/* Tabulator v4.2.3 (c) Oliver Folkerd */ var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Tabulator=e()}(this,function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;ni?(o=t-i,this.element.style.marginLeft=-o+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()},t.prototype.generateColumnsFromRowData=function(t){var e,o,i=[];if(t&&t.length){e=t[0];for(var n in e){var s={field:n,title:n},r=e[n];switch(void 0===r?"undefined":_typeof(r)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(r)?"array":"string";break;default:o=isNaN(r)||""===r?r.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(t,e){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),t.forEach(function(t,e){o._addColumn(t)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},t.prototype._addColumn=function(t,e,o){var n=new i(t,this),s=n.getElement(),r=o?this.findColumnIndex(o):o;if(o&&r>-1){var a=this.columns.indexOf(o.getTopColumn()),l=o.getElement();e?(this.columns.splice(a,0,n),l.parentNode.insertBefore(s,l)):(this.columns.splice(a+1,0,n),l.parentNode.insertBefore(s,l.nextSibling))}else e?(this.columns.unshift(n),this.headersElement.insertBefore(n.getElement(),this.headersElement.firstChild)):(this.columns.push(n),this.headersElement.appendChild(n.getElement()));return n},t.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},t.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},t.prototype._verticalAlignHeaders=function(){var t=this,e=0;t.columns.forEach(function(t){var o;t.clearVerticalAlign(),(o=t.getHeight())>e&&(e=o)}),t.columns.forEach(function(o){o.verticalAlign(t.table.options.columnVertAlign,e)}),t.rowManager.adjustTableSize()},t.prototype.findColumn=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t)))return this.columnsByField[t]||!1;if(t instanceof i)return t;if(t instanceof o)return t._getSelf()||!1;if(t instanceof HTMLElement){return e.columns.find(function(e){return e.element===t})||!1}return!1},t.prototype.getColumnByField=function(t){return this.columnsByField[t]},t.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},t.prototype.getFirstVisibileColumn=function(t){var t=this.columnsByIndex.findIndex(function(t){return t.visible});return t>-1&&this.columnsByIndex[t]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(e){return t===e})},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(t){this.columnsByIndex.forEach(function(e,o){t(e,o)})},t.prototype.getDefinitions=function(t){var e=this,o=[];return e.columnsByIndex.forEach(function(e){(!t||t&&e.visible)&&o.push(e.getDefinition())}),o},t.prototype.getDefinitionTree=function(){var t=this,e=[];return t.columns.forEach(function(t){e.push(t.getDefinition(!0))}),e},t.prototype.getComponents=function(t){var e=this,o=[];return(t?e.columns:e.columnsByIndex).forEach(function(t){o.push(t.getComponent())}),o},t.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(e){e.visible&&(t+=e.getWidth())}),t},t.prototype.moveColumn=function(t,e,o){this._moveColumnInArray(this.columns,t,e,o),this._moveColumnInArray(this.columnsByIndex,t,e,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistentLayout&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("columns")},t.prototype._moveColumnInArray=function(t,e,o,i,n){var s,r=t.indexOf(e);r>-1&&(t.splice(r,1),s=t.indexOf(o),s>-1?i&&(s+=1):s=r,t.splice(s,0,e),n&&this.table.rowManager.rows.forEach(function(t){if(t.cells.length){var e=t.cells.splice(r,1)[0];t.cells.splice(s,0,e)}}))},t.prototype.scrollToColumn=function(t,e,o){var i=this,n=0,s=0,r=0,a=t.getElement();return new Promise(function(l,c){if(void 0===e&&(e=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":r=-i.element.clientWidth/2;break;case"right":r=a.clientWidth-i.headersElement.clientWidth}if(!o&&(s=a.offsetLeft)>0&&s+a.offsetWidtht.rowManager.element.clientHeight&&(e-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,s,r;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?t.table.options.columnMinWidth:parseInt(i.minWidth),r="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,o+=r>s?r:s)}),o},t.prototype.addColumn=function(t,e,o){var i=this._addColumn(t,e,o);this._reIndexColumns(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),this.redraw(),"fitColumns"!=this.table.modules.layout.getMode()&&i.reinitializeWidth(),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.deregisterColumn=function(t){var e,o=t.getField();o&&delete this.columnsByField[o],e=this.columnsByIndex.indexOf(t),e>-1&&this.columnsByIndex.splice(e,1),e=this.columns.indexOf(t),e>-1&&this.columns.splice(e,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},t.prototype.redraw=function(t){t&&(u.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),"fitColumns"==this.table.modules.layout.getMode()?this.table.modules.layout.layout():t?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistentLayout&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var o=function(t){this._column=t,this.type="ColumnComponent"};o.prototype.getElement=function(){return this._column.getElement()},o.prototype.getDefinition=function(){return this._column.getDefinition()},o.prototype.getField=function(){return this._column.getField()},o.prototype.getCells=function(){var t=[];return this._column.cells.forEach(function(e){t.push(e.getComponent())}),t},o.prototype.getVisibility=function(){return this._column.visible},o.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()},o.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()},o.prototype.toggle=function(){this._column.visible?this.hide():this.show()},o.prototype.delete=function(){this._column.delete()},o.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(e){t.push(e.getComponent())}),t},o.prototype.getParentColumn=function(){return this._column.parent instanceof i&&this._column.parent.getComponent()},o.prototype._getSelf=function(){return this._column},o.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},o.prototype.getTable=function(){return this._column.table},o.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},o.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},o.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)},o.prototype.getNextColumn=function(){return this._column.nextColumn().getComponent()},o.prototype.getPrevColumn=function(){return this._column.prevColumn().getComponent()};var i=function t(e,o){var i=this;this.table=o.table,this.definition=e,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.setField(this.definition.field),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,e.columns?(this.isGroup=!0,e.columns.forEach(function(e,o){var n=new t(e,i);i.attachColumn(n)}),i.checkColumnVisibility()):o.registerColumnField(this),e.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader()};i.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t},i.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t},i.prototype.setField=function(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNesteData:this._setFlatData},i.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)},i.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)},i.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)},i.prototype.setTooltip=function(){var t=this,e=t.definition,o=e.headerTooltip||!1===e.tooltip?e.headerTooltip:t.table.options.tooltipsHeader;o?!0===o?e.field?t.table.modules.localize.bind("columns|"+e.field,function(o){t.element.setAttribute("title",o||e.title)}):t.element.setAttribute("title",e.title):("function"==typeof o&&!1===(o=o(t.getComponent()))&&(o=""),t.element.setAttribute("title",o)):t.element.setAttribute("title","")},i.prototype._buildHeader=function(){for(var t=this,e=t.definition;t.element.firstChild;)t.element.removeChild(t.element.firstChild);e.headerVertical&&(t.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&t.element.classList.add("tabulator-col-vertical-flip")),t.contentElement=t._bindEvents(),t.contentElement=t._buildColumnHeaderContent(),t.element.appendChild(t.contentElement),t.isGroup?t._buildGroupHeader():t._buildColumnHeader(),t.setTooltip(),t.table.options.resizableColumns&&t.table.modExists("resizeColumns")&&t.table.modules.resizeColumns.initializeColumn("header",t,t.element),e.headerFilter&&t.table.modExists("filter")&&t.table.modExists("edit")&&(void 0!==e.headerFilterPlaceholder&&e.field&&t.table.modules.localize.setHeaderFilterColumnPlaceholder(e.field,e.headerFilterPlaceholder),t.table.modules.filter.initializeColumn(t)),t.table.modExists("frozenColumns")&&t.table.modules.frozenColumns.initializeColumn(t),t.table.options.movableColumns&&!t.isGroup&&t.table.modExists("moveColumn")&&t.table.modules.moveColumn.initializeColumn(t),(e.topCalc||e.bottomCalc)&&t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.initializeColumn(t),t.element.addEventListener("mouseenter",function(e){t.setTooltip()})},i.prototype._bindEvents=function(){var t,e,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",function(t){n.headerClick(t,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",function(t){n.headerDblClick(t,i.getComponent())}),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",function(t){n.headerContext(t,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0}),i.element.addEventListener("touchend",function(t){o&&n.headerTap(t,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,n.headerDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),"function"==typeof n.headerTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,n.headerTapHold(t,i.getComponent())},1e3)}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null})),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},i.prototype._buildColumnHeader=function(){var t=this,e=t.definition,o=t.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(t,t.contentElement),o.modExists("format")&&o.modules.format.initializeColumn(t),void 0!==e.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(t),void 0!==e.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(t),o.modExists("mutator")&&o.modules.mutator.initializeColumn(t),o.modExists("accessor")&&o.modules.accessor.initializeColumn(t),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(t),void 0!==e.visible&&(e.visible?t.show(!0):t.hide(!0)),e.cssClass){e.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)})}e.field&&this.element.setAttribute("tabulator-field",e.field),t.setMinWidth(void 0===e.minWidth?t.table.options.columnMinWidth:parseInt(e.minWidth)),t.reinitializeWidth(),t.tooltip=t.definition.tooltip||!1===t.definition.tooltip?t.definition.tooltip:t.table.options.tooltips,t.hozAlign=void 0===t.definition.align?"":t.definition.align},i.prototype._buildColumnHeaderContent=function(){var t=this,e=(t.definition,t.table,document.createElement("div"));return e.classList.add("tabulator-col-content"),e.appendChild(t._buildColumnHeaderTitle()),e},i.prototype._buildColumnHeaderTitle=function(){var t=this,e=t.definition,o=t.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),e.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",function(t){t.stopPropagation(),n.focus()}),n.addEventListener("change",function(){e.title=n.value,o.options.columnTitleChanged.call(t.table,t.getComponent())}),i.appendChild(n),e.field?o.modules.localize.bind("columns|"+e.field,function(t){n.value=t||e.title||" "}):n.value=e.title||" "}else e.field?o.modules.localize.bind("columns|"+e.field,function(o){t._formatColumnHeaderTitle(i,o||e.title||" ")}):t._formatColumnHeaderTitle(i,e.title||" ");return i},i.prototype._formatColumnHeaderTitle=function(t,e){var o,i,n,s;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),s={getValue:function(){return e},getElement:function(){return t}},n=this.definition.titleFormatterParams||{},n="function"==typeof n?n():n,i=o.call(this.table.modules.format,s,n),void 0===i?"undefined":_typeof(i)){case"object":i instanceof Node?this.element.appendChild(i):(this.element.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":this.element.innerHTML="";break;default:this.element.innerHTML=i}else t.innerHTML=e},i.prototype._buildGroupHeader=function(){this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.element.appendChild(this.groupElement)},i.prototype._getFlatData=function(t){return t[this.field]},i.prototype._getNestedData=function(t){for(var e,o=t,i=this.fieldStructure,n=i.length,s=0;s-1&&this.table.columnManager.getColumnByIndex(t+1)},i.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this.table.columnManager.getColumnByIndex(t-1)},i.prototype.reinitializeWidth=function(t){this.widthFixed=!1,void 0===this.definition.width||t||this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()},i.prototype.fitToData=function(){var t=this;this.widthFixed||(this.element.style.width="",t.cells.forEach(function(t){t.clearWidth()}));var e=this.element.offsetWidth;t.width&&this.widthFixed||(t.cells.forEach(function(t){var o=t.getWidth();o>e&&(e=o)}),e&&t.setWidthActual(e+1))},i.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},i.prototype.defaultOptionList=["title","field","visible","align","width","minWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter"],i.prototype.getComponent=function(){return new o(this)};var n=function(t){this.table=t,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="classic",this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]};n.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t},n.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t},n.prototype.getElement=function(){return this.element},n.prototype.getTableElement=function(){return this.tableElement},n.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},n.prototype.setColumnManager=function(t){this.columnManager=t},n.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRender=!0,t.element.addEventListener("scroll",function(){var e=t.element.scrollLeft;t.scrollLeft!=e&&(t.columnManager.scrollHorizontal(e),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(e),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(e)),t.scrollLeft=e}),"virtual"===this.renderMode&&t.element.addEventListener("scroll",function(){var e=t.element.scrollTop,o=t.scrollTop>e;t.scrollTop!=e?(t.scrollTop=e,t.scrollVertical(o),"scroll"==t.table.options.ajaxProgressiveLoad&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-e)):t.scrollTop=e})},n.prototype.findRow=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t))){if(void 0===t||null===t)return!1;return e.rows.find(function(o){return o.data[e.table.options.index]==t})||!1}if(t instanceof r)return t;if(t instanceof s)return t._getSelf()||!1;if(t instanceof HTMLElement){return e.rows.find(function(e){return e.element===t})||!1}return!1},n.prototype.getRowFromDataObject=function(t){return this.rows.find(function(e){return e.data===t})||!1},n.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},n.prototype.scrollToRow=function(t,e,o){var i,n=this,s=this.getDisplayRows().indexOf(t),r=t.getElement(),a=0;return new Promise(function(t,l){if(s>-1){if(void 0===e&&(e=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===e)switch(n.renderMode){case"classic":i=u.prototype.helpers.elOffset(r).top,e=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":e=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top"}if(!o&&u.prototype.helpers.elVisible(r)&&(a=u.prototype.helpers.elOffset(r).top-u.prototype.helpers.elOffset(n.element).top)>0&&a-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(e){var o=e.indexOf(t);o>-1&&e.splice(o,1)}),e||this.reRenderInPosition(),this.table.options.rowDeleted.call(this.table,t.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")},n.prototype.addRow=function(t,e,o,i){var n=this.addRowActual(t,e,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:t,pos:e,index:o}),n},n.prototype.addRows=function(t,e,o){var i=this,n=this,s=0,r=[];return new Promise(function(a,l){e=i.findAddRowPos(e),Array.isArray(t)||(t=[t]),s=t.length-1,(void 0===o&&e||void 0!==o&&!e)&&t.reverse(),t.forEach(function(t,i){var s=n.addRow(t,e,o,!0);r.push(s)}),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),a(r)})},n.prototype.findAddRowPos=function(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t},n.prototype.addRowActual=function(t,e,o,i){var n,s=t instanceof r?t:new r(t||{},this),a=this.findAddRowPos(e);if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(n=this.getDisplayRows(),a?n.length?o=n[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],a=!1):n.length&&(o=n[n.length-1],a=!(n.length1&&(!o||o&&-1==l.indexOf(o)?a?l[0]!==s&&(o=l[0],this._moveRowInArray(s.getGroup().rows,s,o,a)):l[l.length-1]!==s&&(o=l[l.length-1],this._moveRowInArray(s.getGroup().rows,s,o,a)):this._moveRowInArray(s.getGroup().rows,s,o,a))}if(o){var c=this.rows.indexOf(o),u=this.activeRows.indexOf(o);this.displayRowIterator(function(t){var e=t.indexOf(o);e>-1&&t.splice(a?e:e+1,0,s)}),u>-1&&this.activeRows.splice(a?u:u+1,0,s),c>-1&&this.rows.splice(a?c:c+1,0,s)}else a?(this.displayRowIterator(function(t){t.unshift(s)}),this.activeRows.unshift(s),this.rows.unshift(s)):(this.displayRowIterator(function(t){t.push(s)}),this.activeRows.push(s),this.rows.push(s));return this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,s.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),s},n.prototype.moveRow=function(t,e,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",t,{pos:this.getRowPosition(t),to:e,after:o}),this.moveRowActual(t,e,o),this.table.options.rowMoved.call(this.table,t.getComponent())},n.prototype.moveRowActual=function(t,e,o){var i=this;if(this._moveRowInArray(this.rows,t,e,o),this._moveRowInArray(this.activeRows,t,e,o),this.displayRowIterator(function(n){i._moveRowInArray(n,t,e,o)}),this.table.options.groupBy&&this.table.modExists("groupRows")){var n=e.getGroup(),s=t.getGroup();n===s?this._moveRowInArray(n.rows,t,e,o):(s&&s.removeRow(t),n.insertRow(t,e,o))}},n.prototype._moveRowInArray=function(t,e,o,i){var n,s,r,a;if(e!==o&&(n=t.indexOf(e),n>-1&&(t.splice(n,1),s=t.indexOf(o),s>-1?i?t.splice(s+1,0,e):t.splice(s,0,e):t.splice(n,0,e)),t===this.getDisplayRows())){r=nn?s:n+1;for(var l=r;l<=a;l++)t[l]&&this.styleRow(t[l],l)}},n.prototype.clearData=function(){this.setData([])},n.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)},n.prototype.getDisplayRowIndex=function(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e},n.prototype.nextDisplayRow=function(t,e){var o=this.getDisplayRowIndex(t),i=!1;return!1!==o&&o-1)&&o},n.prototype.getData=function(t,e){var o=this,i=[];return(t?o.activeRows:o.rows).forEach(function(t){i.push(t.getData(e||"data"))}),i},n.prototype.getHtml=function(t){var e=this.getData(t),o=[],i="",n="";return this.table.columnManager.getColumns().forEach(function(t){var e=t.getDefinition();t.visible&&!e.hideInHtml&&(i+=""+(e.title||"")+"",o.push(t))}),e.forEach(function(t){var e="";o.forEach(function(o){var i=o.getFieldValue(t);void 0!==i&&null!==i||(i=":"),e+=""+i+""}),n+=""+e+""}),"\n\n\t\t\t\n\n\t\t\t"+i+"\n\n\t\t\t\n\n\t\t\t"+n+"\n\n\t\t\t
"},n.prototype.getComponents=function(t){var e=this,o=[];return(t?e.activeRows:e.rows).forEach(function(t){o.push(t.getComponent())}),o},n.prototype.getDataCount=function(t){return t?this.rows.length:this.activeRows.length},n.prototype._genRemoteRequest=function(){var t=this,e=t.table,o=e.options,i={};if(e.modExists("page")){if(o.ajaxSorting){var n=t.table.modules.sort.getSort();n.forEach(function(t){delete t.column}),i[t.table.modules.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=t.table.modules.filter.getFilters(!0,!0);i[t.table.modules.page.paginationDataSentNames.filters]=s}t.table.modules.ajax.setParams(i,!0)}e.modules.ajax.sendRequest().then(function(e){t.setData(e)}).catch(function(t){})},n.prototype.filterRefresh=function(){var t=this.table,e=t.options,o=this.scrollLeft;e.ajaxFiltering?"remote"==e.pagination&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):e.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},n.prototype.sorterRefresh=function(t){var e=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?("remote"==o.pagination||o.progressiveLoad)&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(t?"filter":"sort"),this.scrollHorizontal(i)},n.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft=t,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(t),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(t)},n.prototype.refreshActiveData=function(t,e,o){var i,n=this,s=this.table;switch(n.table.modExists("edit")&&n.table.modules.edit.cancelEdit(),t||(t="all"),s.options.selectable&&!s.options.selectablePersistence&&s.modExists("selectRow")&&s.modules.selectRow.deselectRows(),t){case"all":case"filter":e?e=!1:s.modExists("filter")?n.setActiveRows(s.modules.filter.filter(n.rows)):n.setActiveRows(n.rows.slice(0));case"sort":e?e=!1:s.modExists("sort")&&s.modules.sort.sort(this.activeRows);case"display":this.resetDisplayRows();case"freeze":e?e=!1:this.table.modExists("frozenRows")&&s.modules.frozenRows.isFrozen()&&(s.modules.frozenRows.getDisplayIndex()||s.modules.frozenRows.setDisplayIndex(this.getNextDisplayIndex()),i=s.modules.frozenRows.getDisplayIndex(),!0!==(i=n.setDisplayRows(s.modules.frozenRows.getRows(this.getDisplayRows(i-1)),i))&&s.modules.frozenRows.setDisplayIndex(i));case"group":e?e=!1:s.options.groupBy&&s.modExists("groupRows")&&(s.modules.groupRows.getDisplayIndex()||s.modules.groupRows.setDisplayIndex(this.getNextDisplayIndex()),i=s.modules.groupRows.getDisplayIndex(),!0!==(i=n.setDisplayRows(s.modules.groupRows.getRows(this.getDisplayRows(i-1)),i))&&s.modules.groupRows.setDisplayIndex(i));case"tree":e?e=!1:s.options.dataTree&&s.modExists("dataTree")&&(s.modules.dataTree.getDisplayIndex()||s.modules.dataTree.setDisplayIndex(this.getNextDisplayIndex()),i=s.modules.dataTree.getDisplayIndex(),!0!==(i=n.setDisplayRows(s.modules.dataTree.getRows(this.getDisplayRows(i-1)),i))&&s.modules.dataTree.setDisplayIndex(i)),s.options.pagination&&s.modExists("page")&&!o&&"local"==s.modules.page.getMode()&&s.modules.page.reset();case"page":e?e=!1:s.options.pagination&&s.modExists("page")&&(s.modules.page.getDisplayIndex()||s.modules.page.setDisplayIndex(this.getNextDisplayIndex()),i=s.modules.page.getDisplayIndex(),"local"==s.modules.page.getMode()&&s.modules.page.setMaxRows(this.getDisplayRows(i-1).length),!0!==(i=n.setDisplayRows(s.modules.page.getRows(this.getDisplayRows(i-1)),i))&&s.modules.page.setDisplayIndex(i))}u.prototype.helpers.elVisible(n.element)&&(o?n.reRenderInPosition():(n.renderTable(),s.options.layoutColumnsOnNewData&&n.table.columnManager.redraw(!0))),s.modExists("columnCalcs")&&s.modules.columnCalcs.recalc(this.activeRows)},n.prototype.setActiveRows=function(t){this.activeRows=t,this.activeRowsCount=this.activeRows.length},n.prototype.resetDisplayRows=function(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length,this.table.modExists("frozenRows")&&this.table.modules.frozenRows.setDisplayIndex(0),this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.setDisplayIndex(0),this.table.options.pagination&&this.table.modExists("page")&&this.table.modules.page.setDisplayIndex(0)},n.prototype.getNextDisplayIndex=function(){return this.displayRows.length},n.prototype.setDisplayRows=function(t,e){var o=!0;return e&&void 0!==this.displayRows[e]?(this.displayRows[e]=t,o=!0):(this.displayRows.push(t),o=e=this.displayRows.length-1),e==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length),o},n.prototype.getDisplayRows=function(t){return void 0===t?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[t]||[]},n.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},n.prototype.getRows=function(){return this.rows},n.prototype.reRenderInPosition=function(t){if("virtual"==this.getRenderMode()){for(var e=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(s[r]){var a=e-s[r].getElement().offsetTop;if(!(!1===i||Math.abs(a)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*g),"group"!==f.type&&(d=!1),i.vDomBottom++,c++}t?(i.vDomTopPad=e?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-l,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-a-l,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((a+l)/c),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=l+a+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",e&&(this.scrollTop=i.vDomTopPad+l+o-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&e&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop=this.scrollTop,n.style.minWidth=d?i.table.columnManager.getWidth()+"px":"",i.table.options.groupBy&&"fitDataFill"!=i.table.modules.layout.getMode()&&i.displayRowsCount==i.table.modules.groupRows.countGroups()&&(i.tableElement.style.minWidth=i.table.columnManager.getWidth())}else this.renderEmptyScroll()},n.prototype.scrollVertical=function(t){var e=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-e>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else t?(e<0&&this._addTopRow(-e),o<0&&this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer&&this._removeBottomRow(-o)):(e>=0&&this.scrollTop>this.vDomWindowBuffer&&this._removeTopRow(e),o>=0&&this._addBottomRow(o))},n.prototype._addTopRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var n=this.vDomTop-1,s=i[n],r=s.getHeight()||this.vDomRowHeight;t>=r&&(this.styleRow(s,n),o.insertBefore(s.getElement(),o.firstChild),s.initialized&&s.heightInitialized||(this.vDomTopNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomTopPad-=r,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=r,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),e=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,e+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},n.prototype._removeTopRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(t>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,e.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,t=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(t)}},n.prototype._addBottomRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=r&&(this.styleRow(s,n),o.appendChild(s.getElement()),s.initialized&&s.heightInitialized||(this.vDomBottomNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomBottomPad-=r,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=r,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),e=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,e+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},n.prototype._removeBottomRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(t>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),e.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,t=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(t)}},n.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()}),t.length=0},n.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.normalizeHeight()})},n.prototype.adjustTableSize=function(){if("virtual"===this.renderMode){this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height;var t=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight:0);this.element.style.minHeight="calc(100% - "+t+"px)",this.element.style.height="calc(100% - "+t+"px)",this.element.style.maxHeight="calc(100% - "+t+"px)"}},n.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize()})},n.prototype.redraw=function(t){var e=this.scrollLeft;this.adjustTableSize(),t?this.renderTable():("classic"==self.renderMode?self.table.options.groupBy?self.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(e)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},n.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))};var s=function(t){this._row=t};s.prototype.getData=function(t){return this._row.getData(t)},s.prototype.getElement=function(){return this._row.getElement()},s.prototype.getCells=function(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t},s.prototype.getCell=function(t){var e=this._row.getCell(t);return!!e&&e.getComponent()},s.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},s.prototype.getPosition=function(t){return this._row.table.rowManager.getRowPosition(this._row,t)},s.prototype.delete=function(){return this._row.delete()},s.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},s.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},s.prototype.move=function(t,e){this._row.moveToRow(t,e)},s.prototype.update=function(t){return this._row.updateData(t)},s.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},s.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},s.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},s.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},s.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},s.prototype._getSelf=function(){return this._row},s.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},s.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},s.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},s.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},s.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},s.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},s.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},s.prototype.reformat=function(){return this._row.reinitialize()},s.prototype.getGroup=function(){return this._row.getGroup().getComponent()},s.prototype.getTable=function(){return this._row.table},s.prototype.getNextRow=function(){var t=this._row.nextRow();return t?t.getComponent():t},s.prototype.getPrevRow=function(){var t=this._row.prevRow();return t?t.getComponent():t};var r=function(t,e){this.table=e.table,this.parent=e,this.data={},this.type="row",this.element=this.createElement(),this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.setData(t),this.generateElement()};r.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.setAttribute("role","row"),t},r.prototype.getElement=function(){return this.element},r.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},r.prototype.generateElement=function(){var t,e,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(t){i.table.options.rowClick(t,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(t){i.table.options.rowDblClick(t,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(t){i.table.options.rowContext(t,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(t){i.table.options.rowMouseEnter(t,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(t){i.table.options.rowMouseLeave(t,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(t){i.table.options.rowMouseOver(t,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(t){i.table.options.rowMouseOut(t,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(t){i.table.options.rowMouseMove(t,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0}),i.element.addEventListener("touchend",function(t){o&&i.table.options.rowTap(t,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,i.table.options.rowDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.table.options.rowTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,i.table.options.rowTapHold(t,i.getComponent())},1e3)}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null}))},r.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},r.prototype.initialize=function(t){var e=this;if(!e.initialized||t){for(e.deleteCells();e.element.firstChild;)e.element.removeChild(e.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),e.cells.forEach(function(t){e.element.appendChild(t.getElement()),t.cellRendered()}),t&&e.normalizeHeight(),e.table.options.dataTree&&e.table.modExists("dataTree")&&e.table.modules.dataTree.layoutRow(this),"collapse"===e.table.options.responsiveLayout&&e.table.modExists("responsiveLayout")&&e.table.modules.responsiveLayout.layoutRow(this),e.table.options.rowFormatter&&e.table.options.rowFormatter(e.getComponent()),e.table.options.resizableRows&&e.table.modExists("resizeRows")&&e.table.modules.resizeRows.initializeRow(e),e.initialized=!0}},r.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},r.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},r.prototype.calcHeight=function(t){var e=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(t){var o=t.getHeight();o>e&&(e=o)}),this.height=t?Math.max(e,o):this.manualHeight?this.height:Math.max(e,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},r.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0},r.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})},r.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()},r.prototype.setHeight=function(t,e){(this.height!=t||e)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},r.prototype.getHeight=function(){return this.outerHeight},r.prototype.getWidth=function(){return this.element.offsetWidth},r.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},r.prototype.setData=function(t){this.table.modExists("mutator")&&(t=this.table.modules.mutator.transformRow(t,"data")),this.data=t,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},r.prototype.updateData=function(t){var e=this,o=this,i=u.prototype.helpers.elVisible(this.element);return new Promise(function(n,s){"string"==typeof t&&(t=JSON.parse(t)),e.table.options.reactiveData&&e.table.modExists("reactiveData",!0)&&e.table.modules.reactiveData.block(),o.table.modExists("mutator")&&(t=o.table.modules.mutator.transformRow(t,"data",!0));for(var r in t)o.data[r]=t[r];e.table.options.reactiveData&&e.table.modExists("reactiveData",!0)&&e.table.modules.reactiveData.unblock();for(var r in t){var a=e.getCell(r);a&&a.getValue()!=t[r]&&(a.setValueProcessData(t[r]),i&&a.cellRendered())}i?(o.normalizeHeight(),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(e.initialized=!1,e.height=0,e.heightStyled=""),!1!==o.table.options.dataTree&&o.table.modExists("dataTree")&&void 0!==t[e.table.modules.dataTree.getChildField()]&&(e.table.modules.dataTree.initializeRow(e),e.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(e.table,o.getComponent()),n()})},r.prototype.getData=function(t){var e=this;return t?e.table.modExists("accessor")?e.table.modules.accessor.transformRow(e.data,t):void 0:this.data},r.prototype.getCell=function(t){return t=this.table.columnManager.findColumn(t),this.cells.find(function(e){return e.column===t})},r.prototype.getCellIndex=function(t){return this.cells.findIndex(function(e){return e===t})},r.prototype.findNextEditableCell=function(t){var e=!1;if(t0)for(var o=t-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&u.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){e=i;break}}return e}, r.prototype.getCells=function(){return this.cells},r.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},r.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},r.prototype.moveToRow=function(t,e){var o=this.table.rowManager.findRow(t);o?(this.table.rowManager.moveRowActual(this,o,!e),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)},r.prototype.delete=function(){var t=this;return new Promise(function(e,o){var i=t.table.rowManager.getRowIndex(t);t.deleteActual(),t.table.options.history&&t.table.modExists("history")&&(i&&(i=t.table.rowManager.rows[i-1]),t.table.modules.history.action("rowDelete",t,{data:t.getData(),pos:!i,index:i})),e()})},r.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this);this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.modules.group&&this.modules.group.removeRow(this),this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))},r.prototype.deleteCells=function(){for(var t=this.cells.length,e=0;e-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1)},u.prototype.setDataFromLocalFile=function(t){var e=this;return new Promise(function(o,i){var n=document.createElement("input");n.type="file",n.accept=t||".json,application/json",n.addEventListener("change",function(t){var s,r=n.files[0],a=new FileReader;a.readAsText(r),a.onload=function(t){try{s=JSON.parse(a.result)}catch(t){return console.warn("File Load Error - File contents is invalid JSON",t),void i(t)}e._setData(s).then(function(t){o(t)}).catch(function(t){o(t)})},a.onerror=function(t){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},u.prototype.setData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o)},u.prototype._setData=function(t,e,o,i){var n=this;return"string"!=typeof t?t?n.rowManager.setData(t,i):n.modExists("ajax")&&(n.modules.ajax.getUrl||n.options.ajaxURLGenerator)?"remote"==n.options.pagination&&n.modExists("page",!0)?(n.modules.page.reset(!0),n.modules.page.setPage(1)):n.modules.ajax.loadData(i):n.rowManager.setData([],i):0==t.indexOf("{")||0==t.indexOf("[")?n.rowManager.setData(JSON.parse(t),i):n.modExists("ajax",!0)?(e&&n.modules.ajax.setParams(e),o&&n.modules.ajax.setConfig(o),n.modules.ajax.setUrl(t),"remote"==n.options.pagination&&n.modExists("page",!0)?(n.modules.page.reset(!0),n.modules.page.setPage(1)):n.modules.ajax.loadData(i)):void 0},u.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},u.prototype.getData=function(t){return this.rowManager.getData(t)},u.prototype.getDataCount=function(t){return this.rowManager.getDataCount(t)},u.prototype.searchRows=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,e,o)},u.prototype.searchData=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,e,o)},u.prototype.getHtml=function(t){return this.rowManager.getHtml(t)},u.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},u.prototype.replaceData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!0)},u.prototype.updateData=function(t){var e=this,o=this,i=0;return new Promise(function(n,s){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=o.rowManager.findRow(t[o.options.index]);e&&(i++,e.updateData(t).then(function(){--i||n()}))}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},u.prototype.addData=function(t,e,o){var i=this;return new Promise(function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?i.rowManager.addRows(t,e,o).then(function(t){var e=[];t.forEach(function(t){e.push(t.getComponent())}),n(e)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},u.prototype.updateOrAddData=function(t){var e=this,o=this,i=[],n=0;return new Promise(function(s,r){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=o.rowManager.findRow(t[o.options.index]);n++,e?e.updateData(t).then(function(){n--,i.push(e.getComponent()),n||s(i)}):o.rowManager.addRows(t).then(function(t){n--,i.push(t[0].getComponent()),n||s(i)})}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})},u.prototype.getRow=function(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},u.prototype.getRowFromPosition=function(t,e){var o=this.rowManager.getRowFromPosition(t,e);return o?o.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},u.prototype.deleteRow=function(t){var e=this;return new Promise(function(o,i){var n=e.rowManager.findRow(t);n?n.delete().then(function(){o()}).catch(function(t){i(t)}):(console.warn("Delete Error - No matching row found:",t),i("Delete Error - No matching row found"))})},u.prototype.addRow=function(t,e,o){var i=this;return new Promise(function(n,s){"string"==typeof t&&(t=JSON.parse(t)),i.rowManager.addRows(t,e,o).then(function(t){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(t[0].getComponent())})})},u.prototype.updateOrAddRow=function(t,e){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),s?s.updateData(e).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())}).catch(function(t){n(t)}):s=o.rowManager.addRows(e).then(function(t){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(t[0].getComponent())}).catch(function(t){n(t)})})},u.prototype.updateRow=function(t,e){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),s?s.updateData(e).then(function(){i(s.getComponent())}).catch(function(t){n(t)}):(console.warn("Update Error - No matching row found:",t),n("Update Error - No matching row found"))})},u.prototype.scrollToRow=function(t,e,o){var i=this;return new Promise(function(n,s){var r=i.rowManager.findRow(t);r?i.rowManager.scrollToRow(r,e,o).then(function(){n()}).catch(function(t){s(t)}):(console.warn("Scroll Error - No matching row found:",t),s("Scroll Error - No matching row found"))})},u.prototype.moveRow=function(t,e,o){var i=this.rowManager.findRow(t);i?i.moveToRow(e,o):console.warn("Move Error - No matching row found:",t)},u.prototype.getRows=function(t){return this.rowManager.getComponents(t)},u.prototype.getRowPosition=function(t,e){var o=this.rowManager.findRow(t);return o?this.rowManager.getRowPosition(o,e):(console.warn("Position Error - No matching row found:",t),!1)},u.prototype.copyToClipboard=function(t,e,o,i){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t,e,o,i)},u.prototype.setColumns=function(t){this.columnManager.setColumns(t)},u.prototype.getColumns=function(t){return this.columnManager.getComponents(t)},u.prototype.getColumn=function(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)},u.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},u.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},u.prototype.setColumnLayout=function(t){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0)},u.prototype.showColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Show Error - No matching column found:",t),!1;e.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},u.prototype.hideColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Hide Error - No matching column found:",t),!1;e.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},u.prototype.toggleColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1;e.visible?e.hide():e.show()},u.prototype.addColumn=function(t,e,o){var i=this.columnManager.findColumn(o);this.columnManager.addColumn(t,e,i)},u.prototype.deleteColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Delete Error - No matching column found:",t),!1;e.delete()},u.prototype.scrollToColumn=function(t,e,o){var i=this;return new Promise(function(n,s){var r=i.columnManager.findColumn(t);r?i.columnManager.scrollToColumn(r,e,o).then(function(){n()}).catch(function(t){s(t)}):(console.warn("Scroll Error - No matching column found:",t),s("Scroll Error - No matching column found"))})},u.prototype.setLocale=function(t){this.modules.localize.setLocale(t)},u.prototype.getLocale=function(){return this.modules.localize.getLocale()}, u.prototype.getLang=function(t){return this.modules.localize.getLang(t)},u.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)},u.prototype.setHeight=function(t){this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.redraw()},u.prototype.setSort=function(t,e){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,e),this.rowManager.sorterRefresh())},u.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},u.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},u.prototype.setFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,e,o),this.rowManager.filterRefresh())},u.prototype.addFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,e,o),this.rowManager.filterRefresh())},u.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)},u.prototype.setHeaderFilterFocus=function(t){if(this.modExists("filter",!0)){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Filter Focus Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterFocus(e)}},u.prototype.setHeaderFilterValue=function(t,e){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(t);if(!o)return console.warn("Column Filter Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterValue(o,e)}},u.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},u.prototype.removeFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,e,o),this.rowManager.filterRefresh())},u.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())},u.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},u.prototype.selectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.selectRows(t)},u.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)},u.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)},u.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},u.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},u.prototype.setMaxPage=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(t)},u.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(t,e){e()})},u.prototype.setPageToRow=function(t){var e=this;return new Promise(function(o,i){e.options.pagination&&e.modExists("page")?(t=e.rowManager.findRow(t),t?e.modules.page.setPageToRow(t).then(function(){o()}).catch(function(){i()}):i()):i()})},u.prototype.setPageSize=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(t),this.modules.page.setPage(1).then(function(){}).catch(function(){})},u.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},u.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},u.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},u.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},u.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},u.prototype.setGroupBy=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display")},u.prototype.setGroupStartOpen=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=t,this.modules.groupRows.initialize(),this.options.groupBy?this.rowManager.refreshActiveData("group"):console.warn("Grouping Update - cant refresh view, no groups have been set")},u.prototype.setGroupHeader=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=t,this.modules.groupRows.initialize(),this.options.groupBy?this.rowManager.refreshActiveData("group"):console.warn("Grouping Update - cant refresh view, no groups have been set")},u.prototype.getGroups=function(t){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},u.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},u.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},u.prototype.navigatePrev=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().prev()},u.prototype.navigateNext=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().next()},u.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},u.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},u.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},u.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().dpwn())},u.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},u.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},u.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},u.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},u.prototype.download=function(t,e,o){this.modExists("download",!0)&&this.modules.download.download(t,e,o)},u.prototype.downloadToTab=function(t,e,o){this.modExists("download",!0)&&this.modules.download.download(t,e,o,!0)},u.prototype.tableComms=function(t,e,o,i){this.modules.comms.receive(t,e,o,i)},u.prototype.moduleBindings={},u.prototype.extendModule=function(t,e,o){if(u.prototype.moduleBindings[t]){var i=u.prototype.moduleBindings[t].prototype[e];if(i)if("object"==(void 0===o?"undefined":_typeof(o)))for(var n in o)i[n]=o[n];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",e)}else console.warn("Module Error - module does not exist:",t)},u.prototype.registerModule=function(t,e){u.prototype.moduleBindings[t]=e},u.prototype.bindModules=function(){this.modules={};for(var t in u.prototype.moduleBindings)this.modules[t]=new u.prototype.moduleBindings[t](this)},u.prototype.modExists=function(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)},u.prototype.helpers={elVisible:function(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)},elOffset:function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(t){var e=Array.isArray(t)?[]:{};for(var o in t)null!=t[o]&&"object"===_typeof(t[o])?t[o]instanceof Date?e[o]=new Date(t[o]):e[o]=this.deepClone(t[o]):e[o]=t[o];return e}},u.prototype.comms={tables:[],register:function(t){u.prototype.comms.tables.push(t)},deregister:function(t){var e=u.prototype.comms.tables.indexOf(t);e>-1&&u.prototype.comms.tables.splice(e,1)},lookupTable:function(t){var e,o,i=[];if("string"==typeof t){if(e=document.querySelectorAll(t),e.length)for(var n=0;n-1?n/100*parseInt(t):parseInt(t):t}function o(t,i,n,s){function r(t){return n*(t.column.definition.widthGrow||1)}function a(t){return e(t.width)-n*(t.column.definition.widthShrink||0)}var l=[],c=0,u=0,d=0,h=0,p=0,m=[];return t.forEach(function(t,e){var o=s?a(t):r(t);t.column.minWidth>=o?l.push(t):(m.push(t),p+=s?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),l.length?(l.forEach(function(t){c+=s?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),u=i-c,d=p?Math.floor(u/p):u,h=u-d*p,h+=o(m,u,d,s)):(h=p?i-Math.floor(i/p)*p:i,m.forEach(function(t){t.width=s?a(t):r(t)})),h}var i=this,n=i.table.element.clientWidth,s=0,r=0,a=0,l=0,c=[],u=[],d=0,h=0,p=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach(function(t){var o,i,n;t.visible&&(o=t.definition.width,i=parseInt(t.minWidth),o?(n=e(o),s+=n>i?n:i,t.definition.widthShrink&&(u.push({column:t,width:n>i?n:i}),d+=t.definition.widthShrink)):(c.push({column:t,width:0}),a+=t.definition.widthGrow||1))}),r=n-s,l=Math.floor(r/a);var p=o(c,r,l,!1);c.length&&p>0&&(c[c.length-1].width+=+p),c.forEach(function(t){r-=t.width}),h=Math.abs(p)+r,h>0&&d&&(p=o(u,h,Math.floor(h/d),!0)),u.length&&(u[u.length-1].width-=p),c.forEach(function(t){t.column.setWidth(t.width)}),u.forEach(function(t){t.column.setWidth(t.width)})}},u.prototype.registerModule("layout",d);var h=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={}};h.prototype.setHeaderFilterPlaceholder=function(t){this.langs.default.headerFilters.default=t},h.prototype.setHeaderFilterColumnPlaceholder=function(t,e){this.langs.default.headerFilters.columns[t]=e,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=e)},h.prototype.installLang=function(t,e){this.langs[t]?this._setLangProp(this.langs[t],e):this.langs[t]=e},h.prototype._setLangProp=function(t,e){for(var o in e)t[o]&&"object"==_typeof(t[o])?this._setLangProp(t[o],e[o]):t[o]=e[o]},h.prototype.setLocale=function(t){function e(t,o){for(var i in t)"object"==_typeof(t[i])?(o[i]||(o[i]={}),e(t[i],o[i])):o[i]=t[i]}var o=this;if(t=t||"default",!0===t&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!o.langs[t]){var i=t.split("-")[0];o.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i),t=i):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}o.locale=t,o.lang=u.prototype.helpers.deepClone(o.langs.default||{}),"default"!=t&&e(o.langs[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},h.prototype.getLocale=function(t){return self.locale},h.prototype.getLang=function(t){return t?this.langs[t]:this.lang},h.prototype.getText=function(t,e){var t=e?t+"|"+e:t,o=t.split("|");return this._getLangElement(o,this.locale)||""},h.prototype._getLangElement=function(t,e){var o=this,i=o.lang;return t.forEach(function(t){var e;i&&(e=i[t],i=void 0!==e&&e)}),i},h.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},h.prototype._executeBindings=function(){var t=this;for(var e in t.bindings)!function(e){t.bindings[e].forEach(function(o){o(t.getText(e),t.lang)})}(e)},h.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page"},headerFilters:{default:"filter column...",columns:{}}}},u.prototype.registerModule("localize",h);var p=function(t){this.table=t};p.prototype.getConnections=function(t){var e,o=this,i=[];return e=u.prototype.comms.lookupTable(t),e.forEach(function(t){o.table!==t&&i.push(t)}),i},p.prototype.send=function(t,e,o,i){var n=this,s=this.getConnections(t);s.forEach(function(t){t.tableComms(n.table.element,e,o,i)}),!s.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},p.prototype.receive=function(t,e,o,i){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,o,i);console.warn("Inter-table Comms Error - no such module:",e)},u.prototype.registerModule("comms",p);var m=function(t){this.table=t,this.allowedTypes=["","data","download","clipboard"]};m.prototype.initializeColumn=function(t){var e=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,r="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));t.definition[r]&&(s=e.lookupAccessor(t.definition[r]))&&(o=!0,i[r]={accessor:s,params:t.definition[r+"Params"]||{}})}),o&&(t.modules.accessor=i)},m.prototype.lookupAccessor=function(t){var e=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.accessors[t]?e=this.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":e=t}return e},m.prototype.transformRow=function(t,e){var o=this,i="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),n=u.prototype.helpers.deepClone(t||{});return o.table.columnManager.traverse(function(t){var o,s,r,a;t.modules.accessor&&(s=t.modules.accessor[i]||t.modules.accessor.accessor||!1)&&"undefined"!=(o=t.getFieldValue(n))&&(a=t.getComponent(),r="function"==typeof s.params?s.params(o,n,e,a):s.params,t.setFieldValue(n,s.accessor(o,n,e,r,a)))}),n},m.prototype.accessors={},u.prototype.registerModule("accessor",m);var f=function(t){this.table=t,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};f.prototype.initialize=function(){var t;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(t=document.createElement("template"),t.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=t.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&(this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},f.prototype.createLoaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader"),t},f.prototype.createMsgElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader-msg"),t.setAttribute("role","alert"),t},f.prototype.setParams=function(t,e){if(e){this.params=this.params||{};for(var o in t)this.params[o]=t[o]}else this.params=t},f.prototype.getParams=function(){return this.params||{}},f.prototype.setConfig=function(t){if(this._loadDefaultConfig(),"string"==typeof t)this.config.method=t;else for(var e in t)this.config[e]=t[e]},f.prototype._loadDefaultConfig=function(t){var e=this;if(!e.config||t){e.config={};for(var o in e.defaultConfig)e.config[o]=e.defaultConfig[o]}},f.prototype.setUrl=function(t){this.url=t},f.prototype.getUrl=function(){return this.url},f.prototype.loadData=function(t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(t)},f.prototype.nextPage=function(t){var e;this.loading||(e=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,ti||null===i)&&(i=t)}),null!==i?!1!==n?i.toFixed(n):i:""},min:function(t,e,o){var i=null,n=void 0!==o.precision&&o.precision;return t.forEach(function(t){((t=Number(t))t&&(t=o)}),i.forEach(function(e){var o=e.length;if(o1&&(e.colSpan=t.width),t.height>1&&(e.rowSpan=t.height),e.innerHTML=t.title,v.mapElementStyles(t.element,e,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),o.appendChild(e)}),v.mapElementStyles(v.table.columnManager.getHeadersElement(),o,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.appendChild(o)}),v.htmlElement.appendChild(e)}(y)):function(){var t=document.createElement("tr");e.forEach(function(e){var o=document.createElement("th");o.innerHTML=e.definition.title,v.mapElementStyles(e.getElement(),o,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.appendChild(o)}),v.mapElementStyles(v.table.columnManager.getHeadersElement(),t,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),v.htmlElement.appendChild(document.createElement("thead").appendChild(t))}()),e=this.table.columnManager.columnsByIndex,u=document.createElement("tbody"),window.getComputedStyle&&(d=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),h=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),p=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),m=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),g=this.table.element.getElementsByClassName("tabulator-group")[0],m&&(b=m.getElementsByClassName("tabulator-cell"),f=b[0],b[b.length-1])),i.rowGroups?t.forEach(function(t){c(t,o||{})}):(i.columnCalcs&&a(o,"top"),l(t),i.columnCalcs&&a(o,"bottom")),this.htmlElement.appendChild(u)},b.prototype.mapElementStyles=function(t,e,o){var i={"background-color":"backgroundColor",color:"fontColor","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(t);o.forEach(function(t){e.style[i[t]]=n.getPropertyValue(t)})}},b.prototype.copySelectors={userSelection:function(t,e){return e},selected:function(t,e){var o=[];return this.table.modExists("selectRow",!0)&&(o=this.table.modules.selectRow.getSelectedRows()),t.rowGroups&&console.warn("Clipboard Warning - select coptSelector does not support row groups"),this.buildOutput(o,t,e)},table:function(t,e){return t.rowGroups&&console.warn("Clipboard Warning - table coptSelector does not support row groups"),this.buildOutput(this.table.rowManager.getComponents(),t,e)},active:function(t,e){var o;return o=t.rowGroups?this.buildComplexRows(t):this.table.rowManager.getComponents(!0),this.buildOutput(o,t,e)}},b.prototype.copyFormatters={raw:function(t,e){return t},table:function(t,e){var o=[];return t.forEach(function(t){t.forEach(function(t){void 0===t&&(t=""),t=void 0===t||null===t?"":t.toString(),t.match(/\r|\n/)&&(t=t.split('"').join('""'),t='"'+t+'"')}),o.push(t.join("\t"))}),o.join("\n")}},b.prototype.pasteParsers={table:function(t){var e=[],o=!0,i=this.table.columnManager.columns,n=[],s=[];return t=t.split("\n"),t.forEach(function(t){e.push(t.split("\t"))}),!(!e.length||1===e.length&&e[0].length<2)&&(!0,e[0].forEach(function(t){var e=i.find(function(e){return t&&e.definition.title&&t.trim()&&e.definition.title.trim()===t.trim()});e?n.push(e):o=!1}),o||(o=!0,n=[],e[0].forEach(function(t){var e=i.find(function(e){return t&&e.field&&t.trim()&&e.field.trim()===t.trim()});e?n.push(e):o=!1}),o||(n=this.table.columnManager.columnsByIndex)),o&&e.shift(),e.forEach(function(t){var e={};t.forEach(function(t,o){n[o]&&(e[n[o].field]=t)}),s.push(e)}),s)}},b.prototype.pasteActions={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}},u.prototype.registerModule("clipboard",b);var v=function(t){this.table=t,this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.displayIndex=0};v.prototype.initialize=function(){var t=null,e=this.table.columnManager.getFirstVisibileColumn(),o=this.table.options;switch(this.field=o.dataTreeChildField,this.indent=o.dataTreeChildIndent,this.elementField=o.dataTreeElementColumn||!!e&&e.field,o.dataTreeBranchElement&&(!0===o.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof o.dataTreeBranchElement?(t=document.createElement("div"),t.innerHTML=o.dataTreeBranchElement,this.branchEl=t.firstChild):this.branchEl=o.dataTreeBranchElement),o.dataTreeCollapseElement?"string"==typeof o.dataTreeCollapseElement?(t=document.createElement("div"),t.innerHTML=o.dataTreeCollapseElement,this.collapseEl=t.firstChild):this.collapseEl=o.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.innerHTML="
"),o.dataTreeExpandElement?"string"==typeof o.dataTreeExpandElement?(t=document.createElement("div"),t.innerHTML=o.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=o.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.innerHTML="
"),_typeof(o.dataTreeStartExpanded)){case"boolean":this.startOpen=function(t,e){return o.dataTreeStartExpanded};break;case"function":this.startOpen=o.dataTreeStartExpanded;break;default:this.startOpen=function(t,e){return o.dataTreeStartExpanded[e]}}},v.prototype.initializeRow=function(t){var e=t.getData()[this.field],o=Array.isArray(e),i=o||!o&&"object"===(void 0===e?"undefined":_typeof(e))&&null!==e;t.modules.dataTree={index:0,open:!!i&&this.startOpen(t.getComponent(),0),controlEl:!1,branchEl:!1,parent:!1,children:i}},v.prototype.layoutRow=function(t){var e=this.elementField?t.getCell(this.elementField):t.getCells()[0],o=e.getElement(),i=t.modules.dataTree;i.branchEl&&i.branchEl.parentNode.removeChild(i.branchEl),this.generateControlElement(t,o),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),o.insertBefore(i.branchEl,o.firstChild),i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):o.style.paddingLeft=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")},v.prototype.generateControlElement=function(t,e){var o=this,i=t.modules.dataTree,e=e||t.getCells()[0].getElement(),n=i.controlEl;!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",function(e){e.stopPropagation(),o.collapseRow(t)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",function(e){e.stopPropagation(),o.expandRow(t)})),i.controlEl.addEventListener("mousedown",function(t){t.stopPropagation()}),n&&n.parentNode===e?n.parentNode.replaceChild(i.controlEl,n):e.insertBefore(i.controlEl,e.firstChild))},v.prototype.setDisplayIndex=function(t){this.displayIndex=t},v.prototype.getDisplayIndex=function(){return this.displayIndex},v.prototype.getRows=function(t){var e=this,o=[];return t.forEach(function(t,i){var n,s;o.push(t),t instanceof r&&(n=t.modules.dataTree.children,n.index||!1===n.children||(s=e.getChildren(t),s.forEach(function(t){o.push(t)})))}),o},v.prototype.getChildren=function(t){var e=this,o=t.modules.dataTree,i=[],n=[];return!1!==o.children&&o.open&&(Array.isArray(o.children)||(o.children=this.generateChildren(t)),i=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,this.table.modExists("sort")&&this.table.modules.sort.sort(i),i.forEach(function(t){n.push(t),e.getChildren(t).forEach(function(t){n.push(t)})})),n},v.prototype.generateChildren=function(t){var e=this,o=[],i=t.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(function(i){var n=new r(i||{},e.table.rowManager);n.modules.dataTree.index=t.modules.dataTree.index+1,n.modules.dataTree.parent=t,n.modules.dataTree.children&&(n.modules.dataTree.open=e.startOpen(n.getComponent(),n.modules.dataTree.index)),o.push(n)}),o},v.prototype.expandRow=function(t,e){var o=t.modules.dataTree;!1!==o.children&&(o.open=!0,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(t.getComponent(),t.modules.dataTree.index))},v.prototype.collapseRow=function(t){var e=t.modules.dataTree;!1!==e.children&&(e.open=!1,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(t.getComponent(),t.modules.dataTree.index))},v.prototype.toggleRow=function(t){var e=t.modules.dataTree;!1!==e.children&&(e.open?this.collapseRow(t):this.expandRow(t))},v.prototype.getTreeParent=function(t){return!!t.modules.dataTree.parent&&t.modules.dataTree.parent.getComponent()},v.prototype.getTreeChildren=function(t){var e=t.modules.dataTree,o=[];return e.children&&(Array.isArray(e.children)||(e.children=this.generateChildren(t)),e.children.forEach(function(t){t instanceof r&&o.push(t.getComponent())})),o},v.prototype.checkForRestyle=function(t){t.row.cells.indexOf(t)||!1!==t.row.modules.dataTree.children&&t.row.reinitialize()},v.prototype.getChildField=function(){return this.field},u.prototype.registerModule("dataTree",v);var y=function(t){this.table=t,this.fields={},this.columnsByIndex=[],this.columnsByField={},this.config={}};y.prototype.download=function(t,e,o,i){function n(o,n){i?!0===i?s.triggerDownload(o,n,t,e,!0):i(o):s.triggerDownload(o,n,t,e)}var s=this,r=!1;this.processConfig(),"function"==typeof t?r=t:s.downloaders[t]?r=s.downloaders[t]:console.warn("Download Error - No such download type found: ",t),this.processColumns(),r&&r.call(this,s.processDefinitions(),s.processData(),o||{},n,this.config)},y.prototype.processConfig=function(){var t={columnGroups:!0,rowGroups:!0,columnCalcs:!0};if(this.table.options.downloadConfig)for(var e in this.table.options.downloadConfig)t[e]=this.table.options.downloadConfig[e];t.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows")&&(this.config.rowGroups=!0),t.columnGroups&&this.table.columnManager.columns.length!=this.table.columnManager.columnsByIndex.length&&(this.config.columnGroups=!0),t.columnCalcs&&this.table.modExists("columnCalcs")&&(this.config.columnCalcs=!0)},y.prototype.processColumns=function(){var t=this;t.columnsByIndex=[],t.columnsByField={},t.table.columnManager.columnsByIndex.forEach(function(e){e.field&&!1!==e.definition.download&&(e.visible||!e.visible&&e.definition.download)&&(t.columnsByIndex.push(e),t.columnsByField[e.field]=e)})},y.prototype.processDefinitions=function(){var t=this,e=[];return this.config.columnGroups?t.table.columnManager.columns.forEach(function(o){var i=t.processColumnGroup(o);i&&e.push(i)}):t.columnsByIndex.forEach(function(o){!1!==o.download&&e.push(t.processDefinition(o))}),e},y.prototype.processColumnGroup=function(t){var e=this,o=t.columns,i=0,n={type:"group",title:t.definition.title,depth:1};if(o.length){if(n.subGroups=[],n.width=0,o.forEach(function(t){var o=e.processColumnGroup(t);o.depth>i&&(i=o.depth),o&&(n.width+=o.width,n.subGroups.push(o))}),n.depth+=i,!n.width)return!1}else{if(!t.field||!1===t.definition.download||!(t.visible||!t.visible&&t.definition.download))return!1;n.width=1,n.definition=this.processDefinition(t)}return n},y.prototype.processDefinition=function(t){var e={};for(var o in t.definition)e[o]=t.definition[o];return void 0!==t.definition.downloadTitle&&(e.title=t.definition.downloadTitle),e},y.prototype.processData=function(){var t=this,e=this,o=[],i=[],n={};return this.config.rowGroups?(i=this.table.modules.groupRows.getGroups(),i.forEach(function(e){o.push(t.processGroupData(e))})):o=e.table.rowManager.getData(!0,"download"),this.config.columnCalcs&&(n=this.table.getCalcResults(),o={calcs:n,data:o}),"function"==typeof e.table.options.downloadDataFormatter&&(o=e.table.options.downloadDataFormatter(o)),o},y.prototype.processGroupData=function(t){var e=this,o=t.getSubGroups(),i={type:"group",key:t.key};return o.length?(i.subGroups=[],o.forEach(function(t){i.subGroups.push(e.processGroupData(t))})):i.rows=t.getData(!0,"download"),i},y.prototype.triggerDownload=function(t,e,o,i,n){var s=document.createElement("a"),r=new Blob([t],{type:e}),i=i||"Tabulator."+("function"==typeof o?"txt":o);(r=this.table.options.downloadReady.call(this.table,t,r))&&(n?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,i):(s.setAttribute("href",window.URL.createObjectURL(r)),s.setAttribute("download",i),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},y.prototype.getFieldValue=function(t,e){var o=this.columnsByField[t];return!!o&&o.getFieldValue(e)},y.prototype.commsReceived=function(t,e,o){switch(e){case"intercept":this.download(o.type,"",o.options,o.intercept)}},y.prototype.downloaders={csv:function(t,e,o,i,n){function s(t,e){t.subGroups?t.subGroups.forEach(function(t){s(t,e+1)}):(d.push('"'+String(t.title).split('"').join('""')+'"'),h.push(t.definition.field))}function r(t){t.forEach(function(t){var e=[];h.forEach(function(o){var i=u.getFieldValue(o,t);switch(void 0===i?"undefined":_typeof(i)){case"object":i=JSON.stringify(i);break;case"undefined":case"null":i="";break;default:i=i}e.push('"'+String(i).split('"').join('""')+'"')}),l.push(e.join(p))})}function a(t){t.subGroups?t.subGroups.forEach(function(t){a(t)}):r(t.rows)}var l,c,u=this,d=[],h=[],p=o&&o.delimiter?o.delimiter:",";n.columnGroups?(console.warn("Download Warning - CSV downloader cannot process column groups"),t.forEach(function(t){s(t,0)})):function(){t.forEach(function(t){d.push('"'+String(t.title).split('"').join('""')+'"'),h.push(t.field)})}(),l=[d.join(p)],n.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),e=e.data),n.rowGroups?(console.warn("Download Warning - CSV downloader cannot process row groups"),e.forEach(function(t){a(t)})):r(e),c=l.join("\n"),o.bom&&(c="\ufeff"+c),i(c,"text/csv")},json:function(t,e,o,i,n){var s;n.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),e=e.data),s=JSON.stringify(e,null,"\t"),i(s,"application/json")},pdf:function(t,e,o,i,n){function s(t,e){var o=t.width,i=1,n={content:t.title||""};if(t.subGroups?(t.subGroups.forEach(function(t){s(t,e+1)}),i=1):(h.push(t.definition.field),i=g-e),n.rowSpan=i,p[e].push(n),o--,i>1)for(var r=e+1;rg&&(g=t.depth)});for(var C=0;C1&&h[e].push({type:"hoz",start:f[e].length,end:f[e].length+t.width-1}),f[e].push(t.title),t.subGroups?t.subGroups.forEach(function(t){o(t,e+1)}):(g.push(t.definition.field),i(g.length),h[e].push({type:"vert",start:g.length-1}))}function i(){var t=0;f.forEach(function(e){var o=e.length;o>t&&(t=o)}),f.forEach(function(e){var o=e.length;if(o0&&l(y[e-1]);break;case 40:t.stopImmediatePropagation(),t.stopPropagation(),e=y.indexOf(E),e-1||String(e.title).toLowerCase().indexOf(String(t).toLowerCase())>-1)&&o.push(e)}),E=o,l(e)}function l(t){for(var e=!1;y.firstChild;)y.removeChild(y.firstChild);E.forEach(function(o){var i=o.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=o.title,i.addEventListener("click",function(){c(o),d()}),i.addEventListener("mousedown",function(){R=!1,setTimeout(function(){R=!0},10)}),o.element=i,t&&o.value==b&&(v.value=o.title,o.element.classList.add("active"),e=!0),o===x&&(o.element.classList.add("active"),e=!0)),y.appendChild(i)}),e||c(!1)}function c(t,e){x&&x.element&&x.element.classList.remove("active"),x=t,t&&t.element&&t.element.classList.add("active")}function d(){m(),x?b!==x.value?(b=x.value,v.value=x.value,o(v.value)):i():n.freetext?(b=v.value,o(v.value)):n.allowEmpty&&""===v.value?(b=v.value,o(v.value)):i()}function h(){m(),i()}function p(){if(!y.parentNode){for(;y.firstChild;)y.removeChild(y.firstChild);C=!0===n.values?s():n.values||[],r(C,b);var t=u.prototype.helpers.elOffset(g);y.style.minWidth=g.offsetWidth+"px",y.style.top=t.top+g.offsetHeight+"px",y.style.left=t.left+"px",document.body.appendChild(y)}}function m(){y.parentNode&&y.parentNode.removeChild(y)}var f=this,g=t.getElement(),b=t.getValue(),v=document.createElement("input"),y=document.createElement("div"),w=[],E=[],C=[],x={},R=!0;return v.setAttribute("type","search"),v.style.padding="4px",v.style.width="100%",v.style.boxSizing="border-box",v.addEventListener("keydown",function(t){var e;switch(t.keyCode){case 38:t.stopImmediatePropagation(),t.stopPropagation(),e=E.indexOf(x),c(e>0?E[e-1]:!1);break;case 40:t.stopImmediatePropagation(),t.stopPropagation(),e=E.indexOf(x),e'):("ie"==a.table.browser?e.setAttribute("class","tabulator-star-inactive"):e.classList.replace("tabulator-star-active","tabulator-star-inactive"),e.innerHTML='')})}function r(t){c=t,s(t)}var a=this,l=t.getElement(),c=t.getValue(),u=l.getElementsByTagName("svg").length||5,d=l.getElementsByTagName("svg")[0]?l.getElementsByTagName("svg")[0].getAttribute("width"):14,h=[],p=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");l.style.whiteSpace="nowrap",l.style.overflow="hidden",l.style.textOverflow="ellipsis",p.style.verticalAlign="middle",p.style.display="inline-block",p.style.padding="4px",m.setAttribute("width",d),m.setAttribute("height",d),m.setAttribute("viewBox","0 0 512 512"),m.setAttribute("xml:space","preserve"),m.style.padding="0 1px";for(var f=1;f<=u;f++)!function(t){var e=document.createElement("span"),i=m.cloneNode(!0);h.push(i),e.addEventListener("mouseenter",function(e){e.stopPropagation(),e.stopImmediatePropagation(),s(t)}),e.addEventListener("mousemove",function(t){t.stopPropagation(),t.stopImmediatePropagation()}),e.addEventListener("click",function(e){e.stopPropagation(),e.stopImmediatePropagation(),o(t)}),e.appendChild(i),p.appendChild(e)}(f);return c=Math.min(parseInt(c),u),s(c),p.addEventListener("mousemove",function(t){s(0)}),p.addEventListener("click",function(t){o(0)}),l.addEventListener("blur",function(t){i()}),l.addEventListener("keydown",function(t){switch(t.keyCode){case 39:r(c+1);break;case 37:r(c-1);break;case 13:o(c);break;case 27:i()}}),p},progress:function(t,e,o,i,n){function s(){var t=d*Math.round(m.offsetWidth/(l.clientWidth/100))+u;o(t),l.setAttribute("aria-valuenow",t),l.setAttribute("aria-label",h)}var r,a,l=t.getElement(),c=void 0===n.max?l.getElementsByTagName("div")[0].getAttribute("max")||100:n.max,u=void 0===n.min?l.getElementsByTagName("div")[0].getAttribute("min")||0:n.min,d=(c-u)/100,h=t.getValue()||0,p=document.createElement("div"),m=document.createElement("div");return p.style.position="absolute",p.style.right="0",p.style.top="0",p.style.bottom="0",p.style.width="5px",p.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",l.style.padding="4px 4px",h=Math.min(parseFloat(h),c),h=Math.max(parseFloat(h),u),h=Math.round((h-u)/d),m.style.width=h+"%",l.setAttribute("aria-valuemin",u),l.setAttribute("aria-valuemax",c),m.appendChild(p),p.addEventListener("mousedown",function(t){r=t.screenX,a=m.offsetWidth}),p.addEventListener("mouseover",function(){p.style.cursor="ew-resize"}),l.addEventListener("mousemove",function(t){r&&(m.style.width=a+t.screenX-r+"px")}),l.addEventListener("mouseup",function(t){r&&(t.stopPropagation(),t.stopImmediatePropagation(),r=!1,a=!1,s())}),l.addEventListener("keydown",function(t){switch(t.keyCode){case 39:m.style.width=m.clientWidth+l.clientWidth/100+"px";break;case 37:m.style.width=m.clientWidth-l.clientWidth/100+"px";break;case 13:s();break;case 27:i()}}),l.addEventListener("blur",function(){i()}),m},tickCross:function(t,e,o,i,n){function s(t){return l?t?u?c:a.checked:a.checked&&!u?(a.checked=!1,a.indeterminate=!0,u=!0,c):(u=!1,a.checked):a.checked}var r=t.getValue(),a=document.createElement("input"),l=n.tristate,c=void 0===n.indeterminateValue?null:n.indeterminateValue,u=!1;return a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",a.value=r,!l||void 0!==r&&r!==c&&""!==r||(u=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&e(function(){a.focus()}),a.checked=!0===r||"true"===r||"True"===r||1===r,a.addEventListener("change",function(t){o(s())}),a.addEventListener("blur",function(t){o(s(!0))}),a.addEventListener("keydown",function(t){13==t.keyCode&&o(s()),27==t.keyCode&&i()}),a}},u.prototype.registerModule("edit",w);var E=function(t){this.table=t,this.filterList=[],this.headerFilters={},this.headerFilterElements=[],this.headerFilterColumns=[],this.changed=!1};E.prototype.initializeColumn=function(t,e){function o(e){var o,r="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",a="";if(void 0===i||i!==e){if(i=e,t.modules.filter.emptyFunc(e))delete n.headerFilters[s];else{switch(t.modules.filter.value=e,_typeof(t.definition.headerFilterFunc)){case"string":n.filters[t.definition.headerFilterFunc]?(a=t.definition.headerFilterFunc,o=function(o){var i=t.definition.headerFilterFuncParams||{},s=t.getFieldValue(o);return i="function"==typeof i?i(e,s,o):i,n.filters[t.definition.headerFilterFunc](e,s,o,i)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":o=function(o){var i=t.definition.headerFilterFuncParams||{},n=t.getFieldValue(o);return i="function"==typeof i?i(e,n,o):i,t.definition.headerFilterFunc(e,n,o,i)},a=o}if(!o)switch(r){case"partial":o=function(o){return String(t.getFieldValue(o)).toLowerCase().indexOf(String(e).toLowerCase())>-1},a="like";break;default:o=function(o){return t.getFieldValue(o)==e},a="="}n.headerFilters[s]={value:e,func:o,type:a}}n.changed=!0,n.table.rowManager.filterRefresh()}}var i,n=this,s=t.getField();t.modules.filter={success:o,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)},E.prototype.generateHeaderFilterElement=function(t,e){function o(){}var i,n,s,r,a,l,c,u=this,d=t.modules.filter.success,h=t.getField();if(t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode){var p=t.modules.filter.headerElement.parentNode,m=u.headerFilterElements.indexOf(p);m>=0&&u.headerFilterElements.splice(m,1);var f=u.headerFilterColumns.indexOf(f);f>=0&&u.headerFilterColumns.splice(f,1),t.contentElement.removeChild(p)}if(h){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(t){return!t&&"0"!==t},i=document.createElement("div"),i.classList.add("tabulator-header-filter"),_typeof(t.definition.headerFilter)){case"string":u.table.modules.edit.editors[t.definition.headerFilter]?(n=u.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":n=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?n=t.modules.edit.editor:t.definition.formatter&&u.table.modules.edit.editors[t.definition.formatter]?(n=u.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):n=u.table.modules.edit.editors.input}if(n){if(r={getValue:function(){return void 0!==e?e:""},getField:function(){return t.definition.field},getElement:function(){return i},getColumn:function(){return t.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},c=t.definition.headerFilterParams||{},c="function"==typeof c?c.call(u.table):c,!(s=n.call(this.table.modules.edit,r,function(){},d,o,c)))return void console.warn("Filter Error - Cannot add filter to "+h+" column, editor returned a value of false");if(!(s instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+h+" column, editor should return an instance of Node, the editor returned:",s);h?u.table.modules.localize.bind("headerFilters|columns|"+t.definition.field,function(t){s.setAttribute("placeholder",void 0!==t&&t?t:u.table.modules.localize.getText("headerFilters|default"))}):u.table.modules.localize.bind("headerFilters|default",function(t){s.setAttribute("placeholder",void 0!==u.column.definition.headerFilterPlaceholder&&u.column.definition.headerFilterPlaceholder?u.column.definition.headerFilterPlaceholder:t)}),s.addEventListener("click",function(t){t.stopPropagation(),s.focus()}),a=!1,l=function(t){a&&clearTimeout(a),a=setTimeout(function(){d(s.value)},300)},t.modules.filter.headerElement=s,t.modules.filter.attrType=s.hasAttribute("type")?s.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=s.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"===t.definition.headerFilter||"autocomplete"===t.definition.editor&&!0===t.definition.headerFilter||(s.addEventListener("keyup",l),s.addEventListener("search",l),"number"==t.modules.filter.attrType&&s.addEventListener("change",function(t){d(s.value)}),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&s.setAttribute("type","search")),"input"!=t.modules.filter.tagType&&"select"!=t.modules.filter.tagType&&"textarea"!=t.modules.filter.tagType||s.addEventListener("mousedown",function(t){t.stopPropagation()})),i.appendChild(s),t.contentElement.appendChild(i),u.headerFilterElements.push(s),u.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)},E.prototype.hideHeaderFilterElements=function(){this.headerFilterElements.forEach(function(t){t.style.display="none"})},E.prototype.showHeaderFilterElements=function(){this.headerFilterElements.forEach(function(t){t.style.display=""})},E.prototype.setHeaderFilterFocus=function(t){t.modules.filter&&t.modules.filter.headerElement?t.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())},E.prototype.setHeaderFilterValue=function(t,e){t&&(t.modules.filter&&t.modules.filter.headerElement?(this.generateHeaderFilterElement(t,e),t.modules.filter.success(e)):console.warn("Column Filter Error - No header filter set on column:",t.getField()))},E.prototype.reloadHeaderFilter=function(t){t&&(t.modules.filter&&t.modules.filter.headerElement?this.generateHeaderFilterElement(t,t.modules.filter.value):console.warn("Column Filter Error - No header filter set on column:",t.getField()))},E.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},E.prototype.setFilter=function(t,e,o){var i=this;i.filterList=[],Array.isArray(t)||(t=[{field:t,type:e,value:o}]),i.addFilter(t)},E.prototype.addFilter=function(t,e,o){var i=this;Array.isArray(t)||(t=[{field:t,type:e,value:o}]),t.forEach(function(t){(t=i.findFilter(t))&&(i.filterList.push(t),i.changed=!0)}),this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},E.prototype.findFilter=function(t){var e,o=this;if(Array.isArray(t))return this.findSubFilters(t);var i=!1;return"function"==typeof t.field?i=function(e){return t.field(e,t.type||{})}:o.filters[t.type]?(e=o.table.columnManager.getColumnByField(t.field),i=e?function(i){return o.filters[t.type](t.value,e.getFieldValue(i))}:function(e){return o.filters[t.type](t.value,e[t.field])}):console.warn("Filter Error - No such filter type found, ignoring: ",t.type),t.func=i,!!t.func&&t},E.prototype.findSubFilters=function(t){var e=this,o=[];return t.forEach(function(t){(t=e.findFilter(t))&&o.push(t)}),!!o.length&&o},E.prototype.getFilters=function(t,e){var o=this,i=[];return t&&(i=o.getHeaderFilters()),o.filterList.forEach(function(t){i.push({field:t.field,type:t.type,value:t.value})}),e&&i.forEach(function(t){"function"==typeof t.type&&(t.type="function")}),i},E.prototype.getHeaderFilters=function(){var t=[];for(var e in this.headerFilters)t.push({field:e,type:this.headerFilters[e].type,value:this.headerFilters[e].value});return t},E.prototype.removeFilter=function(t,e,o){var i=this;Array.isArray(t)||(t=[{field:t,type:e,value:o}]),t.forEach(function(t){var e=-1;e="object"==_typeof(t.field)?i.filterList.findIndex(function(e){return t===e}):i.filterList.findIndex(function(e){return t.field===e.field&&t.type===e.type&&t.value===e.value}),e>-1?(i.filterList.splice(e,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)}),this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},E.prototype.clearFilter=function(t){this.filterList=[],t&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},E.prototype.clearHeaderFilter=function(){var t=this;this.headerFilters={},this.headerFilterColumns.forEach(function(e){e.modules.filter.value=null,t.reloadHeaderFilter(e)}),this.changed=!0},E.prototype.search=function(t,e,o,i){var n=this,s=[],r=[];return Array.isArray(e)||(e=[{field:e,type:o,value:i}]),e.forEach(function(t){(t=n.findFilter(t))&&r.push(t)}),this.table.rowManager.rows.forEach(function(e){var o=!0;r.forEach(function(t){n.filterRecurse(t,e.getData())||(o=!1)}),o&&s.push("data"===t?e.getData("data"):e.getComponent())}),s},E.prototype.filter=function(t,e){var o=this,i=[],n=[];return o.table.options.dataFiltering&&o.table.options.dataFiltering.call(o.table,o.getFilters()),o.table.options.ajaxFiltering||!o.filterList.length&&!Object.keys(o.headerFilters).length?i=t.slice(0):t.forEach(function(t){o.filterRow(t)&&i.push(t)}),o.table.options.dataFiltered&&(i.forEach(function(t){n.push(t.getComponent())}),o.table.options.dataFiltered.call(o.table,o.getFilters(),n)),i},E.prototype.filterRow=function(t,e){var o=this,i=!0,n=t.getData();o.filterList.forEach(function(t){o.filterRecurse(t,n)||(i=!1)});for(var s in o.headerFilters)o.headerFilters[s].func(n)||(i=!1);return i},E.prototype.filterRecurse=function(t,e){var o=this,i=!1;return Array.isArray(t)?t.forEach(function(t){o.filterRecurse(t,e)&&(i=!0)}):i=t.func(e),i},E.prototype.filters={"=":function(t,e,o,i){return e==t},"<":function(t,e,o,i){return e":function(t,e,o,i){return e>t},">=":function(t,e,o,i){return e>=t},"!=":function(t,e,o,i){return e!=t},regex:function(t,e,o,i){return"string"==typeof t&&(t=new RegExp(t)),t.test(e)},like:function(t,e,o,i){return null===t||void 0===t?e===t:void 0!==e&&null!==e&&String(e).toLowerCase().indexOf(t.toLowerCase())>-1},in:function(t,e,o,i){return Array.isArray(t)?t.indexOf(e)>-1:(console.warn("Filter Error - filter value is not an array:",t),!1)}},u.prototype.registerModule("filter",E);var C=function(t){this.table=t};C.prototype.initializeColumn=function(t){var e=this,o={params:t.definition.formatterParams||{}};switch(_typeof(t.definition.formatter)){case"string":"tick"===t.definition.formatter&&(t.definition.formatter="tickCross",void 0===o.params.crossElement&&(o.params.crossElement=!1),console.warn("DEPRECATION WANRING - the tick formatter has been depricated, please use the tickCross formatter with the crossElement param set to false")),e.formatters[t.definition.formatter]?o.formatter=e.formatters[t.definition.formatter]:(console.warn("Formatter Error - No such formatter found: ",t.definition.formatter),o.formatter=e.formatters.plaintext);break;case"function":o.formatter=t.definition.formatter;break;default:o.formatter=e.formatters.plaintext}t.modules.format=o},C.prototype.cellRendered=function(t){t.column.modules.format.renderedCallback&&t.column.modules.format.renderedCallback()},C.prototype.formatValue=function(t){function e(e){t.column.modules.format.renderedCallback=e}var o=t.getComponent(),i="function"==typeof t.column.modules.format.params?t.column.modules.format.params(o):t.column.modules.format.params;return t.column.modules.format.formatter.call(this,o,i,e)},C.prototype.sanitizeHTML=function(t){if(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}return t},C.prototype.emptyToSpace=function(t){return null===t||void 0===t?" ":t},C.prototype.getFormatter=function(t){var t;switch(void 0===t?"undefined":_typeof(t)){case"string":this.formatters[t]?t=this.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=this.formatters.plaintext);break;case"function":t=t;break;default:t=this.formatters.plaintext}return t},C.prototype.formatters={plaintext:function(t,e,o){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))},html:function(t,e,o){return t.getValue()},textarea:function(t,e,o){return t.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(t.getValue()))},money:function(t,e,o){var i,n,s,r,a=parseFloat(t.getValue()),l=e.decimal||".",c=e.thousand||",",u=e.symbol||"",d=!!e.symbolAfter,h=void 0!==e.precision?e.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(t.getValue()));for(i=!1!==h?a.toFixed(h):a,i=String(i).split("."),n=i[0],s=i.length>1?l+i[1]:"",r=/(\d+)(\d{3})/;r.test(n);)n=n.replace(r,"$1"+c+"$2");return d?n+s+u:u+n+s},link:function(t,e,o){var i,n=t.getValue(),s=e.urlPrefix||"",r=this.emptyToSpace(n),a=document.createElement("a");if(e.labelField&&(i=t.getData(),r=i[e.labelField]),e.label)switch(_typeof(e.label)){case"string":r=e.label;break;case"function":r=e.label(t)}if(e.urlField&&(i=t.getData(),n=i[e.urlField]),e.url)switch(_typeof(e.url)){case"string":n=e.url;break;case"function":n=e.url(t)}return a.setAttribute("href",s+n),e.target&&a.setAttribute("target",e.target),a.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),a},image:function(t,e,o){var i=document.createElement("img");switch(i.setAttribute("src",t.getValue()),_typeof(e.height)){case"number":i.style.height=e.height+"px";break;case"string":i.style.height=e.height}switch(_typeof(e.width)){case"number":i.style.width=e.width+"px";break;case"string":i.style.width=e.width}return i.addEventListener("load",function(){t.getRow().normalizeHeight()}),i},tickCross:function(t,e,o){var i=t.getValue(),n=t.getElement(),s=e.allowEmpty,r=e.allowTruthy,a=void 0!==e.tickElement?e.tickElement:'',l=void 0!==e.crossElement?e.crossElement:'';return r&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i?(n.setAttribute("aria-checked",!0),a||""):!s||"null"!==i&&""!==i&&null!==i&&void 0!==i?(n.setAttribute("aria-checked",!1),l||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(t,e,o){var i=e.inputFormat||"YYYY-MM-DD hh:mm:ss",n=e.outputFormat||"DD/MM/YYYY hh:mm:ss",s=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",r=t.getValue(),a=moment(r,i);return a.isValid()?a.format(n):!0===s?r:"function"==typeof s?s(r):s},datetimediff:function(t,e,o){var i=e.inputFormat||"YYYY-MM-DD hh:mm:ss",n=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",s=void 0!==e.suffix&&e.suffix,r=void 0!==e.unit?e.unit:void 0,a=void 0!==e.humanize&&e.humanize,l=void 0!==e.date?e.date:moment(),c=t.getValue(),u=moment(c,i);return u.isValid()?a?moment.duration(u.diff(l)).humanize(s):u.diff(l,r)+(s?" "+s:""):!0===n?c:"function"==typeof n?n(c):n},lookup:function(t,e,o){var i=t.getValue();return void 0===e[i]?(console.warn("Missing display value for "+i),i):e[i]},star:function(t,e,o){var i=t.getValue(),n=t.getElement(),s=e&&e.stars?e.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",i=parseInt(i)':'',r.appendChild(c)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",i),r},traffic:function(t,e,o){var i,n,s=this.sanitizeHTML(t.getValue())||0,r=document.createElement("span"),a=e&&e.max?e.max:100,l=e&&e.min?e.min:0,c=e&&void 0!==e.color?e.color:["red","orange","green"],u="#666666";if(!isNaN(s)&&void 0!==t.getValue()){switch(r.classList.add("tabulator-traffic-light"),n=parseFloat(s)<=a?parseFloat(s):a,n=parseFloat(n)>=l?parseFloat(n):l,i=(a-l)/100,n=Math.round((n-l)/i),void 0===c?"undefined":_typeof(c)){case"string":u=c;break;case"function":u=c(s);break;case"object":if(Array.isArray(c)){var d=100/c.length,h=Math.floor(n/d);h=Math.min(h,c.length-1),h=Math.max(h,0),u=c[h];break}}return r.style.backgroundColor=u,r}},progress:function(t,e,o){ var i,n,s,r,a,l=this.sanitizeHTML(t.getValue())||0,c=t.getElement(),u=e&&e.max?e.max:100,d=e&&e.min?e.min:0,h=e&&e.legendAlign?e.legendAlign:"center";switch(n=parseFloat(l)<=u?parseFloat(l):u,n=parseFloat(n)>=d?parseFloat(n):d,i=(u-d)/100,n=Math.round((n-d)/i),_typeof(e.color)){case"string":s=e.color;break;case"function":s=e.color(l);break;case"object":if(Array.isArray(e.color)){var p=100/e.color.length,m=Math.floor(n/p);m=Math.min(m,e.color.length-1),m=Math.max(m,0),s=e.color[m];break}default:s="#2DC214"}switch(_typeof(e.legend)){case"string":r=e.legend;break;case"function":r=e.legend(l);break;case"boolean":r=l;break;default:r=!1}switch(_typeof(e.legendColor)){case"string":a=e.legendColor;break;case"function":a=e.legendColor(l);break;case"object":if(Array.isArray(e.legendColor)){var p=100/e.legendColor.length,m=Math.floor(n/p);m=Math.min(m,e.legendColor.length-1),m=Math.max(m,0),a=e.legendColor[m]}break;default:a="#000"}return c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",n),"
"+(r?"
"+r+"
":"")},color:function(t,e,o){return t.getElement().style.backgroundColor=this.sanitizeHTML(t.getValue()),""},buttonTick:function(t,e,o){return''},buttonCross:function(t,e,o){return''},rownum:function(t,e,o){return this.table.rowManager.activeRows.indexOf(t.getRow()._getSelf())+1},handle:function(t,e,o){return t.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(t,e,o){function i(e){var o=t.getRow().getElement().getElementsByClassName("tabulator-responsive-collapse")[0];s=e,s?(r.classList.add("open"),o&&(o.style.display="")):(r.classList.remove("open"),o&&(o.style.display="none"))}var n=this,s=!1,r=document.createElement("div");return r.classList.add("tabulator-responsive-collapse-toggle"),r.innerHTML="+-",t.getElement().classList.add("tabulator-row-handle"),n.table.options.responsiveLayoutCollapseStartOpen&&(s=!0),r.addEventListener("click",function(t){t.stopImmediatePropagation(),i(!s)}),i(s),r}},u.prototype.registerModule("format",C);var x=function(t){this.table=t,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.initializationMode="left",this.active=!1};x.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1},x.prototype.initializeColumn=function(t){var e={margin:0,edge:!1};t.definition.frozen?t.parent.isGroup?console.warn("Frozen Column Error - Grouped columns cannot be frozen"):t.isGroup?console.warn("Frozen Column Error - Column Groups cannot be frozen"):(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=e):this.initializationMode="right"},x.prototype.layout=function(){var t=this,e=(this.table.rowManager.element,0);t.active&&(t.leftMargin=t._calcSpace(t.leftColumns,t.leftColumns.length),t.table.columnManager.headersElement.style.marginLeft=t.leftMargin+"px",t.rightMargin=t._calcSpace(t.rightColumns,t.rightColumns.length),t.table.columnManager.element.style.paddingRight=t.rightMargin+"px",t.table.rowManager.activeRows.forEach(function(e){t.layoutRow(e)}),t.table.options.dataTree&&t.table.rowManager.getDisplayRows().forEach(function(e){t.layoutRow(e)}),t.table.modExists("columnCalcs")&&(t.table.modules.columnCalcs.topInitialized&&t.table.modules.columnCalcs.topRow&&t.layoutRow(t.table.modules.columnCalcs.topRow),t.table.modules.columnCalcs.botInitialized&&t.table.modules.columnCalcs.botRow&&t.layoutRow(t.table.modules.columnCalcs.botRow)),t.leftColumns.forEach(function(e,o){e.modules.frozen.margin=t._calcSpace(t.leftColumns,o)+t.table.columnManager.scrollLeft,o==t.leftColumns.length-1?e.modules.frozen.edge=!0:e.modules.frozen.edge=!1,t.layoutColumn(e)}),e=t.table.rowManager.element.clientWidth+t.table.columnManager.scrollLeft,t.rightColumns.forEach(function(o,i){o.modules.frozen.margin=e-t._calcSpace(t.rightColumns,i+1),i==t.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,t.layoutColumn(o)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin+"px")},x.prototype.layoutColumn=function(t){var e=this;e.layoutElement(t.getElement(),t),t.cells.forEach(function(o){e.layoutElement(o.getElement(),t)})},x.prototype.layoutRow=function(t){t.getElement().style.paddingLeft=this.leftMargin+"px"},x.prototype.layoutElement=function(t,e){e.modules.frozen&&(t.style.position="absolute",t.style.left=e.modules.frozen.margin+"px",t.classList.add("tabulator-frozen"),e.modules.frozen.edge&&t.classList.add("tabulator-frozen-"+e.modules.frozen.position))},x.prototype._calcSpace=function(t,e){for(var o=0,i=0;i-1&&e.splice(o,1)}),e},R.prototype.freezeRow=function(t){t.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(t.modules.frozen=!0,this.topElement.appendChild(t.getElement()),t.initialize(),t.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(t),this.table.rowManager.refreshActiveData("display"),this.styleRows())},R.prototype.unfreezeRow=function(t){var e=this.rows.indexOf(t);if(t.modules.frozen){t.modules.frozen=!1;var o=t.getElement();o.parentNode.removeChild(o),this.table.rowManager.adjustTableSize(),this.rows.splice(e,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},R.prototype.styleRows=function(t){var e=this;this.rows.forEach(function(t,o){e.table.rowManager.styleRow(t,o)})},u.prototype.registerModule("frozenRows",R);var M=function(t){this._group=t,this.type="GroupComponent"};M.prototype.getKey=function(){return this._group.key},M.prototype.getElement=function(){return this._group.element},M.prototype.getRows=function(){return this._group.getRows(!0)},M.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},M.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},M.prototype.getVisibility=function(){return this._group.visible},M.prototype.show=function(){this._group.show()},M.prototype.hide=function(){this._group.hide()},M.prototype.toggle=function(){this._group.toggleVisibility()},M.prototype._getSelf=function(){return this._group},M.prototype.getTable=function(){return this._group.groupManager.table};var D=function(t,e,o,i,n,s,r){this.groupManager=t,this.parent=e,this.key=i,this.level=o,this.field=n,this.hasSubGroups=o-1?o?this.rows.splice(n+1,0,t):this.rows.splice(n,0,t):o?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)},D.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(e){e.scrollHeader(t)})},D.prototype.getRowIndex=function(t){},D.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t},D.prototype.removeRow=function(t){var e=this.rows.indexOf(t);e>-1&&this.rows.splice(e,1),this.groupManager.table.options.groupValues||this.rows.length?(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},D.prototype.removeGroup=function(t){var e,o=t.level+"_"+t.key;this.groups[o]&&(delete this.groups[o],e=this.groupList.indexOf(t),e>-1&&this.groupList.splice(e,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},D.prototype.getHeadersAndRows=function(t){var e=[];return e.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(o){e=e.concat(o.getHeadersAndRows(t))}):(!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&this.calcs.top.detachElement(),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),e=e.concat(this.rows),!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&this.calcs.bottom.detachElement(),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))):!this.groupList.length&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.options.groupClosedShowCalcs&&this.groupManager.table.modExists("columnCalcs")&&(!t&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&this.calcs.top.detachElement(),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),!t&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&this.calcs.bottom.detachElement(),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))),e},D.prototype.getData=function(t,e){var o=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(t){o.push(t.getData(e||"data"))}),o},D.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(e){t+=e.getRowCount()}):t=this.rows.length,t},D.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},D.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){t.detachElement()})}):this.rows.forEach(function(t){var e=t.getElement();e.parentNode.removeChild(e)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},D.prototype.show=function(){var t=this;if(t.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=t.getElement();this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){var o=t.getElement();e.parentNode.insertBefore(o,e.nextSibling),t.initialize(),e=o})}):t.rows.forEach(function(t){var o=t.getElement();e.parentNode.insertBefore(o,e.nextSibling),t.initialize(),e=o}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},D.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(e){t.push(e.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))},D.prototype.getRowGroup=function(t){var e=!1;return this.groupList.length?this.groupList.forEach(function(o){var i=o.getRowGroup(t);i&&(e=i)}):this.rows.find(function(e){return e===t})&&(e=this),e},D.prototype.getSubGroups=function(t){var e=[];return this.groupList.forEach(function(o){e.push(t?o.getComponent():o)}),e},D.prototype.getRows=function(t){var e=[];return this.rows.forEach(function(o){e.push(t?o.getComponent():o)}),e},D.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(e){t.push(e.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},D.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;t("+i+" "+(1===i?e:o.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(e)||e)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var n=this.table.columnManager.getRealColumns();n.forEach(function(e){e.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(e)||(e=[e]),e.forEach(function(e,o){var i,n;"function"==typeof e?i=e:(n=t.table.columnManager.getColumnByField(e),i=n?function(t){return n.getFieldValue(t)}:function(t){return t[e]}),t.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!t.allowedValues&&t.allowedValues[o]})}),o&&(Array.isArray(o)||(o=[o]),o.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=o),i&&(t.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},L.prototype.setDisplayIndex=function(t){this.displayIndex=t},L.prototype.getDisplayIndex=function(){return this.displayIndex},L.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):t.slice(0)},L.prototype.getGroups=function(t){var e=[];return this.groupList.forEach(function(o){e.push(t?o.getComponent():o)}),e},L.prototype.pullGroupListData=function(t){var e=this,o=[];return t.forEach(function(t){var i={};i.level=0,i.rowCount=0,i.headerContent="";var n=[];t.hasSubGroups?(n=e.pullGroupListData(t.groupList),i.level=t.level,i.rowCount=n.length-t.groupList.length,i.headerContent=t.generator(t.key,i.rowCount,t.rows,t),o.push(i),o=o.concat(n)):(i.level=t.level,i.headerContent=t.generator(t.key,t.rows.length,t.rows,t),i.rowCount=t.getRows().length,o.push(i),t.getRows().forEach(function(t){o.push(t.getData("data"))}))}),o},L.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},L.prototype.getRowGroup=function(t){var e=!1;return this.groupList.forEach(function(o){var i=o.getRowGroup(t);i&&(e=i)}),e},L.prototype.countGroups=function(){return this.groupList.length},L.prototype.generateGroups=function(t){var e=this,o=e.groups;e.groups={},e.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(t){e.createGroup(t,0,o)}),t.forEach(function(t){e.assignRowToExistingGroup(t,o)})):t.forEach(function(t){e.assignRowToGroup(t,o)})},L.prototype.createGroup=function(t,e,o){var i,n=e+"_"+t;o=o||[],i=new D(this,!1,e,t,this.groupIDLookups[0].field,this.headerGenerator[0],o[n]),this.groups[n]=i,this.groupList.push(i)},L.prototype.assignRowToGroup=function(t,e){var o=this.groupIDLookups[0].func(t.getData()),i="0_"+o;this.groups[i]||this.createGroup(o,0,e),this.groups[i].addRow(t)},L.prototype.assignRowToExistingGroup=function(t,e){var o=this.groupIDLookups[0].func(t.getData()),i="0_"+o;this.groups[i]&&this.groups[i].addRow(t)},L.prototype.assignRowToGroup=function(t,e){var o=this.groupIDLookups[0].func(t.getData()),i=!this.groups["0_"+o];return i&&this.createGroup(o,0,e),this.groups["0_"+o].addRow(t),!i},L.prototype.updateGroupRows=function(t){var e=this,o=[];if(e.groupList.forEach(function(t){o=o.concat(t.getHeadersAndRows())}),t){var i=e.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),e.table.rowManager.refreshActiveData("group",!0,!0)}return o},L.prototype.scrollHeaders=function(t){t+="px",this.groupList.forEach(function(e){e.scrollHeader(t)})},L.prototype.removeGroup=function(t){var e,o=t.level+"_"+t.key;this.groups[o]&&(delete this.groups[o],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1))},u.prototype.registerModule("groupRows",L);var T=function(t){this.table=t,this.history=[],this.index=-1};T.prototype.clear=function(){this.history=[],this.index=-1},T.prototype.action=function(t,e,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:e,data:o}),this.index++},T.prototype.getHistoryUndoSize=function(){return this.index+1},T.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},T.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},T.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},T.prototype.undoers={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue)},rowAdd:function(t){t.component.deleteActual()},rowDelete:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this._rebindRow(t.component,e)},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.pos],!1),this.table.rowManager.redraw()}},T.prototype.redoers={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue)},rowAdd:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this._rebindRow(t.component,e)},rowDelete:function(t){t.component.deleteActual()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.pos],!1),this.table.rowManager.redraw()}},T.prototype._rebindRow=function(t,e){this.history.forEach(function(o){if(o.component instanceof r)o.component===t&&(o.component=e);else if(o.component instanceof l&&o.component.row===t){var i=o.component.column.getField();i&&(o.component=e.getCell(i))}})},u.prototype.registerModule("history",T);var k=function(t){this.table=t,this.fieldIndex=[],this.hasIndex=!1};k.prototype.parseTable=function(){var t=this,e=t.table.element,o=t.table.options,i=(o.columns,e.getElementsByTagName("th")),n=e.getElementsByTagName("tbody")[0],s=[];t.hasIndex=!1,t.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],t._extractOptions(e,o),i.length?t._extractHeaders(i,n):t._generateBlankHeaders(i,n);for(var r=0;r-1&&t.pressedKeys.splice(i,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},S.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},S.prototype.checkBinding=function(t,e){var o=this,i=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&(e.keys.forEach(function(t){-1==o.pressedKeys.indexOf(t)&&(i=!1)}),i&&e.action.call(o,t),!0)},S.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},S.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,o=e.scrollTop-e.height;e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(o>=0?e.element.scrollTop=o:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,o=e.scrollTop+e.height,i=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(o<=i?e.element.scrollTop=o:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){var e=!1 ;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().next())},navLeft:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.undo()))},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(this.table.options.selectable&&"highlight"!=this.table.options.selectable?"selected":"active",null,null,null,!0)}},u.prototype.registerModule("keybindings",S);var z=function(t){this.table=t,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};z.prototype.createPlaceholderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.classList.add("tabulator-col-placeholder"),t},z.prototype.initializeColumn=function(t){var e,o=this,i={};t.modules.frozen||(e=t.getElement(),i.mousemove=function(i){t.parent===o.moving.parent&&((o.touchMove?i.touches[0].pageX:i.pageX)-u.prototype.helpers.elOffset(e).left+o.table.columnManager.element.scrollLeft>t.getWidth()/2?o.toCol===t&&o.toColAfter||(e.parentNode.insertBefore(o.placeholderElement,e.nextSibling),o.moveColumn(t,!0)):(o.toCol!==t||o.toColAfter)&&(e.parentNode.insertBefore(o.placeholderElement,e),o.moveColumn(t,!1)))}.bind(o),e.addEventListener("mousedown",function(e){o.touchMove=!1,1===e.which&&(o.checkTimeout=setTimeout(function(){o.startMove(e,t)},o.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(t)),t.modules.moveColumn=i},z.prototype.bindTouchEvents=function(t){var e,o,i,n,s,r,a,l=this,c=t.getElement(),u=!1;c.addEventListener("touchstart",function(c){l.checkTimeout=setTimeout(function(){l.touchMove=!0,e=t,o=t.nextColumn(),n=o?o.getWidth()/2:0,i=t.prevColumn(),s=i?i.getWidth()/2:0,r=0,a=0,u=!1,l.startMove(c,t)},l.checkPeriod)}),c.addEventListener("touchmove",function(c){var d,h;l.moving&&(l.moveHover(c),u||(u=c.touches[0].pageX),d=c.touches[0].pageX-u,d>0?o&&d-r>n&&(h=o)!==t&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveColumn(h,!0)):i&&-d-a>s&&(h=i)!==t&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveColumn(h,!1)),h&&(e=h,o=h.nextColumn(),r=n,n=o?o.getWidth()/2:0,i=h.prevColumn(),a=s,s=i?i.getWidth()/2:0))}),c.addEventListener("touchend",function(t){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&l.endMove(t)})},z.prototype.startMove=function(t,e){var o=e.getElement();this.moving=e,this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-u.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(t)},z.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveColumn.mousemove)})},z.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveColumn.mousemove)})},z.prototype.moveColumn=function(t,e){var o=this.moving.getCells();this.toCol=t,this.toColAfter=e,e?t.getCells().forEach(function(t,e){var i=t.getElement();i.parentNode.insertBefore(o[e].getElement(),i.nextSibling)}):t.getCells().forEach(function(t,e){var i=t.getElement();i.parentNode.insertBefore(o[e].getElement(),i)})},z.prototype.endMove=function(t){(1===t.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumn(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))},z.prototype.moveHover=function(t){var e,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft,s=(o.touchMove?t.touches[0].pageX:t.pageX)-u.prototype.helpers.elOffset(i).left+n;o.hoverElement.style.left=s-o.startX+"px",s-nt.getHeight()/2){if(e.toRow!==t||!e.toRowAfter){var i=t.getElement();i.parentNode.insertBefore(e.placeholderElement,i.nextSibling),e.moveRow(t,!0)}}else if(e.toRow!==t||e.toRowAfter){var i=t.getElement();i.previousSibling&&(i.parentNode.insertBefore(e.placeholderElement,i),e.moveRow(t,!1))}}.bind(e),t.modules.moveRow=o},F.prototype.initializeRow=function(t){var e,o=this,i={};i.mouseup=function(e){o.tableRowDrop(e,t)}.bind(o),i.mousemove=function(e){if(e.pageY-u.prototype.helpers.elOffset(t.element).top+o.table.rowManager.element.scrollTop>t.getHeight()/2){if(o.toRow!==t||!o.toRowAfter){var i=t.getElement();i.parentNode.insertBefore(o.placeholderElement,i.nextSibling),o.moveRow(t,!0)}}else if(o.toRow!==t||o.toRowAfter){var i=t.getElement();i.parentNode.insertBefore(o.placeholderElement,i),o.moveRow(t,!1)}}.bind(o),this.hasHandle||(e=t.getElement(),e.addEventListener("mousedown",function(e){1===e.which&&(o.checkTimeout=setTimeout(function(){o.startMove(e,t)},o.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(t,t.getElement())),t.modules.moveRow=i},F.prototype.initializeCell=function(t){var e=this,o=t.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(e.checkTimeout=setTimeout(function(){e.startMove(o,t.row)},e.checkPeriod))}),o.addEventListener("mouseup",function(t){1===t.which&&e.checkTimeout&&clearTimeout(e.checkTimeout)}),this.bindTouchEvents(t.row,t.getElement())},F.prototype.bindTouchEvents=function(t,e){var o,i,n,s,r,a,l,c=this,u=!1;e.addEventListener("touchstart",function(e){c.checkTimeout=setTimeout(function(){c.touchMove=!0,o=t,i=t.nextRow(),s=i?i.getHeight()/2:0,n=t.prevRow(),r=n?n.getHeight()/2:0,a=0,l=0,u=!1,c.startMove(e,t)},c.checkPeriod)}),this.moving,this.toRow,this.toRowAfter,e.addEventListener("touchmove",function(e){var d,h;c.moving&&(e.preventDefault(),c.moveHover(e),u||(u=e.touches[0].pageY),d=e.touches[0].pageY-u,d>0?i&&d-a>s&&(h=i)!==t&&(u=e.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement().nextSibling),c.moveRow(h,!0)):n&&-d-l>r&&(h=n)!==t&&(u=e.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement()),c.moveRow(h,!1)),h&&(o=h,i=h.nextRow(),a=s,s=i?i.getHeight()/2:0,n=h.prevRow(),l=r,r=n?n.getHeight()/2:0))}),e.addEventListener("touchend",function(t){c.checkTimeout&&clearTimeout(c.checkTimeout),c.moving&&(c.endMove(t),c.touchMove=!1)})},F.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(t){"row"!==t.type&&"group"!==t.type||!t.modules.moveRow.mousemove||t.getElement().addEventListener("mousemove",t.modules.moveRow.mousemove)})},F.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(t){"row"!==t.type&&"group"!==t.type||!t.modules.moveRow.mousemove||t.getElement().removeEventListener("mousemove",t.modules.moveRow.mousemove)})},F.prototype.startMove=function(t,e){var o=e.getElement();this.setStartPosition(t,e),this.moving=e,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(e)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(t)},F.prototype.setStartPosition=function(t,e){var o,i,n=this.touchMove?t.touches[0].pageX:t.pageX,s=this.touchMove?t.touches[0].pageY:t.pageY;o=e.getElement(),this.connection?(i=o.getBoundingClientRect(),this.startX=i.left-n+window.scrollX,this.startY=i.top-s+window.scrollY):this.startY=s-o.getBoundingClientRect().top},F.prototype.endMove=function(t){t&&1!==t.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))},F.prototype.moveRow=function(t,e){this.toRow=t,this.toRowAfter=e},F.prototype.moveHover=function(t){this.connection?this.moveHoverConnections.call(this,t):this.moveHoverTable.call(this,t)},F.prototype.moveHoverTable=function(t){var e=this.table.rowManager.getElement(),o=e.scrollTop,i=(this.touchMove?t.touches[0].pageY:t.pageY)-e.getBoundingClientRect().top+o;this.hoverElement.style.top=i-this.startY+"px"},F.prototype.moveHoverConnections=function(t){this.hoverElement.style.left=this.startX+(this.touchMove?t.touches[0].pageX:t.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?t.touches[0].pageY:t.pageY)+"px"},F.prototype.connectToTables=function(t){var e=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStart.call(this.table,e),this.table.modules.comms.send(this.connection,"moveRow","connect",{row:t})},F.prototype.disconnectFromTables=function(){var t=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStop.call(this.table,t),this.table.modules.comms.send(this.connection,"moveRow","disconnect")},F.prototype.connect=function(t,e){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=t,this.connectedRow=e,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().addEventListener("mouseup",t.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,e,t),!0)},F.prototype.disconnect=function(t){var e=this;t===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),e.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().removeEventListener("mouseup",t.modules.moveRow.mouseup)}),e.table.element.removeEventListener("mouseup",e.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,t)):console.warn("Move Row Error - trying to disconnect from non connected table")},F.prototype.dropComplete=function(t,e,o){var i=!1;if(o){switch(_typeof(this.table.options.movableRowsSender)){case"string":i=this.senders[this.table.options.movableRowsSender];break;case"function":i=this.table.options.movableRowsSender}i?i.call(this,this.moving.getComponent(),e?e.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),e?e.getComponent():void 0,t)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),e?e.getComponent():void 0,t);this.endMove()},F.prototype.tableRowDrop=function(t,e){var o=!1,i=!1;switch(t.stopImmediatePropagation(),_typeof(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver}o?i=o.call(this,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),i?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:e,success:i})},F.prototype.receivers={insert:function(t,e,o){return this.table.addRow(t.getData(),void 0,e),!0},add:function(t,e,o){return this.table.addRow(t.getData()),!0},update:function(t,e,o){return!!e&&(e.update(t.getData()),!0)},replace:function(t,e,o){return!!e&&(this.table.addRow(t.getData(),void 0,e),e.delete(),!0)}},F.prototype.senders={delete:function(t,e,o){t.delete()}},F.prototype.commsReceived=function(t,e,o){switch(e){case"connect":return this.connect(t,o.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,o.row,o.success)}},u.prototype.registerModule("moveRow",F);var _=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};_.prototype.initializeColumn=function(t){var e=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,r="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));t.definition[r]&&(s=e.lookupMutator(t.definition[r]))&&(o=!0,i[r]={mutator:s,params:t.definition[r+"Params"]||{}})}),o&&(t.modules.mutate=i)},_.prototype.lookupMutator=function(t){var e=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.mutators[t]?e=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":e=t}return e},_.prototype.transformRow=function(t,e,o){var i,n=this,s="mutator"+(e.charAt(0).toUpperCase()+e.slice(1));return this.enabled&&n.table.columnManager.traverse(function(n){var r,a,l;n.modules.mutate&&(r=n.modules.mutate[s]||n.modules.mutate.mutator||!1)&&(i=n.getFieldValue(t),(!o||o&&void 0!==i)&&(l=n.getComponent(),a="function"==typeof r.params?r.params(i,t,e,l):r.params,n.setFieldValue(t,r.mutator(i,t,e,a,l))))}),t},_.prototype.transformCell=function(t,e){var o=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1;return o?o.mutator(e,t.row.getData(),"edit",o.params,t.getComponent()):e},_.prototype.enable=function(){this.enabled=!0},_.prototype.disable=function(){this.enabled=!1},_.prototype.mutators={},u.prototype.registerModule("mutator",_);var H=function(t){this.table=t,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.pageSizes=[],this.createElements()};H.prototype.createElements=function(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),t=document.createElement("button"),t.classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},H.prototype.generatePageSizeSelectList=function(){var t=this,e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(var o=1;o<5;o++)e.push(this.size*o);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach(function(e){var o=document.createElement("option");o.value=e,o.innerHTML=e,t.pageSizeSelect.appendChild(o)}),this.pageSizeSelect.value=this.size}},H.prototype.initialize=function(t){var e,o=this;for(var i in o.table.options.paginationDataSent)o.paginationDataSentNames[i]=o.table.options.paginationDataSent[i];for(var n in o.table.options.paginationDataReceived)o.paginationDataReceivedNames[n]=o.table.options.paginationDataReceived[n];o.table.modules.localize.bind("pagination|first",function(t){o.firstBut.innerHTML=t}),o.table.modules.localize.bind("pagination|first_title",function(t){o.firstBut.setAttribute("aria-label",t),o.firstBut.setAttribute("title",t)}),o.table.modules.localize.bind("pagination|prev",function(t){o.prevBut.innerHTML=t}),o.table.modules.localize.bind("pagination|prev_title",function(t){o.prevBut.setAttribute("aria-label",t),o.prevBut.setAttribute("title",t)}),o.table.modules.localize.bind("pagination|next",function(t){o.nextBut.innerHTML=t}),o.table.modules.localize.bind("pagination|next_title",function(t){o.nextBut.setAttribute("aria-label",t),o.nextBut.setAttribute("title",t)}),o.table.modules.localize.bind("pagination|last",function(t){o.lastBut.innerHTML=t}),o.table.modules.localize.bind("pagination|last_title",function(t){o.lastBut.setAttribute("aria-label",t),o.lastBut.setAttribute("title",t)}),o.firstBut.addEventListener("click",function(){o.setPage(1)}),o.prevBut.addEventListener("click",function(){o.previousPage()}),o.nextBut.addEventListener("click",function(){o.nextPage().then(function(){}).catch(function(){})}),o.lastBut.addEventListener("click",function(){o.setPage(o.max)}),o.table.options.paginationElement&&(o.element=o.table.options.paginationElement),this.pageSizeSelect&&(e=document.createElement("label"),o.table.modules.localize.bind("pagination|page_size",function(t){o.pageSizeSelect.setAttribute("aria-label",t),o.pageSizeSelect.setAttribute("title",t),e.innerHTML=t}),o.element.appendChild(e),o.element.appendChild(o.pageSizeSelect),o.pageSizeSelect.addEventListener("change",function(t){o.setPageSize(o.pageSizeSelect.value),o.setPage(1).then(function(){}).catch(function(){})})),o.element.appendChild(o.firstBut),o.element.appendChild(o.prevBut),o.element.appendChild(o.pagesElement),o.element.appendChild(o.nextBut),o.element.appendChild(o.lastBut),o.table.options.paginationElement||t||o.table.footerManager.append(o.element,o),o.mode=o.table.options.pagination,o.size=o.table.options.paginationSize||Math.floor(o.table.rowManager.getElement().clientHeight/24),o.count=o.table.options.paginationButtonCount,o.generatePageSizeSelectList()},H.prototype.initializeProgressive=function(t){this.initialize(!0),this.mode="progressive_"+t,this.progressiveLoad=!0},H.prototype.setDisplayIndex=function(t){this.displayIndex=t},H.prototype.getDisplayIndex=function(){return this.displayIndex},H.prototype.setMaxRows=function(t){this.max=t?Math.ceil(t/this.size):1,this.page>this.max&&(this.page=this.max)},H.prototype.reset=function(t){return("local"==this.mode||t)&&(this.page=1),!0},H.prototype.setMaxPage=function(t){t=parseInt(t),this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())},H.prototype.setPage=function(t){var e=this;return new Promise(function(o,i){t=parseInt(t),t>0&&t<=e.max?(e.page=t,e.trigger().then(function(){o()}).catch(function(){i()})):(console.warn("Pagination Error - Requested page is out of range of 1 - "+e.max+":",t),i())})},H.prototype.setPageToRow=function(t){var e=this;return new Promise(function(o,i){var n=e.table.rowManager.getDisplayRows(e.displayIndex-1),s=n.indexOf(t);if(s>-1){var r=Math.ceil((s+1)/e.size);e.setPage(r).then(function(){o()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},H.prototype.setPageSize=function(t){t=parseInt(t),t>0&&(this.size=t),this.pageSizeSelect&&this.generatePageSizeSelectList()},H.prototype._setPageButtons=function(){for(var t=this,e=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&s<=t.max&&t.pagesElement.appendChild(t._generatePageButton(s));this.footerRedraw()},H.prototype._generatePageButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("tabulator-page"),t==e.page&&o.classList.add("active"),o.setAttribute("type","button"),o.setAttribute("role","button"),o.setAttribute("aria-label","Show Page "+t),o.setAttribute("title","Show Page "+t),o.setAttribute("data-page",t),o.textContent=t,o.addEventListener("click",function(o){e.setPage(t)}),o},H.prototype.previousPage=function(){var t=this;return new Promise(function(e,o){t.page>1?(t.page--,t.trigger().then(function(){e()}).catch(function(){o()})):(console.warn("Pagination Error - Previous page would be less than page 1:",0),o())})},H.prototype.nextPage=function(){var t=this;return new Promise(function(e,o){t.page-1&&(i=i.substr(n),s=i.indexOf(";"),s>-1&&(i=i.substr(0,s)),e=i.replace(o+"=",""));break;default:console.warn("Persistance Load Error - invalid mode selected",this.mode)}return!!e&&JSON.parse(e)},P.prototype.mergeDefinition=function(t,e){var o=this,i=[];return e=e||[],e.forEach(function(e,n){var s=o._findColumn(t,e);s&&(s.width=e.width,s.visible=e.visible,s.columns&&(s.columns=o.mergeDefinition(s.columns,e.columns)),i.push(s))}),t.forEach(function(t,n){o._findColumn(e,t)||(i.length>n?i.splice(n,0,t):i.push(t))}),i},P.prototype._findColumn=function(t,e){var o=e.columns?"group":e.field?"field":"object";return t.find(function(t){switch(o){case"group":return t.title===e.title&&t.columns.length===e.columns.length;case"field":return t.field===e.field;case"object":return t===e}})},P.prototype.save=function(t){var e={};switch(t){case"columns":e=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":e=this.table.modules.filter.getFilters();break;case"sort":e=this.validateSorters(this.table.modules.sort.getSort())}var o=this.id+("columns"===t?"":"-"+t);this.saveData(o,e)},P.prototype.validateSorters=function(t){return t.forEach(function(t){t.column=t.field,delete t.field}),t},P.prototype.saveData=function(t,e){switch(e=JSON.stringify(e),this.mode){case"local":localStorage.setItem(t,e);break;case"cookie":var o=new Date;o.setDate(o.getDate()+1e4),document.cookie=t+"="+e+"; expires="+o.toUTCString();break;default:console.warn("Persistance Save Error - invalid mode selected",this.mode)}},P.prototype.parseColumns=function(t){var e=this,o=[];return t.forEach(function(t){var i={};t.isGroup?(i.title=t.getDefinition().title,i.columns=e.parseColumns(t.getColumns())):(i.title=t.getDefinition().title,i.field=t.getField(),i.width=t.getWidth(),i.visible=t.visible), o.push(i)}),o},u.prototype.registerModule("persistence",P);var A=function(t){this.table=t,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};A.prototype.watchData=function(t){var e,o=this;this.currentVersion++,e=this.currentVersion,o.unwatchData(),o.data=t,o.origFuncs.push=t.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||e!==o.currentVersion||i.forEach(function(t){o.table.rowManager.addRowActual(t,!1)}),o.origFuncs.push.apply(t,arguments)}}),o.origFuncs.unshift=t.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||e!==o.currentVersion||i.forEach(function(t){o.table.rowManager.addRowActual(t,!0)}),o.origFuncs.unshift.apply(t,arguments)}}),o.origFuncs.shift=t.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||e!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[0]))&&i.deleteActual(),o.origFuncs.shift.call(t)}}),o.origFuncs.pop=t.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||e!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]))&&i.deleteActual(),o.origFuncs.pop.call(t)}}),o.origFuncs.splice=t.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,n=Array.from(arguments),s=n[0]<0?t.length+n[0]:n[0],r=n[1],a=!!n[2]&&n.slice(2);if(!o.blocked&&e===o.currentVersion){if(a&&(i=!!t[s]&&o.table.rowManager.getRowFromDataObject(t[s]),i?a.forEach(function(t){o.table.rowManager.addRowActual(t,!0,i,!0)}):(a=a.slice().reverse(),a.forEach(function(t){o.table.rowManager.addRowActual(t,!0,!1,!0)}))),0!==r){t.slice(s,void 0===n[1]?n[1]:s+r).forEach(function(t){var e=o.table.rowManager.getRowFromDataObject(t);e&&e.deleteActual(!0)})}(a||0!==r)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(t,arguments)}})},A.prototype.unwatchData=function(){if(!1!==this.data)for(var t in this.origFuncs)Object.defineProperty(this.data,t,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},A.prototype.watchRow=function(t){var e=t.getData();this.blocked=!0;for(var o in e)this.watchKey(t,e,o);this.blocked=!1},A.prototype.watchKey=function(t,e,o){var i=this,n=Object.getOwnPropertyDescriptor(e,o),s=e[o],r=this.currentVersion;Object.defineProperty(e,o,{set:function(e){if(s=e,!i.blocked&&r===i.currentVersion){var a={};a[o]=e,t.updateData(a)}n.set&&n.set(e)},get:function(){return n.get&&n.get(),s}})},A.prototype.unwatchRow=function(t){var e=t.getData();for(var o in e)Object.defineProperty(e,o,{value:e[o]})},A.prototype.block=function(){this.blocked=!0},A.prototype.unblock=function(){this.blocked=!1},u.prototype.registerModule("reactiveData",A);var N=function(t){this.table=t,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};N.prototype.initializeColumn=function(t,e,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===t&&(n="textarea"==e.definition.formatter||e.definition.variableHeight,e.modules.resize={variableHeight:n}),!0===s||s==t){var r=document.createElement("div");r.className="tabulator-col-resize-handle";var a=document.createElement("div");a.className="tabulator-col-resize-handle prev",r.addEventListener("click",function(t){t.stopPropagation()});var l=function(t){var o=e.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=e,i._mouseDown(t,o,r))};r.addEventListener("mousedown",l),r.addEventListener("touchstart",l),r.addEventListener("dblclick",function(t){i._checkResizability(e)&&e.reinitializeWidth(!0)}),a.addEventListener("click",function(t){t.stopPropagation()});var c=function(t){var o,n,s;(o=e.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(i.startColumn=e,i._mouseDown(t,s,a)))};a.addEventListener("mousedown",c),a.addEventListener("touchstart",c),a.addEventListener("dblclick",function(t){var o,n,s;(o=e.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&s.reinitializeWidth(!0))}),o.appendChild(r),o.appendChild(a)}},N.prototype._checkResizability=function(t){return void 0!==t.definition.resizable?t.definition.resizable:this.table.options.resizableColumns},N.prototype._mouseDown=function(t,e,o){function i(t){e.setWidth(s.startWidth+((void 0===t.screenX?t.touches[0].screenX:t.screenX)-s.startX)),!s.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights()}function n(t){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",i),o.removeEventListener("touchmove",i),o.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.table.options.persistentLayout&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,e.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===t.screenX?t.touches[0].screenX:t.screenX,s.startWidth=e.getWidth(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i),o.addEventListener("touchend",n)},u.prototype.registerModule("resizeColumns",N);var B=function(t){this.table=t,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};B.prototype.initializeRow=function(t){var e=this,o=t.getElement(),i=document.createElement("div");i.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",i.addEventListener("click",function(t){t.stopPropagation()});var s=function(o){e.startRow=t,e._mouseDown(o,t,i)};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s),n.addEventListener("click",function(t){t.stopPropagation()});var r=function(o){var i=e.table.rowManager.prevDisplayRow(t);i&&(e.startRow=i,e._mouseDown(o,i,n))};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),o.appendChild(i),o.appendChild(n)},B.prototype._mouseDown=function(t,e,o){function i(t){e.setHeight(s.startHeight+((void 0===t.screenY?t.touches[0].screenY:t.screenY)-s.startY))}function n(t){document.body.removeEventListener("mouseup",i),document.body.removeEventListener("mousemove",i),o.removeEventListener("touchmove",i),o.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.table.options.rowResized.call(this.table,e.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),s.startY=void 0===t.screenY?t.touches[0].screenY:t.screenY,s.startHeight=e.getHeight(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i),o.addEventListener("touchend",n)},u.prototype.registerModule("resizeRows",B);var I=function(t){this.table=t,this.binding=!1,this.observer=!1};I.prototype.initialize=function(t){var e=this.table;"undefined"!=typeof ResizeObserver&&"virtual"===e.rowManager.getRenderMode()?(this.observer=new ResizeObserver(function(t){e.redraw()}),this.observer.observe(e.element)):(this.binding=function(){e.redraw()},window.addEventListener("resize",this.binding))},I.prototype.clearBindings=function(t){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element)},u.prototype.registerModule("resizeTable",I);var O=function(t){this.table=t,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0};O.prototype.initialize=function(){var t=this,e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(o,i){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=i,e.push(o),o.visible||"collapse"!==t.mode||t.hiddenColumns.push(o))}),e=e.reverse(),e=e.sort(function(t,e){return e.modules.responsive.order-t.modules.responsive.order||e.modules.responsive.index-t.modules.responsive.index}),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent()},O.prototype.initializeColumn=function(t){var e=t.getDefinition();t.modules.responsive={order:void 0===e.responsive?1:e.responsive,visible:!1!==e.visible}},O.prototype.layoutRow=function(t){var e=t.getElement(),o=document.createElement("div");o.classList.add("tabulator-responsive-collapse"),e.classList.contains("tabulator-calcs")||(t.modules.responsiveLayout={element:o},this.collapseStartOpen||(o.style.display="none"),e.appendChild(o),this.generateCollapsedRowContent(t))},O.prototype.updateColumnVisibility=function(t,e){t.modules.responsive&&(t.modules.responsive.visible=e,this.initialize())},O.prototype.hideColumn=function(t){t.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent())},O.prototype.showColumn=function(t){var e;t.show(!1,!0),t.setWidth(t.getWidth()),"collapse"===this.mode&&(e=this.hiddenColumns.indexOf(t),e>-1&&this.hiddenColumns.splice(e,1),this.generateCollapsedContent())},O.prototype.update=function(){for(var t=this,e=!0;e;){var o="fitColumns"==t.table.modules.layout.getMode()?t.table.columnManager.getFlexBaseWidth():t.table.columnManager.getWidth(),i=t.table.columnManager.element.clientWidth-o;if(i<0){var n=t.columns[t.index];n?(t.hideColumn(n),t.index++):e=!1}else{var s=t.columns[t.index-1];s&&i>0&&i>=s.getWidth()?(t.showColumn(s),t.index--):e=!1}t.table.rowManager.activeRowsCount||t.table.rowManager.renderEmptyScroll()}},O.prototype.generateCollapsedContent=function(){var t=this;this.table.rowManager.getDisplayRows().forEach(function(e){t.generateCollapsedRowContent(e)})},O.prototype.generateCollapsedRowContent=function(t){var e,o;if(t.modules.responsiveLayout){for(e=t.modules.responsiveLayout.element;e.firstChild;)e.removeChild(e.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(t)),o&&e.appendChild(o)}},O.prototype.generateCollapsedRowData=function(t){var e,o=this,i=t.getData(),n={};return this.hiddenColumns.forEach(function(s){var r=s.getFieldValue(i);s.definition.title&&s.field&&(s.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(e={value:!1,data:{},getValue:function(){return r},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return s.getComponent()}},n[s.definition.title]=s.modules.format.formatter.call(o.table.modules.format,e,s.modules.format.params)):n[s.definition.title]=r)}),n},O.prototype.formatCollapsedData=function(t){var e=document.createElement("table"),o="";for(var i in t)o+=""+i+""+t[i]+"";return e.innerHTML=o,Object.keys(t).length?e:""},u.prototype.registerModule("responsiveLayout",O);var G=function(t){this.table=t,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[]};G.prototype.clearSelectionData=function(t){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t||this._rowSelectionChanged()},G.prototype.initializeRow=function(t){var e=this,o=t.getElement(),i=function t(){setTimeout(function(){e.selecting=!1},50),document.body.removeEventListener("mouseup",t)};t.modules.select={selected:!1},e.table.options.selectableCheck.call(this.table,t.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),e.table.options.selectable&&"highlight"!=e.table.options.selectable&&(e.table.options.selectableRangeMode&&"click"===e.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){e.lastClickedRow=e.lastClickedRow||t;var i=e.table.rowManager.getDisplayRowIndex(e.lastClickedRow),n=e.table.rowManager.getDisplayRowIndex(t),s=i<=n?i:n,r=i>=n?i:n,a=e.table.rowManager.getDisplayRows().slice(0),l=a.splice(s,r-s+1);o.ctrlKey?(l.forEach(function(t){t!==e.lastClickedRow&&e.toggleRow(t)}),e.lastClickedRow=t):(e.deselectRows(),e.selectRows(l))}else o.ctrlKey?(e.toggleRow(t),e.lastClickedRow=t):(e.deselectRows(),e.selectRows(t),e.lastClickedRow=t)}):(o.addEventListener("click",function(o){e.selecting||e.toggleRow(t)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return e.selecting=!0,e.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),e.toggleRow(t),!1}),o.addEventListener("mouseenter",function(o){e.selecting&&(e.toggleRow(t),e.selectPrev[1]==t&&e.toggleRow(e.selectPrev[0]))}),o.addEventListener("mouseout",function(o){e.selecting&&e.selectPrev.unshift(t)})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},G.prototype.toggleRow=function(t){this.table.options.selectableCheck.call(this.table,t.getComponent())&&(t.modules.select&&t.modules.select.selected?this._deselectRow(t):this._selectRow(t))},G.prototype.selectRows=function(t){var e=this;switch(void 0===t?"undefined":_typeof(t)){case"undefined":e.table.rowManager.rows.forEach(function(t){e._selectRow(t,!0,!0)}),e._rowSelectionChanged();break;case"boolean":!0===t&&(e.table.rowManager.activeRows.forEach(function(t){e._selectRow(t,!0,!0)}),e._rowSelectionChanged());break;default:Array.isArray(t)?(t.forEach(function(t){e._selectRow(t,!0,!0)}),e._rowSelectionChanged()):e._selectRow(t,!1,!0)}},G.prototype._selectRow=function(t,e,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var i=this.table.rowManager.findRow(t);i?-1==this.selectedRows.indexOf(i)&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.getElement().classList.add("tabulator-selected"),this.selectedRows.push(i),e||(this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged())):e||console.warn("Selection Error - No such row found, ignoring selection:"+t)},G.prototype.isRowSelected=function(t){return-1!==this.selectedRows.indexOf(t)},G.prototype.deselectRows=function(t){var e,o=this;if(void 0===t){e=o.selectedRows.length;for(var i=0;i-1&&(n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.getElement().classList.remove("tabulator-selected"),i.selectedRows.splice(o,1),e||(i.table.options.rowDeselected.call(this.table,n.getComponent()),i._rowSelectionChanged())):e||console.warn("Deselection Error - No such row found, ignoring selection:"+t)},G.prototype.getSelectedData=function(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getData())}),t},G.prototype.getSelectedRows=function(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getComponent())}),t},G.prototype._rowSelectionChanged=function(){this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},u.prototype.registerModule("selectRow",G);var j=function(t){this.table=t,this.sortList=[],this.changed=!1};j.prototype.initializeColumn=function(t,e){var o,i,n=this,s=!1;switch(_typeof(t.definition.sorter)){case"string":n.sorters[t.definition.sorter]?s=n.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":s=t.definition.sorter}t.modules.sort={sorter:s,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate},!1!==t.definition.headerSort&&(o=t.getElement(),o.classList.add("tabulator-sortable"),i=document.createElement("div"),i.classList.add("tabulator-arrow"),e.appendChild(i),o.addEventListener("click",function(e){var o="",i=[],s=!1;if(t.modules.sort){if(t.modules.sort.tristate)o="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":o="desc";break;case"desc":o="asc";break;default:o=t.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?(i=n.getSort(),s=i.findIndex(function(e){return e.field===t.getField()}),s>-1?(i[s].dir=o,s!=i.length-1&&(s=i.splice(s,1)[0],"none"!=o&&i.push(s))):"none"!=o&&i.push({column:t,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(t,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},j.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},j.prototype.getSort=function(){var t=this,e=[];return t.sortList.forEach(function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}),e},j.prototype.setSort=function(t,e){var o=this,i=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;e=o.table.columnManager.findColumn(t.column),e?(t.column=e,i.push(t),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),o.sortList=i,this.table.options.persistentSort&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("sort")},j.prototype.clear=function(){this.setSort([])},j.prototype.findSorter=function(t){var e,o=this.table.rowManager.activeRows[0],i="string";if(o&&(o=o.getData(),t.getField()))switch(e=t.getFieldValue(o),void 0===e?"undefined":_typeof(e)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},j.prototype.sort=function(t){var e,o=this;e=this.table.options.sortOrderReverse?o.sortList.slice().reverse():o.sortList,o.table.options.dataSorting&&o.table.options.dataSorting.call(o.table,o.getSort()),o.clearColumnHeaders(),o.table.options.ajaxSorting?e.forEach(function(t,e){o.setColumnHeader(t.column,t.dir)}):e.forEach(function(i,n){i.column&&i.column.modules.sort&&(i.column.modules.sort.sorter||(i.column.modules.sort.sorter=o.findSorter(i.column)),o._sortItem(t,i.column,i.dir,e,n)),o.setColumnHeader(i.column,i.dir)}),o.table.options.dataSorted&&o.table.options.dataSorted.call(o.table,o.getSort(),o.table.rowManager.getComponents(!0))},j.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})},j.prototype.setColumnHeader=function(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort",e)},j.prototype._sortItem=function(t,e,o,i,n){var s=this,r="function"==typeof e.modules.sort.params?e.modules.sort.params(e.getComponent(),o):e.modules.sort.params;t.sort(function(t,a){var l=s._sortRow(t,a,e,o,r);if(0===l&&n)for(var c=n-1;c>=0&&0===(l=s._sortRow(t,a,i[c].column,i[c].dir,r));c--);return l})},j.prototype._sortRow=function(t,e,o,i,n){var s,r,a="asc"==i?t:e,l="asc"==i?e:t;return t=o.getFieldValue(a.getData()),e=o.getFieldValue(l.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",s=a.getComponent(),r=l.getComponent(),o.modules.sort.sorter.call(this,t,e,s,r,o.getComponent(),i,n)},j.prototype.sorters={number:function(t,e,o,i,n,s,r){var a=r.alignEmptyValues,l=r.decimalSeparator||".",c=r.thousandSeparator||",",u=0;if(t=parseFloat(String(t).split(c).join("").split(l).join(".")),e=parseFloat(String(e).split(c).join("").split(l).join(".")),isNaN(t))u=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;u=1}return("top"===a&&"desc"===s||"bottom"===a&&"asc"===s)&&(u*=-1),u},string:function(t,e,o,i,n,s,r){var a,l=r.alignEmptyValues,c=0;if(t){if(e){switch(_typeof(r.locale)){case"boolean":r.locale&&(a=this.table.modules.localize.getLocale());break;case"string":a=r.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),a)}c=1}else c=e?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c},date:function(t,e,o,i,n,s,r){return r.format||(r.format="DD/MM/YYYY"),this.sorters.datetime.call(this,t,e,o,i,n,s,r)},time:function(t,e,o,i,n,s,r){return r.format||(r.format="hh:mm"),this.sorters.datetime.call(this,t,e,o,i,n,s,r)},datetime:function(t,e,o,i,n,s,r){var a=r.format||"DD/MM/YYYY hh:mm:ss",l=r.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(t=moment(t,a),e=moment(e,a),t.isValid()){if(e.isValid())return t-e;c=1}else c=e.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(t,e,o,i,n,s,r){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,o,i,n,s,r){function a(t){switch(u){case"length":return t.length;case"sum":return t.reduce(function(t,e){return t+e});case"max":return Math.max.apply(null,t);case"min":return Math.min.apply(null,t);case"avg":return t.reduce(function(t,e){return t+e})/t.length}}var l=0,c=0,u=r.type||"length",d=r.alignEmptyValues,h=0;if(Array.isArray(t)){if(Array.isArray(e))return l=t?a(t):0,c=e?a(e):0,l-c;d=1}else d=Array.isArray(e)?-1:0;return("top"===d&&"desc"===s||"bottom"===d&&"asc"===s)&&(h*=-1),h},exists:function(t,e,o,i,n,s,r){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,o,i,n,s,r){var a,l,c,u,d,h=0,p=/(\d+)|(\D+)/g,m=/\d/,f=r.alignEmptyValues,g=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if(a=String(t).toLowerCase(),l=String(e).toLowerCase(),a===l)return 0;if(!m.test(a)||!m.test(l))return a>l?1:-1;for(a=a.match(p),l=l.match(p),d=a.length>l.length?l.length:a.length;hu?1:-1;return a.length>l.length}g=1}else g=e||0===e?-1:0;return("top"===f&&"desc"===s||"bottom"===f&&"asc"===s)&&(g*=-1),g}},u.prototype.registerModule("sort",j);var V=function(t){this.table=t};return V.prototype.initializeColumn=function(t){var e,o=this,i=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(t){(e=o._extractValidator(t))&&i.push(e)}):(e=this._extractValidator(t.definition.validator))&&i.push(e),t.modules.validate=!!i.length&&i)},V.prototype._extractValidator=function(t){var e,o,i;switch(void 0===t?"undefined":_typeof(t)){case"string":return e=t.split(":",2),o=e.shift(),i=e[0],this._buildValidator(o,i);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}},V.prototype._buildValidator=function(t,e){var o="function"==typeof t?t:this.validators[t];return o?{type:"function"==typeof t?"function":t,func:o,params:e}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)},V.prototype.validate=function(t,e,o){var i=this,n=[];return t&&t.forEach(function(t){t.func.call(i,e,o,t.params)||n.push({type:t.type,parameters:t.params})}),!n.length||n},V.prototype.validators={integer:function(t,e,o){return""===e||null===e||void 0===e||"number"==typeof(e=Number(e))&&isFinite(e)&&Math.floor(e)===e},float:function(t,e,o){return""===e||null===e||void 0===e||"number"==typeof(e=Number(e))&&isFinite(e)&&e%1!=0},numeric:function(t,e,o){return""===e||null===e||void 0===e||!isNaN(e)},string:function(t,e,o){return""===e||null===e||void 0===e||isNaN(e)},max:function(t,e,o){return""===e||null===e||void 0===e||parseFloat(e)<=o},min:function(t,e,o){return""===e||null===e||void 0===e||parseFloat(e)>=o},minLength:function(t,e,o){return""===e||null===e||void 0===e||String(e).length>=o},maxLength:function(t,e,o){return""===e||null===e||void 0===e||String(e).length<=o},in:function(t,e,o){return""===e||null===e||void 0===e||("string"==typeof o&&(o=o.split("|")),""===e||o.indexOf(e)>-1)},regex:function(t,e,o){return""===e||null===e||void 0===e||new RegExp(o).test(e)},unique:function(t,e,o){if(""===e||null===e||void 0===e)return!0;var i=!0,n=t.getData(),s=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var o=t.getData();o!==n&&e==s.getFieldValue(o)&&(i=!1)}),i},required:function(t,e,o){return""!==e&null!==e&&void 0!==e}},u.prototype.registerModule("validate",V),u});