Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910
  1. /*!
  2. * filename: ej2-grids.min.js
  3. * version : 19.1.57
  4. * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
  5. * Use of this code is subject to the terms of our license.
  6. * A copy of the current license can be obtained at any time by e-mailing
  7. * licensing@syncfusion.com. Any infringement will be prosecuted under
  8. * applicable laws.
  9. */
  10. this.ej=this.ej||{},this.ej.grids=function(e,t,i,r,n,o,s,l,a,h,d){"use strict";function p(e,t,i,r){if(r&&e)return void e.removeAttribute(t);e&&e.setAttribute(t,i)}function c(){return["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound"]}function u(e,t){return e.prototype&&t in e.prototype}function g(e,r,n){return t.isNullOrUndefined(e)||""===e?"":i.DataUtil.getObject(e,r)}function f(e,r){return t.isNullOrUndefined(e)||""===e?"":i.DataUtil.getObject(e,r)}function m(e,t){requestAnimationFrame(function(){try{t(null,e())}catch(e){t(e)}})}function y(e){return!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.columns)&&e.columns.length>0}function v(e,t){for(var i=e.columns,r=t.columns,n=0;n<i.length;n++)if(r.length-1>=n)if(r[n].columns)for(var o=0;o<r[n].columns.length;o++)i[n].columns[o].type=r[n].columns[o].type;else i[n].type=r[n].type}function C(e){for(var t=[],i=e.vRows,r=0;r<i.length;r++)i[r].isDataRow?t.push(i[r]):i[r].isDataRow||(t.push(i[r]),!i[r].isExpand&&i[r].isCaptionRow&&(r+=w(i[r],e)));e.vcRows=t}function w(e,i){Qr=0;var r=i.groupSettings.columns.length,n="items",o=e.gSummary,s=0,l="aggregatesCount";if(o===e.data.count)return i.groupSettings.columns.length&&!t.isNullOrUndefined(e[l])&&e[l]?1!==i.groupSettings.columns.length?Qr+=0!==e.indent&&o<2?e.gSummary*(r-e.indent+(r-e.indent)*e[l]):e.gSummary*(r-e.indent+(r-e.indent-1)*e[l])+e[l]:1===i.groupSettings.columns.length&&(Qr+=e.gSummary*(r-e.indent)+e[l]):i.groupSettings.columns.length&&(1!==i.groupSettings.columns.length?Qr+=e.gSummary*(i.groupSettings.columns.length-e.indent):Qr+=e.gSummary),Qr;for(var a=0,h=e.data[n].length;a<h;a++){var d=e.data[n][a];Qr+=d[n].length+(r===i.columns.length||t.isNullOrUndefined(d[n].records)?0:d[n].records.length),s+=t.isNullOrUndefined(d[n].records)||t.isNullOrUndefined(e[l])?d[n].length:d[n].records.length,d[n].GroupGuid&&0!==d[n].childLevels&&b(d)}return Qr+=e.data[n].length,t.isNullOrUndefined(e[l])||e[l]&&Qr&&0!==s&&(Qr+=(Qr-s)*e[l]+e[l]),Qr}function b(e){for(var t=0,i=e.items.length;t<i;t++){var r=e.items[t];Qr+=r.count,0!==r.items.childLevels&&b(r)}}function S(e,i){for(var r=[],n=0,o=e.length;n<o;n++){var s=i(e[n],n);t.isNullOrUndefined(s)||r.push(s)}return r}function x(e){for(var i=[],r=0;r<e.length;r++)i.push(t.extend({},D(e[r]),{},!0));return i}function R(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}}function F(e,i){var r={},n=["style","class"];t.extend(r,i,{}),"style"in r&&(t.setStyleAttribute(e,r[n[0]]),delete r[n[0]]),"class"in r&&(t.addClass([e],r[n[1]]),delete r[n[1]]),t.attributes(e,r)}function z(e,i,r,n){for(var o=t.extend(e,i,r),s=Object.keys(o),l=0;l<s.length;l++)n&&-1!==n.indexOf(s[l])&&delete o[s[l]];return o}function I(e,i){void 0===i&&(i=0);for(var r=0,n=e.length;r<n;r++)e[r].columns?(e[r].index=t.isNullOrUndefined(e[r].index)?i:e[r].index,i++,i=I(e[r].columns,i)):(e[r].index=t.isNullOrUndefined(e[r].index)?i:e[r].index,i++);return i}function T(e,i,r){for(var n=0,o=e.length;n<o;n++){var s=void 0;"string"==typeof e[n]?s=new ft({field:e[n]},r):e[n]instanceof ft?s=e[n]:e[n].columns?(e[n].columns=T(e[n].columns,null,r),s=new ft(e[n],r)):s=new ft(e[n],r),s.type&&"checkbox"===s.type.toLowerCase()&&(s.allowReordering=!1),s.headerText=t.isNullOrUndefined(s.headerText)?s.foreignKeyValue||s.field||"":s.headerText,s.foreignKeyField=s.foreignKeyField||s.field,s.valueAccessor=("string"==typeof s.valueAccessor?t.getValue(s.valueAccessor,window):s.valueAccessor)||g,s.width=i&&t.isNullOrUndefined(s.width)?200:s.width,t.isNullOrUndefined(s.visible)&&(s.visible=!0),e[n]=s}return e}function E(e,i,r){var n,o=e.querySelector("span"),s=e.parentElement.getBoundingClientRect(),l=i.target.getBoundingClientRect();o.className=r,e.style.display="",n=(t.isNullOrUndefined(i.clientY)?i.changedTouches[0].clientY:i.clientY)>e.offsetHeight+10,e.style.top=l.top-s.top+(n?-(e.offsetHeight+10):e.offsetHeight+10)+"px",e.style.left=M(e,i,l,s.left)+"px",n?(e.querySelector(".e-downtail").style.display="",e.querySelector(".e-uptail").style.display="none"):(e.querySelector(".e-downtail").style.display="none",e.querySelector(".e-uptail").style.display="")}function M(e,t,i,r){var n=e.offsetWidth/2,o=P(t).x;return o-i.left<n?i.left-r:i.right-o<n?i.right-r-2*n:o-r-n}function D(e){return e instanceof t.ChildProperty?t.getValue("properties",e):e}function O(e,t,i){for(var r=e;r&&(i?r.id!==t:!r.classList.contains(t));)r=r.parentElement;return r}function A(e,t){for(var i=-1,r=0,n=t.length;r<n;r++)if(t[r].isEqualNode(e)){i=r;break}return i}function B(e,t){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}function k(e){for(var t=[],i=0,r=e.length;i<r;i++)e[i].hasOwnProperty("properties")?t.push(e[i].properties):t.push(e[i]);return t}function L(e,i){for(var r=[].slice.call(e.querySelectorAll(i)),n=0;n<r.length;n++)t.remove(r[n])}function P(e){var i={};return i.x=t.isNullOrUndefined(e.clientX)?e.changedTouches[0].clientX:e.clientX,i.y=t.isNullOrUndefined(e.clientY)?e.changedTouches[0].clientY:e.clientY,i}function N(e){return e+Jr++}function q(e,t){for(var i=0,r=t.length;i<r;i++)r===t.length?e.appendChild(t[i]):e.appendChild(t[0]);return e}function H(e,t,i){for(var r=e,n=[];r;)(i?r.id===t:r.classList.contains(t))&&n.push(r),r=r.parentElement;return n}function U(e,r,n,o){if("Custom"===e){var s=n.customAggregate;return"string"==typeof s&&(s=t.getValue(s,window)),s?s.call(o,r,n):""}return n.field in r||r instanceof Array?i.DataUtil.aggregates[e.toLowerCase()](r,n.field):null}function j(){if(null!==Xr)return Xr;var e=document.createElement("div"),t=0;return e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth|0,document.body.removeChild(e),Xr=t}function V(e){if(void 0!==ci)return ci;var i=t.createElement("table",{className:"e-table",styles:"visibility: hidden"});i.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(i);var r=i.querySelector("td").getBoundingClientRect();return e.removeChild(i),ci=Math.ceil(r.height)}function G(e){if(void 0!==ui)return ci;var i=t.createElement("table",{className:"e-table",styles:"visibility: hidden"});i.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(i);var r=i.querySelector("tr").getBoundingClientRect();return e.removeChild(i),r.height}function _(e){return e.split(".").length>1}function W(e){return void 0===e&&(e=""),e.replace(/\./g,"___")}function K(e){return void 0===e&&(e=""),e.replace(/___/g,".")}function Q(e,t,i){var r=O(i,"e-row"),n=!r||r&&!r.classList.contains("e-insertedrow");return"beginEdit"===t&&n?!(e.isIdentity||e.isPrimaryKey||!e.allowEditing):("add"!==t||!e.isIdentity)&&!(n&&!e.allowEditing&&!e.isIdentity&&!e.isPrimaryKey)}function J(e){var i=t.select("#"+e.element.id+"EditConfirm",e.element);return"Batch"===e.editSettings.mode&&t.selectAll(".e-updatedtd",e.element).length&&e.editSettings.showConfirmDialog&&(!i||i.classList.contains("e-popup-close"))}function X(e,t){e=e instanceof Array?e:[e];for(var i=0;i<e.length;i++)t?e[i].classList.add("e-wrap"):e[i].classList.remove("e-wrap")}function Y(e,i,r){var n,o=e.getService("valueFormatter");if("date"===i.type||"datetime"===i.type){if(n={type:i.type,skeleton:i.format},t.isBlazor()&&r){n.isServerRendered=r}"string"==typeof i.format&&"yMd"!==i.format&&(n.format=i.format)}switch(i.type){case"date":case"datetime":i.setFormatter(o.getFormatFunction(n)),i.setParser(o.getParserFunction(n));break;case"number":i.setFormatter(o.getFormatFunction({format:i.format})),i.setParser(o.getParserFunction({format:i.format}))}}function $(e,i){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];for(var o=0,s=e.length;o<s;o++)i?(t.classList(e[o],r.slice(),[]),e[o].setAttribute("aria-selected","true")):(t.classList(e[o],[],r.slice()),e[o].removeAttribute("aria-selected"))}function Z(e){for(var t={},i=[],r=0;r<e.length;r++)e[r]in t||(i.push(e[r].toString()),t[e[r]]=1);return i}function ee(e,t,i){var n=t.element.style.display;t.element.style.display="block";var o,s=t.width;o=r.calculateRelativeBasedPosition(e,t.element),t.element.style.display=n,t.element.style.top=o.top+e.getBoundingClientRect().height-5+"px";var l=o.left-s+e.clientWidth;t.element.style.left=l<1?s+l-16+"px":l+-4+"px"}function te(e,t){e.popup.element.style.zIndex=(t.zIndex+1).toString()}function ie(e){var i=e.querySelector(".e-frame"),r=i.previousSibling;i.classList.contains("e-check")?(r.checked=!1,t.classList(i,["e-uncheck"],["e-check"])):(r.checked=!0,t.classList(i,["e-check"],["e-uncheck"]))}function re(e,t){e.checked=t}function ne(e,i,r){var n=t.createElement("div",{className:r});return n.appendChild(i),n.setAttribute("uid",e),n}function oe(e,i){t.removeClass([e],["e-check","e-stop","e-uncheck"]),i?e.classList.add("e-check"):e.classList.add("e-uncheck")}function se(e,i,r){for(o=0;o<i.length;o++)t.setValue(i[o].field,le(i[o],r),e.foreignKeyData);for(var n=e.cells,o=0;o<n.length;o++)n[o].isForeignKey&&t.setValue("foreignKeyData",t.getValue(n[o].column.field,e.foreignKeyData),n[o])}function le(e,r,n,o){var s=e.foreignKeyField,l=t.isNullOrUndefined(n)?g(e.field,r,e):n;l=t.isNullOrUndefined(l)?"":l;var a=new i.Query,h=o||(e.dataSource instanceof i.DataManager&&e.dataSource.dataSource.json.length?e.dataSource.dataSource.json:e.columnData);return l.getDay?a.where(he({field:s,operator:"equal",value:l,matchCase:!1})):a.where(s,"==",l,!1),new i.DataManager(h).executeLocal(a)}function ae(e,t){var i;return t.some(function(t){return i=t,t.foreignKeyValue===e})&&i}function he(e,r){var n,o,s,l=t.extend({},D(e)),a=t.extend({},D(e));if(t.isNullOrUndefined(e.value))return n=new i.Predicate(l.field,l.operator,l.value,!1);var h=new Date(e.value);if("equal"===e.operator||"notequal"===e.operator){"datetime"===r?(o=new Date(h.setSeconds(h.getSeconds()-1)),s=new Date(h.setSeconds(h.getSeconds()+2)),e.value=new Date(h.setSeconds(s.getSeconds()-1))):(o=new Date(h.setHours(0)-1),s=new Date(h.setHours(24))),l.value=o,a.value=s,"equal"===e.operator?(l.operator="greaterthan",a.operator="lessthan"):"notequal"===e.operator&&(l.operator="lessthanorequal",a.operator="greaterthanorequal");var d=new i.Predicate(l.field,l.operator,l.value,!1),p=new i.Predicate(a.field,a.operator,a.value,!1);n="equal"===e.operator?d.and(p):d.or(p)}else"string"==typeof l.value&&(l.value=new Date(l.value)),n=new i.Predicate(l.field,l.operator,l.value,!1);return e.setProperties?e.setProperties({ejpredicate:n},!0):e.ejpredicate=n,n}function de(e,t,i){t=t&&i&&i.isRowDragable()?t+1:t;for(var r=e.cloneNode(!0),n=0;n<t;n++)r.removeChild(r.children[0]);for(var n=t,o=e.childElementCount;n<o;n++)e.removeChild(e.children[e.childElementCount-1]);return r}function pe(e){return e.enableVirtualization&&e.groupSettings.columns.length>0&&e.isVirtualAdaptive}function ce(e,i){if(void 0===e&&(e=""),e){for(var r=i,n=e.split("."),o=0;o<n.length&&!t.isNullOrUndefined(r);o++)r=r[n[o]];return r}}function ue(e,i){var r=new t.Internationalization;return"date"===i?"object"==typeof e?r.getDatePattern({type:e.type?e.type:"date",format:e.format},!1):t.isBlazor()?r.getDatePattern({type:"dateTime",format:e},!1):r.getDatePattern({type:"dateTime",skeleton:e},!1):"object"==typeof e?r.getDatePattern({type:e.type?e.type:"dateTime",format:e.format},!1):t.isBlazor()?r.getDatePattern({type:"dateTime",format:e},!1):r.getDatePattern({type:"dateTime",skeleton:e},!1)}function ge(e,t){for(var i={},r=0,n=e.getRowsObject();r<n.length;r++){var o=n[r];if(o.isExpand&&!o.isDetailRow){var s=e.allowPaging&&"AllPages"===e.printMode?o.index+e.pageSettings.currentPage*e.pageSettings.pageSize-e.pageSettings.pageSize:o.index;i[s]={},i[s].isExpand=!0,i[s].gridModel=fe(o.childGrid,t),i[s].gridModel.query=e.childGrid.query}}return i}function fe(e,t){void 0===t&&(t="Expanded");var i={};if(!e)return i;for(var r=e.isFrozenGrid()&&!e.getFrozenColumns(),n=0,o=Kr.printGridProp;n<o.length;n++){var s=o[n];i[s]="columns"===s?k(r?e.getColumns():e[s]):"allowPaging"===s?"CurrentPage"===e.printMode:D(e[s])}return e.childGrid&&"None"!==t&&(i.expandedRows=ge(e,t)),i}function me(e,i,r,n){var o=e||{},s=arguments.length;n&&(s-=1);for(var l=1;l<s;l++)if(arguments[l])for(var a=arguments[l],h=Object.keys(Object.getPrototypeOf(a)).length?Object.keys(a).concat(ye(a)):Object.keys(a),d=0;d<h.length;d++){var p=o[h[d]],c=a[h[d]],u=void 0;n&&(t.isObject(c)||Array.isArray(c))?t.isObject(c)?(u=p||{},o[h[d]]=t.extend({},u,c,n)):(u=p||[],o[h[d]]=t.extend([],u,c,n)):o[h[d]]=c}return o}function ye(e){for(var t=[];Object.getPrototypeOf(e)&&Object.keys(Object.getPrototypeOf(e)).length;)t=t.concat(Object.keys(Object.getPrototypeOf(e))),e=Object.getPrototypeOf(e);return t}function ve(e){for(var t=0,i=0;i<e.length;i++){var r=Ce(e[i],0);t<r&&(t=r)}return t+1}function Ce(e,t){var i=t,r=[];if(e.columns){t++;for(var n=0;n<e.columns.length;n++)r[n]=Ce(e.columns[n],t);for(var o=0;o<r.length;o++)i<r[o]&&(i=r[o]);t=i}return t}function we(e,t){for(var i=0;i<t.length;i++)t[i].uid=t[i].isForeignKey?ae(t[i].field,e.getForeignKeyColumns()).uid:e.getColumnByField(t[i].field).uid}function be(e){var t=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace(/,/g,"");return{width:parseFloat(t.split(" ")[4]),height:parseFloat(t.split(" ")[5])}}function Se(e,t){e.classList.contains("e-bigger")&&t.classList.add("e-bigger")}function xe(e,i){if(e&&i){var r=t.closest(e,".e-row").getBoundingClientRect().height,n=t.closest(i,".e-row").getBoundingClientRect().height;r>n?i.style.height=r+"px":e.style.height=n+"px"}}function Re(e,t){var i=t.getContent().firstElementChild.offsetHeight;return e&&e.getBoundingClientRect().top>i}function Fe(e,t){return e&&e.getBoundingClientRect().top<t}function ze(e,t){var i=t.getRowHeight(),r=t.getContent().firstElementChild.scrollTop/i;return e<r+t.getContent().firstElementChild.offsetHeight/i&&e>r}function Ie(e,t){var i,r=e.getPrimaryKeyFieldNames()[0];return e.getCurrentViewRecords().filter(function(e,n){e[r]===t[r]&&(i=n)}),i}function Te(e,t){var r;r=Ee(t);var n=new i.Deferred;return r.dataSource=n.resolve,r.action=e,{state:r,deffered:n}}function Ee(e){var t=new i.UrlAdaptor,r=new i.DataManager({url:"",adaptor:new i.UrlAdaptor}),n=t.processQuery(r,e);return JSON.parse(n.data)}function Me(e){for(var i=e.getVisibleColumns(),r=0,n=0,o=0;o<i.length;o++)t.isUndefined(i[o].width)?n++:-1!==i[o].width.toString().indexOf("%")&&r++;return("auto"===e.width||"string"==typeof e.width&&-1!==e.width.indexOf("%"))&&"chrome"!==t.Browser.info.name&&!e.groupSettings.showGroupedColumn&&e.groupSettings.columns.length&&r&&!n}function De(e,t,i,r){for(var n=r||0,o=0;o<t.length;o++)if(t[o].isDataRow){t[o].index=n,t[o].isAltRow=!!e.enableAltRow&&n%2!=0,i[o].setAttribute("aria-rowindex",n.toString()),t[o].isAltRow?i[o].classList.add("e-altrow"):i[o].classList.remove("e-altrow");for(var s=0;s<i[o].cells.length;s++)i[o].cells[s].setAttribute("index",n.toString());n++}t.length||e.renderModule.emptyRow(!0)}function Oe(e,t,i){for(var r=i||0,n=0;n<t.length;n++)t[n].index=r,r++}function Ae(e,t,i,r){var n=e.dataToBeUpdated[i].concat(t[i]).reduce(function(e,t){return e[t[r]]=void 0===e[t[r]]?t:Object.assign(e[t[r]],t),e},{});e.dataToBeUpdated[i]=Object.keys(n).map(function(e){return n[e]})}function Be(e){if(e.isFrozenGrid()){e.contentModule.rowElements=[].slice.call(e.element.querySelectorAll(".e-movableheader .e-row, .e-movablecontent .e-row"));var t="Left-Right"===e.getFrozenMode()?".e-frozen-left-header .e-row, .e-frozen-left-content .e-row":".e-frozenheader .e-row, .e-frozencontent .e-row";e.contentModule.freezeRowElements=[].slice.call(e.element.querySelectorAll(t)),"Left-Right"===e.getFrozenMode()&&(e.contentModule.frozenRightRowElements=[].slice.call(e.element.querySelectorAll(".e-frozen-right-header .e-row, .e-frozen-right-content .e-row")))}else e.contentModule.rowElements=[].slice.call(e.element.querySelectorAll(".e-row:not(.e-addedrow)"))}function ke(e,t,i){var r=e.getFrozenLeftCount(),n=e.getMovableColumnsCount(),o=e.getFrozenRightColumnsCount(),s=e.getFrozenMode(),l=e.isRowDragable()?1:0,a="Right"===s?r+n:r+n+l,h="Right"===s?r:r+l,d="Right"===s?t.length-o-l:o?t.length-o:t.length;return"frozen-left"===i?t=t.slice(0,r?r+l:t.length):"frozen-right"===i?t=t.slice(a,t.length):"movable"===i&&(t=t.slice(h,d)),t}function Le(e,t,i,r,n){(i[0].length||r)&&(n?t("frozen-left",i[0],n[0]):t("frozen-left",i[0])),e.isFrozenGrid()&&(i[1].length||r)&&(n?t("movable",i[1],n[1]):t("movable",i[1])),"Left-Right"!==e.getFrozenMode()&&"Right"!==e.getFrozenMode()||!i[2].length&&!r||(n?t("frozen-right",i[2],n[2]):t("frozen-right",i[2]))}function Pe(e){return["Right"!==e.getFrozenMode()?e.getRowsObject():[],e.getMovableRowsObject(),e.getFrozenRightRowsObject()]}function Ne(e){return["Right"!==e.getFrozenMode()?e.getAllDataRows(!0):[],e.getAllMovableDataRows(!0),e.getAllFrozenRightDataRows(!0)]}function qe(e,t,i){for(var r=e.children.length,n=0,o=0;o<r;o++,n++)o>=t&&o<i||(e.removeChild(e.children[n]),n--)}function He(e,t,i){return"movable"===t.getFreezeTableName()?[].slice.call(e.getMovableDataRows()[i].querySelectorAll(".e-rowcell")):"frozen-right"===t.getFreezeTableName()?[].slice.call(e.getFrozenRightDataRows()[i].querySelectorAll(".e-rowcell")):[].slice.call(e.getDataRows()[i].querySelectorAll(".e-rowcell"))}function Ue(e,t,i,r){var n=e.getFrozenLeftCount(),o=e.getMovableColumnsCount();return r="movable"===t.getFreezeTableName()?r-n:"frozen-right"===t.getFreezeTableName()?r-(n+o):r,He(e,t,i)[r]}function je(e,t,i,r,n,o){"frozen-left"===e.getFreezeTableName()||!t&&"frozen-right"===e.getFreezeTableName()||1===o?i[W(e.field)]=e.validationRules:"movable"!==e.getFreezeTableName()&&e.getFreezeTableName()?"frozen-right"===e.getFreezeTableName()&&(n[W(e.field)]=e.validationRules):r[W(e.field)]=e.validationRules}function Ve(e){var t;return e.isFrozenGrid()&&(t=e.frozenRows&&"Top"===e.editSettings.newRowPosition?e.getMovableHeaderTbody():e.getMovableContentTbody()),t}function Ge(e){var t;return"Left-Right"===e.getFrozenMode()&&(t=e.frozenRows&&"Top"===e.editSettings.newRowPosition?e.getFrozenRightHeaderTbody():e.getFrozenRightContentTbody()),t}function _e(e,t,i,r,n,o,s){e&&r&&s(e,r),t&&n&&s(t,n),i&&o&&s(i,o)}function We(e,i,r){var n,o=new t.Internationalization;if("number"===i)try{n=o.getNumberPattern({format:e,currency:this.currency,useGrouping:!0},!0)}catch(t){n=e}else if("date"===i||"time"===i||"datetime"===i)try{if(n=o.getDatePattern({skeleton:e,type:i},r),t.isNullOrUndefined(n))throw"error"}catch(t){try{n=o.getDatePattern({format:e,type:i},r)}catch(t){n=e}}else n=e;if("number"!==i){var s={G:"",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"};n=n.replace(/G|H|c|'| a|yy|y|EEEE|E/g,function(e){return s[e]})}return n}function Ke(e){if(e.enableAdaptiveUI)for(var t=document.getElementsByClassName("e-responsive-dialog"),i=0;i<t.length;i++)t[i].classList.add("e-bigger")}function Qe(e,t){for(var i,r=e.split(".").length,n=e.split("."),o=t,s=0;s<r;s++)o=i=o[n[s]];return i}function Je(e,t){for(var i=0;i<e.length;i++)for(var r=0;r<e[i].columns.length;r++)t(e[i].columns[r],e[i])}function Xe(e,t,i){var r="Dialog"!==t,n=ue(e.column.format,e.column.type),o=ce(e.column.field,e.rowData);return o=o?new Date(o):null,{floatLabelType:r?"Never":"Always",value:o,format:n,placeholder:r?"":e.column.headerText,enableRtl:i,enabled:Q(e.column,e.requestType,e.element)}}function Ye(e,t,i,r,n,o,s,l){r.clearSelection(),e.startIndex=0;var a=new vi(o,null,r),h=n.generateRows(t,e);e.renderMovableContent?(s.vgenerator.movableCache[1]=h,h=r.getMovableRowsObject()):e.renderFrozenRightContent||e.renderMovableContent?e.renderFrozenRightContent&&(s.vgenerator.frozenRightCache[1]=h,h=r.getFrozenRightRowsObject()):(s.vgenerator.cache[1]=h,h=r.getRowsObject());var d=e.renderMovableContent||e.renderFrozenRightContent?e.renderMovableContent?r.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody"):r.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("tbody"):r.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody");d.innerHTML="";for(var p=0;p<r.frozenRows;p++)if(d.appendChild(a.render(h[p],r.getColumns())),i.indexOf(p)>-1){h[p].isSelected=!0;for(var c=0;c<h[p].cells.length;c++)h[p].cells[c].isSelected=!0}e.renderMovableContent?l.mvblRows=s.vgenerator.movableCache[1]:e.renderMovableContent||e.renderFrozenRightContent?e.renderFrozenRightContent&&(l.frRows=s.vgenerator.frozenRightCache[1]):l.frzRows=s.vgenerator.cache[1],e.renderMovableContent=!e.renderMovableContent&&!e.renderFrozenRightContent,e.renderFrozenRightContent="Left-Right"===r.getFrozenMode()&&!e.renderMovableContent&&!e.renderFrozenRightContent,(e.renderMovableContent||e.renderFrozenRightContent)&&(Ye(e,t,i,r,n,o,s,l),e.renderMovableContent||e.renderFrozenRightContent||(e.isFrozenRowsRender=!1))}function $e(e,i,r){for(var n=[],o=0;o<e.length;o++)n.push(t.extend({},e[o])),n[o].cells=ke(r,n[o].cells,i);return n}function Ze(e,t,i){var r,n=[];"frozen-left"===e?r=t.vgenerator.cache:"movable"===e?r=t.vgenerator.movableCache:"frozen-right"===e&&(r="Right"===i.getFrozenMode()?t.vgenerator.cache:t.vgenerator.frozenRightCache);for(var o=Object.keys(r),s=0;s<o.length;s++)n=n.concat($e(r[o[s]],e,i));return n}function et(e,t){for(var i=Object.keys(t.vgenerator.cache),r=Object.keys(t.vgenerator.movableCache),n=Object.keys(t.vgenerator.frozenRightCache),o=0;o<i.length;o++)tt(e,t.vgenerator.cache[i[o]]);for(o=0;o<r.length;o++)tt(e,t.vgenerator.movableCache[r[o]]);for(o=0;o<n.length;o++)tt(e,t.vgenerator.frozenRightCache[n[o]])}function tt(e,t){for(var i=t.filter(function(t){return e.clearAll||e.uid===t.uid}),r=0;r<i.length;r++){i[r].isSelected=e.set;for(var n=i[r].cells,o=0;o<n.length;o++)n[o].isSelected=e.set}}function it(e,t,i,r,n){e.appendContent(i,r,n),t.refreshFrozenScrollbar()}function rt(e,i,r,n,o){var s=[];s=e.vgenerator.generateRows(i,r).map(function(e){return t.extend({},e)});var l=n.generateRows(i,r,s);return o.frozenRows&&"delete"===r.requestType&&1===o.pageSettings.currentPage&&(l=l.slice(o.frozenRows)),l}function nt(e,t,i,r,n){var o,s=e.virtualInfo.blockIndexes,l=e.virtualInfo.columnIndexes,a=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.renderMovableContent||(e.virtualInfo.columnIndexes=[]);var h=i.getCurrentViewRecords().length;return n=i.renderModule.data.dataManager.dataSource.json.slice(0,h),o=ot(t.vgenerator.generateRows(n,e),i,e,r),e.virtualInfo.blockIndexes=s,e.virtualInfo.columnIndexes=l,e.virtualInfo.page=a,o.splice(0,i.frozenRows)}function ot(e,t,i,r){var n;n=i.renderMovableContent?"movable":i.renderFrozenRightContent?"frozen-right":"frozen-left";for(var o=0,s=e.length;o<s;o++)e[o].cells=ke(t,e[o].cells,n);return e}function st(e){var t=!1;return e&&(t="virtualscroll"===e.requestType&&"X"===e.currentInfo.sentinelInfo.axis),t}function lt(e,t){var i=st(e)?t.getMovableVirtualHeader():t.getHeaderContent();return i?[].slice.call(i.querySelectorAll(".e-headercell:not(.e-stackedheadercell)")):[]}function at(e,t){return st(e)?t.getMovableVirtualHeader().querySelector(".e-table"):t.getFrozenVirtualHeader().querySelector(".e-table")}function ht(e,t){return e=t.columns.slice(0,t.getFrozenColumns()).concat(e)}function dt(e,i,r){return st(i)||(t.isNullOrUndefined(e)||(e.id="content-"+e.id),r.colgroup=e),r.colgroup}function pt(e,t){e.virtualRenderer.vgenerator.cache[1]?e.virtualRenderer.vgenerator.cache[1][t]=e.frzRows[t]:e.virtualRenderer.vgenerator.cache[1]=e.frzRows,e.virtualRenderer.vgenerator.movableCache[1]?e.virtualRenderer.vgenerator.movableCache[1][t]=e.mvblRows[t]:e.virtualRenderer.vgenerator.movableCache[1]=e.mvblRows}function ct(e,t,r,n){var o=e.dataSource instanceof i.DataManager&&!e.dataSource.dataSource.offline,s={container:t.content,pageHeight:2*t.getBlockHeight(),debounceEvent:o,axes:e.enableColumnVirtualization?["X","Y"]:["Y"],scrollbar:r,movableContainer:n};t.observer=new kn(t.virtualEle.wrapper,s,t.virtualEle.movableWrapper)}var ut=function(){function e(e){this.intl=new t.Internationalization,t.isNullOrUndefined(e)||(this.intl.culture=e)}return e.prototype.getFormatFunction=function(e){if(e.type){if(t.isBlazor()){e.isServerRendered=!0}return this.intl.getDateFormat(e)}return this.intl.getNumberFormat(e)},e.prototype.getParserFunction=function(e){if(e.type){if(t.isBlazor()){e.isServerRendered=!0}return this.intl.getDateParser(e)}return this.intl.getNumberParser(e)},e.prototype.fromView=function(e,i,r){return"date"!==r&&"datetime"!==r&&"number"!==r||t.isNullOrUndefined(i)?e:i(e)},e.prototype.toView=function(e,i){var r=e;return t.isNullOrUndefined(i)||t.isNullOrUndefined(e)||(r=i(e)),r},e.prototype.setCulture=function(e){t.isNullOrUndefined(e)||t.setCulture(e)},e}(),gt=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},ft=function(){function e(e,r){var n=this;this.disableHtmlEncode=!0,this.allowSorting=!0,this.allowResizing=!0,this.allowFiltering=!0,this.allowGrouping=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.enableGroupByFormat=!1,this.allowEditing=!0,this.filter={},this.showInColumnChooser=!0,this.edit={},this.allowSearching=!0,this.autoFit=!1,this.sortDirection="Descending",this.getEditTemplate=function(){return n.editTemplateFn},this.getFilterTemplate=function(){return n.filterTemplateFn},t.merge(this,e),this.parent=r,"none"===this.type?this.type=t.isBlazor()&&!t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(this.field)?"none":null:this.type&&(this.type="string"==typeof this.type?this.type.toLowerCase():void 0),this.editType&&(this.editType=this.editType.toLowerCase()),t.isNullOrUndefined(this.uid)&&(this.uid=N("grid-column"));var o=new ut;if(e.format&&(e.format.skeleton||e.format.format)&&(this.setFormatter(o.getFormatFunction(t.extend({},e.format))),this.setParser(o.getParserFunction(e.format))),this.toJSON=function(){for(var e={},i=["filter","dataSource",t.isBlazor()?" ":"headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate","parent"],r=Object.keys(n),o=0;o<r.length;o++)if("columns"===r[o]){e[r[o]]=[];for(var s=0;s<n[r[o]].length;s++)e[r[o]].push(n[r[o]][s].toJSON())}else i.indexOf(r[o])<0&&(e[r[o]]=n[r[o]]);return e},this.field||(this.allowFiltering=!1,this.allowGrouping=!1,this.allowSorting=!1,this.columns&&(this.allowResizing=this.columns.some(function(e){return e.allowResizing}))),this.commands&&!this.textAlign&&(this.textAlign="Right"),(this.template||this.commandsTemplate)&&(this.templateFn=R(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=R(this.headerTemplate)),!t.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=R(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=R(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=R(this.filterTemplate)),this.isForeignColumn()&&(t.isNullOrUndefined(this.editType)||"dropdownedit"===this.editType||"defaultedit"===this.editType)&&(this.editType="dropdownedit",this.edit.params=t.extend({dataSource:this.dataSource,query:new i.Query,fields:{value:this.foreignKeyField||this.field,text:this.foreignKeyValue}},this.edit.params)),this.sortComparer){var s=this.sortComparer;this.sortComparer=function(e,t,i,r){if("string"==typeof s&&(s=ce(s,window)),"Descending"===this.sortDirection){var n=e;e=t,t=n;var o=i;i=r,r=o}return s(e,t,i,r)}}!this.sortComparer&&this.isForeignColumn()&&(this.sortComparer=function(e,t){return e=ce(n.foreignKeyValue,le(n,{},e)[0]),t=ce(n.foreignKeyValue,le(n,{},t)[0]),"Descending"===n.sortDirection?i.DataUtil.fnDescending(e,t):i.DataUtil.fnAscending(e,t)})}return e.prototype.getSortDirection=function(){return this.sortDirection},e.prototype.setSortDirection=function(e){this.sortDirection=e},e.prototype.getFreezeTableName=function(){return this.freezeTable},e.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)this[t[i]]=e[t[i]],this.parent&&this.parent.isReact&&"template"===t[i]&&this.parent.refreshReactColumnTemplateByUid(this.uid)},e.prototype.isForeignColumn=function(){return!(!this.dataSource||!this.foreignKeyValue)},e.prototype.getFormatter=function(){return this.formatFn},e.prototype.setFormatter=function(e){this.formatFn=e},e.prototype.getParser=function(){return this.parserFn},e.prototype.setParser=function(e){this.parserFn=e},e.prototype.getColumnTemplate=function(){return this.templateFn},e.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},e.prototype.getFilterItemTemplate=function(){return this.fltrTemplateFn},e.prototype.getDomSetter=function(){return this.disableHtmlEncode?"textContent":"innerHTML"},e}(),mt=function(){function e(){}return gt([t.Property()],e.prototype,"title",void 0),gt([t.Property()],e.prototype,"type",void 0),gt([t.Property()],e.prototype,"buttonOption",void 0),e}(),yt="actionBegin",vt="actionComplete",Ct="dataBound",wt="columnDragStart",bt="columnDrag",St="columnDrop",xt="rowDragStartHelper",Rt="rowDragStart",Ft="rowDrag",zt="rowDrop",It="initial-load",Tt="initial-end",Et="data-ready",Mt="content-ready",Dt="ui-update",Ot="on-empty",At="inbound-model-changed",Bt="model-changed",kt="colgroup-refresh",Lt="header-refreshed",Pt="reorder-complete",Nt="beforecellfocused",qt="key-pressed",Ht="click",Ut="destroy",jt="column-visible-changed",Vt="column-position-changed",Gt="rows-added",_t="rows-removed",Wt="column-drag-stop",Kt="header-drop",Qt="datasource-modified",Jt="refresh-virtual-block",Xt="toolbar-refresh",Yt="auto-col",$t="update-data",Zt="prevent-batch",ei="dialog-destroy",ti="add-delete-Action",ii="freezerender",ri="hierarchyprint",ni="expandchildgrid",oi="row-position-changed",si="columns-prepared",li="cbox-filter-complete",ai="filter-Prevent",hi="get-virtual-data",di="refresh-infinite-mode-blocks",pi="refreshResizeHandlers";!function(e){e[e.Data=0]="Data",e[e.Header=1]="Header",e[e.Summary=2]="Summary",e[e.GroupSummary=3]="GroupSummary",e[e.CaptionSummary=4]="CaptionSummary",e[e.Filter=5]="Filter",e[e.Indent=6]="Indent",e[e.GroupCaption=7]="GroupCaption",e[e.GroupCaptionEmpty=8]="GroupCaptionEmpty",e[e.Expand=9]="Expand",e[e.HeaderIndent=10]="HeaderIndent",e[e.StackedHeader=11]="StackedHeader",e[e.DetailHeader=12]="DetailHeader",e[e.DetailExpand=13]="DetailExpand",e[e.CommandColumn=14]="CommandColumn",e[e.DetailFooterIntent=15]="DetailFooterIntent",e[e.RowDragIcon=16]="RowDragIcon",e[e.RowDragHIcon=17]="RowDragHIcon"}(e.CellType||(e.CellType={})),function(e){e[e.Header=0]="Header",e[e.Content=1]="Content",e[e.Summary=2]="Summary"}(e.RenderType||(e.RenderType={})),function(e){e[e.Add=0]="Add",e[e.Edit=1]="Edit",e[e.Update=2]="Update",e[e.Delete=3]="Delete",e[e.Cancel=4]="Cancel",e[e.Print=5]="Print",e[e.Search=6]="Search",e[e.ColumnChooser=7]="ColumnChooser",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.WordExport=11]="WordExport"}(e.ToolbarItem||(e.ToolbarItem={})),function(e){e[e.isEdit=0]="isEdit",e[e.isAdd=1]="isAdd",e[e.isSort=2]="isSort",e[e.isFilter=3]="isFilter"}(e.ResponsiveDialogAction||(e.ResponsiveDialogAction={})),function(e){e[e.isInitial=0]="isInitial",e[e.isSearch=1]="isSearch"}(e.ResponsiveToolbarAction||(e.ResponsiveToolbarAction={}));var ci,ui,gi=function(){function e(e,t){this.dataState={isPending:!1,resolver:null,group:[]},this.foreignKeyDataState={isPending:!1,resolver:null},this.parent=e,this.serviceLocator=t,this.initDataManager(),this.parent.isDestroyed||"foreignKey"===this.getModuleName()||(this.parent.on(Gt,this.addRows,this),this.parent.on(oi,this.reorderRows,this),this.parent.on(_t,this.removeRows,this),this.parent.on(Qt,this.initDataManager,this),this.parent.on(Ut,this.destroy,this),this.parent.on($t,this.crudActions,this),this.parent.on(ti,this.getData,this),this.parent.on(Yt,this.refreshFilteredCols,this),this.parent.on(si,this.refreshFilteredCols,this))}return e.prototype.reorderRows=function(e){this.dataManager.dataSource.json.splice(e.toIndex,0,this.dataManager.dataSource.json.splice(e.fromIndex,1)[0])},e.prototype.getModuleName=function(){return"data"},e.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof i.DataManager?e.dataSource:t.isNullOrUndefined(e.dataSource)?new i.DataManager:new i.DataManager(e.dataSource),!e.isAngular||e.query instanceof i.Query?(this.isQueryInvokedFromData=!0,e.query=e.query instanceof i.Query?e.query:new i.Query):e.setProperties({query:new i.Query},!0)},e.prototype.generateQuery=function(e){var t=this.parent.getQuery().clone();if("ExcludeHidden"===this.parent.columnQueryMode)t.select(this.parent.getColumns().filter(function(e){return!(!0!==e.isPrimaryKey&&!1===e.visible||void 0===e.field)}).map(function(e){return e.field}));else if("Schema"===this.parent.columnQueryMode){for(var i=[],r=this.parent.columns,n=0;n<r.length;n++)i.push(r[n].field);t.select(i)}return this.filterQuery(t),this.searchQuery(t),this.aggregateQuery(t),this.sortQuery(t),pe(this.parent)?this.virtualGroupPageQuery(t):this.pageQuery(t,e),this.groupQuery(t),t},e.prototype.aggregateQuery=function(e,t){for(var i=this.parent.aggregates,r=0;r<i.length;r++)for(var n=i[r],o=0;o<n.columns.length;o++)for(var s=n.columns[o],l=s.type instanceof Array?s.type:[s.type],a=0;a<l.length;a++)e.aggregate(l[a].toLowerCase(),s.field);return e},e.prototype.virtualGroupPageQuery=function(e){this.parent;if(e.queries.length)for(var t=0;t<e.queries.length;t++)"onPage"===e.queries[t].fn&&e.queries.splice(t,1);return e},e.prototype.pageQuery=function(e,i){var r=this.parent;if((r.allowPaging||r.enableVirtualization||r.enableInfiniteScrolling)&&!0!==i){if(r.pageSettings.currentPage=Math.max(1,r.pageSettings.currentPage),r.pageSettings.pageCount<=0&&(r.pageSettings.pageCount=8),r.pageSettings.pageSize<=0&&(r.pageSettings.pageSize=12),e.queries.length)for(var n=0;n<e.queries.length;n++)"onPage"===e.queries[n].fn&&e.queries.splice(n,1);!t.isNullOrUndefined(r.infiniteScrollModule)&&r.enableInfiniteScrolling?this.parent.notify("infinite-page-query",e):e.page(r.pageSettings.currentPage,r.pageSettings.pageSize)}return e},e.prototype.groupQuery=function(e){var t=this.parent;if(t.allowGrouping&&t.groupSettings.columns.length){this.parent.groupSettings.enableLazyLoading&&e.lazyLoad.push({key:"isLazyLoad",value:this.parent.groupSettings.enableLazyLoading});for(var i=t.groupSettings.columns,r=0,n=i.length;r<n;r++){var o=this.getColumnByField(i[r]);o||this.parent.log("initial_action",{moduleName:"group",columnName:i[r]});var s=o.enableGroupByFormat,l=o.format;s?e.group(i[r],this.formatGroupColumn.bind(this),l):e.group(i[r],null)}}return e},e.prototype.sortQuery=function(e){var t=this.parent;if((t.allowSorting||t.allowGrouping)&&t.sortSettings.columns.length){for(var i=t.sortSettings.columns,r=[],n=i.length-1;n>-1;n--){if(!(l=this.getColumnByField(i[n].field)))return this.parent.log("initial_action",{moduleName:"sort",columnName:i[n].field}),e;l.setSortDirection(i[n].direction);var o=i[n].direction;l.sortComparer&&(this.parent.log("grid_sort_comparer"),o=this.isRemote()?i[n].direction:l.sortComparer.bind(l)),-1===t.groupSettings.columns.indexOf(i[n].field)?l.isForeignColumn()||l.sortComparer?e.sortByForeignKey(l.field,o,void 0,i[n].direction.toLowerCase()):e.sortBy(l.field,o):r.push({direction:o,field:l.field})}for(var n=0,s=r.length;n<s;n++)if("string"==typeof r[n].direction)e.sortBy(r[n].field,r[n].direction);else{var l=this.getColumnByField(r[n].field);e.sortByForeignKey(r[n].field,r[n].direction,void 0,l.getSortDirection().toLowerCase())}}return e},e.prototype.searchQuery=function(e,t,r){var n=this.parent.searchSettings,o=n.fields.length?n.fields:this.getSearchColumnFieldNames(),s=[],l=!1;if(this.parent.searchSettings.key.length){l=this.parent.getForeignKeyColumns().some(function(e){return o.indexOf(e.field)>-1});var a=r?t.dataSource.adaptor:this.dataManager.adaptor;if(l||a.getModuleName&&"ODataV4Adaptor"===a.getModuleName()){o=r?[t.foreignKeyValue]:o;for(var h=0;h<o.length;h++){var d=r?t:this.getColumnByField(o[h]);d.isForeignColumn()&&!r?s=this.fGeneratePredicate(d,s):s.push(new i.Predicate(o[h],n.operator,n.key,n.ignoreCase,n.ignoreAccent))}var p=i.Predicate.or(s);p.key=n.key,e.where(p)}else e.search(n.key,o,n.operator,n.ignoreCase,n.ignoreAccent)}return e},e.prototype.filterQuery=function(e,r,n){var o,s=this.parent,l=[],a=[],h=this.parent.getForeignKeyColumns();if(s.allowFiltering&&s.filterSettings.columns.length){for(var d=r||s.filterSettings.columns,p={},c=0,u=s.getColumns();c<u.length;c++)p[(v=u[c]).field]=v.filter.type?v.filter.type:s.filterSettings.type;for(var g=[],f=[],m=0,y=d;m<y.length;m++){var v=y[m],C=s.getColumnByField(v.field);t.isNullOrUndefined(v.type)&&C&&("date"===C.type||"datetime"===C.type)&&(v.type=s.getColumnByField(v.field).type),v.isForeignKey?g.push(v):f.push(v)}if(f.length){if("FilterBar"===s.filterSettings.type||"Menu"===s.filterSettings.type)for(var w=0,b=f.length;w<b;w++)f[w].uid=f[w].uid||this.parent.grabColumnByFieldFromAllCols(f[w].field).uid;for(var S=Yr.getPredicate(f),x=0,R=Object.keys(S);x<R.length;x++){M=R[x];l.push(S[M])}}if(g.length)for(var F=0,z=g;F<z.length;F++){(v=z[F]).uid=v.uid||this.parent.grabColumnByFieldFromAllCols(v.field).uid;var I=this.parent.grabColumnByUidFromAllCols(v.uid);if(I||this.parent.log("initial_action",{moduleName:"filter",columnName:v.field}),I.isForeignColumn()&&ae(v.field,h)&&!n)a.push(v),I.columnData.length||(o=!0),l=this.fGeneratePredicate(I,l);else for(var S=Yr.getPredicate(d),T=0,E=Object.keys(S);T<E.length;T++){var M=E[T];l.push(S[M])}}l.length&&!o?e.where(i.Predicate.and(l)):this.parent.notify("showEmptyGrid",{})}return e},e.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify("generateQuery",{predicate:i,column:e}),i.predicate.predicates.length&&t.push(i.predicate)),t},e.prototype.getData=function(e,i){var r=this;void 0===e&&(e={requestType:""});var n=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());if(this.parent.log("datasource_syntax_mismatch",{dataState:this.parent}),this.parent.dataSource&&"result"in this.parent.dataSource)return this.eventPromise(e,i,n).promise;var o=void 0;switch(e.requestType){case"delete":if(i=i||this.generateQuery(),1===Object.keys(e.data).length)o=this.dataManager.remove(n,e.data[0],i.fromTable,i);else{var s={addedRecords:[],deletedRecords:[],changedRecords:[]};s.deletedRecords=e.data,o=this.dataManager.saveChanges(s,n,i.fromTable,i.requiresCount())}break;case"save":t.isBlazor()&&this.parent.isServerRendered&&this.parent.notify("offset",e),i=i||this.generateQuery(),e.index=t.isNullOrUndefined(e.index)?0:e.index,o=this.dataManager.insert(e.data,i.fromTable,i,e.index)}return e.promise=o,!o||Array.isArray(o)||o.hasOwnProperty("deletedRecords")?this.insert(i,e):t.isBlazor()?o.then(function(t){return r.insert(i,e)}).catch(function(e){return null}):o.then(function(t){return r.insert(i,e)})},e.prototype.insert=function(e,t){return"save"===t.requestType&&this.parent.notify("recordAdded",t),this.executeQuery(e)},e.prototype.executeQuery=function(e){var t=this;if(this.dataManager.ready){var r=new i.Deferred;return this.dataManager.ready.then(function(i){t.dataManager.executeQuery(e).then(function(e){r.resolve(e)})}).catch(function(e){r.reject(e)}),r.promise}return this.dataManager.executeQuery(e)},e.prototype.formatGroupColumn=function(e,i){this.parent;var r=this.serviceLocator,n=this.getColumnByField(i),o=e;return n.type||(n.type=o.getDay?o.getHours()>0||o.getMinutes()>0||o.getSeconds()>0||o.getMilliseconds()>0?"datetime":"date":typeof e),t.isNullOrUndefined(n.getFormatter())&&Y(r,n),ut.prototype.toView(e,n.getFormatter())},e.prototype.crudActions=function(e){var i=this.generateQuery(),r=null,n="promise",o=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());switch(this.parent.dataSource&&"result"in this.parent.dataSource&&this.eventPromise(e,i,o),e.requestType){case"save":t.isBlazor()&&this.parent.isServerRendered&&this.parent.notify("offset",e),r=this.dataManager.update(o,e.data,i.fromTable,i,e.previousData)}e[n]=r||e[n],this.parent.notify("crud-Action",e)},e.prototype.saveChanges=function(e,r,n,o){if(void 0===o&&(o=this.generateQuery()),o.requiresCount(),"result"in this.parent.dataSource){this.getStateEventArgument(o);var s=new i.Deferred,l={requestType:"batchsave",changes:e,key:r,query:o,endEdit:s.resolve};return this.setState({isPending:!0,resolver:s.resolve}),this.parent.trigger("dataSourceChanged",l),s.promise}if(t.isBlazor()&&this.parent.isServerRendered){for(a=0;a<e.changedRecords.length;a++){l={data:e.changedRecords[a]};this.parent.notify("offset",l),e.changedRecords[a]=l.data}for(var a=0;a<e.addedRecords.length;a++){l={data:e.addedRecords[a]};this.parent.notify("offset",l),e.addedRecords[a]=l.data}}return this.dataManager.saveChanges(e,r,o.fromTable,o,n)},e.prototype.getKey=function(e){if(e&&e.length)return e[0]},e.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},e.prototype.addRows=function(e){for(var t=e.records.length;t>0;t--)this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1])},e.prototype.removeRows=function(e){var t=this.dataManager.dataSource.json;this.dataManager.dataSource.json=t.filter(function(t,i){return-1===e.records.indexOf(t)})},e.prototype.getColumnByField=function(e){var t;return this.parent.columnModel.some(function(i){return t=i,i.field===e})&&t},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Gt,this.addRows),this.parent.off(_t,this.removeRows),this.parent.off(Qt,this.initDataManager),this.parent.off(Ut,this.destroy),this.parent.off($t,this.crudActions),this.parent.off(ti,this.getData),this.parent.off(Yt,this.refreshFilteredCols),this.parent.off(si,this.refreshFilteredCols))},e.prototype.getState=function(){return this.dataState},e.prototype.setState=function(e){return this.dataState=e},e.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},e.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},e.prototype.getStateEventArgument=function(e){var r=new i.UrlAdaptor,n=new i.DataManager({url:"",adaptor:new i.UrlAdaptor}),o=r.processQuery(n,e),s=JSON.parse(o.data);return t.extend(s,o.pvtData)},e.prototype.eventPromise=function(e,t,r){var n,o=this,s=e;n=this.getStateEventArgument(t);var l=new i.Deferred,a=new i.Deferred;if(void 0!==e.requestType&&!1!==this.dataState.isDataChanged)if(n.action=e,"save"===e.requestType||"delete"===e.requestType){var h=e;h.key=r;h.promise=a.promise,h.state=n,this.setState({isPending:!0,resolver:a.resolve}),s.endEdit=a.resolve,s.cancelEdit=a.reject,this.parent.trigger("dataSourceChanged",h),a.promise.then(function(e){o.setState({isPending:!0,resolver:l.resolve,group:n.group,aggregates:n.aggregates}),"save"===h.requestType&&o.parent.notify("recordAdded",h),o.parent.trigger("dataStateChange",n)}).catch(function(){})}else this.setState({isPending:!0,resolver:l.resolve,group:n.group,aggregates:n.aggregates}),this.parent.trigger("dataStateChange",n);else this.setState({}),l.resolve(this.parent.dataSource);return l},e.prototype.getSearchColumnFieldNames=function(){for(var e=[],i=0,r=this.parent.getColumns();i<r.length;i++){var n=r[i];n.allowSearching&&!t.isNullOrUndefined(n.field)&&e.push(n.field)}return e},e.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&we(this.parent,this.parent.filterSettings.columns)},e}(),fi=function(){function e(e,i){t.merge(this,e),this.parent=i}return e.prototype.clone=function(){var i=new e({});return t.merge(i,this),i.cells=this.cells.map(function(e){return e.clone()}),i},e.prototype.setRowValue=function(e){if(this.parent){var t=this.data[this.parent.getPrimaryKeyFieldNames()[0]];this.parent.setRowData(t,e)}},e.prototype.setCellValue=function(e,t){if(this.parent&&!(this.data[e].toString()===t.toString())){var i=this.parent.getPrimaryKeyFieldNames()[0],r=this.data[i];this.parent.setCellValue(r,e,t),this.makechanges(i,this.data)}},e.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)},e}(),mi=function(){function e(e){this.isSpanned=!1,this.isRowSpanned=!1,t.merge(this,e)}return e.prototype.clone=function(){var i=new e({});return t.merge(i,this),i},e}(),yi=function(){function i(e,t){this.serviceLocator=e,this.parent=t}return i.prototype.render=function(i,r,n,o){var s,l=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(r.cells[n].cellType||e.CellType.Data),a=r.cells[n].cellSpan?r.cells[n].cellSpan:i.colSpan+n<=r.cells.length?i.colSpan:r.cells.length-n,h=i.rowSpan,d=0;if(r.index>0){var p=this.parent.groupSettings.columns.length>0&&!this.parent.getRowsObject()[r.index-1].isDataRow?this.parent.getRowsObject()[r.index].cells:this.parent.getRowsObject()[r.index-1].cells,c=r.cells[n];s=p.filter(function(e){return e.column.uid===c.column.uid})[0]}for(var u=s&&s.colSpanRange>1&&s.rowSpanRange>1?s.colSpanRange:a,g=n+1;g<n+u&&g<r.cells.length;g++)!1===r.cells[g].visible?d++:r.cells[g].isSpanned=!0;if(d>0){for(g=n+a;g<n+a+d&&g<r.cells.length;g++)r.cells[g].isSpanned=!0;n+a+d>=r.cells.length&&(a-=n+a+d-r.cells.length)}return r.cells[n].cellSpan&&(r.data[i.column.field]=r.cells[n].spanText,o=l.render(r.cells[n],r.data,{index:t.isNullOrUndefined(r.index)?"":r.index.toString()})),a>1&&t.attributes(o,{colSpan:a.toString(),"aria-colSpan":a.toString()}),h>1&&(t.attributes(o,{rowspan:h.toString(),"aria-rowspan":h.toString()}),r.cells[n].isRowSpanned=!0,r.cells[n].rowSpanRange=Number(h),a>1&&(r.cells[n].colSpanRange=Number(a))),r.index>0&&s.rowSpanRange>1&&(r.cells[n].isSpanned=!0,r.cells[n].rowSpanRange=Number(s.rowSpanRange-1),r.cells[n].colSpanRange=s.rowSpanRange>0?s.colSpanRange:1),!this.parent.enableColumnVirtualization||r.cells[n].cellSpan||this.containsKey(i.column.field,i.data[i.column.field])||this.backupMergeCells(i.column.field,i.data[i.column.field],i.colSpan),o},i.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},i.prototype.generteKey=function(e,t){return e+"__"+t.toString()},i.prototype.splitKey=function(e){return e.split("__")},i.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},i.prototype.getMergeCells=function(){return this.parent.mergeCells},i.prototype.setMergeCells=function(e,t){this.parent.mergeCells[e]=t},i.prototype.updateVirtualCells=function(e){for(var t=this.getMergeCells(),i=0,r=Object.keys(t);i<r.length;i++){var n=r[i],o=t[n],s=this.splitKey(n),l=this.getIndexFromAllColumns(s[0]),a=this.parent.getColumnIndexesInView(),h=o-(a[0]-l);if(l<a[0]&&h>1)for(var d=0,p=e;d<p.length;d++){var c=p[d];if(c.data[s[0]].toString()===s[1].toString()){c.cells[0].cellSpan=h,c.cells[0].spanText=s[1];break}}}return e},i.prototype.getIndexFromAllColumns=function(e){return S(this.parent.getVisibleColumns(),function(t,i){if(t.field===e)return i})[0]},i}(),vi=function(){function i(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}return i.prototype.render=function(e,t,i,r,n){return this.refreshRow(e,t,i,r,n)},i.prototype.refresh=function(e,t,i,r,n){i&&(e.data=me({},e.changes),this.refreshMergeCells(e));var o=this.parent.element.querySelector("[data-uid="+e.uid+"]"),s=this.refreshRow(e,t,r,n,null,i),l=[].slice.call(s.cells);o.innerHTML="";for(var a=0,h=l;a<h.length;a++){var d=h[a];o.appendChild(d)}},i.prototype.refreshRow=function(i,r,n,o,s,l){var a=t.isNullOrUndefined(s)?this.element.cloneNode():s,h={data:i.data},d={data:i.data},p=t.extend({},n,{}),c=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],u=!1;c&&(u=ce(c.field,h.data)),i.isDataRow&&(i.isSelected=this.parent.getSelectedRowIndexes().indexOf(i.index)>-1||u),i.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(i.isSelected=!0,-1===this.parent.getSelectedRowIndexes().indexOf(i.index)&&this.parent.getSelectedRowIndexes().push(i.index)),this.buildAttributeFromRow(a,i),t.attributes(a,p),F(a,i.attributes);for(var g=this.serviceLocator.getService("cellRendererFactory"),f=this,m=0,y=i.cells.length;m<y;m++)!function(r,n){var o=i.cells[r];o.isSelected=i.isSelected,o.isColumnSelected=o.column.isSelected;var s=g.getCellRenderer(i.cells[r].cellType||e.CellType.Data),h={index:t.isNullOrUndefined(i.index)?"":i.index.toString()};i.isExpand&&i.cells[r].cellType===e.CellType.DetailExpand&&(h.class=f.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand");var p=s.render(i.cells[r],i.data,h,i.isExpand,l);if(i.cells[r].cellType!==e.CellType.Filter){if(i.cells[r].cellType===e.CellType.Data||i.cells[r].cellType===e.CellType.CommandColumn){f.parent.trigger("queryCellInfo",t.extend(d,{cell:p,column:o.column,colSpan:1,rowSpan:1,foreignKeyData:i.cells[r].foreignKeyData,requestType:f.parent.requestTypeAction}));var c=!1;if(i.index>0&&f.isSpan){var u=(f.parent.groupSettings.columns.length>0&&!f.parent.getRowsObject()[i.index-1].isDataRow?f.parent.getRowsObject()[i.index].cells:f.parent.getRowsObject()[i.index-1].cells).filter(function(e){return e.column.uid===i.cells[r].column.uid})[0];c=u.isRowSpanned?u.isRowSpanned:u.rowSpanRange>1}(d.colSpan>1||i.cells[r].cellSpan>1||d.rowSpan>1||c)&&(f.isSpan=!0,p=new yi(f.serviceLocator,f.parent).render(d,i,r,p))}i.cells[r].isSpanned||a.appendChild(p)}}(m);var v={row:a,rowHeight:this.parent.rowHeight};if(i.isDataRow&&(this.parent.trigger("rowDataBound",t.extend(h,v)),this.parent.childGrid||this.parent.isRowDragable()||this.parent.detailTemplate)){var C=a.querySelectorAll(".e-rowcell:not(.e-hide)")[0];C&&C.classList.add("e-detailrowvisible")}if(this.parent.enableVirtualization&&(h.rowHeight=this.parent.rowHeight),h.rowHeight?a.style.height=h.rowHeight+"px":this.parent.rowHeight&&(a.querySelector(".e-headercell")||a.querySelector(".e-groupcaption"))&&(a.style.height=this.parent.rowHeight+"px"),i.cssClass&&a.classList.add(i.cssClass),i.lazyLoadCssClass&&a.classList.add(i.lazyLoadCssClass),!(this.parent.enableColumnVirtualization&&0!==this.parent.frozenColumns)&&this.parent.element.scrollHeight>this.parent.height&&this.parent.aggregates.length)for(m=0;m<this.parent.aggregates.length;m++){if(this.parent.aggregates[m].properties.columns[0].footerTemplate){var w=a.querySelectorAll(".e-summarycell");if(w.length){var b=w[w.length-1];t.addClass([b],["e-lastsummarycell"]);var S=w[0];t.addClass([S],["e-firstsummarycell"])}}}return a},i.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++)i[t].isSpanned=!1;return e},i.prototype.buildAttributeFromRow=function(e,i){var r={},n={rowindex:"aria-rowindex",dataUID:"data-uid",ariaSelected:"aria-selected"},o=[];i.isDataRow&&o.push("e-row"),i.isAltRow&&o.push("e-altrow"),t.isNullOrUndefined(i.index)||(r[n.rowindex]=i.index),i.rowSpan&&(r.rowSpan=i.rowSpan),i.uid&&(r[n.dataUID]=i.uid),i.isSelected&&(r[n.ariaSelected]=!0),!1===i.visible&&o.push("e-hide"),r.class=o,F(e,r)},i}(),Ci=function(){function i(e){this.parent=e}return i.prototype.generateRows=function(e,t){var i=[],r=this.parent.enableVirtualization&&t?t.startIndex:0;r=this.parent.enableInfiniteScrolling&&t?this.getInfiniteIndex(t):r;for(var n=0,o=Object.keys(e).length;n<o;n++,r++)i[n]=this.generateRow(e[n],r);return i},i.prototype.ensureColumns=function(){var t=[];if(this.parent.detailTemplate||this.parent.childGrid){var i={};this.parent.notify("detail-indentcell-info",i),t.push(this.generateCell(i,null,e.CellType.DetailExpand))}return this.parent.isRowDragable()&&t.push(this.generateCell({},null,e.CellType.RowDragIcon)),t},i.prototype.generateRow=function(e,i,r,n,o,s,l){var a={};a.foreignKeyData={};a.uid=t.isBlazor()&&this.parent.isServerRendered?this.parent.getRowUid("grid-row"):N("grid-row"),a.data=e,a.index=i,a.indent=n,a.tIndex=s,a.isDataRow=!0,a.parentGid=o,a.parentUid=l,this.parent.isPrinting&&("All"===this.parent.hierarchyPrintMode?a.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[i]&&(a.isExpand=this.parent.expandedRows[i].isExpand)),a.cssClass=r,a.isAltRow=!!this.parent.enableAltRow&&i%2!=0,a.isAltRow=!!this.parent.enableAltRow&&i%2!=0,t.isBlazor()&&this.parent.isServerRendered&&this.parent.enableVirtualization&&this.parent.selectionModule.checkBoxState?(a.isSelected=this.parent.selectionModule.checkBoxState,a.isSelected&&-1===this.parent.selectionModule.selectedRowIndexes.indexOf(i)&&this.parent.selectionModule.selectedRowIndexes.push(i)):a.isSelected=this.parent.getSelectedRowIndexes().indexOf(i)>-1,this.refreshForeignKeyRow(a);var h=this.ensureColumns(),d=t.isBlazor()?new fi(a):new fi(a,this.parent);return d.cells="Right"===this.parent.getFrozenMode()?this.generateCells(a).concat(h):h.concat(this.generateCells(a)),d},i.prototype.refreshForeignKeyRow=function(e){for(var i=this.parent.getForeignKeyColumns(),r=0;r<i.length;r++)t.setValue(i[r].field,le(i[r],e.data),e.foreignKeyData)},i.prototype.generateCells=function(i){for(var r=this.parent.getColumns(),n=[],o=0;o<r.length;o++)n.push(this.generateCell(r[o],i.uid,t.isNullOrUndefined(r[o].commands)?void 0:e.CellType.CommandColumn,null,o,i.foreignKeyData));return n},i.prototype.generateCell=function(i,r,n,o,s,l){var a={visible:i.visible,isDataCell:!t.isNullOrUndefined(i.field||i.template),isTemplate:!t.isNullOrUndefined(i.template),rowID:r,column:i,cellType:t.isNullOrUndefined(n)?e.CellType.Data:n,colSpan:o,commands:i.commands,isForeignKey:i.isForeignColumn&&i.isForeignColumn(),foreignKeyData:i.isForeignColumn&&i.isForeignColumn()&&t.getValue(i.field,l)};return(a.isDataCell||"checkbox"===a.column.type||a.commands)&&(a.index=s),new mi(a)},i.prototype.refreshRows=function(e){for(var t=0;t<e.length;t++)this.refreshForeignKeyRow(e[t]),e[t].cells=this.generateCells(e[t]);return e},i.prototype.getInfiniteIndex=function(e){return"infiniteScroll"===e.requestType||"delete"===e.requestType||"add"===e.action?e.startIndex:0},i}(),wi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bi=function(){function i(e){this.parent=e}return i.prototype.getData=function(){for(var e=this,t=[],i=this.parent.aggregates.slice(),r=0;r<i.length;r++){var n=i[r].columns.filter(function(t){return!(t.footerTemplate||t.groupFooterTemplate||t.groupCaptionTemplate)||e.columnSelector(t)});n.length&&t.push({columns:n})}return t},i.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},i.prototype.getColumns=function(e,i){var r=[];if(this.parent.allowGrouping)for(var n=0;n<this.parent.groupSettings.columns.length;n++)r.push(new ft({}));return(this.parent.detailTemplate||!t.isNullOrUndefined(this.parent.childGrid)||this.parent.isRowDragable()&&!e)&&r.push(new ft({})),r.push.apply(r,this.parent.getColumns()),i=i?i+this.parent.getIndentCount():i,t.isNullOrUndefined(e)?r:r.slice(e,i)},i.prototype.generateRows=function(e,t,i,r,n){if(0===e.length&&(void 0===t||!t.count))return[];for(var o=this.buildSummaryData(e,t),s=[],l=this.getData(),a=0;a<l.length;a++)s.push(this.getGeneratedRow(l[a],o[a],t?t.level:void 0,i,r,t?t.parentUid:void 0,n));return s},i.prototype.getGeneratedRow=function(i,r,n,o,s,l,a){var h=[],d=this.getIndentByLevel(n),p=!t.isNullOrUndefined(this.parent.childGrid),c=this.parent.getIndentCount();this.parent.isRowDragable()&&(d=["e-indentcelltop"]);for(var u=a||this.getColumns(o,s),g=0;g<u.length;g++)h.push(this.getGeneratedCell(u[g],i,g>=c?this.getCellType():g<this.parent.groupSettings.columns.length?e.CellType.Indent:e.CellType.DetailFooterIntent,d[g],p));var f=new fi({data:r,attributes:{class:"e-summaryrow"}});return f.cells=h,t.isBlazor()&&this.parent.isServerRendered&&!t.isNullOrUndefined(l)?f.uid=this.parent.getRowUid("grid-row"):f.uid=N("grid-row"),f.parentUid=l,f.visible=h.some(function(e){return e.isDataCell&&e.visible}),f},i.prototype.getGeneratedCell=function(e,i,r,n,o){var s=i.columns.filter(function(t){return t.columnName===e.field})[0],l={style:{textAlign:e.textAlign},"e-mappinguid":e.uid,index:e.index};n&&(l.class=n),t.isNullOrUndefined(n)&&o&&(l.class="e-detailindentcelltop");var a={visible:e.visible,isDataCell:!t.isNullOrUndefined(s),isTemplate:s&&!t.isNullOrUndefined(s.footerTemplate||s.groupFooterTemplate||s.groupCaptionTemplate),column:s||{},attributes:l,cellType:r};return a.column.headerText=e.headerText,new mi(a)},i.prototype.buildSummaryData=function(e,t){for(var i=[],r=this.getData(),n={},o=0;o<r.length;o++){n={};for(var s=r[o].columns,l=0;l<s.length;l++)n=this.setTemplate(s[l],t&&t.aggregates?t:e,n);i.push(n)}return i},i.prototype.getIndentByLevel=function(e){return this.parent.groupSettings.columns.map(function(){return"e-indentcelltop"})},i.prototype.setTemplate=function(e,i,r){var n=e.type,o={},s=e.getFormatter()||function(){return function(e){return e}}(),l=i;n instanceof Array||(n=[e.type]);for(var a=0;a<n.length;a++){var h=e.field+" - "+n[a].toLowerCase(),d=e.columnName,p="Custom"!==n[a]&&l.aggregates&&h in l.aggregates?l.aggregates[h]:U(n[a],l.aggregates?l:i,e,this.parent);r[d]=r[d]||{},r[d][h]=p,r[d][n[a]]=t.isNullOrUndefined(p)?" ":s(p),l.field&&(r[d].field=l.field,r[d].key=l.key)}return o.format=e.getFormatter(),e.setTemplate(o),r},i.prototype.getCellType=function(){return e.CellType.Summary},i}(),Si=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return wi(i,t),i.prototype.columnSelector=function(e){return void 0!==e.groupFooterTemplate},i.prototype.getIndentByLevel=function(e){return void 0===e&&(e=this.parent.groupSettings.columns.length),this.parent.groupSettings.columns.map(function(t,i){return i<=e-1?"":"e-indentcelltop"})},i.prototype.getCellType=function(){return e.CellType.GroupSummary},i}(bi),xi=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return wi(i,t),i.prototype.columnSelector=function(e){return void 0!==e.groupCaptionTemplate},i.prototype.getData=function(){var e={columns:[]};return[t.prototype.getData.call(this).reduce(function(e,t){return e.columns=e.columns.concat(t.columns),e},e)]},i.prototype.isEmpty=function(){return 0===(this.getData()[0].columns||[]).length},i.prototype.getCellType=function(){return e.CellType.CaptionSummary},i}(bi),Ri=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fi=function(i){function r(e){var t=i.call(this,e)||this;return t.rows=[],t.index=0,t.parent=e,t.summaryModelGen=new Si(e),t.captionModelGen=new xi(e),t}return Ri(r,i),r.prototype.generateRows=function(e,t){if(0===this.parent.groupSettings.columns.length)return i.prototype.generateRows.call(this,e,t);this.isInfiniteScroll="infiniteScroll"===t.requestType,this.rows=[],this.index=this.parent.enableVirtualization||this.isInfiniteScroll?t.startIndex:0;for(var r=0,n=e.length;r<n;r++)this.getGroupedRecords(0,e[r],e.level,r,void 0,this.rows.length);return this.index=0,this.parent.isCollapseStateEnabled()&&this.ensureRowVisibility(),this.rows},r.prototype.getGroupedRecords=function(e,i,r,n,o,s,l){var a,h=this.isInfiniteScroll&&this.prevKey===i.key,d=r;if(t.isNullOrUndefined(i.items))if(t.isNullOrUndefined(i.GroupGuid))this.rows=this.rows.concat(this.generateDataRows(i,e,n,this.rows.length,l));else for(var p=0,c=i.length;p<c;p++)this.getGroupedRecords(e,i[p],i.level,n,e,this.rows.length,l);else{var u=this.generateCaptionRow(i,e,n,o,s,l);if(h||(this.rows=this.rows.concat(u)),i.items&&i.items.length&&this.getGroupedRecords(e+1,i.items,i.items.level,n,e+1,this.rows.length,u.uid),this.parent.aggregates.length){var g=this.rows.length;(a=this.rows).push.apply(a,this.summaryModelGen.generateRows(i,{level:d,parentUid:u.uid}));for(var f=g-1;f>=0;f--)if(this.rows[f].isCaptionRow)this.rows[f].aggregatesCount=this.rows.length-g;else if(!this.rows[f].isCaptionRow&&!this.rows[f].isDataRow)break}}this.prevKey=i.key},r.prototype.getCaptionRowCells=function(i,r,n){var o=[],s=[],l=this.parent.getColumnByField(i),a=this.parent.getColumnIndexesInView();this.parent.enableColumnVirtualization&&(l=this.parent.columns.filter(function(e){return e.field===i})[0]);var h=this.parent.groupSettings.columns.length,d=this.parent;if(!this.parent.enableColumnVirtualization||-1!==a.indexOf(r)){for(var p=0;p<r;p++)o.push(this.generateIndentCell());o.push(this.generateCell({},null,e.CellType.Expand))}if(r=this.parent.enableColumnVirtualization?1:this.parent.getVisibleColumns().length+h+(d.detailTemplate||d.childGrid?1:0)-r+(this.parent.getVisibleColumns().length?-1:0),this.parent.aggregates.length&&!this.captionModelGen.isEmpty()){var c=this.captionModelGen.generateRows(n)[0];t.extend(n,c.data);var u=0;c.cells.some(function(e,t){return u=t,e.visible&&e.isDataCell}),s=c.cells.slice(u).filter(function(e){return e.visible}),c.visible&&s[0].column.field===this.parent.getVisibleColumns()[0].field&&(s=s.slice(1)),1===this.parent.getVisibleColumns().length&&(s=[]),r-=s.length}for(var g=this.parent.enableColumnVirtualization?this.parent.getColumns():[l],f=!0,m=0;m<g.length;m++){var y=f&&-1!==a.indexOf(r);y&&(f=!1);var v=!this.parent.enableColumnVirtualization||y?e.CellType.GroupCaption:e.CellType.GroupCaptionEmpty;r=this.parent.enableColumnVirtualization&&v===e.CellType.GroupCaption?r+h:r,d.isRowDragable()&&r++,o.push(this.generateCell(l,null,v,r))}return o.push.apply(o,s),o},r.prototype.generateCaptionRow=function(e,i,r,n,o,s){var l={},a=this.parent.getColumnByField(e.field);l.data=t.extend({},e),a&&(l.data.field=e.field),l.isDataRow=!1,l.isExpand=!this.parent.groupSettings.enableLazyLoading&&!this.parent.isCollapseStateEnabled(),l.parentGid=r,l.childGid=n,l.tIndex=o,l.isCaptionRow=!0,l.parentUid=s,l.gSummary=t.isNullOrUndefined(e.items.records)?e.items.length:e.items.records.length,l.uid=t.isBlazor()&&this.parent.isServerRendered?this.parent.getRowUid("grid-row"):N("grid-row");var h=new fi(l);return h.indent=i,this.getForeignKeyData(h),h.cells=this.getCaptionRowCells(e.field,i,h.data),h},r.prototype.getForeignKeyData=function(e){var i=e.data,r=this.parent.getColumnByField(i.field);if(r&&r.isForeignColumn&&r.isForeignColumn()){var n=t.isNullOrUndefined(i.key)?"":r.valueAccessor(r.foreignKeyValue,le(r,{},i.key)[0],r);t.setValue("foreignKey",n,e.data)}},r.prototype.generateDataRows=function(e,t,i,r,n){for(var o=[],s=this.parent.getColumnIndexesInView(),l=0,a=e.length;l<a;l++,r++){o[l]=this.generateRow(e[l],this.index,l?void 0:"e-firstchildrow",t,i,r,n);for(var h=0;h<t;h++)this.parent.enableColumnVirtualization&&-1===s.indexOf(t)||o[l].cells.unshift(this.generateIndentCell());this.index++}return o},r.prototype.generateIndentCell=function(){return this.generateCell({},null,e.CellType.Indent)},r.prototype.refreshRows=function(e){for(var t=this.parent.getColumnIndexesInView(),i=0;i<e.length;i++)if(e[i].isDataRow){e[i].cells=this.generateCells(e[i]);for(var r=0;r<e[i].indent;r++)this.parent.enableColumnVirtualization&&-1===t.indexOf(e[i].indent)||e[i].cells.unshift(this.generateIndentCell())}else{var n=this.generateCaptionRow(e[i].data,e[i].indent);e[i].cells=n.cells}return e},r.prototype.ensureRowVisibility=function(){for(var e=0;e<this.rows.length;e++){var t=this.rows[e];if(t.isCaptionRow)for(var i=e+1;i<this.rows.length;i++){var r=this.rows[i];t.uid===r.parentUid&&(this.rows[i].visible=t.isExpand)}}},r}(Ci),zi=function(){function e(e,i){var r=this;this.rows=[],this.freezeRows=[],this.movableRows=[],this.freezeRowElements=[],this.currentInfo={},this.prevCurrentView=[],this.isLoaded=!0,this.viewColIndexes=[],this.drop=function(e){r.parent.notify(St,{target:e.target,droppedElement:e.droppedElement}),t.remove(e.droppedElement)},this.infiniteCache={},this.isRemove=!1,this.visibleRows=[],this.visibleFrozenRows=[],this.rightFreezeRows=[],this.isAddRows=!1,this.isInfiniteFreeze=!1,this.useGroupCache=!1,this.mutableData=!1,this.rafCallback=function(e){var t=e;return function(){if(r.parent.isFrozenGrid()&&r.parent.enableVirtualization){var i=[].slice.call(r.parent.getMovableVirtualContent().querySelectorAll(".e-row")),n=[].slice.call(r.parent.getFrozenVirtualContent().querySelectorAll(".e-row"));if(r.isLoaded=!!i&&i.length===n.length,r.parent.enableColumnVirtualization&&"virtualscroll"===e.requestType&&r.isLoaded){var o=[].slice.call(r.parent.getMovableVirtualHeader().querySelectorAll(".e-row")),s=[].slice.call(r.parent.getFrozenVirtualHeader().querySelectorAll(".e-row"));r.isLoaded=o.length===s.length}}if(r.ariaService.setBusy(r.getPanel().querySelector(".e-content"),!1),!r.parent.isDestroyed){var l=r.rows.slice(0);if(r.parent.isFrozenGrid()&&(l=e.isFrozen?r.freezeRows:e.renderFrozenRightContent?r.parent.getFrozenRightRowsObject():r.movableRows),r.parent.notify(Mt,{rows:l,args:t}),r.isLoaded&&r.parent.trigger(Ct,{},function(){r.parent.allowTextWrap&&r.parent.notify(ii,{case:"textwrap"})}),t){var a=(t.requestType||"").toLowerCase()+"-complete";r.parent.notify(a,t),"batchsave"===e.requestType&&(e.cancel=!1,r.parent.trigger(vt,e))}r.isLoaded&&r.parent.hideSpinner()}}},this.parent=e,this.serviceLocator=i,this.ariaService=this.serviceLocator.getService("ariaService"),this.mutableData=this.parent.getDataModule().isRemote(),this.generator=this.getModelGenerator(),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.enableVirtualization||this.parent.groupSettings.enableLazyLoading||this.parent.on(jt,this.setVisible,this),this.parent.on(kt,this.colGroupRefresh,this),this.parent.on(Dt,this.enableAfterRender,this),this.parent.on(di,this.refreshContentRows,this),this.parent.on(Nt,this.beforeCellFocused,this),this.parent.on(Ut,this.droppableDestroy,this))}return e.prototype.beforeCellFocused=function(e){!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action?this.pressedKey=void 0:this.pressedKey=e.keyArgs.action},e.prototype.renderPanel=function(){var e=this.parent,t=this.parent.element.querySelector(".e-gridcontent");if(t)return this.ariaService.setOptions(this.parent.element.querySelector(".e-content"),{busy:!1}),void this.setPanel(t);t=this.parent.createElement("div",{className:"e-gridcontent"});var i=this.parent.createElement("div",{className:"e-content"});this.ariaService.setOptions(i,{busy:!1}),t.appendChild(i),this.setPanel(t),e.element.appendChild(t)},e.prototype.renderTable=function(){var e=this.getPanel(),i=e.querySelector(".e-virtualtable"),r=e.querySelector(".e-virtualtrack");!this.parent.enableVirtualization||t.isNullOrUndefined(i)||t.isNullOrUndefined(r)||t.isBlazor()&&(!t.isBlazor()||this.parent.isServerRendered)||(t.remove(i),t.remove(r)),e.appendChild(this.createContentTable("_content_table")),this.setTable(e.querySelector(".e-table")),this.ariaService.setOptions(this.getTable(),{multiselectable:"Multiple"===this.parent.selectionSettings.type}),this.initializeContentDrop(),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdrcont")},e.prototype.createContentTable=function(e){var i=this.getPanel().firstElementChild;t.isBlazor()||this.getTable()&&t.remove(this.getTable());var r=i.querySelector(".e-table")?i.querySelector(".e-table"):this.parent.createElement("table",{className:"e-table",attrs:{cellspacing:"0.25px",role:"grid",id:this.parent.element.id+e}});return this.setColGroup(this.parent.getHeaderTable().querySelector("colgroup").cloneNode(!0)),r.appendChild(this.getColGroup()),r.appendChild(this.parent.createElement("tbody")),i.appendChild(r),i},e.prototype.refreshContentRows=function(e){var i=this;void 0===e&&(e={});var r=this.parent;if(0!==r.currentViewData.length){var n=this.currentMovableRows||r.currentViewData,o=this.parent.contentModule,s=r.isReact&&!t.isNullOrUndefined(r.rowTemplate),l=s?r.createElement("tbody"):document.createDocumentFragment();this.initialPageRecords||(this.initialPageRecords=t.extend([],n));var a,h,d,p=s?r.createElement("tbody"):document.createDocumentFragment(),c=r.getColumns(),u=r.getFrozenColumns(),g=this.parent.isFrozenGrid(),f=new vi(this.serviceLocator,null,this.parent),y=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;this.rowElements=[],this.rows=[];var v,C,w=this.getPanel().querySelector(".e-frozencontent"),b=this.getPanel().querySelector(".e-movablecontent"),S=this.getPanel().querySelector(".e-content");pe(r)&&["sorting","filtering","searching","grouping","ungrouping","reorder"].some(function(t){return e.requestType===t})&&this.emptyVcRows();var x;if(t.isBlazor()&&this.parent.isServerRendered){x=this.generator.generateRows(n,e),this.parent.enableVirtualization&&(this.prevInfo=this.prevInfo?this.prevInfo:e.virtualInfo,this.prevInfo=e.virtualInfo.sentinelInfo&&"Y"===e.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==e.virtualInfo.page?this.currentInfo:e.virtualInfo),this.rows=x,this.freezeRows=x,this.rowElements=[].slice.call(this.getTable().querySelectorAll("tr.e-row[data-uid]")),u&&(this.movableRows=x.map(function(e){var t=new fi(e);return t.cells=e.cells.slice(u,e.cells.length),e.cells=e.cells.slice(0,u),t}),this.freezeRowElements=this.rowElements),this.isLoaded=!0,this.parent.hideSpinner(),e.isFrozen=0!==this.parent.getFrozenColumns()&&!e.isFrozen;Y=t.extend({rows:this.rows},e);if(this.getTable().querySelector(".e-emptyrow")&&(t.remove(this.getTable().querySelector(".e-emptyrow")),t.isNullOrUndefined(this.getTable().querySelectorAll(".e-table > tbody")[1])||t.remove(this.getTable().querySelectorAll(".e-table > tbody")[1])),this.parent.notify("contentcolgroup",{}),this.rafCallback(Y)(),u&&(S.style.overflowY="hidden",w.style.height=b.offsetHeight-j()+"px",b.style.overflowY="auto"!==this.parent.height?"scroll":"auto",w.style.borderRightWidth="1px",this.parent.notify(Mt,{rows:this.movableRows,args:t.extend({},Y,{isFrozen:!1})})),!this.parent.isCheckBoxSelection&&"Multiple"!==this.parent.selectionSettings.type||!this.parent.isPersistSelection&&!this.parent.enableVirtualization){"Normal"!==this.parent.editSettings.mode||t.isNullOrUndefined(e.editRowIndex)||this.parent.selectRow(e.editRowIndex)}if(this.parent.enableVirtualization&&!this.parent.getHeaderContent().querySelectorAll(".e-check").length){for(var R=this.parent.getRows().filter(function(e){return e.getAttribute("aria-selected")}).map(function(e){return e.getAttribute("data-uid")}),F=this.parent.getRows().filter(function(e){return null===e.getAttribute("aria-selected")}).map(function(e){return e.getAttribute("data-uid")}),z=0;z<R.length;z++)if(!t.isNullOrUndefined(this.parent.getRowObjectFromUID(R[z]))&&!this.parent.getRowObjectFromUID(R[z]).isSelected){this.parent.getRowElementByUID(R[z]).removeAttribute("aria-selected"),t.isNullOrUndefined(this.parent.getRowElementByUID(R[z]).querySelector(".e-check"))||t.removeClass([this.parent.getRowElementByUID(R[z]).querySelector(".e-check")],["e-check"]);for(J=0;J<this.parent.getRowElementByUID(R[z]).children.length;J++)this.parent.getRowElementByUID(R[z]).children[J].classList.remove("e-selectionbackground","e-active")}for(z=0;z<F.length;z++)if(!t.isNullOrUndefined(this.parent.getRowObjectFromUID(F[z]))&&this.parent.getRowObjectFromUID(F[z]).isSelected){this.parent.getRowElementByUID(F[z]).setAttribute("aria-selected","true"),t.isNullOrUndefined(this.parent.getRowElementByUID(F[z]).querySelector(".e-frame"))||t.addClass([this.parent.getRowElementByUID(F[z]).querySelector(".e-frame")],["e-check"]);for(J=0;J<this.parent.getRowElementByUID(F[z]).children.length;J++)this.parent.getRowElementByUID(F[z]).children[J].classList.add("e-selectionbackground","e-active")}}}else{this.parent.enableVirtualization&&this.parent.isFrozenGrid()?(this.parent.enableColumnVirtualization&&"virtualscroll"===e.requestType&&"X"===e.virtualInfo.sentinelInfo.axis&&(x=this.parent.contentModule.generateRows(n,e),e.renderMovableContent=!0),x=this.parent.contentModule.generateRows(n,e)):(x=this.checkCache(x,e),this.isAddRows||this.useGroupCache||(x=this.generator.generateRows(n,e))),this.setGroupCache(x,e),this.parent.notify("set-infinite-cache",{isInfiniteScroll:y,modelData:x,args:e});var I=x[0].cells[0].index;g&&(C=o.setTbody(x,e),v=o.getTbody(C));var T="Left-Right"===this.parent.getFrozenMode()&&"frozen-right"===C;if("infiniteScroll"!==e.requestType&&this.parent.registeredTemplate&&this.parent.registeredTemplate.template&&!e.isFrozen&&!T){for(var E=[],z=0;z<this.parent.registeredTemplate.template.length;z++)for(J=0;J<this.parent.registeredTemplate.template[z].rootNodes.length;J++)t.isNullOrUndefined(this.parent.registeredTemplate.template[z].rootNodes[J].parentNode)&&E.push(this.parent.registeredTemplate.template[z]);this.parent.destroyTemplate(["template"],E)}this.parent.isReact&&"infiniteScroll"!==e.requestType&&!e.isFrozen&&(this.parent.destroyTemplate(["columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate"]),this.parent.renderTemplates()),this.parent.enableColumnVirtualization&&new yi(this.serviceLocator,this.parent).updateVirtualCells(x),g||(this.tbody=this.getTable().querySelector("tbody"));var M=0,D=!0;if(pe(r)&&r.vcRows.length){var O=t.isNullOrUndefined(e.virtualInfo.offsets)?t.isNullOrUndefined(e.scrollTop)?0:e.scrollTop.top:e.virtualInfo.offsets.top;if(0!==O){for(var A=r.vGroupOffsets,B=r.pageSettings.pageSize/2,k=Object.keys(A).map(function(e){return A[e]}),L=0;L<k.length;L++)if(O<k[L]){if(t.isNullOrUndefined(e.virtualInfo)||"up"!==e.virtualInfo.direction){e.virtualInfo.blockIndexes=0===L||1===L?[1,2]:[L,L+1],M=0===L||1===L?0:L*B;break}e.virtualInfo.blockIndexes=0===L||1===L?[1,2]:[L,L+1],M=0===L||1===L?0:L*B;break}Math.round(O+this.contentPanel.firstElementChild.offsetHeight)>=this.contentPanel.firstElementChild.scrollHeight&&!e.rowObject&&(D=!1)}}var P=r.frozenRows&&!r.isFrozenGrid()&&this.parent.enableVirtualization&&"reorder"===e.requestType;if(r.frozenRows&&"virtualscroll"===e.requestType&&"X"===e.virtualInfo.sentinelInfo.axis||P){var N=e.virtualInfo.blockIndexes,H=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],P&&(e.virtualInfo.page=1);var U=P?this.initialPageRecords:n,V=this.vgenerator.generateRows(U,e);V.splice(this.parent.frozenRows);for(z=0;z<this.parent.frozenRows;z++)V[z].cells.splice(0,this.parent.getFrozenColumns()),a=f.render(V[z],c),p.appendChild(a);e.virtualInfo.blockIndexes=N,e.virtualInfo.page=H,P&&1===e.virtualInfo.page&&x.splice(0,this.parent.frozenRows)}this.virtualFrozenHdrRefresh(p,x,f,e,n,c);for(var z=M,G=x.length;z<G;z++)if(this.rows.push(x[z]),!this.parent.groupSettings.enableLazyLoading||this.useGroupCache||!this.parent.groupSettings.columns.length||(this.setRowsInLazyGroup(x[z],z),!t.isNullOrUndefined(x[z].indent))){if(this.setInfiniteVisibleRows(e,x[z],C),pe(r)&&this.rows.length>=r.pageSettings.pageSize&&D)break;if(r.rowTemplate){var _=r.element.id+"rowTemplate",W=void 0;if(r.isReact){var K=r.frozenRows&&z<r.frozenRows,Q=t.extend({index:z},n[z]);r.getRowTemplate()(Q,r,"rowTemplate",_,null,null,K?p:l),r.renderTemplates()}else W=r.getRowTemplate()(t.extend({index:z},n[z]),r,"rowTemplate",_);if(r.isReact||"TBODY"!==W[0].tagName)r.frozenRows&&z<r.frozenRows?a=r.isReact?p.lastElementChild:q(p,W):(r.isReact||(a=q(l,W)),d=r.isReact?l.lastElementChild:a.lastElementChild);else{for(var J=0;J<W.length;J++){var X="tr"===W[J].nodeName.toLowerCase();(X||W[J].querySelectorAll&&W[J].querySelectorAll("tr").length)&&(a=X?W[J]:W[J].querySelector("tr"))}r.frozenRows&&z<r.frozenRows?p.appendChild(a):l.appendChild(a)}var Y={data:x[z].data,row:d||a};this.parent.trigger("rowDataBound",Y)}else{a=f.render(x[z],c);var $=this.ensureFrozenHeaderRender(e);r.frozenRows&&z<r.frozenRows&&!y&&"virtualscroll"!==e.requestType&&$&&this.ensureVirtualFrozenHeaderRender(e)?p.appendChild(a):l.appendChild(a),x[z].isExpand&&r.notify(ni,a.cells[r.groupSettings.columns.length])}x[z].isDataRow&&this.rowElements.push(a),this.ariaService.setOptions(this.getTable(),{colcount:r.getColumns().length.toString()})}if(g&&o.splitRows(C),r.frozenRows&&"virtualscroll"!==e.requestType&&!y&&this.ensureVirtualFrozenHeaderRender(e)||"virtualscroll"===e.requestType&&e.virtualInfo.sentinelInfo&&"X"===e.virtualInfo.sentinelInfo.axis)if(h=g?o.getFrozenHeader(C):r.getHeaderTable().querySelector("tbody"),s){var Z=h.parentElement;t.remove(h),Z.appendChild(p)}else h.innerHTML="",h.appendChild(p);!r.enableVirtualization&&r.frozenRows&&0===I&&S.offsetHeight===Number(r.height)&&(S.style.height=S.offsetHeight-h.offsetHeight+"px"),t.isBlazor()&&!this.parent.isJsComponent||(e.rows=this.rows.slice(0)),g&&o.setIsFrozen(e,C),this.index=I,m(function(){i.parent.notify("beforeFragAppend",e);var n=i.parent.enableVirtualization&&i.parent.isFrozenGrid();if(i.parent.enableVirtualization||y||(i.parent.isFrozenGrid()?(t.remove(v),v=i.parent.createElement("tbody")):(t.remove(i.tbody),i.tbody=i.parent.createElement("tbody"))),!g||n||i.parent.enableInfiniteScrolling)if(r.rowTemplate&&t.updateBlazorTemplate(r.element.id+"rowTemplate","RowTemplate",r),n){if(e.renderFrozenRightContent){var s=r.getContent().querySelector(".e-frozen-right-content").querySelector("tbody");i.appendContent(s,l,e)}else e.renderMovableContent?(i.appendContent(b.querySelector("tbody"),l,e),e.renderMovableContent=!1):i.appendContent(w.querySelector("tbody"),l,e);i.parent.getFrozenColumns()||o.renderNextFrozentPart(e,C)}else!t.isNullOrUndefined(i.parent.infiniteScrollModule)&&i.parent.enableInfiniteScrolling?(i.isAddRows=!1,i.parent.notify("remove-infinite-rows",{args:e}),i.parent.notify("append-infinite-content",{tbody:v||i.tbody,frag:l,args:e,rows:i.rows,rowElements:i.rowElements,visibleRows:i.visibleRows,tableName:C}),!u&&g&&(("Left-Right"===r.getFrozenMode()||"frozen-left"!==C&&"frozen-right"!==C)&&("Left-Right"!==r.getFrozenMode()||"frozen-left"!==C&&"movable"!==C)||i.refreshContentRows(t.extend({},e)))):(i.useGroupCache=!1,i.appendContent(i.tbody,l,e));else i.appendContent(v,l,e,C);u&&o.renderNextFrozentPart(e,C),l=null},this.rafCallback(t.extend({},e)))}}},e.prototype.emptyVcRows=function(){this.parent.vcRows=[],this.parent.vRows=[]},e.prototype.appendContent=function(e,i,r,n){this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?this.getTable().appendChild(i):(e.appendChild(i),this.getTable().appendChild(e))},e.prototype.setRowsInLazyGroup=function(e,t){this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&this.parent.contentModule.maintainRows(e,t)},e.prototype.setGroupCache=function(e,t){!this.useGroupCache&&this.parent.groupSettings.enableLazyLoading&&this.parent.notify("group-cache",{args:t,data:e})},e.prototype.ensureFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&("reorder"===e.requestType||"refresh"===e.requestType)||this.parent.infiniteScrollSettings.enableCache&&this.parent.frozenRows&&"delete"===this.parent.infiniteScrollModule.requestType&&1!==this.parent.pageSettings.currentPage)},e.prototype.ensureVirtualFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&"delete"===e.requestType)},e.prototype.checkCache=function(e,i){if(this.parent.infiniteScrollSettings.enableCache&&"infiniteScroll"===i.requestType){var r=i.isFrozen?1:0,n=this.parent.isFrozenGrid();if(this.isAddRows=!t.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage]),n&&!t.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage])&&(this.isAddRows=0!==this.infiniteCache[this.parent.pageSettings.currentPage][r].length),this.isAddRows){var o=n?this.infiniteCache[this.parent.pageSettings.currentPage][r]:this.infiniteCache[this.parent.pageSettings.currentPage];e=1===this.parent.pageSettings.currentPage?o.slice(this.parent.frozenRows):o}return e}return this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&("paging"===i.requestType||"columnstate"===i.requestType||"reorder"===i.requestType)&&this.parent.contentModule.getGroupCache()[this.parent.pageSettings.currentPage]?(this.useGroupCache=!0,this.parent.contentModule.initialGroupRows("reorder"===i.requestType)):null},e.prototype.setInfiniteVisibleRows=function(e,t,i){var r=this.parent.isFrozenGrid();this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&(r?"frozen-left"===i||"Right"===this.parent.getFrozenMode()&&"frozen-right"===i?this.visibleFrozenRows.push(t):"movable"===i?this.visibleRows.push(t):this.rightFreezeRows.push(t):this.parent.infiniteScrollSettings.enableCache||this.visibleRows.push(t))},e.prototype.getCurrentBlockInfiniteRecords=function(e){var t=[];if(this.parent.infiniteScrollSettings.enableCache){if(!Object.keys(this.infiniteCache).length)return[];var i=this.parent.isFrozenGrid(),r=this.parent.getRows(),n=parseInt(r[this.parent.frozenRows].getAttribute("aria-rowindex"),10),o=Math.ceil((n+1)/this.parent.pageSettings.pageSize);n=parseInt(r[r.length-1].getAttribute("aria-rowindex"),10);var s=Math.ceil(n/this.parent.pageSettings.pageSize);if(i){for(var l=e?0:1,a=o;a<=s;a++)t=t.length?t.concat(this.infiniteCache[a][l]):this.infiniteCache[a][l];this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(t=this.infiniteCache[1][l].slice(0,this.parent.frozenRows).concat(t))}else{for(a=o;a<=s;a++)t=t.length?t.concat(this.infiniteCache[a]):this.infiniteCache[a];this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(t=this.infiniteCache[1].slice(0,this.parent.frozenRows).concat(t))}}return t},e.prototype.getReorderedVFRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},e.prototype.getReorderedRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},e.prototype.virtualFrozenHdrRefresh=function(e,t,i,r,n,o){if(this.parent.frozenRows&&this.parent.enableVirtualization&&("reorder"===r.requestType||"refresh"===r.requestType)){var s=void 0,l=[];this.parent.isFrozenGrid()?(this.currentMovableRows=n,l=this.getReorderedVFRows(r)):l=this.getReorderedRows(r);for(var a=0;a<l.length;a++)s=i.render(l[a],o),e.appendChild(s);1===r.virtualInfo.page&&t.splice(0,this.parent.frozenRows),r.renderMovableContent&&(this.parent.currentViewData=this.currentMovableRows,this.currentMovableRows=null)}},e.prototype.getInfiniteRows=function(){var e=[],t=this.parent.isFrozenGrid();if(this.parent.enableInfiniteScrolling)if(this.parent.infiniteScrollSettings.enableCache)for(var i=Object.keys(this.infiniteCache),r=0;r<i.length;r++)e=t?e.concat(this.infiniteCache[i[r]][0]):e.concat(this.infiniteCache[i[r]]);else e=t?this.visibleFrozenRows:this.visibleRows;return e},e.prototype.getInfiniteMovableRows=function(){var e=this.getCurrentBlockInfiniteRecords();return this.parent.enableInfiniteScrolling?e.length?e:this.visibleRows:[]},e.prototype.getPanel=function(){return this.contentPanel},e.prototype.setPanel=function(e){this.contentPanel=e},e.prototype.getTable=function(){return this.contentTable},e.prototype.setTable=function(e){this.contentTable=e},e.prototype.getRows=function(){var e=this.getInfiniteRows();return e.length?e:this.parent.getFrozenColumns()?this.freezeRows:this.rows},e.prototype.getMovableRows=function(){var e=this.getInfiniteMovableRows();return e.length?e:this.movableRows},e.prototype.getRowElements=function(){return this.parent.getFrozenColumns()?this.freezeRowElements:this.rowElements},e.prototype.getMovableRowElements=function(){return this.rowElements},e.prototype.setRowElements=function(e){this.rowElements=e},e.prototype.getColGroup=function(){return this.colgroup},e.prototype.setColGroup=function(e){return t.isNullOrUndefined(e)||(e.id="content-"+e.id),this.colgroup=e},e.prototype.setVisible=function(e){var i=this.parent;t.isBlazor()&&i.isServerRendered&&this.parent.notify("setvisibility",e);var r=this.parent.isFrozenGrid(),n=i.getFrozenColumns(),o=[];if(r){var s=this.freezeRows,l=this.movableRows,a=s.length,h=void 0,d=[];"Left-Right"===i.getFrozenMode()&&(d=i.getFrozenRightRowsObject());for(var p=0,c=void 0;p<a;p++){h=l[p].cells.length;var u=d.length?d[p].cells.length:0;c=s[p].clone();for(var g=0;g<h;g++)c.cells.push(l[p].cells[g]);for(var f=0;f<u;f++)c.cells.push(d[p].cells[f]);o.push(c)}}else o=this.getRows();var m;o.some(function(e){return e.isDataRow&&(m=e),e.isDataRow});var y=!0;!i.groupSettings.columns.length&&m&&(y=!1);for(var v=i.getDataRows(),C={},w=this.infiniteRowVisibility(),b=w||this.rows.filter(function(e){return!e.isDetailRow}),S=0,x=e.length;S<x;S++){var R=e[S],F=this.parent.getNormalizedColumnIndex(R.uid),z=this.parent.getColumnIndexByUid(R.uid),I=!0===R.visible?"":"none";if(-1!==F&&m&&F<m.cells.length)if(r)if("movable"!==R.getFreezeTableName())if("frozen-right"===R.getFreezeTableName()){z=F-=this.parent.getFrozenLeftColumnsCount()+this.parent.getMovableColumnsCount();var T=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector("colgroup");t.setStyleAttribute(T.childNodes[F],{display:I}),b=i.getFrozenRightRowsObject(),v=i.getFrozenRightDataRows()}else{t.setStyleAttribute(this.getColGroup().childNodes[F],{display:I});var E=this.infiniteRowVisibility(!0);b=E||this.freezeRows,v=i.getDataRows()}else{var M=i.getContent().querySelector(".e-movablecontent").querySelector("colgroup");z=F=F-n-this.parent.getFrozenLeftColumnsCount(),t.setStyleAttribute(M.childNodes[F],{display:I}),v=i.getMovableDataRows();var D=this.infiniteRowVisibility();b=D||this.movableRows}else t.setStyleAttribute(this.getColGroup().childNodes[F],{display:I});y||this.setDisplayNone(v,z,I,b),!this.parent.invokedFromMedia&&R.hideAtMedia&&this.parent.updateMediaColumns(R),this.parent.invokedFromMedia=!1}y?this.refreshContentRows({requestType:"refresh"}):this.parent.getFrozenColumns()?(this.parent.notify("partial-refresh",{rows:this.freezeRows,args:{isFrozen:!0,rows:this.freezeRows}}),this.parent.notify("partial-refresh",{rows:this.movableRows,args:{isFrozen:!1,rows:this.movableRows}})):this.parent.notify("partial-refresh",{rows:b,args:C})},e.prototype.setDisplayNone=function(e,i,r,n){for(var o=Object.keys(e),s=0;s<o.length;s++){var l=e[o[s]].querySelectorAll("td.e-rowcell")[i];if(e[o[s]].querySelectorAll("td.e-rowcell").length&&l)if(t.setStyleAttribute(e[o[s]].querySelectorAll("td.e-rowcell")[i],{display:r}),e[o[s]].querySelectorAll("td.e-rowcell")[i].classList.contains("e-hide")&&t.removeClass([e[o[s]].querySelectorAll("td.e-rowcell")[i]],["e-hide"]),this.parent.isRowDragable()){var a=this.parent.getFrozenColumns()?i:i+1;n[o[s]].cells[a].visible=""===r}else n[o[s]].cells[i].visible=""===r}this.parent.notify("infinite-show-hide",{visible:r,index:i,isFreeze:this.isInfiniteFreeze})},e.prototype.infiniteRowVisibility=function(e){var t;return this.parent.enableInfiniteScrolling&&(this.isInfiniteFreeze=e,t=this.parent.infiniteScrollSettings.enableCache?e?this.getCurrentBlockInfiniteRecords(!0):this.getCurrentBlockInfiniteRecords():e?this.visibleFrozenRows:this.visibleRows),t},e.prototype.colGroupRefresh=function(){if(this.getColGroup()){var e=void 0;e=this.parent.enableColumnVirtualization&&this.parent.getFrozenColumns()&&this.parent.contentModule.isXaxis()?this.parent.getMovableVirtualHeader().querySelector("colgroup").cloneNode(!0):this.getHeaderColGroup(),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)}},e.prototype.getHeaderColGroup=function(){return t.isBlazor()?this.parent.getHeaderTable().querySelector("colgroup").cloneNode(!0):this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0)},e.prototype.initializeContentDrop=function(){var e=this.parent;this.droppable=new t.Droppable(e.element,{accept:".e-dragclone",drop:this.drop})},e.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy()},e.prototype.canSkip=function(e,i,r){return t.isNullOrUndefined(i)||t.isNullOrUndefined(e.visible)||i.cells[r].visible===e.visible},e.prototype.getModelGenerator=function(){return this.generator=this.parent.allowGrouping?new Fi(this.parent):new Ci(this.parent)},e.prototype.renderEmpty=function(e){t.isBlazor()&&!this.parent.isJsComponent&&this.parent.frozenRows||(this.getTable().appendChild(e),this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector("tbody").innerHTML=""))},e.prototype.setSelection=function(e,t,i){this.parent.notify("set-freeze-selection",{uid:e,set:t,clearAll:i});var r=this.parent.isFrozenGrid();if(!r||!this.parent.enableVirtualization){if(r)for(var n=this.getMovableRows().filter(function(t){return i||e===t.uid}),o=0;o<n.length;o++)n[o].isSelected=t;for(var s=this.getRows().filter(function(t){return i||e===t.uid}),l=0;l<s.length;l++){s[l].isSelected=t;for(var a=s[l].cells,h=0;h<a.length;h++)a[h].isSelected=t}}},e.prototype.getRowByIndex=function(e){return e=this.getInfiniteRowIndex(e),this.parent.getDataRows()[e]},e.prototype.getInfiniteRowIndex=function(e){if(this.parent.infiniteScrollSettings.enableCache){var t=this.parent.frozenRows,i=t>e?0:t,r=parseInt(this.parent.getRows()[i].getAttribute("aria-rowindex"),10);e=t>e?e:e-r+t}return e},e.prototype.getVirtualRowIndex=function(e){return e},e.prototype.getMovableRowByIndex=function(e){return e=this.getInfiniteRowIndex(e),this.parent.getMovableDataRows()[e]},e.prototype.enableAfterRender=function(e){"group"===e.module&&e.enable&&(this.generator=this.getModelGenerator())},e.prototype.setRowObjects=function(e){this.rows=e},e.prototype.immutableModeRendering=function(e){var i=this;void 0===e&&(e={});var r=this.parent;r.hideSpinner();var n=r.getPrimaryKeyFieldNames()[0],o={},s={},l=[],a={},h=r.getRowsObject().slice(),d=this.getBatchEditedRecords(n,h),p={},c=0!==Object.keys(d).length;if(r.getContent().querySelector(".e-emptyrow")||"reorder"===e.requestType||this.parent.groupSettings.columns.length)this.refreshContentRows(e);else{if(0===r.currentViewData.length)return;var u={},g=r.createElement("tbody"),f=r.currentViewData,m=[].slice.call(this.getTable().querySelector("tbody").children);if(this.prevCurrentView.length){var y=this.prevCurrentView.length,v=f.length;if(y===v)for(C=0;C<v;C++)"Batch"===this.parent.editSettings.mode&&m[C].classList.contains("e-insertedrow")?(m.splice(C,1),--C):(s[f[C][n]]=o[this.prevCurrentView[C][n]]=C,p[C]=f[C][n],u[h[C].uid]=m[C],a[C]=this.prevCurrentView[C][n]);else{for(C=0;C<v;C++)s[f[C][n]]=C,p[C]=f[C][n];for(C=0;C<y;C++)"Batch"===this.parent.editSettings.mode&&m[C].classList.contains("e-insertedrow")?(m.splice(C,1),--C):(u[h[C].uid]=m[C],o[this.prevCurrentView[C][n]]=C,a[C]=this.prevCurrentView[C][n])}}for(var C=0;C<f.length;C++){var w=o[f[C][n]];if(t.isNullOrUndefined(w)){var b=new vi(this.serviceLocator,null,r),S=this.generator.generateRows([f[C]]);l.push(S[0]);R=b.render(S[0],r.getColumns());g.appendChild(R),this.refreshImmutableContent(C,R,l[C])}else{var x=!1;this.mutableData&&(x=this.objectEqualityChecker(this.prevCurrentView[C],f[C]));var R=u[h[w].uid];if(l.push(h[w]),this.rowElements[C]&&this.rowElements[C].getAttribute("data-uid")===l[C].uid&&(c&&t.isNullOrUndefined(d[p[C]])||!c&&(x||this.prevCurrentView[C]===f[C]))){w!==C&&this.refreshImmutableContent(C,R,l[C]),g.appendChild(R);continue}(c&&!t.isNullOrUndefined(d[p[C]])||!this.mutableData&&f[C]!==this.prevCurrentView[w]||this.mutableData&&!x)&&h[w].setRowValue(f[C]),g.appendChild(R),this.refreshImmutableContent(C,R,l[C])}}if(this.rows=l,this.rowElements=[].slice.call(g.children),t.remove(this.getTable().querySelector("tbody")),this.getTable().appendChild(g),this.parent.trigger(Ct,{},function(){i.parent.allowTextWrap&&i.parent.notify(ii,{case:"textwrap"})}),e){var F=(e.requestType||"").toLowerCase()+"-complete";this.parent.notify(F,e)}}},e.prototype.objectEqualityChecker=function(e,t){for(var i=Object.keys(e),r=!0,n=0;n<i.length;n++)if(e[i[n]]!==t[i[n]]){r=!1;break}return r},e.prototype.getBatchEditedRecords=function(e,t){var i={},r=this.parent.getBatchChanges(),n=[],o=[];Object.keys(r).length&&(n=r.changedRecords,o=r.addedRecords);var s={cancel:!1};this.parent.notify("immutable-batch-cancel",{rows:t,args:s}),o.length&&("Bottom"===this.parent.editSettings.newRowPosition?t.splice(t.length-1,o.length):s.cancel||t.splice(0,o.length));for(var l=0;l<n.length;l++)i[n[l][e]]=l;return i},e.prototype.refreshImmutableContent=function(e,t,i){i.isAltRow=!!this.parent.enableAltRow&&e%2!=0,i.isAltRow?t.classList.add("e-altrow"):t.classList.remove("e-altrow"),i.index=e,i.edit=void 0,i.isDirty=!1,t.setAttribute("aria-rowindex",e.toString()),this.updateCellIndex(t,e)},e.prototype.updateCellIndex=function(e,t){for(var i=0;i<e.cells.length;i++)e.cells[i].setAttribute("index",t.toString())},e}(),Ii=function(){function i(e,i){var r=this;this.frzIdx=0,this.notfrzIdx=0,this.isFirstCol=!1,this.isReplaceDragEle=!0,this.helper=function(e){var i=r.parent,n=r.draggable.currentStateTarget,o=O(n,"e-headercell");if(!i.allowReordering&&!i.allowGrouping||!t.isNullOrUndefined(o)&&o.querySelectorAll(".e-checkselectall").length>0)return!1;var s=r.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-headerclone"}),l=n.classList.contains("e-headercell")?n:o;if(!l||!i.allowReordering&&l.classList.contains("e-stackedheadercell"))return!1;var a,h=l.offsetHeight,d=l.querySelector(".e-headercelldiv")||l.querySelector(".e-stackedheadercelldiv");if(d){if(a=l.querySelector(".e-stackedheadercelldiv")?i.getStackedHeaderColumnByHeaderText(d.innerText.trim(),i.columns):i.getColumnByUid(d.getAttribute("e-mappinguid")),r.column=a,r.column.lockColumn)return!1;s.setAttribute("e-mappinguid",r.column.uid)}if(a&&!t.isNullOrUndefined(a.headerTemplate))if(t.isNullOrUndefined(a.headerTemplate))s.innerHTML=a.headerTemplate;else{var p=i.getColumnIndexByField(a.field);q(s,a.getHeaderTemplate()(t.extend({index:p},a),i,"headerTemplate"))}else s.innerHTML=d?a.headerText:l.firstElementChild.innerHTML;return s.style.width=l.offsetWidth+"px",s.style.height=l.offsetHeight+"px",s.style.lineHeight=(h-6).toString()+"px",i.element.appendChild(s),s},this.dragStart=function(e){var i=r.parent;i.element.querySelector(".e-gridpopup").style.display="none",i.notify(wt,{target:r.draggable.currentStateTarget,column:r.column,event:e.event}),t.isBlazor()&&e.bindEvents(e.dragElement)},this.drag=function(e){var i=r.parent,n=e.target;if(n){var o=t.closest(n,".e-grid"),s=r.parent.element.querySelector(".e-cloneproperties");if(!(o&&o.getAttribute("id")===i.element.getAttribute("id")||(t.classList(s,["e-notallowedcur"],["e-defaultcur"]),i.allowReordering&&(i.element.querySelector(".e-reorderuparrow").style.display="none",i.element.querySelector(".e-reorderdownarrow").style.display="none"),i.groupSettings.allowReordering)))return;i.notify(bt,{target:e.target,column:r.column,event:e.event})}},this.dragStop=function(e){var i,n=r.parent;n.element.querySelector(".e-gridpopup").style.display="none",(!O(e.target,"e-headercell")&&!O(e.target,"e-groupdroparea")||!n.allowReordering&&O(e.target,"e-headercell")||!e.helper.getAttribute("e-mappinguid")&&O(e.target,"e-groupdroparea"))&&(t.remove(e.helper),i=!0),n.notify(Wt,{target:e.target,event:e.event,column:r.column,cancel:i})},this.drop=function(e){var i=r.parent,n=e.droppedElement.getAttribute("e-mappinguid"),o=t.closest(e.target,".e-grid");t.remove(e.droppedElement),o&&o.getAttribute("id")!==i.element.getAttribute("id")||!i.allowReordering&&!i.allowGrouping||i.notify(Kt,{target:e.target,uid:n,droppedElement:e.droppedElement})},this.parent=e,this.serviceLocator=i,this.ariaService=this.serviceLocator.getService("ariaService"),this.widthService=this.serviceLocator.getService("widthService"),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount()||this.parent.on(jt,this.setVisible,this),this.parent.on(Vt,this.colPosRefresh,this),this.parent.on(Tt,this.renderCustomToolbar,this),"Vertical"===this.parent.rowRenderingMode&&this.parent.on(Dt,this.updateCustomResponsiveToolbar,this))}return i.prototype.renderPanel=function(){var e=this.parent.element.querySelector(".e-gridheader"),t=null!=e;e=t?e:this.parent.createElement("div",{className:"e-gridheader"});var i=t?e.querySelector(".e-headercontent"):this.parent.createElement("div",{className:"e-headercontent"});this.toggleStackClass(e),e.appendChild(i),this.setPanel(e),t||this.parent.element.appendChild(e)},i.prototype.renderTable=function(){var e=this.getPanel();e.appendChild(this.createHeaderTable()),this.setTable(e.querySelector(".e-table")),this.parent.getFrozenColumns()||this.parent.getFrozenRightColumnsCount()||this.parent.getFrozenLeftColumnsCount()||(this.initializeHeaderDrag(),this.initializeHeaderDrop()),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:this.parent.isFrozenGrid()}})},i.prototype.getPanel=function(){return this.headerPanel},i.prototype.setPanel=function(e){this.headerPanel=e},i.prototype.getTable=function(){return this.headerTable},i.prototype.setTable=function(e){this.headerTable=e},i.prototype.getColGroup=function(){return this.colgroup},i.prototype.setColGroup=function(e){return this.colgroup=e},i.prototype.getRows=function(){return this.getTable().tHead.rows},i.prototype.createHeaderTable=function(){var e=t.isBlazor()&&0!==this.parent.frozenRows,i=this.createTable(),r=this.getPanel().querySelector(".e-headercontent");return e||r.appendChild(i),r},i.prototype.createHeader=function(i,r){void 0===i&&(i=null);var n=t.isBlazor()&&0!==this.parent.frozenRows,o=this.parent,s=o.isFrozenGrid();t.isBlazor()&&!o.isJsComponent||!this.getTable()||s||t.remove(this.getTable());o.getColumns();var l=this.getPanel().querySelector(".e-headercontent"),a=n?i||l.querySelector(".e-table"):this.parent.createElement("table",{className:"e-table",attrs:{cellspacing:"0.25px",role:"grid"}}),h=r||(o.getFrozenLeftCount()?"frozen-left":"frozen-right"),d=this.createHeaderContent(h),p=d.thead,c=this.parent.createElement("tbody",{className:this.parent.frozenRows?"":"e-hide"});this.caption=this.parent.createElement("caption",{innerHTML:this.parent.element.id+"_header_table",className:"e-hide"});for(var u,g=this.parent.createElement("colgroup"),f=this.parent.createElement("tr"),m=this.rows=d.rows,y=(new vi(this.serviceLocator,e.CellType.Header,this.parent),0),v=m.length;y<v;y++)for(var C=0,w=m[y].cells.length;C<w;C++){m[y].cells[C];u=this.parent.createElement("td"),f.appendChild(u)}return(o.allowFiltering||o.allowSorting||o.allowGrouping)&&a.classList.add("e-sortfilter"),this.updateColGroup(g),n||c.appendChild(f),a.appendChild(this.setColGroup(g)),a.appendChild(p),n||a.appendChild(c),a.appendChild(this.caption),this.ariaService.setOptions(a,{colcount:o.getColumns().length.toString()}),a},i.prototype.createTable=function(e){return void 0===e&&(e=null),this.createHeader(e)},i.prototype.createHeaderContent=function(t){var i=this.parent,r=1,n=i.getFrozenMode(),o=i.getColumns(),s=this.parent.createElement("thead"),l=this.parent.createElement("tr",{className:"e-columnheader"}),a=new vi(this.serviceLocator,e.CellType.Header,i);a.element=l;var h,d=[];this.colDepth=ve(i.columns);for(var p=0,c=this.colDepth;p<c;p++)d[p]=this.generateRow(p),d[p].cells=[];"Right"!==n&&(d=this.ensureColumns(d)),d=this.getHeaderCells(d,t),"Right"===n&&(r=0,d=this.ensureColumns(d));var u=this.parent.getFrozenColumns();if(this.parent.isRowDragable()&&this.parent.isFrozenGrid()&&d[0].cells[r]){var g=d[0].cells[r].column.getFreezeTableName();"movable"===g||"Left-Right"===n&&"frozen-right"===g?"Right"===n?d[0].cells.pop():d[0].cells.shift():u||"frozen-left"!==g?"Right"===n&&"frozen-right"===g&&(d[0].cells[d[0].cells.length-1].column.freeze="Right"):d[0].cells[0].column.freeze="frozen-left"===g?"Left":"Right"}for(var p=0,c=this.colDepth;p<c;p++)h=a.render(d[p],o),this.parent.rowHeight&&h.querySelector(".e-headercell")&&(h.style.height=this.parent.rowHeight+"px"),s.appendChild(h);return{thead:s,rows:d}},i.prototype.updateColGroup=function(e){var i,r=this.parent.getColumns(),n=this.parent.getColumnIndexesInView();if(this.parent.enableColumnVirtualization&&this.parent.getFrozenColumns()&&this.parent.contentModule.isXaxis()&&(r=t.extend([],this.parent.getColumns())).splice(0,this.parent.getFrozenColumns()),e.id=this.parent.element.id+"colGroup",this.parent.allowGrouping)for(var o=0,s=this.parent.groupSettings.columns.length;o<s;o++)this.parent.enableColumnVirtualization&&-1===n.indexOf(o)||(i=this.parent.createElement("col",{className:"e-group-intent"}),e.appendChild(i));(this.parent.detailTemplate||this.parent.childGrid)&&(i=this.parent.createElement("col",{className:"e-detail-intent"}),e.appendChild(i)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(i=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(i));for(var o=0,s=r.length;o<s;o++)i=this.parent.createElement("col"),!1===r[o].visible&&t.setStyleAttribute(i,{display:"none"}),e.appendChild(i);return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&(i=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(i)),e},i.prototype.ensureColumns=function(t){for(var i=this.parent,r=this.parent.getColumnIndexesInView(),n=0,o=t.length;n<o;n++){if(i.allowGrouping)for(var s=0,l=i.groupSettings.columns.length;s<l;s++)this.parent.enableColumnVirtualization&&-1===r.indexOf(s)||t[n].cells.push(this.generateCell({},e.CellType.HeaderIndent));if(i.detailTemplate||i.childGrid){var a={};this.parent.notify("detail-indentcell-info",a),t[n].cells.push(this.generateCell(a,e.CellType.DetailHeader))}i.isRowDragable()&&t[n].cells.push(this.generateCell({},e.CellType.RowDragHIcon))}return t},i.prototype.getHeaderCells=function(e,t){var i=this.parent.getHeaderTable()&&this.parent.getHeaderTable().querySelector("thead"),r=this.parent.enableColumnVirtualization?this.parent.getColumns(this.parent.enablePersistence):this.parent.columns;if(this.frzIdx=0,this.notfrzIdx=0,this.parent.lockcolPositionCount)for(n=0;n<r.length;n++)this.lockColsRendered=!1,e=this.appendCells(r[n],e,0,0===n,!1,n===r.length-1,i,t);for(var n=0,o=r.length;n<o;n++)this.notfrzIdx=0,this.lockColsRendered=!0,e=this.appendCells(r[n],e,0,0===n,!1,n===o-1,i,t);return e},i.prototype.appendCells=function(t,i,r,n,o,s,l,a){var h,d=s?"e-lastcell":"",p=this.parent.isFrozenGrid(),c=!this.parent.lockcolPositionCount||t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered,u=!this.parent.lockcolPositionCount||t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered,g=this.parent.getContent().querySelector(".e-movablescrollbar");if(p&&g&&this.parent.enableColumnVirtualization&&(h=g.scrollLeft),t.columns){this.isFirstCol=!1;var f=this.getCellCnt(t,0);if(f){var m=this.getStackedLockColsCount(t,0),y=0===this.parent.lockcolPositionCount||!this.lockColsRendered&&0!==m||this.lockColsRendered&&f-m!=0,v=p&&this.ensureStackedFrozen(t.columns,a,!1);(!p&&y||v)&&i[r].cells.push(new mi({cellType:e.CellType.StackedHeader,column:t,colSpan:this.getColSpan(f,m,t.columns,a,p)}))}if(this.parent.lockcolPositionCount&&!this.lockColsRendered)for(C=0;C<t.columns.length;C++)i=this.appendCells(t.columns[C],i,r+1,n,0===C,C===t.columns.length-1&&s,l,a);if(this.lockColsRendered)for(var C=0,w=t.columns.length;C<w;C++){var b=this.isFirstCol=t.columns[C].visible&&!this.isFirstCol&&1!==w,S=C===w-1;i=this.appendCells(t.columns[C],i,r+1,n,b,S&&s,l,a)}}else h&&h>0&&this.parent.contentModule.isXaxis()&&0!==this.parent.inViewIndexes[0]&&"movable"===t.getFreezeTableName()?i[r].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-r,(n?"":o?"e-firstcell":"")+d,r,this.parent.getColumnIndexByUid(t.uid))):(!p&&c||p&&t.getFreezeTableName()===a&&u)&&i[r].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-r,(n?"":o?"e-firstcell":"")+d,r,this.parent.getColumnIndexByUid(t.uid))),this.parent.lockcolPositionCount?this.frzIdx+this.notfrzIdx<this.parent.frozenColumns&&(t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered)?this.frzIdx++:this.notfrzIdx++:this.frzIdx++;return i},i.prototype.ensureStackedFrozen=function(e,t,i){for(var r=e.length,n=0;n<r;n++)if(e[n].columns)i=this.ensureStackedFrozen(e[n].columns,t,i);else if(e[n].getFreezeTableName()===t){i=!0;break}return i},i.prototype.getStackedLockColsCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getStackedLockColsCount(e.columns[i],t);else e.lockColumn&&t++;return t},i.prototype.getColSpan=function(e,t,i,r,n){return n?e=this.getFrozenColSpan(i,r,0):this.parent.lockcolPositionCount&&(e=this.lockColsRendered?e-t:t),e},i.prototype.getFrozenColSpan=function(e,t,i){for(var r=e.length,n=0;n<r;n++)e[n].columns?i=this.getFrozenColSpan(e[n].columns,t,i):e[n].getFreezeTableName()===t&&i++;return i},i.prototype.generateRow=function(e){return new fi({})},i.prototype.generateCell=function(e,i,r,n,o,s){var l={visible:e.visible,isDataCell:!1,isTemplate:!t.isNullOrUndefined(e.headerTemplate),rowID:"",column:e,cellType:i,rowSpan:r,className:n,index:o,colIndex:s};return(!l.rowSpan||l.rowSpan<2)&&delete l.rowSpan,new mi(l)},i.prototype.setVisible=function(e){for(var i,r,n=this.parent,o=([].slice.call(this.getRows()),n.getFrozenColumns()),s=0,l=e.length;s<l;s++){var a=e[s];if(r=n.getNormalizedColumnIndex(a.uid),i=a.visible?"":"none",o){var h=this.parent.isRowDragable()?o+1:o;if(r<h)t.isBlazor()&&n.isServerRendered?(t.setStyleAttribute(this.getTable().querySelector("colgroup").children[r],{display:i}),t.setStyleAttribute(this.getTable().querySelectorAll("th")[r],{display:i})):t.setStyleAttribute(this.getColGroup().children[r],{display:i});else{var d=n.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup"),p=n.getHeaderContent().querySelector(".e-movableheader").querySelector("table");t.setStyleAttribute(d.children[r-h],{display:i}),t.isBlazor()&&n.isServerRendered&&t.setStyleAttribute(p.querySelectorAll("th")[r-o],{display:i})}}else t.setStyleAttribute(this.getColGroup().children[r],{display:i})}this.refreshUI()},i.prototype.colPosRefresh=function(){t.isBlazor()&&this.parent.isServerRendered&&this.parent.frozenRows&&this.parent.getFrozenColumns()&&(this.freezeReorder=!0),this.refreshUI()},i.prototype.refreshUI=function(){var e=this.parent.isFrozenGrid(),i=this.parent.enableColumnVirtualization&&e,r=t.isBlazor()&&this.parent.isServerRendered&&0!==this.parent.frozenRows&&e,n=this.getPanel();this.toggleStackClass(n);var o=this.freezeReorder?this.headerPanel.querySelector(".e-movableheader").querySelector(".e-table"):this.getTable(),s=this.parent.isFrozenGrid()?this.parent.getFrozenLeftCount()?"frozen-left":"frozen-right":void 0;if(i&&(o=this.parent.contentModule.getVirtualFreezeHeader(),s=this.parent.contentModule.isXaxis()?"movable":s),r&&!i&&(o=this.freezeReorder?this.headerPanel.querySelector(".e-movableheader").querySelector(".e-table"):this.headerPanel.querySelector(".e-frozenheader").querySelector(".e-table")),o){t.isBlazor()&&this.parent.isServerRendered?(o.removeChild(o.querySelector("colgroup")),o.removeChild(o.querySelector("thead"))):(t.remove(o),o.removeChild(o.firstChild),o.removeChild(o.childNodes[0]));var l=this.parent.createElement("colgroup"),a=this.createHeaderContent(s);this.rows=a.rows,o.insertBefore(a.thead,o.firstChild),this.updateColGroup(l),o.insertBefore(this.setColGroup(l),o.firstChild),i||r||this.setTable(o),t.isBlazor()&&this.parent.isServerRendered||this.appendContent(o),this.parent.notify(kt,{}),this.widthService.setWidthToColumns(),this.parent.updateDefaultCursor(),(!e||this.parent.enableColumnVirtualization&&e)&&this.initializeHeaderDrag();for(var h=[].slice.call(n.querySelectorAll("tr.e-columnheader")),d=0,p=h;d<p.length;d++){var c=p[d],u=[].slice.call(c.querySelectorAll(".e-grouptopleftcell"));u.length&&u[u.length-1].classList.add("e-lastgrouptopleftcell")}e||this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:e}}),this.parent.enableColumnVirtualization&&O(o,"e-movableheader")&&this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!1,isXaxis:!0}}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&X(h,!0)}},i.prototype.toggleStackClass=function(e){this.parent.columns.some(function(e){return!t.isNullOrUndefined(e.columns)})?e.classList.add("e-stackedheader"):e.classList.remove("e-stackedheader")},i.prototype.appendContent=function(e){this.getPanel().querySelector(".e-headercontent").appendChild(e)},i.prototype.getCellCnt=function(e,t){if(e.columns)for(var i=0,r=e.columns.length;i<r;i++)t=this.getCellCnt(e.columns[i],t);else e.visible&&t++;return t},i.prototype.initializeHeaderDrag=function(){var e=this.parent;(this.parent.allowReordering||this.parent.allowGrouping&&this.parent.groupSettings.showDropArea)&&(this.draggable=new t.Draggable(e.getHeaderContent(),{dragTarget:".e-headercell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,abort:".e-rhandler",isReplaceDragEle:this.isReplaceDragEle}))},i.prototype.initializeHeaderDrop=function(){var e=this.parent;new t.Droppable(e.getHeaderContent(),{accept:".e-dragclone",drop:this.drop})},i.prototype.renderCustomToolbar=function(){var e=this,t=this.parent;if("Vertical"===t.rowRenderingMode&&!t.toolbar&&(t.allowSorting||t.allowFiltering&&"FilterBar"!==t.filterSettings.type)){for(var i=t.createElement("div",{className:"e-res-toolbar e-toolbar"}),r=t.createElement("div",{className:"e-toolbar-items"}),o=t.createElement("div",{className:"e-toolbar-left"}),s=this.parent.allowFiltering&&this.parent.allowSorting?2:1,l=0;l<s;l++){var a=t.createElement("div",{className:"e-toolbar-item e-gridresponsiveicons e-icons e-tbtn-align"}),h=1===s?this.parent.allowSorting?"sort":"filter":1===l?"sort":"filter",d=t.createElement("button",{className:"e-tbar-btn e-control e-btn e-lib e-icon-btn"}),p=t.createElement("span",{className:"e-btn-icon e-res"+h+"-icon e-icons"});d.appendChild(p),new n.Button({}).appendTo(d),d.onclick=function(t){t.target.classList.contains("e-ressort-btn")||t.target.classList.contains("e-ressort-icon")?e.parent.showResponsiveCustomSort():e.parent.showResponsiveCustomFilter()},a.appendChild(d),o.appendChild(a)}r.appendChild(o),i.appendChild(r),t.element.insertBefore(i,this.parent.element.querySelector(".e-gridheader"))}else t.toolbar||t.getContent().classList.add("e-responsive-header")},i.prototype.updateCustomResponsiveToolbar=function(e){var i=this.parent.element.querySelector(".e-responsive-toolbar");"toolbar"===e.module&&(i?t.remove(i):this.renderCustomToolbar())},i}(),Ti=function(){function i(e,t){this.localizer=t.getService("localization"),this.formatter=t.getService("valueFormatter"),this.parent=e,this.element=this.parent.createElement("TD",{className:"e-rowcell",attrs:{role:"gridcell",tabindex:"-1"}}),this.rowChkBox=this.parent.createElement("input",{className:"e-checkselect",attrs:{type:"checkbox"}})}return i.prototype.getGui=function(){return""},i.prototype.format=function(e,i,r){return t.isNullOrUndefined(e.format)||("number"===e.type&&isNaN(parseInt(i,10))&&(i=null),i=this.formatter.toView(i,e.getFormatter())),t.isNullOrUndefined(i)?"":i.toString()},i.prototype.evaluate=function(e,i,r,n,o,s){var l,a;if(i.column.template){var h=this.parent.isReact&&"string"!=typeof i.column.template,d=["index"],p=me({},r,(l={},l.foreignKeyData=o,l.column=i.column,l)),c=this.parent.element.id+i.column.uid,u="isStringTemplate";if(t.isBlazor()&&s){var g="Batch"!==this.parent.editSettings.mode?parseInt(n.index,10):null;a=i.column.getColumnTemplate()(t.extend({index:n[d[0]]},p),this.parent,"template",c,this.parent[u],g),window[c]=null,"Batch"!==this.parent.editSettings.mode&&t.updateBlazorTemplate(c,"Template",i.column,!1)}else if(h){var f={index:n[d[0]]};i.column.getColumnTemplate()(t.extend(f,p),this.parent,"columnTemplate",c,this.parent[u],null,e),this.parent.renderTemplates()}else a=i.column.getColumnTemplate()(t.extend({index:n[d[0]]},p),this.parent,"template",c,this.parent[u]);return h||q(e,a),this.parent.notify("template-result",{template:a}),a=null,e.setAttribute("aria-label",e.innerText+" is template cell column header "+i.column.headerText),!1}return!0},i.prototype.invokeFormatter=function(e,i,r){return t.isNullOrUndefined(e.formatter)||(i=u(e.formatter,"getValue")?(new(0,e.formatter)).getValue(e,r):"function"==typeof e.formatter?e.formatter(e,r):e.formatter.getValue(e,r)),i},i.prototype.render=function(e,t,i,r,n){return this.refreshCell(e,t,i,n)},i.prototype.refreshTD=function(e,i,r,n){var o="Batch"===this.parent.editSettings.mode&&e.classList.contains("e-editedbatchcell");if(this.parent.isReact){e.innerHTML="";var s=e.cellIndex,l=e.parentElement;t.remove(e);var a=this.refreshCell(i,r,n,o);this.cloneAttributes(a,e),l.cells.length!==s-1?l.insertBefore(a,l.cells[s]):l.appendChild(a)}else{var h=this.refreshCell(i,r,n,o);e.innerHTML="",e.setAttribute("aria-label",h.getAttribute("aria-label"));for(var d=0,p=[].slice.call(h.childNodes);d<p.length;d++){var c=p[d];e.appendChild(c)}}},i.prototype.cloneAttributes=function(e,t){for(var i,r=t.attributes,n=r.length;n--;)i=r[n],e.setAttribute(i.name,i.value)},i.prototype.refreshCell=function(e,i,r,o){var s,l,a=this.element.cloneNode(),h=e.column;e.isForeignKey&&(l=e.foreignKeyData[0]||(s={},s[h.foreignKeyValue]=h.format?null:"",s));var d=this.getGui(),p=e.isForeignKey?this.getValue(h.foreignKeyValue,l,h):this.getValue(h.field,i,h);if("date"!==h.type&&"datetime"!==h.type||t.isNullOrUndefined(p)||(p=new Date(p)),p=this.format(h,p,i),d=p.toString(),"boolean"===h.type&&!h.displayAsCheckBox){var c="true"!==p&&"false"!==p?null:"true"===p?"True":"False";d=c?this.localizer.getConstant(c):d}var u=this.invokeFormatter(h,p,i);if(d=t.isNullOrUndefined(h.formatter)?d:t.isNullOrUndefined(u)?"":u.toString(),a.setAttribute("aria-label",d+" column header "+e.column.headerText),this.evaluate(a,e,i,r,l,o)&&"checkbox"!==h.type?this.appendHtml(a,d,h.getDomSetter?h.getDomSetter():"innerHTML"):"checkbox"===h.type&&(a.classList.add("e-gridchkbox"),a.setAttribute("aria-label","checkbox"),p=!!this.parent.selectionSettings.persistSelection&&"true"===p,(f=n.createCheckBox(this.parent.createElement,!1,{checked:p,label:" "})).insertBefore(this.rowChkBox.cloneNode(),f.firstChild),a.appendChild(f)),"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(e.isSelected=!0),this.setAttributes(a,e,r),"boolean"===h.type&&h.displayAsCheckBox){var g=isNaN(parseInt(p.toString(),10))?"true"===p:parseInt(p.toString(),10)>0,f=n.createCheckBox(this.parent.createElement,!1,{checked:g,label:" "});a.innerHTML="",f.classList.add("e-checkbox-disabled"),a.appendChild(f),a.setAttribute("aria-label",g+" column header "+e.column.headerText)}return a},i.prototype.appendHtml=function(e,t,i){return void 0===i&&(i="innerHTML"),e[i]=t,e},i.prototype.setAttributes=function(e,t,i){var r=t.column;this.buildAttributeFromCell(e,t,"checkbox"===r.type),F(e,i),F(e,t.attributes),r.customAttributes&&F(e,r.customAttributes),"Vertical"===this.parent.rowRenderingMode&&F(e,{"data-cell":r.headerText}),r.textAlign&&(e.style.textAlign=r.textAlign),"Clip"===r.clipMode||!r.clipMode&&"Clip"===this.parent.clipMode?e.classList.add("e-gridclip"):("EllipsisWithTooltip"===r.clipMode||!r.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&"checkbox"!==r.type&&e.classList.add("e-ellipsistooltip")},i.prototype.buildAttributeFromCell=function(i,r,n){var o={},s={colindex:"aria-colindex"},l=[];r.colSpan&&(o.colSpan=r.colSpan),r.rowSpan&&(o.rowSpan=r.rowSpan),r.isTemplate&&l.push("e-templatecell"),r.isSelected&&(l.push.apply(l,["e-selectionbackground","e-active"]),n&&i.querySelector(".e-frame").classList.add("e-check")),r.isColumnSelected&&l.push.apply(l,["e-columnselection"]),r.cellType===e.CellType.Header?o[s.colindex]=r.colIndex:t.isNullOrUndefined(r.index)||(o[s.colindex]=r.index),r.visible||l.push("e-hide"),o.class=l,F(i,o)},i.prototype.getValue=function(e,t,i){return i.valueAccessor(e,t,i)},i}(),Ei=function(){function e(){}return e.prototype.setOptions=function(e,t){for(var i=Object.keys(t),r=0;r<i.length;r++)p(e,Mi[i[r]],t[i[r]])},e.prototype.setExpand=function(e,t){p(e,Mi.expand,t)},e.prototype.setSort=function(e,t){p(e,Mi.sort,t,"boolean"==typeof t)},e.prototype.setBusy=function(e,t){p(e,Mi.busy,t),p(e,Mi.invalid,null,!0)},e.prototype.setGrabbed=function(e,t,i){p(e,Mi.grabbed,t,i)},e.prototype.setDropTarget=function(e,t){p(e,Mi.dropeffect,"copy",!t)},e}(),Mi={expand:"aria-expanded",role:"role",selected:"aria-selected",multiselectable:"aria-multiselectable",sort:"aria-sort",busy:"aria-busy",invalid:"aria-invalid",grabbed:"aria-grabbed",dropeffect:"aria-dropeffect",haspopup:"aria-haspopup",level:"aria-level",colcount:"aria-colcount",rowcount:"aria-rowcount"},Di=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Oi=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell",attrs:{role:"columnheader",tabindex:"-1"}}),t.ariaService=new Ei,t.hTxtEle=t.parent.createElement("span",{className:"e-headertext"}),t.sortEle=t.parent.createElement("div",{className:"e-sortfilterdiv e-icons"}),t.gui=t.parent.createElement("div"),t.chkAllBox=t.parent.createElement("input",{className:"e-checkselectall",attrs:{type:"checkbox"}}),t}return Di(i,e),i.prototype.getGui=function(){return this.gui.cloneNode()},i.prototype.render=function(e,t,i){var r=this.element.cloneNode(),n=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter"});return this.prepareHeader(e,r,n)},i.prototype.refresh=function(e,t){this.clean(t);var i=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter"});return this.prepareHeader(e,t,i)},i.prototype.clean=function(e){e.innerHTML=""},i.prototype.prepareHeader=function(e,i,r){var o,s=e.column,l={},a=this.getGui();if(t.attributes(a,{"e-mappinguid":s.uid,class:"e-headercelldiv"}),t.isNullOrUndefined(s.headerValueAccessor)||(o=this.getValue(s.headerText,s)),"checkbox"!==s.type){var h=s.headerText;t.isNullOrUndefined(o)||(h=o);var d=this.hTxtEle.cloneNode();d[s.getDomSetter()]=h,a.appendChild(d)}else{s.editType="booleanedit";var p=n.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "});p.insertBefore(this.chkAllBox.cloneNode(),p.firstChild),a.appendChild(p),a.classList.add("e-headerchkcelldiv")}if(this.buildAttributeFromCell(i,e),this.appendHtml(i,a),i.appendChild(this.sortEle.cloneNode()),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&s.allowFiltering&&!t.isNullOrUndefined(s.field)&&(!this.parent.showColumnMenu||!s.showColumnMenu)){t.attributes(r,{"e-mappinguid":"e-flmenu-"+s.uid}),i.classList.add("e-fltr-icon");var c=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==c.length)for(var u=this.parent.getForeignKeyColumns(),g=0;g<this.parent.columns.length;g++)for(var f=0;f<this.parent.filterSettings.columns.length;f++)if(this.parent.filterSettings.columns[f].field===s.field||u.length&&s.foreignKeyValue===this.parent.filterSettings.columns[f].field){r.classList.add("e-filtered"),c.push(s.field);break}i.appendChild(r.cloneNode())}e.className&&i.classList.add(e.className),s.customAttributes&&F(i,s.customAttributes),s.allowSorting&&(l.sort="none"),s.allowGrouping&&(l.grabbed=!1),i=this.extendPrepareHeader(s,i);var m,y=this.parent,v=y.getColumnIndexByField(s.field);if(!t.isNullOrUndefined(s.headerTemplate)){var C=y.element.id+s.uid+"headerTemplate",w="isStringTemplate",b=t.isBlazor()?s.toJSON():s;if(this.parent.isReact&&"string"!=typeof s.headerTemplate){var S={index:v};i.firstElementChild.innerHTML="",s.getHeaderTemplate()(t.extend(S,b),y,"headerTemplate",C,this.parent[w],null,i.firstElementChild),this.parent.renderTemplates()}else m=s.getHeaderTemplate()(t.extend({index:v},b),y,"headerTemplate",C,this.parent[w]),i.firstElementChild.innerHTML="",q(i.firstElementChild,m)}if(this.ariaService.setOptions(i,l),!t.isNullOrUndefined(s.headerTextAlign)||!t.isNullOrUndefined(s.textAlign)){var x=s.headerTextAlign||s.textAlign;a.style.textAlign=x,"Right"===x||"Left"===x?i.classList.add("Right"===x?"e-rightalign":"e-leftalign"):"Center"===x&&i.classList.add("e-centeralign")}return"Clip"===s.clipMode||!s.clipMode&&"Clip"===this.parent.clipMode?i.classList.add("e-gridclip"):("EllipsisWithTooltip"===s.clipMode||!s.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&"checkbox"!==s.type&&i.classList.add("e-ellipsistooltip"),i.setAttribute("aria-rowspan",(t.isNullOrUndefined(e.rowSpan)?1:e.rowSpan).toString()),i.setAttribute("aria-colspan","1"),this.parent.trigger("headerCellInfo",{cell:e,node:i}),i},i.prototype.getValue=function(e,t){return t.headerValueAccessor(e,t)},i.prototype.extendPrepareHeader=function(e,i){if(this.parent.showColumnMenu&&e.showColumnMenu&&!t.isNullOrUndefined(e.field)){var r=this.parent.createElement("div",{className:"e-icons e-columnmenu"}),n=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==n.length)for(var o=0;o<this.parent.columns.length;o++)for(var s=0;s<this.parent.filterSettings.columns.length;s++)if(this.parent.filterSettings.columns[s].field===e.field){r.classList.add("e-filtered"),n.push(e.field);break}i.classList.add("e-fltr-icon"),i.appendChild(r)}if(this.parent.allowResizing){var l=this.parent.createElement("div");l.className=e.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",i.appendChild(l)}return i},i.prototype.appendHtml=function(e,t){return e.appendChild(t),e},i}(Ti),Ai=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bi=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell e-stackedheadercell",attrs:{role:"columnheader",tabindex:"-1"}}),t}return Ai(i,e),i.prototype.render=function(e,i,r){var n=this.element.cloneNode(),o=this.parent.createElement("div",{className:"e-stackedheadercelldiv",attrs:{"e-mappinguid":e.column.uid}}),s=e.column;if(n.appendChild(o),t.isNullOrUndefined(s.headerTemplate)?this.appendHtml(o,s.headerText,s.getDomSetter()):q(o,s.getHeaderTemplate()(s,this.parent,"headerTemplate")),e.column.toolTip&&n.setAttribute("title",e.column.toolTip),"Clip"===s.clipMode||!s.clipMode&&"Clip"===this.parent.clipMode?n.classList.add("e-gridclip"):("EllipsisWithTooltip"===s.clipMode||!s.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&n.classList.add("e-ellipsistooltip"),t.isNullOrUndefined(e.column.textAlign)||(o.style.textAlign=e.column.textAlign),e.column.customAttributes&&F(n,e.column.customAttributes),n.setAttribute("colspan",e.colSpan.toString()),n.setAttribute("aria-colspan",e.colSpan.toString()),n.setAttribute("aria-rowspan","1"),this.parent.allowResizing){var l=this.parent.createElement("div");l.className=e.column.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",n.appendChild(l)}return this.parent.trigger("headerCellInfo",{cell:e,node:n}),n},i}(Ti),ki=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Li=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-indentcell"}),t}return ki(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return F(i,e.attributes),i},t}(Ti),Pi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ni=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-groupcaption",attrs:{id:t.parent.element.id+"captioncell",role:"gridcell",tabindex:"-1"}}),t}return Pi(i,e),i.prototype.render=function(e,i){var r,n,o=this.element.cloneNode(),s=this.parent;i.headerText=e.column.headerText,e.isForeignKey&&(n=this.format(e.column,e.column.valueAccessor("foreignKey",i,e.column)));var l=e.isForeignKey?n:e.column.enableGroupByFormat?i.key:this.format(e.column,e.column.valueAccessor("key",i,e.column));if(t.isNullOrUndefined(s.groupSettings.captionTemplate))s.groupSettings.enableLazyLoading?o.innerHTML=e.column.headerText+": "+l:o.innerHTML=e.column.headerText+": "+l+" - "+i.count+" "+(i.count<2?this.localizer.getConstant("Item"):this.localizer.getConstant("Items"));else{var a=this.parent.isReact&&"string"!=typeof s.groupSettings.captionTemplate;if(t.isBlazor()){h=s.element.id+"captionTemplate";r=R(s.groupSettings.captionTemplate)(i,null,null,h)}else if(a){var h=s.element.id+"captionTemplate";R(s.groupSettings.captionTemplate)(i,this.parent,"captionTemplate",h,null,null,o),this.parent.renderTemplates()}else r=this.parent.isVue?R(s.groupSettings.captionTemplate)(i,this.parent):R(s.groupSettings.captionTemplate)(i);a||q(o,r)}return o.setAttribute("colspan",e.colSpan.toString()),o.setAttribute("aria-label",o.innerHTML+" is groupcaption cell"),o.setAttribute("title",o.innerHTML),o},i}(Ti),qi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-groupcaption"}),t}return Pi(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.innerHTML="&nbsp;",i.setAttribute("colspan",e.colSpan.toString()),i},t}(Ti),Hi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ui=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Hi(t,e),t.prototype.render=function(e,t,i,r){var n=this.element.cloneNode();return n.className=r?"e-recordplusexpand":"e-recordpluscollapse",n.setAttribute("ej-mappingname",t.field),n.setAttribute("ej-mappingvalue",t.key),n.setAttribute("aria-expanded",r?"true":"false"),n.setAttribute("tabindex","-1"),n.appendChild(this.parent.createElement("div",{className:r?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow"})),n},t}(Li),ji=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-grouptopleftcell"}),t}return ji(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-headercelldiv e-emptycell",innerHTML:""})),i},t}(Ti),Gi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-detailheadercell"}),t}return Gi(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-emptycell"})),i},t}(Ti),Wi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ki=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-detailrowcollapse",attrs:{"aria-expanded":"false",role:"gridcell",tabindex:"-1"}}),t}return Wi(i,e),i.prototype.render=function(e,i,r){var n=this.element.cloneNode();return r&&!t.isNullOrUndefined(r.class)?(n.className="",n.className=r.class,n.appendChild(this.parent.createElement("div",{className:"e-icons e-dtdiagonaldown e-icon-gdownarrow"}))):n.appendChild(this.parent.createElement("div",{className:"e-icons e-dtdiagonalright e-icon-grightarrow"})),n},i}(Ti),Qi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ji=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-rowdragdrop",attrs:{role:"gridcell",tabindex:"-1"}}),t}return Qi(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-icons e-rowcelldrag e-dtdiagonalright e-icon-rowdragicon"})),e.isSelected&&(i.classList.add("e-selectionbackground"),i.classList.add("e-active")),i},t}(Ti),Xi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yi=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-rowdragheader"}),t}return Xi(i,e),i.prototype.render=function(e,i){var r=this.element.cloneNode();return r.appendChild(t.createElement("div",{className:"e-emptycell"})),r},i}(Ti),$i=function(){function r(e,t){this.emptyGrid=!1,this.counter=0,this.parent=e,this.locator=t,this.data=new gi(e,t),this.l10n=t.getService("localization"),this.ariaService=this.locator.getService("ariaService"),this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}return r.prototype.render=function(){var i=this.parent;this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer.renderPanel(),this.contentRenderer.renderPanel(),i.getColumns().length&&(this.isLayoutRendered=!0,this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.emptyRow(!1)),this.parent.scrollModule.setWidth(),this.parent.scrollModule.setHeight(),"auto"!==this.parent.height&&this.parent.scrollModule.setPadding(),t.isBlazor()&&this.parent.isServerRendered||this.refreshDataManager()},r.prototype.refresh=function(e){var i=this;void 0===e&&(e={requestType:"refresh"});var r=this.parent;if(r.notify(e.requestType+"-begin",e),t.isBlazor()&&this.resetTemplates(),t.isBlazor()&&r.isServerRendered){if(r.bulkChanges.dataSource&&delete r.bulkChanges.dataSource,r.notify("blazor-action-begin",e),"filtering"===e.requestType){e.columns=null}if("sorting"===e.requestType){e.target=null}"Batch"!==r.editSettings.mode||r.isEdit||r.notify("closebatch",{})}var n=this.parent.preventUpdate;r.trigger(yt,e,function(o){if(void 0===o&&(o={requestType:"refresh"}),"delete"===o.requestType&&t.isBlazor()&&!r.isJsComponent){if(t.isNullOrUndefined(r.commandDelIndex))o.data=r.getSelectedRecords();else{var s=o.data;o.data={},o.data[0]=s}}if(o.cancel)return void r.notify("cancel-Begin",o);if(t.isBlazor()&&"Normal"===r.editSettings.mode&&r.isEdit&&"infiniteScroll"!==e.requestType&&r.notify("closeinline",{}),"delete"===o.requestType&&r.allowPaging){var l=o.data.length,a=r.pageSettings.totalRecordsCount-l;r.getCurrentViewRecords().length-l||!a||(r.pageSettings.currentPage-1)*r.pageSettings.pageSize!=a||(r.prevPageMoving=!0,r.setProperties({pageSettings:{totalRecordsCount:a,currentPage:Math.ceil(a/r.pageSettings.pageSize)}},!0),r.pagerModule.pagerObj.totalRecordsCount=a)}if(t.isBlazor()&&i.parent.isServerRendered){if(n){return void(r.bulkChanges={})}"refresh"===e.requestType&&i.parent.notify("updateaction",o),"virtualscroll"!==o.requestType&&i.parent.showSpinner(),"delete"===o.requestType||"save"===o.requestType?(i.parent.notify(ti,o),i.parent.notify("add-delete-success",o)):(i.parent.allowServerDataBinding=!0,i.parent.serverDataBind(),i.parent.allowServerDataBinding=!1)}else"reorder"===o.requestType&&i.parent.dataSource&&"result"in i.parent.dataSource?i.contentRenderer.refreshContentRows(o):("paging"===o.requestType||"columnstate"===o.requestType||"reorder"===o.requestType)&&i.parent.groupSettings.enableLazyLoading&&i.parent.groupSettings.columns.length&&i.parent.contentModule.getGroupCache()[i.parent.pageSettings.currentPage]?i.contentRenderer.refreshContentRows(o):i.refreshDataManager(o)})},r.prototype.resetTemplates=function(){var e=this.parent,i=e.getColumns();if(e.detailTemplate){var r=e.element.id+"detailTemplate";t.blazorTemplates[r]=[],t.resetBlazorTemplate(r,"DetailTemplate")}e.groupSettings.captionTemplate&&t.resetBlazorTemplate(e.element.id+"captionTemplate","CaptionTemplate"),e.rowTemplate&&t.resetBlazorTemplate(e.element.id+"rowTemplate","RowTemplate"),e.toolbarTemplate&&t.resetBlazorTemplate(e.element.id+"toolbarTemplate","ToolbarTemplate"),e.pageSettings.template&&t.resetBlazorTemplate(e.element.id+"_template","pageSettings");for(var n=0;n<i.length;n++)i[n].template&&(t.blazorTemplates[e.element.id+i[n].uid]=[],t.resetBlazorTemplate(e.element.id+i[n].uid,"Template")),i[n].headerTemplate&&t.resetBlazorTemplate(e.element.id+i[n].uid+"headerTemplate","HeaderTemplate"),i[n].filterTemplate&&t.resetBlazorTemplate(e.element.id+i[n].uid+"filterTemplate","FilterTemplate");for(var o=0;o<e.aggregates.length;o++)for(var s=0;s<e.aggregates[o].columns.length;s++){if(e.aggregates[o].columns[s].footerTemplate){l=e.element.id+e.aggregates[o].columns[s].guid+"footerTemplate";t.resetBlazorTemplate(l,"FooterTemplate")}if(e.aggregates[o].columns[s].groupFooterTemplate){l=e.element.id+e.aggregates[o].columns[s].guid+"groupFooterTemplate";t.resetBlazorTemplate(l,"GroupFooterTemplate")}if(e.aggregates[o].columns[s].groupCaptionTemplate){var l=e.element.id+e.aggregates[o].columns[s].guid+"groupCaptionTemplate";t.resetBlazorTemplate(l,"GroupCaptionTemplate")}}},r.prototype.refreshComplete=function(e){t.isBlazor()&&!this.parent.isJsComponent&&(e.rows=null),this.parent.trigger(vt,e)},r.prototype.refreshDataManager=function(e){var t=this;void 0===e&&(e={}),"virtualscroll"!==e.requestType&&this.parent.showSpinner(),this.parent.notify("reset-infinite-blocks",e),this.emptyGrid=!1;var r,n=this.isNeedForeignAction();if(this.ariaService.setBusy(this.parent.getContent().querySelector(".e-content"),!0),n){var o=new i.Deferred;r=this.getFData(o,e)}if(r=r?r.then(function(r){var n=t.data.generateQuery().requiresCount();if(t.emptyGrid){var o=new i.Deferred;return o.resolve({result:[],count:0}),o.promise}return t.data.getData(e,n)}):this.data.getData(e,this.data.generateQuery().requiresCount()),this.parent.getForeignKeyColumns().length&&(!n||this.parent.searchSettings.key.length)){var s=new i.Deferred;r=r.then(function(i){return t.parent.notify("getForeignKeyData",{dataManager:r,result:i,promise:s,action:e}),s.promise})}this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&(r=r.then(function(e){return t.validateGroupRecords(e)})),r.then(function(i){return t.dataManagerSuccess(i,e)}).catch(function(i){return t.dataManagerFailure(i,e)})},r.prototype.getFData=function(e,t){return this.parent.notify("getForeignKeyData",{isComplex:!0,promise:e,action:t}),e.promise},r.prototype.isNeedForeignAction=function(){var e=this.parent;return!!(e.allowFiltering&&e.filterSettings.columns.length||e.searchSettings.key.length)&&this.foreignKey(this.parent.getForeignKeyColumns())},r.prototype.foreignKey=function(e){var t=this;return e.some(function(e){return!(!t.parent.filterSettings.columns.some(function(t){return e.uid===t.uid})&&!t.parent.searchSettings.key.length)})},r.prototype.sendBulkRequest=function(e){var i=this;e.requestType="batchsave";var r=this.data.saveChanges(e.changes,this.parent.getPrimaryKeyFieldNames()[0],e.original);if(t.isBlazor()&&!this.parent.isJsComponent)r.then(function(t){i.parent.notify("editsuccess",e)}).catch(function(e){t.isNullOrUndefined(e.error)||t.isNullOrUndefined(e.error.message)||(e.error=e.error.message),i.parent.trigger("actionFailure",e)});else{var n=this.data.generateQuery().requiresCount();if(this.data.dataManager.dataSource.offline)return void this.refreshDataManager({requestType:"batchsave"});r.then(function(t){i.data.getData(e,n).then(function(t){return i.dmSuccess(t,e)}).catch(function(t){return i.dmFailure(t,e)})}).catch(function(t){return i.dmFailure(t,e)})}},r.prototype.dmSuccess=function(e,t){this.dataManagerSuccess(e,t)},r.prototype.dmFailure=function(e,t){this.dataManagerFailure(e,t)},r.prototype.renderEmptyRow=function(){this.emptyRow(!0)},r.prototype.emptyRow=function(e){var i,r=this.parent,n=this.contentRenderer.getTable().querySelector("tbody");t.isNullOrUndefined(n)||t.remove(n),n=this.parent.createElement("tbody");var o=0;(r.detailTemplate||r.childGrid)&&++o,(i=this.parent.createElement("tr",{className:"e-emptyrow"})).appendChild(this.parent.createElement("td",{innerHTML:this.l10n.getConstant("EmptyRecord"),attrs:{colspan:(r.getVisibleColumns().length+o).toString()}})),n.appendChild(i),this.contentRenderer.renderEmpty(n),e&&(this.parent.trigger(Ct,{}),this.parent.notify(Ot,{rows:[new fi({isDataRow:!0,cells:[new mi({isDataCell:!0,visible:!0})]})]}))},r.prototype.dynamicColumnChange=function(){this.parent.getCurrentViewRecords().length&&this.updateColumnType(this.parent.getCurrentViewRecords()[0])},r.prototype.updateColumnType=function(e){for(var i,r=this.parent.getColumns(),n=e&&e.items?e.items[0]:e,o=this.locator.getService("valueFormatter"),s=0,l=r.length;s<l;s++){i=ce(r[s].field||"",n),t.isNullOrUndefined(r[s].customFormat)||(r[s].format=r[s].customFormat),t.isNullOrUndefined(r[s].validationRules)||t.isNullOrUndefined(r[s].validationRules.equalTo)||(r[s].validationRules.equalTo[0]=this.parent.element.id+r[s].validationRules.equalTo[0]),r[s].isForeignColumn()&&r[s].columnData&&(i=ce(r[s].foreignKeyValue||"",r[s].columnData[0])),t.isNullOrUndefined(i)?r[s].type=r[s].type||(t.isBlazor()&&this.parent.isServerRendered?"none":null):(this.isColTypeDef=!0,(!r[s].type||t.isBlazor()&&this.parent.isServerRendered&&"none"===r[s].type)&&(r[s].type=i.getDay?i.getHours()>0||i.getMinutes()>0||i.getSeconds()>0||i.getMilliseconds()>0?"datetime":"date":typeof i));var a=new ut;if(r[s].format&&(r[s].format.skeleton||r[s].format.format)&&(r[s].setFormatter(a.getFormatFunction(t.extend({},r[s].format))),r[s].setParser(a.getParserFunction(r[s].format))),"string"==typeof r[s].format){var h=this.parent.isServerRendered||this.parent.printModule.isPrintGrid();Y(this.locator,r[s],h)}else r[s].format||"number"!==r[s].type||r[s].setParser(o.getParserFunction({format:"n2"}))}},r.prototype.dataManagerSuccess=function(i,r){var n=this,o=this.parent;this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),i.actionArgs=r;var s=this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&("delete"===r.requestType||"save"===r.requestType&&"add"===this.parent.infiniteScrollModule.requestType);o.trigger("beforeDataBound",i,function(e){if(!e.cancel){e.result=t.isNullOrUndefined(e.result)?[]:e.result;var l=Object.keys(e.result).length;if(!n.parent.isDestroyed){if(!(o.getColumns().length||l||o.columns.length&&o.columns[0]instanceof ft))return void o.hideSpinner();if(n.isInfiniteEnd(r)&&!l)return void n.parent.notify("infinite-edit-handler",{e:r,result:i.result,count:i.count,agg:i.aggregates});if(n.parent.isEdit=!1,n.parent.notify("edit-reset",{}),n.parent.notify("tooltip-destroy",{}),n.contentRenderer.prevCurrentView=n.parent.currentViewData.slice(),o.currentViewData=e.result,o.notify("refresh-infinite-current-view-data",{args:r,data:e.result}),t.isBlazor()&&"FilterBar"===o.filterSettings.type&&(t.isNullOrUndefined(o.currentViewData)||!t.isNullOrUndefined(o.currentViewData)&&!o.currentViewData.length))for(var a=o.getColumns(),h=0;h<a.length;h++)if(a[h].filterTemplate){var d=o.element.id+a[h].uid+"filterTemplate";t.resetBlazorTemplate(d,"FilterTemplate");for(var p=a[h].field,c=o.filterSettings.columns,u=0;u<c.length;u++)p===c[u].field&&(t.blazorTemplates[d][0][p]=c[u].value);t.updateBlazorTemplate(d,"FilterTemplate",a[h],!1)}if(!l&&e.count&&o.allowPaging&&r&&"delete"!==r.requestType)return!n.parent.groupSettings.enableLazyLoading||"grouping"!==r.requestType&&"ungrouping"!==r.requestType||n.parent.notify("grouping-complete",r),o.prevPageMoving=!0,o.pageSettings.totalRecordsCount=e.count,"paging"!==r.requestType&&(o.pageSettings.currentPage=Math.ceil(e.count/o.pageSettings.pageSize)),void o.dataBind();if((o.getColumns().length||!l)&&n.isLayoutRendered||pe(o)||n.updatesOnInitialRender(e),!n.isColTypeDef&&o.getCurrentViewRecords()&&(n.data.dataManager.dataSource.offline&&o.dataSource&&o.dataSource.length?n.updateColumnType(o.dataSource[0]):n.updateColumnType(o.getCurrentViewRecords()[0])),n.parent.isInitialLoad||!n.parent.groupSettings.disablePageWiseAggregates||n.parent.groupSettings.columns.length||(e.result=n.parent.dataSource instanceof Array?n.parent.dataSource:n.parent.currentViewData),n.parent.notify(Et,t.extend({count:e.count,result:e.result,aggregates:e.aggregates},r)),(o.groupSettings.columns.length||r&&"ungrouping"===r.requestType)&&r&&"filtering"!==r.requestType&&n.headerRenderer.refreshUI(),l){if(pe(o)){r.scrollTop={top:n.contentRenderer.content.scrollTop}}s?n.parent.notify("infinite-edit-handler",{e:r,result:i.result,count:i.count,agg:i.aggregates}):n.parent.enableImmutableMode?n.contentRenderer.immutableModeRendering(r):n.contentRenderer.refreshContentRows(r)}else{if(!o.getColumns().length)return o.element.innerHTML="",void alert(n.l10n.getConstant("EmptyDataSourceError"));if(n.contentRenderer.setRowElements([]),n.contentRenderer.setRowObjects([]),n.ariaService.setBusy(n.parent.getContent().querySelector(".e-content"),!1),n.renderEmptyRow(),r){var g=(r.requestType||"").toLowerCase()+"-complete";n.parent.notify(g,r),"batchsave"===r.requestType&&(r.cancel=!1,r.rows=[],r.isFrozen=0!==n.parent.getFrozenColumns()&&!r.isFrozen,n.parent.trigger(vt,r))}n.parent.hideSpinner()}n.parent.notify(Xt,{}),n.setRowCount(n.parent.getCurrentViewRecords().length),n.parent.getDataModule().isQueryInvokedFromData=!1}}})},r.prototype.dataManagerFailure=function(e,t){this.ariaService.setOptions(this.parent.getContent().querySelector(".e-content"),{busy:!1,invalid:!0}),this.setRowCount(1),this.parent.trigger("actionFailure",{error:e}),this.parent.hideSpinner(),"save"!==t.requestType&&"delete"!==t.requestType&&"bulk-save"!==t.name&&(this.parent.currentViewData=[],this.renderEmptyRow(),this.parent.log("actionfailure",{error:e}))},r.prototype.setRowCount=function(e){this.parent;this.ariaService.setOptions(this.parent.getHeaderTable(),{rowcount:e?e.toString():"1"})},r.prototype.isInfiniteEnd=function(e){return this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&"delete"===e.requestType},r.prototype.updatesOnInitialRender=function(e){this.isLayoutRendered=!0,this.parent.columns.length<1&&this.buildColumns(e.result[0]),T(this.parent.columns,null,this.parent),this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.parent.isAutoGen=!0,this.parent.notify(Yt,{})},r.prototype.iterateComplexColumns=function(e,t,i){for(var r=Object.keys(e),n=0;n<r.length;n++)("object"!=typeof e[r[n]]||!e[r[n]]||e[r[n]]instanceof Date?[]:Object.keys(e[r[n]])).length?this.iterateComplexColumns(e[r[n]],t+(r[n]+"."),i):(i[this.counter]=t+r[n],this.counter++)},r.prototype.buildColumns=function(e){var i=[],r={};this.iterateComplexColumns(e,"",r);for(var n=Object.keys(r).filter(function(e){return"BlazId"!==r[e]}).map(function(e){return r[e]}),o=0,s=n.length;o<s;o++)i[o]={field:n[o]},this.parent.enableColumnVirtualization&&(i[o].width=t.isNullOrUndefined(i[o].width)?200:i[o].width);this.parent.setProperties({columns:i},!0)},r.prototype.instantiateRenderer=function(){this.renderer.addRenderer(e.RenderType.Header,new Ii(this.parent,this.locator)),this.renderer.addRenderer(e.RenderType.Content,new zi(this.parent,this.locator));var t=this.locator.getService("cellRendererFactory");t.addCellRenderer(e.CellType.Header,new Oi(this.parent,this.locator)),t.addCellRenderer(e.CellType.Data,new Ti(this.parent,this.locator)),t.addCellRenderer(e.CellType.StackedHeader,new Bi(this.parent,this.locator)),t.addCellRenderer(e.CellType.Indent,new Li(this.parent,this.locator)),t.addCellRenderer(e.CellType.GroupCaption,new Ni(this.parent,this.locator)),t.addCellRenderer(e.CellType.GroupCaptionEmpty,new qi(this.parent,this.locator)),t.addCellRenderer(e.CellType.Expand,new Ui(this.parent,this.locator)),t.addCellRenderer(e.CellType.HeaderIndent,new Vi(this.parent,this.locator)),t.addCellRenderer(e.CellType.StackedHeader,new Bi(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailHeader,new _i(this.parent,this.locator)),t.addCellRenderer(e.CellType.RowDragHIcon,new Yi(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailExpand,new Ki(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailFooterIntent,new Li(this.parent,this.locator)),t.addCellRenderer(e.CellType.RowDragIcon,new Ji(this.parent,this.locator))},r.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(this.parent.on(It,this.instantiateRenderer,this),this.parent.on("refreshdataSource",this.dataManagerSuccess,this),this.parent.on(Bt,this.refresh,this),this.parent.on("refresh-complete",this.refreshComplete,this),this.parent.on("bulk-save",this.sendBulkRequest,this),this.parent.on("showEmptyGrid",function(){e.emptyGrid=!0},this),this.parent.on(Yt,this.dynamicColumnChange,this))},r.prototype.validateGroupRecords=function(e){var r=this,n=e.result.length-1;if(n<0)return Promise.resolve(e);var o=e.result[0],s=e.result[n],l=[],a=function(e){for(var t=[o,s],n=0;n<t.length;n++)l.push(new i.Predicate("field","==",t[n].field).and(r.getPredicate("key","equal",t[n].key)));e.where(i.Predicate.or(l))},h=new i.Query;a(h);var d=new i.DataManager(e.result).executeLocal(h),p=this.data.generateQuery(!0),c=[];if(this.data.isRemote()||t.isBlazor()){for(var u=[o,s],g=0;g<u.length;g++)c.push(this.getPredicate(u[g].field,"equal",u[g].key));p.where(i.Predicate.or(c))}else a(p);var f=new i.Deferred;return this.data.getData({},p).then(function(t){r.updateGroupInfo(d,t.result),f.resolve(e)}).catch(function(e){return f.reject(e)}),f.promise},r.prototype.getPredicate=function(e,t,r){return r instanceof Date?he({field:e,operator:t,value:r}):new i.Predicate(e,t,r)},r.prototype.updateGroupInfo=function(e,t){for(var r=new i.DataManager(t),n=e,o=0;o<n.length;o++){var s=r.executeLocal((new i.Query).where(new i.Predicate("field","==",n[o].field).and(this.getPredicate("key","equal",n[o].key))))[0];n[o].count=s.count;var l=n[o].items,a=s.items;l.GroupGuid&&(n[o].items=this.updateGroupInfo(n[o].items,s.items));for(var h=this.parent.aggregates,d=0;d<h.length;d++)for(var p=h[d],c=0;c<p.columns.length;c++)for(var u=p.columns[c].type instanceof Array?p.columns[c].type:[p.columns[c].type],g=0;g<u.length;g++){var f=p.columns[c].field+" - "+u[g].toLowerCase(),m=l.level?a.records:s.items,y=this.parent;if("Custom"===u[g]){var v=l.level?a:s;n[o].aggregates[f]=p.columns[c].customAggregate?p.columns[c].customAggregate.call(y,v,p.columns[c]):""}else n[o].aggregates[f]=i.DataUtil.aggregates[u[g].toLowerCase()](m,p.columns[c].field)}}return e},r}(),Zi=function(){function i(){this.cellRenderMap={}}return i.prototype.addCellRenderer=function(i,r){i="string"==typeof i?i:t.getEnumValue(e.CellType,i),t.isNullOrUndefined(this.cellRenderMap[i])&&(this.cellRenderMap[i]=r)},i.prototype.getCellRenderer=function(i){if(i="string"==typeof i?i:t.getEnumValue(e.CellType,i),t.isNullOrUndefined(this.cellRenderMap[i]))throw"The cellRenderer "+i+" is not found";return this.cellRenderMap[i]},i}(),er=function(){function i(e,t){this.sortedCols=[],this.sortPredicate=[],this.parent=e,this.serviceLocator=t,this.addEventListener()}return i.prototype.addEventListener=function(){this.parent.on("filter-dialog-close",this.closeCustomDialog,this),this.parent.on("set-custom-filter-header",this.setCustomFilterHeader,this),this.parent.on("refresh-cutsom-filter-ok-button",this.refreshCustomFilterOkBtn,this),this.parent.on("render-responsive-cmenu",this.renderResponsiveContextMenu,this),this.parent.on("filter-cmenu-select",this.renderCustomFilterDiv,this),this.parent.on("custom-filter-close",this.customExFilterClose,this),this.parent.on("refresh-cutsom-filter-clear-button",this.refreshCustomFilterClearBtn,this),this.onActionCompleteFn=this.editComplate.bind(this),this.parent.addEventListener(vt,this.onActionCompleteFn)},i.prototype.customExFilterClose=function(){this.isCustomDlgRender=!1},i.prototype.renderCustomFilterDiv=function(){var e=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),t=e.querySelector(".e-dlg-custom-header"),i=e.querySelector(".e-dlg-closeicon-btn");this.isCustomDlgRender=!0,this.parent.filterModule.filterModule.closeDialog(),this.saveBtn.element.style.display="",this.refreshCustomFilterOkBtn({disabled:!1}),this.backBtn.element.style.display="none",i.style.display="",t.innerHTML=this.parent.localeObj.getConstant("CustomFilter");var r=this.customResponsiveDlg.element.querySelector(".e-dlg-content");this.customExcelFilterParent=this.parent.createElement("div",{className:"e-xl-customfilterdiv e-default-filter"}),r.appendChild(this.customExcelFilterParent)},i.prototype.renderResponsiveContextMenu=function(i){if(this.action===e.ResponsiveDialogAction.isFilter){var r=this.customResponsiveDlg.element.querySelector(".e-dlg-content"),o=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),s=o.querySelector(".e-dlg-closeicon-btn"),l=o.querySelector(".e-dlg-custom-header");if(i.isOpen){r.firstChild.style.display="none",r.appendChild(i.target),s.style.display="none",this.saveBtn.element.style.display="none",this.filterClearBtn.element.style.display="none",l.innerHTML=i.header;var a=this.parent.createElement("button"),h=this.parent.createElement("span",{className:"e-btn-icon e-resfilterback e-icons"});a.appendChild(h),this.backBtn=new n.Button({cssClass:"e-res-back-btn"}),this.backBtn.appendTo(a),l.parentElement.insertBefore(a,l)}else this.backBtn&&!this.isCustomDlgRender&&(r.firstChild.style.display="",t.remove(this.backBtn.element),s.style.display="",this.saveBtn.element.style.display="",this.isFiltered&&(this.filterClearBtn.element.style.display=""),l.innerHTML=this.getHeaderTitle({action:e.ResponsiveDialogAction.isFilter}))}},i.prototype.refreshCustomFilterClearBtn=function(e){this.filterClearBtn&&(this.isFiltered=e.isFiltered,this.filterClearBtn.element.style.display=e.isFiltered?"":"none")},i.prototype.refreshCustomFilterOkBtn=function(e){this.saveBtn&&(this.saveBtn.disabled=e.disabled)},i.prototype.renderResponsiveContent=function(i){var r=this,o=this.parent;if(i)return this.filterParent=this.parent.createElement("div",{className:"e-mainfilterdiv e-default-filter",id:i.uid+"-main-filter"}),this.filterParent;var s=o.getColumns();this.customColumnDiv=o.createElement("div",{className:"columndiv",styles:"width: 100%"});var l=o.createElement("div",{className:"e-ressortbutton-parent"}),a=[];if(this.action===e.ResponsiveDialogAction.isFilter)for(h=0;h<o.filterSettings.columns.length;h++)a.push(o.filterSettings.columns[h].field);for(var h=0;h<s.length;h++){var d=o.createElement("div",{className:"e-responsivecoldiv"});d.setAttribute("data-e-mappingname",s[h].field),d.setAttribute("data-e-mappinguid",s[h].uid);var p=o.createElement("span",{innerHTML:s[h].headerText,className:"e-res-header-text"});if(d.appendChild(p),this.customColumnDiv.appendChild(d),this.action===e.ResponsiveDialogAction.isSort){var c=this.getSortedFieldsAndDirections("field").indexOf(s[h].field),u=o.createElement("button",{id:o.element.id+s[h].field+"sortbutton"}),g=l.cloneNode();g.appendChild(u),d.appendChild(g),new n.Button({cssClass:"e-ressortbutton"}).appendTo(u),u.innerHTML=c>-1?this.parent.sortSettings.columns[c].direction:"None",u.onclick=function(e){r.sortButtonClickHandler(e.target)}}if(this.action===e.ResponsiveDialogAction.isFilter&&a.indexOf(s[h].field)>-1){var f=o.createElement("div",{className:"e-icons e-res-icon e-filtersetdiv"}),m=o.createElement("span",{className:"e-icons e-res-icon e-filterset"});m.setAttribute("colType",s[h].type),f.appendChild(m),d.appendChild(f)}}return t.EventHandler.add(this.customColumnDiv,"click",this.customFilterColumnClickHandler,this),this.customColumnDiv},i.prototype.getSortedFieldsAndDirections=function(e){for(var t=[],i=0;i<this.parent.sortSettings.columns.length;i++)t.push(this.parent.sortSettings.columns[i][e]);return t},i.prototype.sortButtonClickHandler=function(e){if(e){var t=O(e,"e-responsivecoldiv").getAttribute("data-e-mappingname");this.parent.allowMultiSorting||(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1,this.resetSortButtons(e));var i=e.textContent,r="None"===i?"Ascending":"Ascending"===i?"Descending":"None";e.innerHTML=r,this.setSortedCols(t,r)}},i.prototype.resetSortButtons=function(e){for(var t=[].slice.call(this.customColumnDiv.querySelectorAll(".e-ressortbutton")),i=0;i<t.length;i++)t[i]!==e&&(t[i].innerHTML="None")},i.prototype.setSortedCols=function(e,t){var i=this.getCurrentSortedFields().indexOf(e);this.parent.allowMultiSorting&&i>-1&&(this.sortedCols.splice(i,1),this.sortPredicate.splice(i,1)),this.isSortApplied=!0,"None"!==t&&(this.sortedCols.push(e),this.sortPredicate.push({field:e,direction:t}))},i.prototype.getCurrentSortedFields=function(){for(var e=[],t=0;t<this.sortedCols.length;t++)e.push(this.sortedCols[t]);return e},i.prototype.customFilterColumnClickHandler=function(t){if(this.action===e.ResponsiveDialogAction.isFilter){var i=this.parent,r=t.target;if("FilterBar"!==i.filterSettings.type)if(r.classList.contains("e-responsivecoldiv")||r.parentElement.classList.contains("e-responsivecoldiv")){if((s=r.getAttribute("data-e-mappingname"))||(s=r.parentElement.getAttribute("data-e-mappingname")),s){var n=i.getColumnByField(s);this.isRowResponsive=!0,this.showResponsiveDialog(n)}}else if(r.classList.contains("e-filterset")||r.parentElement.classList.contains("e-filtersetdiv")){var o=O(r,"e-responsivecoldiv");if(o){var s=o.getAttribute("data-e-mappingname");("Menu"===(n=i.getColumnByField(s)).filter.type||!n.filter.type&&"Menu"===i.filterSettings.type)&&(this.isDialogClose=!0),this.parent.filterModule.filterModule.clearCustomFilter(n),this.removeCustomDlgFilterEle(r)}}}},i.prototype.showResponsiveDialog=function(t){"Vertical"!==this.parent.rowRenderingMode||this.action!==e.ResponsiveDialogAction.isFilter||this.isRowResponsive?(this.filteredCol=t,this.renderResponsiveDialog(t),this.parent.enableAdaptiveUI&&t&&(this.parent.filterModule.setFilterModel(t),this.parent.filterModule.filterModule.openDialog(this.parent.filterModule.createOptions(t,void 0))),this.customResponsiveDlg.show(!0),this.customResponsiveDlg.element.style.maxHeight="100%",this.setTopToChildDialog(this.customResponsiveDlg.element)):(this.renderCustomFilterDialog(),this.customFilterDlg.show(!0),this.customFilterDlg.element.style.maxHeight="100%")},i.prototype.setTopToChildDialog=function(e){var t=e.querySelector(".e-dialog");if(t){var i=e.querySelector(".e-dlg-header-content").getBoundingClientRect().height;t.style.top=i+"px"}},i.prototype.renderCustomFilterDialog=function(t){var i=this.parent;if(this.action!==e.ResponsiveDialogAction.isFilter||"FilterBar"!==i.filterSettings.type){var r=this.parent.createElement("div",{id:i.element.id+"customfilter",className:"e-customfilterdiv e-responsive-dialog"});this.parent.element.appendChild(r),this.customFilterDlg=this.getDialogOptions(t,!0),this.customFilterDlg.appendTo(r)}},i.prototype.getDialogOptions=function(t,i,n){var o=new r.Dialog({isModal:!0,showCloseIcon:!0,closeOnEscape:!1,locale:this.parent.locale,target:this.parent.adaptiveDlgTarget?this.parent.adaptiveDlgTarget:document.body,visible:!1,enableRtl:this.parent.enableRtl,content:this.renderResponsiveContent(t),open:this.dialogOpen.bind(this),created:this.dialogCreated.bind(this),close:this.beforeDialogClose.bind(this),width:"100%",height:"100%",animationSettings:{effect:"None"}});return o.isStringTemplate=!0,i?(o.header=this.renderResponsiveHeader(void 0,!0),o.cssClass="e-customfilter"):(o.header=this.renderResponsiveHeader(),o.cssClass="Vertical"===this.parent.rowRenderingMode&&this.action===e.ResponsiveDialogAction.isFilter?"e-res"+n+" e-row-responsive-filter":"e-res"+n),o},i.prototype.renderResponsiveDialog=function(t){var i=this.parent;if(this.action!==e.ResponsiveDialogAction.isFilter||"FilterBar"!==i.filterSettings.type){var r=this.action===e.ResponsiveDialogAction.isFilter?"filter":"sort",n=this.parent.createElement("div",{id:i.element.id+"responsive"+r,className:"e-res"+r+"div e-responsive-dialog"});this.parent.element.appendChild(n),this.customResponsiveDlg=this.getDialogOptions(t,!1,r),this.customResponsiveDlg.appendTo(n)}},i.prototype.dialogCreated=function(){Ke(this.parent)},i.prototype.dialogOpen=function(){if(this.action===e.ResponsiveDialogAction.isSort&&this.parent.allowMultiSorting)for(var t=0;t<this.parent.sortSettings.columns.length;t++){this.sortedCols.push(this.parent.sortSettings.columns[t].field);var i=this.parent.sortSettings.columns[t].field,r=this.parent.sortSettings.columns[t].direction;this.sortPredicate.push({field:i,direction:r})}},i.prototype.beforeDialogClose=function(t){this.isDialogClose=t.element&&!t.element.querySelector(".e-xl-customfilterdiv")&&t.element.classList.contains("e-resfilterdiv"),this.action===e.ResponsiveDialogAction.isFilter?t.element.classList.contains("e-resfilterdiv")?this.parent.filterModule.filterModule.closeResponsiveDialog(this.isCustomDlgRender):t.element.classList.contains("e-customfilterdiv")&&this.closeCustomFilter():this.action===e.ResponsiveDialogAction.isSort&&this.closeCustomDialog(),this.parent.off("enter-key-handler",this.keyHandler)},i.prototype.sortColumn=function(){if(!this.isSortApplied)return void this.closeCustomDialog();this.sortPredicate.length&&this.parent.setProperties({sortSettings:{columns:[]}},!0);for(var e=0;e<this.sortPredicate.length;e++)this.parent.sortColumn(this.sortPredicate[e].field,this.sortPredicate[e].direction,this.parent.allowMultiSorting);this.sortPredicate.length||this.parent.clearSorting(),this.closeCustomDialog()},i.prototype.getHeaderTitle=function(t){var i,r=this.parent;return this.action===e.ResponsiveDialogAction.isEdit?i=r.localeObj.getConstant("EditFormTitle")+t.primaryKeyValue[0]:this.action===e.ResponsiveDialogAction.isAdd?i=r.localeObj.getConstant("AddFormTitle"):this.action===e.ResponsiveDialogAction.isFilter?i=r.localeObj.getConstant("FilterButton"):this.action===e.ResponsiveDialogAction.isSort&&(i=r.localeObj.getConstant("Sort")),i},i.prototype.getDialogName=function(t){var i;return t===e.ResponsiveDialogAction.isAdd||t===e.ResponsiveDialogAction.isEdit?i="dialogEdit_wrapper_title":t===e.ResponsiveDialogAction.isFilter&&(i="responsive_filter_dialog_wrapper"),i},i.prototype.getButtonText=function(t){var i;return t===e.ResponsiveDialogAction.isAdd||t===e.ResponsiveDialogAction.isEdit?i="Save":t!==e.ResponsiveDialogAction.isFilter&&this.action!==e.ResponsiveDialogAction.isSort||(i="OKButton"),i},i.prototype.renderResponsiveHeader=function(t,i){var r=this,o=this.parent;o.on("enter-key-handler",this.keyHandler,this);var s=o.element.id+this.getDialogName(this.action),l=o.createElement("div",{className:"e-res-custom-element"}),a=o.createElement("div",{className:"e-dlg-custom-header",id:s});a.innerHTML=this.getHeaderTitle(t),l.appendChild(a);var h=o.createElement("button");i||(this.saveBtn=new n.Button({cssClass:"e-primary e-flat e-res-apply-btn"}),h.innerHTML=o.localeObj.getConstant(this.getButtonText(this.action)),this.saveBtn.appendTo(h),h.onclick=function(e){r.dialogHdrBtnClickHandler()});var d=this.action===e.ResponsiveDialogAction.isSort,p=this.action===e.ResponsiveDialogAction.isFilter;if(p||d){var c=d?"sort":"filter",u=o.createElement("button");if(this.filterClearBtn=new n.Button({cssClass:"e-primary e-flat e-res-"+c+"-clear-btn"}),p){var g=o.createElement("span",{className:"e-btn-icon e-icon-filter-clear e-icons"});u.appendChild(g)}else u.innerHTML=o.localeObj.getConstant("Clear");l.appendChild(u),this.filterClearBtn.appendTo(u),u.onclick=function(e){O(e.target,"e-customfilter")?(r.parent.filterModule.clearFiltering(),r.removeCustomDlgFilterEle()):p?r.filterClear():(r.resetSortButtons(),r.sortedCols=[],r.sortPredicate=[],r.isSortApplied=!0)},l.appendChild(u)}return i||l.appendChild(h),l},i.prototype.filterClear=function(){this.parent.filterModule.filterModule.clearCustomFilter(this.filteredCol),this.parent.filterModule.filterModule.closeResponsiveDialog()},i.prototype.dialogHdrBtnClickHandler=function(){this.action===e.ResponsiveDialogAction.isEdit||this.action===e.ResponsiveDialogAction.isAdd?this.parent.endEdit():this.action===e.ResponsiveDialogAction.isFilter?this.parent.filterModule.filterModule.applyCustomFilter({col:this.filteredCol,isCustomFilter:this.isCustomDlgRender}):this.action===e.ResponsiveDialogAction.isSort&&this.sortColumn()},i.prototype.closeCustomDialog=function(){if(this.isCustomDlgRender){var e=this.customResponsiveDlg.element.querySelector(".e-mainfilterdiv");return void t.remove(e)}this.isRowResponsive=!1,this.isCustomDlgRender=!1,this.destroyCustomFilterDialog()},i.prototype.destroyCustomFilterDialog=function(){if(this.customResponsiveDlg){var i=document.getElementById(this.customResponsiveDlg.element.id);this.customResponsiveDlg&&!this.customResponsiveDlg.isDestroyed&&i&&(this.customResponsiveDlg.destroy(),t.remove(i)),this.closeCustomFilter(),this.action===e.ResponsiveDialogAction.isSort&&(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1)}},i.prototype.closeCustomFilter=function(){if(!this.isDialogClose&&this.customFilterDlg){var e=document.getElementById(this.customFilterDlg.element.id);this.customFilterDlg&&!this.customFilterDlg.isDestroyed&&e&&(this.customFilterDlg.destroy(),t.remove(e))}this.isDialogClose=!1},i.prototype.removeCustomDlgFilterEle=function(e){if(e)e.parentElement.classList.contains("e-filtersetdiv")?t.remove(e.parentElement):t.remove(e);else for(var i=this.customColumnDiv.children,r=0;r<i.length;r++)(e=i[r].querySelector(".e-filtersetdiv"))&&(t.remove(e),r--)},i.prototype.setCustomFilterHeader=function(e){if("Vertical"===this.parent.rowRenderingMode){var t=this.customResponsiveDlg.element.querySelector(".e-reslabel");t&&t.firstElementChild&&(t.firstElementChild.innerHTML=e.title)}},i.prototype.keyHandler=function(t){13===t.keyCode&&(this.action===e.ResponsiveDialogAction.isFilter&&t.target.classList.contains("e-searchinput")||this.action===e.ResponsiveDialogAction.isEdit||this.action===e.ResponsiveDialogAction.isAdd)&&this.dialogHdrBtnClickHandler()},i.prototype.editComplate=function(e){"save"!==e.requestType&&"cancel"!==e.requestType||this.parent.off("enter-key-handler",this.keyHandler)},i.prototype.removeEventListener=function(){this.customColumnDiv&&t.EventHandler.remove(this.customColumnDiv,"click",this.customFilterColumnClickHandler),this.parent.off("filter-dialog-close",this.closeCustomDialog),this.parent.off("set-custom-filter-header",this.setCustomFilterHeader),this.parent.off("refresh-cutsom-filter-ok-button",this.refreshCustomFilterOkBtn),this.parent.off("render-responsive-cmenu",this.renderResponsiveContextMenu),this.parent.off("filter-cmenu-select",this.renderCustomFilterDiv),this.parent.off("custom-filter-close",this.customExFilterClose),this.parent.off("refresh-cutsom-filter-clear-button",this.refreshCustomFilterClearBtn),this.parent.removeEventListener(vt,this.onActionCompleteFn)},i}(),tr=function(){function e(){this.services={}}return e.prototype.register=function(e,i){t.isNullOrUndefined(this.services[e])&&(this.services[e]=i)},e.prototype.getService=function(e){if(t.isNullOrUndefined(this.services[e]))throw"The service "+e+" is not registered";return this.services[e]},e.prototype.registerAdaptiveService=function(e,t,i){t?(e.responsiveDialogRenderer=new er(e.parent,e.serviceLocator),e.responsiveDialogRenderer.action=i):e.responsiveDialogRenderer&&(e.responsiveDialogRenderer.removeEventListener(),e.responsiveDialogRenderer=void 0)},e}(),ir=function(){function i(){this.rendererMap={}}return i.prototype.addRenderer=function(i,r){var n=t.getEnumValue(e.RenderType,i);t.isNullOrUndefined(this.rendererMap[n])&&(this.rendererMap[n]=r)},i.prototype.getRenderer=function(i){var r=t.getEnumValue(e.RenderType,i);if(t.isNullOrUndefined(this.rendererMap[r]))throw"The renderer "+r+" is not found";return this.rendererMap[r]},i}(),rr=function(){function e(e){this.parent=e}return e.prototype.setWidthToColumns=function(){var e=0,t=this.parent.getColumnIndexesInView(),i=!0,r=0;if(this.parent.allowGrouping)for(var n=this.parent.groupSettings.columns.length;e<n;e++)this.parent.enableColumnVirtualization&&-1===t.indexOf(e)?i=!1:this.setColumnWidth(new ft({width:"30px"}),e);(this.parent.detailTemplate||this.parent.childGrid)&&(this.setColumnWidth(new ft({width:"30px"}),e),e++),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(this.setColumnWidth(new ft({width:"30px"}),e),e++);for(var o=this.parent.getColumns(),s=0;s<o.length;s++)this.setColumnWidth(o[s],i&&this.parent.enableColumnVirtualization?void 0:s+e);this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&this.setColumnWidth(new ft({width:"30px"}),o.length),r=this.getTableWidth(this.parent.getColumns()),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(r)},e.prototype.setMinwidthBycalculation=function(e){var i=0,r=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)||"auto"===e.width});if(r.length){i=t.isNullOrUndefined(this.parent.width)||"auto"===this.parent.width||"string"!=typeof this.parent.width||-1!==this.parent.width.indexOf("%")?this.parent.element.getBoundingClientRect().width-e:("string"==typeof this.parent.width?parseInt(this.parent.width,10):this.parent.width)-e;for(var n=0,o=0,s=r;o<s.length;o++){var l=s[o];n+=t.isNullOrUndefined(l.minWidth)?0:"string"==typeof l.minWidth?parseInt(l.minWidth,10):l.minWidth}for(var a=0;a<r.length;a++)0===e&&this.parent.allowResizing&&this.isWidthUndefined()&&a!==r.length-1&&this.setUndefinedColumnWidth(r),0!==e&&i<n?this.setWidth(r[a].minWidth,this.parent.getColumnIndexByField(r[a].field)):0!==e&&i>n&&this.setWidth("",this.parent.getColumnIndexByField(r[a].field)+this.parent.getIndentCount(),!0)}},e.prototype.setUndefinedColumnWidth=function(e){for(var t=0;t<e.length;t++)t!==e.length-1&&(e[t].width=200,this.setWidth(200,this.parent.getColumnIndexByField(e[t].field)))},e.prototype.setColumnWidth=function(e,i,r){if(!(this.parent.getColumns().length<1)){var n=t.isNullOrUndefined(i)?this.parent.getNormalizedColumnIndex(e.uid):i,o=this.getWidth(e),s=this.getTableWidth(this.parent.getColumns());null!==o&&(this.setWidth(o,n),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(s),(this.parent.allowResizing&&"resize"===r||this.parent.getFrozenColumns()&&this.parent.allowResizing)&&this.setWidthToTable(),this.parent.notify("column-width-changed",{index:n,width:o,column:e,module:r}))}},e.prototype.setWidth=function(e,i,r){this.parent.groupSettings.columns.length>i&&Me(this.parent)&&(e=(30/this.parent.element.offsetWidth*100).toFixed(1)+"%");var n,o=this.parent.getHeaderTable(),s=this.parent.getContentTable(),l=t.formatUnit(e),a=this.parent.getFrozenColumns(),h=this.parent.isRowDragable();a=a&&h?a+1:a;var d=this.parent.getHeaderContent().querySelector(".e-movableheader"),p=this.parent.getContent().querySelector(".e-movablecontent"),c=this.parent.getFrozenLeftColumnsCount(),u=this.parent.getFrozenRightColumnsCount(),g=this.parent.getMovableColumnsCount(),f=0!==c||0!==u;if(a&&i>=a&&d&&d.querySelector("colgroup"))n=d.querySelector("colgroup").children[i-a];else if(this.parent.enableColumnVirtualization&&a&&this.parent.contentModule.isXaxis()&&d.scrollLeft>0)n=(v=d.querySelector("colgroup")).children[v.children.length-1-i];else if(f){C=void 0;if(c&&!u)C=(i=h?i-1:i)<c?o:d;else if(!c&&u)C=i>=g?o:d;else if(c&&u){i=h?i-1:i;var m=this.parent.getFrozenRightHeader();C=i<c?o:i<c+g?d:m}if(!(n=this.getColumnLevelFrozenColgroup(i,c,g,C)))return}else n=o.querySelector("colgroup").children[i];n&&!r?n.style.width=l:n&&r&&(n.style.width="");var y;if(a&&i>=a)y=this.parent.getContent().querySelector(".e-movablecontent").querySelector("colgroup").children[i-a];else if(this.parent.enableColumnVirtualization&&a&&this.parent.contentModule.isXaxis()&&p.scrollLeft>0){var v=this.parent.getContent().querySelector(".e-movablecontent").querySelector("colgroup");y=v.children[v.children.length-1-i]}else if(f){var C=void 0;if(c&&!u&&(C=i<c?s:p),!c&&u&&(C=i>=g?s:p),c&&u){var w=this.parent.getContent().querySelector(".e-frozen-right-content");C=i<c?s:i<c+g?p:w}y=this.getColumnLevelFrozenColgroup(i,c,g,C)}else y=s.querySelector("colgroup").children[i];y&&!r?y.style.width=l:y&&r&&(y.style.width="");for(var b=this.parent.element.querySelectorAll(".e-table.e-inline-edit"),S=[],x=0;x<b.length;x++)if(O(b[x],"e-grid").id===this.parent.element.id)for(var R=0;R<b[x].querySelector("colgroup").children.length;R++)S.push(b[x].querySelector("colgroup").children[R]);b.length&&S.length&&(S[i].style.width=l),this.parent.isFrozenGrid()&&this.refreshFrozenScrollbar()},e.prototype.getColumnLevelFrozenColgroup=function(e,t,i,r){if(!r||!r.querySelector("colgroup"))return null;var n=this.parent.getColumns(),o=this.parent.isRowDragable(),s=this.parent.getFrozenMode(),l=[].slice.call(r.querySelector("colgroup").children);return"Right"===s&&o&&e===i+this.parent.getFrozenRightColumnsCount()?l[l.length-1]:o&&-1===e?l[0]:"Left"===n[e].freeze?l[o?e+1:e]:"Right"===n[e].freeze?l[e-(t+i)]:l[e-t]},e.prototype.refreshFrozenScrollbar=function(){var e={cancel:!1};if(this.parent.notify("prevent-frozen-scroll-refresh",e),!e.cancel){var t=j(),i=this.parent.element.querySelector(".e-frozenscrollbar"),r=this.parent.element.querySelector(".e-movablescrollbar"),n=this.parent.getContent().querySelector(".e-frozencontent"),o=this.parent.getContent().querySelector(".e-movablecontent"),s=n.firstElementChild.getBoundingClientRect().width,l=o.firstElementChild.getBoundingClientRect().width;if("Right"===this.parent.getFrozenMode()&&(s+=t),i.style.width=s+"px","Left-Right"===this.parent.getFrozenMode()){var a=this.parent.element.querySelector(".e-frozen-right-scrollbar"),h=this.parent.getContent().querySelector(".e-frozen-right-content").firstElementChild.getBoundingClientRect().width;"auto"!==this.parent.height&&(h+=t),a.style.width=h+"px"}else{if(this.parent.enableColumnVirtualization){var d=this.parent.getMovableVirtualContent().querySelector(".e-virtualtrack");d&&(l=d.scrollWidth)}"Right"!==this.parent.getFrozenMode()&&"auto"!==this.parent.height&&(l+=t)}r.firstElementChild.style.width=l+"px"}},e.prototype.getSiblingsHeight=function(e){return this.getHeightFromDirection(e,"previous")+this.getHeightFromDirection(e,"next")},e.prototype.getHeightFromDirection=function(e,t){for(var i=e[t+"ElementSibling"],r=0,n=["e-gridheader","e-gridfooter","e-groupdroparea","e-gridpager","e-toolbar"];i;)n.some(function(e){return i.classList.contains(e)})&&(r+=i.offsetHeight),i=i[t+"ElementSibling"];return r},e.prototype.isWidthUndefined=function(){var e=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)&&t.isNullOrUndefined(e.minWidth)}).length;return this.parent.getColumns().length===e},e.prototype.getWidth=function(e){if(t.isNullOrUndefined(e.width)&&this.parent.allowResizing&&t.isNullOrUndefined(e.minWidth)&&!this.isWidthUndefined()&&(e.width=200),this.parent.isFrozenGrid()&&t.isNullOrUndefined(e.width)&&("frozen-left"===e.getFreezeTableName()||"frozen-right"===e.getFreezeTableName())&&(e.width=200),!e.width)return null;var i=parseInt(e.width.toString(),10);return e.minWidth&&i<parseInt(e.minWidth.toString(),10)?e.minWidth:e.maxWidth&&i>parseInt(e.maxWidth.toString(),10)?e.maxWidth:e.width},e.prototype.getTableWidth=function(e){for(var t=0,i=0,r=e;i<r.length;i++){var n=r[i],o=this.getWidth(n);"auto"===n.width&&(o=0),!1!==n.visible&&null!==o&&(t+=parseInt(o.toString(),10))}return t},e.prototype.calcMovableOrFreezeColWidth=function(e){var i=this.parent.getColumns().slice(),r=this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenColumns(),n=this.parent.getMovableColumnsCount(),o=this.parent.getFrozenRightColumnsCount();return"movable"===e?(o&&i.splice(r+n,i.length),r&&i.splice(0,r)):"freeze-left"===e?i.splice(r,i.length):"freeze-right"===e&&i.splice(0,r+n),t.formatUnit(this.getTableWidth(i))},e.prototype.setWidthToFrozenRightTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze-right");e=this.isAutoResize()?"100%":e;var t=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(".e-table"),i=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector(".e-table");t.style.width=e,i.style.width=e},e.prototype.setWidthToFrozenLeftTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze-left");e=this.isAutoResize()?"100%":e,this.parent.getHeaderTable().style.width=e,this.parent.getContentTable().style.width=e},e.prototype.setWidthToMovableTable=function(){var e="",i=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)}).length>=1,r=this.parent.getColumns().filter(function(e){return"auto"===e.width}).length>=1;"number"!=typeof this.parent.width||i||r?i||r||(e=this.calcMovableOrFreezeColWidth("movable")):e=t.formatUnit(this.parent.width-parseInt(this.calcMovableOrFreezeColWidth("freeze").split("px")[0],10)-5),e=this.isAutoResize()?"100%":e,this.parent.getHeaderContent().querySelector(".e-movableheader").firstElementChild&&(this.parent.getHeaderContent().querySelector(".e-movableheader").firstElementChild.style.width=e),this.parent.getContent().querySelector(".e-movablecontent").firstElementChild.style.width=e},e.prototype.setWidthToFrozenEditTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze");e=this.isAutoResize()?"100%":e,this.parent.element.querySelectorAll(".e-table.e-inline-edit")[0].style.width=e},e.prototype.setWidthToMovableEditTable=function(){var e=this.calcMovableOrFreezeColWidth("movable");e=this.isAutoResize()?"100%":e,this.parent.element.querySelectorAll(".e-table.e-inline-edit")[1].style.width=e},e.prototype.setWidthToTable=function(){var e=t.formatUnit(this.getTableWidth(this.parent.getColumns()));this.parent.isFrozenGrid()?((this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount())&&this.setWidthToFrozenLeftTable(),this.setWidthToMovableTable(),this.parent.getFrozenRightColumnsCount()&&this.setWidthToFrozenRightTable()):((this.parent.detailTemplate||this.parent.childGrid)&&this.setColumnWidth(new ft({width:"30px"})),e=this.isAutoResize()?"100%":e,this.parent.getHeaderTable().style.width=e,this.parent.getContentTable().style.width=e);var i=this.parent.element.querySelector(".e-table.e-inline-edit");i&&this.parent.getFrozenColumns()?(this.setWidthToFrozenEditTable(),this.setWidthToMovableEditTable()):i&&(i.style.width=e)},e.prototype.isAutoResize=function(){return this.parent.allowResizing&&"Auto"===this.parent.resizeSettings.mode},e}(),nr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),or=function(){function e(e){this.currentInfo={},this.oneTime=!0,this.swap={},this.forget=!1,this.skipFocus=!0,this.focusByClick=!1,this.prevIndexes={},this.refMatrix=this.refreshMatrix(!0),this.actions=["downArrow","upArrow"],this.isVirtualScroll=!1,this.parent=e,this.rowModelGen=new Ci(this.parent),this.addEventListener()}return e.prototype.focusCheck=function(e){var t=e.target;this.focusByClick=!0,this.skipFocus=t.classList.contains("e-grid")},e.prototype.onFocus=function(){if(!(this.parent.isDestroyed||t.Browser.isDevice||this.parent.enableVirtualization)){this.setActive(!this.parent.enableHeaderFocus&&0===this.parent.frozenRows,this.parent.isFrozenGrid());this.parent.enableHeaderFocus||this.parent.getCurrentViewRecords().length||"Batch"===this.parent.editSettings.mode&&("Batch"!==this.parent.editSettings.mode||this.parent.editModule.getBatchChanges().addedRecords.length)||this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new fi({isDataRow:!0})]}),this.getContent().selector,!1);var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.skipFocus&&(this.focus(),this.skipFocus=!1)}},e.prototype.passiveFocus=function(e){this.parent.isDestroyed||e.target&&e.target.classList.contains("e-detailcell")&&(this.currentInfo.skipAction=!1,t.addClass([this.currentInfo.element],["e-focused","e-focus"]))},e.prototype.onBlur=function(e){this.parent.isEdit||e&&(!e.relatedTarget||t.closest(e.relatedTarget,".e-grid"))||(this.removeFocus(),this.skipFocus=!1,this.currentInfo.skipAction=!1,this.getContent().getFocusInfo().elementToFocus&&(this.getContent().getFocusInfo().elementToFocus.tabIndex=0))},e.prototype.onClick=function(e,i){if(!O(e.target,"e-filterbarcell")||!e.target.classList.contains("e-input-group-icon")){var r=!t.isNullOrUndefined(t.closest(e.target,".e-gridcontent")),n=!t.isNullOrUndefined(t.closest(e.target,".e-gridheader"));r=r&&n?!r:r;var o=!t.isNullOrUndefined(t.closest(e.target,".e-frozencontent"))||!t.isNullOrUndefined(t.closest(e.target,".e-frozenheader")),s=!1;if("Left-Right"===this.parent.getFrozenMode()&&(s=!t.isNullOrUndefined(t.closest(e.target,".e-frozen-right-content"))||!t.isNullOrUndefined(t.closest(e.target,".e-frozen-right-header")),o=o&&!s),!(!r&&t.isNullOrUndefined(t.closest(e.target,".e-gridheader"))||e.target.classList.contains("e-content"))&&t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))){if(this.setActive(r,o,s),!r&&t.isNullOrUndefined(t.closest(e.target,".e-gridheader")))return void this.clearOutline();var l={cancel:!1,byKey:!1,byClick:!t.isNullOrUndefined(e.target),clickArgs:e};if(this.parent.notify(Nt,l),!l.cancel&&!t.closest(e.target,".e-inline-edit")&&(this.setActive(r,o,s),this.getContent())){if(!1===this.getContent().onClick(e,i))return;this.focus()}}}},e.prototype.onKeyPress=function(e){if(!this.skipOn(e)){this.activeKey=e.action;var t={cancel:!1,byKey:!0,byClick:!1,keyArgs:e};if(this.parent.notify(Nt,t),!t.cancel){var i=this.getContent().matrix.current;this.currentInfo.outline=!0;var r=this.getContent().jump(e.action,i);if(this.swap=r,r.swap&&(this.setActive(!r.toHeader,r.toFrozen,r.toFrozenRight),this.getContent().matrix.current=this.getContent().getNextCurrent(i,r,this.active,e.action),this.prevIndexes={}),this.setActiveByKey(e.action,this.getContent()),!1===(!this.content.lastIdxCell&&this.getContent().onKeyPress(e)))return void this.clearIndicator();e.preventDefault(),this.focus(e)}}},e.prototype.skipOn=function(e){var i=e.target;if(!i)return!1;if(this.currentInfo.skipAction)return this.clearIndicator(),!0;if(["pageUp","pageDown","altDownArrow"].indexOf(e.action)>-1)return this.clearIndicator(),!0;var r=t.closest(i,"th")&&!t.closest(i,"th").tabIndex;!e.target.classList.contains("e-filterbaroperator")||13!==e.keyCode&&27!==e.keyCode||t.closest(e.target,".e-filterbarcell").querySelector("input").focus(),r&&null!==t.closest(document.activeElement,".e-filterbarcell")&&this.removeFocus();var n=null!==t.closest(document.activeElement,".e-filterbarcell");if(this.parent.enableHeaderFocus&&n){var o=this.active.matrix,s=o.current;n=o.matrix[s[0]].lastIndexOf(1)!==s[1]}return"delete"===e.action||"Batch"!==this.parent.editSettings.mode&&(this.parent.isEdit||["insert","f2"].indexOf(e.action)>-1)||n||null!==t.closest(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)>-1||null===t.closest(i,".e-gridcontent")&&null===t.closest(i,".e-gridheader")||"space"===e.action&&!i.classList.contains("e-gridchkbox")&&null===t.closest(i,".e-gridchkbox")&&null===t.closest(i,".e-headerchkcelldiv")||null!==t.closest(i,".e-filter-popup")},e.prototype.focusVirtualElement=function(e){var t=this;if(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling){var i={virtualData:{},isAdd:!1,isCancel:!1};this.parent.notify(hi,i);var r=this.actions.some(function(e){return e===t.activeKey}),n=!!this.parent.contentModule&&this.parent.contentModule.selectedRowIndex>-1;i.isAdd||Object.keys(i.virtualData).length||r||i.isCancel||n?(i.isCancel=!1,this.parent.contentModule.selectedRowIndex=-1,r&&(this.activeKey=this.empty,this.parent.notify("virtaul-key-handler",e)),this.currentInfo.elementToFocus.focus({preventScroll:!0})):this.isVirtualScroll?this.currentInfo.elementToFocus.focus({preventScroll:!0}):this.currentInfo.elementToFocus.focus()}this.isVirtualScroll=!1},e.prototype.getFocusedElement=function(){return this.currentInfo.elementToFocus},e.prototype.getContent=function(){return this.active||this.content},e.prototype.setActive=function(e,t,i){this.active=e?t?this.fContent:i?this.frContent:this.content:t?this.fHeader:i?this.frHeader:this.header},e.prototype.setFocusedElement=function(e,i){var r=this;this.currentInfo.elementToFocus=e,setTimeout(function(){t.isNullOrUndefined(r.currentInfo.elementToFocus)||(r.parent.enableVirtualization||r.parent.enableInfiniteScrolling?r.focusVirtualElement(i):r.currentInfo.elementToFocus.focus())},0)},e.prototype.focus=function(e){this.parent.notify("virtaul-cell-focus",e),this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)},e.prototype.removeFocus=function(e){this.currentInfo.element&&(t.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focused","e-focus"]),this.currentInfo.element.tabIndex=-1)},e.prototype.addOutline=function(){var e=this.getContent().getFocusInfo();e.element&&(t.addClass([e.element],["e-focused"]),t.addClass([e.elementToFocus],["e-focus"]))},e.prototype.focusHeader=function(){this.setActive(!1,this.parent.isFrozenGrid()),this.resetFocus()},e.prototype.focusContent=function(){this.setActive(!0,this.parent.isFrozenGrid()),this.resetFocus()},e.prototype.resetFocus=function(){var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.focus()},e.prototype.addFocus=function(e,i){if(this.currentInfo=e,this.currentInfo.outline=e.outline&&!t.isNullOrUndefined(i),e.element){var r=e.elementToFocus.classList.contains("e-focus");if(!r){this.currentInfo.outline&&t.addClass([e.element],["e-focused"]),t.addClass([e.elementToFocus],["e-focus"]),e.element.tabIndex=0,r||this.setFocusedElement(e.elementToFocus,i),this.parent.notify("cellfocused",{element:e.elementToFocus,parent:e.element,indexes:this.getContent().matrix.current,byKey:!t.isNullOrUndefined(i),byClick:t.isNullOrUndefined(i),keyArgs:i,isJump:this.swap.swap,container:this.getContent().getInfo(i),outline:!t.isNullOrUndefined(i),swapInfo:this.swap});var n=this.getContent().matrix.current,o=n[0],s=n[1];this.prevIndexes={rowIndex:o,cellIndex:s},this.focusedColumnUid=this.parent.getColumnByIndex(s).uid,this.focusByClick=!1}}},e.prototype.refreshMatrix=function(e){var i=this;return function(r){e&&r.args&&r.args.isFrozen&&!i.fContent?i.fContent=new hr(i.parent):e&&!i.frContent&&r.args&&r.args.renderFrozenRightContent?i.frContent=new cr(i.parent):e&&!i.content&&(i.content=new lr(i.parent)),!e&&r.args&&r.args.isFrozen&&!i.fHeader?i.fHeader=new dr(i.parent):!e&&r.args&&r.args.renderFrozenRightContent&&!i.frHeader?i.frHeader=new ur(i.parent):e||i.header||(i.header=new ar(i.parent));var n=e?r.args&&r.args.isFrozen?i.fContent:r.args&&r.args.renderFrozenRightContent?i.frContent:i.content:r.args&&r.args.isFrozen?i.fHeader:r.args&&r.args.renderFrozenRightContent?i.frHeader:i.header,o=e?r.rows.slice(i.parent.frozenRows):r.rows,s=e?r.rows.slice(0,i.parent.frozenRows):r.rows;i.parent.isCollapseStateEnabled()&&e&&(o=o.filter(function(e){return!1!==e.visible}));var l=!t.isNullOrUndefined(i.parent.rowTemplate),a=n.matrix.generate(s,n.selector,l);if("batchAdd"===r.name&&i.parent.isFrozenGrid()){var h=i.parent.getMovableRowsObject().map(function(e){return e.clone()}),d=o.map(function(e){return e.clone()});if(i.fContent.matrix.generate(d,i.fContent.selector,l),i.content.matrix.generate(h,i.content.selector,l),"Left-Right"===i.parent.getFrozenMode()){var p=i.parent.getFrozenRightRowsObject().map(function(e){return e.clone()});i.frContent.matrix.generate(p,i.frContent.selector,l)}}else n.matrix.generate(o,n.selector,l);if(n.generateRows(s,{matrix:a,handlerInstance:r.args&&r.args.isFrozen?i.fHeader:r.args&&r.args.renderFrozenRightContent?i.frHeader:i.header}),!t.Browser.isDevice&&r&&r.args&&(i.focusByClick||"paging"!==r.args.requestType||(i.skipFocus=!1,i.parent.element.focus()),"grouping"===r.args.requestType&&(i.skipFocus=!0)),r&&r.args&&"virtualscroll"===r.args.requestType)if(i.currentInfo.uid){var c;if(r.rows.some(function(e,t){return c=t,e.uid===i.currentInfo.uid})&&(i.content.matrix.current[0]=c,i.content.matrix.current[1]=i.parent.getColumnIndexByUid(i.focusedColumnUid)||0,f=i.getContent().getFocusInfo().elementToFocus)){var u=f.getBoundingClientRect(),g=i.parent.element.getBoundingClientRect();u.top>=0&&u.left>=0&&u.right<=Math.min(g.right,window.innerWidth||document.documentElement.clientWidth)&&u.bottom<=Math.min(g.bottom,window.innerHeight||document.documentElement.clientHeight)&&(i.isVirtualScroll=!0,i.focus())}}else if(r.args.focusElement&&r.args.focusElement.classList.contains("e-filtertext")){var f=i.parent.element.querySelector("#"+r.args.focusElement.id);f&&f.focus()}}},e.prototype.addEventListener=function(){var e=this;if(!this.parent.isDestroyed){t.EventHandler.add(this.parent.element,"mousedown",this.focusCheck,this),t.EventHandler.add(this.parent.element,"focus",this.onFocus,this),this.parent.element.addEventListener("focus",this.passiveHandler=function(t){return e.passiveFocus(t)},!0),t.EventHandler.add(this.parent.element,"focusout",this.onBlur,this),this.parent.on(qt,this.onKeyPress,this),this.parent.on(Ht,this.onClick,this),this.parent.on(Mt,this.refMatrix,this),this.parent.on("partial-refresh",this.refMatrix,this),this.parent.on("refresh-Expand-and-Collapse",this.refMatrix,this),this.parent.on(Lt,this.refreshMatrix(),this),this.parent.on("close-edit",this.restoreFocus,this),this.parent.on("restore-Focus",this.restoreFocus,this);for(var i=["start-edit","start-add"],r=0;r<i.length;r++)this.parent.on(i[r],this.clearIndicator,this);this.parent.on("sorting-complete",this.restoreFocus,this),this.parent.on("filtering-complete",this.filterfocus,this);for(var n=["grouping","ungrouping"],o=0;o<n.length;o++)this.parent.on(n[o]+"-complete",this.restoreFocusWithAction,this);this.parent.on("batchAdd",this.refMatrix,this),this.parent.on("batchCancel",this.refMatrix,this),this.parent.on("batchDelete",this.refMatrix,this),this.parent.on("detailDataBound",this.refMatrix,this),this.parent.on(Ot,this.refMatrix,this),this.parent.on("cellfocused",this.internalCellFocus,this)}},e.prototype.filterfocus=function(){"FilterBar"!==this.parent.filterSettings.type&&this.restoreFocus()},e.prototype.removeEventListener=function(){if(!this.parent.isDestroyed){t.EventHandler.remove(this.parent.element,"mousedown",this.focusCheck),t.EventHandler.remove(this.parent.element,"focus",this.onFocus),t.EventHandler.remove(this.parent.element,"focusout",this.onBlur),this.parent.element.removeEventListener("focus",this.passiveHandler,!0),this.parent.off(qt,this.onKeyPress),this.parent.off(Ht,this.onClick),this.parent.off(Mt,this.refMatrix),this.parent.off("partial-refresh",this.refMatrix),this.parent.off("refresh-Expand-and-Collapse",this.refMatrix),this.parent.off(Lt,this.refreshMatrix()),this.parent.off("close-edit",this.restoreFocus),this.parent.off("restore-focus",this.restoreFocus);for(var e=["start-edit","start-add"],i=0;i<e.length;i++)this.parent.off(e[i],this.clearOutline);this.parent.off("sorting-complete",this.restoreFocus),this.parent.off("filtering-complete",this.filterfocus);for(var r=["grouping","ungrouping"],n=0;n<r.length;n++)this.parent.on(r[n]+"-complete",this.restoreFocusWithAction);this.parent.off("batchAdd",this.refMatrix),this.parent.off("batchDelete",this.refMatrix),this.parent.off("batchCancel",this.refMatrix),this.parent.off("detailDataBound",this.refMatrix),this.parent.off(Ot,this.refMatrix),this.parent.off("cellfocused",this.internalCellFocus)}},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.restoreFocus=function(){this.addFocus(this.getContent().getFocusInfo())},e.prototype.restoreFocusWithAction=function(e){if(!this.parent.enableInfiniteScrolling){var i=this.getContent().matrix,r=i.current;switch(e.requestType){case"grouping":case"ungrouping":r[1]=!r.length||this.parent.groupSettings.showGroupedColumn||t.isNullOrUndefined(i.matrix[r[0]])?"grouping"===e.requestType?r[1]+1:r[1]-1:i.matrix[r[0]].indexOf(1)}this.getContent().matrix.current=r,this.addFocus(this.getContent().getFocusInfo())}},e.prototype.clearOutline=function(){this.getContent().matrix.current=this.getContent().matrix.get(0,-1,[0,1],"downArrow",this.getContent().validator()),this.clearIndicator()},e.prototype.clearIndicator=function(){this.currentInfo.element&&this.currentInfo.elementToFocus&&t.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focus","e-focused"])},e.prototype.getPrevIndexes=function(){var e=this.forget;return this.forget=!1,e||!Object.keys(this.prevIndexes).length?{rowIndex:null,cellIndex:null}:this.prevIndexes},e.prototype.forgetPrevious=function(){this.forget=!0},e.prototype.setActiveByKey=function(e,t){var i=this;if(this.parent.isFrozenGrid()||0!==this.parent.frozenRows){var r,n={home:function(){return{toHeader:!r.isContent,toFrozen:!0}},end:function(){return{toHeader:!r.isContent,toFrozen:!1}},ctrlHome:function(){return{toHeader:!0,toFrozen:i.parent.isFrozenGrid()}},ctrlEnd:function(){return{toHeader:!1,toFrozen:!1}}};if(e in n){r=t.getInfo();var o=n[e]();this.setActive(!o.toHeader,o.toFrozen),this.getContent().matrix.current=t.matrix.current}}},e.prototype.internalCellFocus=function(e){if(e.byKey&&e.container.isContent&&"enter"===e.keyArgs.action&&(e.parent.classList.contains("e-detailcell")||e.parent.classList.contains("e-unboundcell")||e.parent.classList.contains("e-templatecell"))){this.clearIndicator();var t=this.getContent().getFocusable(this.getFocusedElement());this.setFocusedElement(t),this.currentInfo.skipAction=!0}},e}(),sr=function(){function e(){this.matrix=[],this.current=[]}return e.prototype.set=function(e,t,i){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.columns)),this.matrix[e]=this.matrix[e]||[],this.matrix[e][t]=i?1:0},e.prototype.get=function(e,i,r,n,o){var s=i;if(e+r[0]<0)return[e,i];e=Math.max(0,Math.min(e+r[0],this.rows));var l=!0;if(t.isNullOrUndefined(this.matrix[e]))return null;if(i=Math.max(0,Math.min(i+r[1],this.matrix[e].length-1)),s+r[1]>this.matrix[e].length-1&&o(e,i,n))return[e,s];var a=this.first(this.matrix[e],i,r,!0,n);i=null===a?s:a;var h=t.getValue(e+"."+i,this.matrix);if(e!==this.rows||"downArrow"!==n&&"enter"!==n||(r[0]=-1),null===a){for(var d=0;d<this.rows;d++)if(this.matrix[d].some(function(e){return 1===e})){l=!1;break}if(l)return e=this.current[0],[e,i]}return this.inValid(h)||!o(e,i,n)?this.get(e,s,r,n,o):[e,i]},e.prototype.first=function(e,t,i,r,n){return(t<0||t===e.length)&&this.inValid(e[t])&&"upArrow"!==n&&"downArrow"!==n||!e.some(function(e){return 1===e})?null:this.inValid(e[t])?this.first(e,-1!==["upArrow","downArrow","shiftUp","shiftDown"].indexOf(n)?r?0:++t:t+i[1],i,!1,n):t},e.prototype.select=function(e,t){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.matrix[e].length-1)),this.current=[e,t]},e.prototype.generate=function(e,t,i){this.rows=e.length-1,this.matrix=[];for(var r=0;r<e.length;r++){var n=e[r].cells.filter(function(e){return!0!==e.isSpanned});this.columns=Math.max(n.length-1,0|this.columns);for(var o=0;o<n.length;o++)this.set(r,o,!1!==e[r].visible&&t(e[r],n[o],i))}return this.matrix},e.prototype.inValid=function(e){return 0===e||void 0===e},e}(),lr=function(){function i(e){var t=this;this.matrix=new sr,this.lastIdxCell=!1,this.parent=e,this.keyActions={rightArrow:[0,1],tab:[0,1],leftArrow:[0,-1],shiftTab:[0,-1],upArrow:[-1,0],downArrow:[1,0],shiftUp:[-1,0],shiftDown:[1,0],shiftRight:[0,1],shiftLeft:[0,-1],enter:[1,0],shiftEnter:[-1,0]},this.indexesByKey=function(e){return{home:[t.matrix.current[0],-1,0,1],end:[t.matrix.current[0],t.matrix.columns+1,0,-1],ctrlHome:[0,-1,0,1],ctrlEnd:[t.matrix.rows,t.matrix.columns+1,0,-1]}[e]||null}}return i.prototype.getTable=function(){return this.parent.isFrozenGrid()?this.parent.getContent().querySelector(".e-movablecontent .e-table"):this.parent.getContentTable()},i.prototype.onKeyPress=function(e){var t=this.keyActions[e.action],i=this.getCurrentFromAction(e.action,t,e.action in this.keyActions,e);if(i){if((["tab","shiftTab"].indexOf(e.action)>-1&&this.matrix.current||[]).toString()===i.toString()){if(i.toString()===[this.matrix.rows,this.matrix.columns].toString()||i.toString()===[0,0].toString()||this.matrix.current[0]===this.matrix.rows&&this.matrix.current.toString()===i.toString())return!1;i=this.editNextRow(i[0],i[1],e.action)}this.matrix.select(i[0],i[1])}},i.prototype.editNextRow=function(e,t,i){var r=this.parent,n=r.editSettings.allowNextRowEdit&&(r.isEdit||r.isLastCellPrimaryKey),o=r.getColumnIndexByField(r.getVisibleColumns()[0].field),s=this.getTable().rows[e].cells[t];return"tab"===i&&n&&(e++,t=o+(this.getTable().rows[e].querySelectorAll(".e-indentcell").length+this.getTable().rows[e].querySelectorAll(".e-detailrowcollapse").length)),"shiftTab"===i&&n&&(e--,t=r.getColumnIndexByField(r.getVisibleColumns()[r.getVisibleColumns().length-1].field)),s.classList.contains("e-rowcell")||s.classList.contains("e-headercell")||s.classList.contains("e-groupcaption")?[e,t]:this.editNextRow(e,t,i)},i.prototype.getCurrentFromAction=function(e,t,i,r){if(void 0===t&&(t=[0,0]),!i&&!this.indexesByKey(e)||0===this.matrix.current.length)return null;if(!this.shouldFocusChange(r))return this.matrix.current;var n=this.indexesByKey(e)||this.matrix.current.concat(t),o=n[0],s=n[1],l=n[2],a=n[3];return this.matrix.get(o,s,[l,a],e,this.validator())},i.prototype.onClick=function(e,i){var r=e.target;if(this.target=r,r=r.classList.contains("e-rowcell")?r:t.closest(r,"td"),r=r||(t.closest(e.target,"td.e-detailrowcollapse")||t.closest(e.target,"td.e-detailrowexpand")),r=t.closest(e.target,"td.e-detailcell")&&t.isNullOrUndefined(t.closest(t.closest(e.target,".e-grid"),"td.e-detailcell"))?null:r,!(r=r&&t.closest(r,"table").classList.contains("e-table")?r:null))return!1;var n=[r.parentElement.rowIndex,r.cellIndex],o=n[0],s=n[1],l=this.matrix.current,a=l[0],h=l[1],d=t.getValue(o+"."+s,this.matrix.matrix);if(this.matrix.inValid(d)||!i&&a===o&&h===s||!O(e.target,"e-rowcell")&&!O(e.target,"e-groupcaption"))return!1;this.matrix.select(o,s)},i.prototype.getFocusInfo=function(){var e={},i=this.matrix.current,r=i[0],n=void 0===r?0:r,o=i[1],s=void 0===o?0:o;return this.matrix.current=[n,s],e.element=t.isNullOrUndefined(this.getTable().rows[n])?null:this.getTable().rows[n].cells[s],e.element?(e.elementToFocus=e.element.classList.contains("e-unboundcell")||e.element.classList.contains("e-detailcell")?e.element:this.getFocusable(e.element),e.outline=!0,e.uid=e.element.parentElement.getAttribute("data-uid"),e):e},i.prototype.getFocusable=function(e){var i='button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])',r=!t.isNullOrUndefined(t.closest(e,".e-templatecell"));this.parent.isEdit&&(i='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea');var n=[].slice.call(e.querySelectorAll(i));return n.length?r?this.target:n[0]:e},i.prototype.selector=function(i,r,n){var o=[e.CellType.Expand,e.CellType.GroupCaption,e.CellType.CaptionSummary,e.CellType.GroupSummary];return(i.isDataRow&&r.visible&&(r.isDataCell||r.isTemplate)||i.isDataRow&&r.cellType===e.CellType.DetailExpand&&t.isNullOrUndefined(r.visible)||!i.isDataRow&&o.indexOf(r.cellType)>-1||r.column&&"checkbox"===r.column.type||r.cellType===e.CellType.CommandColumn||i.isDataRow&&n)&&!("delete"===i.edit&&i.isDirty)},i.prototype.nextRowFocusValidate=function(e){for(var t=e,i=e,r=this.matrix.rows;i<r;i++){if(-1!==this.matrix.matrix[e].indexOf(1))return e;e+=1}return this.lastIdxCell=!0,t},i.prototype.previousRowFocusValidate=function(e){for(var t=e,i=e;i>=0;i--){if(-1!==this.matrix.matrix[e].indexOf(1))return e;if((e-=1)<0)return this.lastIdxCell=!0,t}return t},i.prototype.jump=function(e,t){var i=this.parent.getFrozenLeftCount()&&("leftArrow"===e||"shiftTab"===e)&&0===t[1],r=("rightArrow"===e||"tab"===e)&&t[1]===this.matrix.columns,n="Left-Right"===this.parent.getFrozenMode()&&r;"Right"===this.parent.getFrozenMode()&&(i=r),this.lastIdxCell=!1;var o=0!==this.parent.frozenRows&&"shiftEnter"===e;"tab"!==e||this.parent.isEdit||t[1]!==this.matrix.matrix[t[0]].lastIndexOf(1)||this.matrix.matrix.length-1===t[0]||(this.matrix.current[0]=this.nextRowFocusValidate(this.matrix.current[0]+1),this.matrix.current[1]=-1,i=this.parent.isFrozenGrid()),"shiftTab"!==e||this.parent.isEdit||0===t[0]||this.matrix.matrix[t[0]].indexOf(1)!==t[1]||(this.matrix.current[0]=this.previousRowFocusValidate(this.matrix.current[0]-1),this.matrix.current[1]=this.matrix.matrix[t[0]].length);var s=!1,l=document.activeElement.parentElement;return(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&l.classList.contains("e-row")&&(s=parseInt(l.getAttribute("aria-rowindex"),10)>0),{swap:!s&&(("upArrow"===e||o)&&0===t[0]||i||n),toHeader:("upArrow"===e||o)&&0===t[0],toFrozen:i,toFrozenRight:n}},i.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()||"Left-Right"===this.parent.getFrozenMode()?("leftArrow"!==r&&"shiftTab"!==r||(n[0]=e[0],n[1]=i.matrix.columns+1),"Left-Right"!==this.parent.getFrozenMode()||"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1)):"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1),"downArrow"!==r&&"enter"!==r||(n[0]=-1,n[1]=e[1]),n},i.prototype.generateRows=function(e,t){var i,r=t.matrix,n=t.handlerInstance,o=n.matrix.matrix.length,s=this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type?o+1:o;n.matrix.matrix=n.matrix.matrix.slice(0,s),n.matrix.rows=s,(i=n.matrix.matrix).push.apply(i,r),n.matrix.rows+=r.length},i.prototype.getInfo=function(e){var t=this.getFocusInfo(),i=this.matrix.current,r=i[0],n=i[1],o=t.element.classList.contains("e-rowcell"),s=o||e&&"enter"!==e.action&&(t.element.classList.contains("e-detailrowcollapse")||t.element.classList.contains("e-detailrowexpand")),l=[Math.min(parseInt(t.element.parentElement.getAttribute("aria-rowindex"),10),r),Math.min(parseInt(t.element.getAttribute("aria-colindex"),10),n)];return{isContent:!0,isDataCell:o,indexes:[l[0],l[1]],isSelectable:s}},i.prototype.validator=function(){var e=this.getTable();return function(i,r,n){if(!t.isNullOrUndefined(e.rows[i])){var o=void 0;r=e.querySelector(".e-emptyrow")?0:r;var s=0!==(o=e.rows[i].cells[0].classList.contains("e-editcell")?e.rows[i].cells[0].querySelectorAll("td")[r]:e.rows[i].cells[r]).getBoundingClientRect().width;if("enter"===n||"shiftEnter"===n)return s&&o.classList.contains("e-rowcell");if(("shiftUp"===n||"shiftDown"===n)&&o.classList.contains("e-rowcell"))return s;if("shiftUp"!==n&&"shiftDown"!==n)return s}return!1}},i.prototype.shouldFocusChange=function(e){var i=this.matrix.current,r=i[0],n=void 0===r?-1:r,o=i[1],s=void 0===o?-1:o;if(n<0||s<0)return!0;var l=t.getValue(n+".cells."+s,this.getTable().rows);return!l||("enter"!==e.action&&"shiftEnter"!==e.action||l.classList.contains("e-rowcell")&&!l.classList.contains("e-unboundcell")&&(!l.classList.contains("e-templatecell")||l.classList.contains("e-editedbatchcell"))&&!l.classList.contains("e-detailcell"))},i.prototype.getGridSeletion=function(){return!t.isBlazor()&&this.parent.allowSelection&&this.parent.selectionSettings.allowColumnSelection},i}(),ar=function(i){function r(e){return i.call(this,e)||this}return nr(r,i),r.prototype.getTable=function(){return this.parent.isFrozenGrid()?this.parent.getHeaderContent().querySelector(".e-movableheader .e-table"):this.parent.getHeaderTable()},r.prototype.onClick=function(e){var i=e.target;if((i=i.classList.contains("e-headercell")?i:t.closest(i,"th"))||0===this.parent.frozenRows||(i=e.target.classList.contains("e-rowcell")?e.target:t.closest(e.target,"td")),e.target.classList.contains("e-columnheader")||e.target.querySelector(".e-stackedheadercell"))return!1;if(i){var r=[i.parentElement.rowIndex,i.cellIndex],n=r[0],o=r[1],s=t.getValue(n+"."+o,this.matrix.matrix);if(this.matrix.inValid(s))return!1;this.matrix.select(i.parentElement.rowIndex,i.cellIndex)}},r.prototype.getFocusInfo=function(){var e={},i=this.matrix.current,r=i[0],n=void 0===r?0:r,o=i[1],s=void 0===o?0:o;return e.element=this.getTable().rows[n].cells[s],t.isNullOrUndefined(e.element)||(e.elementToFocus=this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell")),e},r.prototype.selector=function(i,r){return r.visible&&(void 0!==r.column.field||r.isTemplate||!t.isNullOrUndefined(r.column.template))||"checkbox"===r.column.type||r.cellType===e.CellType.StackedHeader},r.prototype.jump=function(e,i){var r=this.parent.getFrozenLeftCount()&&("leftArrow"===e||"shiftLeft"===e&&this.getGridSeletion()||"shiftTab"===e)&&0===i[1],n=("rightArrow"===e||"shiftRight"===e&&this.getGridSeletion()||"tab"===e)&&i[1]===this.matrix.columns,o="Left-Right"===this.parent.getFrozenMode()&&n;"Right"===this.parent.getFrozenMode()&&(r=n);var s,l,a=0!==this.parent.frozenRows&&"enter"===e,h=r||o,d=this.parent.focusModule.fHeader&&this.parent.focusModule.fHeader.matrix.matrix,p=d&&!t.isNullOrUndefined(d[i[0]]);return this.parent.enableHeaderFocus&&"tab"===e&&(l=this.matrix.matrix.length-1===i[0],(s=i[1]===this.matrix.matrix[i[0]].lastIndexOf(1))&&(this.matrix.current[0]=l?0:this.matrix.current[0]+1,this.matrix.current[1]=-1),this.parent.isFrozenGrid()&&l&&s&&(r=!0,h=!1)),{swap:("downArrow"===e||a)&&i[0]===this.matrix.matrix.length-1||p&&(r||o)||"tab"===e&&l&&s,toHeader:h,toFrozen:r,toFrozenRight:o}},r.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()||"Left-Right"===this.parent.getFrozenMode()?(("leftArrow"===r||"shiftLeft"===r&&this.getGridSeletion()||"shiftTab"===r)&&(n[0]=e[0],n[1]=i.matrix.columns+1),"Left-Right"===this.parent.getFrozenMode()&&("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=-1)):("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=-1),"upArrow"!==r&&"shiftEnter"!==r||(n[0]=this.matrix.matrix.length,n[1]=e[1]),n},r.prototype.generateRows=function(e){var t=this.matrix.matrix.length;if(this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type){this.matrix.rows=++this.matrix.rows;for(var i=e[0].cells,r=0;r<i.length;r++)this.matrix.set(t,r,i[r].visible&&!1!==i[r].column.allowFiltering)}},r.prototype.getInfo=function(e){return t.extend(i.prototype.getInfo.call(this,e),{isContent:!1,isHeader:!0})},r.prototype.validator=function(){return function(){return!0}},r.prototype.shouldFocusChange=function(e){var i=this.matrix.current,r=i[0],n=i[1];if(r<0||n<0)return!0;var o=t.getValue(r+".cells."+n,this.getTable().rows);return!o||("enter"!==e.action&&"altDownArrow"!==e.action||!o.classList.contains("e-headercell"))},r}(lr),hr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nr(t,e),t.prototype.getTable=function(){return this.parent.getContent().querySelector(".e-frozencontent .e-table")},t.prototype.jump=function(e,t){var i=0!==this.parent.frozenRows&&"shiftEnter"===e,r=("upArrow"===e||i)&&0===t[0];return"Right"===this.parent.getFrozenMode()?{swap:r||("shiftTab"===e||"leftArrow"===e)&&0===t[1],toHeader:r,toFrozen:r}:{swap:r||("tab"===e||"rightArrow"===e)&&t[1]===this.matrix.columns,toHeader:r,toFrozen:r}},t.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()?"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1):("tab"===r&&this.parent.enableHeaderFocus&&(n[0]=e[0],n[1]=-1),"leftArrow"!==r&&"shiftTab"!==r||(n[0]=e[0],n[1]=i.matrix.columns+1)),"downArrow"!==r&&"enter"!==r||(n[0]=-1,n[1]=e[1]),n},t}(lr),dr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return nr(i,e),i.prototype.jump=function(e,i){var r=0!==this.parent.frozenRows&&"enter"===e,n=this.parent.focusModule.header&&this.parent.focusModule.header.matrix.matrix,o=n&&!t.isNullOrUndefined(n[i[0]]);if("Right"===this.parent.getFrozenMode()){var s=("leftArrow"===e||"shiftLeft"===e&&this.getGridSeletion()||"shiftTab"===e)&&0===i[1];return{swap:("downArrow"===e||r)&&i[0]===this.matrix.matrix.length-1||o&&s,toHeader:s,toFrozen:("downArrow"===e||r)&&i[0]===this.matrix.matrix.length-1}}return{swap:("downArrow"===e||r)&&i[0]===this.matrix.matrix.length-1||("rightArrow"===e||"shiftRight"===e&&this.getGridSeletion()||"tab"===e)&&i[1]===this.matrix.columns&&o,toHeader:("rightArrow"===e||"shiftRight"===e&&this.getGridSeletion()||"tab"===e)&&i[1]===this.matrix.columns,toFrozen:("downArrow"===e||r)&&i[0]===this.matrix.matrix.length-1}},i.prototype.getTable=function(){return this.parent.getHeaderContent().querySelector(".e-frozenheader .e-table")},i.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()?("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=-1):("leftArrow"===r||"shiftLeft"===r&&this.getGridSeletion()||"shiftTab"===r)&&(n[0]=e[0],n[1]=i.matrix.columns+1),"upArrow"!==r&&"shiftEnter"!==r||(n[0]=this.matrix.matrix.length,n[1]=e[1]),n},i}(ar),pr=function(){function e(e){this.searchBox=e}return e.prototype.searchFocus=function(e){e.target.parentElement.classList.add("e-input-focus")},e.prototype.searchBlur=function(e){e.target.parentElement.classList.remove("e-input-focus")},e.prototype.wireEvent=function(){this.searchBox&&(t.EventHandler.add(this.searchBox,"focus",this.searchFocus,this),t.EventHandler.add(this.searchBox,"blur",this.searchBlur,this))},e.prototype.unWireEvent=function(){this.searchBox&&(t.EventHandler.remove(this.searchBox,"focus",this.searchFocus),t.EventHandler.remove(this.searchBox,"blur",this.searchBlur))},e}(),cr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nr(t,e),t.prototype.getTable=function(){return this.parent.getContent().querySelector(".e-frozen-right-content .e-table")},t.prototype.jump=function(e,t){var i=0!==this.parent.frozenRows&&"shiftEnter"===e,r=("upArrow"===e||i)&&0===t[0];return{swap:r||("shiftTab"===e||"leftArrow"===e)&&0===t[1],toHeader:r,toFrozenRight:r}},t.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1),"downArrow"!==r&&"enter"!==r||(n[0]=-1,n[1]=e[1]),n},t}(lr),ur=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return nr(i,e),i.prototype.jump=function(e,i){var r=this.parent.focusModule.header&&this.parent.focusModule.header.matrix.matrix,n=r&&!t.isNullOrUndefined(r[i[0]]),o=0!==this.parent.frozenRows&&"enter"===e,s=("leftArrow"===e||"shiftLeft"===e&&this.getGridSeletion()||"shiftTab"===e)&&0===i[1];return{swap:("downArrow"===e||o)&&i[0]===this.matrix.matrix.length-1||n&&s,toHeader:s,toFrozenRight:("downArrow"===e||o)&&i[0]===this.matrix.matrix.length-1}},i.prototype.getTable=function(){return this.parent.getHeaderContent().querySelector(".e-frozen-right-header .e-table")},i.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=0),"upArrow"!==r&&"shiftEnter"!==r||(n[0]=this.matrix.matrix.length,n[1]=e[1]),n},i}(ar),gr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fr=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},mr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return gr(i,e),fr([t.Property(12)],i.prototype,"pageSize",void 0),fr([t.Property(8)],i.prototype,"pageCount",void 0),fr([t.Property(1)],i.prototype,"currentPage",void 0),fr([t.Property()],i.prototype,"totalRecordsCount",void 0),fr([t.Property(!1)],i.prototype,"enableQueryString",void 0),fr([t.Property(!1)],i.prototype,"pageSizes",void 0),fr([t.Property(null)],i.prototype,"template",void 0),i}(t.ChildProperty),yr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vr=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Cr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return yr(i,e),vr([t.Property("startsWith")],i.prototype,"operator",void 0),i}(t.ChildProperty),wr=function(){return(wr=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},br=function(){function r(e,t,i){this.selectedRowIndexes=[],this.selectedRowCellIndexes=[],this.selectedRecords=[],this.preventFocus=!1,this.selectedColumnsIndexes=[],this.checkBoxState=!1,this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1,this.enableSelectMultiTouch=!1,this.clearRowCheck=!1,this.selectRowCheck=!1,this.selectedRowState={},this.totalRecordsCount=0,this.chkAllCollec=[],this.isCheckedOnAdd=!1,this.persistSelectedData=[],this.needColumnSelection=!1,this.isCancelDeSelect=!1,this.isPreventCellSelect=!1,this.disableUI=!1,this.isPersisted=!1,this.cmdKeyPressed=!1,this.cellselected=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.initialRowSelection=!1,this.isPrevRowSelection=!1,this.autoFillRLselection=!0,this.parent=e,this.selectionSettings=t,this.factory=i.getService("rendererFactory"),this.focus=i.getService("focus"),this.addEventListener(),this.wireEvents()}return r.prototype.initializeSelection=function(){this.parent.log("selection_key_missing"),this.render()},r.prototype.onActionBegin=function(e,t){this.parent.trigger(t,this.fDataUpdate(e))},r.prototype.fDataUpdate=function(e){if(!(this.isMultiSelection||t.isNullOrUndefined(e.cellIndex)&&t.isNullOrUndefined(e.rowIndex))){var i=this.getRowObj(t.isNullOrUndefined(e.rowIndex)?t.isNullOrUndefined(e.cellIndex)?this.currentIndex:e.cellIndex.rowIndex:e.rowIndex);e.foreignKeyData=i.foreignKeyData}return e},r.prototype.onActionComplete=function(e,t){this.parent.trigger(t,this.fDataUpdate(e)),this.isMultiSelection=!1},r.prototype.getModuleName=function(){return"selection"},r.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.hidePopUp(),this.clearSelection(),this.removeEventListener(),this.unWireEvents(),t.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler))},r.prototype.isEditing=function(){return("Normal"===this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate())&&this.parent.isEdit&&!this.parent.isPersistSelection},r.prototype.getSelectedMovableRow=function(e){var t=this.parent;return t.isFrozenGrid()&&this.parent.getContent().querySelector(".e-movablecontent")?t.getMovableRowByIndex(e):null},r.prototype.getSelectedFrozenRightRow=function(e){var t=this.parent;return t.isFrozenGrid()&&"Left-Right"===t.getFrozenMode()&&t.getFrozenRightContent()?t.getFrozenRightRowByIndex(e):null},r.prototype.getCurrentBatchRecordChanges=function(){var e=this.parent;if("Batch"===e.editSettings.mode&&e.editModule){var t=x(this.parent.getCurrentViewRecords());t="Bottom"===e.editSettings.newRowPosition?t.concat(this.parent.editModule.getBatchChanges().addedRecords):this.parent.editModule.getBatchChanges().addedRecords.concat(t);for(var i=this.parent.editModule.getBatchChanges().deletedRecords,r=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<i.length;n++)for(var o=0;o<t.length;o++)if(i[n][r]===t[o][r]){t.splice(o,1);break}return t}return e.getCurrentViewRecords()},r.prototype.selectRow=function(e,i){if(this.selectedRowIndexes.length&&this.selectionSettings.enableSimpleMultiRowSelection)return void this.addRowsToSelection([e]);var r,n=this.parent,o=n.getRowByIndex(e),s=this.getSelectedMovableRow(e),l=this.getSelectedFrozenRightRow(e);if(n.enableVirtualization&&e>-1){this.parent.notify("select-virtual-Row",{selectedIndex:e});var a=n.isFrozenGrid()?n.contentModule.getRowObjectByIndex(e):null;if(!o||!n.getRowObjectFromUID(o.getAttribute("data-uid"))&&!a)return void(this.parent.getSelectedRecords().length>0&&this.clearRowSelection());r=a||n.getRowObjectFromUID(o.getAttribute("data-uid")).data}else r=this.getCurrentBatchRecordChanges()[e];if(this.isRowType()&&o&&!this.isEditing()){var h=o.hasAttribute("aria-selected");this.activeTarget();var d;if(i=i?!!this.selectedRowIndexes.length&&(1===this.selectedRowIndexes.length&&e===this.selectedRowIndexes[0]):i)this.rowSelectingCallBack(d,i,e,r,!1,h,"cancel")(d);else{!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(d={data:r,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,row:o,previousRow:n.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},d=this.addMovableArgs(d,s,l)):d={data:r,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowIndex:this.prevRowIndex,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},this.parent.trigger("rowSelecting",this.fDataUpdate(d),this.rowSelectingCallBack(d,i,e,r,!1,h,"cancel"))}}},r.prototype.rowSelectingCallBack=function(e,i,r,n,o,s,l){var a=this;return function(e){if(!t.isNullOrUndefined(e)&&!0===e[l])return void a.disableInteracted();a.index=r,a.toggle=i,a.data=n,a.removed=o,s&&a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode?(a.clearSelectedRow(r),a.selectRowCallBack()):!s&&a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode&&a.selectRowCallBack(),"ResetOnRowClick"===a.selectionSettings.checkboxMode&&a.clearSelection(),(!a.selectionSettings.persistSelection||"ResetOnRowClick"===a.selectionSettings.checkboxMode||!a.parent.isCheckBoxSelection&&a.selectionSettings.persistSelection)&&(a.selectRowCheck=!0,a.clearRow())}},r.prototype.selectRowCallBack=function(){var e,i=this.parent,r=this.index,n=this.toggle,o=this.data,s=this.removed,l=i.getRowByIndex(r),a=this.getSelectedMovableRow(r),h=this.getSelectedFrozenRightRow(r);if(n||s||(this.selectedRowIndexes.indexOf(r)<=-1&&(this.updateRowSelection(l,r),this.selectMovableRow(a,h,r)),this.selectRowIndex(r)),!n){!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(e={data:o,rowIndex:r,row:l,previousRow:i.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked},e=this.addMovableArgs(e,a,h)):e={data:o,rowIndex:r,row:l,previousRow:i.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked},this.onActionComplete(e,"rowSelected")}if(t.isBlazor()&&this.parent.isServerRendered&&this.parent.enableVirtualization){this.parent.interopAdaptor.invokeMethodAsync("MaintainSelection",!0,"normal",[r])}this.isInteracted=!1,this.updateRowProps(r)},r.prototype.selectMovableRow=function(e,t,i){this.parent.isFrozenGrid()&&(this.updateRowSelection(e,i),"Left-Right"===this.parent.getFrozenMode()&&t&&this.updateRowSelection(t,i))},r.prototype.addMovableArgs=function(e,t,i){if(this.parent.isFrozenGrid()){var r={mRow:t,previousMovRow:this.parent.getMovableRows()[this.prevRowIndex]};"Left-Right"===this.parent.getFrozenMode()&&i&&(r.frozenRightRow=i,r.previousFrozenRightRow=this.parent.getFrozenRightDataRows()[this.prevRowIndex]),e=wr({},e,r)}return e},r.prototype.selectRowsByRange=function(e,t){this.selectRows(this.getCollectionFromIndexes(e,t)),this.selectRowIndex(t)},r.prototype.selectRows=function(e){var i=this,r=this.parent,n=this.isSingleSel()?e[e.length-1]:e[0];this.isMultiSelection=!0;var o=[],s=[],l=this.getSelectedMovableRow(n),a=this.getSelectedFrozenRightRow(n),h=[];if(this.isRowType()&&!this.isEditing()){for(var d=0,p=e.length;d<p;d++){var c=this.parent.getDataRows()[e[d]],u=this.getRowObj(c);u&&(h.push(u.data),o.push(c),s.push(u.foreignKeyData))}this.activeTarget();var g;!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(g={cancel:!1,rowIndexes:e,row:o,rowIndex:n,target:this.actualTarget,prevRow:r.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:h,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:s},g=this.addMovableArgs(g,l,a)):g={cancel:!1,rowIndexes:e,rowIndex:n,previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:h,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:s},this.parent.trigger("rowSelecting",this.fDataUpdate(g),function(d){if(!t.isNullOrUndefined(d)&&!0===d.cancel)return void i.disableInteracted();i.clearRow(),i.selectRowIndex(e.slice(-1)[0]);var p=function(e){if(i.updateRowSelection(r.getRowByIndex(e),e),r.isFrozenGrid()){var t="Left-Right"===i.parent.getFrozenMode()?r.getFrozenRightRowByIndex(e):void 0;i.selectMovableRow(r.getMovableRowByIndex(e),t,e)}i.updateRowProps(n)};if(i.isSingleSel())p(n);else for(var c=0,u=e;c<u.length;c++)p(u[c]);!t.isBlazor()||i.parent.isJsComponent||i.parent.isHybrid?(d={rowIndexes:e,row:o,rowIndex:n,target:i.actualTarget,prevRow:r.getRows()[i.prevRowIndex],previousRowIndex:i.prevRowIndex,data:t.isBlazor()?h:i.getSelectedRecords(),isInteracted:i.isInteracted,isHeaderCheckboxClicked:i.isHeaderCheckboxClicked,foreignKeyData:s},d=i.addMovableArgs(d,l,a)):d={rowIndexes:e,rowIndex:n,previousRowIndex:i.prevRowIndex,row:o,prevRow:r.getRows()[i.prevRowIndex],data:t.isBlazor()?h:i.getSelectedRecords(),isInteracted:i.isInteracted,isHeaderCheckboxClicked:i.isHeaderCheckboxClicked,foreignKeyData:s},i.isRowSelected&&i.onActionComplete(d,"rowSelected"),i.isInteracted=!1})}},r.prototype.addRowsToSelection=function(e){var i=this.parent,r=this.target;this.isMultiSelection=!0;var n=i.getSelectedRowIndexes().concat(e),o=this.isSingleSel()?i.getRowByIndex(e[e.length-1]):i.getRowByIndex(e[0]),s=this.isSingleSel()?this.getSelectedMovableRow(e[e.length-1]):this.getSelectedMovableRow(e[0]),l=this.isSingleSel()?this.getSelectedFrozenRightRow(e[e.length-1]):this.getSelectedFrozenRightRow(e[0]);if(this.isRowType()&&!this.isEditing()||this.selectionSettings.checkboxOnly)for(var a,h=this.parent.getColumns().filter(function(e){return"checkbox"===e.type}),d=0,p=e;d<p.length;d++){var c=p[d],u=this.getRowObj(c),g=this.selectedRowIndexes.indexOf(c)>-1;if(this.selectRowIndex(c),g&&(h.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.isAddRowsToSelection=!0,this.rowDeselect("rowDeselecting",[c],[u.data],[o],[u.foreignKeyData],r),this.isCancelDeSelect)return;this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(c),1),this.selectedRecords.splice(this.selectedRecords.indexOf(o),1),o.removeAttribute("aria-selected"),this.addRemoveClassesForRow(o,!1,null,"e-selectionbackground","e-active"),s&&(this.selectedRecords.splice(this.selectedRecords.indexOf(s),1),s.removeAttribute("aria-selected"),this.addRemoveClassesForRow(s,!1,null,"e-selectionbackground","e-active")),l&&(this.selectedRecords.splice(this.selectedRecords.indexOf(l),1),l.removeAttribute("aria-selected"),this.addRemoveClassesForRow(l,!1,null,"e-selectionbackground","e-active")),this.rowDeselect("rowDeselected",[c],[u.data],[o],[u.foreignKeyData],r,[s],void 0,[l]),this.isInteracted=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1}else{f="isHybrid";if(this.activeTarget(),!t.isBlazor()||this.parent.isJsComponent||this.parent[f]?(a={cancel:!1,data:u.data,rowIndex:c,row:o,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},a=this.addMovableArgs(a,s,l)):a={cancel:!1,data:u.data,rowIndex:c,previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},this.parent.trigger("rowSelecting",this.fDataUpdate(a)),!t.isNullOrUndefined(a)&&!0===a.cancel)return void this.disableInteracted();this.isSingleSel()&&this.clearRow(),this.updateRowSelection(o,c),this.selectMovableRow(s,l,c)}if(!g){var f="isHybrid";!t.isBlazor()||this.parent.isJsComponent||this.parent[f]?(a={data:u.data,rowIndex:c,row:o,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},a=this.addMovableArgs(a,s,l)):a={data:u.data,rowIndex:c,previousRowIndex:this.prevRowIndex,row:o,prevRow:i.getRows()[this.prevRowIndex],foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},this.onActionComplete(a,"rowSelected")}if(this.isInteracted=!1,this.updateRowProps(c),this.isSingleSel())break}},r.prototype.getCollectionFromIndexes=function(e,t){for(var i=[],r=e<=t?{i:e,max:t}:{i:t,max:e},n=r.i,o=r.max;n<=o;n++)i.push(n);return e>t&&i.reverse(),i},r.prototype.clearRow=function(){this.clearRowCheck=!0,this.clearRowSelection()},r.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),this.isSingleSel()&&this.parent.isPersistSelection&&(this.selectedRowState={}))},r.prototype.clearSelectedRow=function(e){if(this.toggle){var t=this.parent.getRowByIndex(e);this.disableUI||(t.removeAttribute("aria-selected"),this.addRemoveClassesForRow(t,!1,!0,"e-selectionbackground","e-active")),this.removed=!0,this.updatePersistCollection(t,!1),this.updateCheckBoxes(t),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(e),1),this.selectedRecords.splice(this.selectedRecords.indexOf(this.parent.getRowByIndex(e)),1)}},r.prototype.updateRowProps=function(e){this.prevRowIndex=e,this.isRowSelected=this.selectedRowIndexes.length&&!0},r.prototype.updatePersistCollection=function(e,i){var r=this;if((this.parent.isPersistSelection||this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0)&&!t.isNullOrUndefined(e)){this.parent.isPersistSelection||this.ensureCheckboxFieldSelection();var n=this.getRowObj(e),o=n.data?n.data[this.primaryKey]:null;if(null===o)return;n.isSelected=i,i?(this.selectedRowState[o]=i,this.persistSelectedData.some(function(e){return e[r.primaryKey]===o})||this.persistSelectedData.push(n.data)):this.updatePersistDelete(o)}},r.prototype.updatePersistDelete=function(e){var t=this;delete this.selectedRowState[e];var i;this.persistSelectedData.some(function(r,n){return i=n,r[t.primaryKey]===e})&&this.persistSelectedData.splice(i,1)},r.prototype.updateCheckBoxes=function(e,i,r){if(!t.isNullOrUndefined(e)){var n=e.querySelector(".e-checkselect");t.isNullOrUndefined(n)||(oe(n.nextElementSibling,i),re(n,i),(t.isNullOrUndefined(this.checkedTarget)||!t.isNullOrUndefined(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(r))}},r.prototype.updateRowSelection=function(e,t){if(e){this.selectedRowIndexes.push(t);var i=this.selectedRowIndexes.length;if(this.parent.isFrozenGrid()&&i>1&&this.selectedRowIndexes[i-2]===this.selectedRowIndexes[i-1]&&this.selectedRowIndexes.pop(),this.selectedRecords.push(e),e.setAttribute("aria-selected","true"),this.updatePersistCollection(e,!0),this.updateCheckBoxes(e,!0),this.addRemoveClassesForRow(e,!0,null,"e-selectionbackground","e-active"),!this.preventFocus){var r=this.focus.getPrevIndexes().cellIndex?e.cells[this.focus.getPrevIndexes().cellIndex]:e.querySelector(".e-selectionbackground:not(.e-hide):not(.e-detailrowcollapse):not(.e-detailrowexpand)");if(this.parent.contextMenuModule&&2===this.mouseButton&&(r=this.parent.contextMenuModule.cell),!r)return;this.focus.onClick({target:r},!0)}}},r.prototype.clearSelection=function(){if(!this.parent.isPersistSelection||this.parent.isPersistSelection&&!this.parent.isEdit||!t.isNullOrUndefined(this.checkedTarget)&&this.checkedTarget.classList.contains("e-checkselectall")){var e=this.parent.element.querySelector(".e-gridpopup").querySelector("span");e.classList.contains("e-rowselect")&&e.classList.remove("e-spanclicked"),this.parent.isPersistSelection&&(this.persistSelectedData=[],this.selectedRowState={}),this.clearRowSelection(),this.clearCellSelection(),this.clearColumnSelection(),this.prevRowIndex=void 0,this.enableSelectMultiTouch=!1,this.isInteracted=!1}},r.prototype.clearRowSelection=function(){var e=this;if(this.isRowSelected){for(var i=this.parent,r=this.parent.getDataRows(),n=[],o=[],s=[],l=[],a=[],h=[],d=this.target,p=(this.parent.getCurrentViewRecords(),0),c=this.selectedRowIndexes.length;p<c;p++){var u="Batch"===this.parent.editSettings.mode?this.parent.getRows()[this.selectedRowIndexes[p]]:this.parent.getDataRows()[this.selectedRowIndexes[p]],g=this.getRowObj(u);g&&(n.push(g.data),o.push(u),a.push(this.selectedRowIndexes[p]),h.push(g.foreignKeyData)),i.isFrozenGrid()&&(s.push(i.getMovableRows()[this.selectedRowIndexes[p]]),"Left-Right"===i.getFrozenMode()&&l.push(i.getFrozenRightRows()[this.selectedRowIndexes[p]]))}this.selectionSettings.persistSelection&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode&&(this.isRowClicked=!!this.checkSelectAllClicked),this.rowDeselect("rowDeselecting",a,n,o,h,d,s,function(){if(e.isCancelDeSelect&&(e.isRowClicked||e.checkSelectAllClicked||e.isInteracted&&!e.parent.isPersistSelection)){if(e.parent.isPersistSelection)if("Intermediate"===e.getCheckAllStatus(e.parent.element.querySelector(".e-checkselectall")))for(c=0;c<e.selectedRecords.length;c++)e.updatePersistCollection(e.selectedRecords[c],!0);else e.parent.checkAllRows="Check",e.updatePersistSelectedData(!0);return void(e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1)))}for(var i=[].slice.call(r.filter(function(e){return e.hasAttribute("aria-selected")})),p=0;p<i.length;p++)e.disableUI&&!t.isBlazor()||(i[p].removeAttribute("aria-selected"),e.addRemoveClassesForRow(i[p],!1,!0,"e-selectionbackground","e-active")),e.isPrevRowSelection||e.updatePersistCollection(i[p],!1),e.updateCheckBoxes(i[p]);t.isBlazor()&&e.parent.isServerRendered&&e.parent.enableVirtualization&&e.getRenderer().setSelection(null,!1,!0);for(var c=0,u=e.selectedRowIndexes.length;c<u;c++){var g=e.getSelectedMovableRow(e.selectedRowIndexes[c]);g&&(e.disableUI&&!t.isBlazor()||(g.removeAttribute("aria-selected"),e.addRemoveClassesForRow(g,!1,!0,"e-selectionbackground","e-active")),e.updateCheckBoxes(g),e.isPrevRowSelection||e.updatePersistCollection(g,!1));var f=e.getSelectedFrozenRightRow(e.selectedRowIndexes[c]);f&&(e.disableUI||(f.removeAttribute("aria-selected"),e.addRemoveClassesForRow(f,!1,!0,"e-selectionbackground","e-active")),e.updateCheckBoxes(f),e.isPrevRowSelection||e.updatePersistCollection(f,!1))}e.selectedRowIndexes=[],e.selectedRecords=[],e.isRowSelected=!1,e.selectRowIndex(-1),e.isPrevRowSelection=!1,e.rowDeselect("rowDeselected",a,n,o,h,d,s,void 0,l),e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1))},l)}else this.clearRowCheck&&(this.clearRowCallBack(),this.clearRowCheck=!1,this.selectRowCheck&&(this.selectRowCallBack(),this.selectRowCheck=!1))},r.prototype.rowDeselect=function(e,i,r,n,o,s,l,a,h){var d=this;if(this.selectionSettings.persistSelection&&(this.isRowClicked||this.checkSelectAllClicked)||!this.selectionSettings.persistSelection){var p=1===i.length,c={rowIndex:i[0],data:this.selectionSettings.persistSelection&&"Uncheck"===this.parent.checkAllRows&&!p&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode?this.persistSelectedData:r,foreignKeyData:o,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked};"rowDeselected"===e&&delete c.cancel;if(!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid){c.row=n,c.target=this.actualTarget,this.actualTarget&&!t.isNullOrUndefined(t.closest(this.actualTarget,"thead"))||i.length>1?(c.rowIndex=i[0],c.rowIndexes=i):1===i.length&&(c.data=c.data[0],c.row=c.row[0],c.foreignKeyData=c.foreignKeyData[0],this.isAddRowsToSelection&&(c.rowIndexes=i))}else{c.rowIndex=c.rowIndex[c.rowIndex.length-1],c.data=c.data[c.data.length-1]}this.parent.trigger(e,t.isBlazor()&&!this.parent.isJsComponent||!this.parent.isFrozenGrid()?c:wr({},c,{mRow:l,frozenRightRow:h}),function(e){d.isCancelDeSelect=e.cancel,d.isCancelDeSelect&&(d.isRowClicked||d.isInteracted||d.checkSelectAllClicked)||(d.updatePersistCollection(n[0],!1),d.updateCheckBoxes(n[0],void 0,i[0]),l&&d.updateCheckBoxes(l[0],void 0,i[0]),h&&d.updateCheckBoxes(h[0],void 0,i[0])),void 0!==a&&a()})}else this.selectionSettings.persistSelection&&!this.isInteracted&&void 0!==a&&a()},r.prototype.getRowObj=function(e){return void 0===e&&(e=this.currentIndex),t.isNullOrUndefined(e)?{}:("number"==typeof e&&(e=this.parent.getRowByIndex(e)),e?this.parent.getRowObjectFromUID(e.getAttribute("data-uid"))||{}:{})},r.prototype.getSelectedMovableCell=function(e){var t=this.parent,i=t.getColumnByIndex(e.cellIndex);return t.isFrozenGrid()&&"movable"===i.getFreezeTableName()?t.getMovableCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex)):null},r.prototype.selectCell=function(e,i){if(this.isCellType()){var r,n=this.parent,o=this.getSelectedMovableCell(e);o||(o=n.getCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex))),this.currentIndex=e.rowIndex;var s=this.getCurrentBatchRecordChanges()[this.currentIndex];if(this.isCellType()&&o&&!this.isEditing()){var l=o.classList.contains("e-cellselectionbackground");if(i=i?!t.isUndefined(this.prevCIdxs)&&e.rowIndex===this.prevCIdxs.rowIndex&&e.cellIndex===this.prevCIdxs.cellIndex&&l:i)this.successCallBack(r,i,e,o,s)(r);else{if(r={data:s,cellIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,cancel:!1},!t.isBlazor()||this.parent.isJsComponent){r.currentCell=o;r.previousRowCellIndex=this.prevECIdxs}this.parent.trigger("cellSelecting",this.fDataUpdate(r),this.successCallBack(r,i,e,o,s)),this.cellselected=!0}}}},r.prototype.successCallBack=function(e,i,r,n,o){var s=this;return function(e){if((t.isNullOrUndefined(e)||!0!==e.cancel)&&(i||(e.currentCell=e.currentCell?e.currentCell:n),s.clearCell(),i||s.updateCellSelection(n,r.rowIndex,r.cellIndex),!i)){var l=void 0;if(!t.isBlazor()||s.parent.isJsComponent||s.parent.isHybrid){(l={data:o,cellIndex:r,currentCell:n,selectedRowCellIndex:s.selectedRowCellIndexes,previousRowCell:s.prevECIdxs?s.getCellIndex(s.prevECIdxs.rowIndex,s.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=s.prevECIdxs}else l={data:o,cellIndex:r,selectedRowCellIndex:s.selectedRowCellIndexes};s.updateCellProps(r,r),s.onActionComplete(l,"cellSelected")}}},r.prototype.getCellIndex=function(e,t){return this.parent.getFrozenColumns()&&t>=this.parent.getFrozenColumns()?this.parent.getMovableCellFromIndex(e,t):this.parent.getCellFromIndex(e,t)},r.prototype.selectCellsByRange=function(e,i){var r=this;if(this.isCellType()){var n=this.parent,o=this.getSelectedMovableCell(e),s=n.getFrozenColumns();o||(o=n.getCellFromIndex(e.rowIndex,e.cellIndex));var l,a,h,d=e,p=i=i||e;this.currentIndex=e.rowIndex;var c=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var u={data:c,cellIndex:e,currentCell:o,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};if(!t.isBlazor()){u.previousRowCellIndex=this.prevECIdxs}this.parent.trigger("cellSelecting",this.fDataUpdate(u),function(u){if(t.isNullOrUndefined(u)||!0!==u.cancel){if(r.clearCell(),e.rowIndex>i.rowIndex){var g=e;e=i,i=g}for(var f=e.rowIndex;f<=i.rowIndex;f++){r.selectionSettings.cellSelectionMode.indexOf("Box")<0?(l=f===e.rowIndex?e.cellIndex:0,a=f===i.rowIndex?i.cellIndex:r.getLastColIndex(f)):(l=e.cellIndex,a=i.cellIndex),h=[];for(var m=l<a?l:a,y=l>a?l:a;m<=y;m++)(o=s?m<s?n.getCellFromIndex(f,m):n.getMovableCellFromIndex(f,m):n.getCellFromIndex(f,m))&&(h.push(m),r.updateCellSelection(o),r.addAttribute(o));r.selectedRowCellIndexes.push({rowIndex:f,cellIndexes:h})}var v;if(!t.isBlazor()||r.parent.isJsComponent||r.parent.isHybrid){(v={data:c,cellIndex:p,currentCell:n.getCellFromIndex(p.rowIndex,p.cellIndex),selectedRowCellIndex:r.selectedRowCellIndexes,previousRowCell:r.prevECIdxs?r.getCellIndex(r.prevECIdxs.rowIndex,r.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=r.prevECIdxs}else v={data:c,cellIndex:p,selectedRowCellIndex:r.selectedRowCellIndexes};r.isDragged||(r.onActionComplete(v,"cellSelected"),r.cellselected=!0),r.updateCellProps(d,p)}})}}},r.prototype.selectCells=function(e){if(this.isCellType()){var i=this.parent,r=this.getSelectedMovableCell(e[0]),n=i.getFrozenColumns();r||(r=i.getCellFromIndex(e[0].rowIndex,e[0].cellIndexes[0])),this.currentIndex=e[0].rowIndex;var o=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var s;!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(s={data:o,cellIndex:e[0].cellIndexes[0],currentCell:r,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0})[c="previousRowCellIndex"]=this.prevECIdxs:s={data:o,cellIndex:e[0].cellIndexes[0],isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest},this.onActionBegin(s,"cellSelecting");for(var l=0,a=e.length;l<a;l++)for(var h=0,d=e[l].cellIndexes.length;h<d;h++)(r=n?e[l].cellIndexes[h]<n?i.getCellFromIndex(e[l].rowIndex,e[l].cellIndexes[h]):i.getMovableCellFromIndex(e[l].rowIndex,e[l].cellIndexes[h]):i.getCellFromIndex(e[l].rowIndex,e[l].cellIndexes[h]))&&(this.updateCellSelection(r),this.addAttribute(r),this.addRowCellIndex({rowIndex:e[l].rowIndex,cellIndex:e[l].cellIndexes[h]}));this.updateCellProps({rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]},{rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]});var p;if(!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid){var c="previousRowCellIndex";(p={data:o,cellIndex:e[0].cellIndexes[0],currentCell:r,selectedRowCellIndex:this.selectedRowCellIndexes,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0})[c]=this.prevECIdxs}else p={data:o,cellIndex:e[0].cellIndexes[0],selectedRowCellIndex:this.selectedRowCellIndexes};this.onActionComplete(p,"cellSelected")}}},r.prototype.addCellsToSelection=function(e){if(this.isCellType()){var i,r,n=this.parent;this.currentIndex=e[0].rowIndex;var o=this.getCurrentBatchRecordChanges()[this.currentIndex],s=n.getFrozenLeftCount(),l=n.getMovableColumnsCount();if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){this.hideAutoFill();var a,h=n.getColumnByIndex(e[0].cellIndex);Le(this.parent,function(t,i){a=i[e[0].rowIndex]},[h.getFreezeTableName()&&"frozen-left"!==h.getFreezeTableName()?[]:n.getRowsObject(),"movable"===h.getFreezeTableName()?n.getMovableRowsObject():[],"frozen-right"===h.getFreezeTableName()?n.getFrozenRightRowsObject():[]]);for(var d=[],p=0,c=e;p<c.length;p++){for(var u=c[p],g=0,f=this.selectedRowCellIndexes.length;g<f;g++)if(this.selectedRowCellIndexes[g].rowIndex===u.rowIndex){r=g;break}(i=this.getSelectedMovableCell(u))||(i=n.getCellFromIndex(u.rowIndex,this.getColIndex(u.rowIndex,u.cellIndex)));var m="movable"===h.getFreezeTableName()?u.cellIndex-s:"frozen-right"===h.getFreezeTableName()?u.cellIndex-(s+l):u.cellIndex;d.push(a.cells[m].foreignKeyData);var y=void 0;!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(y={cancel:!1,data:o,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,currentCell:i,isCtrlPressed:this.isMultiCtrlRequest,previousRowCell:this.prevECIdxs?n.getCellFromIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0})[b="previousRowCellIndex"]=this.prevECIdxs:y={cancel:!1,data:o,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,isCtrlPressed:this.isMultiCtrlRequest};var v=r>-1;if(v){var C=this.selectedRowCellIndexes[r].cellIndexes;C.indexOf(u.cellIndex)>-1?(this.cellDeselect("cellDeselecting",[{rowIndex:u.rowIndex,cellIndexes:[u.cellIndex]}],o,[i],d),C.splice(C.indexOf(u.cellIndex),1),0===C.length&&this.selectedRowCellIndexes.splice(r,1),i.classList.remove("e-cellselectionbackground"),i.removeAttribute("aria-selected"),this.cellDeselect("cellDeselected",[{rowIndex:u.rowIndex,cellIndexes:[u.cellIndex]}],o,[i],d)):(v=!1,this.onActionBegin(y,"cellSelecting"),this.addRowCellIndex({rowIndex:u.rowIndex,cellIndex:u.cellIndex}),this.updateCellSelection(i),this.addAttribute(i))}else{if(this.onActionBegin(y,"cellSelecting"),!t.isNullOrUndefined(y)&&!0===y.cancel)return;this.updateCellSelection(i,u.rowIndex,u.cellIndex)}if(!v){var w=void 0;if(!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid){var b="previousRowCellIndex";(w={data:o,cellIndex:e[0],currentCell:i,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,selectedRowCellIndex:this.selectedRowCellIndexes})[b]=this.prevECIdxs}else w={data:o,cellIndex:e[0],selectedRowCellIndex:this.selectedRowCellIndexes};this.onActionComplete(w,"cellSelected"),this.cellselected=!0}this.updateCellProps(u,u)}}}},r.prototype.getColIndex=function(e,t){var i=this.parent.isFrozenGrid(),r=this.parent.getColumnByIndex(t),n=He(this.parent,r,e);if(n)for(var o=0;o<n.length;o++)if(parseInt(n[o].getAttribute("aria-colindex"),10)===t)return i&&("movable"===r.getFreezeTableName()?o+=this.parent.getFrozenLeftCount():"frozen-right"===r.getFreezeTableName()&&(o+=this.parent.getFrozenLeftColumnsCount()+this.parent.getMovableColumnsCount())),o;return-1},r.prototype.getLastColIndex=function(e){var t=this.parent.getFrozenColumns()?this.parent.getMovableDataRows()[e].querySelectorAll("td.e-rowcell"):this.parent.getDataRows()[e].querySelectorAll("td.e-rowcell");return parseInt(t[t.length-1].getAttribute("aria-colindex"),10)},r.prototype.clearCell=function(){this.clearCellSelection()},r.prototype.cellDeselect=function(e,i,r,n,o){n[0]&&n[0].classList.contains("e-gridchkbox")&&this.updateCheckBoxes(t.closest(n[0],"tr"));var s={cells:n,data:r,cellIndexes:i,foreignKeyData:o,cancel:!1};this.parent.trigger(e,s),this.isPreventCellSelect=s.cancel},r.prototype.updateCellSelection=function(e,i,r){t.isNullOrUndefined(i)||this.addRowCellIndex({rowIndex:i,cellIndex:r}),e.classList.add("e-cellselectionbackground"),e.classList.contains("e-gridchkbox")&&this.updateCheckBoxes(t.closest(e,"tr"),!0),this.addAttribute(e)},r.prototype.addAttribute=function(e){this.target=e,t.isNullOrUndefined(e)||(e.setAttribute("aria-selected","true"),this.preventFocus||this.focus.onClick({target:e},!0))},r.prototype.updateCellProps=function(e,t){this.prevCIdxs=e,this.prevECIdxs=t,this.isCellSelected=this.selectedRowCellIndexes.length&&!0},r.prototype.addRowCellIndex=function(e){for(var t,i,r=0,n=this.selectedRowCellIndexes.length;r<n;r++)if(this.selectedRowCellIndexes[r].rowIndex===e.rowIndex){t=!0,i=r;break}t?this.selectedRowCellIndexes[i].cellIndexes.indexOf(e.cellIndex)<0&&this.selectedRowCellIndexes[i].cellIndexes.push(e.cellIndex):this.selectedRowCellIndexes.push({rowIndex:e.rowIndex,cellIndexes:[e.cellIndex]})},r.prototype.clearCellSelection=function(){if(this.isCellSelected){var e=this.parent,t=this.getSelectedCellsElement(),i=this.selectedRowCellIndexes,r=[],n=[],o=[],s=this.getCurrentBatchRecordChanges(),l=e.isFrozenGrid();this.hideAutoFill();for(var a=0,h=i.length;a<h;a++){r.push(s[i[a].rowIndex]);for(var d=this.getRowObj(i[a].rowIndex),p=0,c=i[a].cellIndexes.length;p<c;p++)if(l){var u=e.getColumnByIndex(i[a].cellIndexes[p]);n.push(Ue(this.parent,u,i[a].rowIndex,i[a].cellIndexes[p]))}else d.cells&&o.push(d.cells[i[a].cellIndexes[p]].foreignKeyData),n.push(e.getCellFromIndex(i[a].rowIndex,i[a].cellIndexes[p]))}if(this.cellDeselect("cellDeselecting",i,r,n,o),!0===this.isPreventCellSelect)return;for(var a=0,h=t.length;a<h;a++)t[a].classList.remove("e-cellselectionbackground"),t[a].removeAttribute("aria-selected");this.bdrElement&&this.showHideBorders("none"),this.selectedRowCellIndexes=[],this.isCellSelected=!1,!this.isDragged&&this.cellselected&&this.cellDeselect("cellDeselected",i,r,n,o)}},r.prototype.getSelectedCellsElement=function(){var e,t=this.parent,i=t.getDataRows();t.isFrozenGrid()&&(e=t.getMovableDataRows(),i=t.addMovableRows(i,e),"Left-Right"===t.getFrozenMode()&&(i=t.addMovableRows(i,t.getFrozenRightDataRows())));for(var r=[],n=0,o=i.length;n<o;n++)r=r.concat([].slice.call(i[n].querySelectorAll(".e-cellselectionbackground")));return r},r.prototype.mouseMoveHandler=function(e){e.preventDefault();var i,r=this.parent.element.getBoundingClientRect(),n=this.x,o=this.y,s=P(e),l=s.x-r.left,a=s.y-r.top,h=t.closest(e.target,"tr");if(this.isDragged=!0,this.isCellDrag||(h||(h=t.closest(document.elementFromPoint(this.parent.element.offsetLeft+2,e.clientY),"tr")),n>l&&(i=l,l=n,n=i),o>a&&(i=a,a=o,o=i),this.element.style.left=n+"px",this.element.style.top=o+"px",this.element.style.width=l-n+"px",this.element.style.height=a-o+"px"),h&&!e.ctrlKey&&!e.shiftKey){var d=parseInt(h.getAttribute("aria-rowindex"),10);if(this.isCellDrag){var p=O(e.target,"e-rowcell");p&&(this.startAFCell=this.startCell,this.endAFCell=O(e.target,"e-rowcell"),this.selectLikeExcel(e,d,parseInt(p.getAttribute("aria-colindex"),10)))}else this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,d)}},r.prototype.selectLikeExcel=function(e,t,i){this.isAutoFillSel?(this.showAFBorders(),this.selectLikeAutoFill(e)):(this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:i}),this.drawBorders())},r.prototype.drawBorders=function(){"BoxWithBorder"===this.selectionSettings.cellSelectionMode&&this.selectedRowCellIndexes.length&&!this.parent.isEdit?(this.parent.element.classList.add("e-enabledboxbdr"),this.bdrElement||this.createBorders(),this.positionBorders()):this.showHideBorders("none")},r.prototype.isLastCell=function(e){var t=[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"));return t[t.length-1]===e},r.prototype.isLastRow=function(e){var i=[].slice.call(t.closest(e,"tbody").querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===i[i.length-1]},r.prototype.isFirstRow=function(e){var i=[].slice.call(t.closest(e,"tbody").querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===i[0]},r.prototype.isFirstCell=function(e){return[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"))[0]===e},r.prototype.setBorders=function(e,t,i){var r=[].slice.call(e.querySelectorAll(".e-cellselectionbackground")).filter(function(e){return""===e.style.display});if(r.length){var n=this.parent.isFrozenGrid(),o=r[0],s=r[r.length-1],l=o.getBoundingClientRect(),a=s.getBoundingClientRect(),h=o.offsetParent.getBoundingClientRect(),d=!this.isLastRow(s)||"1"!==i&&"2"!==i&&"5"!==i?0:2,p=this.parent.frozenRows&&("1"===i||"2"===i)&&this.isFirstRow(o)?1.5:0,c=n&&("2"===i||"4"===i)&&this.isFirstCell(o)?1:0,u=("Right"!==this.parent.getFrozenMode()||"1"!==i&&"3"!==i)&&("Left-Right"!==this.parent.getFrozenMode()||"5"!==i&&"6"!==i)||!this.isFirstCell(o)?0:1;this.parent.enableRtl?(t.style.right=h.right-l.right-c+"px",t.style.width=l.right-a.left+c+1+"px"):(t.style.left=l.left-h.left-c-u+"px",t.style.width=a.right-l.left+c-u+1+"px"),t.style.top=l.top-h.top-p+"px",t.style.height=a.top-l.top>0?a.top-h.top+a.height+1-(l.top-h.top)-d+p+"px":a.height+p-d+1+"px",this.selectDirection+=i}else t.style.display="none"},r.prototype.positionBorders=function(){this.updateStartEndCells(),this.startCell&&this.bdrElement&&this.selectedRowCellIndexes.length&&(this.selectDirection="",this.showHideBorders(""),this.setBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.contentModule.getMovableContent(),this.mcBdrElement,"2"),"Left-Right"===this.parent.getFrozenMode()&&this.setBorders(this.parent.contentModule.getFrozenRightContent(),this.frcBdrElement,"5")),this.parent.frozenRows&&(this.setBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.headerModule.getMovableHeader(),this.mhBdrElement,"4"),"Left-Right"===this.parent.getFrozenMode()&&this.setBorders(this.parent.headerModule.getFrozenRightHeader(),this.frhBdrElement,"6"))),this.applyBorders(this.selectDirection))},r.prototype.applyBothFrozenBorders=function(e){var t=this.parent.enableRtl;switch(e.length){case 6:this.bdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.mcBdrElement.style.borderWidth="0 0 2px 0",this.fhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px",this.mhBdrElement.style.borderWidth="2px 0 0 0",this.frcBdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.frhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0";break;case 4:e.includes("1")&&e.includes("2")&&e.includes("3")&&e.includes("4")&&(this.bdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.mcBdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.fhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px",this.mhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0"),e.includes("2")&&e.includes("4")&&e.includes("5")&&e.includes("6")&&(this.mcBdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.mhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px",this.frcBdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.frhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0");break;case 3:this.bdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.mcBdrElement.style.borderWidth="2p 0 2px 0",this.frcBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.mhBdrElement.style.borderWidth="2px 0 2px 0",this.frcBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0");break;case 2:e.includes("1")&&(this.mcBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth="2px 2px 0 2px")),e.includes("2")&&(this.bdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.frcBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.parent.frozenRows&&(this.mhBdrElement.style.borderWidth="2px 2px 0 2px")),e.includes("3")&&(this.mhBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.bdrElement.style.borderWidth="0 2px 2px 2px"),e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.frhBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.mcBdrElement.style.borderWidth="0 2px 2px 2px"),e.includes("5")&&(this.mcBdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.parent.frozenRows&&(this.frhBdrElement.style.borderWidth="2px 2px 0 2px")),e.includes("6")&&(this.mhBdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.frcBdrElement.style.borderWidth="0 2px 2px 2px");break;default:this.bdrElement.style.borderWidth="2px",this.mcBdrElement.style.borderWidth="2px",this.frcBdrElement.style.borderWidth="2px",this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth="2px",this.mhBdrElement.style.borderWidth="2px",this.frhBdrElement.style.borderWidth="2px")}},r.prototype.applyBorders=function(e){var t=this.parent.enableRtl;if("Left-Right"===this.parent.getFrozenMode())this.applyBothFrozenBorders(e);else switch(e.length){case 4:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.mcBdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.fhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0",this.mhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px"):(this.bdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.mcBdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.fhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px",this.mhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0");break;case 2:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=e.includes("2")?t?"2px 0 2px 2px":"2px 2px 2px 0":"0 2px 2px 2px",this.mcBdrElement.style.borderWidth=e.includes("1")?t?"2px 2px 2px 0":"2px 0 2px 2px":"0 2px 2px 2px",this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=e.includes("1")?"2px 2px 0 2px":t?"2px 0 2px 2px":"2px 2px 2px 0",this.mhBdrElement.style.borderWidth=e.includes("2")?"2px 2px 0 2px":t?"2px 2px 2px 0":"2px 0 2px 2px")):(this.bdrElement.style.borderWidth=e.includes("2")?t?"2px 2px 2px 0":"2px 0 2px 2px":"0 2px 2px 2px",this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=e.includes("1")?t?"2px 0 2px 2px":"2px 2px 2px 0":"0 2px 2px 2px"),this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=e.includes("1")?"2px 2px 0 2px":t?"2px 2px 2px 0":"2px 0 2px 2px",this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth=e.includes("2")?"2px 2px 0 2px":t?"2px 0 2px 2px":"2px 2px 2px 0")));break;default:this.bdrElement.style.borderWidth="2px",this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth="2px"),this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth="2px",this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth="2px"))}},r.prototype.createBorders=function(){this.bdrElement||(this.bdrElement=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdr",styles:"width: 2px; border-width: 0;"})),this.parent.isFrozenGrid()&&(this.mcBdrElement=this.parent.contentModule.getMovableContent().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mcbdr",styles:"height: 2px; border-width: 0;"})),"Left-Right"===this.parent.getFrozenMode()&&(this.frcBdrElement=this.parent.contentModule.getFrozenRightContent().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frcbdr",styles:"height: 2px; border-width: 0;"})))),this.parent.frozenRows&&(this.fhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_fhbdr",styles:"height: 2px;"}))),this.parent.frozenRows&&this.parent.isFrozenGrid()&&(this.mhBdrElement=this.parent.headerModule.getMovableHeader().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mhbdr",styles:"height: 2px;"})),"Left-Right"===this.parent.getFrozenMode()&&(this.frhBdrElement=this.parent.headerModule.getFrozenRightHeader().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frhbdr",styles:"height: 2px;"})))))},r.prototype.showHideBorders=function(e){this.bdrElement&&(this.bdrElement.style.display=e,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.display=e,"Left-Right"===this.parent.getFrozenMode()&&(this.frcBdrElement.style.display=e)),this.parent.frozenRows&&(this.fhBdrElement.style.display=e),this.parent.frozenRows&&this.parent.isFrozenGrid()&&(this.mhBdrElement.style.display=e,"Left-Right"===this.parent.getFrozenMode()&&(this.frhBdrElement.style.display=e)))},r.prototype.drawAFBorders=function(){this.bdrAFBottom||this.createAFBorders(),this.positionAFBorders()},r.prototype.positionAFBorders=function(){if(this.startCell&&this.bdrAFLeft){var e=this.startAFCell.getBoundingClientRect(),t=this.endAFCell.getBoundingClientRect(),i=t.top-e.top>0?1:0,r=t.top-e.top>=0&&(O(this.startAFCell,"e-movablecontent")||O(this.startAFCell,"e-frozencontent"))&&this.isFirstRow(this.startAFCell)?1.5:0,n=(O(this.startAFCell,"e-movablecontent")||O(this.startAFCell,"e-movableheader"))&&this.isFirstCell(this.startAFCell)?1:0,o=this.isLastRow(this.endAFCell)&&(O(this.endAFCell,"e-movablecontent")||O(this.endAFCell,"e-frozencontent"))?2:0,s=this.startAFCell.offsetParent.getBoundingClientRect(),l=this.parent.element.getBoundingClientRect(),a=this.startAFCell.offsetParent.parentElement.scrollTop,h=this.startAFCell.offsetParent.parentElement.scrollLeft,d=a-this.startAFCell.offsetTop,p=h-this.startAFCell.offsetLeft,c=this.parent.element.clientHeight,u=this.parent.element.clientWidth;d=d>0?Math.floor(d)-1:0,p=p>0?p:0;var g=e.left-l.left;if(this.parent.enableRtl){var f=O(this.startAFCell,"e-movablecontent")||O(this.startAFCell,"e-movableheader")?e.right-this.startAFCell.offsetParent.parentElement.getBoundingClientRect().width-l.left:0;this.bdrAFLeft.style.right=l.right-t.right-2+t.width+"px",this.bdrAFLeft.style.width=u<=parseInt(this.bdrAFLeft.style.right,10)?"0px":"2px",this.bdrAFRight.style.right=l.right-e.right-n+f-1+"px",this.bdrAFTop.style.left=t.left-l.left-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFLeft.style.right,10)-parseInt(this.bdrAFRight.style.right,10)-n+1+"px",parseInt(this.bdrAFTop.style.left,10)<0&&(this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)+"px",this.bdrAFTop.style.left="0px")}else if(this.bdrAFLeft.style.left=g-n+p-1+"px",this.bdrAFRight.style.left=t.left-l.left-2+t.width+"px",this.bdrAFRight.style.width=u<=parseInt(this.bdrAFRight.style.left,10)?"0px":"2px",this.bdrAFTop.style.left=g+p-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFRight.style.left,10)-parseInt(this.bdrAFLeft.style.left,10)-n+1+"px",u<=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)){var m=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)-u;this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-m+"px"}if(this.bdrAFLeft.style.top=e.top-l.top-r+d+"px",this.bdrAFLeft.style.height=t.top-e.top>0?t.top-s.top+t.height+1-(e.top-s.top)+r-o-d+"px":t.height+r-o-d+"px",this.bdrAFRight.style.top=this.bdrAFLeft.style.top,this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px",this.bdrAFTop.style.top=this.bdrAFRight.style.top,this.bdrAFBottom.style.left=this.bdrAFTop.style.left,this.bdrAFBottom.style.top=parseFloat(this.bdrAFLeft.style.top)+parseFloat(this.bdrAFLeft.style.height)-i-1+"px",this.bdrAFBottom.style.width=c<=parseFloat(this.bdrAFBottom.style.top)?"0px":this.bdrAFTop.style.width,c<=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)){var y=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)-c;this.bdrAFLeft.style.height=parseInt(this.bdrAFLeft.style.height,10)-y+"px",this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px"}}},r.prototype.createAFBorders=function(){this.bdrAFLeft||(this.bdrAFLeft=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafleft",styles:"width: 2px;"})),this.bdrAFRight=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafright",styles:"width: 2px;"})),this.bdrAFBottom=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafbottom",styles:"height: 2px;"})),this.bdrAFTop=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdraftop",styles:"height: 2px;"})))},r.prototype.showAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="",this.bdrAFRight.style.display="",this.bdrAFBottom.style.display="",this.bdrAFTop.style.display="")},r.prototype.hideAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="none",this.bdrAFRight.style.display="none",this.bdrAFBottom.style.display="none",this.bdrAFTop.style.display="none")},r.prototype.updateValue=function(e,t,i){var r=this.createBeforeAutoFill(e,t,i);if(!r.cancel){var n=this.parent.getColumnByIndex(t);this.parent.editModule&&i&&("number"===n.type?this.parent.editModule.updateCell(e,n.field,parseInt(r.value,10)):this.parent.editModule.updateCell(e,n.field,r.value))}},r.prototype.createBeforeAutoFill=function(e,t,i){var r={column:this.parent.getColumnByIndex(t),value:i.innerText};return this.parent.trigger("beforeAutoFill",r),r},r.prototype.getAutoFillCells=function(e,t){var i=".e-cellselectionbackground",r=[].slice.call(this.parent.getDataRows()[e].querySelectorAll(i));return this.parent.isFrozenGrid()&&(r=r.concat([].slice.call(this.parent.getMovableDataRows()[e].querySelectorAll(i))),"Left-Right"===this.parent.getFrozenMode()&&(r=r.concat([].slice.call(this.parent.getFrozenRightDataRows()[e].querySelectorAll(i))))),r},r.prototype.selectLikeAutoFill=function(e,t){var i=parseInt(O(this.startAFCell,"e-row").getAttribute("aria-rowindex"),10),r=parseInt(this.startAFCell.getAttribute("aria-colindex"),10),n=parseInt(O(this.endAFCell,"e-row").getAttribute("aria-rowindex"),10),o=parseInt(this.endAFCell.getAttribute("aria-colindex"),10),s=this.selectedRowCellIndexes.length-1,l=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!O(e.target,"e-rowcell"):this.startAFCell=this.parent.getCellFromIndex(i,r),this.endAFCell=this.parent.getCellFromIndex(i+s,r+l),this.drawAFBorders();break;case this.autoFillRLselection&&r+l<o&&o-r-l+1>n-i-s&&o-r-l+1>i-n:if(this.endAFCell=this.parent.getCellFromIndex(i+s,o),n=parseInt(O(this.endAFCell,"e-row").getAttribute("aria-rowindex"),10),o=parseInt(this.endAFCell.getAttribute("aria-colindex"),10),t){for(var a=parseInt(this.endCell.getAttribute("aria-colindex"),10),h=i;h<=n;h++)for(var d=this.getAutoFillCells(h,r),p=0,c=a+1;c<=o;c++)p>l&&(p=0),this.updateValue(h,c,d[p]),p++;this.selectCellsByRange({rowIndex:i,cellIndex:this.startCellIndex},{rowIndex:n,cellIndex:o})}else this.drawAFBorders();break;case this.autoFillRLselection&&r>o&&r-o+1>n-i-s&&r-o+1>i-n:if(this.startAFCell=this.parent.getCellFromIndex(i,o),this.endAFCell=this.endCell,t){for(h=i;h<=i+s;h++){(d=this.getAutoFillCells(h,r)).reverse();for(var p=0,c=this.startCellIndex-1;c>=o;c--)p>l&&(p=0),this.updateValue(h,c,d[p]),p++}this.selectCellsByRange({rowIndex:i,cellIndex:o},{rowIndex:i+s,cellIndex:this.startCellIndex+l})}else this.drawAFBorders();break;case i>n:if(this.startAFCell=this.parent.getCellFromIndex(n,r),this.endAFCell=this.endCell,t){for(var u=g=parseInt(this.endCell.parentElement.getAttribute("aria-rowindex"),10),h=i-1;h>=n;h--){u===this.startIndex-1&&(u=g);var d=this.getAutoFillCells(u,r),p=0;u--;for(c=this.startCellIndex;c<=this.startCellIndex+l;c++)this.updateValue(h,c,d[p]),p++}this.selectCellsByRange({rowIndex:n,cellIndex:r+l},{rowIndex:i+s,cellIndex:r})}else this.drawAFBorders();break;default:if(this.endAFCell=this.parent.getCellFromIndex(n,r+l),t){for(var g=parseInt(this.endCell.parentElement.getAttribute("aria-rowindex"),10),u=this.startIndex,h=g+1;h<=n;h++){u===g+1&&(u=this.startIndex);d=this.getAutoFillCells(u,r);u++;for(var p=0,f=this.startCellIndex;f<=this.startCellIndex+l;f++)this.updateValue(h,f,d[p]),p++}this.selectCellsByRange({rowIndex:g-s,cellIndex:r},{rowIndex:n,cellIndex:r+l})}else this.drawAFBorders()}},r.prototype.mouseUpHandler=function(e){if(document.body.classList.remove("e-disableuserselect"),this.element&&t.remove(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=O(e.target,"e-rowcell"):this.mUPTarget=null,this.isDragged&&!this.isAutoFillSel&&"Cell"===this.selectionSettings.mode){var i=e.target,r=parseInt(i.parentElement.getAttribute("aria-rowindex"),10),n=parseInt(i.getAttribute("aria-colindex"),10);this.isDragged=!1,this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:r,cellIndex:n})}if(this.isDragged=!1,this.updateAutoFillPosition(),this.isAutoFillSel){var o=O(e.target,"e-rowcell");this.endAFCell=o||(this.endCell===this.endAFCell?this.startAFCell:this.endAFCell),this.startAFCell=this.startCell,this.updateStartCellsIndex(),this.selectLikeAutoFill(e,!0),this.updateAutoFillPosition(),this.hideAFBorders(),this.positionBorders(),this.isAutoFillSel=!1}t.EventHandler.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),this.parent.frozenRows&&t.EventHandler.remove(this.parent.getHeaderContent(),"mousemove",this.mouseMoveHandler),t.EventHandler.remove(document,"mouseup",this.mouseUpHandler)},r.prototype.hideAutoFill=function(){this.autofill&&(this.autofill.style.display="none")},r.prototype.updateAutoFillPosition=function(){if(this.parent.enableAutoFill&&!this.parent.isEdit&&this.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel()&&this.selectedRowCellIndexes.length){var e=parseInt(this.target.getAttribute("aria-colindex"),10),i=parseInt(this.target.getAttribute("index"),10),r=this.selectedRowCellIndexes[this.selectedRowCellIndexes.length-1].rowIndex,n=this.getAutoFillCells(r,e).filter(function(e){return""===e.style.display}),o=this.parent.getColumnByIndex(e),s="movable"===o.getFreezeTableName(),l=i<this.parent.frozenRows,a="Left-Right"===this.parent.getFrozenMode()&&"frozen-right"===o.getFreezeTableName();t.select("#"+this.parent.element.id+"_autofill",O(this.target,"e-table"))||(t.select("#"+this.parent.element.id+"_autofill",this.parent.element)&&t.select("#"+this.parent.element.id+"_autofill",this.parent.element).remove(),this.autofill=t.createElement("div",{className:"e-autofill",id:this.parent.element.id+"_autofill"}),this.autofill.style.display="none",l?s?this.parent.headerModule.getMovableHeader().appendChild(this.autofill):this.parent.getHeaderTable().parentElement.appendChild(this.autofill):s?this.parent.contentModule.getMovableContent().appendChild(this.autofill):this.parent.getContentTable().parentElement.appendChild(this.autofill),a&&(l?this.parent.getFrozenRightHeader().appendChild(this.autofill):this.parent.getFrozenRightContent().appendChild(this.autofill)));var h=n[n.length-1];if(h&&h.offsetParent){var d=h.getBoundingClientRect(),p=h.offsetParent.getBoundingClientRect(),c=this.isLastCell(h)?4:0,u=this.isLastRow(h)?3:0;this.parent.enableRtl?this.autofill.style.right=p.right-d.right+d.width-4-c+"px":this.autofill.style.left=d.left-p.left+d.width-4-c+"px",this.autofill.style.top=d.top-p.top+d.height-5-u+"px"}this.autofill.style.display=""}else this.hideAutoFill()},r.prototype.mouseDownHandler=function(e){this.mouseButton=e.button;var i,r=e.target,n=this.parent,o=O(r,"e-grid");if(!(o&&o.id!==n.element.id||O(r,"e-headercontent")&&!this.parent.frozenRows||O(r,"e-editedbatchcell")||O(r,"e-editedrow"))){if((e.shiftKey||e.ctrlKey)&&e.preventDefault(),O(r,"e-rowcell")&&!e.shiftKey&&!e.ctrlKey){if(n.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel())this.isCellDrag=!0,i=!0;else if(n.allowRowDragAndDrop&&!n.isEdit&&!this.parent.selectionSettings.checkboxOnly){if(!this.isRowType()||this.isSingleSel()||t.closest(r,"td").classList.contains("e-selectionbackground"))return void(this.isDragged=!1);i=!0,this.element=this.parent.createElement("div",{className:"e-griddragarea"}),n.getContent().appendChild(this.element)}i&&this.enableDrag(e,!0)}this.updateStartEndCells(),(r.classList.contains("e-autofill")||r.classList.contains("e-xlsel"))&&(this.isCellDrag=!0,this.isAutoFillSel=!0,this.enableDrag(e))}},r.prototype.updateStartEndCells=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-cellselectionbackground"));this.startCell=e[0],this.endCell=e[e.length-1],this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute("aria-rowindex"),10),this.startCellIndex=parseInt(O(this.startCell,"e-rowcell").getAttribute("aria-colindex"),10))},r.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute("aria-rowindex"),10),this.startCellIndex=parseInt(O(this.startCell,"e-rowcell").getAttribute("aria-colindex"),10))},r.prototype.enableDrag=function(e,i){var r=this.parent;if(i){var n=t.closest(e.target,"tr");this.startDIndex=parseInt(n.getAttribute("aria-rowindex"),10),this.startDCellIndex=parseInt(O(e.target,"e-rowcell").getAttribute("aria-colindex"),10)}document.body.classList.add("e-disableuserselect");var o=r.element.getBoundingClientRect(),s=P(e);this.x=s.x-o.left,this.y=s.y-o.top,t.EventHandler.add(r.getContent(),"mousemove",this.mouseMoveHandler,this),this.parent.frozenRows&&t.EventHandler.add(r.getHeaderContent(),"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)},r.prototype.clearSelAfterRefresh=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||this.parent.isPersistSelection||t||this.clearSelection()},r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Dt,this.enableAfterRender,this),this.parent.on(Tt,this.initializeSelection,this),this.parent.on("rowselected",this.onActionComplete,this),this.parent.on("cellselected",this.onActionComplete,this),this.parent.on(At,this.onPropertyChanged,this),this.parent.on("cellfocused",this.onCellFocused,this),this.parent.on("beforeFragAppend",this.clearSelAfterRefresh,this),this.parent.on(Vt,this.columnPositionChanged,this),this.parent.on(Mt,this.initialEnd,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(yt,this.actionBeginFunction),this.parent.addEventListener(vt,this.actionCompleteFunction),this.parent.on(_t,this.rowsRemoved,this),this.parent.on(Lt,this.refreshHeader,this),this.addEventListener_checkbox())},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Dt,this.enableAfterRender),this.parent.off(Tt,this.initializeSelection),this.parent.off("rowselected",this.onActionComplete),this.parent.off("cellselected",this.onActionComplete),this.parent.off(At,this.onPropertyChanged),this.parent.off("cellfocused",this.onCellFocused),this.parent.off("beforeFragAppend",this.clearSelAfterRefresh),this.parent.off(Vt,this.columnPositionChanged),this.parent.removeEventListener(yt,this.actionBeginFunction),this.parent.removeEventListener(vt,this.actionCompleteFunction),this.parent.off(_t,this.rowsRemoved),this.parent.off(Lt,this.refreshHeader),this.removeEventListener_checkbox())},r.prototype.wireEvents=function(){this.isMacOS=-1!==navigator.userAgent.indexOf("Mac OS"),this.isMacOS&&(t.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.parent.element,"keyup",this.keyUpHandler,this))},r.prototype.unWireEvents=function(){this.isMacOS&&(t.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.parent.element,"keyup",this.keyUpHandler))},r.prototype.columnPositionChanged=function(){this.parent.isPersistSelection||this.clearSelection()},r.prototype.refreshHeader=function(){this.setCheckAllState()},r.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)delete this.selectedRowState[e.records[t][this.primaryKey]],--this.totalRecordsCount;this.setCheckAllState()},r.prototype.beforeFragAppend=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||this.clearSelection()},r.prototype.getCheckAllBox=function(){return this.parent.getHeaderContent().querySelector(".e-checkselectall")},r.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.initPerisistSelection())},r.prototype.render=function(e){t.EventHandler.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler,this)},r.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){var i=this.parent;t.isNullOrUndefined(e.properties.type)||"Single"!==this.selectionSettings.type||(this.selectedRowCellIndexes.length>1&&(this.clearCellSelection(),this.prevCIdxs=void 0),this.selectedRowIndexes.length>1&&(this.clearRowSelection(),this.prevRowIndex=void 0),this.selectedColumnsIndexes.length>1&&(this.clearColumnSelection(),this.prevColIndex=void 0),this.enableSelectMultiTouch=!1,this.hidePopUp()),t.isNullOrUndefined(e.properties.mode)&&t.isNullOrUndefined(e.properties.cellSelectionMode)||(this.clearSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevColIndex=void 0),this.isPersisted=!0,this.checkBoxSelectionChanged(),this.isPersisted=!1,this.initPerisistSelection(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&(i.isCheckBoxSelection=!("ResetOnRowClick"===this.selectionSettings.checkboxMode)),this.drawBorders()}},r.prototype.hidePopUp=function(){this.parent.element.querySelector(".e-gridpopup").querySelectorAll(".e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},r.prototype.initialEnd=function(e){var t=this.parent.isFrozenGrid(),i="Left-Right"===this.parent.getFrozenMode();(!t||t&&!i&&!e.args.isFrozen||i&&e.args.renderFrozenRightContent)&&(this.parent.off(Mt,this.initialEnd),this.selectRow(this.parent.selectedRowIndex))},r.prototype.checkBoxSelectionChanged=function(){this.parent.off(Mt,this.checkBoxSelectionChanged);var e=this.parent,i=e.getColumns().filter(function(e){return"checkbox"===e.type});i.length>0&&(e.isCheckBoxSelection=!0,this.chkField=i[0].field,this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount,t.isNullOrUndefined(this.totalRecordsCount)&&(this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),this.isSingleSel()?(e.selectionSettings.type="Multiple",e.dataBind()):this.initPerisistSelection()),e.isCheckBoxSelection||this.isPersisted||(this.chkField=null,this.initPerisistSelection())},r.prototype.initPerisistSelection=function(){var e=this.parent;this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!0,this.ensureCheckboxFieldSelection()):this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!1,this.ensureCheckboxFieldSelection()):(e.isPersistSelection=!1,this.selectedRowState={})},r.prototype.ensureCheckboxFieldSelection=function(){var e=this.parent;if(this.primaryKey=this.parent.getPrimaryKeyFieldNames()[0],!e.enableVirtualization&&this.chkField&&(e.isPersistSelection&&0===Object.keys(this.selectedRowState).length||!e.isPersistSelection)){var t=this.parent.getDataModule(),r=(new i.Query).where(this.chkField,"equal",!0);r.params||(r.params=this.parent.query.params);var n=t.getData({},r),o=this;this.parent.showSpinner(),n.then(function(e){o.dataSuccess(e.result),o.refreshPersistSelection(),o.parent.hideSpinner()})}},r.prototype.dataSuccess=function(e){for(var i=0;i<e.length;i++)t.isNullOrUndefined(this.selectedRowState[e[i][this.primaryKey]])&&e[i][this.chkField]&&(this.selectedRowState[e[i][this.primaryKey]]=e[i][this.chkField]);this.persistSelectedData=e},r.prototype.setRowSelection=function(e){if(!this.parent.getDataModule().isRemote()&&!t.isBlazor())if(e)if(this.parent.groupSettings.columns.length)for(var i=0,r=this.getData().records;i<r.length;i++){s=r[i];this.selectedRowState[s[this.primaryKey]]=!0}else for(var n=0,o=this.getData();n<o.length;n++){var s=o[n];this.selectedRowState[s[this.primaryKey]]=!0}else this.selectedRowState={}},r.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},r.prototype.refreshPersistSelection=function(){var e=this.parent.getRows();if(this.parent.isCheckBoxSelection&&this.parent.isFrozenGrid()&&(this.parent.getMovableContentTbody().querySelector(".e-checkselect")&&(e=this.parent.getMovableRows()),"Left-Right"===this.parent.getFrozenMode()&&this.parent.getFrozenRightContentTbody().querySelector(".e-checkselect")&&(e=this.parent.getFrozenRightRows())),this.totalRecordsCount=this.parent.getCurrentViewRecords().length,this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),null!==e&&e.length>0&&(this.parent.isPersistSelection||this.chkField)){for(var i=[],r=0;r<e.length;r++){var n=this.getRowObj(e[r]),o=n&&n.data?n.data[this.primaryKey]:null;if(null===o)return;var s=void 0,l=e[r].querySelector(".e-checkselect");this.selectedRowState[o]||"Check"===this.parent.checkAllRows&&this.totalRecordsCount===Object.keys(this.selectedRowState).length&&this.chkAllCollec.indexOf(o)<0||"Uncheck"===this.parent.checkAllRows&&this.chkAllCollec.indexOf(o)>0||"Intermediate"===this.parent.checkAllRows&&!t.isNullOrUndefined(this.chkField)&&n.data[this.chkField]?(i.push(parseInt(e[r].getAttribute("aria-rowindex"),10)),s=!0):(s=!1,this.checkedTarget!==l&&this.parent.isCheckBoxSelection&&oe(l.nextElementSibling,s)),this.updatePersistCollection(e[r],s)}this.isSingleSel()&&i.length>0?this.selectRow(i[0],!0):this.selectRows(i)}this.parent.isCheckBoxSelection&&this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState()},r.prototype.actionBegin=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){var i=this.parent.element.querySelector(".e-edit-checkselect");if(!t.isNullOrUndefined(i)){var r=t.closest(i,".e-editedrow");if(r){"Dialog"===this.parent.editSettings.mode&&(r=this.parent.element.querySelector(".e-dlgeditrow"));var n=this.getRowObj(r);if(!n)return;this.selectedRowState[n.data[this.primaryKey]]=n.isSelected=i.checked}else this.isCheckedOnAdd=i.checked}}},r.prototype.actionComplete=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){if("add"===e.action&&this.isCheckedOnAdd){var i=this.parent.getRowObjectFromUID(this.parent.getRows()[e.selectedRow].getAttribute("data-uid"));this.selectedRowState[i.data[this.primaryKey]]=i.isSelected=this.isCheckedOnAdd}this.refreshPersistSelection()}if("delete"===e.requestType&&this.parent.isPersistSelection){for(var r=[],n=(r=t.isBlazor()?this.getSelectedRecords():e.data).slice(),o=0;o<n.length;o++)t.isNullOrUndefined(n[o][this.primaryKey])||this.updatePersistDelete(n[o][this.primaryKey]);this.setCheckAllState(),this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount}"paging"===e.requestType&&(this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0)},r.prototype.onDataBound=function(){if(!this.parent.enableVirtualization&&this.parent.isPersistSelection&&(this.selectedRecords.length&&(this.isPrevRowSelection=!0),this.refreshPersistSelection()),this.parent.enableVirtualization&&this.setCheckAllState(),this.parent.isCheckBoxSelection&&!this.initialRowSelection){for(var e=this.parent.getRowsObject(),t=[],i=0;i<e.length;i++)e[i].isSelected&&t.push(i);t.length&&this.selectRows(t),this.initialRowSelection=!0}},r.prototype.updatePersistSelectedData=function(e){if(this.parent.isPersistSelection){for(var i=this.parent.getRows(),r=0;r<i.length;r++)this.updatePersistCollection(i[r],e);"Uncheck"===this.parent.checkAllRows?(this.setRowSelection(!1),this.persistSelectedData=this.parent.getDataModule().isRemote()?this.persistSelectedData:[]):"Check"===this.parent.checkAllRows&&(this.setRowSelection(!0),this.persistSelectedData=this.parent.getDataModule().isRemote()||t.isBlazor()?this.persistSelectedData:this.parent.groupSettings.columns.length?this.getData().records.slice():this.getData().slice())}},r.prototype.checkSelectAllAction=function(e){var i=this.getRenderer(),r=this.parent.element.querySelector(".e-gridform");if(this.checkedTarget=this.getCheckAllBox(),e&&this.getCurrentBatchRecordChanges().length?(this.parent.checkAllRows="Check",this.updatePersistSelectedData(e),t.isBlazor()&&this.parent.enableVirtualization&&!t.isNullOrUndefined(this.parent.contentModule.currentInfo.endIndex)?this.selectRowsByRange(this.parent.contentModule.currentInfo.startIndex,this.parent.contentModule.currentInfo.endIndex):this.selectRowsByRange(i.getVirtualRowIndex(0),i.getVirtualRowIndex(this.getCurrentBatchRecordChanges().length-1))):(this.parent.checkAllRows="Uncheck",this.updatePersistSelectedData(e),this.clearSelection()),this.chkAllCollec=[],!t.isNullOrUndefined(r)){var n=r.querySelector(".e-edit-checkselect");t.isNullOrUndefined(n)||oe(n.nextElementSibling,e)}},r.prototype.checkSelectAll=function(e){var i=this,r=this.getCheckAllStatus(e),n="Check"===r;if(this.isHeaderCheckboxClicked=!0,"Intermediate"===r&&(n=this.getCurrentBatchRecordChanges().some(function(e){return e[i.primaryKey]in i.selectedRowState})),this.parent.isPersistSelection&&this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),this.checkSelectAllAction(!n),t.isBlazor()&&this.parent.isServerRendered&&this.parent.enableVirtualization){if(this.parent.interopAdaptor.invokeMethodAsync("MaintainSelection",!n,"checkbox",null),this.checkBoxState=!n,!n){var o=this.parent.contentModule.vgenerator.rowCache;Object.values(o).forEach(function(e){return e.isSelected=!0});for(var s=0;s<Object.keys(o).length;s++)-1===this.parent.selectionModule.selectedRowIndexes.indexOf(Number(Object.keys(o)[s]))&&this.parent.selectionModule.selectedRowIndexes.push(Number(Object.keys(o)[s]))}}this.target=null,this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState(),this.triggerChkChangeEvent(e,!n)},r.prototype.getCheckAllStatus=function(e){var t=e?e.nextElementSibling.classList:this.getCheckAllBox().nextElementSibling.classList;return t.contains("e-check")?"Check":t.contains("e-uncheck")?"Uncheck":t.contains("e-stop")?"Intermediate":"None"},r.prototype.checkSelect=function(e){var i=t.closest(this.checkedTarget,".e-rowcell"),r=this.parent;this.isMultiCtrlRequest=!0;var n=0;if(this.isHeaderCheckboxClicked=!1,pe(r)){var o=i.parentElement.getAttribute("data-uid");n=r.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(o)}else n=parseInt(i.parentElement.getAttribute("aria-rowindex"),10);this.parent.isPersistSelection&&this.parent.element.querySelectorAll(".e-addedrow").length>0&&"Top"===this.parent.editSettings.newRowPosition&&++n,this.rowCellSelectionHandler(n,parseInt(i.getAttribute("aria-colindex"),10)),this.moveIntoUncheckCollection(t.closest(i,".e-row")),this.setCheckAllState(),this.isMultiCtrlRequest=!1,this.triggerChkChangeEvent(e,e.nextElementSibling.classList.contains("e-check"))},r.prototype.moveIntoUncheckCollection=function(e){if("Check"===this.parent.checkAllRows||"Uncheck"===this.parent.checkAllRows){var t=this.getRowObj(e),i=t&&t.data?t.data[this.primaryKey]:null;if(!i)return;this.chkAllCollec.indexOf(i)<0?this.chkAllCollec.push(i):this.chkAllCollec.splice(this.chkAllCollec.indexOf(i),1)}},r.prototype.triggerChkChangeEvent=function(e,t){this.parent.trigger("checkBoxChange",{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e}),this.parent.isEdit||(this.checkedTarget=null)},r.prototype.updateSelectedRowIndex=function(e){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.getDataModule().isRemote()&&(!t.isBlazor()||!this.parent.isServerRendered))if("Check"===this.parent.checkAllRows){this.selectedRowIndexes=[];for(var i=this.getData().length,r=0;r<i;r++)this.selectedRowIndexes.push(r)}else if("Uncheck"===this.parent.checkAllRows)this.selectedRowIndexes=[];else if(e&&"false"===this.parent.getRowByIndex(e).getAttribute("aria-selected")){var n=this.selectedRowIndexes.indexOf(e);this.selectedRowIndexes.splice(n,1)}},r.prototype.setCheckAllState=function(e,i){if(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode){var r=void 0,n=t.isBlazor()&&this.parent.isServerRendered&&this.parent.enableVirtualization;if(n){r=!Object.values(this.parent.contentModule.vgenerator.rowCache).filter(function(e){return void 0===e.isSelected||!1===e.isSelected}).length&&Object.values(this.parent.contentModule.vgenerator.rowCache).filter(function(e){return e.isSelected}).length===this.selectedRowIndexes.length}var o=Object.keys(this.selectedRowState).length;this.parent.isPersistSelection||n||(o=this.selectedRowIndexes.length,this.totalRecordsCount=this.getCurrentBatchRecordChanges().length);var s=this.getCheckAllBox();if(s){var l=s.nextElementSibling;t.removeClass([l],["e-check","e-stop","e-uncheck"]),re(s,!1),s.indeterminate=!1,r||o===this.totalRecordsCount&&this.totalRecordsCount||!(!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.allowPaging||this.parent.getDataModule().isRemote()||t.isBlazor()&&this.parent.isServerRendered||o!==this.getData().length)?(t.addClass([l],["e-check"]),re(s,!0),i&&this.getRenderer().setSelection(null,!0,!0),this.parent.checkAllRows="Check"):n&&!this.selectedRowIndexes.length||0===o&&!n||0===this.getCurrentBatchRecordChanges().length?(t.addClass([l],["e-uncheck"]),i&&this.getRenderer().setSelection(null,!1,!0),this.parent.checkAllRows="Uncheck",0===o&&0===this.getCurrentBatchRecordChanges().length?t.addClass([l.parentElement],["e-checkbox-disabled"]):t.removeClass([l.parentElement],["e-checkbox-disabled"])):(t.addClass([l],["e-stop"]),this.parent.checkAllRows="Intermediate",s.indeterminate=!0),!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.allowPaging||this.parent.getDataModule().isRemote()||this.updateSelectedRowIndex(e)}}},r.prototype.keyDownHandler=function(e){(("chrome"===t.Browser.info.name||"safari"===t.Browser.info.name)&&(91===e.keyCode||93===e.keyCode)||"opera"===t.Browser.info.name&&17===e.keyCode||"mozilla"===t.Browser.info.name&&224===e.keyCode)&&(this.cmdKeyPressed=!0)},r.prototype.keyUpHandler=function(e){(("chrome"===t.Browser.info.name||"safari"===t.Browser.info.name)&&(91===e.keyCode||93===e.keyCode)||"opera"===t.Browser.info.name&&17===e.keyCode||"mozilla"===t.Browser.info.name&&224===e.keyCode)&&(this.cmdKeyPressed=!1)},r.prototype.clickHandler=function(e){var i=e.target;this.actualTarget=i,(O(i,"e-row")||O(i,"e-headerchkcelldiv")||this.selectionSettings.allowColumnSelection&&i.classList.contains("e-headercell"))&&(this.isInteracted=!0),this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch||this.isMacOS&&this.cmdKeyPressed,this.isMultiShiftRequest=e.shiftKey,this.popUpClickHandler(e);var r=!1;this.preventFocus=!0;var n,o=O(i,"e-checkbox-wrapper");if(this.checkSelectAllClicked=!!(o&&o.querySelectorAll(".e-checkselectall")||this.selectionSettings.persistSelection&&O(i,"e-row")),o&&o.querySelectorAll(".e-checkselect,.e-checkselectall").length>0&&(n=o.querySelector('input[type="checkbox"]'),r=!0),this.drawBorders(),this.updateAutoFillPosition(),(i=O(i,"e-rowcell"))&&i.parentElement.classList.contains("e-row")&&!this.parent.selectionSettings.checkboxOnly||r){if(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=i,t.isNullOrUndefined(n)){var s=this.parent,l=0;if(pe(s)){a=i.parentElement.getAttribute("data-uid");l=s.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(a)}else l=parseInt(i.parentElement.getAttribute("aria-rowindex"),10);this.parent.isPersistSelection&&this.parent.element.querySelectorAll(".e-addedrow").length>0&&++l,this.mUPTarget&&this.mUPTarget.isEqualNode(i)||this.rowCellSelectionHandler(l,parseInt(i.getAttribute("aria-colindex"),10)),this.parent.hoverFrozenRows(e),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection(t.closest(i,".e-row")),this.setCheckAllState())}else this.checkedTarget=n,n.classList.contains("e-checkselectall")?this.checkSelectAll(n):this.checkSelect(n);this.parent.isCheckBoxSelection||!t.Browser.isDevice||this.isSingleSel()||this.showPopup(e)}else if(e.target.classList.contains("e-headercell")&&!e.target.classList.contains("e-stackedheadercell")){var a=e.target.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");this.headerSelectionHandler(this.parent.getColumnIndexByUid(a))}this.isMultiCtrlRequest=!1,this.isMultiShiftRequest=!1,t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))&&(this.preventFocus=!1)},r.prototype.popUpClickHandler=function(e){var i=e.target;t.closest(i,".e-headercell")||e.target.classList.contains("e-rowcell")||t.closest(i,".e-gridpopup")?i.classList.contains("e-rowselect")&&(i.classList.contains("e-spanclicked")?(i.classList.remove("e-spanclicked"),this.enableSelectMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(i.classList.add("e-spanclicked"),this.enableSelectMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},r.prototype.showPopup=function(e){this.selectionSettings.enableSimpleMultiRowSelection||E(this.parent.element.querySelector(".e-gridpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(!this.isSingleSel()&&(this.selectedRecords.length>(this.parent.getFrozenColumns()?2:1)||this.selectedRowCellIndexes.length>1)?" e-spanclicked":""))},r.prototype.rowCellSelectionHandler=function(e,i){this.parent;if(!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel())this.isDragged||this.selectRow(e,this.selectionSettings.enableToggle),this.selectCell({rowIndex:e,cellIndex:i},this.selectionSettings.enableToggle),this.selectedRowCellIndexes.length&&this.updateAutoFillPosition(),this.drawBorders();else if(this.isMultiShiftRequest)this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!t.closest(this.target,".e-rowcell").classList.contains("e-gridchkbox")?this.selectRowsByRange(t.isUndefined(this.prevRowIndex)?e:this.prevRowIndex,e):this.addRowsToSelection([e]),this.selectCellsByRange(t.isUndefined(this.prevCIdxs)?{rowIndex:e,cellIndex:i}:this.prevCIdxs,{rowIndex:e,cellIndex:i}),this.updateAutoFillPosition(),this.drawBorders();else{if(this.addRowsToSelection([e]),t.isBlazor()&&this.parent.enableVirtualization&&this.parent.isServerRendered){var r=this.parent.getSelectedRowIndexes();this.parent.interopAdaptor.invokeMethodAsync("MaintainSelection",!0,"normal",r)}this.addCellsToSelection([{rowIndex:e,cellIndex:i}]),this.showHideBorders("none")}this.isDragged=!1},r.prototype.onCellFocused=function(e){if(this.parent.frozenRows&&e.container.isHeader&&e.byKey)if("upArrow"===e.keyArgs.action)this.parent.allowFiltering?e.isJump="INPUT"===e.element.tagName:e.isJump="TH"===e.element.tagName;else if("downArrow"===e.keyArgs.action){var i=Number(e.element.parentElement.getAttribute("aria-rowindex"));e.isJump=0===i}else"ctrlHome"===e.keyArgs.action&&(e.isJump=!0);var r=this.parent.isFrozenGrid()?(e.container.isHeader&&"TD"!==e.element.tagName&&e.isJump&&!this.selectionSettings.allowColumnSelection||(e.container.isContent||"TD"===e.element.tagName)&&!(e.container.isSelectable||"TD"===e.element.tagName))&&!(e.byKey&&"space"===e.keyArgs.action):(e.container.isHeader&&e.isJump||e.container.isContent&&!e.container.isSelectable)&&!(e.byKey&&"space"===e.keyArgs.action)&&!(e.element.classList.contains("e-detailrowexpand")||e.element.classList.contains("e-detailrowcollapse")),n=e.container.isHeader&&"TD"!==e.element.tagName&&!t.closest(e.element,".e-rowcell")&&!(e.byKey&&"space"===e.keyArgs.action);if(!e.byKey||r)return void(r&&!this.parent.isCheckBoxSelection&&this.clearSelection());var o=e.container.isContent?e.container.indexes:e.indexes,s=o[0],l=o[1],a=this.focus.getPrevIndexes();if(this.parent.frozenRows)if(e.container.isHeader&&("TD"===e.element.tagName||t.closest(e.element,".e-rowcell"))){var h=this.parent.getHeaderTable().querySelector("thead").childElementCount;s-=h,a.rowIndex=t.isNullOrUndefined(a.rowIndex)?null:a.rowIndex-h}else s+=this.parent.frozenRows,a.rowIndex=0!==a.rowIndex&&t.isNullOrUndefined(a.rowIndex)?null:a.rowIndex+this.parent.frozenRows;if(this.parent.isFrozenGrid()){var d=Number(e.element.getAttribute("aria-colindex")),p=this.parent.getSelectedRowCellIndexes();p.length&&0===a.cellIndex&&(a.cellIndex=p[p.length-1].cellIndexes[0]),a.cellIndex=t.isNullOrUndefined(a.cellIndex)?null:a.cellIndex===l?d:d-1,l=d}if(!(n||-1===["ctrlPlusA","escape"].indexOf(e.keyArgs.action)&&"space"!==e.keyArgs.action&&s===a.rowIndex&&l===a.cellIndex)||this.selectionSettings.allowColumnSelection){this.preventFocus=!0;var c=this.getKeyColIndex(e);switch(this.needColumnSelection&&(l=c),e.keyArgs.action){case"downArrow":case"upArrow":case"enter":case"shiftEnter":this.target=e.element,this.applyDownUpKey(s,l);break;case"rightArrow":case"leftArrow":this.applyRightLeftKey(s,l);break;case"shiftDown":case"shiftUp":this.shiftDownKey(s,l);break;case"shiftLeft":case"shiftRight":this.applyShiftLeftRightKey(s,l);break;case"home":case"end":l="end"===e.keyArgs.action?this.getLastColIndex(s):0,this.applyHomeEndKey(s,l);break;case"ctrlHome":case"ctrlEnd":this.applyCtrlHomeEndKey(s,l);break;case"escape":this.clearSelection();break;case"ctrlPlusA":this.ctrlPlusA();break;case"space":this.applySpaceSelection(e.element);break;case"tab":this.parent.editSettings.allowNextRowEdit&&this.selectRow(s)}this.needColumnSelection=!1,this.preventFocus=!1,this.positionBorders(),this.updateAutoFillPosition()}},r.prototype.getKeyColIndex=function(e){var t,i=null,r=e.element.querySelector(".e-stackedheadercelldiv");if(this.selectionSettings.allowColumnSelection&&O(e.element,"e-columnheader"))if(this.needColumnSelection=!!e.container.isHeader,r){if("rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)return i;t=r.getAttribute("e-mappinguid");var n=this.getstackedColumns(this.parent.getColumnByUid(t).columns),o=this.parent.getColumnIndexByUid(n[n.length-1].uid),s=this.parent.getColumnIndexByUid(n[0].uid);i=this.prevColIndex>=o?s:o}else i=this.parent.getColumnIndexByUid(e.element.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));return i},r.prototype.ctrlPlusA=function(){this.isRowType()&&!this.isSingleSel()&&this.selectRowsByRange(0,this.getCurrentBatchRecordChanges().length-1),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange({rowIndex:0,cellIndex:0},{rowIndex:this.parent.getRows().length-1,cellIndex:this.parent.getColumns().length-1})},r.prototype.applySpaceSelection=function(e){e.classList.contains("e-checkselectall")?(this.checkedTarget=e,this.checkSelectAll(this.checkedTarget)):e.classList.contains("e-checkselect")&&(this.checkedTarget=e,this.checkSelect(this.checkedTarget))},r.prototype.applyDownUpKey=function(e,t){var i=this.parent;this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&!this.selectionSettings.persistSelection&&(this.checkSelectAllAction(!1),this.checkedTarget=null),this.isRowType()&&(this.parent.frozenRows,this.selectRow(e,!0),this.applyUpDown(i.selectedRowIndex)),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0),this.selectionSettings.allowColumnSelection&&this.needColumnSelection&&this.selectColumn(t)},r.prototype.applyUpDown=function(e){if(!(e<0)){this.target||(this.target=this.parent.getRows()[0].children[this.parent.groupSettings.columns.length||0]);var t=parseInt(this.target.getAttribute("aria-colindex"),10),i=this.parent.getFrozenColumns();this.target=i&&t>=i?this.contentRenderer.getMovableRowByIndex(e).querySelectorAll(".e-rowcell")[t-i]:this.contentRenderer.getRowByIndex(e).querySelectorAll(".e-rowcell")[t],this.addAttribute(this.target)}},r.prototype.applyRightLeftKey=function(e,t){this.parent;this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumn(t):this.isCellType()&&(this.selectCell({rowIndex:e,cellIndex:t},!0),this.addAttribute(this.target))},r.prototype.applyHomeEndKey=function(e,t){this.isCellType()?this.selectCell({rowIndex:e,cellIndex:t},!0):this.addAttribute(this.parent.getCellFromIndex(e,t))},r.prototype.shiftDownKey=function(e,i){this.parent;this.isMultiShiftRequest=!0,this.isRowType()&&!this.isSingleSel()&&(t.isUndefined(this.prevRowIndex)?this.selectRow(0,!0):(this.selectRowsByRange(this.prevRowIndex,e),this.applyUpDown(e))),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange(this.prevCIdxs||{rowIndex:0,cellIndex:0},{rowIndex:e,cellIndex:i}),this.isMultiShiftRequest=!1},r.prototype.applyShiftLeftRightKey=function(e,t){this.parent;this.isMultiShiftRequest=!0,this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumnsByRange(this.prevColIndex,t):this.selectCellsByRange(this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},r.prototype.getstackedColumns=function(e){for(var t=[],i=0,r=e.length;i<r;i++)e[i].columns?this.getstackedColumns(e[i].columns):t.push(e[i]);return t},r.prototype.applyCtrlHomeEndKey=function(e,t){this.isRowType()&&(this.selectRow(e,!0),this.addAttribute(this.parent.getCellFromIndex(e,t))),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0)},r.prototype.addRemoveClassesForRow=function(e,t,i){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];if(e){var o=[].slice.call(e.querySelectorAll(".e-rowcell")),s=e.querySelector(".e-detailrowcollapse")||e.querySelector(".e-detailrowexpand"),l=e.querySelector(".e-rowdragdrop");s&&o.push(s),l&&o.push(l),$.apply(void 0,[o,t].concat(r))}this.getRenderer().setSelection(e?e.getAttribute("data-uid"):null,t,i)},r.prototype.isRowType=function(){return"Row"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},r.prototype.isCellType=function(){return"Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},r.prototype.isSingleSel=function(){return"Single"===this.selectionSettings.type},r.prototype.getRenderer=function(){return t.isNullOrUndefined(this.contentRenderer)&&(this.contentRenderer=this.factory.getRenderer(e.RenderType.Content)),this.contentRenderer},r.prototype.getSelectedRecords=function(){return this.selectionSettings.persistSelection?this.persistSelectedData:this.parent.getRowsObject().filter(function(e){return e.isSelected}).map(function(e){return e.data})},r.prototype.selectColumn=function(e){var i=this.parent;if(!t.isNullOrUndefined(i.getColumns()[e])){var r=i.getColumnByIndex(e),n=i.getColumnHeaderByUid(r.uid),o=n.classList.contains("e-columnselection");if(i.selectionSettings.allowColumnSelection){var s=this.selectedColumnsIndexes.length>1&&this.selectedColumnsIndexes.indexOf(e)>-1;if(this.clearColDependency(),!o||!this.selectionSettings.enableToggle||s){var l={columnIndex:e,headerCell:n,column:r,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(l,"columnSelecting"),l.cancel)return void this.disableInteracted();i.selectionSettings.enableToggle&&e===this.prevColIndex&&o&&!s||this.updateColSelection(n,e);var a={columnIndex:e,headerCell:n,column:r,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(a,"columnSelected")}this.updateColProps(e)}}},r.prototype.selectColumnsByRange=function(e,i){var r=this.parent;if(!t.isNullOrUndefined(r.getColumns()[e])){var n=[];if("Single"===r.selectionSettings.type||t.isNullOrUndefined(i))n[0]=e;else for(var o=e<i,s=e;o?s<=i:s>=i;o?s++:s--)n.push(s);this.selectColumns(n)}},r.prototype.selectColumns=function(e){var t=this.parent,i=this.getselectedCols();if("Single"===t.selectionSettings.type&&(e=[e[0]]),t.selectionSettings.allowColumnSelection){this.clearColDependency();var r={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(r,"columnSelecting"),r.cancel)return void this.disableInteracted();for(var n=0,o=e.length;n<o;n++)this.updateColSelection(t.getColumnHeaderByUid(t.getColumnByIndex(e[n]).uid),e[n]);i=this.getselectedCols();var s={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(s,"columnSelected"),this.updateColProps(e[0])}},r.prototype.selectColumnWithExisting=function(e){var i=this.parent;if(!t.isNullOrUndefined(i.getColumns()[e])){var r=i.getFrozenColumns(),n=r&&e>=r,o=i.getColumnHeaderByUid(i.getColumnByIndex(e).uid),s=this.getselectedCols();if("Single"===i.selectionSettings.type&&this.clearColDependency(),i.selectionSettings.allowColumnSelection){n?i.getMovableRows():i.getDataRows();if(this.selectedColumnsIndexes.indexOf(e)>-1)this.clearColumnSelection(e);else{var l={columnIndex:e,headerCell:s,columnIndexes:this.selectedColumnsIndexes,column:i.getColumnByIndex(e),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(l,"columnSelecting"),l.cancel)return void this.disableInteracted();this.updateColSelection(o,e);var a={columnIndex:e,headerCell:s=this.getselectedCols(),column:i.getColumnByIndex(e),columnIndexes:this.selectedColumnsIndexes,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(a,"columnSelected")}this.updateColProps(e)}}},r.prototype.clearColumnSelection=function(e){if(this.isColumnSelected){var i=this.parent;if(!t.isNullOrUndefined(e)&&-1===this.selectedColumnsIndexes.indexOf(e))return;var r=t.isNullOrUndefined(e)?this.selectedColumnsIndexes[this.selectedColumnsIndexes.length-1]:e,n=i.getColumnByIndex(r),o=void 0,s=i.getColumnByIndex(r),l={columnIndex:r,headerCell:o="frozen-right"===n.getFreezeTableName()?i.getFrozenRightColumnHeaderByIndex(r):"movable"===n.getFreezeTableName()?i.getMovableColumnHeaderByIndex(r):i.getColumnHeaderByUid(s.uid),columnIndexes:this.selectedColumnsIndexes,column:s,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted};if(this.columnDeselect(l,"columnDeselecting"))return void this.disableInteracted();for(var a=t.isNullOrUndefined(e)?[].slice.call(i.getHeaderContent().querySelectorAll(".e-columnselection")):[o],h=this.getSelectedColumnCells(e),d=0,p=a.length;d<p;d++)$([a[d]],!1,"e-columnselection");for(var d=0,p=h.length;d<p;d++)$([h[d]],!1,"e-columnselection");t.isNullOrUndefined(e)?(this.columnDeselect(l,"columnDeselected"),this.selectedColumnsIndexes=[],this.isColumnSelected=!1,this.parent.getColumns().filter(function(e){return e.isSelected=!1})):(this.selectedColumnsIndexes.splice(this.selectedColumnsIndexes.indexOf(e),1),this.parent.getColumns()[e].isSelected=!1)}},r.prototype.getselectedCols=function(){var e,t=this.parent;if(this.selectedColumnsIndexes.length>1){e=[];for(var i=0;i<this.selectedColumnsIndexes.length;i++)e.push(t.getColumnHeaderByUid(t.getColumnByIndex(this.selectedColumnsIndexes[i]).uid))}else e=t.getColumnHeaderByUid(t.getColumnByIndex(this.selectedColumnsIndexes[0]).uid);return e},r.prototype.getSelectedColumnCells=function(e){var i,r,n=this.parent,o=!t.isNullOrUndefined(this.parent.rowTemplate),s=o?n.getRows():n.getDataRows();n.isFrozenGrid()&&n.getContent().querySelector(".e-movablecontent")&&(i=o?n.getMovableRows():n.getMovableDataRows(),s=n.addMovableRows(s,i),"Left-Right"===n.getFrozenMode()&&(r=o?n.getFrozenRightRows():n.getFrozenRightDataRows(),s=n.addMovableRows(s,r)));for(var l=[],a=t.isNullOrUndefined(e)?".e-columnselection":'[aria-colindex="'+e+'"]',h=0,d=s.length;h<d;h++)l=l.concat([].slice.call(s[h].querySelectorAll(a)));return l},r.prototype.columnDeselect=function(e,t){return"columnDeselected"===t&&delete e.cancel,this.onActionComplete(e,t),e.cancel},r.prototype.updateColProps=function(e){this.prevColIndex=e,this.isColumnSelected=this.selectedColumnsIndexes.length&&!0},r.prototype.clearColDependency=function(){this.clearColumnSelection(),this.selectedColumnsIndexes=[]},r.prototype.updateColSelection=function(e,i){if(!t.isNullOrUndefined(this.parent.getColumns()[i])){var r,n=this.parent.getFrozenLeftCount(),o=this.parent.getMovableColumnsCount(),s=this.parent.getColumnByIndex(i),l=!t.isNullOrUndefined(this.parent.rowTemplate);this.selectedColumnsIndexes.push(i),this.parent.getColumns()[i].isSelected=!0,"frozen-right"===s.getFreezeTableName()?(i-=n+o,r=l?this.parent.getFrozenRightRows():this.parent.getFrozenRightDataRows()):"movable"===s.getFreezeTableName()?(i-=n,r=l?this.parent.getMovableRows():this.parent.getMovableDataRows()):(i+=this.parent.getIndentCount(),r=l?this.parent.getRows():this.parent.getDataRows()),$([e],!0,"e-columnselection");for(var a=0,h=r.length;a<h;a++)r[a].classList.contains("e-row")&&(!r[a].classList.contains("e-editedrow")&&!r[a].classList.contains("e-addedrow")||"Normal"!==this.parent.editSettings.mode||t.isNullOrUndefined(r[a].querySelector("tr").childNodes[i])?t.isNullOrUndefined(r[a].childNodes[i])||$([r[a].childNodes[i]],!0,"e-columnselection"):$([r[a].querySelector("tr").childNodes[i]],!0,"e-columnselection"))}},r.prototype.headerSelectionHandler=function(e){!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?this.selectColumn(e):this.isMultiShiftRequest?this.selectColumnsByRange(t.isUndefined(this.prevColIndex)?e:this.prevColIndex,e):this.selectColumnWithExisting(e)},r.prototype.addEventListener_checkbox=function(){var e=this;this.parent.on(Et,this.dataReady,this),this.onDataBoundFunction=this.onDataBound.bind(this),this.parent.addEventListener(Ct,this.onDataBoundFunction),this.parent.on(Mt,this.checkBoxSelectionChanged,this),this.parent.on("before-refresh-on-data-change",this.initPerisistSelection,this),this.parent.on(Ot,this.setCheckAllForEmptyGrid,this),this.actionCompleteFunc=this.actionCompleteHandler.bind(this),this.parent.addEventListener(vt,this.actionCompleteFunc),this.parent.on(Ht,this.clickHandler,this),this.resizeEndFn=function(){e.updateAutoFillPosition(),e.drawBorders()},this.resizeEndFn.bind(this),this.parent.addEventListener("resizeStop",this.resizeEndFn)},r.prototype.removeEventListener_checkbox=function(){this.parent.off(Et,this.dataReady),this.parent.removeEventListener(Ct,this.onDataBoundFunction),this.parent.removeEventListener(vt,this.actionCompleteFunc),this.parent.off(Ot,this.setCheckAllForEmptyGrid),this.parent.off(Ht,this.clickHandler),this.parent.off("before-refresh-on-data-change",this.initPerisistSelection)},r.prototype.setCheckAllForEmptyGrid=function(){var e=this.getCheckAllBox();if(e){this.parent.isCheckBoxSelection=!0;var i=e.nextElementSibling;t.removeClass([i],["e-check","e-stop","e-uncheck"])}},r.prototype.dataReady=function(e){this.isHeaderCheckboxClicked=!1;var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||this.parent.isPersistSelection||t||(this.disableUI=!this.parent.enableImmutableMode,this.clearSelection(),this.setCheckAllState(),this.disableUI=!1)},r.prototype.actionCompleteHandler=function(e){"save"===e.requestType&&this.parent.isPersistSelection&&this.refreshPersistSelection()},r.prototype.selectRowIndex=function(e){this.parent.isSelectedRowIndexUpdating=!0,this.parent.selectedRowIndex=e},r.prototype.disableInteracted=function(){this.isInteracted=!1},r.prototype.activeTarget=function(){this.actualTarget=this.isInteracted?this.actualTarget:null},r}(),Sr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.search=function(e){var i=this.parent;if(e=t.isNullOrUndefined(e)?"":e,J(i))return void i.notify(Zt,{instance:this,handler:this.search,arg1:e});e!==i.searchSettings.key?(i.searchSettings.key=e.toString(),i.dataBind()):this.refreshSearch&&i.refresh()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(At,this.onPropertyChanged,this),this.parent.on("searching-complete",this.onSearchComplete,this),this.parent.on(Ut,this.destroy,this),this.actionCompleteFunc=this.onActionComplete.bind(this),this.parent.addEventListener(vt,this.actionCompleteFunc),this.parent.on("cancel-Begin",this.cancelBeginEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(At,this.onPropertyChanged),this.parent.off("searching-complete",this.onSearchComplete),this.parent.off(Ut,this.destroy),this.parent.removeEventListener(vt,this.actionCompleteFunc),this.parent.off("cancel-Begin",this.cancelBeginEvent))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(t.isNullOrUndefined(e.properties.key)?this.parent.notify(Bt,{requestType:"searching",type:yt}):this.parent.notify(Bt,{requestType:"searching",type:yt,searchString:this.parent.searchSettings.key}))},e.prototype.onSearchComplete=function(e){t.isBlazor()&&!this.parent.isJsComponent&&(e.rows=null),this.parent.trigger(vt,t.extend(e,{searchString:this.parent.searchSettings.key,requestType:"searching",type:vt}))},e.prototype.onActionComplete=function(e){this.refreshSearch="searching"!==e.requestType},e.prototype.cancelBeginEvent=function(e){"searching"===e.requestType&&this.parent.setProperties({searchSettings:{key:""}},!0)},e.prototype.getModuleName=function(){return"search"},e}(),xr=function(){function e(e){this.parent=e}return e.prototype.show=function(e,t){var i=this.getToggleFields(e),r=this.getColumns(i,t);this.parent.notify("tooltip-destroy",{module:"edit"});for(var n=0;n<r.length;n++)r[n].visible=!0;this.setVisible(r)},e.prototype.hide=function(e,t){var i=this.getToggleFields(e),r=this.getColumns(i,t);this.parent.notify("tooltip-destroy",{module:"edit"});for(var n=0;n<r.length;n++)r[n].visible=!1;this.setVisible(r)},e.prototype.getToggleFields=function(e){return"string"==typeof e?[e]:e},e.prototype.getColumns=function(e,t){var i=this;return S(e,function(e,r){return S(i.parent.columnModel,function(i,r){if(i[t]===e)return i})[0]})},e.prototype.setVisible=function(e,i){var r=this;void 0===i&&(i=[]);var n={requestType:"columnstate",cancel:!1,columns:i=i.length>0?i:t.isBlazor()?JSON.parse(JSON.stringify(e)):e};this.parent.trigger(yt,n,function(n){var o=r.parent.getColumns();if(e=t.isNullOrUndefined(e)?o:e,n.cancel)return r.parent.notify("reset-columns",{showHideArgs:n}),void(e.length>0&&(e[0].visible=!0));pe(r.parent)&&r.parent.contentModule.emptyVcRows(),r.parent.allowSelection&&r.parent.getSelectedRecords().length&&!r.parent.selectionSettings.persistSelection&&r.parent.clearSelection(),r.parent.enableColumnVirtualization?e.filter(function(e){return o.some(function(t){return e.field===t.field})}).length&&r.parent.notify(jt,e):r.parent.notify(jt,e);var s={requestType:"columnstate",columns:i};r.parent.trigger(vt,s),"All"!==r.parent.columnQueryMode&&r.parent.refresh()})},e}(),Rr=function(){function e(e){this.lastScrollTop=0,this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new rr(e),this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(e){this.parent.element.style.width=t.formatUnit(this.parent.width),e&&this.widthService.setWidthToColumns(),this.parent.toolbarModule&&this.parent.toolbarModule.toolbar&&this.parent.toolbarModule.toolbar.element&&this.parent.toolbarModule.toolbar.refreshOverflow()},e.prototype.setHeight=function(){var i=0,r=this.parent.getContent().querySelector(".e-content"),n=this.parent.height;if(this.parent.isFrozenGrid()&&"auto"!==this.parent.height&&this.parent.height.toString().indexOf("%")<0&&(n=parseInt(n,10)-e.getScrollBarWidth()),!this.parent.enableVirtualization&&this.parent.frozenRows&&"auto"!==this.parent.height){var o=this.parent.getHeaderContent().querySelector("tbody");i=o?o.offsetHeight:0,o&&i&&(i-=o.querySelectorAll(".e-addedrow").length*this.parent.getRowHeight()),r.style.height=t.formatUnit(n-i)}else r.style.height=t.formatUnit(n);this.ensureOverflow(r),this.parent.isFrozenGrid()&&this.refresh()},e.prototype.setPadding=function(){var t=this.parent.getHeaderContent(),i=e.getScrollBarWidth()-this.getThreshold(),r=this.getCssProperties(),n="Right"===this.parent.getFrozenMode()||"Left-Right"===this.parent.getFrozenMode()?"0.5px":"1px";t.querySelector(".e-headercontent").style[r.border]=i>0?n:"0px",t.style[r.padding]=i>0?i+"px":"0px"},e.prototype.removePadding=function(e){var t=this.getCssProperties(e),i=this.parent.getHeaderContent().querySelector(".e-headercontent");i.style[t.border]="",i.parentElement.style[t.padding]="";var r=this.parent.getFooterContent();r&&r.classList.contains("e-footerpadding")&&r.classList.remove("e-footerpadding")},e.prototype.refresh=function(){if("100%"===this.parent.height){var e=this.parent.getContent();this.parent.element.style.height="100%";var t=this.widthService.getSiblingsHeight(e);e.style.height="calc(100% - "+t+"px)",this.parent.isFrozenGrid()&&(e.firstElementChild.style.height="calc(100% - "+j()+"px)")}},e.prototype.getThreshold=function(){return"mozilla"===t.Browser.info.name?.5:1},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ot,this.wireEvents,this),this.parent.on(Mt,this.wireEvents,this),this.parent.on(Dt,this.onPropertyChanged,this),this.parent.on("textWrapRefresh",this.wireEvents,this),this.parent.on(Lt,this.setScrollLeft,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ot,this.wireEvents),this.parent.off(Mt,this.wireEvents),this.parent.off(Dt,this.onPropertyChanged),this.parent.off("textWrapRefresh",this.wireEvents),this.parent.off(Lt,this.setScrollLeft))},e.prototype.setScrollLeft=function(){this.parent.isFrozenGrid()?this.parent.headerModule.getMovableHeader().scrollLeft=this.previousValues.left:this.parent.getHeaderContent().querySelector(".e-headercontent").scrollLeft=this.previousValues.left},e.prototype.onFrozenContentScroll=function(){var e=this;return function(i){null===e.content.querySelector("tbody")||e.parent.isPreventScrollEvent||(!t.isNullOrUndefined(e.parent.infiniteScrollModule)&&e.parent.enableInfiniteScrolling&&e.parent.notify("infinite-scroll-handler",i),e.previousValues.top=i.target.scrollTop)}},e.prototype.onContentScroll=function(e){var i=this,r=e,n=r.classList.contains("e-headercontent");return function(e){if(null!==i.content.querySelector("tbody")&&!i.parent.isPreventScrollEvent){var o=e.target,s=o.scrollLeft;if(!t.isNullOrUndefined(i.parent.infiniteScrollModule)&&i.parent.enableInfiniteScrolling&&i.parent.notify("infinite-scroll-handler",{target:e.target,isLeft:i.previousValues.left!==s}),i.parent.groupSettings.columns.length&&i.parent.groupSettings.enableLazyLoading){var l=i.previousValues.top<i.parent.getContent().firstElementChild.scrollTop;i.parent.notify("lazy-load-scroll-handler",{scrollDown:l})}i.parent.notify("virtual-scroll-edit",{});o.scrollWidth;var a=o.classList.contains("e-summarycontent");if(i.previousValues.left===s)return void(i.previousValues.top=n?o.scrollTop:i.previousValues.top);i.parent.notify("close-filter-dialog",e),r.scrollLeft=s,a&&(i.header.scrollLeft=s),i.previousValues.left=s,i.parent.notify("scroll",{left:s})}}},e.prototype.onCustomScrollbarScroll=function(e,t){var i=this,r=e,n=t;return function(e){if(null!==i.content.querySelector("tbody")){var t=e.target.scrollLeft;i.previousValues.left!==t&&(r.scrollLeft=t,n.scrollLeft=t,i.previousValues.left=t,i.parent.notify("scroll",{left:t}),i.parent.isDestroyed)}}},e.prototype.onTouchScroll=function(e){var t=this,i=e;return function(e){if("mouse"!==e.pointerType){var r=t.parent.isFrozenGrid(),n=t.getPointXY(e),o=i.scrollLeft+(t.pageXY.x-n.x),s=r?t.parent.getHeaderContent().querySelector(".e-movableheader"):t.parent.getHeaderContent().querySelector(".e-headercontent"),l=r?t.parent.getContent().querySelector(".e-movablecontent"):t.parent.getContent().querySelector(".e-content");t.previousValues.left===o||o<0||s.scrollWidth-s.clientWidth<o||(e.preventDefault(),s.scrollLeft=o,l.scrollLeft=o,r&&(t.parent.getContent().querySelector(".e-movablescrollbar").scrollLeft=o),t.pageXY.x=n.x,t.previousValues.left=o)}}},e.prototype.setPageXY=function(){var e=this;return function(t){"mouse"!==t.pointerType&&(e.pageXY=e.getPointXY(t))}},e.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},e.prototype.wireEvents=function(){var e=this;if(this.oneTimeReady){var i=this.parent.isFrozenGrid();this.content=this.parent.getContent().querySelector(".e-content"),this.header=this.parent.getHeaderContent().querySelector(".e-headercontent");var r=this.content.querySelector(".e-movablecontent"),n=(this.content.querySelector(".e-frozencontent"),this.header.querySelector(".e-movableheader")),o=this.parent.getContent().querySelector(".e-movablescrollbar");this.parent.frozenRows&&(t.EventHandler.add(i?n:this.header,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(i?n:this.header,"touchmove pointermove",this.onTouchScroll(i?r:this.content),this)),this.parent.isFrozenGrid()?(t.EventHandler.add(o,"scroll",this.onCustomScrollbarScroll(r,n),this),t.EventHandler.add(r,"scroll",this.onCustomScrollbarScroll(o,n),this),t.EventHandler.add(n,"scroll",this.onCustomScrollbarScroll(o,r),this),t.EventHandler.add(this.content,"scroll",this.onFrozenContentScroll(),this),t.EventHandler.add(n,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(n,"touchmove pointermove",this.onTouchScroll(r),this),t.EventHandler.add(r,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(r,"touchmove pointermove",this.onTouchScroll(n),this)):(t.EventHandler.add(this.content,"scroll",this.onContentScroll(this.header),this),t.EventHandler.add(this.header,"scroll",this.onContentScroll(this.content),this)),this.parent.aggregates.length&&t.EventHandler.add(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll(this.content),this),this.refresh(),this.oneTimeReady=!1}var s,l,a,h=this.parent.getContentTable();m(function(){s=e.header.scrollLeft,l=h.scrollHeight,a=e.parent.getContent().clientHeight},function(){var i={cancel:!1};e.parent.notify("check-scroll-reset",i),e.parent.enableVirtualization||e.parent.enableInfiniteScrolling||(l<a&&(t.addClass(h.querySelectorAll("tr:last-child td"),"e-lastrowcell"),e.parent.isFrozenGrid()&&t.addClass(e.parent.getContent().querySelector(".e-movablecontent").querySelectorAll("tr:last-child td"),"e-lastrowcell")),i.cancel||((e.parent.frozenRows>0||e.parent.isFrozenGrid())&&e.header.querySelector(".e-movableheader")?e.header.querySelector(".e-movableheader").scrollLeft=e.previousValues.left:e.header.scrollLeft=e.previousValues.left,e.content.scrollLeft=e.previousValues.left,e.content.scrollTop=e.previousValues.top)),e.parent.enableColumnVirtualization||(e.content.scrollLeft=s),e.parent.isFrozenGrid()&&e.header.querySelector(".e-movableheader")&&(e.header.querySelector(".e-movableheader").scrollLeft=e.content.querySelector(".e-movablecontent").scrollLeft)}),this.parent.isPreventScrollEvent=!1},e.prototype.getCssProperties=function(e){var i={},r=t.isNullOrUndefined(e)?this.parent.enableRtl:e;return i.border=r?"borderLeftWidth":"borderRightWidth",i.padding=r?"paddingLeft":"paddingRight",i},e.prototype.ensureOverflow=function(e){e.style.overflowY="auto"===this.parent.height?"auto":"scroll"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){this.setPadding(),this.oneTimeReady=!0,"auto"===this.parent.height&&this.removePadding(),this.wireEvents(),this.setHeight();this.setWidth(!t.isNullOrUndefined(e.properties.width))}},e.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))){this.removeEventListener(),this.removePadding();var i=this.parent.getContent().querySelector(".e-content");t.removeClass([this.parent.getHeaderContent().querySelector(".e-headercontent")],"e-headercontent"),t.removeClass([i],"e-content"),i.style.height="",this.parent.element.style.width="",t.EventHandler.remove(i,"scroll",this.onContentScroll)}},e.getScrollBarWidth=function(){return j()},e}(),Fr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zr=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Ir=function(i){function r(){var e=null!==i&&i.apply(this,arguments)||this;return e.templateFn={},e}return Fr(r,i),r.prototype.setFormatter=function(e){this.formatFn=e},r.prototype.getFormatter=function(){return this.formatFn},r.prototype.setTemplate=function(i){void 0===i&&(i={}),void 0!==this.footerTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.Summary)]={fn:t.compile(this.footerTemplate,i),property:"footerTemplate"}),void 0!==this.groupFooterTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.GroupSummary)]={fn:t.compile(this.groupFooterTemplate,i),property:"groupFooterTemplate"}),void 0!==this.groupCaptionTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.CaptionSummary)]={fn:t.compile(this.groupCaptionTemplate,i),property:"groupCaptionTemplate"})},r.prototype.getTemplate=function(i){return this.templateFn[t.getEnumValue(e.CellType,i)]},r.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},zr([t.Property()],r.prototype,"type",void 0),zr([t.Property()],r.prototype,"field",void 0),zr([t.Property()],r.prototype,"columnName",void 0),zr([t.Property()],r.prototype,"format",void 0),zr([t.Property()],r.prototype,"footerTemplate",void 0),zr([t.Property()],r.prototype,"groupFooterTemplate",void 0),zr([t.Property()],r.prototype,"groupCaptionTemplate",void 0),zr([t.Property()],r.prototype,"customAggregate",void 0),r}(t.ChildProperty),Tr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Fr(i,e),zr([t.Collection([],Ir)],i.prototype,"columns",void 0),i}(t.ChildProperty),Er=function(){function e(e){this.copyContent="",this.isSelect=!1,this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Mt,this.initialEnd,this),this.parent.on(qt,this.keyDownHandler,this),this.parent.on(Ht,this.clickHandler,this),t.EventHandler.add(this.parent.element,"keydown",this.pasteHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(qt,this.keyDownHandler),this.parent.off(Mt,this.initialEnd),this.parent.off(Ht,this.clickHandler),t.EventHandler.remove(this.parent.element,"keydown",this.pasteHandler))},e.prototype.clickHandler=function(e){var t=e.target;t=O(t,"e-rowcell")},e.prototype.pasteHandler=function(e){var i=this,r=this.parent,n=/(Mac)/i.test(navigator.platform);if(86===e.keyCode&&(e.ctrlKey||n&&e.metaKey)&&!r.isEdit){if(!t.closest(document.activeElement,".e-rowcell")||!r.editSettings.allowEditing||"Batch"!==r.editSettings.mode||"Cell"!==r.selectionSettings.mode||"Flow"===r.selectionSettings.cellSelectionMode)return;this.activeElement=document.activeElement,this.clipBoardTextArea.value="";var o=window.scrollX,s=window.scrollY;this.clipBoardTextArea.focus(),setTimeout(function(){i.activeElement.focus(),window.scrollTo(o,s),i.paste(i.clipBoardTextArea.value,i.parent.getSelectedRowCellIndexes()[0].rowIndex,i.parent.getSelectedRowCellIndexes()[0].cellIndexes[0])},10)}},e.prototype.paste=function(e,i,r){var n,o,s,l=this.parent,a=r,h=i;if(l.editSettings.allowEditing&&"Batch"===l.editSettings.mode&&"Cell"===l.selectionSettings.mode&&"Flow"!==l.selectionSettings.cellSelectionMode){var d,p,c,u=e.split("\n"),g=l.getDataRows(),f=this.parent.isFrozenGrid();f&&(p=l.getMovableDataRows(),l.getFrozenRightColumnsCount()&&(c=l.getFrozenRightDataRows()));for(var m=0;m<u.length;m++){if(d=u[m].split("\t"),a=r,m===u.length-1&&""===u[m]||t.isUndefined(l.getRowByIndex(h))){a++;break}for(var y=0;y<d.length;y++){if(s=l.getCellFromIndex(h,a),f){var v=g[h],C=p[h];s=!!v.querySelector('[aria-colindex="'+a+'"]')||C.querySelector('[aria-colindex="'+a+'"]'),c&&!s&&(s=c[h].querySelector('[aria-colindex="'+a+'"]'))}if(!s){a++;break}if(n=l.getColumnByIndex(a),o=n.getParser()?n.getParser()(d[y]):d[y],n.allowEditing&&!n.isPrimaryKey&&!n.template){var w={column:n,data:o,rowIndex:h};this.parent.trigger("beforePaste",w),h=w.rowIndex,w.cancel||l.editModule&&("number"===n.type?this.parent.editModule.updateCell(h,n.field,parseFloat(w.data)):l.editModule.updateCell(h,n.field,w.data))}a++}h++}l.selectionModule.selectCellsByRange({rowIndex:i,cellIndex:r},{rowIndex:h-1,cellIndex:a-1});var b=this.parent.getCellFromIndex(h-1,a-1);b&&t.classList(b,["e-focus","e-focused"],[])}},e.prototype.initialEnd=function(){this.parent.off(Mt,this.initialEnd),this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",styles:"opacity: 0",attrs:{tabindex:"-1","aria-label":"clipboard"}}),this.parent.element.appendChild(this.clipBoardTextArea)},e.prototype.keyDownHandler=function(e){"ctrlPlusC"===e.action?this.copy():"ctrlShiftPlusH"===e.action&&this.copy(!0)},e.prototype.setCopyData=function(e){if(""===window.getSelection().toString()){var i=this.parent.isFrozenGrid();this.clipBoardTextArea.value=this.copyContent="";var r=void 0,n=void 0,o=this.parent.getRows();if(i&&(r=this.parent.getMovableDataRows(),"Left-Right"===this.parent.getFrozenMode()&&(n=this.parent.getFrozenRightRows())),"Cell"!==this.parent.selectionSettings.mode){var s=this.parent.getSelectedRowIndexes().sort(function(e,t){return e-t});if(e){for(var l=[],a=0;a<this.parent.getVisibleColumns().length;a++)l[a]=this.parent.getVisibleColumns()[a].headerText;this.getCopyData(l,!1,"\t",e),this.copyContent+="\n"}for(a=0;a<s.length;a++){a>0&&(this.copyContent+="\n");p=[].slice.call(o[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)"));i&&(p.push.apply(p,[].slice.call(r[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)"))),n&&p.push.apply(p,[].slice.call(n[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)")))),this.getCopyData(p,!1,"\t",e)}}else{var h=this.checkBoxSelection();if(h.status){if(e){for(var d=[],a=0;a<h.colIndexes.length;a++)d.push(this.parent.getColumnHeaderByIndex(h.colIndexes[a]));this.getCopyData(d,!1,"\t",e),this.copyContent+="\n"}for(a=0;a<h.rowIndexes.length;a++){a>0&&(this.copyContent+="\n");var p=[].slice.call(o[h.rowIndexes[a]].querySelectorAll(".e-cellselectionbackground"));i&&(p.push.apply(p,[].slice.call(r[h.rowIndexes[a]].querySelectorAll(".e-cellselectionbackground"))),n&&p.push.apply(p,[].slice.call(n[h.rowIndexes[a]].querySelectorAll(".e-cellselectionbackground")))),this.getCopyData(p,!1,"\t",e)}}else this.getCopyData([].slice.call(this.parent.element.querySelectorAll(".e-cellselectionbackground")),!0,"\n",e)}var c={data:this.copyContent,cancel:!1};if(this.parent.trigger("beforeCopy",c),c.cancel)return;this.clipBoardTextArea.value=this.copyContent=c.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0}},e.prototype.getCopyData=function(e,i,r,n){for(var o="string"!=typeof e[0],s=0;s<e.length;s++)n&&i&&(this.copyContent+=this.parent.getColumns()[parseInt(e[s].getAttribute("aria-colindex"),10)].headerText+"\n"),o?e[s].classList.contains("e-hide")||(t.isBlazor()?!e[s].classList.contains("e-gridchkbox")&&Object.keys(e[s].querySelectorAll(".e-check")).length?this.copyContent+=!0:!e[s].classList.contains("e-gridchkbox")&&Object.keys(e[s].querySelectorAll(".e-uncheck")).length?this.copyContent+=!1:this.copyContent+=e[s].innerText:this.copyContent+=e[s].innerText):this.copyContent+=e[s],s<e.length-1&&(this.copyContent+=r)},e.prototype.copy=function(e){document.queryCommandSupported("copy")&&(this.setCopyData(e),document.execCommand("copy"),this.clipBoardTextArea.blur()),this.isSelect&&(window.getSelection().removeAllRanges(),this.isSelect=!1)},e.prototype.getModuleName=function(){return"clipboard"},e.prototype.destroy=function(){this.removeEventListener(),this.clipBoardTextArea&&t.remove(this.clipBoardTextArea)},e.prototype.checkBoxSelection=function(){var e=this.parent,t={status:!1};if("Cell"===e.selectionSettings.mode){var i=e.getSelectedRowCellIndexes(),r=void 0,n=[],o=void 0;for(o=0;o<i.length&&(i[o].cellIndexes.length&&n.push(i[o].rowIndex),!i[o].cellIndexes.length||(r||(r=JSON.stringify(i[o].cellIndexes.sort())),r===JSON.stringify(i[o].cellIndexes.sort())));o++);n.sort(function(e,t){return e-t}),o===i.length&&n[n.length-1]-n[0]==n.length-1&&(t={status:!0,rowIndexes:n,colIndexes:i[0].cellIndexes})}return t},e}(),Mr=new t.Observer,Dr=function(){function r(e){this.aria=new Ei,this.actionArgs={},this.virtualHeight=0,this.parent=e,this.addEventListener()}return r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("detailclick",this.onDetailRowClick,this),this.parent.on("add-delete-success",this.addDeleteSuccess,this),this.parent.on("editsuccess",this.editSuccess,this),this.parent.on("setvisibility",this.setColumnVisibility,this),this.parent.on("offset",this.setServerOffSet,this),this.parent.on("updateaction",this.modelChanged,this),this.parent.on(Bt,this.modelChanged,this),this.parent.on("group-expand-collapse",this.onGroupClick,this),this.parent.on("setcolumnstyles",this.setColVTableWidthAndTranslate,this),this.parent.on("refresh-virtual-indices",this.invokeServerDataBind,this),this.parent.on("contentcolgroup",this.contentColGroup,this),this.parent.on(Qt,this.dataSourceModified,this))},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("detailclick",this.onDetailRowClick),this.parent.off("add-delete-success",this.addDeleteSuccess),this.parent.off("editsuccess",this.editSuccess),this.parent.off("setvisibility",this.setColumnVisibility),this.parent.off("offset",this.setServerOffSet),this.parent.off("updateaction",this.modelChanged),this.parent.off(Bt,this.modelChanged),this.parent.off("group-expand-collapse",this.onGroupClick),this.parent.off("setcolumnstyles",this.setColVTableWidthAndTranslate),this.parent.off("refresh-virtual-indices",this.invokeServerDataBind),this.parent.off("contentcolgroup",this.contentColGroup),this.parent.off(Qt,this.dataSourceModified))},r.prototype.getModuleName=function(){return"blazor"},r.prototype.modelChanged=function(e){this.actionArgs=e,this.parent.currentAction=e},r.prototype.addDeleteSuccess=function(e){var i,r=this;i={requestType:e.requestType,data:e.data,action:e.action},t.isNullOrUndefined(e.index)||(i.index=e.index),e.promise.then(function(e){return r.editSuccess(i)}).catch(function(e){if(t.isBlazor()&&r.parent.isServerRendered){t.isNullOrUndefined(e.error)||t.isNullOrUndefined(e.error.message)||(e.error=e.error.message)}r.parent.trigger("actionFailure",t.isBlazor()&&e instanceof Array?e[0]:e),r.parent.hideSpinner(),r.parent.log("actionfailure",{error:e})})},r.prototype.editSuccess=function(e){this.parent.renderModule.resetTemplates(),this.invokeServerDataBind(e)},r.prototype.invokeServerDataBind=function(e){this.actionArgs=e,this.parent.currentAction=e,this.parent.allowServerDataBinding=!0,this.parent.serverDataBind(),this.parent.allowServerDataBinding=!1},r.prototype.onDetailRowClick=function(t){var i=this.parent,r=t.parentElement,n=r.getAttribute("data-uid"),o=i.getRowObjectFromUID(n),s={uid:n,classList:t.classList[0],index:r.getAttribute("aria-rowindex"),rowIndex:i.getRowsObject().indexOf(o),colSpan:this.parent.getVisibleColumns().length};if(i.interopAdaptor.invokeMethodAsync("OnDetailClick",s),t.classList.contains("e-detailrowcollapse")){for(var l=i.getRowsObject(),a=o.data,h=this.parent.getRowUid("grid-row"),d=i.groupSettings.columns.length,p=new fi({isDataRow:!0,isExpand:!0,uid:h,isDetailRow:!0,cells:[new mi({cellType:e.CellType.Indent}),new mi({isDataCell:!0,visible:!0})]}),c=0;c<d;c++)p.cells.unshift(new mi({cellType:e.CellType.Indent}));l.splice(s.rowIndex+1,0,p),i.trigger("detailDataBound",{data:a}),i.notify("detailDataBound",{rows:i.getRowsObject()}),o.isExpand=!0,this.aria.setExpand(t,!0)}else i.getRowsObject().splice(s.rowIndex+1,1),i.notify("detailDataBound",{rows:i.getRowsObject()}),o.isExpand=!1,this.aria.setExpand(t,!1)},r.prototype.setColumnVisibility=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].uid]=e[i].visible;this.parent.interopAdaptor.invokeMethodAsync("setColumnVisibility",{visible:t})},r.prototype.dataSuccess=function(e){this.parent.enableVirtualization&&0===Object.keys(this.actionArgs).length&&(this.actionArgs.requestType="virtualscroll");if(this.actionArgs.startIndex=e.startIndex,this.actionArgs.endIndex=e.endIndex,this.parent.enableVirtualization){if(this.virtualContentModule=this.parent.contentModule,"downArrow"===this.virtualContentModule.activeKey||"upArrow"===this.virtualContentModule.activeKey){var t=this.parent.getRowByIndex(this.virtualContentModule.blzRowIndex);t&&(this.parent.selectRow(parseInt(t.getAttribute("aria-rowindex"),10)),t.cells[0].focus({preventScroll:!0}))}this.virtualContentModule.blazorDataLoad=!1}if(e.foreignColumnsData)for(var r=this.parent.getColumns(),n=0;n<r.length;n++)e.foreignColumnsData[r[n].field]&&(r[n].columnData=e.foreignColumnsData[r[n].field]);if(this.parent.allowGrouping&&this.parent.groupSettings.columns){for(var o=[],s=this.parent.aggregates,n=0;n<s.length;n++)for(var l=s[n],a=0;a<l.columns.length;a++){var h={};h={type:l.columns[a].type.toString().toLowerCase(),field:l.columns[a].field},o.push(h)}for(var d=void 0,p=void 0,c=this.parent.groupSettings.columns,u=0;u<c.length;u++)p=d||e.result,d=i.DataUtil.group(p,c[u],o,null,null);e.result=d||e.result}var g="offset";if(this.parent.rowUid=e.rowUid,e[g]=1===Math.sign(e[g])?-Math.abs(e[g]):Math.abs(e[g]),this.parent.offsetTime=e[g],this.parent.offsetTime!==(new Date).getTimezoneOffset()/60)if("Batch"!==this.parent.editSettings.mode){"edit"===this.actionArgs.action?this.setClientOffSet(e,this.actionArgs.rowIndex):"add"===this.actionArgs.action&&this.setClientOffSet(e,this.actionArgs.index)}else if("Batch"===this.parent.editSettings.mode){for(var f=this.parent.getPrimaryKeyFieldNames()[0],m=this.actionArgs.changes||{changedRecords:[],addedRecords:[]},n=0;n<m.changedRecords.length;n++)for(a=0;a<e.result.length;a++)m.changedRecords[n][f]===e.result[a][f]&&this.setClientOffSet(e,a);for(n=0;n<m.addedRecords.length;n++)for(a=0;a<e.result.length;a++)m.addedRecords[n][f]===e.result[a][f]&&this.setClientOffSet(e,a)}this.parent.renderModule.dataManagerSuccess(e,this.actionArgs),this.parent.getMediaColumns(),this.parent.enableVirtualization&&(this.virtualContentModule=this.parent.contentModule,this.setColVTableWidthAndTranslate(),this.parent.groupSettings.columns.length&&this.virtualContentModule.setVirtualHeight(this.virtualHeight)),this.actionArgs=this.parent.currentAction={}},r.prototype.removeDisplayNone=function(){for(var e=this.parent.getContentTable().querySelectorAll("tr"),t=0;t<e.length;t++)for(var i=e[t].querySelectorAll("td"),r=0;r<i.length;r++)i[r].style.display=""},r.prototype.setVirtualTrackHeight=function(e){this.virtualHeight=e.VisibleGroupedRowsCount*this.parent.getRowHeight(),this.virtualContentModule.setVirtualHeight(this.virtualHeight)},r.prototype.setColVTableWidthAndTranslate=function(e){if(this.parent.enableColumnVirtualization&&this.virtualContentModule.prevInfo&&JSON.stringify(this.virtualContentModule.currentInfo.columnIndexes)!==JSON.stringify(this.virtualContentModule.prevInfo.columnIndexes)||e&&e.refresh){var t=this.virtualContentModule.getColumnOffset(this.virtualContentModule.startColIndex-1),i=this.virtualContentModule.getColumnOffset(this.virtualContentModule.endColIndex-1)-t+"";this.virtualContentModule.header.virtualEle.setWrapperWidth(i),this.virtualContentModule.virtualEle.setWrapperWidth(i),this.virtualContentModule.header.virtualEle.adjustTable(t,0),this.parent.getContentTable().parentElement.style.width=i+"px"}this.dataSourceChanged&&(this.virtualContentModule.getPanel().firstElementChild.scrollTop=0,this.virtualContentModule.getPanel().firstElementChild.scrollLeft=0,this.virtualContentModule.header.virtualEle&&this.virtualContentModule.header.virtualEle.adjustTable(0,0),this.parent.getContentTable().parentElement.style.transform="translate(0px,0px)",this.virtualContentModule.refreshOffsets(),this.virtualContentModule.refreshVirtualElement(),this.dataSourceChanged=!1)},r.prototype.dataSourceModified=function(){this.dataSourceChanged=!0},r.prototype.setClientOffSet=function(e,t){var r=i.DataUtil.serverTimezoneOffset;i.DataUtil.serverTimezoneOffset=0,e.result[t]=i.DataUtil.parse.parseJson(JSON.stringify(e.result[t])),i.DataUtil.serverTimezoneOffset=r},r.prototype.setServerOffSet=function(e){var t=i.DataUtil.serverTimezoneOffset,r=(new Date).getTimezoneOffset()/60*2+this.parent.offsetTime;i.DataUtil.serverTimezoneOffset=r,e.data=i.DataUtil.parse.parseJson(JSON.stringify(e.data)),i.DataUtil.serverTimezoneOffset=t},r.prototype.onGroupClick=function(e){var t=this;e.exactTopIndex=Math.round(this.parent.element.querySelector(".e-content").scrollTop/this.parent.getRowHeight());e.rowHeight=this.parent.getRowHeight(),this.parent.interopAdaptor.invokeMethodAsync("OnGroupExpandClick",e).then(function(){t.parent.contentModule.rowElements=[].slice.call(t.parent.getContentTable().querySelectorAll("tr.e-row[data-uid]"))})},r.prototype.setPersistData=function(e){var t=this.parent;t.mergePersistGridData(e);t.bulkChanges.columns&&delete t.bulkChanges.columns,t.headerModule.refreshUI(),t.notify("persist-data-changed",{}),t.notify(jt,t.getColumns())},r.prototype.resetPersistData=function(e){var t=this.parent,i=JSON.parse(e),r={filterSettings:i.filterSettings,groupSettings:i.groupSettings,pageSettings:i.pageSettings,sortSettings:i.sortSettings,searchSettings:i.searchSettings,columns:i.columns};r.sortSettings.columns||(r.sortSettings.columns=[]),r.groupSettings.columns||(r.groupSettings.columns=[]),r.pageSettings.currentPage||(t.pageSettings.currentPage=1);for(n=0;n<t.columns.length;n++)t.groupSettings.columns.indexOf(t.columns[n].field)>-1&&(t.columns[n].visible=!0);t.mergePersistGridData(r),t.notify("persist-data-changed",{}),t.bulkChanges.columns&&delete t.bulkChanges.columns,t.headerModule.refreshUI();for(var n=0;n<t.columns.length;n++)t.columns[n].editType=t.columns[n].editType.toLowerCase();t.setProperties({filterSettings:{columns:[]}},!0)},r.prototype.contentColGroup=function(){var e=this.parent,t=e.getContent().querySelector(".e-table");if(t.insertBefore(t.querySelector("#content-"+e.element.id+"colGroup"),t.querySelector("tbody")),e.frozenRows){var i=e.getHeaderContent().querySelector(".e-table");i.insertBefore(i.querySelector("#"+e.element.id+"colGroup"),i.querySelector("tbody"))}if(0!==e.getFrozenColumns()){var r=e.getContent().querySelector(".e-movablecontent").querySelector(".e-table");if(r.insertBefore(r.querySelector("#"+e.element.id+"colGroup"),r.querySelector("tbody")),e.frozenRows){var n=e.getHeaderContent().querySelector(".e-movableheader").querySelector(".e-table");n.insertBefore(n.querySelector("#"+e.element.id+"colGroup"),n.querySelector("tbody"))}}},r.prototype.dataFailure=function(e){this.parent.renderModule.dataManagerFailure(e,this.actionArgs),this.actionArgs=this.parent.currentAction={}},r.prototype.destroy=function(){this.removeEventListener()},r}(),Or=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ar=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Br=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property()],i.prototype,"field",void 0),Ar([t.Property()],i.prototype,"direction",void 0),Ar([t.Property(!1)],i.prototype,"isFromGroup",void 0),i}(t.ChildProperty),kr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Collection([],Br)],i.prototype,"columns",void 0),Ar([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),Lr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property()],i.prototype,"field",void 0),Ar([t.Property()],i.prototype,"operator",void 0),Ar([t.Property()],i.prototype,"value",void 0),Ar([t.Property()],i.prototype,"matchCase",void 0),Ar([t.Property(!1)],i.prototype,"ignoreAccent",void 0),Ar([t.Property()],i.prototype,"predicate",void 0),Ar([t.Property({})],i.prototype,"actualFilterValue",void 0),Ar([t.Property({})],i.prototype,"actualOperator",void 0),Ar([t.Property()],i.prototype,"type",void 0),Ar([t.Property()],i.prototype,"ejpredicate",void 0),Ar([t.Property()],i.prototype,"uid",void 0),Ar([t.Property()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),Pr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property(!1)],i.prototype,"enableCache",void 0),Ar([t.Property(3)],i.prototype,"maxBlocks",void 0),Ar([t.Property(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),Nr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Collection([],Lr)],i.prototype,"columns",void 0),Ar([t.Property("FilterBar")],i.prototype,"type",void 0),Ar([t.Property()],i.prototype,"mode",void 0),Ar([t.Property(!0)],i.prototype,"showFilterBarStatus",void 0),Ar([t.Property(1500)],i.prototype,"immediateModeDelay",void 0),Ar([t.Property()],i.prototype,"operators",void 0),Ar([t.Property(!1)],i.prototype,"ignoreAccent",void 0),Ar([t.Property(!1)],i.prototype,"enableCaseSensitivity",void 0),Ar([t.Property(!1)],i.prototype,"showFilterBarOperator",void 0),i}(t.ChildProperty),qr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property("Row")],i.prototype,"mode",void 0),Ar([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),Ar([t.Property("Single")],i.prototype,"type",void 0),Ar([t.Property(!1)],i.prototype,"checkboxOnly",void 0),Ar([t.Property(!1)],i.prototype,"persistSelection",void 0),Ar([t.Property("Default")],i.prototype,"checkboxMode",void 0),Ar([t.Property(!1)],i.prototype,"enableSimpleMultiRowSelection",void 0),Ar([t.Property(!0)],i.prototype,"enableToggle",void 0),Ar([t.Property(!1)],i.prototype,"allowColumnSelection",void 0),i}(t.ChildProperty),Hr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property([])],i.prototype,"fields",void 0),Ar([t.Property("")],i.prototype,"key",void 0),Ar([t.Property("contains")],i.prototype,"operator",void 0),Ar([t.Property(!0)],i.prototype,"ignoreCase",void 0),Ar([t.Property(!1)],i.prototype,"ignoreAccent",void 0),i}(t.ChildProperty),Ur=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property()],i.prototype,"targetID",void 0),i}(t.ChildProperty),jr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),Vr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property("Normal")],i.prototype,"mode",void 0),i}(t.ChildProperty),Gr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property(!0)],i.prototype,"showDropArea",void 0),Ar([t.Property(!1)],i.prototype,"allowReordering",void 0),Ar([t.Property(!1)],i.prototype,"showToggleButton",void 0),Ar([t.Property(!1)],i.prototype,"showGroupedColumn",void 0),Ar([t.Property(!0)],i.prototype,"showUngroupButton",void 0),Ar([t.Property(!1)],i.prototype,"disablePageWiseAggregates",void 0),Ar([t.Property([])],i.prototype,"columns",void 0),Ar([t.Property()],i.prototype,"captionTemplate",void 0),Ar([t.Property(!1)],i.prototype,"enableLazyLoading",void 0),i}(t.ChildProperty),_r=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property(!1)],i.prototype,"allowAdding",void 0),Ar([t.Property(!1)],i.prototype,"allowEditing",void 0),Ar([t.Property(!1)],i.prototype,"allowDeleting",void 0),Ar([t.Property("Normal")],i.prototype,"mode",void 0),Ar([t.Property(!0)],i.prototype,"allowEditOnDblClick",void 0),Ar([t.Property(!0)],i.prototype,"showConfirmDialog",void 0),Ar([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),Ar([t.Property("")],i.prototype,"template",void 0),Ar([t.Property("")],i.prototype,"headerTemplate",void 0),Ar([t.Property("")],i.prototype,"footerTemplate",void 0),Ar([t.Property("Top")],i.prototype,"newRowPosition",void 0),Ar([t.Property({})],i.prototype,"dialog",void 0),Ar([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),Wr=function(n){function o(e,i){var r=n.call(this,e,i)||this;return r.isPreventScrollEvent=!1,r.inViewIndexes=[],r.keyA=!1,r.frozenRightCount=0,r.frozenLeftCount=0,r.tablesCount=1,r.movableCount=0,r.visibleFrozenLeft=0,r.visibleFrozenRight=0,r.visibleMovable=0,r.frozenLeftColumns=[],r.frozenRightColumns=[],r.movableColumns=[],r.media={},r.isFreezeRefresh=!1,r.tableIndex=0,r.componentRefresh=t.Component.prototype.refresh,r.isVirtualAdaptive=!1,r.vRows=[],r.vcRows=[],r.vGroupOffsets={},r.rowUid=0,r.currentViewData=[],r.lockcolPositionCount=0,r.prevPageMoving=!1,r.pageTemplateChange=!1,r.isAutoGen=!1,r.mediaBindInstance={},r.commandDelIndex=void 0,r.asyncTimeOut=50,r.enableLogger=!0,r.needsID=!0,s.Inject(br),t.setValue("mergePersistData",r.mergePersistGridData,r),r}Or(o,n),s=o,o.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","groupSettings","columns","searchSettings","selectedRowIndex","scrollPosition"],i={pageSettings:["template","pageSizes","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent"],groupSettings:["showDropArea","showToggleButton","showGroupedColumn","showUngroupButton","disablePageWiseAggregates","hideCaptionCount"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},r=0;r<e.length;r++)for(var n=this[e[r]],o=0,s=i[e[r]];o<s.length;o++)delete n[s[o]];return this.pageSettings.template=void 0,this.isAngular&&delete this.groupSettings.properties.captionTemplate,this.pageTemplateChange=!t.isNullOrUndefined(this.pagerTemplate),this.addOnPersist(e)},o.prototype.requiredModules=function(){this.setFrozenCount();var e=[];return this.isDestroyed?e:(this.allowFiltering&&e.push({member:"filter",args:[this,this.filterSettings,this.serviceLocator]}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this,this.serviceLocator]}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this]}),this.allowSorting&&e.push({member:"sort",args:[this,this.sortSettings,this.sortedColumns,this.serviceLocator]}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings]}),this.allowSelection&&e.push({member:"selection",args:[this,this.selectionSettings,this.serviceLocator]}),e.push({member:"resize",args:[this]}),this.allowReordering&&e.push({member:"reorder",args:[this]}),this.allowRowDragAndDrop&&e.push({member:"rowDragAndDrop",args:[this]}),this.allowGrouping&&e.push({member:"group",args:[this,this.groupSettings,this.sortedColumns,this.serviceLocator]}),this.aggregates.length&&e.push({member:"aggregate",args:[this,this.serviceLocator]}),this.isDetail()&&e.push({member:"detailRow",args:[this,this.serviceLocator]}),(this.toolbar||this.toolbarTemplate)&&e.push({member:"toolbar",args:[this,this.serviceLocator]}),(this.enableVirtualization||this.enableColumnVirtualization)&&e.push({member:"virtualscroll",args:[this,this.serviceLocator]}),(this.getFrozenColumns()||this.frozenRows||this.frozenRightCount||this.frozenLeftCount)&&e.push({member:"freeze",args:[this,this.serviceLocator]}),this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this,this.serviceLocator]}),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this,this.serviceLocator]}),this.extendRequiredModules(e),e)},o.prototype.extendRequiredModules=function(e){this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this,this.serviceLocator]}),this.groupSettings.enableLazyLoading&&e.push({member:"lazyLoadGroup",args:[this,this.serviceLocator]}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this,this.serviceLocator]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this,this.serviceLocator]}),this.showColumnChooser&&e.push({member:"columnChooser",args:[this,this.serviceLocator]}),this.isForeignKeyEnabled(this.columns)&&e.push({member:"foreignKey",args:[this,this.serviceLocator]}),this.enableLogger&&e.push({member:"logger",args:[this]}),t.isBlazor()&&e.push({member:"blazor",args:[this]})},o.prototype.preRender=function(){this.serviceLocator=new tr,this.initProperties(),this.initializeServices()},o.prototype.initProperties=function(){if(this.isInitial=!0,this.sortedColumns=[],this.inViewIndexes=[],this.mediaCol=[],this.isInitialLoad=!1,this.allowServerDataBinding=!1,this.ignoreCollectionWatch=!0,t.isBlazor()&&this.enableVirtualization&&this.allowGrouping){this.isExpanded=!1}this.mergeCells={},this.isEdit=!1,this.checkAllRows="None",this.isCheckBoxSelection=!1,this.isPersistSelection=!1,this.componentRefresh=t.Component.prototype.refresh,this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith"},this.defaultLocale={EmptyRecord:"No records to display",True:"true",False:"false",InvalidFilterMessage:"Invalid Filter Data",GroupDropArea:"Drag a column header here to group its column",UnGroup:"Click here to ungroup",UnGroupButton:"Click here to ungroup",GroupDisable:"Grouping is disabled for this column",FilterbarTitle:"'s filter bar cell",EmptyDataSourceError:"DataSource must not be empty at initial load since columns are generated from dataSource in AutoGenerate Column Grid",Add:"Add",Edit:"Edit",Cancel:"Cancel",Update:"Update",Delete:"Delete",Print:"Print",Pdfexport:"PDF Export",Excelexport:"Excel Export",Wordexport:"Word Export",Csvexport:"CSV Export",Search:"Search",Columnchooser:"Columns",Save:"Save",Item:"item",Items:"items",EditOperationAlert:"No records selected for edit operation",DeleteOperationAlert:"No records selected for delete operation",SaveButton:"Save",OKButton:"OK",CancelButton:"Cancel",EditFormTitle:"Details of ",AddFormTitle:"Add New Record",BatchSaveConfirm:"Are you sure you want to save changes?",BatchSaveLostChanges:"Unsaved changes will be lost. Are you sure you want to continue?",ConfirmDelete:"Are you sure you want to Delete Record?",CancelEdit:"Are you sure you want to Cancel the changes?",ChooseColumns:"Choose Column",SearchColumns:"search columns",Matchs:"No matches found",FilterButton:"Filter",ClearButton:"Clear",StartsWith:"Starts With",EndsWith:"Ends With",Contains:"Contains",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",ChooseDate:"Choose a Date",EnterValue:"Enter the value",Copy:"Copy",Group:"Group by this column",Ungroup:"Ungroup by this column",autoFitAll:"Autofit all columns",autoFit:"Autofit this column",AutoFitAll:"Autofit all columns",AutoFit:"Autofit this column",Export:"Export",FirstPage:"First Page",LastPage:"Last Page",PreviousPage:"Previous Page",NextPage:"Next Page",SortAscending:"Sort Ascending",SortDescending:"Sort Descending",EditRecord:"Edit Record",DeleteRecord:"Delete Record",FilterMenu:"Filter",SelectAll:"Select All",Blanks:"Blanks",FilterTrue:"True",FilterFalse:"False",NoResult:"No matches found",ClearFilter:"Clear Filter",Clear:"Clear",NumberFilter:"Number Filters",TextFilter:"Text Filters",DateFilter:"Date Filters",DateTimeFilter:"DateTime Filters",MatchCase:"Match Case",Between:"Between",CustomFilter:"Custom Filter",CustomFilterPlaceHolder:"Enter the value",CustomFilterDatePlaceHolder:"Choose a date",AND:"AND",OR:"OR",ShowRowsWhere:"Show rows where:",FilterMenuDialogARIA:"Filter menu dialog",ExcelFilterDialogARIA:"Excel filter dialog",DialogEditARIA:"Edit dialog",ColumnChooserDialogARIA:"Column chooser dialog",ColumnMenuDialogARIA:"Column menu dialog",CustomFilterDialogARIA:"Customer filter dialog",SortAtoZ:"Sort A to Z",SortZtoA:"Sort Z to A",SortByOldest:"Sort by Oldest",SortByNewest:"Sort by Newest",SortSmallestToLargest:"Sort Smallest to Largest",SortLargestToSmallest:"Sort Largest to Smallest",Sort:"Sort"},this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftRight:"shift+rightarrow",shiftLeft:"shift+leftarrow",home:"home",end:"end",escape:"escape",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",pageUp:"pageup",pageDown:"pagedown",ctrlAltPageUp:"ctrl+alt+pageup",ctrlAltPageDown:"ctrl+alt+pagedown",altPageUp:"alt+pageup",altPageDown:"alt+pagedown",altDownArrow:"alt+downarrow",altUpArrow:"alt+uparrow",ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlPlusA:"ctrl+A",ctrlPlusP:"ctrl+P",insert:"insert",delete:"delete",f2:"f2",enter:"enter",ctrlEnter:"ctrl+enter",shiftEnter:"shift+enter",tab:"tab",shiftTab:"shift+tab",space:"space",ctrlPlusC:"ctrl+C",ctrlShiftPlusH:"ctrl+shift+H",ctrlSpace:"ctrl+space",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow"}},o.prototype.render=function(){this.log(["module_missing","promise_enabled","locale_missing","check_datasource_columns"]),this.ariaService.setOptions(this.element,{role:"grid"}),t.isBlazor()&&this.renderComplete(),r.createSpinner({target:this.element},this.createElement),this.renderModule=new $i(this,this.serviceLocator),this.searchModule=new Sr(this),this.scrollModule=new Rr(this),this.notify(It,{}),!0!==this.getDataModule().dataManager.dataSource.offline&&void 0!==this.getDataModule().dataManager.dataSource.url||(this.isVirtualAdaptive=!0),this.trigger("load"),T(this.columns,this.enableColumnVirtualization,this),this.enablePersistence&&this.notify(si,{}),t.isBlazor()&&this.isServerRendered||(this.getMediaColumns(),I(this.columns)),this.checkLockColumns(this.columns),this.getColumns(),this.processModel(),this.gridRender(),this.wireEvents(),this.addListener(),this.updateDefaultCursor(),this.updateStackedFilter(),this.showSpinner(),this.notify(Tt,{}),t.isBlazor()&&this.isServerRendered&&Mr.notify("component-rendered",{id:this.element.id,grid:this})},o.prototype.showSpinner=function(){r.showSpinner(this.element)},o.prototype.hideSpinner=function(){r.hideSpinner(this.element)},o.prototype.updateStackedFilter=function(){this.allowFiltering&&"FilterBar"===this.filterSettings.type&&this.getHeaderContent().querySelectorAll(".e-stackedheadercell").length?this.getHeaderContent().classList.add("e-stackedfilter"):this.getHeaderContent().classList.remove("e-stackedfilter")},o.prototype.getMediaColumns=function(){if(!this.enableColumnVirtualization){var e=this.getColumns();if(this.getShowHideService=this.serviceLocator.getService("showHideService"),!t.isNullOrUndefined(e))for(var i=0;i<e.length;i++)t.isNullOrUndefined(e[i].hideAtMedia)||!t.isNullOrUndefined(e[i].visible)&&!e[i].visible||this.pushMediaColumn(e[i],i)}},o.prototype.pushMediaColumn=function(e,t){this.mediaCol.push(e),this.media[e.uid]=window.matchMedia(e.hideAtMedia),this.mediaQueryUpdate(t,this.media[e.uid]),this.mediaBindInstance[t]=this.mediaQueryUpdate.bind(this,t),this.media[e.uid].addListener(this.mediaBindInstance[t])},o.prototype.updateMediaColumns=function(e){if(!this.enableColumnVirtualization){for(var t=this.getColumnIndexByUid(e.uid),i=0;i<this.mediaCol.length;i++)if(e.uid===this.mediaCol[i].uid)return void this.mediaCol.splice(i,1);this.pushMediaColumn(e,t)}},o.prototype.mediaQueryUpdate=function(e,t){var i=this.getColumns()[e];this.mediaCol.some(function(e){return e.uid===i.uid})&&(i.visible=t.matches,this.isInitialLoad&&(this.invokedFromMedia=!0,i.visible?this.showHider.show(i.headerText,"headerText"):this.showHider.hide(i.headerText,"headerText")))},o.prototype.refreshMediaCol=function(){this.isInitialLoad=!0;var e=this.element.querySelector(".e-gridfooter");this.aggregates.length&&this.element.scrollHeight>this.height&&e&&t.addClass([e],["e-footerpadding"]),this.getColumns().filter(function(e){return"checkbox"===e.type}).length&&"ResetOnRowClick"===this.selectionSettings.checkboxMode&&(this.isCheckBoxSelection=!1),"Vertical"===this.rowRenderingMode&&this.enableHover&&(this.setProperties({enableAdaptiveUI:!0,enableHover:!1},!0),t.removeClass([this.element],"e-gridhover"))},o.prototype.removeMediaListener=function(){for(var e=0;e<this.mediaCol.length;e++)this.media[this.mediaCol[e].uid].removeListener(this.mediaBindInstance[this.mediaCol[e].index])},o.prototype.eventInitializer=function(){},o.prototype.destroy=function(){var e=this.element;if(e){var i=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent"));i&&this.unwireEvents(),this.removeListener(),this.removeMediaListener(),this.notify(Ut,{}),this.destroyDependentModules(),i&&n.prototype.destroy.call(this),this.toolTipObj.destroy();for(var r=["renderModule","headerModule","contentModule","valueFormatterService","serviceLocator","ariaService","keyboardModule","widthService","searchModule","showHider","scrollModule","printModule","clipboardModule","focusModule"],o=0;o<r.length;o++)this[r[o]]&&(this[r[o]]=null);t.isBlazor()&&this.isServerRendered?this.element.style.display="none":this.element.innerHTML="",t.classList(this.element,[],["e-rtl","e-gridhover","e-responsive","e-default","e-device","e-grid-min-height"]),this.isAngular&&!this.isFreezeRefresh&&(this.element=null),this.isFreezeRefresh=!1}},o.prototype.destroyDependentModules=function(){var e=this.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.scrollModule.destroy(),this.keyboardModule.destroy(),this.focusModule.destroy())},o.prototype.getModuleName=function(){return"grid"},o.prototype.enableBoxSelection=function(){this.enableAutoFill?(this.selectionSettings.cellSelectionMode="BoxWithBorder",this.element.classList.add("e-afenabled")):this.element.classList.remove("e-afenabled")},o.prototype.onPropertyChanged=function(e,i){var r,n=!1,o=!1,s=!1,l={requestType:"refresh"};if(!this.isDestroyed){this.log("module_missing"),this.isEllipsisTooltip()&&this.toolTipObj.close();var a=Object.keys(e);a.indexOf("columns")>-1&&(this.updateColumnObject(),o=!0);for(var h=0,d=a;h<d.length;h++){var p=d[h];switch(p){case"allowPaging":this.notify(Dt,{module:"pager",enable:this.allowPaging}),n=!0;break;case"pageSettings":if(this.pageTemplateChange){this.pageTemplateChange=!1,this.notify(At,{module:"pager",properties:e.pageSettings});break}this.notify(At,{module:"pager",properties:e.pageSettings}),(t.isNullOrUndefined(e.pageSettings.currentPage)&&t.isNullOrUndefined(e.pageSettings.pageSize)&&t.isNullOrUndefined(e.pageSettings.totalRecordsCount)||!t.isNullOrUndefined(i.pageSettings)&&e.pageSettings.currentPage!==i.pageSettings.currentPage&&!this.enableColumnVirtualization&&!this.enableVirtualization&&this.pageSettings.totalRecordsCount<=this.pageSettings.pageSize)&&(n=!0);break;case"allowSorting":this.notify(Dt,{module:"sort",enable:this.allowSorting}),n=!0,r=!0;break;case"allowFiltering":this.updateStackedFilter(),this.notify(Dt,{module:"filter",enable:this.allowFiltering}),n=!0,"FilterBar"!==this.filterSettings.type&&this.refreshHeader();break;case"height":case"width":this.notify(Dt,{module:"scroll",properties:{width:e.width,height:e.height}});break;case"allowReordering":this.headerModule.refreshUI(),r=!0;break;case"allowRowDragAndDrop":this.notify(Dt,{module:"rowDragAndDrop",enable:this.allowRowDragAndDrop}),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"allowSelection":this.notify(Dt,{module:"selection",enable:this.allowSelection});break;case"enableAutoFill":this.selectionModule&&(this.enableBoxSelection(),this.selectionModule.updateAutoFillPosition());break;case"rowTemplate":this.rowTemplateFn=R(this.rowTemplate),n=!0;break;case"detailTemplate":this.detailTemplateFn=R(this.detailTemplate),n=!0;break;case"allowGrouping":this.notify(Dt,{module:"group",enable:this.allowGrouping}),this.headerModule.refreshUI(),n=!0,r=!0;break;case"enableInfiniteScrolling":case"childGrid":n=!0;break;case"toolbar":this.notify(Dt,{module:"toolbar"});break;case"groupSettings":this.notify(At,{module:"group",properties:e.groupSettings,oldProperties:i.groupSettings});break;case"aggregates":!this.aggregates.length&&this.allowGrouping&&this.groupSettings.columns.length&&(n=!0),this.notify(Dt,{module:"aggregate",properties:e});break;case"frozenColumns":case"frozenRows":case"enableVirtualization":case"currencyCode":case"locale":this.log("frozen_rows_columns"),s=!0,o=!0;break;case"query":this.getDataModule().isQueryInvokedFromData||(n=!0),this.getDataModule().isQueryInvokedFromData=!1;break;default:this.extendedPropertyChange(p,e,o)}}r&&this.updateDefaultCursor(),o?s||this.getFrozenColumns()||this.frozenRows?t.isBlazor()&&this.isServerRendered||this.freezeRefresh():this.refresh():n&&(this.notify(Bt,l),n=!1,this.maintainSelection(e.selectedRowIndex))}},o.prototype.extendedPropertyChange=function(e,r,n){switch(e){case"enableRtl":this.updateRTL(),this.allowPaging&&(this.element.querySelector(".e-gridpager").ej2_instances[0].enableRtl=r.enableRtl,this.element.querySelector(".e-gridpager").ej2_instances[0].dataBind()),"auto"!==this.height&&(this.scrollModule.removePadding(!r.enableRtl),this.scrollModule.setPadding()),this.toolbar&&this.toolbarModule&&(this.toolbarModule.getToolbar().ej2_instances[0].enableRtl=r.enableRtl,this.toolbarModule.getToolbar().ej2_instances[0].dataBind()),this.contextMenuItems&&this.contextMenuModule&&(this.contextMenuModule.getContextMenu().ej2_instances[0].enableRtl=r.enableRtl,this.contextMenuModule.getContextMenu().ej2_instances[0].dataBind()),this.showColumnMenu&&this.columnMenuModule&&(this.columnMenuModule.getColumnMenu().ej2_instances[0].enableRtl=r.enableRtl,this.columnMenuModule.getColumnMenu().ej2_instances[0].dataBind()),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&this.refreshHeader(),this.notify("rtl-updated",{});break;case"enableAltRow":this.renderModule.refresh();break;case"allowResizing":this.headerModule.refreshUI(),this.updateResizeLines();break;case"rowHeight":this.rowHeight?t.addClass([this.element],"e-grid-min-height"):t.removeClass([this.element],"e-grid-min-height"),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"gridLines":this.updateGridLines();break;case"showColumnMenu":this.headerModule.refreshUI(),this.notify(Dt,{module:"columnMenu",enable:!0});break;case"columnMenuItems":this.notify(Dt,{module:"columnMenu",enable:this.columnMenuItems});break;case"contextMenuItems":this.notify(Dt,{module:"contextMenu",enable:this.contextMenuItems});break;case"showColumnChooser":this.notify(Dt,{module:"columnChooser",enable:this.showColumnChooser});break;case"filterSettings":this.updateStackedFilter(),this.notify(At,{module:"filter",properties:r.filterSettings});break;case"searchSettings":this.notify(At,{module:"search",properties:r.searchSettings});break;case"sortSettings":this.notify(At,{module:"sort"});break;case"selectionSettings":this.notify(At,{module:"selection",properties:r.selectionSettings});break;case"editSettings":this.notify(At,{module:"edit",properties:r.editSettings});break;case"allowTextWrap":case"textWrapSettings":this.allowTextWrap?this.applyTextWrap():this.removeTextWrap(),this.notify(ii,{case:"textwrap",isModeChg:"textWrapSettings"===e});break;case"dataSource":var o=this.getDataModule().getState();if(Object.getPrototypeOf(r).deepWatch)for(var s=this.getPrimaryKeyFieldNames()[0],l=0,a=Object.keys(r.dataSource);l<a.length;l++)this.setRowData(t.getValue(s,this.dataSource[a[l]]),this.dataSource[a[l]]);else if(o.isPending){for(var h=t.isNullOrUndefined(this.dataSource)?[]:this.dataSource.result,d=o.group||[],l=0;l<d.length;l++)h=i.DataUtil.group(h,d[l],o.aggregates||[]);this.dataSource={result:h,count:this.dataSource.count,aggregates:this.dataSource.aggregates},this.getDataModule().setState({}),o.resolver(this.dataSource)}else this.getDataModule().setState({isDataChanged:!1}),this.notify(Qt,{}),n||(this.renderModule.refresh(),this.isCheckBoxSelection&&this.notify("before-refresh-on-data-change",{}));this.scrollRefresh();break;case"enableHover":(r.enableHover?t.addClass:t.removeClass)([this.element],"e-gridhover");break;case"selectedRowIndex":this.isSelectedRowIndexUpdating||this.selectRow(r.selectedRowIndex),this.isSelectedRowIndexUpdating=!1;break;case"resizeSettings":this.widthService.setWidthToTable();break;case"enableAdaptiveUI":this.notify("set-fullscreen-dialog",{});break;case"rowRenderingMode":this.enableVerticalRendering(),this.notify("row-mode-change",{}),this.refresh()}},o.prototype.maintainSelection=function(e){var t=this;if(-1!==e){var i=function(){t.selectRow(e),t.off(Mt,i)};this.on(Mt,i,this)}},o.prototype.setProperties=function(e,t){n.prototype.setProperties.call(this,e,t);e.filterSettings&&this.filterModule&&t&&this.filterModule.refreshFilter()},o.prototype.setTablesCount=function(){var e=this.getFrozenColumns(),t=this.getFrozenLeftColumnsCount(),i=this.getFrozenRightColumnsCount();!e||t||i?e||!t&&!i||(t&&!i||i&&!t?this.tablesCount=2:t&&i&&(this.tablesCount=3)):this.tablesCount=2},o.prototype.getTablesCount=function(){return this.tablesCount},o.prototype.updateDefaultCursor=function(){var e=[].slice.call(this.getHeaderContent().querySelectorAll(".e-headercell:not(.e-stackedheadercell)")),t=[].slice.call(this.getHeaderContent().querySelectorAll(".e-stackedheadercell")),i=this.getColumns();if(this.enableColumnVirtualization&&this.getFrozenColumns()){var r=this.contentModule.getHeaderCells();e=r.length?r:e}for(var n=0;n<e.length;n++){var o=e[n];(this.allowGrouping||this.allowReordering||this.allowSorting)&&(i[n].allowReordering&&i[n].allowSorting&&i[n].allowGrouping?o.classList.add("e-mousepointer"):o.classList.add("e-defaultcursor"))}for(var s=0;s<t.length;s++)this.allowReordering&&t[s].classList.add("e-mousepointer")},o.prototype.updateColumnModel=function(e){for(var t=0,i=e.length;t<i;t++)e[t].columns?this.updateColumnModel(e[t].columns):this.columnModel.push(e[t]);this.updateColumnLevelFrozen(),this.updateFrozenColumns(),this.updateLockableColumns()},o.prototype.updateColumnLevelFrozen=function(){var e=this.columnModel,t=[],i=[],r=[];if(this.frozenLeftCount||this.frozenRightCount){for(var n=0,o=e.length;n<o;n++){var s=e[n];"Left"===s.freeze?(s.freezeTable="frozen-left",t.push(s)):"Right"===s.freeze?(s.freezeTable="frozen-right",i.push(s)):(s.freezeTable="movable",r.push(s))}this.columnModel=t.concat(r).concat(i)}},o.prototype.updateFrozenColumns=function(){if(!this.frozenLeftCount&&!this.frozenRightCount)for(var e=this.columnModel,t=this.frozenColumns,i=this.getFrozenColumns(),r=0,n=0,o=e.length;n<o;n++){var s=e[n];t&&(s.freezeTable=n<t?"frozen-left":"movable"),s.isFrozen&&n>=t?(s.freezeTable="frozen-left",e.splice(this.frozenColumns+r,0,e.splice(n,1)[0]),r++):i&&!t&&(s.freezeTable="movable")}},o.prototype.getFrozenLeftCount=function(){return this.getFrozenColumns()||this.getFrozenLeftColumnsCount()},o.prototype.isFrozenGrid=function(){return 0!==this.getFrozenColumns()||0!==this.getFrozenLeftColumnsCount()||0!==this.getFrozenRightColumnsCount()},o.prototype.getFrozenMode=function(){return this.frozenName},o.prototype.updateLockableColumns=function(){for(var e=this.columnModel,t=0,i=0,r=this.getFrozenColumns(),n=0;n<e.length;n++)e[n].lockColumn&&(n<r?(e.splice(t,0,e.splice(n,1)[0]),t++):(e.splice(r+i,0,e.splice(n,1)[0]),i++))},o.prototype.checkLockColumns=function(e){for(var t=0;t<e.length;t++)e[t].columns?this.checkLockColumns(e[t].columns):e[t].lockColumn&&this.lockcolPositionCount++},o.prototype.getColumns=function(e){var i=this,r=this.inViewIndexes.map(function(e){return e-i.groupSettings.columns.length}).filter(function(e){return e>-1}),n=r.length;(!this.enableColumnVirtualization||t.isNullOrUndefined(this.columnModel)||0===this.columnModel.length||e)&&(this.columnModel=[],this.updateColumnModel(this.columns));var o=0===n?this.columnModel:this.columnModel.slice(r[0],r[n-1]+1);return this.contentModule&&this.enableColumnVirtualization&&this.isFrozenGrid()&&r.length&&r[0]>0&&(o=this.contentModule.ensureFrozenCols(o)),o},o.prototype.getStackedHeaderColumnByHeaderText=function(e,t){for(var i=0;i<t.length;i++){var r=t[i];if(r.field===e||r.headerText===e){this.stackedColumn=r;break}r.columns&&this.getStackedHeaderColumnByHeaderText(e,r.columns)}return this.stackedColumn},o.prototype.getColumnIndexesInView=function(){return this.inViewIndexes},o.prototype.getQuery=function(){return this.query},o.prototype.getLocaleConstants=function(){return this.defaultLocale},o.prototype.setColumnIndexesInView=function(e){this.inViewIndexes=e},o.prototype.getVisibleColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var r=i[t];r.visible&&e.push(r)}return e},o.prototype.getHeaderContent=function(){return this.headerModule.getPanel()},o.prototype.setGridHeaderContent=function(e){this.headerModule.setPanel(e)},o.prototype.getContentTable=function(){return this.contentModule.getTable()},o.prototype.setGridContentTable=function(e){this.contentModule.setTable(e)},o.prototype.getContent=function(){return this.contentModule.getPanel()},o.prototype.setGridContent=function(e){this.contentModule.setPanel(e)},o.prototype.getHeaderTable=function(){return this.headerModule.getTable()},o.prototype.setGridHeaderTable=function(e){this.headerModule.setTable(e)},o.prototype.getFooterContent=function(){return this.footerElement=this.element.getElementsByClassName("e-gridfooter")[0],this.footerElement},o.prototype.getFooterContentTable=function(){return this.footerElement=this.element.getElementsByClassName("e-gridfooter")[0],this.footerElement.firstChild.firstChild},o.prototype.getPager=function(){return this.gridPager},o.prototype.setGridPager=function(e){this.gridPager=e},o.prototype.getRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},o.prototype.getMovableRowByIndex=function(e){return this.contentModule.getMovableRowByIndex(e)},o.prototype.getFrozenRowByIndex=function(e){return this.getFrozenDataRows()[e]},o.prototype.getRows=function(){return this.contentModule.getRowElements()},o.prototype.getFrozenRightRowByIndex=function(e){return this.contentModule.getFrozenRightRowByIndex(e)},o.prototype.getRowInfo=function(e){var i=e,r={target:e};if(!t.isNullOrUndefined(e)&&t.isNullOrUndefined(O(i,"e-detailrowcollapse")&&t.isNullOrUndefined(O(i,"e-recordplusexpand")))){var n=t.closest(i,".e-rowcell");if(!n){var o=t.closest(i,".e-row");if(!t.isNullOrUndefined(o)){var s=this.getRowObjectFromUID(o.getAttribute("data-uid")),l=parseInt(o.getAttribute("aria-rowindex"),10);r={row:o,rowData:s.data,rowIndex:l}}return r}var a=parseInt(n.getAttribute("aria-colindex"),10);if(!t.isNullOrUndefined(n)&&!isNaN(a)){var h=t.closest(n,".e-row"),l=parseInt(h.getAttribute("aria-rowindex"),10),d=this.getFrozenColumns(),p=this.columnModel[a].getFreezeTableName(),c=this.contentModule.getRows(),u=a+this.getIndentCount();this.isFrozenGrid()&&("frozen-left"===p?c=this.contentModule.getRows():"movable"===p?(u=a-d-this.frozenLeftCount,c=this.contentModule.getMovableRows()):"frozen-right"===p&&(u=a-(this.frozenLeftCount+this.movableCount),c=this.contentModule.getFrozenRightRows()));var g=c.filter(function(e){return e.uid===h.getAttribute("data-uid")}),f={},m=void 0;Object.keys(g).length&&(f=g[0].data,m=g[0].cells[u].column),r={cell:n,cellIndex:a,row:h,rowIndex:l,rowData:f,column:m,target:e}}}return r},o.prototype.getMovableRows=function(){return this.contentModule.getMovableRowElements()},o.prototype.getFrozenRightRows=function(){return this.contentModule.getFrozenRightRowElements()},o.prototype.getDataRows=function(){return this.getAllDataRows()},o.prototype.getAllDataRows=function(e){if(t.isNullOrUndefined(this.getContentTable().querySelector("tbody")))return[];var i=this.isFrozenGrid()?this.getFrozenLeftContentTbody():this.getContentTable().querySelector("tbody"),r=[].slice.call(i.children);if(this.frozenRows){var n=this.isFrozenGrid()?this.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody"):this.getHeaderTable().querySelector("tbody"),o=[].slice.call(n.children);r=this.addMovableRows(o,r)}return this.generateDataRows(r,e)},o.prototype.addMovableRows=function(e,t){for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},o.prototype.generateDataRows=function(e,t){for(var i=[],r=0,n=e.length;r<n;r++)!e[r].classList.contains("e-row")||e[r].classList.contains("e-hiddenrow")&&!t||(this.isCollapseStateEnabled()?i[parseInt(e[r].getAttribute("aria-rowindex"))]=e[r]:i.push(e[r]));return i},o.prototype.getMovableDataRows=function(){return this.getAllMovableDataRows()},o.prototype.getAllMovableDataRows=function(e){if(!this.isFrozenGrid())return[];var t=[].slice.call(this.getContent().querySelector(".e-movablecontent").querySelector("tbody").children);if(this.frozenRows){var i=[].slice.call(this.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody").children);t=this.addMovableRows(i,t)}return this.generateDataRows(t,e)},o.prototype.getFrozenDataRows=function(){return this.getAllFrozenDataRows()},o.prototype.getAllFrozenDataRows=function(e){var t=[].slice.call(this.getContent().querySelector(".e-frozencontent").querySelector("tbody").children);if(this.frozenRows){var i=[].slice.call(this.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody").children);t=this.addMovableRows(i,t)}return this.generateDataRows(t,e)},o.prototype.getFrozenRightDataRows=function(){return this.getAllFrozenRightDataRows()},o.prototype.getAllFrozenRightDataRows=function(e){if("Right"!==this.getFrozenMode()&&"Left-Right"!==this.getFrozenMode())return[];var t=[].slice.call(this.getContent().querySelector(".e-frozen-right-content").querySelector("tbody").children);if(this.frozenRows){var i=[].slice.call(this.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("tbody").children);t=this.addMovableRows(i,t)}return this.generateDataRows(t,e)},o.prototype.setCellValue=function(e,i,r){var n,o,s,l,a=this.getPrimaryKeyFieldNames()[0],h=new Ti(this,this.serviceLocator),d={},p={},c=this.contentModule.getRows(),u=this.contentModule.getMovableRows();if(n=this.getColumnIndexByField(i),this.groupSettings.columns.length&&(n+=this.groupSettings.columns.length),(this.childGrid||this.detailTemplate)&&n++,this.isRowDragable()&&n++,o=this.getColumnByField(i),d=c.filter(function(i){return t.getValue(a,i.data)===e})[0],p=u.filter(function(i){return t.getValue(a,i.data)===e})[0],s=t.isNullOrUndefined(d)?null:this.element.querySelector("[data-uid="+d.uid+"]"),l=t.isNullOrUndefined(p)?null:this.element.querySelector("[data-uid="+p.uid+"]"),!t.isNullOrUndefined(s)){t.setValue(i,r,d.data);var g=t.isNullOrUndefined(s.cells[n])?l.cells[n-this.frozenColumns]:s.cells[n];if(!t.isNullOrUndefined(g)){var f=d.cells[n],m=void 0;this.frozenColumns&&(m=p.cells[n-this.frozenColumns]),h.refreshTD(g,t.isNullOrUndefined(f)?m:f,d.data,{index:d.index}),this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})),t.isNullOrUndefined(p)||t.isNullOrUndefined(p.changes)||(p.changes[i]=r),this.trigger("queryCellInfo",{cell:g,column:o,data:d.data})}}},o.prototype.refreshReactColumnTemplateByUid=function(e){var i=this;this.isReact&&this.clearTemplate(["columnTemplate"],void 0,function(){for(var r=i.getRowsObject(),n=i.getIndentCount(),o=i.getNormalizedColumnIndex(e),s=0;s<r.length;s++)if(r[s].isDataRow&&!t.isNullOrUndefined(r[s].index)){var l=r[s].cells[o],a=new Ti(i,i.serviceLocator),h=i.getCellFromIndex(r[s].index,o-n);a.refreshTD(h,l,r[s].data,{index:r[s].index})}})},o.prototype.setRowData=function(e,i){var r,n=this.contentModule.getRows(),o=this.getPrimaryKeyFieldNames()[0],s=new vi(this.serviceLocator,null,this);this.groupSettings.columns.length>0&&this.aggregates.length>0&&(n=n.filter(function(e){return e.isDataRow})),r=n.filter(function(i){return t.getValue(o,i.data)===e})[0],!t.isNullOrUndefined(r)&&this.element.querySelectorAll("[data-uid="+r.uid+"]").length&&(r.changes=i,se(r,this.getForeignKeyColumns(),r.changes),s.refresh(r,this.getColumns(),!0),this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})))},o.prototype.getCellFromIndex=function(e,t){return Ue(this,this.getColumnByIndex(t),e,t)},o.prototype.getMovableCellFromIndex=function(e,t){if(!("Left-Right"===this.frozenName&&t>=this.movableCount)){var i=this.getFrozenColumns()||this.getFrozenLeftColumnsCount();return this.getMovableDataRows()[e]&&this.getMovableDataRows()[e].querySelectorAll(".e-rowcell")[t-i]}},o.prototype.getFrozenRightCellFromIndex=function(e,t){var i=this.getFrozenLeftColumnsCount()+this.getMovableColumnsCount(),r=this.getFrozenRightDataRows();return r[e]&&r[e].querySelectorAll(".e-rowcell")[t-i]},o.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable().querySelectorAll(".e-headercell")[e]},o.prototype.getMovableColumnHeaderByIndex=function(e){var t=this.getFrozenColumns()||this.getFrozenLeftColumnsCount();return this.getMovableVirtualHeader().querySelectorAll(".e-headercell")[e-t]},o.prototype.getFrozenRightColumnHeaderByIndex=function(e){var t=this.getFrozenLeftColumnsCount()+this.getMovableColumnsCount();return this.getFrozenRightHeader().querySelectorAll(".e-headercell")[e-t]},o.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.getFrozenVirtualHeader().querySelectorAll(".e-headercell")[e]},o.prototype.getRowObjectFromUID=function(e,i,r){var n=this.contentModule.getRows(),o=this.rowObject(n,e);return this.isFrozenGrid()&&(!o||i||r)?((!(o=this.rowObject(this.contentModule.getMovableRows(),e))&&"Left-Right"===this.getFrozenMode()||r)&&(o=this.rowObject(this.contentModule.getFrozenRightRows(),e)),o):t.isNullOrUndefined(o)&&this.enableVirtualization&&this.groupSettings.columns.length>0?o=this.rowObject(this.vRows,e):o},o.prototype.rowObject=function(e,t){for(var i=0,r=e;i<r.length;i++){var n=r[i];if(n.uid===t)return n}return null},o.prototype.getRowsObject=function(){return this.contentModule.getRows()},o.prototype.getMovableRowsObject=function(){var e=[];return this.isFrozenGrid()&&(e=this.contentModule.getMovableRows()),e},o.prototype.getFrozenRightRowsObject=function(){var e=[];return"Right"!==this.getFrozenMode()&&"Left-Right"!==this.getFrozenMode()||(e=this.contentModule.getFrozenRightRows()),e},o.prototype.getColumnHeaderByField=function(e){var t=this.getColumnByField(e);return t?this.getColumnHeaderByUid(t.uid):void 0},o.prototype.getColumnHeaderByUid=function(e){var t=this.getHeaderContent().querySelector("[e-mappinguid="+e+"]");return t?t.parentElement:void 0},o.prototype.getColumnByIndex=function(e){var t;return this.getColumns().some(function(i,r){return t=i,r===e}),t},o.prototype.getColumnByField=function(e){return S(this.getColumns(),function(t,i){if(t.field===e)return t})[0]},o.prototype.getColumnIndexByField=function(e){for(var t=this.getColumns(),i=0;i<t.length;i++)if(t[i].field===e)return i;return-1},o.prototype.getColumnByUid=function(e){return S(this.getColumns().concat(this.getStackedColumns(this.columns)),function(t,i){if(t.uid===e)return t})[0]},o.prototype.getStackedColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,r=e;i<r.length;i++){var n=r[i];n.columns&&(t.push(n),this.getStackedColumns(n.columns,t))}return t},o.prototype.getColumnIndexByUid=function(e){var i=S(this.getColumns(),function(t,i){if(t.uid===e)return i})[0];return t.isNullOrUndefined(i)?-1:i},o.prototype.getUidByColumnField=function(e){return S(this.getColumns(),function(t,i){if(t.field===e)return t.uid})[0]},o.prototype.getNormalizedColumnIndex=function(e){return this.getColumnIndexByUid(e)+this.getIndentCount()},o.prototype.getIndentCount=function(){var e=0;return this.allowGrouping&&(e+=this.groupSettings.columns.length),this.isDetail()&&e++,this.isRowDragable()&&t.isNullOrUndefined(this.rowDropSettings.targetID)&&e++,e},o.prototype.getColumnFieldNames=function(){for(var e,t=[],i=0,r=this.getColumns().length;i<r;i++)(e=this.getColumns()[i]).visible&&t.push(e.field);return t},o.prototype.getRowTemplate=function(){return this.rowTemplateFn},o.prototype.getDetailTemplate=function(){return this.detailTemplateFn},o.prototype.getEditTemplate=function(){return this.editTemplateFn},o.prototype.getEditHeaderTemplate=function(){return this.editHeaderTemplateFn},o.prototype.getEditFooterTemplate=function(){return this.editFooterTemplateFn},o.prototype.getPrimaryKeyFieldNames=function(){for(var e=[],t=0;t<this.columnModel.length;t++)this.columnModel[t].isPrimaryKey&&e.push(this.columnModel[t].field);return e},o.prototype.refresh=function(){this.isDestroyed||(this.headerModule.refreshUI(),this.updateStackedFilter(),this.renderModule.refresh())},o.prototype.refreshHeader=function(){this.headerModule.refreshUI()},o.prototype.getSelectedRows=function(){return this.selectionModule?this.selectionModule.selectedRecords:[]},o.prototype.getSelectedRowIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowIndexes:[]},o.prototype.getSelectedRowCellIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowCellIndexes:[]},o.prototype.getSelectedRecords=function(){return this.selectionModule?this.selectionModule.getSelectedRecords():[]},o.prototype.getSelectedColumnsUid=function(){var e=this,t=[];return this.selectionModule&&this.selectionModule.selectedColumnsIndexes.filter(function(i){return t.push(e.getColumns()[i].uid)}),t},o.prototype.getDataModule=function(){return this.renderModule.data},o.prototype.showColumns=function(e,t){t=t||"headerText",this.showHider.show(e,t)},o.prototype.hideColumns=function(e,t){t=t||"headerText",this.showHider.hide(e,t)},o.prototype.getFrozenColumns=function(){return this.frozenColumns+this.getFrozenCount(this.columns,0,0)},o.prototype.getFrozenRightColumnsCount=function(){return this.frozenRightCount},o.prototype.getFrozenLeftColumnsCount=function(){return this.frozenLeftCount},o.prototype.getMovableColumnsCount=function(){return this.movableCount},o.prototype.setFrozenCount=function(){this.frozenLeftCount=this.frozenRightCount=this.movableCount=0,this.visibleFrozenLeft=this.visibleFrozenRight=this.visibleMovable=0,this.frozenLeftColumns=[],this.frozenRightColumns=[],this.movableColumns=[],this.splitFrozenCount(this.columns),this.frozenColumns&&(this.frozenLeftCount||this.frozenRightCount)&&this.setProperties({frozenColumns:0},!0),this.setTablesCount(),this.frozenLeftCount&&!this.frozenRightCount?this.frozenName="Left":this.frozenRightCount&&!this.frozenLeftCount?this.frozenName="Right":this.frozenLeftCount&&this.frozenRightCount&&(this.frozenName="Left-Right")},o.prototype.getVisibleFrozenLeftCount=function(){return this.visibleFrozenLeft},o.prototype.getVisibleFrozenRightCount=function(){return this.visibleFrozenRight},o.prototype.getVisibleMovableCount=function(){return this.visibleMovable},o.prototype.getFrozenRightColumns=function(){return this.frozenRightColumns},o.prototype.getFrozenLeftColumns=function(){return this.frozenLeftColumns},o.prototype.getMovableColumns=function(){return this.movableColumns},o.prototype.splitFrozenCount=function(e){for(var t=0;t<e.length;t++)e[t].columns?this.splitFrozenCount(e[t].columns):"Right"===e[t].freeze?(!1!==e[t].visible&&this.visibleFrozenRight++,this.frozenRightColumns.push(e[t]),this.frozenRightCount++):"Left"===e[t].freeze?(!1!==e[t].visible&&this.visibleFrozenLeft++,this.frozenLeftColumns.push(e[t]),this.frozenLeftCount++):(!1!==e[t].visible&&this.visibleMovable++,this.movableColumns.push(e[t]),this.movableCount++)},o.prototype.getVisibleFrozenColumns=function(){return this.getVisibleFrozenColumnsCount()+this.getVisibleFrozenCount(this.columns,0)},o.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},o.prototype.getVisibleFrozenColumnsCount=function(){for(var e=0,t=this.columnModel,i=0;i<this.frozenColumns;i++)t[i].visible&&e++;if(this.frozenLeftCount||this.frozenRightCount)for(i=0;i<t.length;i++)!t[i].visible||"Left"!==t[i].freeze&&"Right"!==t[i].freeze||e++;return e},o.prototype.getVisibleFrozenCount=function(e,t){if(!this.frozenLeftCount&&!this.frozenRightCount)for(var i=0,r=e.length;i<r;i++)e[i].columns?t=this.getVisibleFrozenCount(e[i].columns,t):e[i].isFrozen&&e[i].visible&&t++;return t},o.prototype.getFrozenCount=function(e,t,i){for(var r=0,n=e.length;r<n;r++)e[r].columns?t=this.getFrozenCount(e[r].columns,t,i):(e[r].isFrozen&&i>this.frozenColumns-1&&t++,i++);return t},o.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},o.prototype.updateExternalMessage=function(e){this.pagerModule&&this.pagerModule.updateExternalMessage(e)},o.prototype.sortColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},o.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},o.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},o.prototype.filterByColumn=function(e,t,i,r,n,o,s,l){this.filterModule&&this.filterModule.filterByColumn(e,t,i,r,n,o,s,l)},o.prototype.clearFiltering=function(e){this.filterModule&&this.filterModule.clearFiltering(e)},o.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},o.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},o.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},o.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},o.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},o.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},o.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},o.prototype.print=function(){this.printModule&&this.printModule.print()},o.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},o.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},o.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},o.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},o.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},o.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},o.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},o.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},o.prototype.updateCell=function(e,t,i){this.editModule&&this.editModule.updateCell(e,t,i)},o.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},o.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},o.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},o.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},o.prototype.recalcIndentWidth=function(){var e=this;if(this.getHeaderTable().querySelector(".e-emptycell")&&(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&!this.getHeaderTable().querySelector(".e-emptycell").getAttribute("indentRefreshed")&&this.getContentTable()){var t=this.getHeaderTable().querySelector(".e-emptycell").parentElement.offsetWidth,i=[].slice.call(this.getHeaderTable().querySelector("colgroup").childNodes),r=[].slice.call(this.getContentTable().querySelector("colgroup").childNodes),n=t/30,o="Right"===this.getFrozenMode()?this.frozenRightCount:0,s=this.element.offsetWidth,l=function(t,n){if(Me(e)){var o=(n/s*100).toFixed(1)+"%";i[t].style.width=o,r[t].style.width=o}else i[t].style.width=n+"px",r[t].style.width=n+"px";e.notify("column-width-changed",{index:t,width:n})};for(n>=1&&(t=30/n),(this.enableColumnVirtualization||this.isAutoGen)&&(t=30);o<this.groupSettings.columns.length;)l(o,t),o++;this.isDetail()&&(l(o,t),o++),this.isRowDragable()&&l(o,t),this.isAutoGen=!1,this.getHeaderTable().querySelector(".e-emptycell").setAttribute("indentRefreshed","true")}},o.prototype.resetIndentWidth=function(){if(Me(this)&&(this.getHeaderTable().querySelector(".e-emptycell").removeAttribute("indentRefreshed"),this.widthService.setWidthToColumns(),this.recalcIndentWidth()),("auto"===this.width||"string"==typeof this.width&&-1!==this.width.indexOf("%"))&&this.getColumns().filter(function(e){return(!e.width||"auto"===e.width)&&e.minWidth}).length>0){var e=this.widthService.getTableWidth(this.getColumns());this.widthService.setMinwidthBycalculation(e)}this.isFrozenGrid()&&this.widthService&&this.widthService.refreshFrozenScrollbar(),this.allowTextWrap&&"Content"!=this.textWrapSettings.wrapMode&&this.notify(pi,{})},o.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},o.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},o.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},o.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},o.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},o.prototype.refreshDataSource=function(e,t){this.notify("refreshdataSource",e)},o.prototype.disableRowDD=function(e){var i=this.getHeaderTable(),r=this.getContentTable(),n=i.querySelectorAll("th.e-rowdragheader, th.e-mastercell"),o=this.getRows(),s=e?"none":"";t.setStyleAttribute(i.querySelector("colgroup").childNodes[0],{display:s}),t.setStyleAttribute(r.querySelector("colgroup").childNodes[0],{display:s});for(var l=0;l<this.getRows().length;l++){h=o[l].firstElementChild;e?t.addClass([h],"e-hide"):t.removeClass([h],["e-hide"])}for(var a=0;a<i.querySelectorAll("th.e-rowdragheader, th.e-mastercell").length;a++){var h=n[a];e?t.addClass([h],"e-hide"):t.removeClass([h],["e-hide"])}},o.prototype.autoFitColumns=function(e){this.resizeModule&&this.resizeModule.autoFitColumns(e)},o.prototype.createColumnchooser=function(e,t,i){this.columnChooserModule&&this.columnChooserModule.renderColumnChooser(e,t,i)},o.prototype.initializeServices=function(){this.serviceLocator.register("widthService",this.widthService=new rr(this)),this.serviceLocator.register("cellRendererFactory",new Zi),this.serviceLocator.register("rendererFactory",new ir),this.serviceLocator.register("localization",this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale)),this.serviceLocator.register("valueFormatter",this.valueFormatterService=new ut(this.locale)),this.serviceLocator.register("showHideService",this.showHider=new xr(this)),this.serviceLocator.register("ariaService",this.ariaService=new Ei),this.serviceLocator.register("focus",this.focusModule=new or(this))},o.prototype.processModel=function(){var e,i,r=this.groupSettings.columns,n=this.sortSettings.columns;if(this.allowGrouping)for(var o=this,s=0,l=r.length;s<l;s++)!function(t,s){i=0;for(var l=n.length;i<l;i++)if(n[i].field===r[t]){e=!0;break}if(e?o.allowSorting?o.sortedColumns.push(n[i].field):n[i].direction="Ascending":n.push({field:r[t],direction:"Ascending",isFromGroup:!0}),!o.groupSettings.showGroupedColumn){var a=o.enableColumnVirtualization?o.columns.filter(function(e){return e.field===r[t]})[0]:o.getColumnByField(r[t]);a?a.visible=!1:o.log("initial_action",{moduleName:"group",columnName:r[t]})}}(s);if(!r.length)for(s=0;s<n.length;s++)this.sortedColumns.push(n[s].field);if(this.rowTemplateFn=R(this.rowTemplate),this.detailTemplateFn=R(this.detailTemplate),this.editTemplateFn=R(this.editSettings.template),this.editHeaderTemplateFn=R(this.editSettings.headerTemplate),this.editFooterTemplateFn=R(this.editSettings.footerTemplate),!t.isNullOrUndefined(this.parentDetails)){var a=t.isNullOrUndefined(this.parentDetails.parentKeyFieldValue)?"undefined":this.parentDetails.parentKeyFieldValue;this.query.where(this.queryString,"equal",a,!0)}this.initForeignColumn()},o.prototype.initForeignColumn=function(){this.isForeignKeyEnabled(this.getColumns())&&this.notify("initForeignKeyColumn",this.getForeignKeyColumns())},o.prototype.enableVerticalRendering=function(){"Vertical"===this.rowRenderingMode?this.element.classList.add("e-row-responsive"):this.element.classList.remove("e-row-responsive")},o.prototype.gridRender=function(){this.updateRTL(),"Vertical"===this.rowRenderingMode&&this.element.classList.add("e-row-responsive"),this.enableHover&&this.element.classList.add("e-gridhover"),t.Browser.isDevice&&this.element.classList.add("e-device"),this.rowHeight&&this.element.classList.add("e-grid-min-height"),t.classList(this.element,["e-responsive","e-default"],[]);var i=this.serviceLocator.getService("rendererFactory");this.headerModule=i.getRenderer(e.RenderType.Header),this.contentModule=i.getRenderer(e.RenderType.Content),this.printModule=new Kr(this,this.scrollModule),this.clipboardModule=new Er(this),this.renderModule.render(),this.eventInitializer(),this.createGridPopUpElement(),this.widthService.setWidthToColumns(),this.updateGridLines(),this.applyTextWrap(),this.createTooltip(),this.enableBoxSelection()},o.prototype.dataReady=function(){this.scrollModule.setWidth(),this.scrollModule.setHeight(),"auto"!==this.height&&this.scrollModule.setPadding()},o.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},o.prototype.createGridPopUpElement=function(){var e=this.createElement("div",{className:"e-gridpopup",styles:"display:none;"}),i=this.createElement("div",{className:"e-content",attrs:{tabIndex:"-1"}});t.append([i,this.createElement("div",{className:"e-uptail e-tail"})],e),i.appendChild(this.createElement("span")),t.append([i,this.createElement("div",{className:"e-downtail e-tail"})],e),this.element.appendChild(e)},o.prototype.updateGridLines=function(){switch(t.classList(this.element,[],["e-verticallines","e-horizontallines","e-hidelines","e-bothlines"]),this.gridLines){case"Horizontal":this.element.classList.add("e-horizontallines");break;case"Vertical":this.element.classList.add("e-verticallines");break;case"None":this.element.classList.add("e-hidelines");break;case"Both":this.element.classList.add("e-bothlines")}this.updateResizeLines()},o.prototype.updateResizeLines=function(){this.allowResizing&&"Vertical"!==this.gridLines&&"Both"!==this.gridLines?this.element.classList.add("e-resize-lines"):this.element.classList.remove("e-resize-lines")},o.prototype.applyTextWrap=function(){if(this.allowTextWrap){var e=[].slice.call(this.element.querySelectorAll(".e-columnheader"));switch(this.textWrapSettings.wrapMode){case"Header":X(this.element,!1),X(this.getContent(),!1),X(e,!0);break;case"Content":X(this.getContent(),!0),X(this.element,!1),X(e,!1);break;default:X(this.element,!0),X(this.getContent(),!1),X(e,!1)}"Content"!==this.textWrapSettings.wrapMode&&this.notify(pi,{})}},o.prototype.removeTextWrap=function(){X(this.element,!1),X([].slice.call(this.element.querySelectorAll(".e-columnheader")),!1),X(this.getContent(),!1),"Content"!==this.textWrapSettings.wrapMode&&this.notify(pi,{})},o.prototype.createTooltip=function(){this.toolTipObj=new r.Tooltip({opensOn:"custom",content:""},this.element)},o.prototype.freezeRefresh=function(){this.isFreezeRefresh=!0,this.enableVirtualization&&(this.pageSettings.currentPage=1),this.componentRefresh()},o.prototype.getTooltipStatus=function(e){var t,i=this.getHeaderTable(),r=(this.getContentTable(),this.createTable(i,"e-gridheader","header")),n=this.createTable(i,"e-gridheader","content"),o=e.classList.contains("e-headercell")?r:n,s=e.classList.contains("e-headercell")?"th":"tr";return o.querySelector(s).className=e.className,o.querySelector(s).innerHTML=e.innerHTML,t=o.querySelector(s).getBoundingClientRect().width,document.body.removeChild(r),document.body.removeChild(n),t>e.getBoundingClientRect().width},o.prototype.mouseMoveHandler=function(e){if(this.isEllipsisTooltip()){var i=O(e.target,"e-ellipsistooltip");this.prevElement===i&&"mouseout"!==e.type||this.toolTipObj.close();var r=e.target.tagName,n=["A","BUTTON","INPUT"];if(i&&"mouseout"!==e.type&&(!t.Browser.isDevice||-1===n.indexOf(r))){if(i.getAttribute("aria-describedby"))return;this.getTooltipStatus(i)&&(i.getElementsByClassName("e-headertext").length?this.toolTipObj.content=i.getElementsByClassName("e-headertext")[0].innerText:this.toolTipObj.content=i.innerText,this.prevElement=i,this.toolTipObj.open(i))}}this.hoverFrozenRows(e)},o.prototype.hoverFrozenRows=function(e){if(this.isFrozenGrid()){var t=O(e.target,"e-row");if([].slice.call(this.element.querySelectorAll(".e-frozenhover")).length&&"mouseout"===e.type)for(var i=[].slice.call(this.element.querySelectorAll(".e-frozenhover")),r=0;r<i.length;r++)i[r].classList.remove("e-frozenhover");else if(t){(i=[].slice.call(this.element.querySelectorAll('tr[aria-rowindex="'+t.getAttribute("aria-rowindex")+'"]'))).splice(i.indexOf(t),1);for(r=0;r<i.length;r++)"true"!=t.getAttribute("aria-selected")&&i[r]?i[r].classList.add("e-frozenhover"):i[r]&&i[r].classList.remove("e-frozenhover")}}},o.prototype.isEllipsisTooltip=function(){var e=this.getColumns();if("EllipsisWithTooltip"===this.clipMode)return!0;for(var t=0;t<e.length;t++)if("EllipsisWithTooltip"===e[t].clipMode)return!0;return!1},o.prototype.scrollHandler=function(){this.isEllipsisTooltip()&&this.toolTipObj.close()},o.prototype.createTable=function(e,t,i){var r=this.createElement("div");r.className=this.element.className,r.style.cssText="display: inline-block;visibility:hidden;position:absolute";var n=this.createElement("div");n.className=t;var o=this.createElement("table");o.className=e.className,o.style.cssText="table-layout: auto;width: auto";var s="header"===i?"th":"td",l=this.createElement("tr"),a=this.createElement(s);return l.appendChild(a),o.appendChild(l),n.appendChild(o),r.appendChild(n),document.body.appendChild(r),r},o.prototype.onKeyPressed=function(e){"tab"!==e.action&&"shiftTab"!==e.action||this.toolTipObj.close()},o.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"dblclick",this.dblClickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),t.EventHandler.add(window,"resize",this.resetIndentWidth,this),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),t.EventHandler.add(this.getContent().firstElementChild,"scroll",this.scrollHandler,this),t.EventHandler.add(this.element,"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(this.element,"mouseout",this.mouseMoveHandler,this),t.EventHandler.add(this.getContent(),"touchstart",this.tapEvent,this),t.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)},o.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.mouseClickHandler),t.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"dblclick",this.dblClickHandler),t.EventHandler.remove(this.getContent().firstElementChild,"scroll",this.scrollHandler),t.EventHandler.remove(this.element,"mousemove",this.mouseMoveHandler),t.EventHandler.remove(this.element,"mouseout",this.mouseMoveHandler),t.EventHandler.remove(this.element,"keydown",this.keyPressHandler),t.EventHandler.remove(this.getContent(),"touchstart",this.tapEvent),t.EventHandler.remove(document.body,"keydown",this.keyDownHandler),t.EventHandler.remove(window,"resize",this.resetIndentWidth)},o.prototype.addListener=function(){this.isDestroyed||(this.on(Et,this.dataReady,this),this.on(Mt,this.recalcIndentWidth,this),this.on(Lt,this.recalcIndentWidth,this),this.dataBoundFunction=this.refreshMediaCol.bind(this),this.addEventListener(Ct,this.dataBoundFunction),this.on(qt,this.onKeyPressed,this),this.on(Mt,this.blazorTemplate,this))},o.prototype.removeListener=function(){this.isDestroyed||(this.off(Et,this.dataReady),this.off(Mt,this.recalcIndentWidth),this.off(Lt,this.recalcIndentWidth),this.removeEventListener(Ct,this.dataBoundFunction),this.off(qt,this.onKeyPressed))},o.prototype.blazorTemplate=function(){if(t.isBlazor()){this.pageSettings.template&&t.updateBlazorTemplate(this.element.id+"_template","Template",this.pageSettings);for(var e=0;e<this.columnModel.length;e++){if(this.columnModel[e].template&&t.updateBlazorTemplate(this.element.id+this.columnModel[e].uid,"Template",this.columnModel[e],!1),this.columnModel[e].headerTemplate&&t.updateBlazorTemplate(this.element.id+this.columnModel[e].uid+"headerTemplate","HeaderTemplate",this.columnModel[e],!1),"FilterBar"==this.filterSettings.type&&this.columnModel[e].filterTemplate){for(var i=this.columnModel[e].field,r=this.element.id+this.columnModel[e].uid+"filterTemplate",n=this.filterSettings.columns,o=0;o<n.length;o++)i==n[o].field&&(t.blazorTemplates[r][0][i]=n[o].value);t.updateBlazorTemplate(this.element.id+this.columnModel[e].uid+"filterTemplate","FilterTemplate",this.columnModel[e],!1)}"FilterBar"!=this.filterSettings.type&&this.columnModel[e].filterTemplate&&t.updateBlazorTemplate(this.element.id+this.columnModel[e].uid+"filterTemplate","FilterTemplate",this.columnModel[e])}this.groupSettings.captionTemplate&&t.updateBlazorTemplate(this.element.id+"captionTemplate","CaptionTemplate",this.groupSettings);for(o=0;o<this.aggregates.length;o++)for(var s=0;s<this.aggregates[o].columns.length;s++)this.aggregates[o].columns[s].footerTemplate&&t.updateBlazorTemplate(this.element.id+this.aggregates[o].columns[s].guid+"footerTemplate","FooterTemplate",this.aggregates[o].columns[s]),this.aggregates[o].columns[s].groupFooterTemplate&&t.updateBlazorTemplate(this.element.id+this.aggregates[o].columns[s].guid+"groupFooterTemplate","GroupFooterTemplate",this.aggregates[o].columns[s]),this.aggregates[o].columns[s].groupCaptionTemplate&&t.updateBlazorTemplate(this.element.id+this.aggregates[o].columns[s].guid+"groupCaptionTemplate","GroupCaptionTemplate",this.aggregates[o].columns[s])}},o.prototype.getCurrentViewRecords=function(){return pe(this)?t.isNullOrUndefined(this.currentViewData.records)?this.currentViewData:this.currentViewData.records:this.groupSettings.enableLazyLoading?this.currentViewData:this.allowGrouping&&this.groupSettings.columns.length&&this.currentViewData.length&&this.currentViewData.records?this.currentViewData.records:this.currentViewData},o.prototype.mouseClickHandler=function(e){if(!(this.isChildGrid(e)||O(e.target,"e-gridpopup")&&e.touches||this.element.querySelectorAll(".e-cloneproperties").length||this.checkEdit(e))&&((this.allowRowDragAndDrop||!O(e.target,"e-gridcontent")&&"TD"!==e.target.tagName)&&(this.allowGrouping||this.allowReordering||!O(e.target,"e-gridheader"))||!e.touches)){O(e.target,"e-gridheader")&&this.allowRowDragAndDrop&&!O(e.target,"e-filterbarcell")&&e.preventDefault();var i=this.getRowInfo(e.target);i.cancel=!1;var r=!1,n=t.closest(e.target,"tr");if(n&&n.getAttribute("data-uid")){var o=this.getRowObjectFromUID(n.getAttribute("data-uid"));r=!!o&&o.isDataRow}if(t.isBlazor()){var s=t.extend({},i.column);i={rowData:i.rowData,rowIndex:i.rowIndex,cellIndex:i.cellIndex,column:s}}r&&this.trigger("recordClick",i),this.notify(Ht,e)}},o.prototype.checkEdit=function(e){var t=O(e.target,"e-row"),i="Batch"!==this.editSettings.mode&&this.isEdit&&t&&(t.classList.contains("e-editedrow")||t.classList.contains("e-addedrow"));return!O(e.target,"e-unboundcelldiv")&&(i||O(e.target,"e-rowcell")&&O(e.target,"e-rowcell").classList.contains("e-editedbatchcell"))},o.prototype.dblClickHandler=function(e){var i=O(e.target,"e-grid");if(!t.isNullOrUndefined(i)&&i.id===this.element.id&&!t.closest(e.target,".e-unboundcelldiv")){var r=!1,n=t.closest(e.target,"tr");if(n&&n.getAttribute("data-uid")){var o=this.getRowObjectFromUID(n.getAttribute("data-uid"));r=!!o&&o.isDataRow}var s=this.getRowInfo(e.target);s.target=e.target,r&&this.trigger("recordDoubleClick",s),this.notify("dblclick",e)}},o.prototype.focusOutHandler=function(e){if(!this.isChildGrid(e)){O(e.target,"e-grid")||(this.element.querySelector(".e-gridpopup").style.display="None");var i=this.element.querySelector(".e-cancel:not(.e-hide)");i&&i.classList.add("e-hide");var r=e.relatedTarget,n=r?r.getAttribute("aria-owns"):null;r&&(O(r,"e-grid")||(!t.isNullOrUndefined(n)&&n)===e.target.getAttribute("aria-owns"))||this.keyPress||!this.isEdit||t.Browser.isDevice||("Batch"===this.editSettings.mode&&(this.editModule.saveCell(),this.notify("editNextValCell",{})),"Normal"===this.editSettings.mode&&this.editModule.editFormValidate()),this.keyPress=!1}},o.prototype.isChildGrid=function(e){var t=O(e.target,"e-grid");return!(!t||t.id===this.element.id)},o.prototype.mergePersistGridData=function(e){var i=this.getLocalData();if(!t.isNullOrUndefined(i)&&""!==i||!t.isNullOrUndefined(e)){var r=t.isNullOrUndefined(e)?JSON.parse(i):e;this.enableVirtualization&&(r.pageSettings.currentPage=1);var n=Object.keys(r);this.isProtectedOnChange=!0;for(var o=0,s=n;o<s.length;o++){var l=s[o];"object"!=typeof this[l]||t.isNullOrUndefined(this[l])?this[l]=r[l]:Array.isArray(this[l])&&"columns"===l?(t.isBlazor()&&this.isServerRendered||I(this[l]),this.mergeColumns(r[l],this[l]),this[l]=r[l]):t.extend(this[l],r[l])}this.isProtectedOnChange=!1}},o.prototype.mergeColumns=function(e,i){for(var r=e,n=this,o=0;o<r.length;o++)!function(e){var o=i.filter(function(t){return t.index===r[e].index})[0];if(!t.isNullOrUndefined(o))if(o.columns&&o.columns.length)n.mergeColumns(r[e].columns,o.columns),r[e]=t.extend(o,r[e],{},!0);else{if(t.isBlazor()){r[e].guid=o.guid,r[e].uid=o.uid}r[e]=t.extend(o,r[e],{},!0)}}(o)},o.prototype.isDetail=function(){return!t.isNullOrUndefined(this.detailTemplate)||!t.isNullOrUndefined(this.childGrid)},o.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},o.prototype.isForeignKeyEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isForeignKeyEnabled(e.columns):!(!e.dataSource||!e.foreignKeyValue)})},o.prototype.keyPressHandler=function(e){var i=t.extend(e,{cancel:!1});this.trigger("keyPressed",i),!0===i.cancel&&e.stopImmediatePropagation()},o.prototype.keyDownHandler=function(e){e.altKey&&(74===e.keyCode&&(this.keyA?(this.notify("group-collapse",{target:e.target,collapse:!1}),this.keyA=!1):(this.focusModule.focusHeader(),this.focusModule.addOutline())),87===e.keyCode&&(this.focusModule.focusContent(),this.focusModule.addOutline()),65===e.keyCode&&(this.keyA=!0),72===e.keyCode&&this.keyA&&(this.notify("group-collapse",{target:e.target,collapse:!0}),this.keyA=!1)),13===e.keyCode&&this.notify("enter-key-handler",e)},o.prototype.keyActionHandler=function(e){this.isChildGrid(e)||this.isEdit&&"escape"!==e.action&&"enter"!==e.action&&"shiftEnter"!==e.action&&"tab"!==e.action&&"shiftTab"!==e.action||(this.keyPress=!0,this.allowKeyboard&&("ctrlPlusP"===e.action&&(e.preventDefault(),this.print()),this.notify(qt,e)))},o.prototype.setInjectedModules=function(e){this.injectedModules=e},o.prototype.updateColumnObject=function(){T(this.columns,this.enableColumnVirtualization,this),t.isBlazor()&&this.isServerRendered||I(this.columns),this.initForeignColumn(),this.notify(Yt,{})},o.prototype.getForeignKeyColumns=function(){return this.getColumns().filter(function(e){return e.isForeignColumn()})},o.prototype.getRowHeight=function(){return this.rowHeight?this.rowHeight:V(this.element)},o.prototype.refreshColumns=function(){this.setFrozenCount();var e=this.getContent().querySelector(".e-frozen-left-content"),i=this.getContent().querySelector(".e-frozen-right-content"),r=!this.frozenRightCount&&!this.frozenLeftCount;if(!(0!==this.getFrozenColumns())&&(!e&&this.frozenLeftCount||!i&&this.frozenRightCount||e&&!this.frozenLeftCount||i&&!this.frozenRightCount))this.tableIndex=0,this.tablesCount=1,this.enableColumnVirtualization&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.freezeRefresh();else if(r&&(1===this.getFrozenColumns()&&!e||0===this.getFrozenColumns()&&e))this.tableIndex=0,this.tablesCount=1,this.enableColumnVirtualization&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.freezeRefresh();else if(this.isPreventScrollEvent=!0,this.updateColumnObject(),this.checkLockColumns(this.getColumns()),this.refresh(),this.isFrozenGrid()){var n=this.contentModule.getMovableContent().querySelector(".e-table");t.remove(n.querySelector("colgroup"));var o=this.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").cloneNode(!0);if(n.insertBefore(o,n.querySelector("tbody")),"Left-Right"===this.getFrozenMode()){var s=this.contentModule.getFrozenRightContent().querySelector(".e-table");t.remove(s.querySelector("colgroup"));var l=this.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("colgroup").cloneNode(!0);s.insertBefore(l,s.querySelector("tbody"))}}if(this.isFrozenGrid()){var a=this.getContent().querySelector(".e-movablescrollbar").scrollLeft;this.headerModule.getMovableHeader().scrollLeft=a,this.contentModule.getMovableContent().scrollLeft=a}},o.prototype.excelExport=function(e,i,r,n){return t.isBlazor()?(this.excelExportModule.Map(this,e,i,r,!1,n),null):this.excelExportModule?this.excelExportModule.Map(this,e,i,r,!1,n):null},o.prototype.csvExport=function(e,i,r,n){return t.isBlazor()?(this.excelExportModule.Map(this,e,i,r,!0,n),null):this.excelExportModule?this.excelExportModule.Map(this,e,i,r,!0,n):null},o.prototype.pdfExport=function(e,i,r,n){return t.isBlazor()?(this.pdfExportModule.Map(this,e,i,r,n),null):this.pdfExportModule?this.pdfExportModule.Map(this,e,i,r,n):null},o.prototype.groupColumn=function(e){this.groupModule&&this.groupModule.groupColumn(e)},o.prototype.groupExpandAll=function(){this.groupModule&&this.groupModule.expandAll()},o.prototype.groupCollapseAll=function(){this.groupModule&&this.groupModule.collapseAll()},o.prototype.clearGrouping=function(){this.groupModule&&this.groupModule.clearGrouping()},o.prototype.ungroupColumn=function(e){this.groupModule&&this.groupModule.ungroupColumn(e)},o.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},o.prototype.scrollRefresh=function(){var e=this,t=function(){e.scrollModule.refresh(),e.off(Mt,t)};this.on(Mt,t,this)},o.prototype.detailCollapseAll=function(){this.detailRowModule&&this.detailRowModule.collapseAll()},o.prototype.detailExpandAll=function(){this.detailRowModule&&this.detailRowModule.expandAll()},o.prototype.clearCellSelection=function(){this.selectionModule&&this.selectionModule.clearCellSelection()},o.prototype.clearRowSelection=function(){this.selectionModule&&this.selectionModule.clearRowSelection()},o.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},o.prototype.selectRowsByRange=function(e,t){this.selectionModule&&this.selectionModule.selectRowsByRange(e,t)},o.prototype.isContextMenuOpen=function(){return this.contextMenuModule&&this.contextMenuModule.isOpen},o.prototype.ensureModuleInjected=function(e){return this.getInjectedModules().indexOf(e)>=0},o.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},o.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.log(e,t)},o.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},o.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},o.prototype.hideScroll=function(){var e=this.getContent().querySelector(".e-content"),t=this.getContent().querySelector(".e-scrollbar");if(e.scrollHeight<=e.clientHeight&&(this.scrollModule.removePadding(),e.style.overflowY="auto"),this.isFrozenGrid()&&t){var i=this.getContent().querySelector(".e-movablescrollbar"),r=this.getContent().querySelector(".e-movablechild");t.style.display="flex",i.offsetWidth>=r.offsetWidth&&(t.style.display="none",this.notify("frozenHeight",0))}},o.prototype.getRowIndexByPrimaryKey=function(e){var t=this.getPrimaryKeyFieldNames()[0];e="object"==typeof e?e[t]:e;for(var i=0;i<this.getRowsObject().length;i++){var r=this.getRowsObject()[i].data[t];if(t.split(".").length>1&&(r=Qe(t,this.getRowsObject()[i].data)),r===e)return this.getRowsObject()[i].index}return-1},o.prototype.grabColumnByFieldFromAllCols=function(e){var t;this.columnModel=[],this.updateColumnModel(this.columns);for(var i=this.columnModel,r=0;r<i.length;r++)e===i[r].field&&(t=i[r]);return t},o.prototype.grabColumnByUidFromAllCols=function(e){var t;this.columnModel=[],this.updateColumnModel(this.columns);for(var i=this.columnModel,r=0;r<i.length;r++)e===i[r].uid&&(t=i[r]);return t},o.prototype.getFilteredRecords=function(){if(this.allowFiltering&&this.filterSettings.columns.length){var e=this.renderModule.data.generateQuery(!0);return this.dataSource&&this.renderModule.data.isRemote()&&this.dataSource instanceof i.DataManager?this.renderModule.data.getData(this.dataSource,e):this.dataSource instanceof i.DataManager?this.dataSource.executeLocal(e):new i.DataManager(this.dataSource,e).executeLocal(e)}return[]},o.prototype.getUserAgent=function(){var e=t.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},o.prototype.tapEvent=function(t){this.getUserAgent()&&(e.Global.timer?(clearTimeout(e.Global.timer),e.Global.timer=null,this.dblClickHandler(t),this.notify("double-tap",t)):e.Global.timer=setTimeout(function(){e.Global.timer=null},300))},o.prototype.getRowUid=function(e){return""+e+this.rowUid++},o.prototype.getMovableVirtualContent=function(){return this.getContent().querySelector(".e-movablecontent")},o.prototype.getFrozenVirtualContent=function(){return this.getContent().querySelector(".e-frozencontent")},o.prototype.getMovableVirtualHeader=function(){return this.getHeaderContent().querySelector(".e-movableheader")},o.prototype.getFrozenVirtualHeader=function(){return this.getHeaderContent().querySelector(".e-frozenheader")},o.prototype.getRowElementByUID=function(e){var t,i=[];if(this.isFrozenGrid()){var r=[].slice.call(this.getFrozenVirtualContent().querySelector("tbody").children),n=[].slice.call(this.getMovableVirtualContent().querySelector("tbody").children),o=[];if(3===this.tablesCount&&(o=[].slice.call(this.getContent().querySelector(".e-frozen-right-content").querySelector("tbody").children)),this.frozenRows){if(i=[].slice.call(this.getFrozenVirtualHeader().querySelector("tbody").children),i=i.concat([].slice.call(this.getMovableVirtualHeader().querySelector("tbody").children)),3===this.tablesCount){var s=this.getHeaderContent().querySelector(".e-frozen-right-header");i=i.concat([].slice.call(s.querySelector("tbody").children)).concat(o)}i=i.concat(r).concat(n)}else i=r.concat(n).concat(o)}else{var l=[].slice.call(this.getContent().querySelector("tbody").children);i=this.frozenRows?(i=[].slice.call(this.getHeaderContent().querySelector("tbody").children)).concat(l):l}for(var a=0,h=i;a<h.length;a++){var d=h[a];if(d.getAttribute("data-uid")===e){t=d;break}}return t},o.prototype.getHiddenColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var r=i[t];!1===r.visible&&e.push(r)}return e},o.prototype.calculatePageSizeByParentHeight=function(e){if(this.allowPaging&&(this.allowTextWrap&&"Header"==this.textWrapSettings.wrapMode||!this.allowTextWrap)){var t=0;if(-1!=e.indexOf("%")&&(e=parseInt(e)/100*this.element.clientHeight),e>this.getNoncontentHeight()+this.getRowHeight()){t=(e-this.getNoncontentHeight())/this.getRowHeight()}if(t>0)return Math.floor(t)}return 0},o.prototype.getNoncontentHeight=function(){var e=0;if(t.isNullOrUndefined(this.getHeaderContent().clientHeight)||(e+=this.getHeaderContent().clientHeight),this.toolbar&&!t.isNullOrUndefined(this.element.querySelector(".e-toolbar").clientHeight)&&(e+=this.element.querySelector(".e-toolbar").clientHeight),this.allowPaging&&!t.isNullOrUndefined(this.element.querySelector(".e-gridpager").clientHeight)&&(e+=this.element.querySelector(".e-gridpager").clientHeight),this.showColumnChooser&&!t.isNullOrUndefined(this.element.querySelector(".e-columnheader").clientHeight)&&(e+=this.element.querySelector(".e-columnheader").clientHeight),this.allowGrouping&&this.groupSettings.showDropArea&&!t.isNullOrUndefined(this.element.querySelector(".e-groupdroparea").clientHeight)&&(e+=this.element.querySelector(".e-groupdroparea").clientHeight),this.aggregates.length>0&&!t.isNullOrUndefined(this.element.querySelector(".e-summaryrow").clientHeight))for(var i=0;i<this.element.querySelectorAll(".e-summaryrow").length;i++)e+=this.element.querySelectorAll(".e-summaryrow")[i].clientHeight;return e},o.prototype.getSummaryValues=function(e,t){return i.DataUtil.aggregates[e.type.toLowerCase()](t,e.field)},o.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportGrid(e)},o.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportGrid(e)},o.prototype.exportGrid=function(e){var r=this,n=this,o=n.getDataModule().generateQuery(!0),s=(new i.UrlAdaptor).processQuery(new i.DataManager({url:""}),o).data,l=JSON.parse(this.addOnPersist(["allowGrouping","allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","groupSettings","columns","locale","searchSettings"]));l.filterSettings.columns=JSON.parse(s).where,l.columns.forEach(function(e){var i=n.getColumnByUid(e.uid);i&&(e.headerText=i.headerText,t.isNullOrUndefined(i.template)||(e.template="true"),e.format&&(e.format=We(r.getFormat(e.format),e.type,r.isExcel))),e.columns&&r.setHeaderText(e.columns)});var a=this.createElement("form",{id:"ExportForm",styles:"display:none;"}),h=this.createElement("input",{id:"gridInput",attrs:{name:"gridModel"}});h.value=JSON.stringify(l),a.method="POST",a.action=e,a.appendChild(h),document.body.appendChild(a),a.submit(),a.remove()},o.prototype.setHeaderText=function(e){for(var i=0;i<e.length;i++){var r=this.getColumnByUid(e[i].uid);e[i].headerText=r.headerText,t.isNullOrUndefined(r.template)||(e[i].template="true"),e[i].format&&(e[i].format=We(this.getFormat(e[i].format),e[i].type,this.isExcel)),e[i].columns&&this.setHeaderText(e[i].columns)}},o.prototype.getFormat=function(e){return"object"==typeof e?t.isNullOrUndefined(e.format)?e.skeleton:e.format:e},o.prototype.isCollapseStateEnabled=function(){return!1===this.isExpanded},o.prototype.updateRowValue=function(e,t){var i={requestType:"save",data:t};this.showSpinner(),this.notify($t,i),this.refresh()},o.prototype.setForeignKeyData=function(){this.dataBind();var e=this.getDataModule().getForeignKeyDataState();e.isPending?(this.getDataModule().setForeignKeyDataState({}),e.resolver()):(this.getDataModule().setForeignKeyDataState({isDataChanged:!1}),(this.contentModule||this.headerModule)&&this.renderModule.render())},o.prototype.resetFilterDlgPosition=function(e){var t=this.getColumnHeaderByField(e);if(t){var i=t.querySelector(".e-filtermenudiv"),r=this.element.querySelector(".e-filter-popup");if(i&&r){var n=this.element.getBoundingClientRect(),o=i.getBoundingClientRect();r&&(r.style.left=(o.right-n.left).toString()+"px")}}},o.prototype.renderTemplates=function(){this.notify("reactTemplateRender",this.portals),this.renderReactTemplates()},o.prototype.batchUpdate=function(e){this.processRowChanges(e)},o.prototype.batchAsyncUpdate=function(e){this.processBulkRowChanges(e)},o.prototype.processBulkRowChanges=function(e){var t=this;if(this.dataToBeUpdated)for(var i=["addedRecords","changedRecords","deletedRecords"],r=this.getPrimaryKeyFieldNames()[0],n=0;n<i.length;n++)e[i[n]]&&Ae(this,e,i[n],r);else this.dataToBeUpdated=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e),setTimeout(function(){t.processRowChanges(t.dataToBeUpdated),t.dataToBeUpdated=null},this.asyncTimeOut)},o.prototype.processRowChanges=function(e){var t=this,i=this.getPrimaryKeyFieldNames()[0];e=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e);var r=this.getDataModule().saveChanges(e,i,{},this.getDataModule().generateQuery().requiresCount());this.getDataModule().isRemote()?r.then(function(e){t.setNewData()}):this.setNewData()},o.prototype.setNewData=function(){var e=this,t=JSON.parse(JSON.stringify(this.getCurrentViewRecords()));this.getDataModule().getData({},this.getDataModule().generateQuery().requiresCount()).then(function(i){e.bulkRefresh(i.result,t,i.count)})},o.prototype.deleteRowElement=function(e){var i=this.getRowElementByUID(e.uid),r=parseInt(i.getAttribute("aria-rowindex"),10);if(t.remove(i),this.getFrozenColumns()){var n=this.getMovableRows()[r];t.remove(n)}},o.prototype.bulkRefresh=function(e,t,i){for(var r,n=this,o=this.getRowsObject(),s=this.getPrimaryKeyFieldNames()[0],l=this,a=0;a<o.length;a++)!function(t){e.filter(function(e){return e[s]===o[t].data[s]}).length||(l.deleteRowElement(o[t]),o.splice(t,1),t--),r=t}(a),a=r;for(var h=this,a=0;a<e.length;a++)!function(i){var r;t.filter(function(t){t[s]===e[i][s]&&(t!==e[i]&&n.setRowData(e[i][s],e[i]),r=!0)}),r||h.renderRowElement(e[i],i)}(a);this.currentViewData=e;var d=[].slice.call(this.getContentTable().querySelectorAll(".e-row"));De(this,this.getRowsObject(),d),Be(this),this.allowPaging&&this.notify(At,{module:"pager",properties:{totalRecordsCount:i}})},o.prototype.renderRowElement=function(e,t){var i,r=new vi(this.serviceLocator,null,this),n=new Ci(this).generateRows([e]),o=r.render(n[0],this.getColumns());this.addRowObject(n[0],t);var s=this.getContentTable().querySelector("tbody");if(s.querySelector(".e-emptyrow")){var l=s.querySelector(".e-emptyrow");if(l.parentNode.removeChild(l),this.getFrozenColumns()){var a=this.getContent().querySelector(".e-movablecontent").querySelector("tbody");a.firstElementChild.parentNode.removeChild(a.firstElementChild)}}this.getFrozenColumns()&&(i=de(o,this.getFrozenColumns(),this),(this.frozenRows&&t<this.frozenRows?this.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody"):this.getContent().querySelector(".e-movablecontent").querySelector("tbody")).appendChild(i),"auto"===this.height&&this.notify("frozenHeight",{})),s=this.frozenRows&&t<this.frozenRows?this.getHeaderContent().querySelector("tbody"):this.getContent().querySelector("tbody"),(s=this.getContent().querySelector("tbody")).appendChild(o)},o.prototype.addRowObject=function(e,t){var i=this.getFrozenColumns();if(i){var r=this.getMovableRowsObject(),n=e.clone();n.cells=n.cells.slice(i),e.cells=e.cells.slice(0,i),r.splice(t,1,n)}this.getRowsObject().splice(t,1,e)},o.prototype.getHeight=function(e){return e=Number.isInteger(e)||-1==e.indexOf("%")?Number.isInteger(e)||"auto"===this.height?this.height:parseInt(e):parseInt(e)/100*this.element.clientHeight},o.prototype.getFrozenRightContent=function(){return this.getContent().querySelector(".e-frozen-right-content")},o.prototype.getFrozenRightHeader=function(){return this.getHeaderContent().querySelector(".e-frozen-right-header")},o.prototype.getMovableHeaderTbody=function(){return this.getMovableVirtualHeader().querySelector("tbody")},o.prototype.getMovableContentTbody=function(){return this.getMovableVirtualContent().querySelector("tbody")},o.prototype.getFrozenHeaderTbody=function(){return this.getFrozenVirtualHeader().querySelector("tbody")},o.prototype.getFrozenLeftContentTbody=function(){return this.getFrozenVirtualContent().querySelector("tbody")},o.prototype.getFrozenRightHeaderTbody=function(){return this.getFrozenRightHeader().querySelector("tbody")},o.prototype.getFrozenRightContentTbody=function(){var e;return this.getFrozenRightContent()&&(e=this.getFrozenRightContent().querySelector("tbody")),e},o.prototype.showResponsiveCustomFilter=function(){this.filterModule&&this.filterModule.showCustomFilter()},o.prototype.showResponsiveCustomSort=function(){this.sortModule&&this.sortModule.showCustomFilter()};var s;return Ar([t.Property()],o.prototype,"parentDetails",void 0),Ar([t.Property([])],o.prototype,"columns",void 0),Ar([t.Property(!0)],o.prototype,"enableAltRow",void 0),Ar([t.Property(!0)],o.prototype,"enableHover",void 0),Ar([t.Property(!1)],o.prototype,"enableAutoFill",void 0),Ar([t.Property(!0)],o.prototype,"allowKeyboard",void 0),Ar([t.Property(!1)],o.prototype,"allowTextWrap",void 0),Ar([t.Complex({},jr)],o.prototype,"textWrapSettings",void 0),Ar([t.Complex({},Vr)],o.prototype,"resizeSettings",void 0),Ar([t.Property(!1)],o.prototype,"allowPaging",void 0),Ar([t.Complex({},mr)],o.prototype,"pageSettings",void 0),Ar([t.Property(!1)],o.prototype,"enableVirtualization",void 0),Ar([t.Property(!1)],o.prototype,"enableColumnVirtualization",void 0),Ar([t.Property(!1)],o.prototype,"enableInfiniteScrolling",void 0),Ar([t.Complex({},Hr)],o.prototype,"searchSettings",void 0),Ar([t.Property(!1)],o.prototype,"allowSorting",void 0),Ar([t.Property("Ellipsis")],o.prototype,"clipMode",void 0),Ar([t.Property(!0)],o.prototype,"allowMultiSorting",void 0),Ar([t.Property(!1)],o.prototype,"allowExcelExport",void 0),Ar([t.Property(!1)],o.prototype,"allowPdfExport",void 0),Ar([t.Complex({},kr)],o.prototype,"sortSettings",void 0),Ar([t.Complex({},Pr)],o.prototype,"infiniteScrollSettings",void 0),Ar([t.Property(!0)],o.prototype,"allowSelection",void 0),Ar([t.Property(-1)],o.prototype,"selectedRowIndex",void 0),Ar([t.Complex({},qr)],o.prototype,"selectionSettings",void 0),Ar([t.Property(!1)],o.prototype,"allowFiltering",void 0),Ar([t.Property("Horizontal")],o.prototype,"rowRenderingMode",void 0),Ar([t.Property(!1)],o.prototype,"enableAdaptiveUI",void 0),Ar([t.Property(!1)],o.prototype,"allowReordering",void 0),Ar([t.Property(!1)],o.prototype,"allowResizing",void 0),Ar([t.Property(!1)],o.prototype,"allowRowDragAndDrop",void 0),Ar([t.Complex({},Ur)],o.prototype,"rowDropSettings",void 0),Ar([t.Complex({},Nr)],o.prototype,"filterSettings",void 0),Ar([t.Property(!1)],o.prototype,"allowGrouping",void 0),Ar([t.Property(!1)],o.prototype,"enableImmutableMode",void 0),Ar([t.Property(!1)],o.prototype,"showColumnMenu",void 0),Ar([t.Complex({},Gr)],o.prototype,"groupSettings",void 0),Ar([t.Complex({},_r)],o.prototype,"editSettings",void 0),Ar([t.Collection([],Tr)],o.prototype,"aggregates",void 0),Ar([t.Property(!1)],o.prototype,"showColumnChooser",void 0),Ar([t.Complex({},Cr)],o.prototype,"columnChooserSettings",void 0),Ar([t.Property(!1)],o.prototype,"enableHeaderFocus",void 0),Ar([t.Property("auto")],o.prototype,"height",void 0),Ar([t.Property("auto")],o.prototype,"width",void 0),Ar([t.Property("Default")],o.prototype,"gridLines",void 0),Ar([t.Property()],o.prototype,"rowTemplate",void 0),Ar([t.Property()],o.prototype,"detailTemplate",void 0),Ar([t.Property()],o.prototype,"childGrid",void 0),Ar([t.Property()],o.prototype,"queryString",void 0),Ar([t.Property("AllPages")],o.prototype,"printMode",void 0),Ar([t.Property("Expanded")],o.prototype,"hierarchyPrintMode",void 0),Ar([t.Property([])],o.prototype,"dataSource",void 0),Ar([t.Property(null)],o.prototype,"rowHeight",void 0),Ar([t.Property()],o.prototype,"query",void 0),Ar([t.Property("USD")],o.prototype,"currencyCode",void 0),Ar([t.Property()],o.prototype,"toolbar",void 0),Ar([t.Property()],o.prototype,"contextMenuItems",void 0),Ar([t.Property()],o.prototype,"columnMenuItems",void 0),Ar([t.Property()],o.prototype,"toolbarTemplate",void 0),Ar([t.Property()],o.prototype,"pagerTemplate",void 0),Ar([t.Property(0)],o.prototype,"frozenRows",void 0),Ar([t.Property(0)],o.prototype,"frozenColumns",void 0),Ar([t.Property("All")],o.prototype,"columnQueryMode",void 0),Ar([t.Property({})],o.prototype,"currentAction",void 0),Ar([t.Property("19.1.57")],o.prototype,"ej2StatePersistenceVersion",void 0),Ar([t.Event()],o.prototype,"created",void 0),Ar([t.Event()],o.prototype,"destroyed",void 0),Ar([t.Event()],o.prototype,"load",void 0),Ar([t.Event()],o.prototype,"rowDataBound",void 0),Ar([t.Event()],o.prototype,"queryCellInfo",void 0),Ar([t.Event()],o.prototype,"headerCellInfo",void 0),Ar([t.Event()],o.prototype,"actionBegin",void 0),Ar([t.Event()],o.prototype,"actionComplete",void 0),Ar([t.Event()],o.prototype,"actionFailure",void 0),Ar([t.Event()],o.prototype,"dataBound",void 0),Ar([t.Event()],o.prototype,"recordDoubleClick",void 0),Ar([t.Event()],o.prototype,"recordClick",void 0),Ar([t.Event()],o.prototype,"rowSelecting",void 0),Ar([t.Event()],o.prototype,"rowSelected",void 0),Ar([t.Event()],o.prototype,"rowDeselecting",void 0),Ar([t.Event()],o.prototype,"rowDeselected",void 0),Ar([t.Event()],o.prototype,"cellSelecting",void 0),Ar([t.Event()],o.prototype,"cellSelected",void 0),Ar([t.Event()],o.prototype,"cellDeselecting",void 0),Ar([t.Event()],o.prototype,"cellDeselected",void 0),Ar([t.Event()],o.prototype,"columnSelecting",void 0),Ar([t.Event()],o.prototype,"columnSelected",void 0),Ar([t.Event()],o.prototype,"columnDeselecting",void 0),Ar([t.Event()],o.prototype,"columnDeselected",void 0),Ar([t.Event()],o.prototype,"columnDragStart",void 0),Ar([t.Event()],o.prototype,"columnDrag",void 0),Ar([t.Event()],o.prototype,"columnDrop",void 0),Ar([t.Event()],o.prototype,"printComplete",void 0),Ar([t.Event()],o.prototype,"beforePrint",void 0),Ar([t.Event()],o.prototype,"pdfQueryCellInfo",void 0),Ar([t.Event()],o.prototype,"pdfHeaderQueryCellInfo",void 0),Ar([t.Event()],o.prototype,"pdfAggregateQueryCellInfo",void 0),Ar([t.Event()],o.prototype,"excelAggregateQueryCellInfo",void 0),Ar([t.Event()],o.prototype,"exportDetailDataBound",void 0),Ar([t.Event()],o.prototype,"excelQueryCellInfo",void 0),Ar([t.Event()],o.prototype,"excelHeaderQueryCellInfo",void 0),Ar([t.Event()],o.prototype,"beforeExcelExport",void 0),Ar([t.Event()],o.prototype,"excelExportComplete",void 0),Ar([t.Event()],o.prototype,"beforePdfExport",void 0),Ar([t.Event()],o.prototype,"pdfExportComplete",void 0),Ar([t.Event()],o.prototype,"rowDragStartHelper",void 0),Ar([t.Event()],o.prototype,"detailDataBound",void 0),Ar([t.Event()],o.prototype,"rowDragStart",void 0),Ar([t.Event()],o.prototype,"rowDrag",void 0),Ar([t.Event()],o.prototype,"rowDrop",void 0),Ar([t.Event()],o.prototype,"toolbarClick",void 0),Ar([t.Event()],o.prototype,"beforeOpenColumnChooser",void 0),Ar([t.Event()],o.prototype,"batchAdd",void 0),Ar([t.Event()],o.prototype,"batchDelete",void 0),Ar([t.Event()],o.prototype,"batchCancel",void 0),Ar([t.Event()],o.prototype,"beforeBatchAdd",void 0),Ar([t.Event()],o.prototype,"beforeBatchDelete",void 0),Ar([t.Event()],o.prototype,"beforeBatchSave",void 0),Ar([t.Event()],o.prototype,"beginEdit",void 0),Ar([t.Event()],o.prototype,"commandClick",void 0),Ar([t.Event()],o.prototype,"cellEdit",void 0),Ar([t.Event()],o.prototype,"cellSave",void 0),Ar([t.Event()],o.prototype,"cellSaved",void 0),Ar([t.Event()],o.prototype,"resizeStart",void 0),Ar([t.Event()],o.prototype,"resizing",void 0),Ar([t.Event()],o.prototype,"resizeStop",void 0),Ar([t.Event()],o.prototype,"keyPressed",void 0),Ar([t.Event()],o.prototype,"beforeDataBound",void 0),Ar([t.Event()],o.prototype,"contextMenuOpen",void 0),Ar([t.Event()],o.prototype,"contextMenuClick",void 0),Ar([t.Event()],o.prototype,"columnMenuOpen",void 0),Ar([t.Event()],o.prototype,"columnMenuClick",void 0),Ar([t.Event()],o.prototype,"checkBoxChange",void 0),Ar([t.Event()],o.prototype,"beforeCopy",void 0),Ar([t.Event()],o.prototype,"beforePaste",void 0),Ar([t.Event()],o.prototype,"beforeAutoFill",void 0),Ar([t.Event()],o.prototype,"columnDataStateChange",void 0),Ar([t.Event()],o.prototype,"dataStateChange",void 0),Ar([t.Event()],o.prototype,"dataSourceChanged",void 0),Ar([t.Event()],o.prototype,"exportGroupCaption",void 0),Ar([t.Event()],o.prototype,"lazyLoadGroupExpand",void 0),Ar([t.Event()],o.prototype,"lazyLoadGroupCollapse",void 0),o=s=Ar([t.NotifyPropertyChanges],o)}(t.Component),Kr=function(){function e(e,t){this.isAsyncPrint=!1,this.defered=new i.Deferred,this.parent=e,this.parent.isDestroyed||(this.parent.on(Mt,this.isContentReady(),this),this.parent.addEventListener(yt,this.actionBegin.bind(this)),this.parent.on(Ot,this.onEmpty.bind(this)),this.parent.on(ri,this.hierarchyPrint,this),this.scrollModule=t)}return e.prototype.isContentReady=function(){var e=this;return!this.isPrintGrid()||"None"!==this.parent.hierarchyPrintMode&&this.parent.childGrid?function(){e.defered.promise.then(function(){e.contentReady()}),e.isPrintGrid()&&e.hierarchyPrint()}:this.contentReady},e.prototype.hierarchyPrint=function(){this.removeColGroup(this.parent);var e=window.printGridObj;e&&!e.element.querySelector("[aria-busy=true")&&e.printModule.defered.resolve()},e.prototype.print=function(){this.renderPrintGrid(),this.printWind=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWind.moveTo(0,0),this.printWind.resizeTo(screen.availWidth,screen.availHeight)},e.prototype.onEmpty=function(){this.isPrintGrid()&&this.contentReady()},e.prototype.actionBegin=function(){this.isPrintGrid()&&(this.isAsyncPrint=!0)},e.prototype.renderPrintGrid=function(){var e=this.parent,i=t.createElement("div",{id:this.parent.element.id+"_print",className:e.element.className+" e-print-grid"});document.body.appendChild(i);var r=new Wr(fe(e,e.hierarchyPrintMode));if(e.isFrozenGrid()&&!e.getFrozenColumns())for(var n=0;n<r.columns.length;n++)r.columns[n]=t.extend({},r.columns[n]),r.columns[n].freeze=void 0;this.parent.isAngular&&(r.viewContainerRef=this.parent.viewContainerRef),r.load=function(){},r.query=e.getQuery().clone(),window.printGridObj=r,r.isPrinting=!0;var o=r.getInjectedModules(),s=e.getInjectedModules();o&&o.length===s.length||r.setInjectedModules(s),e.notify("printGrid-Init",{element:i,printgrid:r}),this.parent.log("exporting_begin",this.getModuleName()),r.registeredTemplate=this.parent.registeredTemplate,r.appendTo(i),r.trigger=e.trigger},e.prototype.contentReady=function(){if(this.isPrintGrid()){var e=this.parent;if(this.isAsyncPrint)return void this.printGrid();var i={requestType:"print",element:e.element,selectedRows:e.getContentTable().querySelectorAll('tr[aria-selected="true"]'),cancel:!1,hierarchyPrintMode:e.hierarchyPrintMode};if(this.isAsyncPrint||e.trigger("beforePrint",i),i.cancel)return void t.detach(e.element);this.isAsyncPrint||this.printGrid()}},e.prototype.printGrid=function(){var e=this.parent;if("auto"!==e.height){var i=this.scrollModule.getCssProperties(),r=e.element.querySelector(".e-content"),n=e.element.querySelector(".e-gridheader");r.style.height="auto",r.style.overflowY="auto",n.style[i.padding]="",n.firstElementChild.style[i.border]=""}e.allowGrouping&&(e.groupSettings.columns.length?this.removeColGroup(e):e.element.querySelector(".e-groupdroparea").style.display="none");for(var o=0,s=[].slice.call(e.element.querySelectorAll(".e-content"));o<s.length;o++)(d=s[o]).style.overflowX="hidden";for(var l=e.element.querySelectorAll(".e-spin-show"),a=0,h=[].slice.call(l);a<h.length;a++){var d=h[a];t.classList(d,["e-spin-hide"],["e-spin-show"])}this.printGridElement(e),e.isPrinting=!1,delete window.printGridObj;var p={element:e.element};e.trigger("printComplete",p),this.parent.log("exporting_complete",this.getModuleName())},e.prototype.printGridElement=function(e){t.classList(e.element,["e-print-grid-layout"],["e-print-grid"]),e.isPrinting&&t.detach(e.element),this.printWind=t.print(e.element,this.printWind)},e.prototype.removeColGroup=function(e){var i=e.groupSettings.columns.length,r=e.element,n="#"+e.element.id;if(i){for(var o=t.selectAll(n+"captioncell.e-groupcaption",r),s=o[i-1].getAttribute("colspan"),l=0;l<o.length;l++)o[l].setAttribute("colspan",s);var a=t.selectAll("colgroup"+n+"colGroup",r),h=t.selectAll(".e-content colgroup",r);this.hideColGroup(a,i),this.hideColGroup(h,i)}},e.prototype.hideColGroup=function(e,t){for(var i=0;i<e.length;i++)for(var r=0;r<t;r++)e[i].children[r].style.display="none"},e.prototype.isPrintGrid=function(){return this.parent.element.id.indexOf("_print")>0&&this.parent.isPrinting},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Mt,this.contentReady.bind(this)),this.parent.removeEventListener(yt,this.actionBegin.bind(this)),this.parent.off(Ot,this.onEmpty.bind(this)),this.parent.off(ri,this.hierarchyPrint))},e.prototype.getModuleName=function(){return"print"},e.printGridProp=["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound"].concat(["beforePrint","printComplete","load"]),e}(),Qr=0,Jr=0,Xr=null;!function(e){e.timer=null}(e.Global||(e.Global={}));var Yr=function(){function e(e){this.existingPredicate={},this.foreignKeyQuery=new i.Query,this.filterState=!0,this.values={},this.renderEmpty=!1,this.parent=e,this.id=this.parent.element.id,this.valueFormatter=new ut(this.parent.locale),this.cBoxTrue=n.createCheckBox(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=n.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"])}return e.prototype.destroy=function(){this.closeDialog()},e.prototype.wireEvents=function(){t.EventHandler.add(this.dlg,"click",this.clickHandler,this),t.EventHandler.add(this.dlg,"keyup",this.keyupHandler,this),this.searchHandler=t.debounce(this.searchBoxKeyUp,200);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&t.EventHandler.add(e,"keyup",this.searchHandler,this)},e.prototype.unWireEvents=function(){t.EventHandler.remove(this.dlg,"click",this.clickHandler),t.EventHandler.remove(this.dlg,"keyup",this.keyupHandler);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&t.EventHandler.remove(e,"keyup",this.searchHandler)},e.prototype.foreignKeyFilter=function(e,t,i){var r=this,n={},o=[],s=this.foreignKeyQuery.clone();this.options.column.dataSource.executeQuery(s.where(i)).then(function(i){r.options.column.columnData=i.result,r.parent.notify("generateQuery",{predicate:n,column:r.options.column}),e.ejpredicate=n.predicate.predicates;for(var s=n.predicate.predicates,l=0;l<s.length;l++)o.push({field:s[l].field,predicate:"or",matchCase:s[l].ignoreCase,ignoreAccent:s[l].ignoreAccent,operator:s[l].operator,value:s[l].value,type:r.options.type});e.filterCollection=o.length?o:t.filter(function(e){return e.field=r.options.field}),r.options.handler(e)})},e.prototype.foreignFilter=function(e,t){var r=this.options.isRemote?"string"===this.options.column.type?"contains":"equal":this.options.column.type?"contains":"equal",n=new i.Predicate(this.options.column.foreignKeyValue,r,t,!0,this.options.ignoreAccent);this.foreignKeyFilter(e,[e.filterCollection],n)},e.prototype.searchBoxClick=function(e){e.target.classList.contains("e-searchclear")&&(this.sInput.value="",this.refreshCheckboxes(),this.updateSearchIcon(),this.sInput.focus())},e.prototype.searchBoxKeyUp=function(e){this.refreshCheckboxes(),this.updateSearchIcon()},e.prototype.updateSearchIcon=function(){this.sInput.value.length?t.classList(this.sIcon,["e-chkcancel-icon"],["e-search-icon"]):t.classList(this.sIcon,["e-search-icon"],["e-chkcancel-icon"])},e.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},e.prototype.updateDataSource=function(){var e=this.options.dataSource;if(!(e instanceof i.DataManager))for(var t=0;t<e.length;t++)if("object"!=typeof e){var r={};r[this.options.field]=e[t],e[t]=r}},e.prototype.updateModel=function(e){this.options=e,this.existingPredicate=e.actualPredicate||{},this.options.dataSource=e.dataSource,this.options.dataManager=e.dataManager?e.dataManager:e.dataSource,this.updateDataSource(),this.options.type=e.type,this.options.format=e.format||"",this.options.ignoreAccent=e.ignoreAccent||!1,this.options.filteredColumns=e.filteredColumns||this.parent.filterSettings.columns,this.options.query=e.query||new i.Query,this.options.allowCaseSensitive=e.allowCaseSensitive||!1,this.options.uid=e.column.uid,this.values={},this.localeObj=e.localeObj,this.isFiltered=e.filteredColumns.length},e.prototype.getAndSetChkElem=function(e){if(this.dlg=this.parent.createElement("div",{id:this.id+this.options.type+"_excelDlg",attrs:{uid:this.options.column.uid},className:"e-checkboxfilter e-filter-popup"}),this.sBox=this.parent.createElement("div",{className:"e-searchcontainer"}),!e.hideSearchbox){this.sInput=this.parent.createElement("input",{id:this.id+"_SearchBox",className:"e-searchinput"}),this.sIcon=this.parent.createElement("span",{className:"e-searchclear e-search-icon e-icons e-input-group-icon",attrs:{type:"text",title:this.getLocalizedLabel("Search")}}),this.searchBox=this.parent.createElement("span",{className:"e-searchbox e-fields"}),this.searchBox.appendChild(this.sInput),this.sBox.appendChild(this.searchBox);var t={element:this.sInput,floatLabelType:"Never",properties:{placeholder:this.getLocalizedLabel("Search")}};o.Input.createInput(t,this.parent.createElement),this.searchBox.querySelector(".e-input-group").appendChild(this.sIcon)}return this.spinner=this.parent.createElement("div",{className:"e-spinner"}),this.cBox=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxList",className:"e-checkboxlist e-fields"}),this.spinner.appendChild(this.cBox),this.sBox.appendChild(this.spinner),this.sBox},e.prototype.showDialog=function(e){var i={requestType:"filterbeforeopen",columnName:this.options.field,columnType:this.options.type,cancel:!1};if(!t.isBlazor()||this.parent.isJsComponent){i.filterModel=this}if(this.parent.notify("cbox-filter-begin",i),!i.cancel){this.dialogObj=new r.Dialog({visible:!1,content:this.sBox,close:this.closeDialog.bind(this),width:!t.isNullOrUndefined(O(e.target,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:255,target:this.parent.element,animationSettings:{effect:"None"},buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:"e-flat",content:this.getLocalizedLabel(this.isExcel?"CancelButton":"ClearButton")}}],created:this.dialogCreated.bind(this),open:this.dialogOpen.bind(this)});this.dialogObj.isStringTemplate=!0,this.renderResponsiveFilter(e),this.dlg.setAttribute("aria-label",this.getLocalizedLabel("ExcelFilterDialogARIA")),e.isResponsiveFilter?document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv").appendChild(this.dlg):this.parent.element.appendChild(this.dlg),this.dialogObj.appendTo(this.dlg),this.dialogObj.element.style.maxHeight=e.isResponsiveFilter?"none":this.options.height+"px",this.dialogObj.show(),this.dialogObj.element.querySelector(".e-dlg-content").appendChild(this.sBox),this.wireEvents(),r.createSpinner({target:this.spinner},this.parent.createElement),r.showSpinner(this.spinner),this.getAllData()}},e.prototype.renderResponsiveFilter=function(e){e.isResponsiveFilter&&(this.dialogObj.buttons=[{}],this.dialogObj.position={X:"",Y:""},this.dialogObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dialogObj.width="100%")},e.prototype.dialogCreated=function(e){this.options.isResponsiveFilter?this.dialogObj.element.style.left="0px":t.Browser.isDevice?this.dialogObj.position={X:"center",Y:"center"}:ee(this.options.target,this.dialogObj,this.parent),this.parent.notify("filterDialogCreated",e)},e.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},e.prototype.closeDialog=function(){if(this.dialogObj&&!this.dialogObj.isDestroyed){var e=this.options.columns.filter(function(e){return e.getFilterItemTemplate()}),i=this.parent.registeredTemplate;e.length&&!t.isNullOrUndefined(i)&&i.filterItemTemplate&&this.parent.destroyTemplate(["filterItemTemplate"]),this.parent.isReact&&(this.parent.destroyTemplate(["filterItemTemplate"]),this.parent.renderTemplates()),this.parent.notify("filter-menu-close",{field:this.options.field}),this.dialogObj.destroy(),this.unWireEvents(),t.remove(this.dlg),this.dlg=null,this.parent.notify("filter-dialog-close",{})}},e.prototype.clearFilter=function(e){var t={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(ai,t),t.cancel||this.options.handler({action:"clear-filter",field:e?e.field:this.options.field})},e.prototype.btnClick=function(e){if(this.filterState){if("input"===e.target.tagName.toLowerCase()&&e.target.classList.contains("e-searchinput")){var t=e.target.value;"boolean"===this.options.column.type&&(""!==t&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(t.toLowerCase())?t=!0:""!==t&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(t.toLowerCase())&&(t=!1));var i={action:"filtering",filterCollection:{field:this.options.field,operator:this.options.isRemote?"string"===this.options.column.type?"contains":"equal":"date"===this.options.column.type||"datetime"===this.options.column.type||"boolean"===this.options.column.type?"equal":"contains",value:t,matchCase:!1,type:this.options.column.type},field:this.options.field};void 0!==t&&null!==t&&""!==t?this.isForeignColumn(this.options.column)?this.foreignFilter(i,t):this.options.handler(i):this.closeDialog()}else if(13===e.keyCode)this.fltrBtnHandler();else{var r=e.target.firstChild.textContent.toLowerCase();this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton").toLowerCase()===r?this.fltrBtnHandler():this.getLocalizedLabel("ClearButton").toLowerCase()===r&&this.clearFilter()}this.closeDialog()}else"input"!==e.target.tagName.toLowerCase()&&(this.clearFilter(),this.closeDialog())},e.prototype.fltrBtnHandler=function(){var i=[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall)")),r=i,n="equal",o=this.dialogObj.element.querySelector(".e-dropdownlist");o&&(this.options.operator=n=o.ej2_instances[0].value),this.isMenuNotEqual="notequal"===this.options.operator;var s;this.options.hideSearchbox||(s=this.searchBox.querySelector(".e-searchinput"));var l=this.options.allowCaseSensitive,a={field:this.options.field,predicate:this.isMenuNotEqual?"and":"or",uid:this.options.uid,operator:n,type:this.options.type,matchCase:l,ignoreAccent:this.options.ignoreAccent},h=this.itemsCnt!==i.length&&this.itemsCnt-i.length<i.length;h&&s&&""===s.value&&(n=this.isMenuNotEqual?"equal":"notequal",i=[].slice.call(this.cBox.querySelectorAll(".e-uncheck:not(.e-selectall)")),a.predicate=this.isMenuNotEqual?"or":"and",a.operator=n);var d,p,c,u,g=[];if(i.length!==this.itemsCnt||s&&s.value&&""!==s.value){for(var f=0;f<i.length;f++){d=this.values[O(i[f],"e-ftrchk").getAttribute("uid")],u=t.extend({},{value:d},a),d&&!d.toString().length&&(u.operator=h?"notequal":"equal"),""===d||t.isNullOrUndefined(d)?g=g.concat(e.generateNullValuePredicates(a)):g.push(u);var m={instance:this,handler:this.fltrBtnHandler,arg1:u.field,arg2:u.predicate,arg3:u.operator,arg4:u.matchCase,arg5:u.ignoreAccent,arg6:u.value,cancel:!1};if(this.parent.notify(ai,m),m.cancel)return}"date"!==this.options.type&&"datetime"!==this.options.type||(c=r.length-1,p=this.values[O(r[c],"e-ftrchk").getAttribute("uid")],t.isNullOrUndefined(p)&&h&&g.push({field:a.field,matchCase:a.matchCase,operator:"equal",predicate:"and",value:null})),this.initiateFilter(g)}else this.clearFilter()},e.generateNullValuePredicates=function(e){var t=[];return"string"===e.type&&t.push({field:e.field,ignoreAccent:e.ignoreAccent,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:""}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:null}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:void 0}),t},e.prototype.initiateFilter=function(e){var r,n=e[0];if(!t.isNullOrUndefined(n)){r=n.ejpredicate?n.ejpredicate:new i.Predicate(n.field,n.operator,n.value,!n.matchCase,n.ignoreAccent);for(var o=1;o<e.length;o++)r=void 0!==e[o].ejpredicate?r[e[o].predicate](e[o].ejpredicate):r[e[o].predicate](e[o].field,e[o].operator,e[o].value,!e[o].matchCase,e[o].ignoreAccent);var s={action:"filtering",filterCollection:e,field:this.options.field,ejpredicate:i.Predicate.or(r)};this.options.handler(s)}},e.prototype.isForeignColumn=function(e){return!!e.isForeignColumn&&e.isForeignColumn()},e.prototype.refreshCheckboxes=function(){var e=this,n=this.sInput.value,o=this.options.column,s=this.isForeignColumn(o)?this.foreignKeyQuery.clone():this.options.query.clone(),l=this.options.query.clone(),a=s.queries.filter(function(e){return e&&"onWhere"===e.fn})[0];s.queries=[],l.queries=[];var h="string"!==this.options.type&&parseFloat(n)?parseFloat(n):n,d=this.options.isRemote?"string"===this.options.type?"contains":"equal":this.options.type?"contains":"equal",p=this.options.ignoreAccent,c=this.isForeignColumn(o)?o.foreignKeyValue:o.field;h=""===h||void 0===h?void 0:h;var u,g=this.options.dataManager.adaptor.getModuleName;"boolean"===this.options.type&&(void 0!==h&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(h.toLowerCase())?h="true":void 0!==h&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(h.toLowerCase())&&(h="false"),void 0!==h&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(h.toLowerCase())&&g?(g(),h=!0):void 0!==h&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(h.toLowerCase())&&g&&(g(),h=!1),d="equal"),"date"!==this.options.type&&"datetime"!==this.options.type||(h=this.valueFormatter.fromView(n,this.options.parserFn,this.options.type)),this.addDistinct(s);var f={requestType:"filtersearchbegin",filterModel:this,columnName:c,column:o,operator:d,matchCase:!0,ignoreAccent:p,filterChoiceCount:null,query:s,value:h};if(t.isBlazor()&&!this.parent.isJsComponent){f.filterModel={}}this.parent.trigger(yt,f,function(g){if(g.operator=t.isBlazor()&&"none"!==g.excelSearchOperator?g.excelSearchOperator:g.operator,u=new i.Predicate(c,g.operator,h,g.matchCase,g.ignoreAccent),"date"===e.options.type||"datetime"===e.options.type){if(d="equal",t.isNullOrUndefined(h)&&n.length)return;u=he({field:c,operator:d,value:h,matchCase:!0,ignoreAccent:p},e.options.type)}n.length?(u=t.isNullOrUndefined(a)?u:u.and(a.e),s.where(u)):t.isNullOrUndefined(a)||s.where(a.e),g.filterChoiceCount=t.isNullOrUndefined(g.filterChoiceCount)?1e3:g.filterChoiceCount;var f={};r.showSpinner(e.spinner),e.renderEmpty=!1,e.isForeignColumn(o)&&n.length?("result"in o.dataSource?new i.DataManager(o.dataSource.result):o.dataSource).executeQuery(s).then(function(t){var i=e.options.column.columnData;e.options.column.columnData=t.result,e.parent.notify("generateQuery",{predicate:f,column:o}),f.predicate.predicates.length?l.where(f.predicate):e.renderEmpty=!0,e.options.column.columnData=i,l.take(g.filterChoiceCount),e.search(g,l)}):(s.take(g.filterChoiceCount),e.search(g,s))})},e.prototype.search=function(e,t){this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(e,t):this.processSearch(t)},e.prototype.getPredicateFromCols=function(t){for(var r=e.getPredicate(t),n=[],o={},s=void 0!==this.parent.getForeignKeyColumns,l=s?this.parent.getForeignKeyColumns():[],a=0,h=Object.keys(r);a<h.length;a++){var d=h[a],p=void 0;s&&this.parent.getColumnByField(d).isForeignColumn()&&(p=ae(d,l)),p?(this.parent.notify("generateQuery",{predicate:o,column:p}),o.predicate.predicates.length&&n.push(i.Predicate.or(o.predicate.predicates))):n.push(r[d])}return n.length&&i.Predicate.and(n)},e.prototype.getQuery=function(){return this.parent.getQuery?this.parent.getQuery().clone():new i.Query},e.prototype.getAllData=function(){var e=this,i=this.getQuery();i.requiresCount(),this.addDistinct(i);var r={requestType:"filterchoicerequest",query:i,filterChoiceCount:null};if(!t.isBlazor()||this.parent.isJsComponent){r.filterModel=this}this.parent.trigger(yt,r,function(r){r.filterChoiceCount=t.isNullOrUndefined(r.filterChoiceCount)?1e3:r.filterChoiceCount,i.take(r.filterChoiceCount),e.parent.dataSource&&"result"in e.parent.dataSource?e.filterEvent(r,i):e.processDataOperation(i,!0)})},e.prototype.addDistinct=function(e){var t=i.DataUtil.distinct(this.options.filteredColumns,"field");return t.indexOf(this.options.column.field)<=-1&&(t=t.concat(this.options.column.field)),e.distinct(t),e},e.prototype.filterEvent=function(e,t){var i=this,r=Te(e,t);this.parent.trigger("dataStateChange",r.state),r.deffered.promise.then(function(e){i.dataSuccess(e)})},e.prototype.processDataOperation=function(e,t){var r=this;this.options.dataSource=this.options.dataSource instanceof i.DataManager?this.options.dataSource:new i.DataManager(this.options.dataSource);var n=[],o=[];if(this.isForeignColumn(this.options.column)&&t){var s="result"in this.options.column.dataSource?new i.DataManager(this.options.column.dataSource.result):this.options.column.dataSource;this.foreignKeyQuery.params=e.params,n.push(s.executeQuery(this.foreignKeyQuery)),o.push(function(e){return r.foreignKeyData=e})}n.push(this.options.dataSource.executeQuery(e)),o.push(this.dataSuccess.bind(this));var l=0;Promise.all(n).then(function(e){for(var t=0;t<e.length;t++)o[l++](e[t].result)})},e.prototype.dataSuccess=function(r){this.fullData=r;var n={dataSource:this.fullData,executeQuery:!0,field:this.options.field};if(this.parent.notify("beforeCheckboxRenderer",n),n.executeQuery){var o=new i.Query;if(this.parent.searchSettings&&this.parent.searchSettings.key.length){var s=this.parent.searchSettings,l=s.fields.length?s.fields:this.options.columns.map(function(e){return e.field});o.search(s.key,l,s.operator,s.ignoreCase,s.ignoreAccent)}if(this.options.filteredColumns.length){for(var a=[],h=0;h<this.options.filteredColumns.length;h++){var d=this.options.filteredColumns[h];this.options.uid?(d.uid=d.uid||this.parent.getColumnByField(d.field).uid,d.uid!==this.options.uid&&a.push(this.options.filteredColumns[h])):d.field!==this.options.field&&a.push(this.options.filteredColumns[h])}var p=this.getPredicateFromCols(a);p&&o.where(p)}var c=new i.DataManager(n.dataSource).executeLocal(o),u=this.options.column;this.filteredData=e.getDistinct(c,this.options.field,u,this.foreignKeyData).records||[]}var g=n.executeQuery?this.filteredData:n.dataSource;this.processDataSource(null,!0,g,n),this.sInput&&this.sInput.focus();var f={requestType:"filterafteropen",columnName:this.options.field,columnType:this.options.type};if(!t.isBlazor()||this.parent.isJsComponent){f.filterModel=this}this.parent.notify(li,f)},e.prototype.processDataSource=function(e,t,i,n){r.showSpinner(this.spinner),this.updateResult(),this.createFilterItems(i,t,n)},e.prototype.processSearch=function(e){this.processDataOperation(e)},e.prototype.updateResult=function(){this.result={};var e=this.getPredicateFromCols(this.options.filteredColumns),t=new i.Query;e&&t.where(e);for(var r=0,n=new i.DataManager(this.fullData).executeLocal(t);r<n.length;r++){var o=n[r];this.result[ce(this.options.field,o)]=!0}},e.prototype.clickHandler=function(e){var t=e.target,i=O(t,"e-checkbox-wrapper");if(O(t,"e-searchbox")&&this.searchBoxClick(e),i){var r=i.querySelector(".e-selectall");r?this.updateAllCBoxes(!r.classList.contains("e-check")):ie(i.parentElement),this.updateIndeterminatenBtn(),i.querySelector(".e-chk-hidden").focus()}this.setFocus(O(i,"e-ftrchk"))},e.prototype.keyupHandler=function(e){this.setFocus(O(e.target,"e-ftrchk"))},e.prototype.setFocus=function(e){var t=this.dlg.querySelector(".e-chkfocus");t&&t.classList.remove("e-chkfocus"),e&&e.classList.add("e-chkfocus")},e.prototype.updateAllCBoxes=function(e){for(var t=0,i=[].slice.call(this.cBox.querySelectorAll(".e-frame"));t<i.length;t++){var r=i[t];oe(r,e),re(r.previousSibling,e)}},e.prototype.dialogOpen=function(){this.parent.element.classList.contains("e-device")&&(this.dialogObj.element.querySelector(".e-input-group").classList.remove("e-input-focus"),this.options.isResponsiveFilter||this.dialogObj.element.querySelector(".e-btn").focus())},e.prototype.createCheckbox=function(e,i,r){var n=i?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);re(n.querySelector("input"),i);var o=n.querySelector(".e-label"),s=me({},r,{column:this.options.column,parent:this.parent});return o.innerHTML=!t.isNullOrUndefined(e)&&e.toString().length?e:this.getLocalizedLabel("Blanks"),"boolean"==typeof e&&(o.innerHTML=!0===e?this.getLocalizedLabel("FilterTrue"):this.getLocalizedLabel("FilterFalse")),t.addClass([o],["e-checkboxfiltertext"]),this.options.template&&r[this.options.column.field]!==this.getLocalizedLabel("SelectAll")&&(o.innerHTML="",this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate?(this.options.template(s,this.parent,"filterItemTemplate",null,null,null,o),this.parent.renderTemplates()):q(o,this.options.template(s,this.parent,"filterItemTemplate"))),n},e.prototype.updateIndeterminatenBtn=function(){var e,i=this.cBox.children.length-1,r=[],n=!1,o=this.cBox.querySelector(".e-selectall"),s=this.cBox.querySelectorAll(".e-check:not(.e-selectall)").length;this.options.isResponsiveFilter||((e=this.dialogObj.btnObj[0]).disabled=!1);var l=o.previousSibling;re(l,!1),l.indeterminate=!1,i===s?(r=["e-check"],re(l,!0)):s?(r=["e-stop"],l.indeterminate=!0):(r=["e-uncheck"],n=!0,e&&(e.disabled=!0)),e&&(this.filterState=!e.disabled,e.dataBind()),t.removeClass([o],["e-check","e-stop","e-uncheck"]),t.addClass([o],r),this.parent.notify("refresh-cutsom-filter-ok-button",{disabled:n})},e.prototype.createFilterItems=function(e,n,o){var s,l,a=this.parent.createElement("div"),h=!1;this.options.isResponsiveFilter||(l=this.dialogObj.btnObj[0]);var d=-1,p="ejValue";o.executeQuery||(p=o.field);for(C=0;C<e.length;C++){var c=t.getValue(p,e[C]);(""===c||t.isNullOrUndefined(c))&&(d+=1)}if(this.itemsCnt=-1!==d?e.length-d:e.length,e.length&&!this.renderEmpty){var u=this.getLocalizedLabel("SelectAll"),g=this.createCheckbox(u,!1,(s={},s[this.options.field]=u,s)),f=ne(N("cbox"),g,"e-ftrchk");f.querySelector(".e-frame").classList.add("e-selectall"),a.appendChild(f);var m=new i.Predicate("field","equal",this.options.field);this.options.foreignKeyValue&&(m=m.or("field","equal",this.options.foreignKeyValue));for(var y=new i.DataManager(this.options.filteredColumns).executeLocal((new i.Query).where(m)).length,v=void 0,C=0;C<e.length;C++){var w=N("cbox");this.values[w]=t.getValue(p,e[C]);var b=t.getValue(this.options.field,e[C]);this.options.formatFn&&(b=this.valueFormatter.toView(b,this.options.formatFn));var S={value:b,column:this.options.column,data:e[C]};if(this.parent.notify("filter-cbox-value",S),""===(b=S.value)||t.isNullOrUndefined(b)){if(v)continue;v=!0}var x=this.createCheckbox(b,this.getCheckedState(y,this.values[w]),t.getValue("dataObj",e[C]));a.appendChild(ne(w,x,"e-ftrchk"))}this.cBox.innerHTML="",q(this.cBox,[].slice.call(a.children)),this.updateIndeterminatenBtn(),l&&(l.disabled=!1),h=!1}else a.appendChild(this.parent.createElement("span",{innerHTML:this.getLocalizedLabel("NoResult")})),this.cBox.innerHTML="",q(this.cBox,[].slice.call(a.children)),l&&(l.disabled=!0),h=!0;l&&(this.filterState=!l.disabled,l.dataBind());var R={requestType:"filterchoicerequest",dataSource:this.renderEmpty||t.isBlazor()&&this.parent.isServerRendered?[]:e};if(!t.isBlazor()||this.parent.isJsComponent){R.filterModel=this}this.parent.notify(li,R),this.parent.notify("refresh-cutsom-filter-ok-button",{disabled:h}),r.hideSpinner(this.spinner)},e.prototype.getCheckedState=function(e,t){if(this.isFiltered&&e){var i=this.result[t];return"notequal"===this.options.operator?!i:i}return!0},e.getDistinct=function(e,r,n,o){for(var s,l=e.length,a=[],h={},d=!(!n||!n.isForeignColumn)&&n.isForeignColumn();l--;)if(s=e[l],!((s=ce(r,s))in h)){var p={};if(p.ejValue=s,h[s]=!0,d){var c=le(n,{},s,o)[0];t.setValue("foreignKeyData",c,e[l]),s=t.getValue(n.foreignKeyValue,c)}t.setValue(r,t.isNullOrUndefined(s)?null:s,p),t.setValue("dataObj",e[l],p),a.push(p)}return i.DataUtil.group(i.DataUtil.sort(a,r,i.DataUtil.fnAscending),"ejValue")},e.getPredicate=function(t){for(var r=i.DataUtil.distinct(t,"field",!0)||[],n=[],o={},s=0;s<r.length;s++)0!==(n=new i.DataManager(t).executeLocal((new i.Query).where("field","equal",r[s].field))).length&&(o[r[s].field]=e.generatePredicate(n));return o},e.generatePredicate=function(r){var n,o,s=r?r.length:0;(o=e.updateDateFilter(r[0])).ignoreAccent=!t.isNullOrUndefined(o.ignoreAccent)&&o.ignoreAccent,n="date"===o.type||"datetime"===o.type?he(o,o.type):o.ejpredicate?o.ejpredicate:new i.Predicate(o.field,o.operator,o.value,!e.getCaseValue(o),o.ignoreAccent);for(var l=1;l<s;l++)r[l]=e.updateDateFilter(r[l]),s>2&&l>1&&"or"===r[l].predicate?"date"===r[l].type||"datetime"===r[l].type?n.predicates.push(he(r[l],r[l].type)):n.predicates.push(new i.Predicate(r[l].field,r[l].operator,r[l].value,!e.getCaseValue(r[l]),r[l].ignoreAccent)):n="date"===r[l].type||"datetime"===r[l].type?"and"===r[l].predicate&&"equal"===r[l].operator?n.or(he(r[l],r[l].type),r[l].type,r[l].ignoreAccent):n[r[l].predicate](he(r[l],r[l].type),r[l].type,r[l].ignoreAccent):r[l].ejpredicate?n[r[l].predicate](r[l].ejpredicate):n[r[l].predicate](r[l].field,r[l].operator,r[l].value,!e.getCaseValue(r[l]),r[l].ignoreAccent);return n||null},e.getCaseValue=function(e){return t.isNullOrUndefined(e.matchCase)?!("string"===e.type||t.isNullOrUndefined(e.type)&&"string"==typeof e.value):e.matchCase},e.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e},e}(),$r=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zr=function(e){function h(t,i){var r=e.call(this,t)||this;return r.customFilterOperators=i,r.isExcel=!0,r}return $r(h,e),h.prototype.getCMenuDS=function(e,t){var i={number:["Equal","NotEqual","","LessThan","LessThanOrEqual","GreaterThan","GreaterThanOrEqual","Between","","CustomFilter"],string:["Equal","NotEqual","","StartsWith","EndsWith","","Contains","","CustomFilter"]};i.date=i.number,i.datetime=i.number;for(var r=[],n=0;n<i[e].length;n++)i[e][n].length?t?r.push({text:this.getLocalizedLabel(i[e][n])+"...",iconCss:"e-icons e-icon-check "+(t===i[e][n].toLowerCase()?"":"e-emptyicon")}):r.push({text:this.getLocalizedLabel(i[e][n])+"..."}):r.push({separator:!0});return r},h.prototype.destroy=function(){this.dlg&&(this.unwireExEvents(),e.prototype.destroy.call(this)),this.cmenu&&this.cmenu.parentElement&&t.remove(this.cmenu)},h.prototype.createMenu=function(e,t,i,r){var n={string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"};this.menu=this.parent.createElement("div",{className:"e-contextmenu-wrapper"}),this.parent.enableRtl?this.menu.classList.add("e-rtl"):this.menu.classList.remove("e-rtl");var o=this.parent.createElement("ul"),s=t?"e-excl-filter-icon e-filtered":"e-excl-filter-icon";if(this.parent.allowSorting&&"grid"===this.parent.getModuleName()&&!this.options.isResponsiveFilter){var l=this.parent.getColumnHeaderByUid(r.uid).getAttribute("aria-sort"),a=this.parent.getColumnByField(r.field).allowSorting,h=a&&"Ascending"!==l?"e-excel-ascending":"e-disabled e-excel-ascending",d=a&&"Descending"!==l?"e-excel-descending":"e-disabled e-excel-descending",p="string"===e?this.getLocalizedLabel("SortAtoZ"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByOldest"):this.getLocalizedLabel("SortSmallestToLargest"),c="string"===e?this.getLocalizedLabel("SortZtoA"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByNewest"):this.getLocalizedLabel("SortLargestToSmallest");o.appendChild(this.createMenuElem(p,h,"e-sortascending")),o.appendChild(this.createMenuElem(c,d,"e-sortdescending"));var u=this.parent.createElement("li",{className:"e-separator e-menu-item e-excel-separator"});o.appendChild(u)}this.options.isResponsiveFilter||o.appendChild(this.createMenuElem(this.getLocalizedLabel("ClearFilter"),t?"":"e-disabled",s)),"boolean"!==e&&o.appendChild(this.createMenuElem(this.getLocalizedLabel(n[e]),"e-submenu",i&&this.ensureTextFilter()?"e-icon-check":s+" e-emptyicon",!0)),this.menu.appendChild(o),this.parent.notify("before-filter-cmenu-open",{element:this.menu}),this.parent.notify("refresh-cutsom-filter-clear-button",{isFiltered:t})},h.prototype.createMenuElem=function(e,t,i,r){var n=this.parent.createElement("li",{className:t+" e-menu-item"});return n.innerHTML=e,n.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+i}),n.firstChild),r&&n.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),n},h.prototype.wireExEvents=function(){t.EventHandler.add(this.dlg,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.dlg,"click",this.clickExHandler,this)},h.prototype.unwireExEvents=function(){t.EventHandler.remove(this.dlg,"mouseover",this.hoverHandler),t.EventHandler.remove(this.dlg,"click",this.clickExHandler)},h.prototype.clickExHandler=function(e){var t={string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"},i=O(e.target,"e-menu-item");i&&(this.getLocalizedLabel("ClearFilter")===i.innerText.trim()?(this.clearFilter(),this.closeDialog()):this.options.isResponsiveFilter&&this.getLocalizedLabel(t[this.options.type])===i.innerText.trim()&&this.hoverHandler(e))},h.prototype.destroyCMenu=function(){this.isCMenuOpen=!1,this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),t.remove(this.cmenu),this.parent.notify("render-responsive-cmenu",{target:null,header:"",isOpen:!1}))},h.prototype.hoverHandler=function(e){if(!this.options.isResponsiveFilter||"mouseover"!==e.type){var i,r=e.target.querySelector(".e-contextmenu"),n=O(e.target,"e-menu-item"),o=this.menu.querySelector(".e-focused");if(o&&o.classList.remove("e-focused"),n&&(n.classList.add("e-focused"),i=n.classList.contains("e-submenu")),!r){if(!i){var s=this.menu.querySelector(".e-submenu");t.isNullOrUndefined(s)||s.classList.remove("e-selected"),this.destroyCMenu()}var l=this.ensureTextFilter();if(!this.isCMenuOpen&&i){n.classList.add("e-selected"),this.isCMenuOpen=!0;var h={items:this.getCMenuDS(this.options.type,l?l.replace(/\s/g,""):void 0),select:this.selectHandler.bind(this),onClose:this.destroyCMenu.bind(this),enableRtl:this.parent.enableRtl,beforeClose:this.preventClose.bind(this),cssClass:this.options.isResponsiveFilter?"e-res-contextmenu-wrapper":""};this.parent.element.appendChild(this.cmenu),this.menuObj=new a.ContextMenu(h,this.cmenu);var d=this.menu.querySelector(".e-submenu").getBoundingClientRect(),p={top:0,left:0};if(this.options.isResponsiveFilter){var c={string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"},u=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4;this.menuObj.element.style.height="calc(100% - "+u+"px)",this.menuObj.open(u,0,document.body);var g=this.getLocalizedLabel(c[this.options.type]);this.parent.notify("render-responsive-cmenu",{target:this.menuObj.element.parentElement,header:g,isOpen:!0})}else{if(t.Browser.isDevice){var f=this.getContextBounds(this.menuObj);p.top=(window.innerHeight-f.height)/2,p.left=(window.innerWidth-f.width)/2,this.closeDialog()}else p.top=t.Browser.isIE?window.pageYOffset+d.top:window.scrollY+d.top,p.left=this.getCMenuYPosition(this.dlg,this.menuObj);this.menuObj.open(p.top,p.left,e.target)}Se(this.parent.element,this.menuObj.element.parentElement)}}}},h.prototype.ensureTextFilter=function(){var e,t=this.existingPredicate[this.options.field];return t&&2===t.length?e="greaterthanorequal"===t[0].operator&&"lessthanorequal"===t[1].operator?"between":"customfilter":t&&1===t.length&&(this.optrData=this.customFilterOperators[this.options.type+"Operator"],e=t[0].operator),e},h.prototype.preventClose=function(e){if(this.options&&this.options.isResponsiveFilter&&e.event){var t=e.event.target,i=t.classList.contains("e-resfilterback")||t.classList.contains("e-res-back-btn")||t.classList.contains("e-menu-item");e.cancel=!i}else e.event instanceof MouseEvent&&e.event.target.classList.contains("e-submenu")&&(e.cancel=!0)},h.prototype.getContextBounds=function(e){this.menuObj.element.style.display;return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},h.prototype.getCMenuYPosition=function(e,t){var i=this.getContextBounds(t).width,r=e.getBoundingClientRect(),n=r.right+i-this.parent.element.clientWidth,o=e.offsetWidth-e.clientWidth;return o=o?o+1:0,n<1?r.right+1-o:r.left-i-1+o},h.prototype.openDialog=function(e){var t=this;this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),this.dialogObj.dataBind();var i=this.existingPredicate[e.field]&&this.existingPredicate[e.field].length||this.options.filteredColumns.filter(function(e){return t.options.field===e.field}).length;this.createMenu(e.type,i>0,1===i||2===i,e),this.dlg.insertBefore(this.menu,this.dlg.firstChild),this.dlg.classList.add("e-excelfilter"),this.parent.enableRtl&&this.dlg.classList.add("e-rtl"),this.dlg.classList.remove("e-checkboxfilter"),this.cmenu=this.parent.createElement("ul",{className:"e-excel-menu"}),this.parent.notify("filterDialogCreated",{}),this.wireExEvents()},h.prototype.closeDialog=function(){e.prototype.closeDialog.call(this)},h.prototype.selectHandler=function(e){e.item&&(this.parent.notify("filter-cmenu-select",{}),this.menuItem=e.item,this.renderDialogue(e))},h.prototype.renderDialogue=function(e){var i=this,n=e?e.element:void 0,o=this.options.field,s=!t.isNullOrUndefined(o)&&_(o),l=!t.isNullOrUndefined(o)&&W(o),a=this.parent.createElement("div",{className:"e-xlfl-maindiv",id:s?l+"-xlflmenu":o+"-xlflmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-xlflmenu",id:s?l+"-xlfldlg":o+"-xlfldlg"}),this.options.isResponsiveFilter?document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv").appendChild(this.dlgDiv):this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new r.Dialog({header:this.getLocalizedLabel("CustomFilter"),isModal:!0,overlayClick:this.removeDialog.bind(this),showCloseIcon:!0,closeOnEscape:!1,target:document.body,visible:!1,enableRtl:this.parent.enableRtl,open:function(){var e=i.dlgObj.element.querySelector("table.e-xlfl-table>tr");i.options.column.filterTemplate&&(t.isBlazor()?e.querySelector(".e-xlfl-valuediv").children[0].focus():e.querySelector("#"+i.options.column.field+"-xlfl-frstvalue").focus())},close:this.removeDialog.bind(this),created:this.createdDialog.bind(this,n,o),buttons:[{click:this.filterBtnClick.bind(this,o),buttonModel:{content:this.getLocalizedLabel("OKButton"),isPrimary:!0,cssClass:"e-xlfl-okbtn"}},{click:this.removeDialog.bind(this),buttonModel:{content:this.getLocalizedLabel("CancelButton"),cssClass:"e-xlfl-cancelbtn"}}],content:a,width:430,animationSettings:{effect:"None"}});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgDiv.setAttribute("aria-label",this.getLocalizedLabel("CustomFilterDialogARIA")),this.dlgObj.appendTo(this.dlgDiv)},h.prototype.renderResponsiveDialog=function(){if(this.options.isResponsiveFilter){var e=document.querySelector(".e-row-responsive-filter");e&&e.classList.remove("e-row-responsive-filter"),this.dlgObj.buttons=[{}],this.dlgObj.header=void 0,this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.showCloseIcon=!1}},h.prototype.removeDialog=function(){if(t.isBlazor())for(var e=this.options.columns||[],i=0;i<e.length;i++)if(e[i].filterTemplate){var r=this.parent.element.id+e[i].uid+"filterTemplate";t.updateBlazorTemplate(r,"FilterTemplate",e[i])}this.parent.notify("custom-filter-close",{}),this.parent.isReact&&(this.parent.destroyTemplate(["filterTemplate"]),this.parent.renderTemplates()),this.removeObjects([this.dropOptr,this.datePicker,this.dateTimePicker,this.actObj,this.numericTxtObj,this.dlgObj]),t.remove(this.dlgDiv),this.parent.notify("filter-dialog-close",{})},h.prototype.createdDialog=function(e,i){if(this.renderCustomFilter(e,i),this.dlgObj.element.style.left="0px",this.options.isResponsiveFilter){var r=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4;this.dlgObj.element.style.top=r+"px"}else this.dlgObj.element.style.top="0px";!this.options.isResponsiveFilter&&t.Browser.isDevice&&window.innerWidth<440&&(this.dlgObj.element.style.width="90%"),this.parent.notify("beforeCustomFilterOpen",{column:i,dialog:this.dialogObj}),this.dlgObj.show(),Se(this.parent.element,this.dlgObj.element.parentElement),this.parent.notify("set-custom-filter-header",{title:this.getLocalizedLabel("CustomFilter")})},h.prototype.renderCustomFilter=function(e,t){var i=this.dlgObj.element.querySelector(".e-xlfl-maindiv"),r=this.parent.createElement("div",{innerHTML:this.getLocalizedLabel("ShowRowsWhere"),className:"e-xlfl-dlgfields"});i.appendChild(r);var n=this.parent.createElement("div",{innerHTML:this.options.displayName,className:"e-xlfl-fieldset"});i.appendChild(n),this.renderFilterUI(t,i)},h.prototype.filterBtnClick=function(e){var i,r=!t.isNullOrUndefined(e)&&_(e),n=!t.isNullOrUndefined(e)&&W(e),o=r?n:e,s=this.options.column.filterTemplate&&t.isBlazor()?this.dlgDiv.querySelector(".-xlfl-frstvalue").children[0].querySelector(".e-control").ej2_instances[0]:this.dlgDiv.querySelector("#"+o+"-xlfl-frstvalue").ej2_instances[0],l=this.dlgDiv.querySelector("#"+o+"-xlfl-frstoptr").ej2_instances[0],a=this.options.column.filterTemplate&&t.isBlazor()?this.dlgDiv.querySelector(".-xlfl-secndvalue").children[0].querySelector(".e-control").ej2_instances[0]:this.dlgDiv.querySelector("#"+o+"-xlfl-secndvalue").ej2_instances[0],h=this.dlgDiv.querySelector("#"+o+"-xlfl-secndoptr").ej2_instances[0];"string"===this.options.type&&(i=this.dlgDiv.querySelector("#"+o+"-xlflmtcase").ej2_instances[0].checked);var d=this.dlgDiv.querySelector("#"+o+"e-xlfl-frstpredicate").ej2_instances[0],p=(this.dlgDiv.querySelector("#"+o+"e-xlfl-secndpredicate").ej2_instances[0],d.checked?"and":"or");null===a.value&&(p="or"),this.filterByColumn(this.options.field,l.value,s.value,p,i,this.options.ignoreAccent,h.value,a.value),this.removeDialog()},h.prototype.filterByColumn=function(e,r,n,o,s,l,a,h){var d,p=this.parent.getColumnByField?this.parent.getColumnByField(e):this.options.column,c=this.isForeignColumn(p)?p.foreignKeyValue:e,u=[];u.push({field:c,predicate:o,matchCase:s,ignoreAccent:l,operator:r,value:n,type:this.options.type});var g={instance:this,handler:this.filterByColumn,arg1:e,arg2:r,arg3:n,arg4:o,arg5:s,arg6:l,arg7:a,arg8:h,cancel:!1};if(this.parent.notify(ai,g),!g.cancel){d=new i.Predicate(c,r.toLowerCase(),n,!s,l),t.isNullOrUndefined(h)||t.isNullOrUndefined(a)||(u.push({field:c,predicate:o,matchCase:s,ignoreAccent:l,operator:a,value:h,type:this.options.type}),d=d[o](c,a.toLowerCase(),h,!s,l));var f={action:"filtering",filterCollection:u,field:this.options.field,ejpredicate:d,actualPredicate:u};this.isForeignColumn(p)?this.foreignKeyFilter(f,u,d):this.options.handler(f)}},h.prototype.renderOperatorUI=function(e,i,r,n,o){var l=this.parent.createElement("tr",{className:"e-xlfl-fields"});i.appendChild(l);var a=this.parent.createElement("td",{className:"e-xlfl-optr"});l.appendChild(a);var h=this.parent.createElement("div",{className:"e-xlfl-optrdiv"}),d=!t.isNullOrUndefined(e)&&_(e),p=!t.isNullOrUndefined(e)&&W(e),c=this.parent.createElement("input",{id:d?p+r:e+r});h.appendChild(c),a.appendChild(h);var u=this.options.type+"Operator",g=this.customFilterOperators[u];this.optrData=g;var f=this.dropSelectedVal(this.options.column,n,o),m="";this.menuItem&&((m=this.menuItem.text.slice(0,-3))!==this.getLocalizedLabel("CustomFilter")&&(f=o?m:void 0),m===this.getLocalizedLabel("Between")&&(f=this.getLocalizedLabel(o?"GreaterThanOrEqual":"LessThanOrEqual")));var y=this.options.column;return this.dropOptr=new s.DropDownList(z({dataSource:g,fields:{text:"text",value:"value"},text:f,open:this.dropDownOpen.bind(this),enableRtl:this.parent.enableRtl,change:this.dropDownValueChange.bind(this)},y.filter.params)),this.dropOptr.appendTo(c),{fieldElement:l,operator:this.getSelectedValue(f)}},h.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},h.prototype.dropDownValueChange=function(e){e.element.id.includes("-xlfl-frstoptr")?this.firstOperator=e.value.toString():this.secondOperator=e.value.toString()},h.prototype.getFilterUIInfo=function(){return{firstOperator:this.firstOperator,secondOperator:this.secondOperator,field:this.options.field}},h.prototype.getSelectedValue=function(e){var r=new i.DataManager(this.optrData).executeLocal((new i.Query).where("text","equal",e));return t.isNullOrUndefined(r[0])?"":r[0].value},h.prototype.dropSelectedVal=function(e,t,i){var r;return r=t&&t.length>0?2===t.length?i?t[0].operator:t[1].operator:i?t[0].operator:void 0:i&&"string"===e.type&&!e.filter.operator?"startswith":i?e.filter.operator||"equal":void 0,this.getSelectedText(r)},h.prototype.getSelectedText=function(e){var r=new i.DataManager(this.optrData).executeLocal((new i.Query).where("value","equal",e));return t.isNullOrUndefined(r[0])?"":r[0].text},h.prototype.renderFilterUI=function(e,t){var i=this.existingPredicate[e],r=this.parent.createElement("table",{className:"e-xlfl-table"});t.appendChild(r);var n=this.parent.createElement("colGroup");n.innerHTML='<col style="width: 50%"></col><col style="width: 50%"></col>',r.appendChild(n);var o=this.renderOperatorUI(e,r,"-xlfl-frstoptr",i,!0);this.firstOperator=o.operator,this.renderFlValueUI(e,o,"-xlfl-frstvalue",i,!0);var s=this.parent.createElement("tr",{className:"e-xlfl-predicate"});r.appendChild(s),this.renderRadioButton(e,s,i),o=this.renderOperatorUI(e,r,"-xlfl-secndoptr",i,!1),this.secondOperator=o.operator,this.renderFlValueUI(e,o,"-xlfl-secndvalue",i,!1)},h.prototype.renderRadioButton=function(e,i,r){var o=this.parent.createElement("td",{className:"e-xlfl-radio",attrs:{colSpan:"2"}});i.appendChild(o);var s=this.parent.createElement("div",{className:"e-xlfl-radiodiv",attrs:{style:"display: inline-block"}}),l=!t.isNullOrUndefined(e)&&_(e),a=!t.isNullOrUndefined(e)&&W(e),h=this.parent.createElement("input",{id:l?a+"e-xlfl-frstpredicate":e+"e-xlfl-frstpredicate",attrs:{type:"radio"}}),d=this.parent.createElement("input",{id:l?a+"e-xlfl-secndpredicate":e+"e-xlfl-secndpredicate",attrs:{type:"radio"}});s.appendChild(h),s.appendChild(d),o.appendChild(s),"string"===this.options.type&&this.renderMatchCase(e,i,o,"-xlflmtcase",r);var p=new n.RadioButton({label:this.getLocalizedLabel("AND"),name:"default",cssClass:"e-xlfl-radio-and",checked:!0,enableRtl:this.parent.enableRtl}),c=new n.RadioButton({label:this.getLocalizedLabel("OR"),name:"default",cssClass:"e-xlfl-radio-or",enableRtl:this.parent.enableRtl});"and"===(r&&2===r.length?r[1].predicate:"and")?(p.checked=!0,c.checked=!1):(c.checked=!0,p.checked=!1),p.appendTo(h),c.appendTo(d)},h.prototype.removeObjects=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r&&!r.isDestroyed&&r.destroy()}},h.prototype.renderFlValueUI=function(e,i,r,n,o){var s=this.parent.createElement("td",{className:"e-xlfl-value"});i.fieldElement.appendChild(s);var l=!t.isNullOrUndefined(e)&&_(e),a=!t.isNullOrUndefined(e)&&W(e),h=this.parent.createElement("div",{className:"e-xlfl-valuediv"}),d=this.options.filteredColumns.some(function(t){return e===t.field}),p=this.options.filteredColumns.filter(function(t){return t.field===e});if(this.options.column.filterTemplate){var c={},u=this.options.column;d&&r&&(c=this.getExcelFilterData(r,c,u,n,p));var g=this.parent.isReact&&"string"!=typeof this.options.column.filterTemplate,f=this.parent.element.id+u.uid+"filterTemplate";g?(this.options.column.getFilterTemplate()(c,this.parent,"filterTemplate",f,null,null,h),this.parent.renderTemplates()):q(h,this.options.column.getFilterTemplate()(c,this.parent,"filterTemplate",f)),t.isBlazor()?(h.children[0].classList.add(r),this.dlgDiv.querySelectorAll(".e-xlfl-value").length>1&&t.updateBlazorTemplate(f,"FilterTemplate",u)):h.querySelector("input").id=l?a+r:e+r,s.appendChild(h)}else{var m=this.parent.createElement("input",{id:l?a+r:e+r});h.appendChild(m),s.appendChild(h);var y=void 0,v=void 0;n&&n.length>0&&(y=(v=2===n.length?o?n[0]:n[1]:o?n[0]:void 0)&&v.operator===i.operator?v.value:void 0,t.isNullOrUndefined(y)&&(y=void 0)),{string:this.renderAutoComplete.bind(this),number:this.renderNumericTextBox.bind(this),date:this.renderDate.bind(this),datetime:this.renderDateTime.bind(this)}[this.options.type](this.options,e,m,y,this.parent.enableRtl)}},h.prototype.getExcelFilterData=function(e,t,i,r,n){var o="-xlfl-frstvalue"===e?0:1;if("-xlfl-frstvalue"===e||n.length>1){t={column:r instanceof Array?r[o]:r};var s=this.options.column.columnData&&n.length>1?1===this.options.column.columnData.length?0:1:o;t[this.options.field]=i.foreignKeyValue?this.options.column.columnData[s][i.foreignKeyValue]:n[s].value,this.options.foreignKeyValue&&(t[this.options.foreignKeyValue]=this.options.column.columnData[s][i.foreignKeyValue])}return t},h.prototype.renderMatchCase=function(e,i,r,o,s){var l=this.parent.createElement("div",{className:"e-xlfl-matchcasediv",attrs:{style:"display: inline-block"}}),a=!t.isNullOrUndefined(e)&&_(e),h=!t.isNullOrUndefined(e)&&W(e),d=this.parent.createElement("input",{id:a?h+o:e+o,attrs:{type:"checkbox"}});l.appendChild(d),r.appendChild(l);var p=!!(s&&s.length>0)&&(s&&2===s.length?s[1].matchCase:s[0].matchCase);new n.CheckBox({label:this.getLocalizedLabel("MatchCase"),enableRtl:this.parent.enableRtl,checked:p}).appendTo(d)},h.prototype.renderDate=function(e,t,i,r,n){var o=ue(e.format,e.type);this.datePicker=new l.DatePicker(z({format:o,cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:n,value:new Date(r),locale:this.parent.locale},e.column.filter.params)),this.datePicker.appendTo(i)},h.prototype.renderDateTime=function(e,t,i,r,n){var o=ue(e.format,e.type);this.dateTimePicker=new l.DateTimePicker(z({format:o,cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:n,value:new Date(r),locale:this.parent.locale},e.column.filter.params)),this.dateTimePicker.appendTo(i)},h.prototype.completeAction=function(e){e.result=Z(e.result)},h.prototype.renderNumericTextBox=function(e,t,i,r,n){this.numericTxtObj=new o.NumericTextBox(z({format:e.format,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:n,value:r,locale:this.parent.locale},e.column.filter.params)),this.numericTxtObj.appendTo(i)},h.prototype.renderAutoComplete=function(e,r,n,o,l){var a=this,h=this.options.column,d=this.isForeignColumn(h),p=d?h.dataSource:e.dataSource,c={value:d?h.foreignKeyValue:r},u=new s.AutoComplete(z({dataSource:p instanceof i.DataManager?p:new i.DataManager(p),fields:c,query:this.getQuery(),sortOrder:"Ascending",locale:this.parent.locale,cssClass:"e-popup-flmenu",autofill:!0,focus:function(){var i=!t.isNullOrUndefined(r)&&_(r),o=!t.isNullOrUndefined(r)&&W(r),s=i?o:r;u.filterType=a.dlgDiv.querySelector("#"+s+(n.id===s+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr")).ej2_instances[0].value,u.ignoreCase="string"!==e.type||!a.dlgDiv.querySelector("#"+s+"-xlflmtcase").ej2_instances[0].checked,u.filterType=t.isNullOrUndefined(u.filterType)?"equal":u.filterType},placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:l,actionComplete:function(e){var i=!t.isNullOrUndefined(r)&&_(r);e.result=e.result.filter(function(e,t,r){return r.map(function(e){return i?Qe(u.fields.value,e):e[u.fields.value]}).indexOf(i?Qe(u.fields.value,e):e[a.actObj.fields.value])===t})},text:o},h.filter.params));if(p&&"result"in p){var g=Te({requestType:"stringfilterrequest"},this.getQuery());this.parent.trigger("dataStateChange",g.state),g.deffered.promise.then(function(e){u.dataSource=new i.DataManager(e)})}u.appendTo(n),this.actObj=u},h}(Yr),en=function(){function i(e,t,i,r){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new Ei,this.currentTarget=null,this.parent=e,this.sortSettings=t,this.sortedColumns=i,this.serviceLocator=r,this.focus=r.getService("focus"),this.addEventListener(),this.setFullScreenDialog()}return i.prototype.updateModel=function(){var e,t={field:this.columnName,direction:this.direction},i=this.parent.groupSettings.columns,r=!1;if(this.isMultiSort)(e=this.getSortedColsIndexByField(this.columnName))>-1&&this.sortSettings.columns.splice(e,1),this.sortSettings.columns.push(t),this.sortSettings.columns=this.sortSettings.columns;else if(i.length){for(var n=[],o=0,s=i.length;o<s;o++)if(e=this.getSortedColsIndexByField(i[o],n),this.columnName===i[o])r=!0,n.push(t);else{var l=this.getSortColumnFromField(i[o]);n.push({field:l.field,direction:l.direction,isFromGroup:l.isFromGroup})}r||n.push(t),this.sortSettings.columns=n}else this.sortSettings.columns=[t];this.parent.dataBind(),this.lastSortedCol=this.columnName},i.prototype.onActionComplete=function(e){t.isBlazor()&&!this.parent.isJsComponent&&(e.rows=null);var i=this.isRemove?{requestType:"sorting",type:vt}:{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:vt};this.isRemove=!1,this.parent.trigger(vt,t.extend(e,i))},i.prototype.sortColumn=function(e,t,i){var r=this.parent;if(!1===this.parent.getColumnByField(e).allowSorting||this.parent.isContextMenuOpen())return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:e});if(r.allowMultiSorting||(i=r.allowMultiSorting),this.isActionPrevent())return void r.notify(Zt,{instance:this,handler:this.sortColumn,arg1:e,arg2:t,arg3:i});this.backupSettings(),this.columnName=e,this.direction=t,this.isMultiSort=i,this.removeSortIcons();r.getColumnHeaderByField(e);this.updateSortedCols(e,i),this.updateModel()},i.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,e.ResponsiveDialogAction.isSort)},i.prototype.backupSettings=function(){this.lastSortedCols=x(this.sortSettings.columns),this.lastCols=this.sortedColumns},i.prototype.restoreSettings=function(){this.isModelChanged=!1,this.isMultiSort=!0,this.parent.setProperties({sortSettings:{columns:this.lastSortedCols}},!0),this.sortedColumns=this.lastCols,this.isModelChanged=!0},i.prototype.updateSortedCols=function(e,t){if(!t)if(this.parent.allowGrouping)for(var i=0,r=this.sortedColumns.length;i<r;i++)this.parent.groupSettings.columns.indexOf(this.sortedColumns[i])<0&&(this.sortedColumns.splice(i,1),r--,i--);else this.sortedColumns.splice(0,this.sortedColumns.length);this.sortedColumns.indexOf(e)<0&&this.sortedColumns.push(e)},i.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){if(this.contentRefresh){var t=this.sortSettings.columns.length?{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:yt,target:this.currentTarget,cancel:!1}:{requestType:"sorting",type:yt,cancel:!1,target:this.currentTarget};this.parent.notify(Bt,t)}this.refreshSortSettings(),this.removeSortIcons(),this.addSortIcons()}},i.prototype.refreshSortSettings=function(){this.sortedColumns.length=0;for(var e=this.sortSettings.columns,t=0;t<e.length;t++)e[t].isFromGroup||this.sortedColumns.push(e[t].field)},i.prototype.clearSorting=function(){var e=k(this.sortSettings.columns);if(this.isActionPrevent())return void this.parent.notify(Zt,{instance:this,handler:this.clearSorting});for(var i=0,r=e.length;i<r;i++)this.removeSortColumn(e[i].field);t.isBlazor()&&!this.parent.isJsComponent&&(this.sortSettings.columns=this.sortSettings.columns)},i.prototype.isActionPrevent=function(){return J(this.parent)},i.prototype.removeSortColumn=function(e){var t=this.parent,i=this.sortSettings.columns;if(!(0===i.length&&this.sortedColumns.indexOf(e)<0)){if(this.isActionPrevent())return void this.parent.notify(Zt,{instance:this,handler:this.removeSortColumn,arg1:e});this.backupSettings(),this.removeSortIcons();for(var r=0,n=i.length;r<n;r++)if(i[r].field===e){if(t.allowGrouping&&t.groupSettings.columns.indexOf(i[r].field)>-1)continue;this.sortedColumns.splice(this.sortedColumns.indexOf(i[r].field),1),i.splice(r,1),this.isRemove=!0,this.isModelChanged&&this.parent.notify(Bt,{requestType:"sorting",type:yt,target:this.currentTarget});break}this.addSortIcons()}},i.prototype.getSortedColsIndexByField=function(e,t){for(var i=t||this.sortSettings.columns,r=0,n=i.length;r<n;r++)if(i[r].field===e)return r;return-1},i.prototype.getModuleName=function(){return"sort"},i.prototype.initialEnd=function(){this.parent.off(Mt,this.initialEnd);if((!t.isBlazor()||!this.parent.isServerRendered)&&this.parent.getColumns().length&&this.sortSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.isMultiSort=this.sortSettings.columns.length>1;for(var i=0,r=e.sortSettings.columns.slice();i<r.length;i++){var n=r[i];this.sortedColumns.indexOf(n.field)>-1&&this.sortColumn(n.field,n.direction,!0)}this.isMultiSort=!1,this.contentRefresh=!0}},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("set-fullscreen-dialog",this.setFullScreenDialog,this),this.parent.on(Mt,this.initialEnd,this),this.parent.on("sorting-complete",this.onActionComplete,this),this.parent.on(At,this.onPropertyChanged,this),this.parent.on(Ht,this.clickHandler,this),this.parent.on(Lt,this.refreshSortIcons,this),this.parent.on(qt,this.keyPressed,this),this.parent.on("cancel-Begin",this.cancelBeginEvent,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("set-fullscreen-dialog",this.setFullScreenDialog),this.parent.off("sorting-complete",this.onActionComplete),this.parent.off(At,this.onPropertyChanged),this.parent.off(Ht,this.clickHandler),this.parent.off(Lt,this.refreshSortIcons),this.parent.off(qt,this.keyPressed),this.parent.off("cancel-Begin",this.cancelBeginEvent))},i.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.parent.element.querySelector(".e-gridpopup").querySelectorAll(".e-sortdirect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none"),this.parent.refreshing||this.clearSorting(),this.isModelChanged=!0,this.removeEventListener())},i.prototype.cancelBeginEvent=function(e){"sorting"===e.requestType&&(this.restoreSettings(),this.refreshSortIcons(),this.isMultiSort=!0)},i.prototype.clickHandler=function(e){var i=this.parent;this.currentTarget=null,this.popUpClickHandler(e);var r=t.closest(e.target,".e-headercell");if(r&&!e.target.classList.contains("e-grptogglebtn")&&!r.classList.contains("e-resized")&&!e.target.classList.contains("e-rhandler")&&!e.target.classList.contains("e-columnmenu")&&!e.target.classList.contains("e-filtermenudiv")&&!O(e.target,"e-stackedheadercell")&&!(i.allowSelection&&i.selectionSettings.allowColumnSelection&&e.target.classList.contains("e-headercell"))){var n=this.parent.getColumnByUid(r.querySelector(".e-headercelldiv").getAttribute("e-mappinguid")),o=r.querySelectorAll(".e-ascending").length?"Descending":"Ascending";"checkbox"!==n.type&&(this.initiateSort(r,e,n),t.Browser.isDevice&&this.showPopUp(e))}if(r&&r.classList.remove("e-resized"),O(e.target,"e-excel-ascending")||O(e.target,"e-excel-descending")){var s=t.closest(e.target,".e-filter-popup").getAttribute("uid"),o=t.isNullOrUndefined(O(e.target,"e-excel-descending"))?"Ascending":"Descending";this.sortColumn(i.getColumnByUid(s).field,o,!1)}},i.prototype.keyPressed=function(e){var i=e.target;if(!this.parent.isEdit&&("enter"===e.action||"ctrlEnter"===e.action||"shiftEnter"===e.action)&&t.closest(i,".e-headercell")){var r=this.focus.getFocusedElement();if(t.isNullOrUndefined(r)||!r.classList.contains("e-headercell")||!r.querySelector(".e-headercelldiv"))return;var n=this.parent.getColumnByUid(r.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));this.initiateSort(r,e,n)}},i.prototype.initiateSort=function(e,i,r){var n=this.parent,o=r.field;this.currentTarget=i.target;var s=e.querySelectorAll(".e-ascending").length?"Descending":"Ascending";i.shiftKey||this.sortSettings.allowUnsort&&e.querySelectorAll(".e-descending").length&&!(n.groupSettings.columns.indexOf(o)>-1)?(this.removeSortColumn(o),t.isBlazor()&&!this.parent.isJsComponent&&(this.sortSettings.columns=this.sortSettings.columns)):this.sortColumn(o,s,i.ctrlKey||this.enableSortMultiTouch||-1!==navigator.userAgent.indexOf("Mac OS")&&i.metaKey)},i.prototype.showPopUp=function(e){var i=t.closest(e.target,".e-headercell");!this.parent.allowMultiSorting||t.isNullOrUndefined(i)&&!this.parent.isContextMenuOpen()||E(this.parent.element.querySelector(".e-gridpopup"),e,"e-sortdirect e-icons e-icon-sortdirect"+(this.sortedColumns.length>1?" e-spanclicked":""))},i.prototype.popUpClickHandler=function(e){var i=e.target;t.closest(i,".e-headercell")||e.target.classList.contains("e-rowcell")||t.closest(i,".e-gridpopup")?i.classList.contains("e-sortdirect")&&(i.classList.contains("e-spanclicked")?(i.classList.remove("e-spanclicked"),this.enableSortMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(i.classList.add("e-spanclicked"),this.enableSortMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},i.prototype.addSortIcons=function(){for(var e,i,r=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),s=0,l=n.length;s<l;s++)e=r.getColumnHeaderByField(n[s].field),-1===o.indexOf(n[s].field)||t.isNullOrUndefined(e)||(this.aria.setSort(e,n[s].direction),this.isMultiSort&&n.length>1&&e.querySelector(".e-headercelldiv").insertBefore(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(s+1).toString()}),e.querySelector(".e-headertext")),i=e.querySelector(".e-sortfilterdiv"),"Ascending"===n[s].direction?t.classList(i,["e-ascending","e-icon-ascending"],[]):t.classList(i,["e-descending","e-icon-descending"],[]))},i.prototype.removeSortIcons=function(e){for(var i,r=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),s=e||0,l=t.isNullOrUndefined(e)?n.length:e+1;s<l;s++)i=r.getColumnHeaderByField(n[s].field),t.isNullOrUndefined(i)||r.allowGrouping&&r.groupSettings.columns.indexOf(n[s].field)>-1&&!i.querySelector(".e-sortfilterdiv")||-1!==o.indexOf(n[s].field)&&(this.aria.setSort(i,"none"),t.classList(i.querySelector(".e-sortfilterdiv"),[],["e-descending","e-icon-descending","e-ascending","e-icon-ascending"]),i.querySelector(".e-sortnumber")&&i.querySelector(".e-headercelldiv").removeChild(i.querySelector(".e-sortnumber")))},i.prototype.getSortColumnFromField=function(e){for(var t=0,i=this.sortSettings.columns.length;t<i;t++)if(this.sortSettings.columns[t].field===e)return this.sortSettings.columns[t];return!1},i.prototype.updateAriaAttr=function(){for(var e=this.parent.getColumns().map(function(e){return e.field}),t=0,i=this.sortedColumns;t<i.length;t++){var r=i[t];if(-1!==e.indexOf(r)){var n=this.parent.getColumnHeaderByField(r);this.aria.setSort(n,this.getSortColumnFromField(r).direction)}}},i.prototype.refreshSortIcons=function(e){void 0===e&&(e={args:{isFrozen:!1}}),e.args.isFrozen||(this.removeSortIcons(),this.isMultiSort=!0,this.removeSortIcons(),this.addSortIcons(),this.isMultiSort=!1,this.updateAriaAttr())},i.prototype.showCustomFilter=function(){this.responsiveDialogRenderer.showResponsiveDialog()},i}(),tn=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){this.pagerElement=this.pagerModule.element,this.renderNumericContainer(),this.refreshNumericLinks(),this.wireEvents()},e.prototype.refresh=function(){this.pagerModule.updateTotalPages(),this.links.length&&this.updateLinksHtml(),this.updateStyles()},e.prototype.refreshNumericLinks=function(){var e,i=this.pagerModule,r=i.element.querySelector(".e-numericcontainer"),n=document.createDocumentFragment();r.innerHTML="";for(var o=1;o<=i.pageCount;o++)e=t.createElement("a",{className:"e-link e-numericitem e-spacing e-pager-default",attrs:{role:"link",tabindex:"-1","aria-label":"Goto Page "+o,href:"javascript:void(0);",name:"Goto page"+o}}),i.currentPage===o&&t.classList(e,["e-currentitem","e-active"],["e-pager-default"]),n.appendChild(e);r.appendChild(n),this.links=[].slice.call(r.childNodes)},e.prototype.wireEvents=function(){t.EventHandler.add(this.pagerElement,"click",this.clickHandler,this)},e.prototype.unwireEvents=function(){t.EventHandler.remove(this.pagerModule.element,"click",this.clickHandler)},e.prototype.destroy=function(){this.unwireEvents()},e.prototype.renderNumericContainer=function(){this.element=t.createElement("div",{className:"e-pagercontainer",attrs:{role:"navigation"}}),this.renderFirstNPrev(this.element),this.renderPrevPagerSet(this.element),this.element.appendChild(t.createElement("div",{className:"e-numericcontainer"})),this.renderNextPagerSet(this.element),this.renderNextNLast(this.element),this.pagerModule.element.appendChild(this.element)},e.prototype.renderFirstNPrev=function(e){this.first=t.createElement("div",{className:"e-first e-icons e-icon-first",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("FirstPageTooltip"):this.pagerModule.getLocalizedLabel("firstPageTooltip"),"aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("FirstPageTooltip"):this.pagerModule.getLocalizedLabel("firstPageTooltip"),tabindex:"-1"}}),this.prev=t.createElement("div",{className:"e-prev e-icons e-icon-prev",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPageTooltip"):this.pagerModule.getLocalizedLabel("previousPageTooltip"),"aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPageTooltip"):this.pagerModule.getLocalizedLabel("previousPageTooltip"),tabindex:"-1"}}),t.append([this.first,this.prev],e)},e.prototype.renderPrevPagerSet=function(e){var i=t.createElement("div");this.PP=t.createElement("a",{className:"e-link e-pp e-spacing",innerHTML:"...",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPagerTooltip"):this.pagerModule.getLocalizedLabel("previousPagerTooltip"),role:"link","aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPagerTooltip"):this.pagerModule.getLocalizedLabel("previousPagerTooltip"),tabindex:"-1",name:t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPagerTooltip"):this.pagerModule.getLocalizedLabel("previousPagerTooltip"),href:"javascript:void(0);"}}),i.appendChild(this.PP),e.appendChild(i)},e.prototype.renderNextPagerSet=function(e){var i=t.createElement("div");this.NP=t.createElement("a",{className:"e-link e-np e-spacing",innerHTML:"...",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPagerTooltip"):this.pagerModule.getLocalizedLabel("nextPagerTooltip"),role:"link","aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPagerTooltip"):this.pagerModule.getLocalizedLabel("nextPagerTooltip"),tabindex:"-1",name:t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPagerTooltip"):this.pagerModule.getLocalizedLabel("nextPagerTooltip"),href:"javascript:void(0);"}}),i.appendChild(this.NP),e.appendChild(i)},e.prototype.renderNextNLast=function(e){this.next=t.createElement("div",{className:"e-next e-icons e-icon-next",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPageTooltip"):this.pagerModule.getLocalizedLabel("nextPageTooltip"),"aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPageTooltip"):this.pagerModule.getLocalizedLabel("nextPageTooltip"),tabindex:"-1"}}),this.last=t.createElement("div",{className:"e-last e-icons e-icon-last",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("LastPageTooltip"):this.pagerModule.getLocalizedLabel("lastPageTooltip"),"aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("LastPageTooltip"):this.pagerModule.getLocalizedLabel("lastPageTooltip"),tabindex:"-1"}}),t.append([this.next,this.last],e)},e.prototype.clickHandler=function(e){var i=this.pagerModule,r=e.target;return i.previousPageNo=i.currentPage,r.classList.contains("e-disable")||t.isNullOrUndefined(r.getAttribute("index"))||(i.currentPage=parseInt(r.getAttribute("index"),10),i.dataBind()),!1},e.prototype.updateLinksHtml=function(){var e,i,r=this.pagerModule;r.currentPage=1===r.totalPages?1:r.currentPage,r.currentPage>r.totalPages&&r.totalPages&&(r.currentPage=r.totalPages),e=parseInt((r.currentPage/r.pageCount).toString(),10),r.currentPage%r.pageCount==0&&e>0&&(e-=1);for(var n=0;n<r.pageCount;n++)(i=e*r.pageCount+1+n)<=r.totalPages?(this.links[n].style.display="",this.links[n].setAttribute("index",i.toString()),this.links[n].innerHTML=r.customText?r.customText+i:i.toString(),r.currentPage!==i?this.links[n].classList.add("e-pager-default"):this.links[n].classList.remove("e-pager-default")):(this.links[n].innerHTML=r.customText?r.customText+i:i.toString(),this.links[n].style.display="none"),t.classList(this.links[n],[],["e-currentitem","e-active"]);this.first.setAttribute("index","1"),this.last.setAttribute("index",r.totalPages.toString()),this.prev.setAttribute("index",(r.currentPage-1).toString()),this.next.setAttribute("index",(r.currentPage+1).toString()),this.pagerElement.querySelector(".e-mfirst").setAttribute("index","1"),this.pagerElement.querySelector(".e-mlast").setAttribute("index",r.totalPages.toString()),this.pagerElement.querySelector(".e-mprev").setAttribute("index",(r.currentPage-1).toString()),this.pagerElement.querySelector(".e-mnext").setAttribute("index",(r.currentPage+1).toString()),this.PP.setAttribute("index",(parseInt(this.links[0].getAttribute("index"),10)-r.pageCount).toString()),this.NP.setAttribute("index",(parseInt(this.links[this.links.length-1].getAttribute("index"),10)+1).toString())},e.prototype.updateStyles=function(){this.updateFirstNPrevStyles(),this.updatePrevPagerSetStyles(),this.updateNextPagerSetStyles(),this.updateNextNLastStyles(),this.links.length&&t.classList(this.links[(this.pagerModule.currentPage-1)%this.pagerModule.pageCount],["e-currentitem","e-active"],[])},e.prototype.updateFirstNPrevStyles=function(){var e=["e-firstpage","e-pager-default"],i=["e-firstpagedisabled","e-disable"],r=["e-prevpage","e-pager-default"],n=["e-prevpagedisabled","e-disable"];this.pagerModule.totalPages>0&&this.pagerModule.currentPage>1?(t.classList(this.prev,r,n),t.classList(this.first,e,i),t.classList(this.pagerElement.querySelector(".e-mfirst"),e,i),t.classList(this.pagerElement.querySelector(".e-mprev"),r,n)):(t.classList(this.prev,n,r),t.classList(this.first,i,e),t.classList(this.pagerElement.querySelector(".e-mprev"),n,r),t.classList(this.pagerElement.querySelector(".e-mfirst"),i,e))},e.prototype.updatePrevPagerSetStyles=function(){this.pagerModule.currentPage>this.pagerModule.pageCount?t.classList(this.PP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]):t.classList(this.PP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"])},e.prototype.updateNextPagerSetStyles=function(){var e=this.pagerModule,i=this.links[0].innerHTML.replace(e.customText,"");!i.length||!this.links.length||parseInt(i,10)+e.pageCount>e.totalPages?t.classList(this.NP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]):t.classList(this.NP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])},e.prototype.updateNextNLastStyles=function(){var e=["e-lastpage","e-pager-default"],i=["e-lastpagedisabled","e-disable"],r=["e-nextpage","e-pager-default"],n=["e-nextpagedisabled","e-disable"],o=this.pagerModule;o.currentPage===o.totalPages||0===o.totalRecordsCount?(t.classList(this.last,i,e),t.classList(this.next,n,r),t.classList(this.pagerElement.querySelector(".e-mlast"),i,e),t.classList(this.pagerElement.querySelector(".e-mnext"),n,r)):(t.classList(this.last,e,i),t.classList(this.next,r,n),t.classList(this.pagerElement.querySelector(".e-mlast"),e,i),t.classList(this.pagerElement.querySelector(".e-mnext"),r,n))},e}(),rn=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){var e=t.createElement("div",{className:"e-parentmsgbar",attrs:{"aria-label":"Pager Information"}});this.pageNoMsgElem=t.createElement("span",{className:"e-pagenomsg",styles:"textalign:right"}),this.pageCountMsgElem=t.createElement("span",{className:"e-pagecountmsg",styles:"textalign:right"}),t.append([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},e.prototype.refresh=function(){var e=this.pagerModule;t.isBlazor()?(this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("CurrentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel("TotalItemsInfo"),[e.totalRecordsCount||0])):(this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("currentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0,e.totalRecordsCount||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel(e.totalRecordsCount<=1?"totalItemInfo":"totalItemsInfo"),[e.totalRecordsCount||0,e.totalRecordsCount?e.pageSize*(e.currentPage-1)+1:0,e.pageSize*e.currentPage>e.totalRecordsCount?e.totalRecordsCount:e.pageSize*e.currentPage])),this.pageNoMsgElem.parentElement.setAttribute("aria-label",this.pageNoMsgElem.textContent+this.pageCountMsgElem.textContent)},e.prototype.hideMessage=function(){this.pageNoMsgElem&&(this.pageNoMsgElem.style.display="none"),this.pageCountMsgElem&&(this.pageCountMsgElem.style.display="none")},e.prototype.showMessage=function(){this.pageNoMsgElem||this.render(),this.pageNoMsgElem.style.display="",this.pageCountMsgElem.style.display=""},e.prototype.destroy=function(){},e.prototype.format=function(e,t){for(var i,r=0;r<t.length;r++)i=new RegExp("\\{"+r+"\\}","gm"),e=e.replace(i,t[r].toString());return e},e}(),nn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),on=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},sn=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.hasParent=!1,r}return nn(i,e),i.prototype.requiredModules=function(){var e=[];return this.enableExternalMessage&&e.push({member:"externalMessage",args:[this]}),this.checkpagesizes()&&e.push({member:"pagerdropdown",args:[this]}),e},i.prototype.preRender=function(){this.defaultConstants={currentPageInfo:"{0} of {1} pages",totalItemsInfo:"({0} items)",totalItemInfo:"({0} item)",firstPageTooltip:"Go to first page",lastPageTooltip:"Go to last page",nextPageTooltip:"Go to next page",previousPageTooltip:"Go to previous page",nextPagerTooltip:"Go to next pager",previousPagerTooltip:"Go to previous pager",pagerDropDown:"Items per page",pagerAllDropDown:"Items",CurrentPageInfo:"{0} of {1} pages",TotalItemsInfo:"({0} items)",FirstPageTooltip:"Go to first page",LastPageTooltip:"Go to last page",NextPageTooltip:"Go to next page",PreviousPageTooltip:"Go to previous page",NextPagerTooltip:"Go to next pager",PreviousPagerTooltip:"Go to previous pager",PagerDropDown:"Items per page",PagerAllDropDown:"Items",All:"All"},this.containerModule=new tn(this),this.pagerMessageModule=new rn(this)},i.prototype.render=function(){this.template?this.isReactTemplate()?(this.on("pager-refresh",this.pagerTemplate,this),this.notify("pager-refresh",{})):this.pagerTemplate():(this.initLocalization(),this.updateRTL(),this.totalRecordsCount=this.totalRecordsCount||0,this.renderFirstPrevDivForDevice(),this.containerModule.render(),this.enablePagerMessage&&this.pagerMessageModule.render(),this.renderNextLastDivForDevice(),this.checkpagesizes()&&this.pagerdropdownModule&&this.pagerdropdownModule.render(),this.addAriaLabel(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render(),this.refresh(),this.trigger("created",{currentPage:this.currentPage,totalRecordsCount:this.totalRecordsCount}))},i.prototype.getPersistData=function(){var e=["currentPage","pageSize"];return this.addOnPersist(e)},i.prototype.destroy=function(){this.isReactTemplate()&&(this.off("pager-refresh",this.pagerTemplate),this.hasParent||this.destroyTemplate(["template"])),e.prototype.destroy.call(this),this.containerModule.destroy(),this.pagerMessageModule.destroy(),this.isReactTemplate()||(this.element.innerHTML="")},i.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},i.prototype.getModuleName=function(){return"pager"},i.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){e.pageCount!==t.pageCount&&(this.containerModule.refreshNumericLinks(),this.containerModule.refresh());for(var i=0,r=Object.keys(e);i<r.length;i++)switch(r[i]){case"currentPage":this.checkGoToPage(e.currentPage,t.currentPage)&&this.currentPageChanged(e,t);break;case"pageSize":case"totalRecordsCount":case"customText":this.checkpagesizes()&&this.pagerdropdownModule&&(t.pageSize!==e.pageSize&&(this.currentPage=1),this.pagerdropdownModule.setDropDownValue("value",this.pageSize)),e.pageSize!==t.pageSize?(this.pageSize=e.pageSize,this.currentPageChanged(e,t)):this.refresh();break;case"pageSizes":this.checkpagesizes()&&this.pagerdropdownModule&&(this.pagerdropdownModule.destroy(),this.pagerdropdownModule.render()),this.refresh();break;case"template":this.templateFn=this.compile(this.template),this.refresh();break;case"locale":this.initLocalization(),this.refresh();break;case"enableExternalMessage":this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render();break;case"externalMessage":this.externalMessageModule&&this.externalMessageModule.refresh();break;case"enableRtl":this.updateRTL();break;case"enablePagerMessage":this.enablePagerMessage?this.pagerMessageModule.showMessage():this.pagerMessageModule.hideMessage()}}},i.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},i.prototype.goToPage=function(e){this.checkGoToPage(e)&&(this.currentPage=e,this.dataBind())},i.prototype.setPageSize=function(e){this.pageSize=e,this.dataBind()},i.prototype.checkpagesizes=function(){return!(!0!==this.pageSizes&&!this.pageSizes.length)},i.prototype.checkGoToPage=function(e,i){return e!==this.currentPage&&(this.previousPageNo=this.currentPage),t.isNullOrUndefined(i)||(this.previousPageNo=i),this.previousPageNo!==e&&e>=1&&e<=this.totalPages},i.prototype.currentPageChanged=function(e,t){if(this.enableQueryString&&this.updateQueryString(this.currentPage),e.currentPage!==t.currentPage||e.pageSize!==t.pageSize){var i={currentPage:this.currentPage,newProp:e,oldProp:t,cancel:!1};this.trigger("click",i),i.cancel||this.refresh()}},i.prototype.pagerTemplate=function(){if(!this.isReactTemplate()||!this.hasParent){var e;this.element.classList.add("e-pagertemplate"),this.compile(this.template);var i={currentPage:this.currentPage,pageSize:this.pageSize,pageCount:this.pageCount,totalRecordsCount:this.totalRecordsCount,totalPages:this.totalPages},r=this.element.parentElement.id+"_template";this.isReactTemplate()?(this.getPagerTemplate()(i,this,"template",r,null,null,this.element),this.renderReactTemplates()):(e=t.isBlazor()?this.getPagerTemplate()(i,this,"template",r,this.isStringTemplate):this.getPagerTemplate()(i),q(this.element,e))}},i.prototype.updateTotalPages=function(){this.totalPages=this.totalRecordsCount%this.pageSize==0?this.totalRecordsCount/this.pageSize:parseInt((this.totalRecordsCount/this.pageSize).toString(),10)+1},i.prototype.getPagerTemplate=function(){return this.templateFn},i.prototype.compile=function(e){if(e)try{document.querySelectorAll(e).length&&(this.templateFn=t.compile(document.querySelector(e).innerHTML.trim()))}catch(i){this.templateFn=t.compile(e)}},i.prototype.refresh=function(){this.template?this.isReactTemplate()?(this.updateTotalPages(),this.notify("pager-refresh",{})):(this.element.innerHTML="",this.updateTotalPages(),this.pagerTemplate()):(this.updateRTL(),this.containerModule.refresh(),this.enablePagerMessage&&this.pagerMessageModule.refresh(),this.pagerdropdownModule&&this.pagerdropdownModule.refresh(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.refresh())},i.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},i.prototype.initLocalization=function(){this.localeObj=new t.L10n(this.getModuleName(),this.defaultConstants,this.locale)},i.prototype.updateQueryString=function(e){var t=this.getUpdatedURL(window.location.href,"page",e.toString());window.history.pushState({path:t},"",t)},i.prototype.getUpdatedURL=function(e,t,i){var r=new RegExp("([?|&])"+t+"=.*?(&|#|$)","i");if(e.match(r))return e.replace(r,"$1"+t+"="+i+"$2");var n="";return-1!==e.indexOf("#")&&(n=e.replace(/.*#/,"#"),e=e.replace(/#.*/,"")),e+(-1!==e.indexOf("?")?"&":"?")+t+"="+i+n},i.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:t.isBlazor()?this.getLocalizedLabel("FirstPageTooltip"):this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1"}})),this.element.appendChild(t.createElement("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:t.isBlazor()?this.getLocalizedLabel("PreviousPageTooltip"):this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1"}}))},i.prototype.renderNextLastDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:t.isBlazor()?this.getLocalizedLabel("NextPageTooltip"):this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1"}})),this.element.appendChild(t.createElement("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:t.isBlazor()?this.getLocalizedLabel("LastPageTooltip"):this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1"}}))},i.prototype.addAriaLabel=function(){var e=[".e-mfirst",".e-mprev",".e-mnext",".e-mlast"];if(!t.Browser.isDevice)for(var i=0;i<e.length;i++){var r=this.element.querySelector(e[i]);r.setAttribute("aria-label",r.getAttribute("title"))}},i.prototype.isReactTemplate=function(){return this.isReact&&this.template&&"string"!=typeof this.template},on([t.Property(!1)],i.prototype,"enableQueryString",void 0),on([t.Property(!1)],i.prototype,"enableExternalMessage",void 0),on([t.Property(!0)],i.prototype,"enablePagerMessage",void 0),on([t.Property(12)],i.prototype,"pageSize",void 0),on([t.Property(10)],i.prototype,"pageCount",void 0),on([t.Property(1)],i.prototype,"currentPage",void 0),on([t.Property()],i.prototype,"totalRecordsCount",void 0),on([t.Property()],i.prototype,"externalMessage",void 0),on([t.Property(!1)],i.prototype,"pageSizes",void 0),on([t.Property()],i.prototype,"template",void 0),on([t.Property("")],i.prototype,"customText",void 0),on([t.Event()],i.prototype,"click",void 0),on([t.Event()],i.prototype,"dropDownChanged",void 0),on([t.Event()],i.prototype,"created",void 0),i=on([t.NotifyPropertyChanges],i)}(t.Component),ln=function(){function e(e){this.pagerModule=e}return e.prototype.getModuleName=function(){return"pagerdropdown"},e.prototype.render=function(){var e=this.pagerModule;this.pagerDropDownDiv=t.createElement("div",{className:"e-pagesizes"});var i=t.createElement("div",{className:"e-pagerdropdown"}),r=t.createElement("div",{className:"e-pagerconstant"}),n=t.createElement("input",{attrs:{type:"text",tabindex:"1"}});this.pagerCons=t.createElement("span",{className:"e-constant",innerHTML:t.isBlazor()?this.pagerModule.getLocalizedLabel("PagerDropDown"):this.pagerModule.getLocalizedLabel("pagerDropDown")}),i.appendChild(n),r.appendChild(this.pagerCons),this.pagerDropDownDiv.appendChild(i),this.pagerDropDownDiv.appendChild(r),this.pagerModule.element.appendChild(this.pagerDropDownDiv);var o=this.pagerModule.pageSizes,l=o.length?this.convertValue(o):[this.pagerModule.getLocalizedLabel("All"),"5","10","12","20"],a=this.pagerModule.pageSize;this.dropDownListObject=new s.DropDownList({dataSource:l,value:a.toString(),change:this.onChange.bind(this),cssClass:"e-alldrop"}),this.dropDownListObject.appendTo(n),o.length&&(this.dropDownListObject.element.value=this.pagerModule.pageSize.toString()),e.pageSize=a,e.dataBind(),e.trigger("dropDownChanged",{pageSize:a}),this.addEventListener()},e.prototype.onChange=function(e){this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?(this.pagerModule.pageSize=this.pagerModule.totalRecordsCount,this.refresh(),e.value=this.pagerModule.pageSize,document.getElementsByClassName("e-popup-open e-alldrop").length&&(document.getElementsByClassName("e-popup-open e-alldrop")[0].style.display="none")):(this.pagerModule.pageSize=parseInt(this.dropDownListObject.value,10),this.pagerCons.innerHTML!==this.pagerModule.getLocalizedLabel("pagerDropDown")&&this.refresh()),this.pagerModule.dataBind(),this.pagerModule.trigger("dropDownChanged",{pageSize:parseInt(this.dropDownListObject.value,10)})},e.prototype.refresh=function(){this.pagerCons&&(this.pagerModule.pageSize===this.pagerModule.totalRecordsCount?this.pagerCons.innerHTML=t.isBlazor()?this.pagerModule.getLocalizedLabel("PagerAllDropDown"):this.pagerModule.getLocalizedLabel("pagerAllDropDown"):this.pagerCons.innerHTML=t.isBlazor()?this.pagerModule.getLocalizedLabel("PagerDropDown"):this.pagerModule.getLocalizedLabel("pagerDropDown"))},e.prototype.beforeValueChange=function(e){if("number"==typeof e.newProp.value){var t=e.newProp.value.toString();e.newProp.value=t}},e.prototype.convertValue=function(e){for(var t=e,i=0;i<t.length;i++)t[i]=parseInt(t[i],10)?t[i].toString():""!==this.pagerModule.getLocalizedLabel(t[i])?this.pagerModule.getLocalizedLabel(t[i]):t[i];return t},e.prototype.setDropDownValue=function(e,t){this.dropDownListObject&&(this.dropDownListObject[e]=t)},e.prototype.addEventListener=function(){this.dropDownListObject.on("beforeValueChange",this.beforeValueChange,this)},e.prototype.removeEventListener=function(){this.dropDownListObject.off("beforeValueChange",this.beforeValueChange)},e.prototype.destroy=function(e){this.dropDownListObject&&!this.dropDownListObject.isDestroyed&&(this.removeEventListener(),this.dropDownListObject.destroy(),t.remove(this.pagerDropDownDiv))},e}(),an=function(){function e(e){this.pagerModule=e}return e.prototype.getModuleName=function(){return"externalMessage"},e.prototype.render=function(){this.element=t.createElement("div",{className:"e-pagerexternalmsg",attrs:{"aria-label":"Pager external message"}}),this.pagerModule.element.appendChild(this.element),this.refresh()},e.prototype.refresh=function(){this.pagerModule.externalMessage&&this.pagerModule.externalMessage.toString().length?(this.showMessage(),this.element.innerHTML=this.pagerModule.externalMessage):this.hideMessage()},e.prototype.hideMessage=function(){t.isNullOrUndefined(this.element)||(this.element.style.display="none")},e.prototype.showMessage=function(){this.element.style.display=""},e.prototype.destroy=function(){t.remove(this.element)},e}(),hn=function(){function e(e,t){this.isInitialRender=!0,sn.Inject(an,ln),this.parent=e,this.pageSettings=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"pager"},e.prototype.render=function(){var e,i=this.parent;this.pagerDestroy(),t.isNullOrUndefined(this.parent.pagerTemplate)||(this.pageSettings.template=this.parent.pagerTemplate,this.parent.pageTemplateChange=!0),this.element=this.parent.createElement("div",{className:"e-gridpager"}),e=z({},t.extend({},D(this.pageSettings)),{click:this.clickHandler.bind(this),dropDownChanged:this.onSelect.bind(this),enableRtl:i.enableRtl,locale:i.locale,created:this.addAriaAttr.bind(this)},["parentObj","propName"]),this.pagerObj=new sn(e),this.pagerObj.hasParent=!0,this.pagerObj.on("pager-refresh",this.renderReactPagerTemplate,this),this.pagerObj.allowServerDataBinding=!1},e.prototype.onSelect=function(e){this.pageSettings.pageSize=e.pageSize,this.isInitialLoad||(this.pageSettings.currentPage=1)},e.prototype.addAriaAttr=function(){if(!this.pageSettings.template){for(var e=this.parent.createElement("div",{className:"e-numericcontainer"}),t=this.element.querySelector(".e-pagercontainer"),i=document.createDocumentFragment(),r=this.element.querySelector(".e-numericcontainer"),n=r.querySelectorAll("a"),o=0;o<n.length;o++){this.parent.getContentTable()?n[o].setAttribute("aria-owns",this.parent.getContentTable().id):n[o].setAttribute("aria-owns",this.parent.element.getAttribute("id")+"_content_table");var s=this.parent.createElement("div");s.appendChild(n[o]),i.appendChild(s)}e.appendChild(i),t.replaceChild(e,r);for(var l=[".e-mfirst",".e-mprev",".e-first",".e-prev",".e-next",".e-last",".e-mnext",".e-mlast"],a=0;a<l.length;a++){var h=this.element.querySelector(l[a]);this.parent.getContentTable()&&h.setAttribute("aria-owns",this.parent.getContentTable().id)}}},e.prototype.dataReady=function(e){this.updateModel(e)},e.prototype.refresh=function(){this.pagerObj.refresh()},e.prototype.goToPage=function(e){this.pagerObj.goToPage(e)},e.prototype.setPageSize=function(e){this.pagerObj.setPageSize(e)},e.prototype.updateModel=function(e){this.parent.pageSettings.totalRecordsCount=e.count,this.parent.dataBind()},e.prototype.onActionComplete=function(e){t.isBlazor()&&!this.parent.isJsComponent&&(e.rows=null),this.parent.trigger(vt,t.extend(e,{currentPage:this.parent.pageSettings.currentPage,requestType:"paging",type:vt}))},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){for(var t=e.properties,i=0,r=Object.keys(t);i<r.length;i++){var n=r[i];this.pagerObj[n]=t[n]}this.pagerObj.dataBind()}},e.prototype.clickHandler=function(e){var i=this.parent;if(this.isForceCancel||J(i)&&!i.prevPageMoving)return this.isForceCancel?this.isForceCancel=!1:(t.isNullOrUndefined(e.newProp)||t.isNullOrUndefined(e.newProp.pageSize)?e.currentPage&&(i.notify(Zt,{instance:this,handler:this.goToPage,arg1:e.currentPage}),this.pagerObj.currentPage=i.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:i.pageSettings.currentPage):(i.notify(Zt,{instance:this,handler:this.setPageSize,arg1:e.newProp.pageSize}),this.pagerObj.pageSize=e.oldProp.pageSize,i.pageSettings.pageSize=e.newProp.pageSize),this.isForceCancel=!0,this.pagerObj.dataBind()),void(e.cancel=!0);i.pageSettings.pageSize=this.pagerObj.pageSize,i.prevPageMoving=!1;var r=this.pageSettings.currentPage;this.pageSettings.currentPage=e.currentPage;var n={cancel:!1,requestType:"paging",previousPage:r,currentPage:e.currentPage,type:yt};this.parent.notify(Bt,n),n.cancel&&(e.cancel=!0),this.parent.requestTypeAction="paging"},e.prototype.keyPressHandler=function(e){e.action in dn&&(e.preventDefault(),this.element.querySelector(dn[e.action]).click())},e.prototype.updateExternalMessage=function(e){this.pagerObj.enableExternalMessage||(this.pagerObj.enableExternalMessage=!0,this.pagerObj.dataBind()),this.pagerObj.externalMessage=e,this.pagerObj.dataBind()},e.prototype.appendToElement=function(e){this.isInitialLoad=!0,this.parent.element.appendChild(this.element),this.parent.setGridPager(this.element),this.pagerObj.isReact=this.parent.isReact,this.pagerObj.appendTo(this.element),this.isInitialLoad=!1},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.appendToElement(),this.isReactTemplate()&&(this.pagerObj.updateTotalPages(),this.created()))},e.prototype.addEventListener=function(){this.handlers={load:this.render,end:this.appendToElement,ready:this.dataReady,complete:this.onActionComplete,updateLayout:this.enableAfterRender,inboundChange:this.onPropertyChanged,keyPress:this.keyPressHandler,created:this.created},this.parent.isDestroyed||(this.parent.isReact&&this.parent.addEventListener("created",this.handlers.created.bind(this)),this.parent.on(It,this.handlers.load,this),this.parent.on(Tt,this.handlers.end,this),this.parent.on(Et,this.handlers.ready,this),this.parent.on("paging-complete",this.handlers.complete,this),this.parent.on(Dt,this.handlers.updateLayout,this),this.parent.on(At,this.handlers.inboundChange,this),this.parent.on(qt,this.handlers.keyPress,this))},e.prototype.created=function(){this.isInitialRender&&this.isReactTemplate()&&(this.isInitialRender=!1,this.renderReactPagerTemplate())},e.prototype.isReactTemplate=function(){return this.parent.isReact&&this.pagerObj.template&&"string"!=typeof this.pagerObj.template},e.prototype.renderReactPagerTemplate=function(){if(!this.isInitialRender&&this.isReactTemplate()){this.parent.destroyTemplate(["pagerTemplate"]),this.element.classList.add("e-pagertemplate"),this.pagerObj.compile(this.pagerObj.template);var e=this.parent.pageSettings,t={currentPage:e.currentPage,pageSize:e.pageSize,pageCount:e.pageCount,totalRecordsCount:e.totalRecordsCount,totalPages:this.pagerObj.totalPages},i=this.parent.id+"_pagertemplate";this.pagerObj.templateFn(t,this.parent,"pagerTemplate",i,null,null,this.pagerObj.element),this.parent.renderTemplates()}},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.isReact&&this.parent.removeEventListener("created",this.handlers.created),this.parent.off("pager-refresh",this.renderReactPagerTemplate),this.parent.off(It,this.handlers.load),this.parent.off(Tt,this.handlers.end),this.parent.off(Et,this.handlers.ready),this.parent.off("paging-complete",this.handlers.complete),this.parent.off(Dt,this.handlers.updateLayout),this.parent.off(At,this.handlers.inboundChange),this.parent.off(qt,this.handlers.keyPress))},e.prototype.destroy=function(){this.removeEventListener(),this.isReactTemplate()&&this.parent.destroyTemplate(["pagerTemplate"]),this.pagerObj.destroy()},e.prototype.pagerDestroy=function(){this.pagerObj&&!this.pagerObj.isDestroyed&&(this.pagerObj.destroy(),t.remove(this.element))},e}(),dn={pageUp:".e-prev",pageDown:".e-next",ctrlAltPageDown:".e-last",ctrlAltPageUp:".e-first",altPageUp:".e-pp",altPageDown:".e-np"},pn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cn=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-filterbarcell"}),t}return pn(i,e),i.prototype.getGui=function(){return this.parent.createElement("div")},i.prototype.render=function(e,i){var r,n=this.parent.element.querySelector(".e-filterbar"),s=this.element.cloneNode(),l=this.getGui(),a=e.column;if(n.appendChild(s),s.setAttribute("e-mappinguid",a.uid),a.filterTemplate){var h={};i&&(h[a.field]=i[a.field]);if(h.column=a,a.visible){var d=this.parent.isReact&&"string"!=typeof a.filterTemplate,p=this.parent.element.id+a.uid+"filterTemplate";d?(a.getFilterTemplate()(h,this.parent,"filterTemplate",p,null,null,s),this.parent.renderTemplates()):q(s,a.getFilterTemplate()(h,this.parent,"filterTemplate",p))}else s.classList.add("e-hide")}else if("checkbox"!==a.type){if(!t.isNullOrUndefined(a.allowFiltering)&&!a.allowFiltering||t.isNullOrUndefined(a.filterBarTemplate)){t.attributes(l,{class:"e-filterdiv e-fltrinputdiv"}),r=this.parent.createElement("input",{id:a.field+"_filterBarcell",className:"e-filtertext",attrs:{type:"search",title:a.headerText+e.attributes.title,value:i[e.column.field]?i[e.column.field]:"",role:"search"}}),l.appendChild(r);c={element:r,floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0}};o.Input.createInput(c,this.parent.createElement)}else if(s.classList.add("e-fltrtemp"),t.attributes(l,{class:"e-fltrtempdiv"}),t.isNullOrUndefined(a.filterBarTemplate.create))r=this.parent.createElement("input",{id:a.field+"_filterBarcell",className:"e-filterUi_input e-filtertext e-fltrTemp",attrs:{type:"search",title:a.headerText}}),l.appendChild(r);else{var c={column:a,node:Element},u=a.filterBarTemplate.create;if("string"==typeof u&&(u=t.getValue(u,window)),"string"==typeof(r=u(c))){var g=this.parent.createElement("div");g.innerHTML=r,r=g.firstChild}t.attributes(l,{class:"e-filterUi_input e-filtertext e-fltrTemp",title:a.headerText,id:a.field+"_filterBarcell"}),l.appendChild(r)}if((!1===a.allowFiltering||""===a.field||t.isNullOrUndefined(a.field))&&(r.setAttribute("disabled","true"),r.classList.add("e-disable")),a.visible||s.classList.add("e-hide"),this.appendHtml(s,l),this.parent.filterSettings.showFilterBarOperator&&"FilterBar"===this.parent.filterSettings.type&&!this.parent.isPrinting&&t.isNullOrUndefined(a.filterTemplate)&&this.operatorIconRender(l,a,e),(t.isNullOrUndefined(a.allowFiltering)||a.allowFiltering)&&!t.isNullOrUndefined(a.filterBarTemplate)){var f=a.filterBarTemplate.write,c={element:r,column:a};"string"==typeof f&&(f=t.getValue(f,window)),f.call(this,c)}}return s},i.prototype.appendHtml=function(e,t){return e.appendChild(t),e},i.prototype.operatorIconRender=function(e,i,r){var n=this.parent,o=this.parent.createElement("input",{className:" e-filterbaroperator e-icons e-icon-filter",id:r.column.uid});e.querySelector("span").appendChild(o);var l=i.filter&&i.filter.operator?i.filter.operator:"equal";t.isNullOrUndefined(n.filterModule.operators[i.field])||(l=n.filterModule.operators[i.field]),this.dropOptr=new s.DropDownList({fields:{text:"text",value:"value"},popupHeight:"auto",value:l,width:"0px",enabled:i.allowFiltering,popupWidth:"auto",enableRtl:this.parent.enableRtl,change:this.internalEvent.bind(this),beforeOpen:function(){var e=n.filterModule.customOperators;this.dataSource=e[n.getColumnByUid(this.element.id).type+"Operator"];for(var r=0;r<this.dataSource.length;r++)i.filter&&i.filter.operator&&t.isNullOrUndefined(n.filterModule.operators[i.field])&&this.dataSource[r].value===i.filter.operator&&(this.value=i.filter.operator)}}),this.dropOptr.appendTo(o);var a=t.closest(this.dropOptr.element,"span");a.classList.add("e-filterbardropdown"),a.removeAttribute("tabindex")},i.prototype.internalEvent=function(e){var t=this.parent,i=t.getColumnByUid(e.element.getAttribute("id"));e.column=i,t.filterModule.operators[i.field]=e.value,t.notify("get-filterbar-operator",e)},i}(Ti),un=function(){function e(e,t,i,r){this.parent=e,this.serviceLocator=i,this.filterSettings=r,this.customFilterOperators=t}return e.prototype.renderOperatorUI=function(e,i,r,n,o){this.dialogObj=n;var l=r.type+"Operator";this.optrData=this.customOptr=t.isNullOrUndefined(o)?t.isNullOrUndefined(this.parent.filterSettings.operators)||t.isNullOrUndefined(this.parent.filterSettings.operators[l])?this.customFilterOperators[l]:this.parent.filterSettings.operators[l]:o;var a=this.customOptr,h=this.dropSelectedVal(r,l),d=this.parent.createElement("div",{className:"e-flm_optrdiv"});e.appendChild(d);var p=this.parent.createElement("input",{id:r.uid+"-floptr"});d.appendChild(p),this.dropOptr=new s.DropDownList({dataSource:a,fields:{text:"text",value:"value"},open:this.dropDownOpen.bind(this),cssClass:"e-popup-flmenu",enableRtl:this.parent.enableRtl,text:h}),this.dropOptr.appendTo("#"+r.uid+"-floptr")},e.prototype.renderResponsiveDropDownList=function(e){e.popup.element.style.width="100%"},e.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString(),this.parent.enableAdaptiveUI&&this.renderResponsiveDropDownList(e)},e.prototype.dropSelectedVal=function(e,r){for(var n="",o=0,s=this.parent.filterSettings.columns;o<s.length;o++){var l=s[o];if(e.field===l.field||e.isForeignColumn()&&e.foreignKeyValue===l.field){var a=new i.DataManager(this.optrData).executeLocal((new i.Query).where("value","equal",l.operator));n=t.isNullOrUndefined(a[0])?"":a[0].text}}if(""===n)if(e.filter.operator)for(var h=Object.keys(this.optrData).length,d=0;d<h;d++)this.optrData[d].value===e.filter.operator&&(n=this.optrData[d].text);else n=this.optrData[0].text;return n},e.prototype.getFlOperator=function(){return this.dropOptr.value},e}(),gn=function(){function e(e,t,i){this.parent=e,this.serLocator=t,this.filterSettings=i}return e.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"strui-"+e.column.uid}),e.target.appendChild(this.instance),this.dialogObj=e.dialogObj,this.actObj=this.getAutoCompleteOptions(e),this.actObj.appendTo(this.instance)},e.prototype.getAutoCompleteOptions=function(e){var r,n=this,o=e.column.isForeignColumn();o&&((r=new i.Query).params=this.parent.query.params);var l=o?e.column.dataSource:this.parent.dataSource,a={value:o?e.column.foreignKeyValue:e.column.field},h=new s.AutoComplete(t.extend({dataSource:l instanceof i.DataManager?l:new i.DataManager(l),fields:a,locale:this.parent.locale,enableRtl:this.parent.enableRtl,query:o?r:this.parent.query.clone(),sortOrder:"Ascending",open:this.openPopup.bind(this),cssClass:"e-popup-flmenu",focus:function(){n.actObj.filterType=e.getOptrInstance.getFlOperator()},autofill:!0,placeholder:e.localizeText.getConstant("EnterValue"),actionComplete:function(e){e.result=e.result.filter(function(e,i,r){return r.map(function(e){return t.getValue(n.actObj.fields.value,e)}).indexOf(t.getValue(n.actObj.fields.value,e))===i})}},e.column.filter.params));if(l&&"result"in l){var d=Te({requestType:"stringfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new i.Query);this.parent.trigger("dataStateChange",d.state),d.deffered.promise.then(function(e){h.dataSource=new i.DataManager(e)})}return h},e.prototype.write=function(e){this.filterSettings.columns;""===e.filteredValue||t.isNullOrUndefined(e.filteredValue)||(document.querySelector("#strui-"+e.column.uid).ej2_instances[0].value=e.filteredValue)},e.prototype.read=function(e,i,r,n){var o=document.querySelector("#strui-"+i.uid).ej2_instances[0];t.Browser.isDevice&&(o.hidePopup(),o.focusOut());var s=o.value;(t.isNullOrUndefined(s)||""===s)&&(s=null),n.filterByColumn(i.field,r,s,"and",this.parent.filterSettings.enableCaseSensitivity)},e.prototype.openPopup=function(e){te(e,this.dialogObj)},e}(),fn=function(){function e(e,t,i){this.filterSettings=i,this.parent=e,this.serviceLocator=t}return e.prototype.keyEventHandler=function(e){if(13===e.keyCode||9===e.keyCode){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.dispatchEvent(t)}},e.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"numberui-"+e.column.uid}),e.target.appendChild(this.instance),this.numericTxtObj=new o.NumericTextBox(t.extend({format:"string"==typeof e.column.format||t.isUndefined(e.column.format)?e.column.format:e.column.format.format,locale:this.parent.locale,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("EnterValue"),enableRtl:this.parent.enableRtl},e.column.filter.params)),this.numericTxtObj.appendTo(this.instance)},e.prototype.write=function(e){var t=document.querySelector("#numberui-"+e.column.uid).ej2_instances[0];t.element.addEventListener("keydown",this.keyEventHandler),t.value=e.filteredValue},e.prototype.read=function(e,t,i,r){var n=document.querySelector("#numberui-"+t.uid).ej2_instances[0].value;r.filterByColumn(t.field,i,n,"and",!0)},e}(),mn=function(){function e(e,t,i){this.parent=e,this.serviceLocator=t,this.filterSettings=i}return e.prototype.create=function(e){var r=e.column.isForeignColumn(),n=r?e.column.dataSource:this.parent.dataSource,o=r?e.column.foreignKeyValue:e.column.field;this.elem=this.parent.createElement("input",{className:"e-flmenu-input",id:"bool-ui-"+e.column.uid}),e.target.appendChild(this.elem),this.dialogObj=e.dialogObj,this.dropInstance=new s.DropDownList(t.extend({dataSource:n instanceof i.DataManager?n:new i.DataManager(n),query:(new i.Query).select(o),fields:{text:o,value:o},placeholder:e.localizeText.getConstant("SelectValue"),cssClass:"e-popup-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this),actionComplete:function(e){e.result=i.DataUtil.distinct(e.result,o,!0)}},e.column.filter.params)),this.dropInstance.appendTo(this.elem)},e.prototype.write=function(e){var i=document.querySelector("#bool-ui-"+e.column.uid).ej2_instances[0];t.isNullOrUndefined(e.filteredValue)||(i.text=e.filteredValue)},e.prototype.read=function(e,t,i,r){var n=document.querySelector("#bool-ui-"+t.uid).ej2_instances[0].value;r.filterByColumn(t.field,i,n,"and",!1)},e.prototype.openPopup=function(e){te(e,this.dialogObj)},e}(),yn=function(){function e(e,t,i){this.parent=e,this.locator=t,this.fltrSettings=i}return e.prototype.create=function(e){var i=ue(e.column.format,e.column.type);this.dialogObj=e.dialogObj,this.inputElem=this.parent.createElement("input",{className:"e-flmenu-input",id:"dateui-"+e.column.uid}),e.target.appendChild(this.inputElem),"date"===e.column.type?this.datePickerObj=new l.DatePicker(t.extend({format:i,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this)},e.column.filter.params)):"datetime"===e.column.type&&(this.datePickerObj=new l.DateTimePicker(t.extend({format:i,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this)},e.column.filter.params))),this.datePickerObj.appendTo(this.inputElem)},e.prototype.write=function(e){this.fltrSettings.columns;document.querySelector("#dateui-"+e.column.uid).ej2_instances[0].value=t.isNullOrUndefined(e.filteredValue)?null:new Date(e.filteredValue)},e.prototype.read=function(e,i,r,n){var o=document.querySelector("#dateui-"+i.uid).ej2_instances[0].value;o=t.isNullOrUndefined(o)?null:o,n.filterByColumn(i.field,r,o,"and",!0)},e.prototype.openPopup=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},e}(),vn=function(){function e(e,t,i,r,n){this.isDialogOpen=!1,this.maxHeight="350px",this.isMenuCheck=!1,this.colTypes={string:gn,number:fn,date:yn,boolean:mn,datetime:yn},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.customFilterOperators=r,this.filterObj=n,this.flMuiObj=new un(this.parent,this.customFilterOperators,this.serviceLocator),this.l10n=this.serviceLocator.getService("localization"),this.menuFilterBase=new Yr(e)}return e.prototype.clearCustomFilter=function(e){this.clearBtnClick(e)},e.prototype.applyCustomFilter=function(e){this.filterBtnClick(e.col)},e.prototype.openDialog=function(e){this.options=e,this.col=this.parent.getColumnByField(e.field),(t.isNullOrUndefined(this.col.filter)||t.isNullOrUndefined(this.col.filter.type)||"Menu"===this.col.filter.type)&&this.renderDlgContent(e.target,this.col)},e.prototype.closeDialog=function(e){if(this.dlgObj){if(t.isBlazor())for(var i=this.parent.getColumns(),r=0;r<i.length;r++)if(i[r].filterTemplate){var n=this.parent.element.id+i[r].uid+"filterTemplate";t.updateBlazorTemplate(n,"FilterTemplate",i[r])}this.parent.isReact&&(this.parent.destroyTemplate(["filterTemplate"]),this.parent.renderTemplates());var o=document.getElementById(this.dlgObj.element.id);if(this.dlgObj&&!this.dlgObj.isDestroyed&&o){var s={cancel:!1,column:this.col,target:e,element:o};if(this.parent.notify("filter-menu-close",s),s.cancel)return;this.isDialogOpen=!1,this.isMenuCheck&&(this.menuFilterBase.unWireEvents(),this.parent.off(li,this.actionComplete),this.isMenuCheck=!1),this.dlgObj.destroy(),t.remove(o)}this.parent.notify("filter-dialog-close",{})}},e.prototype.renderDlgContent=function(e,i){var n={requestType:"filterbeforeopen",columnName:i.field,columnType:i.type};if(!t.isBlazor()||this.parent.isJsComponent){n.filterModel=this}this.parent.trigger(yt,n);var o=this.parent.createElement("div",{className:"e-flmenu-maindiv",id:i.uid+"-flmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-flmenu",id:i.uid+"-flmdlg"}),this.dlgDiv.setAttribute("aria-label",this.l10n.getConstant("FilterMenuDialogARIA")),this.parent.enableAdaptiveUI?document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv").appendChild(this.dlgDiv):this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new r.Dialog({showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,created:this.dialogCreated.bind(this,e,i),position:this.parent.element.classList.contains("e-device")?{X:"center",Y:"center"}:{X:"",Y:""},target:this.parent.element.classList.contains("e-device")?document.body:this.parent.element,buttons:[{click:this.filterBtnClick.bind(this,i),buttonModel:{content:this.l10n.getConstant("FilterButton"),isPrimary:!0,cssClass:"e-flmenu-okbtn"}},{click:this.clearBtnClick.bind(this,i),buttonModel:{content:this.l10n.getConstant("ClearButton"),cssClass:"e-flmenu-cancelbtn"}}],content:o,width:!t.isNullOrUndefined(O(e,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:250,animationSettings:{effect:"None"},cssClass:"e-filter-popup"});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgObj.appendTo(this.dlgDiv)},e.prototype.renderResponsiveDialog=function(){this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.buttons=[{}])},e.prototype.dialogCreated=function(e,i){!t.Browser.isDevice&&e&&ee(e,this.dlgObj,this.parent),this.renderFilterUI(e,i),this.parent.notify("filterDialogCreated",{}),this.parent.enableAdaptiveUI?(this.dlgObj.element.style.left="0px",this.dlgObj.element.style.maxHeight="none"):this.dlgObj.element.style.maxHeight=this.maxHeight,this.dlgObj.show(),i.filterTemplate||this.writeMethod(i,this.dlgObj.element.querySelector("#"+i.uid+"-flmenu"));var r={requestType:"filterafteropen",columnName:i.field,columnType:i.type};if(!t.isBlazor()||this.parent.isJsComponent){r.filterModel=this}this.isDialogOpen=!0,this.isMenuCheck||this.parent.trigger(vt,r)},e.prototype.renderFilterUI=function(e,t){var i=this.dlgObj.element.querySelector(".e-flmenu-maindiv");this.parent.log("column_type_missing",{column:t}),this.renderOperatorUI(i,e,t),this.renderFlValueUI(i,e,t)},e.prototype.renderOperatorUI=function(e,t,i){this.flMuiObj.renderOperatorUI(e,t,i,this.dlgObj,this.filterObj.menuOperator)},e.prototype.renderFlValueUI=function(e,i,r){var n=this.parent.createElement("div",{className:"e-flmenu-valuediv"}),o=this.filterObj;e.appendChild(n);this.flMuiObj,this.dlgObj;var s=new this.colTypes[r.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(r.filterTemplate){var l={};l[r.field]=l.value=o.values[r.field],r.foreignKeyValue&&(l[r.foreignKeyValue]=o.values[r.field],l[r.field]=void 0);l.column=r;var a=this.parent.isReact&&"string"!=typeof r.filterTemplate,h=this.parent.element.id+r.uid+"filterTemplate";if(a)r.getFilterTemplate()(l,this.parent,"filterTemplate",h,null,null,n),this.parent.renderTemplates();else{var d=r.getFilterTemplate()(l,this.parent,"filterTemplate",h);t.updateBlazorTemplate(h,"FilterTemplate",r),q(n,d)}this.isMenuCheck&&(this.menuFilterBase.cBox=this.dlgObj.element.querySelector(".e-checkboxlist.e-fields"),this.menuFilterBase.wireEvents(),this.parent.on(li,this.actionComplete,this),this.menuFilterBase.getAllData())}else if(t.isNullOrUndefined(r.filter)||t.isNullOrUndefined(r.filter.ui)||t.isNullOrUndefined(r.filter.ui.create))s.create({column:r,target:n,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj});else{var p=r.filter.ui.create;"string"==typeof p&&(p=t.getValue(p,window)),p({column:r,target:n,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj})}},e.prototype.writeMethod=function(e,i){for(var r,n=i.querySelector(".e-flmenu-valinput"),o=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),s=0,l=this.filterSettings.columns;s<l.length;s++){var a=l[s];e.uid===a.uid&&(r=a.value)}if(t.isNullOrUndefined(e.filter)||t.isNullOrUndefined(e.filter.ui)||t.isNullOrUndefined(e.filter.ui.write))o.write({column:e,target:n,parent:this.parent,filteredValue:r});else{var h=e.filter.ui.write;"string"==typeof h&&(h=t.getValue(h,window)),h({column:e,target:n,parent:this.parent,filteredValue:r})}},e.prototype.filterBtnClick=function(e){var i,r=this.dlgObj.element.querySelector(".e-flmenu-valuediv input");i=this.flMuiObj.getFlOperator();var n=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(e.filterTemplate){var o=this.dlgDiv.querySelector(".e-flmenu-valuediv"),s=void 0;if(o.children[0].value)s=o.children[0].value;else if(t.isBlazor()||t.isNullOrUndefined(o.children[0].ej2_instances)){var l=o.querySelector(".e-control");s="boolean"===e.type?l.checked:t.isNullOrUndefined(l.ej2_instances)?l.value:l.ej2_instances[0].value}else s=o.querySelector("input").ej2_instances[0].value;this.filterObj.filterByColumn(e.field,i,s)}else if(t.isNullOrUndefined(e.filter)||t.isNullOrUndefined(e.filter.ui)||t.isNullOrUndefined(e.filter.ui.read))n.read(r,e,i,this.filterObj);else{var a=e.filter.ui.read;"string"==typeof a&&(a=t.getValue(a,window)),a({element:r,column:e,operator:i,fltrObj:this.filterObj})}this.closeDialog()},e.prototype.closeResponsiveDialog=function(){this.closeDialog()},e.prototype.clearBtnClick=function(e){this.filterObj.removeFilteredColsByField(e.field),t.isBlazor()&&!this.parent.isJsComponent&&this.parent.setProperties({filterSettings:{columns:this.filterSettings.columns}},!0),this.closeDialog();var i=this.parent.showColumnMenu?".e-columnmenu":".e-icon-filter",r=this.parent.element.querySelector('[e-mappinguid="'+e.uid+'"]').parentElement.querySelector(i);r&&r.classList.remove("e-filtered")},e.prototype.destroy=function(){this.closeDialog()},e.prototype.getFilterUIInfo=function(){return{field:this.col.field,operator:this.flMuiObj.getFlOperator()}},e.prototype.renderCheckBoxMenu=function(){return this.isMenuCheck=!0,this.menuFilterBase.updateModel(this.options),this.menuFilterBase.getAndSetChkElem(this.options),this.dlgObj.buttons=[{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{content:this.menuFilterBase.getLocalizedLabel("FilterButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{cssClass:"e-flat",content:this.menuFilterBase.getLocalizedLabel("ClearButton")}}],this.menuFilterBase.dialogObj=this.dlgObj,this.menuFilterBase.dlg=this.dlgObj.element,this.menuFilterBase.dlg.classList.add("e-menucheckbox"),this.menuFilterBase.dlg.classList.remove("e-checkboxfilter"),this.maxHeight="800px",this.menuFilterBase.sBox.innerHTML},e.prototype.actionComplete=function(e){this.isMenuCheck&&this.parent.trigger(vt,e)},e}(),Cn=function(){function e(e,t,i){this.parent=e,this.isresetFocus=!0,this.checkBoxBase=new Yr(e),this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.checkBoxBase.closeDialog()},e.prototype.openDialog=function(e){this.checkBoxBase.openDialog(e),this.parent.log("column_type_missing",{column:e.column})},e.prototype.closeDialog=function(){this.removeEventListener(),this.checkBoxBase.closeDialog(),this.isresetFocus&&this.parent.notify("restore-Focus",{})},e.prototype.closeResponsiveDialog=function(e){this.checkBoxBase.closeDialog()},e.prototype.getModuleName=function(){return"checkboxFilter"},e.prototype.actionBegin=function(e){this.parent.trigger(yt,e)},e.prototype.actionComplete=function(e){this.parent.trigger(vt,e)},e.prototype.actionPrevent=function(e){J(this.parent)&&(this.parent.notify(Zt,e),e.cancel=!0)},e.prototype.clearCustomFilter=function(e){this.checkBoxBase.clearFilter(e)},e.prototype.applyCustomFilter=function(e){this.checkBoxBase.fltrBtnHandler(),this.checkBoxBase.closeDialog()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("cbox-filter-begin",this.actionBegin,this),this.parent.on(li,this.actionComplete,this),this.parent.on(ai,this.actionPrevent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("cbox-filter-begin",this.actionBegin),this.parent.off(li,this.actionComplete),this.parent.off(ai,this.actionPrevent))},e}(),wn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bn=function(e){function t(t,i,r,n){var o=e.call(this,t,i,r)||this;return o.parent=t,o.isresetFocus=!0,o.excelFilterBase=new Zr(t,n),o}return wn(t,e),t.prototype.destroy=function(){this.excelFilterBase.closeDialog()},t.prototype.openDialog=function(e){this.excelFilterBase.openDialog(e)},t.prototype.closeDialog=function(){this.excelFilterBase.closeDialog(),this.isresetFocus&&this.parent.notify("restore-Focus",{})},t.prototype.clearCustomFilter=function(e){this.excelFilterBase.clearFilter(e)},t.prototype.closeResponsiveDialog=function(e){e?this.excelFilterBase.removeDialog():this.closeDialog()},t.prototype.applyCustomFilter=function(e){e.isCustomFilter?this.excelFilterBase.filterBtnClick(e.col.field):(this.excelFilterBase.fltrBtnHandler(),this.excelFilterBase.closeDialog())},t.prototype.filterByColumn=function(e,t,i,r,n,o,s,l){this.excelFilterBase.filterByColumn(e,t,i,r,n,o,s,l)},t.prototype.getFilterUIInfo=function(){return this.excelFilterBase.getFilterUIInfo()},t.prototype.getModuleName=function(){return"excelFilter"},t}(Cn),Sn=function(){function r(e,t,i){this.predicate="and",this.contentRefresh=!0,this.filterByMethod=!0,this.refresh=!0,this.values={},this.operators={},this.cellText={},this.nextFlMenuOpen="",this.type={Menu:vn,CheckBox:Cn,Excel:bn},this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith"},this.fltrDlgDetails={field:"",isOpen:!1},this.skipNumberInput=["="," ","!"],this.skipStringInput=[">","<","="],this.actualPredicate={},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.addEventListener(),this.setFullScreenDialog()}return r.prototype.render=function(r){if(!(i.DataUtil.getObject("args.isFrozen",r)||"Left-Right"===this.parent.getFrozenMode()&&i.DataUtil.getObject("args.renderFrozenRightContent",r))){var n=this.parent;if(this.l10n=this.serviceLocator.getService("localization"),this.getLocalizedCustomOperators(),"FilterBar"===this.parent.filterSettings.type&&n.columns.length){var o=this.parent.element.querySelector(".e-filterbar");o&&t.remove(o);var s=new vi(this.serviceLocator,e.CellType.Filter,n),l=void 0;this.serviceLocator.getService("cellRendererFactory").addCellRenderer(e.CellType.Filter,new cn(this.parent,this.serviceLocator)),this.valueFormatter=this.serviceLocator.getService("valueFormatter"),s.element=this.parent.createElement("tr",{className:"e-filterbar"}),(l=this.generateRow()).data=this.values,"Right"===n.getFrozenMode()?n.getFrozenRightHeader().querySelector("thead").appendChild(s.element):this.parent.getHeaderContent().querySelector("thead").appendChild(s.element);var a=this.parent.element.querySelector(".e-rowdragheader");this.element=s.render(l,n.getColumns(),null,null,s.element);var h=this.element.querySelector(".e-detailheadercell");h&&(h.className="e-filterbarcell e-mastercell"),a&&(a.className="e-dragheadercell e-mastercell");var d=[].slice.call(this.element.querySelectorAll(".e-grouptopleftcell"));d.length&&d[d.length-1].classList.add("e-lastgrouptopleftcell"),this.wireEvents(),this.parent.notify(ii,{case:"filter"})}}},r.prototype.showCustomFilter=function(){this.responsiveDialogRenderer.showResponsiveDialog(this.column)},r.prototype.setFilterModel=function(e){var t=e.filter.type||this.parent.filterSettings.type;this.filterModule=new this.type[t](this.parent,this.parent.filterSettings,this.serviceLocator,this.customOperators,this)},r.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))){if(this.filterModule&&this.filterModule.destroy(),this.parent.refreshing||(this.filterSettings.columns=[]),this.updateFilterMsg(),this.removeEventListener(),this.unWireEvents(),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator)for(var i=this.element.querySelectorAll(".e-filterbaroperator"),r=0;r<i.length;r++)i[r].ej2_instances[0].destroy();if(this.element){t.remove(this.element);var n=this.parent.getHeaderContent().querySelector(".e-filterbar");this.parent.isFrozenGrid()&&n&&t.remove(n)}}},r.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,e.ResponsiveDialogAction.isFilter)},r.prototype.generateRow=function(e){var t=new fi({});return t.cells=this.generateCells(),t},r.prototype.generateCells=function(){var t=[];if(this.parent.allowGrouping)for(var i=0,r=this.parent.groupSettings.columns.length;i<r;i++)t.push(this.generateCell({},e.CellType.HeaderIndent));(this.parent.detailTemplate||this.parent.childGrid)&&t.push(this.generateCell({},e.CellType.DetailHeader)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&t.push(this.generateCell({},e.CellType.RowDragHIcon));for(var n=0,o=this.parent.getColumns();n<o.length;n++){var s=o[n];t.push(this.generateCell(s))}return"Right"===this.parent.getFrozenMode()&&t.push(this.generateCell({},e.CellType.RowDragHIcon)),t},r.prototype.generateCell=function(t,i){var r={visible:t.visible,isDataCell:!1,rowId:"",column:t,cellType:i||e.CellType.Filter,attributes:{title:this.l10n.getConstant("FilterbarTitle")}};return new mi(r)},r.prototype.updateModel=function(){var e=this.parent.getColumnByField(this.fieldName);this.filterObjIndex=this.getFilteredColsIndexByField(e),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex];for(var t=Array.isArray(this.value)?this.value:[this.value],i=0,r=t.length;i<r;i++){var n=e.isForeignColumn()?e.foreignKeyValue:this.fieldName;this.currentFilterObject={field:n,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:t[i],predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}};var o=this.getFilteredColsIndexByField(e);o>-1&&!Array.isArray(this.value)?this.filterSettings.columns[o]=this.currentFilterObject:this.filterSettings.columns.push(this.currentFilterObject)}this.filterSettings.columns=this.filterSettings.columns,this.parent.dataBind()},r.prototype.getFilteredColsIndexByField=function(e){for(var t=this.filterSettings.columns,i=0,r=t.length;i<r;i++)if(t[i].uid===e.uid||e.isForeignColumn()&&this.parent.getColumnByUid(e.uid).field===e.foreignKeyValue)return i;return-1},r.prototype.onActionComplete=function(e){t.isBlazor()&&!this.parent.isJsComponent&&(e.rows=null);var i=this.isRemove?{requestType:"filtering",type:vt}:{currentFilterObject:this.currentFilterObject,currentFilteringColumn:t.isNullOrUndefined(this.column)?void 0:this.column.field,columns:this.filterSettings.columns,requestType:"filtering",type:vt};this.parent.trigger(vt,t.extend(e,i)),this.isRemove=!1},r.prototype.wireEvents=function(){t.EventHandler.add(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate,this)},r.prototype.unWireEvents=function(){t.EventHandler.remove(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate)},r.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.parent.getHeaderTable().classList.add("e-sortfilter"),this.render())},r.prototype.refreshFilterValue=function(){"FilterBar"===this.filterSettings.type&&this.filterSettings.columns.length&&!this.parent.getCurrentViewRecords().length&&this.parent.enablePersistence&&(this.initialEnd(),this.parent.removeEventListener("beforeDataBound",this.refreshFilterValue))},r.prototype.initialEnd=function(){if(this.parent.off(Mt,this.initialEnd),this.parent.getColumns().length&&this.filterSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.initialLoad=!0;for(var t=0,i=e.filterSettings.columns;t<i.length;t++){var r=i[t];this.filterByColumn(r.field,r.operator,r.value,r.predicate,r.matchCase,r.ignoreAccent,r.actualFilterValue,r.actualOperator)}this.initialLoad=!1,this.updateFilterMsg(),this.contentRefresh=!0}},r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("set-fullscreen-dialog",this.setFullScreenDialog,this),this.parent.on(Dt,this.enableAfterRender,this),this.parent.on("filtering-complete",this.onActionComplete,this),this.parent.on(At,this.onPropertyChanged,this),this.parent.on(qt,this.keyUpHandler,this),this.parent.on(Vt,this.columnPositionChanged,this),this.parent.on(Lt,this.render,this),this.parent.on(Mt,this.initialEnd,this),this.parent.on("filter-menu-close",this.filterMenuClose,this),this.docClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.docClickHandler,this),this.parent.on("filterOpen",this.columnMenuFilter,this),this.parent.on(Ht,this.filterIconClickHandler,this),this.parent.on("persist-data-changed",this.initialEnd,this),this.parent.on("close-filter-dialog",this.clickHandler,this),this.parent.addEventListener("beforeDataBound",this.refreshFilterValue.bind(this)))},r.prototype.removeEventListener=function(){t.EventHandler.remove(document,"click",this.docClickHandler),this.parent.isDestroyed||(this.parent.off("set-fullscreen-dialog",this.setFullScreenDialog),this.parent.off(Dt,this.enableAfterRender),this.parent.off("filtering-complete",this.onActionComplete),this.parent.off(At,this.onPropertyChanged),this.parent.off(qt,this.keyUpHandler),this.parent.off(Vt,this.columnPositionChanged),this.parent.off(Lt,this.render),this.parent.off("filterOpen",this.columnMenuFilter),this.parent.off("filter-menu-close",this.filterMenuClose),this.parent.off(Ht,this.filterIconClickHandler),this.parent.off("close-filter-dialog",this.clickHandler))},r.prototype.filterMenuClose=function(e){this.fltrDlgDetails.isOpen=!1},r.prototype.filterByColumn=function(e,i,r,n,o,s,l,a){var h,d=this,p=this.parent;if(this.column=p.grabColumnByFieldFromAllCols(e),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(i=this.getOperatorName(e)),this.column){if("FilterBar"===this.filterSettings.type&&(h=p.getHeaderContent().querySelector("[id='"+this.column.field+"_filterBarcell']")),!t.isNullOrUndefined(this.column.allowFiltering)&&!this.column.allowFiltering)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:this.column.headerText});if(J(p))return void p.notify(Zt,{instance:this,handler:this.filterByColumn,arg1:e,arg2:i,arg3:r,arg4:n,arg5:o,arg6:s,arg7:l,arg8:a});if(this.predicate=n||(Array.isArray(r)?"or":"and"),this.value=r,this.matchCase=o||!1,this.ignoreAccent=this.ignoreAccent=t.isNullOrUndefined(s)?this.parent.filterSettings.ignoreAccent:s,this.fieldName=e,this.operator=i,r=!t.isNullOrUndefined(r)&&r.toString(),"number"!==this.column.type&&"date"!==this.column.type||(this.matchCase=!0),p.getColumnHeaderByField(e).setAttribute("aria-filtered","true"),h&&"FilterBar"===this.filterSettings.type){if(r.length<1||!this.filterByMethod&&this.checkForSkipInput(this.column,r))return this.filterStatusMsg=r.length<1?"":this.l10n.getConstant("InvalidFilterMessage"),void this.updateFilterMsg();h.value!==r&&(h.value=r)}t.isNullOrUndefined(this.column.format)?this.values[this.column.field]=r:(this.applyColumnFormat(r),this.initialLoad&&"FilterBar"===this.filterSettings.type&&(h.value=this.values[this.column.field]));var c={field:this.fieldName,predicate:n,matchCase:o,ignoreAccent:s,operator:this.operator,value:this.value,type:this.column.type};this.parent.filterSettings.columns.filter(function(e){return e.field===d.fieldName}).length>1&&!t.isNullOrUndefined(this.actualPredicate[this.fieldName])?this.actualPredicate[this.fieldName].push(c):this.actualPredicate[this.fieldName]=[c],this.checkAlreadyColFiltered(this.column.field)||this.updateModel()}},r.prototype.applyColumnFormat=function(e){var t="date"===this.column.type||"datetime"===this.column.type?new Date(e):parseFloat(e);this.values[this.column.field]=this.setFormatForFlColumn(t,this.column)},r.prototype.skipUid=function(e){for(var t=!0,i=Object.keys(e),r=0;r<i.length;r++){var n=Object.keys(e[i[r]]);1===n.length&&"uid"===n[0]&&(t=!1)}return t},r.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var i=0,r=Object.keys(e.properties);i<r.length;i++){var n=r[i];switch(n){case"columns":var o={currentFilterObject:this.currentFilterObject,currentFilteringColumn:this.column?this.column.field:void 0,action:"filter",columns:this.filterSettings.columns,requestType:"filtering",type:yt,cancel:!1};if(this.contentRefresh&&this.skipUid(e.properties.columns)){if(this.parent.notify(Bt,o),o.cancel)return void(t.isNullOrUndefined(this.prevFilterObject)?this.filterSettings.columns.splice(this.filterSettings.columns.length-1,1):this.filterSettings.columns[this.filterObjIndex]=this.prevFilterObject);this.addFilteredClass(o.currentFilteringColumn),this.updateFilterIcon(),this.refreshFilterSettings(),this.updateFilterMsg(),this.updateFilter()}break;case"showFilterBarStatus":e.properties[n]?this.updateFilterMsg():this.parent.allowPaging&&this.parent.updateExternalMessage("");break;case"showFilterBarOperator":case"type":this.parent.refreshHeader(),this.refreshFilterSettings()}}},r.prototype.refreshFilterSettings=function(){if("FilterBar"===this.filterSettings.type){for(n=0;n<this.filterSettings.columns.length;n++){this.column=this.parent.grabColumnByUidFromAllCols(this.filterSettings.columns[n].uid);var e=this.filterSettings.columns[n].value;if(e=!t.isNullOrUndefined(e)&&e.toString(),t.isNullOrUndefined(this.column.format)){var i=this.filterSettings.columns[n].field;this.values[i]=this.filterSettings.columns[n].value}else this.applyColumnFormat(e);(o=this.getFilterBarElement(this.column.field))&&(""===this.cellText[this.filterSettings.columns[n].field]||t.isNullOrUndefined(this.cellText[this.filterSettings.columns[n].field])?o.value=this.filterSettings.columns[n].value:o.value=this.cellText[this.column.field])}if(0===this.filterSettings.columns.length)for(var r=this.parent.getColumns(),n=0;n<r.length;n++){var o=this.getFilterBarElement(r[n].field);o&&""!==o.value&&(o.value="",delete this.values[r[n].field])}}},r.prototype.updateFilterIcon=function(){if(0===this.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var e=[].slice.call(this.parent.element.querySelectorAll(".e-filtered")),t=0,i=e.length;t<i;t++)e[t].removeAttribute("aria-filtered"),e[t].classList.remove("e-filtered")},r.prototype.getFilterBarElement=function(e){var i,r="[id='"+e+"_filterBarcell']";return r&&!t.isNullOrUndefined(this.element)&&(i=this.element.querySelector(r)),i},r.prototype.refreshFilter=function(){this.refreshFilterSettings(),this.updateFilterMsg()},r.prototype.clearFiltering=function(e){var i=this,r=k(this.filterSettings.columns);if(!t.isNullOrUndefined(e))return this.refresh=!1,e.forEach(function(e){i.removeFilteredColsByField(e,!1)}),this.parent.setProperties({filterSettings:{columns:this.filterSettings.columns}},!0),this.parent.renderModule.refresh(),void(this.refresh=!0);if(J(this.parent))return void this.parent.notify(Zt,{instance:this,handler:this.clearFiltering});for(s=0;s<r.length;s++)r[s].uid=r[s].uid||this.parent.getColumnByField(r[s].field).uid;var n=r.map(function(e){return e.uid}),o=n.filter(function(e,t){return n.indexOf(e)===t});this.refresh=!1;for(var s=0,l=o.length;s<l;s++)this.removeFilteredColsByField(this.parent.getColumnByUid(o[s]).field,!1);if(t.isBlazor()&&!this.parent.isJsComponent&&this.parent.setProperties({filterSettings:{columns:this.filterSettings.columns}},!0),this.refresh=!0,o.length&&this.parent.renderModule.refresh(),0===this.parent.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var a=[].slice.call(this.parent.element.querySelectorAll(".e-filtered")),s=0,l=a.length;s<l;s++)a[0].removeAttribute("aria-filtered"),a[0].classList.remove("e-filtered");this.isRemove=!0,this.filterStatusMsg="",this.updateFilterMsg()},r.prototype.checkAlreadyColFiltered=function(e){for(var t=0,i=this.filterSettings.columns;t<i.length;t++){var r=i[t];if(r.field===e&&r.value===this.value&&r.operator===this.operator&&r.predicate===this.predicate)return!0}return!1},r.prototype.columnMenuFilter=function(e){this.column=e.col;var i=t.closest(e.target,"#"+e.id);e.isClose&&!i?this.filterModule.closeDialog():i&&this.filterDialogOpen(this.column,e.target)},r.prototype.filterDialogOpen=function(e,t,i,r){this.filterModule&&this.filterModule.closeDialog(),this.setFilterModel(e),this.filterModule.openDialog(this.createOptions(e,t,i,r))},r.prototype.createOptions=function(e,i,r,n){var o=this.parent,s=e.filter.dataSource||o.dataSource&&"result"in o.dataSource?o.dataSource:o.getDataModule().dataManager,l=e.filter.type||this.parent.filterSettings.type;return{type:e.type,field:e.field,displayName:e.headerText,dataSource:s,format:e.format,height:800,columns:o.getColumns(),filteredColumns:o.filterSettings.columns,target:i,dataManager:o.getDataModule().dataManager,formatFn:e.getFormatter(),ignoreAccent:o.filterSettings.ignoreAccent,parserFn:e.getParser(),query:o.query,template:e.getFilterItemTemplate(),hideSearchbox:!t.isNullOrUndefined(e.filter.hideSearchbox)&&e.filter.hideSearchbox,handler:this.filterHandler.bind(this),localizedStrings:o.getLocaleConstants(),position:{X:r,Y:n},column:e,foreignKeyValue:e.foreignKeyValue,actualPredicate:this.actualPredicate,localeObj:o.localeObj,isRemote:o.getDataModule().isRemote(),allowCaseSensitive:this.filterSettings.enableCaseSensitivity,isResponsiveFilter:this.parent.enableAdaptiveUI,operator:this.actualPredicate[e.field]&&"Menu"===l?this.actualPredicate[e.field][0].operator:"equal"}},r.prototype.removeFilteredColsByField=function(e,i){var r,n=this.filterSettings.columns;if(J(this.parent)){var o={instance:this,handler:this.removeFilteredColsByField,arg1:e,arg2:i};return void this.parent.notify(Zt,o)}for(var s=n.map(function(e){return e.uid}),l=s.filter(function(e,t){return s.indexOf(e)===t}),a=this,h=0,d=l.length;h<d&&"break"!==function(o,s){n[o].uid=n[o].uid||a.parent.getColumnByField(n[o].field).uid;var h=n.length,d=a.parent.grabColumnByUidFromAllCols(l[o]);if(d.field===e||d.field===d.foreignKeyValue&&d.isForeignColumn()){var p=a.filterSettings.columns.filter(function(e){return e.uid===d.uid})[0];if("FilterBar"===a.filterSettings.type&&!i){var c="[id='"+d.field+"_filterBarcell']";(r=a.parent.getHeaderContent().querySelector(c))&&(r.value="",delete a.values[e])}for(;h--;)n[h].uid===d.uid&&n.splice(h,1);var u=a.parent.getColumnHeaderByField(d.field);if(u.removeAttribute("aria-filtered"),"FilterBar"!==a.filterSettings.type){var g=a.parent.showColumnMenu?".e-columnmenu":".e-icon-filter";u.querySelector(g).classList.remove("e-filtered")}return a.isRemove=!0,a.actualPredicate[e]&&delete a.actualPredicate[e],a.values[e]&&delete a.values[e],a.refresh&&(t.isBlazor()&&!a.parent.isJsComponent?(a.parent.setProperties({filterSettings:{columns:a.filterSettings.columns}},!0),a.parent.notify(Bt,{requestType:"filtering",type:yt,currentFilterObject:{field:d.field,operator:a.operator,value:a.value,predicate:a.predicate,matchCase:a.matchCase,ignoreAccent:a.ignoreAccent,actualFilterValue:{},actualOperator:{}},currentFilterColumn:d})):a.parent.notify(Bt,{requestType:"filtering",type:yt,currentFilterObject:p,currentFilterColumn:d,action:"clearFilter"})),"break"}}(h);h++);this.updateFilterMsg()},r.prototype.getModuleName=function(){return"filter"},r.prototype.keyUpHandlerImmediate=function(e){13!==e.keyCode&&this.keyUpHandler(e)},r.prototype.keyUpHandler=function(e){var i=this.parent,r=e.target;if(r&&t.matches(r,".e-filterbar input")){var n=t.closest(r,"th.e-filterbarcell");if(this.column=i.getColumnByUid(n.getAttribute("e-mappinguid")),!this.column)return;if("altDownArrow"===e.action&&this.parent.filterSettings.showFilterBarOperator){var o=t.closest(r,"span").querySelector(".e-filterbaroperator");o.ej2_instances[0].showPopup(),o.focus()}"Immediate"!==this.filterSettings.mode&&(13!==e.keyCode||e.target.classList.contains("e-filterbaroperator"))||9===e.keyCode||this.column.filterTemplate||(this.value=r.value.trim(),this.processFilter(e))}if("altDownArrow"===e.action&&"FilterBar"!==this.filterSettings.type){var s=i.focusModule.currentInfo.element;if(s&&s.classList.contains("e-headercell")){var l=i.getColumnByUid(s.firstElementChild.getAttribute("e-mappinguid"));this.openMenuByField(l.field),this.parent.focusModule.clearIndicator()}}"escape"===e.action&&"Menu"===this.filterSettings.type&&this.filterModule&&(this.filterModule.closeDialog(),i.notify("restore-Focus",{}))},r.prototype.updateCrossIcon=function(e){e.value.length&&e.nextElementSibling.classList.remove("e-hide")},r.prototype.updateFilterMsg=function(){if("FilterBar"===this.filterSettings.type){var e=this.parent,i=void 0,r=this.filterSettings.columns,n=(this.serviceLocator.getService("valueFormatter"),void 0);if(!this.filterSettings.showFilterBarStatus)return;if(r.length>0&&this.filterStatusMsg!==this.l10n.getConstant("InvalidFilterMessage")){this.filterStatusMsg="";for(var o=0;o<r.length;o++)if(n=e.grabColumnByUidFromAllCols(r[o].uid)||e.grabColumnByFieldFromAllCols(r[o].field),o&&(this.filterStatusMsg+=" && "),t.isNullOrUndefined(n.format))this.filterStatusMsg+=n.headerText+": "+this.values[n.field];else{var s="date"===n.type||"datetime"===n.type?this.valueFormatter.fromView(this.values[n.field],n.getParser(),n.type):this.values[n.field];i="date"!==n.type&&"datetime"!==n.type?this.serviceLocator.getService("valueFormatter").toView(s,n.getParser()).toString():this.setFormatForFlColumn(s,n),this.filterStatusMsg+=n.headerText+": "+i}}e.allowPaging&&e.updateExternalMessage(this.filterStatusMsg),this.filterStatusMsg=""}},r.prototype.setFormatForFlColumn=function(e,t){return this.serviceLocator.getService("valueFormatter").toView(e,t.getFormatter()).toString()},r.prototype.checkForSkipInput=function(e,t){var r;if("number"===e.type)(i.DataUtil.operatorSymbols[t]||this.skipNumberInput.indexOf(t)>-1)&&(r=!0);else if("string"===e.type)for(var n=0,o=t;n<o.length;n++){var s=o[n];this.skipStringInput.indexOf(s)>-1&&(r=!0)}return r},r.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},r.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick()},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},r.prototype.stopTimer=function(){window.clearInterval(this.timer)},r.prototype.onTimerTick=function(){var e="[id='"+this.column.field+"_filterBarcell']",i=this.element.querySelector(e);!i&&this.parent.isFrozenGrid()&&(i=this.parent.getHeaderContent().querySelector(e));var r;if(this.cellText[this.column.field]=i.value,this.stopTimer(),t.isNullOrUndefined(this.column.filterBarTemplate))r=JSON.parse(JSON.stringify(i.value));else{var n=this.column.filterBarTemplate.read;"string"==typeof n&&(n=t.getValue(n,window)),t.isNullOrUndefined(n)||(this.value=n.call(this,i))}if(t.isNullOrUndefined(this.value)||""===this.value)return void this.removeFilteredColsByField(this.column.field);this.validateFilterValue(this.value),this.filterByMethod=!1,this.filterByColumn(this.column.field,this.operator,this.value,this.predicate,this.filterSettings.enableCaseSensitivity,this.ignoreAccent),this.filterByMethod=!0,i.value=r,this.updateFilterMsg()},r.prototype.validateFilterValue=function(e){var i,r;this.parent;switch(this.matchCase=this.filterSettings.enableCaseSensitivity,this.column.type){case"number":this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal,i=[">","<","=","!"];for(var n=0;n<e.length;n++)if(i.indexOf(e[n])>-1){r=n;break}this.getOperator(e.substring(r)),0!==r&&(this.value=e.substring(0,r)),""!==this.value&&e.length>=1&&(this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type)),isNaN(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage"));break;case"date":case"datetime":this.operator=this.filterOperators.equal,""===this.value||this.value instanceof Date||(this.getOperator(e),this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type),t.isNullOrUndefined(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")));break;case"string":this.matchCase=!1,"*"===e.charAt(0)?(this.value=this.value.slice(1),this.operator=this.filterOperators.startsWith):"%"===e.charAt(e.length-1)?(this.value=this.value.slice(0,-1),this.operator=this.filterOperators.startsWith):"%"===e.charAt(0)?(this.value=this.value.slice(1),this.operator=this.filterOperators.endsWith):this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.startsWith;break;case"boolean":"true"===e.toLowerCase()||"1"===e?this.value=!0:"false"===e.toLowerCase()||"0"===e?this.value=!1:e.length&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")),this.operator=this.filterOperators.equal;break;default:this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal}},r.prototype.getOperator=function(e){var r=e.charAt(0),n=e.slice(0,2),o=t.extend({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},i.DataUtil.operatorSymbols);(o.hasOwnProperty(r)||o.hasOwnProperty(n))&&(this.operator=o[r],this.value=e.substring(1),this.operator||(this.operator=o[n],this.value=e.substring(2))),this.operator!==this.filterOperators.lessThan&&this.operator!==this.filterOperators.greaterThan||"="===this.value.charAt(0)&&(this.operator=this.operator+"orequal",this.value=this.value.substring(1))},r.prototype.columnPositionChanged=function(e){this.parent.filterSettings.type},r.prototype.getLocalizedCustomOperators=function(){var e=[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}];this.customOperators={stringOperator:[{value:"startswith",text:this.l10n.getConstant("StartsWith")},{value:"endswith",text:this.l10n.getConstant("EndsWith")},{value:"contains",text:this.l10n.getConstant("Contains")},{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}],numberOperator:e,dateOperator:e,datetimeOperator:e,booleanOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}]}},r.prototype.openMenuByField=function(e){var t=this.parent;if(t.enableAdaptiveUI)return void this.showCustomFilter();var i=t.getColumnByField(e),r=t.getColumnHeaderByField(e).querySelector(".e-filtermenudiv");if(r){var n=t.element.getBoundingClientRect(),o=r.getBoundingClientRect();this.filterDialogOpen(i,r,o.right-n.left,o.bottom-n.top)}},r.prototype.filterIconClickHandler=function(e){var t=e.target;if(t.classList.contains("e-filtermenudiv")&&("Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)){var i=this.parent.getColumnByUid(O(t,"e-headercell").firstElementChild.getAttribute("e-mappinguid"));if(this.column=i,this.fltrDlgDetails.field===i.field&&this.fltrDlgDetails.isOpen)return;this.filterModule&&this.filterModule.closeDialog(),this.fltrDlgDetails={field:i.field,isOpen:!0},this.openMenuByField(i.field)}},r.prototype.clickHandler=function(e){if("FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(O(e.target,"e-filterbarcell")&&e.target.classList.contains("e-input-group-icon")&&t.closest(e.target,"div").querySelector(".e-filterbaroperator").focus(),e.target.classList.contains("e-list-item"))){var i=document.querySelector(".e-popup-open").getAttribute("id").replace("_popup","");-1!==i.indexOf("grid-column")&&t.closest(document.getElementById(i),"div").querySelector(".e-filtertext").focus()}if("Immediate"===this.filterSettings.mode||"Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type){this.parent;var r=e.target,n=r.classList.contains("e-day"),o=O(this.parent.element,"e-dialog"),s=!1,l=O(r,"e-popup"),a=this.parent.element.querySelector(".e-filter-popup");if(o&&l&&(s=o.id===l.id),a&&(O(r,"e-excel-ascending")||O(r,"e-excel-descending"))&&this.filterModule.closeDialog(r),O(r,"e-filter-popup")||r.classList.contains("e-filtermenudiv"))return;if(!this.filterModule||O(r,"e-popup-wrapper")||t.closest(r,".e-filter-item.e-menu-item")||n||(s&&!O(r,"e-filter-popup")&&!O(r,"e-popup-flmenu")||!l&&a)&&(this.filterModule.isresetFocus=O(r,"e-grid")&&O(r,"e-grid").id===this.parent.element.id,this.filterModule.closeDialog(r)),"Immediate"===this.filterSettings.mode&&r.classList.contains("e-clear-icon")){var h=r.previousElementSibling;this.removeFilteredColsByField(h.id.slice(0,-14))}}},r.prototype.filterHandler=function(e){var r;this.actualPredicate[e.field]=e.actualPredicate;for(var n=new i.DataManager(this.filterSettings.columns),o=(new i.Query).where("field",this.filterOperators.equal,e.field),s=n.executeLocal(o),l=0;l<s.length;l++){for(var a=-1,h=0;h<this.filterSettings.columns.length;h++)if(s[l].field===this.filterSettings.columns[h].field){a=h;break}-1!==a&&this.filterSettings.columns.splice(a,1)}"clear-filter"===e.action&&t.isBlazor()&&!this.parent.isJsComponent&&this.parent.setProperties({filterSettings:{columns:this.filterSettings.columns}},!0),this.values[e.field]&&delete this.values[e.field];var d=this.parent.showColumnMenu?".e-columnmenu":".e-icon-filter";r=this.parent.getColumnHeaderByField(e.field).querySelector(d),"filtering"===e.action?(this.filterSettings.columns=this.filterSettings.columns.concat(e.filterCollection),this.filterSettings.columns.length&&r&&r.classList.add("e-filtered")):(r&&r.classList.remove("e-filtered"),e.requestType="filtering",this.parent.renderModule.refresh(e)),this.parent.dataBind()},r.prototype.updateFilter=function(){var e=this.filterSettings.columns;this.actualPredicate={};for(var t=0;t<e.length;t++){this.column=this.parent.getColumnByField(e[t].field)||ae(e[t].field,this.parent.getForeignKeyColumns());var i=e[t].field;this.parent.getColumnByField(e[t].field)||(i=ae(e[t].field,this.parent.getForeignKeyColumns()).field),this.refreshFilterIcon(i,e[t].operator,e[t].value,e[t].type,e[t].predicate,e[t].matchCase,e[t].ignoreAccent,e[t].uid)}},r.prototype.refreshFilterIcon=function(e,t,i,r,n,o,s,l){var a;a={field:e,predicate:n,matchCase:o,ignoreAccent:s,operator:t,value:i,type:r},this.actualPredicate[e]?this.actualPredicate[e].push(a):this.actualPredicate[e]=[a];var h=l?this.parent.grabColumnByUidFromAllCols(l).field:e;this.addFilteredClass(h)},r.prototype.addFilteredClass=function(e){var t;this.parent.showColumnMenu?t=this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu"):this.parent.getColumnByField(e)&&(t=this.parent.getColumnHeaderByField(e).querySelector(".e-icon-filter")),t&&t.classList.add("e-filtered")},r.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},r.prototype.getOperatorName=function(e){return document.getElementById(this.parent.getColumnByField(e).uid).ej2_instances[0].value},r.prototype.renderCheckboxOnFilterMenu=function(){return this.filterModule.renderCheckBoxMenu()},r}(),xn={root:"e-rhandler",suppress:"e-rsuppress",icon:"e-ricon",helper:"e-rhelper",header:"th.e-headercell",cursor:"e-rcursor"},Rn=function(){function i(e){this.tapped=!1,this.isDblClk=!0,this.parent=e,this.parent.isDestroyed||(this.widthService=new rr(e),this.addEventListener())}return i.prototype.autoFitColumns=function(e){var t=void 0===e||null===e||e.length<=0?this.parent.getColumns().map(function(e){return e.field}):"string"==typeof e?[e]:e;this.findColumn(t)},i.prototype.autoFit=function(){var e=this.parent.getColumns().filter(function(e){return!0===e.autoFit}).map(function(e){return e.field||e.headerText});e.length>0&&this.autoFitColumns(e),"Auto"===this.parent.resizeSettings.mode&&this.widthService.setWidthToTable()},i.prototype.resizeColumn=function(e,i,r){var n,o,s,l,a,h,d=this.parent,p=0,c=0,u=r||this.parent.getUidByColumnField(e),g=this.parent.getNormalizedColumnIndex(u),f=this.parent.getColumnIndexByField(e),m=d.getFrozenColumns()||d.getFrozenLeftColumnsCount(),y=d.getMovableColumnsCount();if(t.isNullOrUndefined(d.getFooterContent())||(s=d.getFooterContentTable()),d.isFrozenGrid()){var v=d.getColumnByField(e);"frozen-left"===v.getFreezeTableName()?(n=d.getHeaderTable(),o=d.getContentTable(),l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g+1)+")"),s&&(h=s.querySelectorAll("td:nth-child("+(g+1)+")"))):"movable"===v.getFreezeTableName()?(n=d.getHeaderContent().querySelector(".e-movableheader").children[0],o=d.getContent().querySelector(".e-movablecontent").children[0],l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g-m+1)+")"),s&&(h=(s=d.getFooterContent().querySelector(".e-movablefootercontent").children[0]).querySelectorAll("td:nth-child("+(g-m+1)+")"))):"frozen-right"===v.getFreezeTableName()&&(n=d.getHeaderContent().querySelector(".e-frozen-right-header").children[0],o=d.getContent().querySelector(".e-frozen-right-content").children[0],l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g-(m+y)+1)+")"),s&&(h=(s=d.getFooterContent().querySelector(".e-movablefootercontent").children[0]).querySelectorAll("td:nth-child("+(g-(m+y)+1)+")")))}else n=d.getHeaderTable(),o=d.getContentTable(),l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g+1)+"):not(.e-groupcaption)"),s&&(h=s.querySelectorAll("td:nth-child("+(g+1)+"):not(.e-groupcaption)"));var C=n.querySelector("tr").querySelectorAll(".e-grouptopleftcell");if(C.length>0)for(D=0;D<C.length;D++)c+=C[D].offsetWidth;var w=o.querySelector(".e-detailrowcollapse")||o.querySelector(".e-detailrowexpand");(this.parent.detailTemplate||this.parent.childGrid)&&w&&(c+=w.offsetWidth);var b=[l],S=[],x=[];if(s)for(D=0;D<h.length;D++)x[D]=h[D].cloneNode(!0);for(D=0;D<a.length;D++)S[D]=a[D].cloneNode(!0);var R=this.createTable(n,b,"e-gridheader"),F=this.createTable(o,S,"e-gridcontent"),z=null;x.length&&(z=this.createTable(s,x,"e-gridfooter"));var I=d.getColumns()[f],T=I.width=t.formatUnit(Math.max(R,F,z)),E=I.maxWidth&&parseFloat(I.maxWidth.toString());if(parseInt(T,10)>E&&(I.width=E),this.widthService.setColumnWidth(d.getColumns()[f]),!1===d.getColumns().some(function(e){return null===e.width||void 0===e.width||e.width.length<=0}))for(var M=d.getColumns(),D=0;D<M.length;D++)M[D].visible&&(p+=parseFloat(M[D].width));var O=p+c;p>0&&!d.isFrozenGrid()&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new ft({width:"30px"})),"Auto"===this.parent.resizeSettings.mode&&(O="100%"),n.style.width=t.formatUnit(O),o.style.width=t.formatUnit(O),t.isNullOrUndefined(s)||(s.style.width=t.formatUnit(O)));var A=n.offsetWidth;d.getContent().scrollWidth>A?(n.classList.add("e-tableborder"),o.classList.add("e-tableborder")):(n.classList.remove("e-tableborder"),o.classList.remove("e-tableborder")),t.isNullOrUndefined(s)||s.classList.add("e-tableborder")},i.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},i.prototype.getModuleName=function(){return"resize"},i.prototype.findColumn=function(e){for(var i=0;i<e.length;i++){var r=e[i],n=this.parent.getColumnIndexByField(r),o=this.parent.getColumns()[n];n>-1&&!t.isNullOrUndefined(o)&&!0===o.visible&&this.resizeColumn(r,n)}},i.prototype.createTable=function(e,t,i){var r=this.parent.createElement("div");r.className=this.parent.element.className,r.style.cssText="display: inline-block;visibility:hidden;position:absolute";var n=this.parent.createElement("div");n.className=i;var o=this.parent.createElement("table");o.className=e.className,o.classList.add("e-resizetable"),o.style.cssText="table-layout: auto;width: auto";for(var s=this.parent.createElement("tr"),l=0;l<t.length;l++){var a=s.cloneNode();a.className=e.querySelector("tr").className,a.appendChild(t[l]),o.appendChild(a)}n.appendChild(o),r.appendChild(n),document.body.appendChild(r);var h=o.getBoundingClientRect().width;return document.body.removeChild(r),Math.ceil(h)},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Lt,this.refreshHeight,this),this.parent.on(Tt,this.wireEvents,this),this.parent.on(Mt,this.autoFit,this),this.parent.on(pi,this.refreshHeight,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Lt,this.refreshHeight),this.parent.off(Tt,this.wireEvents),this.parent.off(pi,this.refreshHeight))},i.prototype.render=function(){this.unwireEvents(),this.wireEvents(),this.setHandlerHeight()},i.prototype.refreshHeight=function(){for(var e=this.getResizeHandlers(),t=0;t<e.length;t++)e[t].parentElement.offsetHeight>0&&(e[t].style.height=e[t].parentElement.offsetHeight+"px");this.setHandlerHeight()},i.prototype.wireEvents=function(){t.EventHandler.add(this.parent.getHeaderContent(),t.Browser.touchStartEvent,this.touchResizeStart,this),t.EventHandler.add(this.parent.getHeaderContent(),"dblclick",this.callAutoFit,this)},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.parent.getHeaderContent(),t.Browser.touchStartEvent,this.touchResizeStart),t.EventHandler.remove(this.parent.getHeaderContent(),"dblclick",this.callAutoFit)},i.prototype.getResizeHandlers=function(){return this.parent.isFrozenGrid()?[].slice.call(this.parent.getHeaderContent().querySelectorAll("."+xn.root)):[].slice.call(this.parent.getHeaderTable().querySelectorAll("."+xn.root))},i.prototype.setHandlerHeight=function(){for(var e=[].slice.call(this.parent.getHeaderTable().querySelectorAll("."+xn.suppress)),t=0;t<e.length;t++)e[t].style.height=e[t].parentElement.offsetHeight+"px"},i.prototype.callAutoFit=function(e){if(e.target.classList.contains("e-rhandler")){var i=this.getTargetColumn(e);if(i.columns)return;this.resizeColumn(i.field,this.parent.getNormalizedColumnIndex(i.uid),i.uid),t.closest(e.target,xn.header).classList.add("e-resized")}},i.prototype.touchResizeStart=function(t){if(!e.Global.timer)return e.Global.timer=setTimeout(function(){e.Global.timer=null},300),this.resizeStart(t);clearTimeout(e.Global.timer),e.Global.timer=null,this.callAutoFit(t)},i.prototype.resizeStart=function(e){var i=this;if(e.target.classList.contains("e-rhandler")){if(!this.helper){if(0===this.getScrollBarWidth()){if(this.parent.allowGrouping)for(u=0;u<this.parent.groupSettings.columns.length;u++)this.widthService.setColumnWidth(new ft({width:"30px"}),u);for(var r=0,n=this.refreshColumnWidth();r<n.length;r++){var o=n[r];this.widthService.setColumnWidth(o)}this.widthService.setWidthToTable()}if(this.refreshStackedColumnWidth(),this.element=e.target,this.parent.getVisibleFrozenColumns()){var s=this.parent.getMovableContentTbody(),l=this.parent.getFrozenLeftContentTbody(),a=this.parent.getFrozenRightContentTbody(),h=[].slice.call(s.querySelectorAll("tr")),d=[].slice.call(l.querySelectorAll("tr")),p=[];"Left-Right"===this.parent.getFrozenMode()&&a&&(p=[].slice.call(a.querySelectorAll("tr")));for(var c=this,u=0;u<h.length;u++)!function(e){Le(c.parent,function(t,r){i.parent.rowHeight?r[e].style.height=i.parent.rowHeight+"px":r[e].style.removeProperty("height")},[d,h,p])}(u)}this.parentElementWidth=this.parent.element.getBoundingClientRect().width,this.appendHelper(),this.column=this.getTargetColumn(e),this.pageX=this.getPointX(e),"frozen-right"===this.column.getFreezeTableName()?this.parent.enableRtl?this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(t.isNullOrUndefined(this.column.width)?"":this.column.width.toString()):this.minMove=parseFloat(t.isNullOrUndefined(this.column.width)?"":this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.parent.enableRtl?this.minMove=parseFloat(this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(t.isNullOrUndefined(this.column.width)?"":this.column.width.toString()),this.minMove+=this.pageX}if(t.Browser.isDevice&&!this.helper.classList.contains(xn.icon))this.helper.classList.add(xn.icon),t.EventHandler.add(document,t.Browser.touchStartEvent,this.removeHelper,this),t.EventHandler.add(this.helper,t.Browser.touchStartEvent,this.resizeStart,this);else{var g=void 0;g=!t.isBlazor()||this.parent.isJsComponent?{e:e,column:this.column}:{column:t.extend({},this.column)},this.parent.trigger("resizeStart",g,function(e){if(e.cancel||i.parent.isEdit)return void i.cancelResizeAction();t.EventHandler.add(document,t.Browser.touchEndEvent,i.resizeEnd,i),t.EventHandler.add(i.parent.element,t.Browser.touchMoveEvent,i.resizing,i),i.updateCursor("add")})}}},i.prototype.cancelResizeAction=function(e){e&&(t.EventHandler.remove(this.parent.element,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove")),t.Browser.isDevice&&(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart)),t.detach(this.helper),this.refresh()},i.prototype.getWidth=function(e,t,i){return t&&e<t?t:i&&e>i?i:e},i.prototype.updateResizeEleHeight=function(){for(var e=[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-rhandler")),t=0;t<e.length;t++)e[t].style.height=this.element.parentElement.offsetHeight+"px"},i.prototype.getColData=function(e,i){return{width:parseFloat(t.isNullOrUndefined(this.widthService.getWidth(e))||"auto"===this.widthService.getWidth(e)?"0":this.widthService.getWidth(e).toString())+i,minWidth:e.minWidth?parseFloat(e.minWidth.toString()):null,maxWidth:e.maxWidth?parseFloat(e.maxWidth.toString()):null}},i.prototype.resizing=function(e){if(!t.isNullOrUndefined(this.column)){var i=0;t.isNullOrUndefined(this.column)&&(i=O(this.element,"th").offsetWidth),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.setHelperHeight());var r=this.getPointX(e),n=this.parent.enableRtl?-(r-this.pageX):r-this.pageX;"frozen-right"===this.column.getFreezeTableName()&&(n=this.parent.enableRtl?r-this.pageX:this.pageX-r);var o=this.getColData(this.column,n);o.width||(o.width=t.closest(this.element,"th").offsetWidth);var s=this.getWidth(o.width,o.minWidth,o.maxWidth);if(this.parent.log("resize_min_max",{column:this.column,width:s}),"frozen-right"===this.column.getFreezeTableName()&&(this.parent.enableRtl&&this.minMove>=r||!this.parent.enableRtl&&this.minMove<=r)&&(s=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=r=this.minMove),("frozen-right"!==this.column.getFreezeTableName()&&(!this.parent.enableRtl&&this.minMove>=r||this.parent.enableRtl&&this.minMove<=r)||"frozen-right"===this.column.getFreezeTableName()&&(this.parent.enableRtl&&this.minMove>=r||!this.parent.enableRtl&&this.minMove<=r))&&(s=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=r=this.minMove),s!==parseFloat(t.isNullOrUndefined(this.column.width)||"auto"===this.column.width?i.toString():this.column.width.toString())){this.pageX=r,this.column.width=t.formatUnit(s);var l={e:e,column:this.column};if(this.parent.trigger("resizing",l),l.cancel)return void this.cancelResizeAction(!0);var a=[this.column],h=[this.column];this.column.columns&&(a=this.getSubColumns(this.column,[]),a=this.calulateColumnsWidth(a,!1,n),h=this.calulateColumnsWidth(a,!0,n));for(var d=0,p=h;d<p.length;d++){var c=p[d];this.widthService.setColumnWidth(c,null,"resize")}this.updateHelper()}this.isDblClk=!1}},i.prototype.calulateColumnsWidth=function(e,i,r){for(var n=[],o=0,s=e;o<s.length;o++){for(var l=s[o],a=0,h=0;h<e.length;h++)a+=parseFloat(e[h].width.toString());var d=this.getColData(l,parseFloat(l.width)*r/a),p=this.getWidth(d.width,d.minWidth,d.maxWidth);p!==parseFloat(l.width.toString())&&(i&&(l.width=t.formatUnit(p<1?1:p)),n.push(l))}return n},i.prototype.getSubColumns=function(e,t){for(var i=0,r=e.columns;i<r.length;i++){var n=r[i];!1!==n.visible&&n.allowResizing&&(n.columns?this.getSubColumns(n,t):t.push(n))}return t},i.prototype.resizeEnd=function(e){if(this.helper&&!this.parent.isDestroyed){t.EventHandler.remove(this.parent.element,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove"),t.detach(this.helper);var i;i=!t.isBlazor()||this.parent.isJsComponent?{e:e,column:this.column}:{column:t.extend({},this.column)};var r=this.parent.getContent().querySelector(".e-content"),n=r.querySelector(".e-movablecontent")?r.querySelector(".e-movablecontent"):r;n.scrollHeight>n.clientHeight&&(this.parent.scrollModule.setPadding(),n.style.overflowY="scroll"),this.parent.trigger("resizeStop",i),t.closest(this.element,".e-headercell").classList.add("e-resized"),O(this.element,"e-frozenheader")?this.isFrozenColResized=!0:this.isFrozenColResized=!1,this.parent.isFrozenGrid()&&this.parent.notify(ii,{case:"textwrap"}),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.parent.notify("textWrapRefresh",{case:"textwrap"})),this.refresh(),this.doubleTapEvent(e),this.isDblClk=!0}},i.prototype.getPointX=function(e){return e.touches&&e.touches.length?e.touches[0].pageX:e.pageX},i.prototype.refreshColumnWidth=function(){for(var e=this.parent.getColumns(),t=0,i=[].slice.apply(this.parent.getHeaderContent().querySelectorAll("th.e-headercell"));t<i.length;t++)for(var r=i[t],n=0,o=e;n<o.length;n++){var s=o[n];if(r.querySelector("[e-mappinguid]")&&r.querySelector("[e-mappinguid]").getAttribute("e-mappinguid")===s.uid&&s.visible){s.width=r.getBoundingClientRect().width;break}}return e},i.prototype.refreshStackedColumnWidth=function(){for(var e=0,t=this.parent.getStackedColumns(this.parent.columns);e<t.length;e++){var i=t[e];i.width=this.getStackedWidth(i,0)}},i.prototype.getStackedWidth=function(e,t){for(var i=0,r=e.columns;i<r.length;i++){var n=r[i];!1!==n.visible&&(n.columns?this.getStackedWidth(n,t):t+=n.width)}return t},i.prototype.getTargetColumn=function(e){var i=t.closest(e.target,xn.header),r=(i=i.querySelector(".e-headercelldiv")||i.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid");return this.parent.getColumnByUid(r)},i.prototype.updateCursor=function(e){var t=[].slice.call(this.parent.getHeaderContent().querySelectorAll("th"));t.push(this.parent.element);for(var i=0,r=t;i<r.length;i++)r[i].classList[e](xn.cursor)},i.prototype.refresh=function(){this.column=null,this.pageX=null,this.element=null,this.helper=null},i.prototype.appendHelper=function(){this.helper=this.parent.createElement("div",{className:xn.helper}),this.parent.element.appendChild(this.helper),this.setHelperHeight()},i.prototype.setHelperHeight=function(){var e=this.parent.isFrozenGrid(),i=e?this.parent.getContent().querySelector(".e-content").offsetHeight:this.parent.getContent().offsetHeight-this.getScrollBarWidth(),r=t.closest(this.element,xn.header),n=[].slice.call(this.parent.getHeaderContent().querySelectorAll("tr")),o=this.parent.getFrozenRightColumnsCount();e&&(n=O(r,"e-movableheader")?[].slice.call(this.parent.getHeaderContent().querySelector(".e-movableheader").querySelectorAll("tr")):o&&O(r,"e-frozen-right-header")?[].slice.call(this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelectorAll("tr")):[].slice.call(this.parent.getHeaderContent().querySelector(".e-frozen-left-header").querySelectorAll("tr")));for(var s=n.indexOf(r.parentElement);s<n.length&&s>-1;s++)i+=n[s].offsetHeight;var l=this.calcPos(r);O(r,"e-frozen-right-header")?l.left+=this.parent.enableRtl?r.offsetWidth-2:-1:l.left+=this.parent.enableRtl?-1:r.offsetWidth-2,this.helper.style.cssText="height: "+i+"px; top: "+l.top+"px; left:"+Math.floor(l.left)+"px;",this.parent.enableVirtualization&&this.helper.classList.add("e-virtual-rhandler")},i.prototype.getScrollBarWidth=function(e){var t=this.parent.getContent().firstChild;return t.scrollHeight>t.clientHeight&&e||t.scrollWidth>t.clientWidth?j():0},i.prototype.removeHelper=function(e){var i=e.target.classList;i.contains(xn.root)||i.contains(xn.icon)||!this.helper||(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart),t.detach(this.helper),this.refresh())},i.prototype.updateHelper=function(){var e,i=t.closest(this.element,xn.header);if((e=O(i,"e-frozen-right-header")?Math.floor(this.calcPos(i).left+(this.parent.enableRtl?i.offsetWidth-2:-1)):Math.floor(this.calcPos(i).left+(this.parent.enableRtl?-1:i.offsetWidth-2)))>this.parentElementWidth&&(e=this.parentElementWidth-2),this.parent.isFrozenGrid()){var r=t.closest(i,".e-table").offsetLeft;e<r&&(e=r)}this.helper.style.left=e+"px"},i.prototype.calcPos=function(e){for(var t={top:0,left:0},i=e.getBoundingClientRect(),r=e.ownerDocument,n=O(e,"e-grid")||r.documentElement;n&&(n===r.body||n===r.documentElement)&&"static"===n.style.position;)n=n.parentNode;return n&&n!==e&&1===n.nodeType&&(t=n.getBoundingClientRect()),{top:i.top-t.top,left:i.left-t.left}},i.prototype.doubleTapEvent=function(e){var t=this;this.getUserAgent()&&this.isDblClk&&(this.tapped?(clearTimeout(this.tapped),this.callAutoFit(e),this.tapped=null):this.tapped=setTimeout(function(){t.tapped=null},300))},i.prototype.getUserAgent=function(){var e=t.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},i.prototype.timeoutHandler=function(){this.tapped=null},i}(),Fn=function(){function e(e){this.parent=e,this.parent.isDestroyed||(this.parent.on(Kt,this.headerDrop,this),this.parent.on(Dt,this.enableAfterRender,this),this.parent.on(Pt,this.onActionComplete,this),this.parent.on(bt,this.drag,this),this.parent.on(wt,this.dragStart,this),this.parent.on(Wt,this.dragStop,this),this.parent.on(Kt,this.headerDrop,this),this.parent.on(Lt,this.createReorderElement,this),this.parent.on(qt,this.keyPressHandler,this))}return e.prototype.chkDropPosition=function(e,i){var r=this.parent.getColumnByUid(i.firstElementChild.getAttribute("e-mappinguid")),n=!r||!r.lockColumn;return(e.parentElement.isEqualNode(i.parentElement)||this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()&&Array.prototype.indexOf.call(t.closest(e,"thead").children,e.parentElement)===Array.prototype.indexOf.call(t.closest(i,"thead").children,i.parentElement))&&this.targetParentContainerIndex(e,i)>-1&&n},e.prototype.chkDropAllCols=function(e,t){this.parent.columns;for(var i,r=this.getHeaderCells();!i&&r.length>0;)i=e!==r.pop()&&this.targetParentContainerIndex(e,t)>-1;return i},e.prototype.findColParent=function(e,t,i){i=i;for(var r=0,n=t.length;r<n;r++){if(e===t[r])return!0;if(t[r].columns){var o=i.length;if(i.push(t[r]),this.findColParent(e,t[r].columns,i))return!0;i.splice(o,i.length-o)}}return!1},e.prototype.getColumnsModel=function(e){var t=[],i=[];if(!this.parent.getFrozenColumns()&&this.parent.isFrozenGrid())return this.parent.getColumns();for(var r=0,n=e.length;r<n;r++)t.push(e[r]),e[r].columns&&(i=i.concat(e[r].columns));return i.length&&(t=t.concat(this.getColumnsModel(i))),t},e.prototype.headerDrop=function(e){var i=this.parent,r=(this.element.querySelector(".e-headercelldiv")||this.element.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid"),n=i.getColumnByUid(r);if(!t.closest(e.target,"th")||!t.isNullOrUndefined(n)&&(!n.allowReordering||n.lockColumn))return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n});var o=t.closest(e.target,".e-headercell"),s=(o.querySelector(".e-headercelldiv")||o.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid");if(!t.isNullOrUndefined(s)){var l=i.getColumnByUid(s);if(t.isNullOrUndefined(l)||!l.allowReordering||l.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n,destColumn:l})}if(o&&this.chkDropPosition(this.element,o)&&this.chkDropAllCols(this.element,o))if(this.parent.enableColumnVirtualization){var a=this.parent.columns,h=this.element.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"),d=null,p=this.parent.columns.filter(function(e){return e.uid===h})[0],c=o.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");a.some(function(e,t){return e.uid===c&&(d=t,e.uid===c)});t.isNullOrUndefined(d)||this.moveColumns(d,p)}else{var u=this.targetParentContainerIndex(this.element,o),g=this.element.firstElementChild.getAttribute("e-mappinguid");if(this.destElement=o,this.parent.notify("set-reorder-destination-element",{ele:o}),g)this.moveColumns(u,this.parent.getColumnByUid(g));else{var f=this.getHeaderCells(),m=A(this.element,f),y=(a=this.getColumnsModel(this.parent.columns))[m];this.moveColumns(u,y)}}},e.prototype.isActionPrevent=function(e){return J(e)},e.prototype.moveColumns=function(e,t,i,r){var n=this.parent;if(this.isActionPrevent(n))return void n.notify(Zt,{instance:this,handler:this.moveColumns,arg1:e,arg2:t});var o=!n.getFrozenColumns()&&n.isFrozenGrid(),s=this.getColParent(t,this.parent.columns),l=s?s.columns:o?this.parent.getColumns():this.parent.columns,a=B(t,l);if((this.parent.isFrozenGrid()&&s||this.parent.lockcolPositionCount)&&!i){for(d=0;d<l.length;d++)if(l[d].field===t.field){a=d;break}var h=this.parent.getColumnByUid(this.destElement.firstElementChild.getAttribute("e-mappinguid"));if(h){for(d=0;d<l.length;d++)if(l[d].field===h.field){e=d;break}}else for(var d=0;d<l.length;d++)l[d].headerText===this.destElement.innerText.trim()&&(e=d)}if(n.allowReordering&&a!==e&&-1!==a&&-1!==e){l.splice(e,0,l.splice(a,1)[0]);var p={column:t,destIndex:e,columns:l,parent:s,cancel:!1};n.notify("refresh-frozen-columns",p),p.cancel||(n.getColumns(!0),n.notify(Vt,{fromIndex:e,toIndex:a}),!1!==r&&n.notify(Bt,{type:yt,requestType:"reorder",fromIndex:e,toIndex:a,toColumnUid:t.uid}))}},e.prototype.targetParentContainerIndex=function(e,t){var i=!this.parent.getFrozenColumns()&&this.parent.isFrozenGrid()?this.parent.getColumns():this.parent.columns,r=this.getHeaderCells(),n=this.getColumnsModel(i),o=this.getColParent(n[A(e,r)],i);return i=o?o.columns:i,B(n[A(t,r)],i)},e.prototype.getHeaderCells=function(){var e=this.parent.getFrozenColumns();if(e||this.parent.lockcolPositionCount){var t=void 0,i=void 0,r=[],n=[].slice.call(this.parent.getHeaderTable().querySelectorAll(".e-columnheader"));if(e)for(var o=[].slice.call(this.parent.getHeaderContent().querySelector(".e-movableheader").querySelectorAll(".e-columnheader")),s=0;s<n.length;s++){t=[].slice.call(n[s].getElementsByClassName("e-headercell")),i=[].slice.call(o[s].getElementsByClassName("e-headercell"));for(var l=void 0,a=0;a<t.length;a++){for(h=0;h<i.length;h++)if(i[h].innerText===t[a].innerText){l=!0;break}l||(r=r.concat([t[a]]))}for(h=0;h<i.length;h++)r.push(i[h])}else for(s=0;s<n.length;s++){i=[].slice.call(n[s].getElementsByClassName("e-headercell"));for(a=0;a<i.length;a++){for(var l=void 0,h=a+1;h<i.length;h++)if(i[h].innerText===i[a].innerText){l=!0;break}l||(r=r.concat([i[a]]))}}return r}return[].slice.call(this.parent.element.getElementsByClassName("e-headercell"))},e.prototype.getColParent=function(e,t){var i=[];return this.findColParent(e,t,i),i[i.length-1]},e.prototype.reorderSingleColumn=function(e,i){var r=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:this.parent.getColumnByField(e),n=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===i})[0]:this.parent.getColumnByField(i);if(!t.isNullOrUndefined(r)&&(!r.allowReordering||r.lockColumn)||!t.isNullOrUndefined(n)&&(!n.allowReordering||r.lockColumn))return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:r,destColumn:n});var o=n,s=this.getColParent(o,this.parent.columns),l=B(o,s?s.columns:this.parent.columns);l>-1&&this.moveColumns(l,r,!0)},e.prototype.reorderMultipleColumns=function(e,i){var r=this.parent.getColumnIndexByField(i),n=this.parent.getColumnByField(i);if(!(r<0)&&(t.isNullOrUndefined(n)||n.allowReordering&&!n.lockColumn)){for(o=0;o<e.length;o++){s=this.parent.getColumnByField(e[o]);if(!t.isNullOrUndefined(s)&&(!s.allowReordering||s.lockColumn))return}for(var o=0;o<e.length;o++){var s=this.parent.getColumnByIndex(r),l=this.getColParent(s,this.parent.columns),a=B(s,l?l.columns:this.parent.columns);a>-1&&this.moveColumns(a,this.parent.getColumnByField(e[o]),!0,!(t.isBlazor()&&!this.parent.isJsComponent)),this.parent.getColumnIndexByField(e[o+1])>=a&&r++}if(t.isBlazor()&&!this.parent.isJsComponent){var h=this.parent.getColumns();this.parent.notify(Bt,{fromColumnUid:e.map(function(e){return h.filter(function(t){return t.field===e})[0].uid}),toColumnUid:n.uid,isMultipleReorder:!0,requestType:"reorder",type:"actionBegin"})}}},e.prototype.moveTargetColumn=function(e,t){t>-1&&this.moveColumns(t,e,!0)},e.prototype.reorderSingleColumnByTarget=function(e,t){var i=this.parent.getColumnByField(e);this.moveTargetColumn(i,t)},e.prototype.reorderMultipleColumnByTarget=function(e,t){for(var i=0;i<e.length;i++)this.reorderSingleColumnByTarget(e[i],t)},e.prototype.reorderColumns=function(e,t){"string"==typeof e?(this.reorderSingleColumn(e,t),this.fromCol=e):(this.reorderMultipleColumns(e,t),this.fromCol=e[0])},e.prototype.reorderColumnByIndex=function(e,t){var i=this.parent.getColumnByIndex(e);this.moveTargetColumn(i,t)},e.prototype.reorderColumnByTargetIndex=function(e,t){"string"==typeof e?this.reorderSingleColumnByTarget(e,t):this.reorderMultipleColumnByTarget(e,t)},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.createReorderElement()},e.prototype.createReorderElement=function(e){e&&e.args.isXaxis&&this.setDisplay("none");var t=this.parent.element.querySelector(".e-headercontent");this.upArrow=t.appendChild(this.parent.createElement("div",{className:"e-icons e-icon-reorderuparrow e-reorderuparrow",attrs:{style:"display:none"}})),this.downArrow=t.appendChild(this.parent.createElement("div",{className:"e-icons e-icon-reorderdownarrow e-reorderdownarrow",attrs:{style:"display:none"}}))},e.prototype.onActionComplete=function(e){t.isBlazor()&&!this.parent.isJsComponent&&(e.rows=null),this.parent.trigger(vt,t.extend(e,{type:vt}));var i=this.fromCol&&this.parent.getColumnHeaderByField(this.fromCol);i&&this.parent.focusModule.onClick({target:i},!0)},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(t.remove(this.upArrow),t.remove(this.downArrow),this.parent.off(Kt,this.headerDrop),this.parent.off(Dt,this.enableAfterRender),this.parent.off(Pt,this.onActionComplete),this.parent.off(bt,this.drag),this.parent.off(wt,this.dragStart),this.parent.off(Wt,this.dragStop),this.parent.off(Lt,this.createReorderElement),this.parent.off(qt,this.keyPressHandler))},e.prototype.keyPressHandler=function(e){var t=this.parent;switch(e.action){case"ctrlLeftArrow":case"ctrlRightArrow":var i=t.focusModule.currentInfo.element;if(i&&i.classList.contains("e-headercell")){var r=t.getColumnByUid(i.firstElementChild.getAttribute("e-mappinguid")),n=t.getVisibleColumns(),o=n.indexOf(r),s="ctrlLeftArrow"===e.action?n[o-1]:n[o+1];s&&s.field&&r.field&&this.reorderColumns(r.field,s.field)}}},e.prototype.drag=function(e){var i=this.parent,r=e.target;if(e.column.allowReordering&&!e.column.lockColumn){var n=t.closest(r,".e-headercell:not(.e-stackedHeaderCell)"),o=i.element.querySelector(".e-cloneproperties"),s=i.isFrozenGrid()?i.getMovableVirtualContent():i.getContent().firstElementChild,l=this.x>P(e.event).x+s.scrollLeft;t.removeClass(i.getHeaderTable().querySelectorAll(".e-reorderindicate"),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),t.classList(o,["e-defaultcur"],["e-notallowedcur"]),this.updateScrollPostion(e.event),n&&!n.isEqualNode(this.element)&&(r=n,this.chkDropPosition(this.element,r)&&this.chkDropAllCols(this.element,r)?(this.updateArrowPosition(r,l),t.classList(r,["e-allowDrop","e-reorderindicate"],[])):i.allowGrouping&&O(e.target,"e-groupdroparea")||t.classList(o,["e-notallowedcur"],["e-defaultcur"])),i.trigger(bt,{target:r,draggableType:"headercell",column:e.column})}},e.prototype.updateScrollPostion=function(e){var t=this,i=P(e).x,r=this.parent.element.getBoundingClientRect(),n=r.right;if(this.parent.isFrozenGrid())this.updateFrozenScrollPosition(i,r);else{var o=r.left,s=this.parent.getContent().firstElementChild;i>o&&i<o+35?this.timer=window.setInterval(function(){t.setScrollLeft(s,!0)},50):i<n&&i>n-35&&(this.timer=window.setInterval(function(){t.setScrollLeft(s,!1)},50))}},e.prototype.updateFrozenScrollPosition=function(e,t){var i=this,r=this.parent.getContent().querySelector(".e-movablecontent"),n=this.parent.element.querySelector(".e-movableheader").getBoundingClientRect(),o=this.parent.getFrozenLeftCount(),s=this.parent.getFrozenRightColumnsCount()?n.right:t.right,l=o?n.left:t.left;e>l&&e<l+35?this.timer=window.setInterval(function(){i.setScrollLeft(r,!0)},50):e<s&&e>s-35&&(this.timer=window.setInterval(function(){i.setScrollLeft(r,!1)},50))},e.prototype.setScrollLeft=function(e,t){var i=e.scrollLeft;e.scrollLeft=e.scrollLeft+(t?-5:5),i!==e.scrollLeft&&this.setDisplay("none")},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.updateArrowPosition=function(e,t){var i=e.getBoundingClientRect(),r=this.parent.element.getBoundingClientRect();if(!(t&&i.left<r.left||!t&&i.right>r.right)){if(this.parent.isFrozenGrid()&&e.classList.contains("e-headercell")){var n=this.parent.getFrozenLeftCount(),o=this.parent.getFrozenRightColumnsCount(),s=this.element.querySelector(".e-headercelldiv"),l=s?this.parent.getColumnByUid(s.getAttribute("data-uid")):null,a=this.parent.getColumnByUid(e.firstElementChild.getAttribute("e-mappinguid")),h=Math.round(this.parent.getFrozenVirtualHeader().getBoundingClientRect().right),d=Math.round(this.parent.getMovableVirtualHeader().getBoundingClientRect().right);if(a){if(n&&!o&&this.parent.getNormalizedColumnIndex(a.uid)>=n&&(t&&Math.round(i.left)<h||!t&&d<i.right))return;if(!n&&o&&l&&l.getFreezeTableName()!==a.getFreezeTableName()&&!t&&Math.round(i.right)<h)return}}this.upArrow.style.top=i.top+i.height-r.top+"px",this.downArrow.style.top=i.top-r.top-7+"px",this.upArrow.style.left=this.downArrow.style.left=(t?i.left:i.right)-r.left-4+"px",this.setDisplay("")}},e.prototype.dragStart=function(e){var t=this.parent,i=e.target;if(this.element=i.classList.contains("e-headercell")?i:O(i,"e-headercell"),e.column.allowReordering&&!e.column.lockColumn){var r=t.isFrozenGrid()?t.getMovableVirtualContent():t.getContent().firstElementChild;this.x=P(e.event).x+r.scrollLeft,t.trigger(wt,{target:i,draggableType:"headercell",column:e.column})}},e.prototype.dragStop=function(e){var i=this.parent;this.setDisplay("none"),this.stopTimer(),e.cancel||i.trigger(St,{target:e.target,draggableType:"headercell",column:e.column}),t.removeClass(i.getHeaderTable().querySelectorAll(".e-reorderindicate"),["e-reorderindicate"])},e.prototype.setDisplay=function(e){this.upArrow.style.display=e,this.downArrow.style.display=e},e.prototype.getModuleName=function(){return"reorder"},e}(),zn=function(){function e(e){var r=this;this.selectedRows=[],this.isOverflowBorder=!0,this.selectedRowColls=[],this.isRefresh=!0,this.isReplaceDragEle=!0,this.istargetGrid=!1,this.helper=function(e){var i=r.parent,n=r.draggable.currentStateTarget,o=r.parent.createElement("div",{className:"e-cloneproperties e-draganddrop e-grid e-dragclone",styles:'height:"auto", z-index:2, width:'+i.element.offsetWidth}),s=r.parent.createElement("table",{styles:"width:"+i.element.offsetWidth}),l=r.parent.createElement("tbody");if(document.getElementsByClassName("e-griddragarea").length||i.rowDropSettings.targetID&&!n.classList.contains("e-selectionbackground")&&"Single"!==i.selectionSettings.type||!i.rowDropSettings.targetID&&!O(n,"e-rowdragdrop"))return!1;i.rowDropSettings.targetID&&"Row"===i.selectionSettings.mode&&"Single"===i.selectionSettings.type&&i.selectRow(parseInt(r.draggable.currentStateTarget.parentElement.getAttribute("aria-rowindex"),10)),r.startedRow=t.closest(n,"tr").cloneNode(!0);var a=r.parent.isFrozenGrid();if(a){var h=parseInt(t.closest(n,"tr").getAttribute("aria-rowindex"),10);r.startedRow.innerHTML="",r.startedRow.innerHTML+=i.getRowByIndex(h).innerHTML,r.startedRow.innerHTML+=i.getMovableRowByIndex(h).innerHTML,"Left-Right"===i.getFrozenMode()&&(r.startedRow.innerHTML+=i.getFrozenRightRowByIndex(h).innerHTML)}r.processArgs(n);var d={selectedRow:r.rows,dragelement:n,cloneElement:o,cancel:!1,data:r.rowData},p=i.getSelectedRows();i.trigger(xt,d);if(d.cancel)return!1;L(r.startedRow,".e-indentcell"),L(r.startedRow,".e-detailrowcollapse"),L(r.startedRow,".e-detailrowexpand"),r.removeCell(r.startedRow,"e-gridchkbox");var c=new RegExp("e-active","g");if(r.startedRow.innerHTML=r.startedRow.innerHTML.replace(c,""),l.appendChild(r.startedRow),i.getSelectedRowIndexes().length>1&&r.startedRow.hasAttribute("aria-selected")){var u="Left-Right"===i.getFrozenMode()?3:2,g=r.parent.createElement("span",{className:"e-dropitemscount",innerHTML:a?""+p.length/u:""+p.length});o.appendChild(g)}var f=t.closest(n,"tr").querySelector(".e-icon-rowdragicon");return f&&f.classList.add("e-dragstartrow"),s.appendChild(l),o.appendChild(s),i.element.appendChild(o),o},this.dragStart=function(e){var i=r.parent;if(!document.getElementsByClassName("e-griddragarea").length){var n=e.target,o=r.parent.element.querySelector(".e-dropitemscount");r.parent.getSelectedRecords().length>1&&o&&(o.style.left=r.parent.element.querySelector(".e-cloneproperties table").offsetWidth-5+"px"),r.processArgs(n),i.trigger(Rt,{rows:t.isBlazor()?null:r.rows,target:t.isBlazor()?null:e.target,draggableType:"rows",fromIndex:parseInt(r.rows[0].getAttribute("aria-rowindex"),10),data:Object.keys(r.rowData[0]).length>0?r.rowData:r.currentViewData()}),t.isBlazor()&&e.bindEvents(e.dragElement),r.dragStartData=r.rowData;var s=document.getElementById(i.rowDropSettings.targetID);i.rowDropSettings.targetID&&s&&s.ej2_instances&&"grid"===s.ej2_instances[0].getModuleName()&&s.ej2_instances[0].getContent().classList.add("e-allowRowDrop")}},this.drag=function(e){var i=r.parent;if(r.isDropGrid=r.parent,r.istargetGrid=!1,r.parent.rowDropSettings.targetID){var n=document.getElementById(i.rowDropSettings.targetID);r.isDropGrid=n.ej2_instances[0],O(e.target,"e-grid")&&(r.istargetGrid=r.parent.rowDropSettings.targetID===O(e.target,"e-grid").id)}var o=r.parent.element.querySelector(".e-cloneproperties"),s=r.getElementFromPosition(o,e.event);t.classList(o,["e-defaultcur"],["e-notallowedcur","e-movecur"]),r.isOverflowBorder=!0,r.hoverState=i.enableHover;var l=O(s,"e-grid")?t.closest(e.target,"tr"):null;if(i.enableHover=!1,e.target){r.processArgs(s);var a={rows:r.rows,target:s,draggableType:"rows",data:r.rowData,originalEvent:e,cancel:!1};if(i.trigger(Ft,a),r.stopTimer(),!a.cancel){if(i.element.classList.add("e-rowdrag"),r.dragTarget=l&&O(s,"e-grid").id===o.parentElement.id?parseInt(l.getAttribute("aria-rowindex"),10):parseInt(r.startedRow.getAttribute("aria-rowindex"),10),i.rowDropSettings.targetID)O(s,"e-grid")&&O(o.parentElement,"e-grid").id!==O(s,"e-grid").id?t.classList(o,["e-defaultcur"],["e-notallowedcur"]):t.classList(o,["e-notallowedcur"],["e-defaultcur"]);else{var h=O(s,"e-grid");h&&h.id===o.parentElement.id?t.classList(o,["e-movecur"],["e-defaultcur"]):t.classList(o,["e-notallowedcur"],["e-movecur"])}if(O(r.isDropGrid.element,"e-grid")){if((!r.isDropGrid.groupSettings.columns.length||e.target.classList.contains("e-selectionbackground"))&&!r.isDropGrid.element.querySelector(".e-emptyrow"))if(O(s,"e-grid")&&O(s,"e-grid").id===r.isDropGrid.element.id&&r.updateScrollPostion(e.event,s),(r.isOverflowBorder||r.parent.frozenRows>r.dragTarget)&&(parseInt(r.startedRow.getAttribute("aria-rowindex"),10)!==r.dragTarget||r.istargetGrid)||r.istargetGrid&&l&&r.isDropGrid.getRowByIndex(r.isDropGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")===l.getAttribute("data-uid"))r.moveDragRows(e,r.startedRow,l);else{var d=void 0;if(r.parent.enableVirtualization)d=l&&parseInt(l.getAttribute("aria-rowindex"),10)===r.parent.renderModule.data.dataManager.dataSource.json.length-1;else{var p=r.parent.getRowByIndex(r.parent.getCurrentViewRecords().length-1).getAttribute("data-uid");d=l&&p===l.getAttribute("data-uid")&&p!==r.startedRow.getAttribute("data-uid")}if(d&&!r.parent.rowDropSettings.targetID){var c=r.parent.createElement("div",{className:"e-lastrow-dragborder"}),u=r.parent.getContent();c.style.width=r.parent.element.offsetWidth-r.getScrollWidth()+"px",u.querySelectorAll(".e-lastrow-dragborder").length||(u.classList.add("e-grid-relative"),u.appendChild(c),c.style.bottom=r.getScrollWidth()+"px")}r.removeBorder(l)}if(s&&s.classList.contains("e-content")&&!r.isDropGrid.element.querySelector(".e-emptyrow")&&r.istargetGrid){r.removeBorder(l);var g=r.isDropGrid.getCurrentViewRecords().length-1,f=".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse",m=[];m=[].slice.call(r.isDropGrid.getRowByIndex(g).querySelectorAll(f)),r.isDropGrid.isFrozenGrid()&&(m=r.borderRowElement(g,f)),m.length>0&&$(m,!0,"e-dragborder")}}}}},this.dragStop=function(e){J(r.parent)?r.parent.notify(Zt,{instance:r,handler:r.processDragStop,arg1:e}):r.processDragStop(e)},this.processDragStop=function(e){var n=r.parent;if(!r.parent.isDestroyed){var o=r.getElementFromPosition(e.helper,e.event),s=o&&!o.classList.contains("e-dlg-overlay")?o:e.target;r.parent.element.querySelector(".e-cloneproperties");n.element.classList.remove("e-rowdrag");var l=document.getElementById(n.rowDropSettings.targetID);if(n.rowDropSettings.targetID&&l&&l.ej2_instances&&"grid"===l.ej2_instances[0].getModuleName()&&l.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),O(r.isDropGrid.element,"e-grid")){r.stopTimer(),r.isDropGrid.enableHover=r.hoverState,r.isDropGrid.getContent().classList.remove("e-grid-relative"),r.removeBorder(o);var a=r.isDropGrid.element.querySelector(".e-dragstartrow");a&&a.classList.remove("e-dragstartrow")}if(r.processArgs(s),r.parent.enableVirtualization&&t.isNullOrUndefined(r.rows[0]))return r.dragTarget=null,void t.remove(e.helper);var h={target:t.isBlazor()?null:s,draggableType:"rows",cancel:!1,fromIndex:parseInt(r.rows[0].getAttribute("aria-rowindex"),10),dropIndex:r.dragTarget,rows:t.isBlazor()?null:r.rows,data:Object.keys(r.dragStartData[0]).length>0?r.dragStartData:r.currentViewData()};n.trigger(zt,h,function(){if(!(O(s,"e-row")||O(s,"e-emptyrow")||O(s,"e-gridcontent"))||h.cancel)return r.dragTarget=null,void t.remove(e.helper);r.isRefresh=!1;var o=r.parent.getSelectedRowIndexes();if(n.isRowDragable()){if(t.isBlazor()){var l=r.parent.getSelectedRecords().length?r.parent.getSelectedRecords():r.currentViewData(),a={addedRecords:[],deletedRecords:l,changedRecords:[]},d=r.dragTarget?r.dragTarget:h.dropIndex,p=new i.Query;p.dragDropDestinationIndex=d,r.saveChange(a,p),a.deletedRecords=[],a.addedRecords=l,r.saveChange(a,p)}else!r.parent.rowDropSettings.targetID&&r.startedRow.querySelector("td.e-selectionbackground")&&o.length>1&&o.length!==r.parent.getCurrentViewRecords().length?r.reorderRows(o,h.dropIndex):r.reorderRows([parseInt(r.startedRow.getAttribute("aria-rowindex"),10)],r.dragTarget);r.dragTarget=null,n.rowDropSettings.targetID||(t.remove(e.helper),n.frozenRows&&n.enableVirtualization?n.refresh():r.rowOrder(h))}r.isRefresh=!0})}},this.removeCell=function(e,t){return[].slice.call(e.querySelectorAll("td")).filter(function(i){i.classList.contains(t)&&e.deleteCell(i.cellIndex)})},this.parent=e,this.parent.isDestroyed||(this.parent.on(Tt,this.initializeDrag,this),this.parent.on(St,this.columnDrop,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(Ct,this.onDataBoundFn),this.parent.on(Dt,this.enableAfterRender,this))}return e.prototype.refreshRow=function(e,t,i,r,n,o,s){var l,a,h,d,p=this.parent,c=p.isFrozenGrid(),u="Left-Right"===p.getFrozenMode(),g=p.getContentTable().querySelector("tbody"),f=p.getHeaderTable().querySelector("tbody");c&&(l=p.getMovableHeaderTbody(),a=p.getMovableContentTbody(),u&&(h=p.getFrozenRightHeaderTbody(),d=p.getFrozenRightContentTbody()));for(var m="Left-Right"===p.getFrozenMode()?3:2,y=0,v=e.rows.length;y<v;y++)c?y%m==0?t.insertBefore(e.rows[y],n):y%m==1?i.insertBefore(e.rows[y],o):r.insertBefore(e.rows[y],s):t.insertBefore(e.rows[y],n);var C,w,b=[].slice.call(t.querySelectorAll(".e-row"));if(c&&(C=[].slice.call(i.querySelectorAll(".e-row")),u&&(w=[].slice.call(r.querySelectorAll(".e-row")))),this.parent.enableVirtualization?this.refreshVirtualData(b,C,w):this.refreshData(b,C,w),this.parent.frozenRows)for(var S=this,y=0,v=b.length;y<v;y++)!function(e,t){e<S.parent.frozenRows?_e(f,l,h,b,C,w,function(t,i){t.appendChild(i[e])}):_e(g,a,d,b,C,w,function(t,i){t.appendChild(i[e])})}(y)},e.prototype.updateFrozenRowreOrder=function(e){var t,i,r,n,o=this.parent,s=this.parent.isFrozenGrid(),l="Left-Right"===o.getFrozenMode(),a=o.getContentTable().querySelector("tbody"),h=o.getHeaderTable().querySelector("tbody");s&&(t=o.getMovableHeaderTbody(),i=o.getMovableContentTbody(),l&&(r=o.getFrozenRightHeaderTbody(),n=o.getFrozenRightContentTbody()));var d,p,c=[].slice.call(h.querySelectorAll(".e-row")).concat([].slice.call(a.querySelectorAll(".e-row")));s&&(d=[].slice.call(t.querySelectorAll(".e-row")).concat([].slice.call(i.querySelectorAll(".e-row"))),l&&(p=[].slice.call(r.querySelectorAll(".e-row")).concat([].slice.call(n.querySelectorAll(".e-row")))));var u=o.createElement("tbody"),g=o.createElement("tbody"),f=o.createElement("tbody");this.parent.clearSelection();for(var m=this.refreshRowTarget(e),y=0,v=c.length;y<v;y++)u.appendChild(c[y]),s&&(g.appendChild(d[y]),l&&f.appendChild(p[y]));this.refreshRow(e,u,g,f,m.target,m.mTarget,m.frTarget)},e.prototype.refreshRowTarget=function(e){var t,i,r,n=this.parent,o=parseInt(e.target.parentElement.getAttribute("aria-rowindex"),10);return(e.fromIndex<e.dropIndex||e.fromIndex===e.dropIndex)&&(o+=1),t=n.getRowByIndex(o),n.isFrozenGrid()&&(i=n.getMovableRowByIndex(o),"Left-Right"===n.getFrozenMode()&&(r=n.getFrozenRightRowByIndex(o))),{target:t,mTarget:i,frTarget:r}},e.prototype.updateFrozenColumnreOrder=function(e){var t,i,r=this.parent,n=this.parent.isFrozenGrid(),o=r.getContentTable().querySelector("tbody");n&&(t=r.getMovableContentTbody(),"Left-Right"===r.getFrozenMode()&&(i=r.getFrozenRightContentTbody())),this.parent.clearSelection();var s=this.refreshRowTarget(e);this.refreshRow(e,o,t,i,s.target,s.mTarget,s.frTarget)},e.prototype.refreshVirtualData=function(e,t,i){for(var r={},n=this.parent.getCurrentViewRecords(),o=this.parent.isFrozenGrid()?this.parent.getMovableRows()[0]:this.parent.getRows()[0],s=parseInt(o.getAttribute("aria-rowindex"),10),l=0,a=e.length;l<a;l++){var h=parseInt(e[l].getAttribute("aria-rowindex"),10);this.parent.notify("refresh-Virtual-Cache-On-RowDD",{objIndex:h,end:l===e.length-1,startIndex:s}),h-=s,r[l]=n[h]}var d,p,c=this.parent.getRows();this.parent.isFrozenGrid()&&(d=this.parent.getMovableRows(),i&&(p=this.parent.getFrozenRightRows()));for(var l=0,a=e.length;l<a;l++)e[l].setAttribute("aria-rowindex",(l+s).toString()),c[l]=e[l],n[l]=r[l],this.parent.isFrozenGrid()&&(t[l].setAttribute("aria-rowindex",(l+s).toString()),d[l]=t[l],i&&(i[l].setAttribute("aria-rowindex",(l+s).toString()),p[l]=i[l]))},e.prototype.refreshData=function(e,t,i){for(var r={},n={},o={},s={},l=this.parent.getRowsObject(),a=this.parent.getMovableRowsObject(),h=this.parent.getFrozenRightRowsObject(),d=this.parent.getCurrentViewRecords(),p=0,c=e.length;p<c;p++){var u=parseInt(e[p].getAttribute("aria-rowindex"),10);r[p]=l[u],s[p]=d[u],this.parent.isFrozenGrid()&&(n[p]=a[u],i&&(o[p]=h[u]))}var g,f,m=this.parent.getRows();this.parent.isFrozenGrid()&&(g=this.parent.getMovableRows(),i&&(f=this.parent.getFrozenRightRows()));for(var p=0,c=e.length;p<c;p++)m[p]=e[p],l[p]=r[p],d[p]=s[p],this.parent.isFrozenGrid()&&(g[p]=t[p],a[p]=n[p],i&&(f[p]=i[p],h[p]=o[p]));De(this.parent,l,e),this.parent.isFrozenGrid()&&(De(this.parent,a,t),i&&De(this.parent,h,i))},e.prototype.rowOrder=function(e){if(e.dropIndex!==e.fromIndex&&!isNaN(e.dropIndex)){if(this.parent.childGrid){this.parent.detailCollapseAll();var t=[].slice.call(this.parent.getContentTable().querySelector("tbody").children),i=this.parent.getRowsObject();t.filter(function(e){e.classList.contains("e-detailrow")&&e.remove()});for(var r=0,n=i.length;r<n&&i[r];r++)i[r].isDetailRow&&(this.parent.getRowsObject().splice(r,1),r--)}if(e.target.classList.contains("e-rowcelldrag")&&(e.target=e.target.parentElement),this.parent.frozenRows?this.updateFrozenRowreOrder(e):this.updateFrozenColumnreOrder(e),this.selectedRowColls.length>0){this.parent.selectRows(this.selectedRowColls);var o=[];if(this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length){for(var r=0,n=e.rows.length;r<n;r++)o.push(parseInt(e.rows[r].getAttribute("aria-rowindex"),10));this.selectedRowColls=o}this.selectedRowColls=[]}}},e.prototype.currentViewData=function(){for(var e=this.parent.getSelectedRowIndexes(),t=[],i=parseInt(this.startedRow.getAttribute("aria-rowindex"),10),r=0,n=e.length;r<n;r++){t[r]=this.parent.currentViewData[e[r]]}return this.parent.rowDropSettings.targetID||0!==e.length||(t[0]=this.parent.currentViewData[i]),t},e.prototype.saveChange=function(e,i){var r=this;this.parent.getDataModule().saveChanges(e,this.parent.getPrimaryKeyFieldNames()[0],{},i).then(function(){r.parent.notify(Bt,{type:yt,requestType:"rowdraganddrop"})}).catch(function(e){t.isNullOrUndefined(e.error)||t.isNullOrUndefined(e.error.message)||(e.error=e.error.message),r.parent.trigger("actionFailure",e)})},e.prototype.reorderRows=function(e,t){for(var i=this.parent.getSelectedRowIndexes(),r=[],n=[],o=this.parent.renderModule.data.dataManager.dataSource.json,s=this.parent.allowPaging?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-this.parent.pageSettings.pageSize:0,l=t+s,a=e[0]+s,h=0,d=e.length;h<d;h++)n[h]=o[e[h]+s];for(var h=0,d=i.length;h<d;h++)r[h]=o[i[h]+s];for(var h=0,d=n.length;h<d;h++){if(0!==h){for(var p=0,c=o.length;p<c;p++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[p])===JSON.stringify(n[h])){a=p;break}for(var p=0,c=o.length;p<c;p++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[p])===JSON.stringify(n[h-1])){a>p&&(l=p+1);break}}this.reorderRow(a-s,l-s)}this.isRefresh&&this.parent.notify(Bt,{type:yt,requestType:"rowdraganddrop"});for(var h=0,d=r.length;h<d;h++)for(var p=0,c=o.length;p<c;p++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[p])===JSON.stringify(r[h])){i[h]=p-s;break}this.selectedRowColls=i},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.initializeDrag=function(){var e=this.parent;this.draggable=new t.Draggable(e.element,{dragTarget:".e-rowcelldrag, .e-rowdragdrop, .e-rowcell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,isReplaceDragEle:this.isReplaceDragEle})},e.prototype.updateScrollPostion=function(e,t){var i=this,r=P(e).y,n=this.isDropGrid.getContent().getBoundingClientRect(),o=this.isDropGrid.getRowHeight()-15,s=this.isDropGrid.getContent().firstElementChild;if(n.top>=r){var l=-this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){i.setScrollDown(s,l,!0)},200)}else if(n.top+this.isDropGrid.getContent().clientHeight-o-33<=r){var a=this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){i.setScrollDown(s,a,!0)},200)}},e.prototype.setScrollDown=function(e,t,i){e.scrollTop=e.scrollTop+t},e.prototype.moveDragRows=function(e,i,r){var n=this.parent.element.querySelector(".e-cloneproperties"),o=t.closest(e.target,"tr");if(O(o,"e-grid")&&(O(n.parentElement,"e-grid").id===O(o,"e-grid").id||this.istargetGrid)){var s=o||this.startedRow;this.setBorder(s,e.event,i,r)}},e.prototype.setBorder=function(e,i,r,n){var o=this.parent.element;this.istargetGrid&&(o=this.isDropGrid.element);var s=this.parent.element.querySelector(".e-cloneproperties");if(this.removeFirstRowBorder(e),this.removeLastRowBorder(e),O(e,"e-grid")&&!this.parent.rowDropSettings.targetID&&e.classList.contains("e-row")&&O(s.parentElement,"e-grid").id===O(e,"e-grid").id||this.istargetGrid){t.removeClass(o.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragborder"]);var l=[],a=parseInt(n.getAttribute("aria-rowindex"),10);if(n&&0===a){var h=this.parent.createElement("div",{className:"e-firstrow-dragborder"}),d=this.isDropGrid.getHeaderContent();d.classList.add("e-grid-relative"),h.style.width=o.offsetWidth-this.getScrollWidth()+"px",d.querySelectorAll(".e-firstrow-dragborder").length||d.appendChild(h)}else this.parent.rowDropSettings.targetID&&n?(e=this.isDropGrid.getRowByIndex(a-1),l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):n&&parseInt(r.getAttribute("aria-rowindex"),10)>a?(e=this.parent.getRowByIndex(a-1),l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"));var p=this.parent.isFrozenGrid();if(n&&0!==a&&p){var c=parseInt(e.getAttribute("aria-rowindex"),10);l=this.borderRowElement(c,".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")}l.length>0&&$(l,!0,"e-dragborder")}},e.prototype.borderRowElement=function(e,t){var i=[];return i=[].slice.call(this.isDropGrid.getRowByIndex(e).querySelectorAll(t)).concat([].slice.call(this.isDropGrid.getMovableRowByIndex(e).querySelectorAll(t))),"Left-Right"===this.isDropGrid.getFrozenMode()&&(i=i.concat([].slice.call(this.isDropGrid.getFrozenRightRowByIndex(e).querySelectorAll(t)))),i},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?Rr.getScrollBarWidth():0},e.prototype.removeFirstRowBorder=function(e){this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder").length>0&&e&&0!==e.rowIndex&&t.remove(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder")[0])},e.prototype.removeLastRowBorder=function(e){var i;i=this.parent.enableVirtualization?e&&parseInt(e.getAttribute("aria-rowindex"),10)!==this.parent.renderModule.data.dataManager.dataSource.json.length-1:e&&this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1).getAttribute("data-uid")!==e.getAttribute("data-uid"),this.parent.element.getElementsByClassName("e-lastrow-dragborder").length>0&&e&&i&&t.remove(this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0])},e.prototype.removeBorder=function(e){if(this.removeFirstRowBorder(e),this.parent.rowDropSettings.targetID||this.removeLastRowBorder(e),e=(this.isDropGrid.isFrozenGrid()?this.isDropGrid.getMovableRows():this.isDropGrid.getRows()).filter(function(e){return e.querySelector("td.e-dragborder")})[0]){var t=[].slice.call(e.querySelectorAll(".e-dragborder"));if(this.parent.isFrozenGrid()){var i=parseInt(e.getAttribute("aria-rowindex"),10);t=this.borderRowElement(i,".e-dragborder")}$(t,!1,"e-dragborder")}},e.prototype.getElementFromPosition=function(e,t){var i,r=P(t);return e.style.display="none",i=document.elementFromPoint(r.x,r.y),e.style.display="",i},e.prototype.onDataBound=function(e){this.selectedRowColls.length>0&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10):0},e.prototype.singleRowDrop=function(e){var i,r,n=t.closest(e.target,"tr");r=e.droppedElement.parentElement.ej2_instances[0],i=n?n.rowIndex:r.currentViewData.length-1,this.reorderRow(this.startedRowIndex,i)},e.prototype.columnDrop=function(e){var r=this.parent;e.droppedElement.parentElement.ej2_instances[0];if("grouping"!==e.droppedElement.getAttribute("action")&&(O(e.target,"e-row")||O(e.target,"e-emptyrow")||O(e.target,"e-gridcontent"))){var n,o=t.closest(e.target,"tr"),s=void 0;if("true"!==e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id===r.element.id||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id!==r.element.id)return;if(e.droppedElement.parentElement.id!==r.element.id)n=e.droppedElement.parentElement.ej2_instances[0];else if(this.isSingleRowDragDrop||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow"))return void this.singleRowDrop(e);if(n.element.id!==r.element.id&&n.rowDropSettings.targetID!==r.element.id)return;var l=n.getSelectedRecords(),a=s=this.getTargetIdx(o);if(isNaN(a)&&(a=s=0),r.allowPaging&&(a=a+r.pageSettings.currentPage*r.pageSettings.pageSize-r.pageSettings.pageSize),t.isBlazor()){for(var h=[],d=n.getSelectedRowIndexes(),p=0;p<d.length;p++)h[p]=n.currentViewData[d[p]];var c={addedRecords:l=h,deletedRecords:[],changedRecords:[]},u=new i.Query;u.dragDropDestinationIndex=a,r.getDataModule().saveChanges(c,r.getPrimaryKeyFieldNames()[0],{},u).then(function(){r.notify(Bt,{type:yt,requestType:"rowdraganddrop"})}).catch(function(e){t.isNullOrUndefined(e.error)||t.isNullOrUndefined(e.error.message)||(e.error=e.error.message),r.trigger("actionFailure",e)}),c.deletedRecords=l,c.addedRecords=[],n.getDataModule().saveChanges(c,n.getPrimaryKeyFieldNames()[0],{},u).then(function(){n.notify(Bt,{type:yt,requestType:"rowdraganddrop"})}).catch(function(e){t.isNullOrUndefined(e.error)||t.isNullOrUndefined(e.error.message)||(e.error=e.error.message),n.trigger("actionFailure",e)})}else{r.notify(Gt,{toIndex:a,records:l}),r.notify(Bt,{type:yt,requestType:"rowdraganddrop"});var g=n.getSelectedRowIndexes(),f=n.allowPaging?n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize:0;this.selectedRows=[];for(var p=0,m=l.length;p<m;p++)this.selectedRows.push(f+g[p]);n.notify(_t,{indexes:this.selectedRows,records:l}),n.notify(Bt,{type:yt,requestType:"rowdraganddrop"})}}},e.prototype.reorderRow=function(e,t){var i=this.parent;if(!i.sortSettings.columns.length&&!i.groupSettings.columns.length&&!i.filterSettings.columns.length){var r=i.allowPaging?i.pageSettings.currentPage*i.pageSettings.pageSize-i.pageSettings.pageSize:0;t+=r,this.selectedRows=i.getSelectedRowIndexes(),i.notify(oi,{fromIndex:e+r,toIndex:t})}},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.initializeDrag()},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.draggable.destroy(),this.parent.off(Tt,this.initializeDrag),this.parent.off(St,this.columnDrop),this.parent.removeEventListener(Ct,this.onDataBoundFn),this.parent.off(Dt,this.enableAfterRender))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e.prototype.processArgs=function(e){var t=this.parent,i=parseInt(this.startedRow.getAttribute("aria-rowindex"),10);if(t.getSelectedRecords().length>0&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length)this.rows=[this.parent.getRowByIndex(i)],t.isFrozenGrid()&&(this.rows=[t.getRowByIndex(i),t.getMovableRowByIndex(i)],"Left-Right"===t.getFrozenMode()&&(this.rows=[t.getRowByIndex(i),t.getMovableRowByIndex(i),t.getFrozenRightRowByIndex(i)])),this.rowData=[this.parent.getRowInfo(this.startedRow.querySelector(".e-rowcell")).rowData];else if(this.rows=t.getSelectedRows(),this.rowData=t.getSelectedRecords(),this.parent.enableVirtualization){this.rows=[];for(var r=t.getSelectedRowIndexes(),n=0,o=r.length;n<o;n++)this.rows.push(t.getRowByIndex(r[n])),t.isFrozenGrid()&&(this.rows.push(t.getMovableRowByIndex(r[n])),"Left-Right"===t.getFrozenMode()&&this.rows.push(t.getFrozenRightRowByIndex(r[n])))}},e}(),In=function(){function e(e,i,r,n){var o=this;this.sortRequired=!0,this.isAppliedGroup=!1,this.isAppliedUnGroup=!1,this.reorderingColumns=[],this.visualElement=t.createElement("div",{className:"e-cloneproperties e-dragclone e-gdclone",styles:"line-height:23px",attrs:{action:"grouping"}}),this.helper=function(e){var t=o.parent,i=e.sender.target,r=i.classList.contains("e-groupheadercell")?i:O(i,"e-groupheadercell");return!(!r||!i.classList.contains("e-drag")&&o.groupSettings.allowReordering)&&(o.column=t.getColumnByField(r.firstElementChild.getAttribute("ej-mappingname")),o.visualElement.textContent=r.textContent,o.visualElement.style.width=r.offsetWidth+2+"px",o.visualElement.style.height=r.offsetHeight+2+"px",o.visualElement.setAttribute("e-mappinguid",o.column.uid),t.element.appendChild(o.visualElement),o.visualElement)},this.dragStart=function(e){o.parent.element.classList.add("e-ungroupdrag"),t.isBlazor()&&e.bindEvents(e.dragElement)},this.drag=function(e){o.groupSettings.allowReordering&&o.animateDropper(e);var i=e.target,r=o.parent.element.querySelector(".e-cloneproperties");o.parent.trigger(bt,{target:i,draggableType:"headercell",column:o.column}),o.groupSettings.allowReordering||(t.classList(r,["e-defaultcur"],["e-notallowedcur"]),O(i,"e-gridcontent")||O(i,"e-headercell")||t.classList(r,["e-notallowedcur"],["e-defaultcur"]))},this.dragStop=function(e){o.parent.element.classList.remove("e-ungroupdrag");var i=!(O(e.target,"e-gridcontent")||O(e.target,"e-gridheader"));if(o.groupSettings.allowReordering&&i){if(t.remove(e.helper),O(e.target,"e-groupdroparea"))o.rearrangeGroup(e);else if(!O(e.target,"e-grid")){var r=o.parent.getColumnByUid(e.helper.getAttribute("e-mappinguid")).field;-1!==o.groupSettings.columns.indexOf(r)&&o.ungroupColumn(r)}}else if(i)return void t.remove(e.helper)},this.animateDropper=function(e){var t=o.parent.element.querySelector(".e-cloneproperties").getAttribute("e-mappinguid"),i=o.parent.getColumnByUid(t).field,r=O(e.target,"e-groupdroparea"),n=O(e.target,"e-group-animator"),s=[].slice.call(o.element.querySelectorAll(".e-groupheadercell")).map(function(e){return e.querySelector("div").getAttribute("ej-mappingname")}),l=JSON.parse(JSON.stringify(s));if(n||r){if(n){var a=n.querySelector("div[ej-mappingname]").getAttribute("ej-mappingname"),h=+n.getAttribute("index");if(a!==i){var d=l.indexOf(i);-1!==d&&l.splice(d,1);var p=-1!==h&&d===h;l.splice(h+(p?1:0),0,i)}}else r&&-1===l.indexOf(i)&&l.push(i);o.element.innerHTML="",l.length&&!o.element.classList.contains("e-grouped")&&o.element.classList.add("e-grouped"),o.reorderingColumns=l;for(var c=0;c<l.length;c++)o.addColToGroupDrop(l[c])}else o.addLabel(),o.removeColFromGroupDrop(i)},this.drop=function(e){var i=o.parent,r=i.getColumnByUid(e.droppedElement.getAttribute("e-mappinguid"));if(o.element.classList.remove("e-hover"),t.remove(e.droppedElement),o.aria.setDropTarget(o.parent.element.querySelector(".e-groupdroparea"),!1),o.aria.setGrabbed(o.parent.getHeaderTable().querySelector("[aria-grabbed=true]"),!1),t.isNullOrUndefined(r)||!1===r.allowGrouping||O(i.getColumnHeaderByUid(r.uid),"e-grid").getAttribute("id")!==i.element.getAttribute("id"))return void o.parent.log("action_disabled_column",{moduleName:o.getModuleName(),columnName:r.headerText});o.groupColumn(r.field)},this.contentRefresh=!0,this.aria=new Ei,this.parent=e,this.groupSettings=i,this.serviceLocator=n,this.sortedColumns=r,this.focus=n.getService("focus"),this.addEventListener(),this.groupGenerator=new Fi(this.parent)}return e.prototype.addLabel=function(){if(!this.element.querySelectorAll(".e-group-animator").length){var e=this.l10n.getConstant("GroupDropArea");this.element.innerHTML=e,this.element.classList.remove("e-grouped")}},e.prototype.rearrangeGroup=function(e){this.sortRequired=!1,this.updateModel()},e.prototype.columnDrag=function(e){this.groupSettings.allowReordering&&this.animateDropper(e);this.parent;var i=this.parent.element.querySelector(".e-cloneproperties");t.classList(i,["e-defaultcur"],["e-notallowedcur"]),O(e.target,"e-groupdroparea")||this.parent.allowReordering&&O(e.target,"e-headercell")||t.classList(i,["e-notallowedcur"],["e-defaultcur"]),e.target.classList.contains("e-groupdroparea")?this.element.classList.add("e-hover"):this.element.classList.remove("e-hover")},e.prototype.columnDragStart=function(e){if(!e.target.classList.contains("e-stackedheadercell")){this.parent;var t=this.parent.element.querySelector(".e-groupdroparea");this.aria.setDropTarget(t,e.column.allowGrouping);var i=e.target.classList.contains("e-headercell")?e.target:O(e.target,"e-headercell");this.aria.setGrabbed(i,!0,!e.column.allowGrouping)}},e.prototype.columnDrop=function(e){var i=this.parent;if("grouping"===e.droppedElement.getAttribute("action")){var r=i.getColumnByUid(e.droppedElement.getAttribute("e-mappinguid"));if(t.isNullOrUndefined(r)||!1===r.allowGrouping||O(i.getColumnHeaderByUid(r.uid),"e-grid").getAttribute("id")!==i.element.getAttribute("id"))return;this.ungroupColumn(r.field)}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Dt,this.enableAfterRender,this),this.parent.on("grouping-complete",this.onActionComplete,this),this.parent.on("ungrouping-complete",this.onActionComplete,this),this.parent.on(At,this.onPropertyChanged,this),this.parent.on(Ht,this.clickHandler,this),this.parent.on(bt,this.columnDrag,this),this.parent.on(wt,this.columnDragStart,this),this.parent.on(Kt,this.columnDrop,this),this.parent.on(St,this.columnDrop,this),this.parent.on(Lt,this.refreshSortIcons,this),this.parent.on("sorting-complete",this.refreshSortIcons,this),this.parent.on(qt,this.keyPressHandler,this),this.parent.on(Mt,this.initialEnd,this),this.parent.on(Ot,this.initialEnd,this),this.parent.on(Tt,this.render,this),this.parent.on("group-aggregates",this.onGroupAggregates,this),this.parent.on("blazor-action-begin",this.blazorActionBegin,this),this.parent.on("group-expand-collapse",this.updateExpand,this),this.parent.on("persist-data-changed",this.initialEnd,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Tt,this.render),this.parent.off(Dt,this.enableAfterRender),this.parent.off("grouping-complete",this.onActionComplete),this.parent.off("ungrouping-complete",this.onActionComplete),this.parent.off(At,this.onPropertyChanged),this.parent.off(Ht,this.clickHandler),this.parent.off(bt,this.columnDrag),this.parent.off(wt,this.columnDragStart),this.parent.off(St,this.columnDrop),this.parent.off(Kt,this.columnDrop),this.parent.off(Lt,this.refreshSortIcons),this.parent.off("sorting-complete",this.refreshSortIcons),this.parent.off(qt,this.keyPressHandler),this.parent.off("group-aggregates",this.onGroupAggregates),this.parent.off("blazor-action-begin",this.blazorActionBegin),this.parent.off("group-expand-collapse",this.updateExpand))},e.prototype.blazorActionBegin=function(){this.parent.allowGrouping&&!this.parent.isCollapseStateEnabled()&&this.expandAll()},e.prototype.initialEnd=function(){var e=this.parent;if(this.parent.off(Mt,this.initialEnd),this.parent.off(Ot,this.initialEnd),t.isBlazor()&&e.isServerRendered){for(var i=0;i<e.columns.length;i++)this.removeColFromGroupDrop(e.columns[i].field);this.updateGroupDropArea()}if(this.parent.getColumns().length&&this.groupSettings.columns.length){this.contentRefresh=!1;for(var r=0,n=e.groupSettings.columns;r<n.length;r++){var o=n[r];this.groupColumn(o)}this.contentRefresh=!0}},e.prototype.keyPressHandler=function(e){var i=this.parent;if("ctrlSpace"===e.action||this.groupSettings.columns.length&&-1!==["altDownArrow","altUpArrow","ctrlDownArrow","ctrlUpArrow","enter"].indexOf(e.action))switch(e.preventDefault(),e.action){case"altDownArrow":case"altUpArrow":var r=i.allowSelection?i.getSelectedRowIndexes():[];if(r.length){for(var n=i.getContentTable().querySelector("tbody").children,o=void 0,s=i.getDataRows()[r[r.length-1]].rowIndex;s>=0;s--)if(!n[s].classList.contains("e-row")&&!n[s].classList.contains("e-detailrow")){o=n[s];break}this.expandCollapseRows(o.querySelector("altUpArrow"===e.action?".e-recordplusexpand":".e-recordpluscollapse"))}break;case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"enter":if(this.parent.isEdit||null!==t.closest(e.target,"#"+this.parent.element.id+"_searchbar"))return;var l=this.focus.getFocusedElement(),a=l?l.parentElement.querySelector('[class^="e-record"]'):null;if(!a)break;this.expandCollapseRows(a);break;case"ctrlSpace":var h=i.focusModule.currentInfo.element;if(h&&h.classList.contains("e-headercell")){var d=i.getColumnByUid(h.firstElementChild.getAttribute("e-mappinguid"));d.field&&i.groupSettings.columns.indexOf(d.field)<0?this.groupColumn(d.field):this.ungroupColumn(d.field)}}},e.prototype.clickHandler=function(e){this.expandCollapseRows(e.target),this.applySortFromTarget(e.target),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},e.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname"))},e.prototype.toogleGroupFromHeader=function(e){this.groupSettings.showToggleButton&&(e.classList.contains("e-grptogglebtn")?e.classList.contains("e-toggleungroup")?this.ungroupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):this.groupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):e.classList.contains("e-toggleungroup")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname")))},e.prototype.applySortFromTarget=function(e){var i=this.parent,r=t.closest(e,".e-groupheadercell");if(i.allowSorting&&r&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")){var n=r.firstElementChild.getAttribute("ej-mappingname");i.getColumnHeaderByField(n).querySelectorAll(".e-ascending").length?i.sortColumn(n,"Descending",!0):i.sortColumn(n,"Ascending",!0)}},e.prototype.expandCollapseRows=function(e){var i=O(e,"e-recordplusexpand")||O(e,"e-recordpluscollapse");if(i){var r=i.cellIndex,n=i.parentElement.rowIndex,o=this.parent.getContentTable().querySelector("tbody").children,s=[].slice.call(o).slice(n+1,o.length),l=void 0,a=void 0,h=[],d=this.parent,p=i.parentElement.querySelectorAll(".e-indentcell").length,c=!1;if(t.isBlazor()&&this.parent.isCollapseStateEnabled())return void this.parent.notify("group-expand-collapse",{uid:i.parentElement.getAttribute("data-uid"),isExpand:i.classList.contains("e-recordpluscollapse")});if(i.classList.contains("e-recordpluscollapse")?(t.addClass([i],"e-recordplusexpand"),t.removeClass([i],"e-recordpluscollapse"),i.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",c=!0,pe(d)&&this.updateVirtualRows(d,e,c,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.captionExpand(i.parentElement)):(l=!0,t.removeClass([i],"e-recordplusexpand"),t.addClass([i],"e-recordpluscollapse"),i.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",pe(d)&&this.updateVirtualRows(d,e,!l,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.captionCollapse(i.parentElement)),this.aria.setExpand(i,c),!pe(d)&&!this.parent.groupSettings.enableLazyLoading){for(var u=0,g=s.length;u<g&&(s[u].querySelectorAll("td")[r]&&s[u].querySelectorAll("td")[r].classList.contains("e-indentcell")&&s);u++)l?s[u].style.display="none":s[u].querySelectorAll(".e-indentcell").length===p+1&&(s[u].style.display="",(a=s[u].querySelector(".e-recordplusexpand"))&&h.push(a),s[u].classList.contains("e-detailrow")&&s[u-1].querySelectorAll(".e-detailrowcollapse").length&&(s[u].style.display="none"));this.updateVisibleexpandCollapseRows(),this.parent.notify("refresh-Expand-and-Collapse",{rows:this.parent.getRowsObject()})}for(var u=0,g=h.length;u<g;u++)t.removeClass([h[u]],"e-recordplusexpand"),t.addClass([h[u]],"e-recordpluscollapse"),h[u].firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",this.expandCollapseRows(h[u])}},e.prototype.updateVisibleexpandCollapseRows=function(){for(var e=this.parent.getRowsObject(),t=0,i=e.length;t<i;t++)e[t].isDataRow&&"none"===this.parent.getRowElementByUID(e[t].uid).style.display&&(e[t].visible=!1)},e.prototype.updateVirtualRows=function(e,t,i,r,n){var o=e.getRowObjectFromUID(t.closest("tr").getAttribute("data-uid"));o.isExpand=i,C(e),this.parent.notify("refresh-virtual-max-page",{}),(r=e.getDataModule().generateQuery(!1)).queries=e.getDataModule().aggregateQuery(e.getQuery().clone()).queries;var s={requestType:"virtualscroll",rowObject:o};e.getDataModule().getData(s,r.requiresCount()).then(function(t){return e.renderModule.dataManagerSuccess(t,s)})},e.prototype.expandCollapse=function(e){if(t.isBlazor()&&this.parent.isCollapseStateEnabled())return void this.parent.notify("group-expand-collapse",{isExpand:e});e||this.parent.notify("initial-collapse",e);for(var i,r=this.parent.getContentTable().querySelector("tbody").children,n=0,o=r.length;n<o;n++)r[n].querySelectorAll(".e-recordplusexpand, .e-recordpluscollapse").length?((i=r[n].querySelector(e?".e-recordpluscollapse":".e-recordplusexpand"))&&(i.className=e?"e-recordplusexpand":"e-recordpluscollapse",i.firstElementChild.className=e?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow"),r[n].firstElementChild.classList.contains("e-recordplusexpand")||r[n].firstElementChild.classList.contains("e-recordpluscollapse")||(r[n].style.display=e?"":"none")):r[n].style.display=e?"":"none";this.updateVisibleexpandCollapseRows(),this.parent.notify("refresh-Expand-and-Collapse",{rows:this.parent.getRowsObject()})},e.prototype.expandAll=function(){this.expandCollapse(!0)},e.prototype.collapseAll=function(){this.expandCollapse(!1)},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderGroupDropArea(),this.initDragAndDrop(),this.refreshToggleBtn()},e.prototype.renderGroupDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");e&&t.remove(e),this.element=this.parent.createElement("div",{className:"e-groupdroparea",attrs:{tabindex:"-1"}}),this.groupSettings.allowReordering&&this.element.classList.add("e-group-animate"),this.updateGroupDropArea(),this.parent.element.insertBefore(this.element,this.parent.element.firstChild),this.groupSettings.showDropArea||(this.element.style.display="none")},e.prototype.updateGroupDropArea=function(e){if(this.groupSettings.showDropArea&&!this.groupSettings.columns.length){var t=this.l10n.getConstant("GroupDropArea");this.element.innerHTML=t,this.element.classList.remove("e-grouped")}else(this.element.innerHTML===this.l10n.getConstant("GroupDropArea")&&(1===this.groupSettings.columns.length||!this.isAppliedGroup&&!this.isAppliedUnGroup)||e)&&(this.element.innerHTML=""),this.element.classList.add("e-grouped")},e.prototype.initDragAndDrop=function(){this.initializeGHeaderDrop(),this.initializeGHeaderDrag()},e.prototype.initializeGHeaderDrag=function(){new t.Draggable(this.element,{dragTarget:this.groupSettings.allowReordering?".e-drag":".e-groupheadercell",distance:this.groupSettings.allowReordering?-10:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop})},e.prototype.initializeGHeaderDrop=function(){this.parent,new t.Droppable(this.element,{accept:".e-dragclone",drop:this.drop})},e.prototype.groupColumn=function(e){var i=this.parent,r=i.getColumnByField(e);return t.isNullOrUndefined(r)||!1===r.allowGrouping||this.contentRefresh&&this.groupSettings.columns.indexOf(e)>-1?void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:r.headerText}):J(i)?void i.notify(Zt,{instance:this,handler:this.groupColumn,arg1:e}):(r.visible=i.groupSettings.showGroupedColumn,this.colName=e,this.isAppliedGroup=!0,this.contentRefresh?this.updateModel():this.addColToGroupDrop(e),this.updateGroupDropArea(),void(this.isAppliedGroup=!1))},e.prototype.ungroupColumn=function(e){var i=this.parent,r=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:i.getColumnByField(e);if(!(t.isNullOrUndefined(r)||!1===r.allowGrouping||this.groupSettings.columns.indexOf(e)<0)){if(J(i))return void i.notify(Zt,{instance:this,handler:this.ungroupColumn,arg1:e});if(r.visible=!0,t.isBlazor()&&i.isServerRendered){var n=[];n[0]=r,this.parent.notify("setvisibility",n)}this.colName=r.field;var o=JSON.parse(JSON.stringify(this.groupSettings.columns));if(o.splice(o.indexOf(this.colName),1),this.sortedColumns.indexOf(e)<0)for(var s=0,l=i.sortSettings.columns.length;s<l;s++)if(e===i.sortSettings.columns[s].field){i.sortSettings.columns.splice(s,1);break}t.isBlazor()&&this.parent.isServerRendered&&(i.sortSettings.columns=i.sortSettings.columns),this.groupSettings.allowReordering&&(this.reorderingColumns=o),this.groupSettings.columns=o,i.allowGrouping&&(this.isAppliedUnGroup=!0,this.parent.dataBind())}},e.prototype.updateModel=function(){this.parent;var e=JSON.parse(JSON.stringify(this.groupSettings.columns));e=this.reorderingColumns.length?JSON.parse(JSON.stringify(this.reorderingColumns)):e,this.sortRequired&&(-1===e.indexOf(this.colName)&&e.push(this.colName),this.groupAddSortingQuery(this.colName)),this.sortRequired=!0,this.parent.groupSettings.columns=e,this.parent.dataBind()},e.prototype.onActionComplete=function(e){t.isBlazor()&&!this.parent.isJsComponent&&(e.rows=null);this.parent;"grouping"===e.requestType?this.addColToGroupDrop(this.colName):this.removeColFromGroupDrop(this.colName);var i=this.groupSettings.columns.indexOf(this.colName)>-1?{columnName:this.colName,requestType:"grouping",type:vt}:{requestType:"ungrouping",type:vt};this.parent.trigger(vt,t.extend(e,i)),this.colName=null},e.prototype.groupAddSortingQuery=function(e){for(var i=0;i<this.parent.sortSettings.columns.length&&this.parent.sortSettings.columns[i].field!==e;)i++;if(this.parent.sortSettings.columns.length===i){this.parent.sortSettings.columns.push({field:e,direction:"Ascending",isFromGroup:!0});t.isBlazor()&&this.parent.isServerRendered&&(this.parent.sortSettings.columns=this.parent.sortSettings.columns)}else this.parent.allowSorting||(this.parent.sortSettings.columns[i].direction="Ascending")},e.prototype.createElement=function(e){var i=this.parent,r="Ascending",n=this.parent.createElement("div",{className:"e-grid-icon e-group-animator"}),o=this.parent.createElement("div",{className:"e-grid-icon e-groupheadercell"}),s=this.parent.createElement("div",{attrs:{"ej-mappingname":e}}),l=this.parent.getColumnByField(e),a=i.getColumnHeaderByUid(l.uid);this.groupSettings.allowReordering&&s.appendChild(this.parent.createElement("span",{className:"e-drag e-icons e-icon-drag",innerHTML:"&nbsp;",attrs:{title:"Drag",tabindex:"-1","aria-label":"Drag the grouped column"}})),s.appendChild(this.parent.createElement("span",{className:"e-grouptext",innerHTML:l.headerText,attrs:{tabindex:"-1","aria-label":"sort the grouped column"}})),this.groupSettings.showToggleButton&&s.appendChild(this.parent.createElement("span",{className:"e-togglegroupbutton e-icons e-icon-ungroup e-toggleungroup",innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":"ungroup button"}})),a.querySelectorAll(".e-ascending,.e-descending").length&&(r=a.querySelector(".e-ascending")?"Ascending":"Descending"),s.appendChild(this.parent.createElement("span",{className:"e-groupsort e-icons e-"+r.toLowerCase()+" e-icon-"+r.toLowerCase(),innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":"sort the grouped column"}})),s.appendChild(this.parent.createElement("span",{className:"e-ungroupbutton e-icons e-icon-hide",innerHTML:"&nbsp;",attrs:{title:t.isBlazor()?this.l10n.getConstant("UnGroupButton"):this.l10n.getConstant("UnGroup"),tabindex:"-1","aria-label":"ungroup the grouped column"},styles:this.groupSettings.showUngroupButton?"":"display:none"})),o.appendChild(s);this.groupSettings.columns.indexOf(e);return this.groupSettings.allowReordering&&(n.appendChild(o),n.appendChild(this.createSeparator()),o=n),o},e.prototype.addColToGroupDrop=function(e){if(!this.groupSettings.allowReordering||!this.parent.element.querySelector(".e-groupdroparea div[ej-mappingname="+e+"]")){var i=this.parent.getColumnByField(e);if(!t.isNullOrUndefined(i)){var r=this.createElement(e);if(this.groupSettings.allowReordering){var n=this.element.querySelectorAll(".e-group-animator").length;r.setAttribute("index",n.toString())}this.element.appendChild(r)}}},e.prototype.createSeparator=function(){return this.parent.createElement("span",{className:"e-nextgroup e-icons e-icon-next",innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":"Separator for the grouped columns"},styles:this.groupSettings.showUngroupButton?"":"display:none"})},e.prototype.refreshToggleBtn=function(e){if(this.groupSettings.showToggleButton)for(var i=[].slice.call(this.parent.getHeaderTable().getElementsByClassName("e-headercelldiv")),r=0,n=i.length;r<n;r++)if(!i[r].classList.contains("e-emptycell")&&!i[r].classList.contains("e-headerchkcelldiv")){var o=this.parent.getColumnByUid(i[r].getAttribute("e-mappinguid"));(!this.parent.showColumnMenu||this.parent.showColumnMenu&&!o.showColumnMenu)&&(i[r].querySelectorAll(".e-grptogglebtn").length&&t.remove(i[r].querySelectorAll(".e-grptogglebtn")[0]),e||i[r].appendChild(this.parent.createElement("span",{className:"e-grptogglebtn e-icons "+(this.groupSettings.columns.indexOf(o.field)>-1?"e-toggleungroup e-icon-ungroup":"e-togglegroup e-icon-group"),attrs:{tabindex:"-1","aria-label":"Group button"}})))}},e.prototype.removeColFromGroupDrop=function(e){if(!t.isNullOrUndefined(this.getGHeaderCell(e))){var i=this.getGHeaderCell(e);if(this.groupSettings.allowReordering){var r=O(i,"e-group-animator");t.remove(r)}else t.remove(i);this.updateGroupDropArea()}this.isAppliedUnGroup=!1},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var i=0,r=Object.keys(e.properties);i<r.length;i++){var n=r[i];switch(n){case"columns":var o=void 0;if(this.contentRefresh){if(this.isAppliedUnGroup)o={columnName:this.colName,requestType:"ungrouping",type:yt};else{if(!this.isAppliedGroup){this.updateGroupDropArea(!0);for(var s=0;s<this.parent.sortSettings.columns.length;s++)this.parent.sortSettings.columns[s].isFromGroup&&(this.parent.sortSettings.columns.splice(s,1),s--);for(a=0;a<this.groupSettings.columns.length;a++)this.colName=this.groupSettings.columns[a],this.parent.getColumnByField(this.colName).visible=this.parent.groupSettings.showGroupedColumn,this.groupAddSortingQuery(this.colName),a<this.groupSettings.columns.length-1&&this.addColToGroupDrop(this.groupSettings.columns[a])}o={columnName:this.colName,requestType:e.properties[n].length?"grouping":"ungrouping",type:yt}}if(!this.groupSettings.showGroupedColumn)for(var l=e.oldProperties[n],a=0;a<l.length;a++)-1===e.properties[n].indexOf(l[a])&&(this.parent.getColumnByField(l[a]).visible=!0);t.isBlazor()&&this.parent.isServerRendered&&this.parent.isCollapseStateEnabled()&&"grouping"===o.requestType&&this.parent.refreshHeader(),this.parent.notify(Bt,o)}break;case"showDropArea":this.updateGroupDropArea(),this.groupSettings.showDropArea?this.element.style.display="":this.element.style.display="none";break;case"showGroupedColumn":this.updateGroupedColumn(this.groupSettings.showGroupedColumn),this.parent.notify(Bt,{requestType:"refresh"});break;case"showUngroupButton":this.updateButtonVisibility(this.groupSettings.showUngroupButton,"e-ungroupbutton");break;case"showToggleButton":this.updateButtonVisibility(this.groupSettings.showToggleButton,"e-togglegroupbutton "),this.parent.refreshHeader();break;case"enableLazyLoading":this.parent.freezeRefresh()}}},e.prototype.updateGroupedColumn=function(e){for(var t=0;t<this.groupSettings.columns.length;t++)this.parent.getColumnByField(this.groupSettings.columns[t]).visible=e},e.prototype.updateButtonVisibility=function(e,t){for(var i=[].slice.call(this.element.querySelectorAll("."+t)),r=0;r<i.length;r++)i[r].style.display=e?"":"none"},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.parent.isDestroyed||this.parent.refreshing||this.clearGrouping(),this.removeEventListener(),this.refreshToggleBtn(!0),t.remove(this.element))},e.prototype.clearGrouping=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns));this.contentRefresh=!1;for(var t=0,i=e.length;t<i;t++)t===i-1&&(this.contentRefresh=!0),this.ungroupColumn(e[t]);this.contentRefresh=!0},e.prototype.getModuleName=function(){return"group"},e.prototype.refreshSortIcons=function(e){var i,r=this.parent,n=r.sortSettings.columns,o=r.groupSettings.columns,s=this.parent.getColumns().map(function(e){return e.field});this.refreshToggleBtn();for(var l=0,a=n.length;l<a;l++)-1!==s.indexOf(n[l].field)&&(i=r.getColumnHeaderByField(n[l].field),!r.allowSorting&&(this.sortedColumns.indexOf(n[l].field)>-1||this.groupSettings.columns.indexOf(n[l].field)>-1)?(t.classList(i.querySelector(".e-sortfilterdiv"),["e-ascending","e-icon-ascending"],[]),n.length>1&&i.querySelector(".e-headercelldiv").appendChild(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(l+1).toString()}))):this.getGHeaderCell(n[l].field)&&this.getGHeaderCell(n[l].field).querySelectorAll(".e-groupsort").length&&("Ascending"===n[l].direction?t.classList(this.getGHeaderCell(n[l].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):t.classList(this.getGHeaderCell(n[l].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])));for(var l=0,a=o.length;l<a;l++)-1!==s.indexOf(o[l])&&r.getColumnHeaderByField(o[l]).setAttribute("aria-grouped","true")},e.prototype.getGHeaderCell=function(e){return this.element&&this.element.querySelector('[ej-mappingname="'+e+'"]')?this.element.querySelector('[ej-mappingname="'+e+'"]').parentElement:null},e.prototype.onGroupAggregates=function(e){var t=this.iterateGroupAggregates(e),i=this.groupGenerator.generateRows(t,{}),r=this.parent.getRowsObject().filter(function(e){return!e.isDataRow}),n=i.filter(function(e){return!e.isDataRow});this.parent.isReact&&this.parent.destroyTemplate(["groupFooterTemplate","groupCaptionTemplate","footerTemplate"]);for(var o=0;o<n.length;o++){var s=n[o],l={cells:s.cells.filter(function(e){return e.isDataCell}),data:s.data,dataUid:r[o]?r[o].uid:""};this.parent.notify("refresh-aggregate-cell",l)}},e.prototype.iterateGroupAggregates=function(e){var t=e instanceof Array?e:[],r=this.parent.getRowsObject(),n=this.parent.getCurrentViewRecords(),o=[],s=r.map(function(e){return"delete"===e.edit&&o.push(e.data),e.changes instanceof Object?e.changes:e.data}),l=this.parent.getPrimaryKeyFieldNames()[0];s=0===t.length?s:t;var a=n.map(function(e){var t,r=i.DataUtil.getObject(l,e);return s.some(function(e){return t=e,r===i.DataUtil.getObject(l,e)})?t:e}),h=e;if((!h.type||"cancel"!==h.type)&&o.length>0)for(var d=0;d<o.length;d++){var p=a.indexOf(o[d]);a.splice(p,1)}for(var c=[],u=this.parent.aggregates,g=0;g<u.length;g++)for(var f=u[g],m=0;m<f.columns.length;m++){var y={};y={type:f.columns[m].type.toString().toLowerCase(),field:f.columns[m].field},c.push(y)}for(var v,C,w=this.parent.groupSettings.columns,b=0;b<w.length;b++)C=v||a,v=i.DataUtil.group(C,w[b],c,null,null);return v},e.prototype.updateExpand=function(e){for(var i=e.uid,r=e.isExpand,n=this.parent.getRowsObject(),o=0;o<n.length;o++){var s=n[o];if(s.uid===i||t.isNullOrUndefined(i)){s.isExpand=r;for(var l=o+1;l<n.length&&"break"!==function(e){var r=n[e],o=void 0;if(r.parentUid!==s.uid&&(o=n.filter(function(e){return e.uid===r.parentUid})[0]),r.parentUid===s.uid?r.visible=s.isExpand:t.isNullOrUndefined(o)||r.parentUid!==o.uid||(o.isExpand&&!0===o.visible?r.visible=!0:o.isExpand&&!1===o.visible&&(r.visible=!1)),t.isNullOrUndefined(i))return"break"}(l);l++);}}this.parent.notify(Mt,{rows:n,args:{isFrozen:!1,rows:n}})},e}(),Tn=function(){function i(e,t){this.aria=new Ei,this.parent=e,this.parent.isDestroyed||(this.focus=t.getService("focus"),this.parent.on(Ht,this.clickHandler,this),this.parent.on(Ut,this.destroy,this),this.parent.on(qt,this.keyPressHandler,this),this.parent.on(ni,this.expand,this),this.parent.on(jt,this.refreshColSpan,this))}return i.prototype.clickHandler=function(e){this.toogleExpandcollapse(t.closest(e.target,"td"))},i.prototype.toogleExpandcollapse=function(i){var r,n=this.parent,o=this.parent.getContentTable(),s=this.parent.getCurrentViewRecords().length-1,l=i&&i.classList.contains("e-detailrowcollapse");if(i&&(i.classList.contains("e-detailrowcollapse")||i.classList.contains("e-detailrowexpand"))){if(t.isBlazor()&&this.parent.isServerRendered)return void this.parent.notify("detailclick",i);var a=i.parentElement,h=a.getAttribute("data-uid"),d=n.getRowObjectFromUID(h),p=this.parent.getContentTable().querySelector("tbody").children[a.rowIndex+1];if(i.classList.contains("e-detailrowcollapse")){var c=d.data;if(this.isDetailRow(p))p.style.display="",n.notify("detail-state-change",{data:c,childGrid:n.childGrid,detailElement:i,isExpanded:l});else if(n.getDetailTemplate()||n.childGrid){var u=N("grid-row"),g=this.parent.createElement("tr",{className:"e-detailrow",attrs:{"data-uid":u}}),f=this.parent.createElement("td",{className:"e-detailcell"}),m=this.parent.getVisibleColumns().length;this.parent.allowRowDragAndDrop&&m++,f.setAttribute("colspan",m.toString());for(var y=new fi({isDataRow:!0,isExpand:!0,uid:u,isDetailRow:!0,cells:[new mi({cellType:e.CellType.Indent}),new mi({isDataCell:!0,visible:!0})]}),v=0,C=n.groupSettings.columns.length;v<C;v++)g.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),y.cells.unshift(new mi({cellType:e.CellType.Indent}));if(g.appendChild(this.parent.createElement("td",{className:"e-detailindentcell"})),g.appendChild(f),a.parentNode.insertBefore(g,a.nextSibling),n.detailTemplate){var w=this.parent.isReact&&"string"!=typeof n.detailTemplate,b=n.element.id+"detailTemplate";w?(n.getDetailTemplate()(c,n,"detailTemplate",b,null,null,f),this.parent.renderTemplates()):q(f,n.getDetailTemplate()(c,n,"detailTemplate",b)),t.isBlazor()&&t.updateBlazorTemplate(b,"DetailTemplate",n,!1)}else{(r=new Wr(this.getGridModel(n,d,n.printMode))).query&&(r.query=r.query.clone()),r.parentDetails={parentID:n.element.id,parentPrimaryKeys:n.getPrimaryKeyFieldNames(),parentKeyField:n.childGrid.queryString,parentKeyFieldValue:c[n.childGrid.queryString],parentRowData:c},r.isLegacyTemplate=n.isReact||n.isLegacyTemplate,n.isPrinting&&(r.isPrinting=!0,r.on(Mt,this.promiseResolve(r),this),r.on(Ot,this.promiseResolve(r),this)),d.childGrid=r;var S=r.getInjectedModules(),x=n.getInjectedModules();S&&S.length===x.length||r.setInjectedModules(x);var R=this.parent.createElement("div",{id:"child"+H(a,"e-grid").length+"_grid"+a.rowIndex+N("")});f.appendChild(R),r.appendTo(R)}g.appendChild(f),a.nextSibling?a.parentNode.insertBefore(g,a.nextSibling):a.parentNode.appendChild(g),n.getRows().splice(a.rowIndex+1,0,g),n.getRowsObject().splice(d.index+1,0,y),n.trigger("detailDataBound",{detailElement:f,data:c,childGrid:r}),n.notify("detailDataBound",{rows:n.getRowsObject()})}if(t.classList(i,["e-detailrowexpand"],["e-detailrowcollapse"]),t.classList(i.firstElementChild,["e-dtdiagonaldown","e-icon-gdownarrow"],["e-dtdiagonalright","e-icon-grightarrow"]),d.isExpand=!0,i.classList.contains("e-lastrowcell")&&this.parent.getContent().clientHeight>o.scrollHeight){t.removeClass(i.parentElement.querySelectorAll("td"),"e-lastrowcell");var F=o.querySelector("tbody").querySelectorAll(".e-detailrow").length-1;t.addClass(o.querySelector("tbody").querySelectorAll(".e-detailrow")[F].childNodes,["e-lastrowcell"]),this.lastrowcell=!0}this.aria.setExpand(i,!0)}else this.isDetailRow(p)&&(p.style.display="none",n.notify("detail-state-change",{data:d.data,childGrid:n.childGrid,detailElement:i,isExpanded:l})),t.classList(i,["e-detailrowcollapse"],["e-detailrowexpand"]),t.classList(i.firstElementChild,["e-dtdiagonalright","e-icon-grightarrow"],["e-dtdiagonaldown","e-icon-gdownarrow"]),parseInt(a.getAttribute("aria-rowindex"),10)===s&&this.lastrowcell&&(t.addClass(i.parentElement.querySelectorAll("td"),"e-lastrowcell"),this.lastrowcell=!1),d.isExpand=!1,this.aria.setExpand(i,!1)}},i.prototype.getGridModel=function(e,t,i){var r;return e.isPrinting&&t.isExpand&&e.expandedRows&&e.expandedRows[t.index]&&e.expandedRows[t.index].gridModel?(e.expandedRows[t.index].gridModel.hierarchyPrintMode=e.childGrid.hierarchyPrintMode,r=e.expandedRows[t.index].gridModel):e.isPrinting&&e.childGrid.allowPaging?(e.childGrid.allowPaging="CurrentPage"===i,r=e.childGrid):r=e.childGrid,r},i.prototype.promiseResolve=function(e){var t=this;return function(){e.off(Mt,t.promiseResolve),e.off(Ot,t.promiseResolve),e.notify(ri,{})}},i.prototype.isDetailRow=function(e){return e&&e.classList.contains("e-detailrow")},i.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.parent.off(Ht,this.clickHandler),this.parent.off(Ut,this.destroy),this.parent.off(qt,this.keyPressHandler),this.parent.off(ni,this.expand),this.parent.off(jt,this.refreshColSpan))},i.prototype.getTDfromIndex=function(e,t){var i=this.parent.getDataRows()[e];return i&&i.querySelector(t)?i.querySelector(t):null},i.prototype.expand=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowcollapse")),e&&e.classList.contains("e-detailrowcollapse")&&this.toogleExpandcollapse(e)},i.prototype.collapse=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowexpand")),e&&e.classList.contains("e-detailrowexpand")&&this.toogleExpandcollapse(e)},i.prototype.expandAll=function(){this.expandCollapse(!0),this.parent.trigger(vt,{requestType:"expandAllComplete",type:vt,moduleObj:this})},i.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(vt,{requestType:"collapseAllComplete",type:vt,moduleObj:this})},i.prototype.expandCollapse=function(e){for(var t,i=this.parent.getDataRows(),r=0,n=i.length;r<n;r++)t=i[r].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),e?this.expand(t):this.collapse(t)},i.prototype.keyPressHandler=function(e){var t=this.parent;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"altUpArrow":case"altDownArrow":var i=t.allowSelection?t.getSelectedRowIndexes():[];if(i.length){var r=t.getDataRows()[i[i.length-1]].querySelector(".e-detailrowcollapse, .e-detailrowexpand");"altDownArrow"===e.action?this.expand(r):this.collapse(r)}break;case"enter":if(this.parent.isEdit)return;var n=this.focus.getFocusedElement();if(!e.target.classList.contains("e-detailrowcollapse")&&!e.target.classList.contains("e-detailrowexpand"))break;this.toogleExpandcollapse(n)}},i.prototype.refreshColSpan=function(){for(var e=this.parent.contentModule.getTable().querySelectorAll("tr.e-detailrow"),t=this.parent.getVisibleColumns().length,i=0;i<e.length;i++)e[i].querySelector(".e-detailcell").setAttribute("colspan",t+"")},i.prototype.getModuleName=function(){return"detailRow"},i}(),En=function(){function i(e,t){this.predefinedItems={},this.items=["Add","Edit","Update","Delete","Cancel","Print","Search","ColumnChooser","PdfExport","ExcelExport","CsvExport","WordExport"],this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return i.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization");for(var e=0,t=["Add","Edit","Update","Delete","Cancel","Print","PdfExport","ExcelExport","WordExport","CsvExport"];e<t.length;e++){var i=t[e],r=i.toLowerCase(),n=r[0].toUpperCase()+r.slice(1);this.predefinedItems[i]={id:this.gridID+"_"+r,prefixIcon:"e-"+r,text:this.parent.enableAdaptiveUI?"":this.l10n.getConstant(n),tooltipText:this.l10n.getConstant(n)}}this.predefinedItems.Search={id:this.gridID+"_search",tooltipText:this.l10n.getConstant("Search"),align:"Right",cssClass:"e-search-wrapper",type:"Input"},this.predefinedItems.ColumnChooser={id:this.gridID+"_columnchooser",cssClass:"e-cc e-ccdiv e-cc-toolbar",suffixIcon:"e-columnchooser-btn",text:this.l10n.getConstant("Columnchooser"),tooltipText:this.l10n.getConstant("Columnchooser"),align:"Right"},"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&(this.predefinedItems.responsiveFilter={id:this.gridID+"_responsivefilter",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resfilter-icon",tooltipText:this.l10n.getConstant("FilterButton")}),this.parent.allowSorting&&(this.predefinedItems.responsiveSort={id:this.gridID+"_responsivesort",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-ressort-icon",tooltipText:this.l10n.getConstant("Sort")})),this.parent.enableAdaptiveUI&&this.parent.toolbar.indexOf("Search")>-1&&(this.predefinedItems.responsiveBack={id:this.gridID+"_responsiveback",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resback-icon"}),this.createToolbar()},i.prototype.getToolbar=function(){return this.toolbar.element},i.prototype.destroy=function(){this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.element?(this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.toolbar.destroy()):(this.parent.destroyTemplate(["toolbarTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),this.unWireEvent(),this.removeEventListener(),t.remove(this.element))},i.prototype.bindSearchEvents=function(){this.searchElement=t.select("#"+this.gridID+"_searchbar",this.element),this.wireEvent(),this.refreshToolbarItems(),this.parent.searchSettings&&this.updateSearchBox()},i.prototype.toolbarCreated=function(e){this.element.querySelector(".e-search-wrapper")&&(!this.parent.enableAdaptiveUI||e?this.element.querySelector(".e-search-wrapper").innerHTML='<div class="e-input-group e-search" role="search"> <input id="'+this.gridID+'_searchbar" class="e-input" name="input" type="search" placeholder= "'+this.l10n.getConstant("Search")+'"/> <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" title="'+this.l10n.getConstant("Search")+'" aria-label= "search"></span> </div>':this.element.querySelector(".e-search-wrapper").innerHTML='<span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" title="'+this.l10n.getConstant("Search")+'" aria-label= "search"></span> </div>'),this.bindSearchEvents()},i.prototype.createToolbar=function(){var e=this.getResponsiveToolbarItems(this.getItems());this.toolbar=new a.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,created:this.toolbarCreated.bind(this)}),this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this);this.toolbar.isStringTemplate=!0;var i="viewContainerRef";if(this.parent[i]&&(this.toolbar.registeredTemplate={},this.toolbar[i]=this.parent[i]),this.element=this.parent.createElement("div",{id:this.gridID+"_toolbarItems"}),this.parent.enableAdaptiveUI&&(this.toolbar.overflowMode="Popup",this.element.classList.add("e-res-toolbar")),this.parent.toolbarTemplate)if(t.isBlazor()||"string"!=typeof this.parent.toolbarTemplate)if(t.isBlazor()){var r=this.parent.element.id+"toolbarTemplate",n=q(this.element,R(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",r)),o=this.getItem(n);this.toolbar.items.push(o),this.toolbar.appendTo(this.element),t.updateBlazorTemplate(this.parent.element.id+"toolbarTemplate","ToolbarTemplate",this.parent)}else{var s=this.parent.isReact&&"string"!=typeof this.parent.toolbarTemplate,l=this.parent.element.id+"toolbarTemplate";s?(R(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",l,null,null,this.element),this.parent.renderTemplates()):q(this.element,R(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate"))}else this.toolbar.appendTo(this.parent.toolbarTemplate),this.element=this.toolbar.element;else this.toolbar.appendTo(this.element);this.parent.element.insertBefore(this.element,this.parent.getHeaderContent())},i.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},i.prototype.renderResponsiveSearch=function(i){if(i)this.toolbarCreated(!0),this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isSearch),this.searchElement=t.select("#"+this.gridID+"_searchbar",this.element),(r=O(this.searchElement,"e-toolbar-right")).classList.add("e-responsive-right"),this.parent.searchSettings&&this.updateSearchBox(),this.searchBoxObj.searchFocus({target:this.searchElement}),this.searchElement.focus();else{var r=O(this.searchElement,"e-toolbar-right");r.classList.remove("e-responsive-right"),this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isInitial),this.toolbarCreated(!1),this.unWireEvent(),this.searchElement=void 0}},i.prototype.getResponsiveToolbarItems=function(e){if(this.parent.enableAdaptiveUI)for(var t=0;t<e.length;t++)e[t].visible=e[t].id===this.parent.element.id+"_add"||e[t].id===this.parent.element.id+"_search"||e[t].id===this.parent.element.id+"_responsivesort"||e[t].id===this.parent.element.id+"_responsivefilter";return e},i.prototype.refreshResponsiveToolbarItems=function(t){var i=this.toolbar.items,r=["add","search","responsivesort","responsivefilter"];this.parent.getSelectedRowIndexes().length&&(r.push("edit","delete"),"Vertical"!==this.parent.rowRenderingMode&&r.push("update","cancel"));for(var n=["responsiveback","search"],o=t===e.ResponsiveToolbarAction.isInitial?r:n,s=0;s<i.length;s++){var l=i[s].id.split("_"),a=this.element.querySelector("#"+i[s].id);if(a){var h=O(a,"e-toolbar-item");o.indexOf(l[1])>-1?h.classList.remove("e-hidden"):h.classList.add("e-hidden")}}return i},i.prototype.refreshToolbarItems=function(e){var t=this.parent,i=[],r=[],n=t.editSettings,o=t.currentViewData&&t.currentViewData.length;n.allowAdding?i.push(this.gridID+"_add"):r.push(this.gridID+"_add"),n.allowEditing&&o?i.push(this.gridID+"_edit"):r.push(this.gridID+"_edit"),n.allowDeleting&&o?i.push(this.gridID+"_delete"):r.push(this.gridID+"_delete"),"Batch"===t.editSettings.mode?t.element.querySelectorAll(".e-updatedtd").length&&(n.allowAdding||n.allowEditing)?(i.push(this.gridID+"_update"),i.push(this.gridID+"_cancel")):(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")):t.isEdit&&(n.allowAdding||n.allowEditing)?(i=[this.gridID+"_update",this.gridID+"_cancel"],r=[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")),this.enableItems(i,!0),this.enableItems(r,!1)},i.prototype.getItems=function(){var e=[],t=this.parent.toolbar||[];if("string"==typeof this.parent.toolbar)return[];for(var i=0,r=t;i<r.length;i++){var n=r[i];switch(typeof n){case"number":e.push(this.getItemObject(this.items[n]));break;case"string":e.push(this.getItemObject(n));break;default:e.push(this.getItem(n))}}return"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&e.push(this.getItemObject("responsiveFilter")),this.parent.allowSorting&&e.push(this.getItemObject("responsiveSort"))),this.parent.enableAdaptiveUI&&e.push(this.getItemObject("responsiveBack")),e},i.prototype.getItem=function(e){var i=this.predefinedItems[e.text];return i?t.extend(i,i,e):e},i.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.gridID+"_"+e}},i.prototype.enableItems=function(e,i){for(var r=0,n=e;r<n.length;r++){var o=n[r],s=t.select("#"+o,this.element);s&&this.toolbar.enableItems(s.parentElement,i)}},i.prototype.toolbarClickHandler=function(e){var i=this,r=this.parent,n=this.gridID;t.extend(e,{cancel:!1});var o=!t.isBlazor()||this.parent.isJsComponent?e:{item:e.item,cancel:e.cancel,name:e.name},s=e.originalEvent;r.trigger("toolbarClick",o,function(e){if(e.originalEvent=e.originalEvent?e.originalEvent:s,!e.cancel)switch(!t.isNullOrUndefined(e.item)&&e.item.id){case n+"_print":r.print();break;case n+"_edit":r.startEdit();break;case n+"_update":r.endEdit();break;case n+"_cancel":r.closeEdit();break;case n+"_add":r.addRecord();break;case n+"_delete":r.deleteRecord();break;case n+"_search":e.originalEvent.target.id===n+"_searchbutton"&&i.searchElement?i.search():!r.enableAdaptiveUI||i.searchElement||!e.originalEvent.target.classList.contains("e-search-wrapper")&&e.originalEvent.target.id!==n+"_searchbutton"||i.renderResponsiveSearch(!0);break;case n+"_columnchooser":var o=i.parent.element.querySelector(".e-ccdiv"),l=o.getBoundingClientRect().top,a=o.getBoundingClientRect().left,h=e.originalEvent.target;l=o.getBoundingClientRect().top+o.offsetTop,r.createColumnchooser(a,l,h);break;case"copy":t.isBlazor()&&r.copy();break;case"copyheader":case"copyHeader":t.isBlazor()&&r.copy(!0);break;case n+"_responsivefilter":r.showResponsiveCustomFilter();break;case n+"_responsivesort":r.showResponsiveCustomSort();break;case n+"_responsiveback":i.renderResponsiveSearch(!1)}})},i.prototype.modelChanged=function(e){"edit"===e.module&&this.refreshToolbarItems()},i.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&this.parent.toolbar&&(this.element&&t.remove(this.element),this.render())},i.prototype.keyUpHandler=function(e){13===e.keyCode&&this.search()},i.prototype.search=function(){this.parent.search(this.searchElement.value)},i.prototype.updateSearchBox=function(){this.searchElement&&(this.searchElement.value=this.parent.searchSettings.key)},i.prototype.wireEvent=function(){this.searchElement&&(this.searchBoxObj=new pr(this.searchElement),t.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent())},i.prototype.unWireEvent=function(){this.searchElement&&(t.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),this.searchBoxObj.unWireEvent())},i.prototype.reRenderToolbar=function(){this.element&&t.remove(this.element),this.render()},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("set-fullscreen-dialog",this.reRenderToolbar,this),this.parent.on(Tt,this.render,this),this.parent.on(Dt,this.onPropertyChanged,this),this.parent.on(At,this.updateSearchBox.bind(this)),this.parent.on(Bt,this.refreshToolbarItems,this),this.parent.on(Xt,this.refreshToolbarItems,this),this.parent.on(At,this.modelChanged,this),this.parent.on(Ct,this.refreshToolbarItems,this),this.parent.on(Ht,this.removeResponsiveSearch,this),this.parent.on("row-mode-change",this.reRenderToolbar,this),this.rowSelectedFunction=this.rowSelected.bind(this),this.rowDeSelectedFunction=this.rowSelected.bind(this),this.parent.addEventListener("rowSelected",this.rowSelectedFunction),this.parent.addEventListener("rowDeselected",this.rowDeSelectedFunction))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("set-fullscreen-dialog",this.reRenderToolbar),this.parent.off(Tt,this.render),this.parent.off(Dt,this.onPropertyChanged),this.parent.off(At,this.updateSearchBox),this.parent.off(Bt,this.refreshToolbarItems),this.parent.off(Xt,this.refreshToolbarItems),this.parent.off(At,this.modelChanged),this.parent.off(Ct,this.refreshToolbarItems),this.parent.off(Ht,this.removeResponsiveSearch),this.parent.off("row-mode-change",this.reRenderToolbar),this.parent.removeEventListener("rowSelected",this.rowSelectedFunction),this.parent.removeEventListener("rowDeselected",this.rowDeSelectedFunction))},i.prototype.removeResponsiveSearch=function(e){var t=e.target,i=t.classList.contains("e-search-icon")||t.classList.contains("e-search-wrapper");this.parent.enableAdaptiveUI&&!i&&this.searchElement&&!O(e.target,"e-res-toolbar")&&this.renderResponsiveSearch(!1)},i.prototype.rowSelected=function(){this.parent.enableAdaptiveUI&&this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isInitial)},i.prototype.getModuleName=function(){return"toolbar"},i}(),Mn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dn=function(e){function r(t,i){var r=e.call(this,t,i)||this;return r.aggregates={},r.parent=t,r.locator=i,r.modelGenerator=new bi(r.parent),r.addEventListener(),r}return Mn(r,e),r.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:"e-gridfooter"}),i=this.parent.createElement("div",{className:"e-summarycontent"}),r=i;if(this.parent.isFrozenGrid()){var n=this.parent.createElement("div",{className:"e-frozenfootercontent e-frozen-left-footercontent"}),o=this.parent.createElement("div",{className:"e-movablefootercontent"}),s=this.parent.createElement("div",{className:"e-frozenfootercontent e-frozen-right-footercontent"});(this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount())&&(i.appendChild(n),this.frozenContent=n),i.appendChild(o),this.movableContent=o,r=o,this.parent.getFrozenRightColumnsCount()&&(i.appendChild(s),this.frozenRightContent=s)}t.Browser.isDevice&&(r.style.overflowX="scroll"),e.appendChild(i),this.setPanel(e),null!=this.parent.getPager()?this.parent.element.insertBefore(e,this.parent.getPager()):this.parent.element.appendChild(e)},r.prototype.renderTable=function(){var e=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount(),i=this.createContentTable("_footer_table").querySelector(".e-table"),r=this.parent.createElement("tfoot");if(i.appendChild(r),this.parent.isFrozenGrid()){var n=i.cloneNode(!0),o=i.cloneNode(!0);if(e&&(this.frozenContent.appendChild(n),this.freezeTable=n),this.parent.getFrozenRightColumnsCount()){t.remove(o.querySelector("colgroup"));var s=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("colgroup").cloneNode(!0);o.insertBefore(s,o.querySelector("tbody")),this.frozenRightContent.appendChild(o),this.frTable=o}this.movableContent.appendChild(i),t.remove(i.querySelector("colgroup"));var l=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").cloneNode(!0);i.insertBefore(l,i.querySelector("tbody")),this.setColGroup(l)}this.setTable(i)},r.prototype.renderSummaryContent=function(e,i,r,n){var o=this.parent.dataSource instanceof Array?this.parent.dataSource:this.parent.currentViewData,s=this.modelGenerator.getData(),l=t.isNullOrUndefined(r)?this.modelGenerator.getColumns():this.modelGenerator.getColumns(r,n),a=t.isNullOrUndefined(r)?this.modelGenerator.generateRows(o,e||this.aggregates):this.modelGenerator.generateRows(o,e||this.aggregates,r,n),h=document.createDocumentFragment(),d=new vi(this.locator,null,this.parent);d.element=this.parent.createElement("TR",{className:"e-summaryrow"});for(var p=0,c=s.length;p<c;p++){var u=a[p];if(u){var g=d.render(u,l);h.appendChild(g)}}i.tFoot.appendChild(h),this.aggregates=t.isNullOrUndefined(e)?this.aggregates:e},r.prototype.refresh=function(e){var i=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount(),r=this.parent.getMovableColumnsCount(),n=this.parent.getFrozenRightColumnsCount();if(this.parent.isFrozenGrid()&&(t.remove(this.getPanel()),this.renderPanel(),this.renderTable(),i&&(this.freezeTable.tFoot.innerHTML="",this.renderSummaryContent(e,this.freezeTable,0,i))),this.getTable().tFoot.innerHTML="",this.renderSummaryContent(e,this.getTable(),i,n?i+r:void 0),this.parent.getFrozenRightColumnsCount()){this.frTable.tFoot.innerHTML="",this.renderSummaryContent(e,this.frTable,i+r,i+r+n);var o=[].slice.call(this.getTable().querySelectorAll(".e-lastsummarycell"));if(o.length)for(var s=0;s<o.length;s++)o[s].style.borderRight="0px"}if(this.parent.isFrozenGrid()){var l=[].slice.call(this.parent.element.querySelector(".e-movablefootercontent").querySelectorAll(".e-summaryrow")),a=void 0;if(i){a=[].slice.call(this.parent.element.querySelector(".e-frozen-left-footercontent").querySelectorAll(".e-summaryrow")),this.refreshHeight(a,l);var h=this.frozenContent;h.offsetHeight||(h.style.height=this.getTable().offsetHeight+"px")}if(n){var d=[].slice.call(this.parent.element.querySelector(".e-frozen-right-footercontent").querySelectorAll(".e-summaryrow"));this.refreshHeight(d,l),a&&this.refreshHeight(d,a);var p=this.frTable;p.offsetHeight||(p.style.height=this.getTable().offsetHeight+"px")}this.parent.allowResizing&&this.updateFooterTableWidth(this.getTable())}this.onScroll()},r.prototype.refreshHeight=function(e,t){for(var i=0;i<e.length;i++){var r=e[i].getBoundingClientRect().height,n=t[i].getBoundingClientRect().height;r<n?(e[i].classList.remove("e-hide"),e[i].style.height=n+"px"):r>n&&(t[i].classList.remove("e-hide"),t[i].style.height=r+"px")}},r.prototype.refreshCol=function(){var e,t=e=this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0);this.parent.getFrozenColumns()&&(this.parent.enableColumnVirtualization&&this.parent.contentModule.isXaxis()?e=this.parent.getMovableVirtualHeader().querySelector("colgroup").cloneNode(!0):(e=de(t,this.parent.getFrozenColumns(),this.parent),this.freezeTable.replaceChild(t,this.freezeTable.querySelector("colGroup")))),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},r.prototype.onWidthChange=function(e){this.getColFromIndex(e.index).style.width=t.formatUnit(e.width),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},r.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.isFrozenGrid()?this.parent.getContent().querySelector(".e-movablecontent").scrollLeft:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},r.prototype.getColFromIndex=function(e){var t=this.parent.getFrozenColumns();return t=t&&this.parent.isRowDragable()?t+1:t,t&&t>e?this.freezeTable.querySelector("colGroup").children[e]:this.getColGroup().children[e-t]},r.prototype.columnVisibilityChanged=function(){this.refresh()},r.prototype.addEventListener=function(){this.parent.on(kt,this.refreshCol,this),this.parent.on("column-width-changed",this.onWidthChange,this),this.parent.on("scroll",this.onScroll,this),this.parent.on(jt,this.columnVisibilityChanged,this),this.parent.on("refresh-footer-rendered",this.refreshFooterRenderer,this)},r.prototype.removeEventListener=function(){this.parent.off(kt,this.refreshCol),this.parent.off("column-width-changed",this.onWidthChange),this.parent.off("scroll",this.onScroll),this.parent.off(jt,this.columnVisibilityChanged),this.parent.off("refresh-footer-rendered",this.refreshFooterRenderer)},r.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},r.prototype.refreshFooterRenderer=function(e){var t=this.onAggregates(e);this.refresh(t)},r.prototype.getIndexByKey=function(e,t){for(var i=this.parent.getPrimaryKeyFieldNames()[0],r=0;r<t.length;r++)if(t[r][i]===e[i])return r;return-1},r.prototype.onAggregates=function(e){e=e instanceof Array?e:[];var t=this.parent.getPrimaryKeyFieldNames()[0],r=[],n=!1,o={},s=this.parent.dataSource instanceof Array?this.parent.dataSource:this.parent.dataSource.dataSource.json.length?this.parent.dataSource.dataSource.json:this.parent.getCurrentViewRecords();if(this.parent.editModule&&(o=this.parent.editModule.getBatchChanges()),Object.keys(o).length){for(p=0;p<s.length;p++)n=!1,o.changedRecords.length&&this.getIndexByKey(s[p],o.changedRecords)>-1&&(n=!0,r.push(o.changedRecords[this.getIndexByKey(s[p],o.changedRecords)])),o.deletedRecords.length&&this.getIndexByKey(s[p],o.deletedRecords)>-1?n=!0:n||r.push(s[p]);if(o.addedRecords.length)for(p=0;p<o.addedRecords.length;p++)r.push(o.addedRecords[p])}else r=e.length?x(s).map(function(r){var n,o=i.DataUtil.getObject(t,r);return e.some(function(e){return n=e,o===i.DataUtil.getObject(t,e)})?n:r}):s;var l=e;l.type&&"cancel"===l.type&&(r=s);for(var a,h={},d=this.parent.aggregates,p=0;p<d.length;p++)for(var c=0;c<d[p].columns.length;c++){var u=d[p].columns[c].type.toString();a=U(u,r,d[p].columns[c],this.parent),h[d[p].columns[c].field+" - "+u.toLowerCase()]=a}return{result:r,count:r.length,aggregates:h}},r}(zi),On=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),An=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-summarycell",attrs:{role:"gridcell",tabindex:"-1"}}),t}return On(i,e),i.prototype.getValue=function(e,i,r){var n;return n=t.isNullOrUndefined(r.type)?r.columnName:r.field+" - "+("string"==typeof r.type?r.type.toLowerCase():""),i[r.columnName]?i[r.columnName][n]:""},i.prototype.evaluate=function(e,i,r,n){var o=i.column;if(this.parent.on("refresh-aggregate-cell",this.refreshWithAggregate(e,i),this),!(o.footerTemplate||o.groupFooterTemplate||o.groupCaptionTemplate))return"Vertical"===this.parent.rowRenderingMode&&(e.style.display="none"),!0;"Vertical"===this.parent.rowRenderingMode&&e.classList.add("e-lastsummarycell");var s=o.getTemplate(i.cellType),l="",a=this.parent.getColumnByField(r[o.columnName].field);if(!t.isNullOrUndefined(a)&&(r[o.columnName].headerText=a.headerText,a.isForeignColumn())){var h=a.columnData.filter(function(e){return e[a.foreignKeyField]===r[o.columnName].key})[0];h&&(r[o.columnName].foreignKey=h[a.foreignKeyValue])}if(t.isBlazor()){l=this.parent.element.id+o.guid+s.property}if(this.parent.isReact&&(o.footerTemplate?"string"!=typeof o.footerTemplate:o.groupFooterTemplate?"string"!=typeof o.groupFooterTemplate:!!o.groupCaptionTemplate&&"string"!=typeof o.groupCaptionTemplate)){var d=r[o.columnName];if("groupCaptionTemplate"===s.property||"groupFooterTemplate"===s.property){d.groupKey=d.key}s.fn(d,this.parent,s.property,l,null,null,e),this.parent.renderTemplates()}else q(e,s.fn(r[o.columnName],this.parent,s.property,l));return!1},i.prototype.refreshWithAggregate=function(e,i){var r=this,n=i;return function(i){var o=n,s=o.column.columnName?o.column.columnName:null,l=t.isNullOrUndefined(s)?null:i.cells.filter(function(e){return e.column.columnName===s})[0];e.parentElement&&e.parentElement.getAttribute("data-uid")===i.dataUid&&s&&s===l.column.columnName&&r.refreshTD(e,l,i.data)}},i}(Ti),Bn=function(){function i(e,t){this.parent=e,this.locator=t,this.addEventListener()}return i.prototype.getModuleName=function(){return"aggregate"},i.prototype.initiateRender=function(){for(var i=this,r=this.locator.getService("cellRendererFactory"),n=new An(this.parent,this.locator),o=[e.CellType.Summary,e.CellType.CaptionSummary,e.CellType.GroupSummary],s=0;s<o.length;s++)r.addCellRenderer(o[s],n);this.footerRenderer=new Dn(this.parent,this.locator),this.footerRenderer.renderPanel(),this.footerRenderer.renderTable();var l=this.footerRenderer.getPanel();this.parent.element.scrollHeight>=this.parent.getHeight(this.parent.height)&&l&&t.addClass([l],["e-footerpadding"]),this.locator.register("footerRenderer",this.footerRenderer);var a=function(){i.prepareSummaryInfo(),i.parent.off(Et,a)};this.parent.on(Et,a,this),this.parent.on(Et,this.footerRenderer.refresh,this.footerRenderer)},i.prototype.prepareSummaryInfo=function(){var e=this;if(Je(this.parent.aggregates,function(i){e.parent.getColumnByField(i.field);if(t.isNullOrUndefined(i.customFormat)||i.setPropertiesSilent({format:i.customFormat}),"object"==typeof i.format){var r=new ut;i.setFormatter(r.getFormatFunction(t.extend({},i.format)))}else if("string"==typeof i.format){var n=e.locator.getService("valueFormatter");i.setFormatter(n.getFormatFunction({format:i.format}))}i.setPropertiesSilent({columnName:i.columnName||i.field})}),t.isBlazor()&&this.parent.isServerRendered)for(var i=Object.keys(this.parent.bulkChanges),r=0;r<i.length;r++)i[r].startsWith("aggregates")&&delete this.parent.bulkChanges[i[r]]},i.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){t.isNullOrUndefined(this.footerRenderer)&&this.initiateRender(),this.prepareSummaryInfo(),this.footerRenderer.refresh();var i=new xi(this.parent);0===new Si(this.parent).getData().length&&i.isEmpty()||this.parent.notify(Bt,{})}},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Tt,this.initiateRender,this),this.parent.on(Dt,this.onPropertyChanged,this),this.parent.on("refresh-aggregates",this.refresh,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.footerRenderer.removeEventListener(),this.parent.off(Tt,this.initiateRender),this.parent.off(Et,this.footerRenderer.refresh),this.parent.off(Dt,this.onPropertyChanged),this.parent.off("refresh-aggregates",this.refresh))},i.prototype.destroy=function(){this.removeEventListener(),t.remove(this.parent.element.querySelector(".e-gridfooter"))},i.prototype.refresh=function(e){var t=e instanceof Array?e:[e];this.parent.notify("refresh-footer-rendered",t),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",t)},i}(),kn=function(){function e(e,t,i){var r=this;this.fromWheel=!1,this.touchMove=!1,this.options={},this.sentinelInfo={up:{check:function(e,t){var i=e.top-r.containerRect.top;return t.entered=i>=0,i+r.options.pageHeight/2>=0},axis:"Y"},down:{check:function(e,t){r.options.container.clientHeight;var i=e.bottom;return t.entered=e.bottom<=r.containerRect.bottom,i-r.options.pageHeight/2<=r.options.pageHeight/2},axis:"Y"},right:{check:function(e,t){var i=e.right;return r.movableEle?(t.entered=i<r.movableContainerRect.right,i-r.movableContainerRect.width<=r.movableContainerRect.right):(t.entered=i<r.containerRect.right,i-r.containerRect.width<=r.containerRect.right)},axis:"X"},left:{check:function(e,t){var i=e.left;return t.entered=i>0,r.movableEle?i+r.movableContainerRect.width>=r.movableContainerRect.left:i+r.containerRect.width>=r.containerRect.left},axis:"X"}},this.element=e,this.options=t,this.movableEle=i}return e.prototype.observe=function(e,i){var r=this;this.containerRect=this.options.container.getBoundingClientRect(),t.EventHandler.add(this.options.container,"wheel",function(){return r.fromWheel=!0},this),t.EventHandler.add(this.options.container,"scroll",this.virtualScrollHandler(e,i),this),this.options.movableContainer&&(this.movableContainerRect=this.options.movableContainer.getBoundingClientRect(),t.EventHandler.add(this.options.scrollbar,"wheel",function(){return r.fromWheel=!0},this),t.EventHandler.add(this.options.scrollbar,"scroll",this.virtualScrollHandler(e,i),this))},e.prototype.check=function(e){var t=this.sentinelInfo[e];return!this.movableContainerRect||"left"!==e&&"right"!==e?t.check(this.element.getBoundingClientRect(),t):t.check(this.movableEle.getBoundingClientRect(),t)},e.prototype.virtualScrollHandler=function(e,i){var r=this,n="chrome"===t.Browser.info.name?200:100,o=t.debounce(e,n),s=t.debounce(e,50);return this.options.prevTop=this.options.prevLeft=0,function(e){var t=r.options.movableContainer?r.options.container.scrollTop:e.target.scrollTop,n=r.options.movableContainer?r.options.scrollbar.scrollLeft:e.target.scrollLeft,l=r.options.prevTop<t?"down":"up";l=r.options.prevLeft===n?l:r.options.prevLeft<n?"right":"left",r.options.prevTop=t,r.options.prevLeft=n;var a=r.sentinelInfo[l];if(-1!==r.options.axes.indexOf(a.axis)){var h=r.check(l);if(a.entered&&(!r.movableEle||"right"!==l&&"left"!==l?i(r.element,a,l,{top:t,left:n},r.fromWheel,h):i(r.movableEle,a,l,{top:t,left:n},r.fromWheel,h)),h){var d=o;"X"===a.axis&&(d=s),d({direction:l,sentinel:a,offset:{top:t,left:n},focusElement:document.activeElement})}r.fromWheel=!1}}},e.prototype.setPageHeight=function(e){this.options.pageHeight=e},e}(),Ln=function(){function e(e){this.cOffsets={},this.cache={},this.movableCache={},this.frozenRightCache={},this.rowCache={},this.data={},this.groups={},this.parent=e,this.model=this.parent.pageSettings,this.rowModelGenerator=this.parent.allowGrouping?new Fi(this.parent):new Ci(this.parent)}return e.prototype.generateRows=function(e,i){var r=this.parent.isFrozenGrid(),n=i.virtualInfo=i.virtualInfo||this.getData(),o=n.sentinelInfo&&"X"===n.sentinelInfo.axis,s=o||!n.loadNext||n.loadSelf?n.page:n.nextInfo.page,l=[],a=(this.model.pageSize,this.getBlockIndexes(s)),h=[];if((r&&"Left-Right"!==this.parent.getFrozenMode()&&!i.renderMovableContent||"Left-Right"===this.parent.getFrozenMode()&&!i.renderMovableContent&&!i.renderFrozenRightContent||!r)&&this.checkAndResetCache(i.requestType),pe(this.parent)&&this.parent.vcRows.length)return l=this.parent.vcRows;if(this.parent.enableColumnVirtualization)for(c=0;c<n.blockIndexes.length;c++)this.isBlockAvailable(n.blockIndexes[c])&&(this.cache[n.blockIndexes[c]]=this.rowModelGenerator.refreshRows(this.cache[n.blockIndexes[c]])),(i.renderMovableContent&&this.isMovableBlockAvailable(n.blockIndexes[c])||i.renderFrozenRightContent&&this.isFrozenRightBlockAvailable(n.blockIndexes[c]))&&((y=i.renderMovableContent?this.movableCache:this.frozenRightCache)[n.blockIndexes[c]]=this.rowModelGenerator.refreshRows(y[n.blockIndexes[c]]));if(t.isBlazor()&&this.parent.isServerRendered){if(i.virtualStartIndex||0!==Object.keys(this.rowCache).length){if(i.virtualStartIndex){for(var d=i.startIndex,p=[],c=0;c<Object.keys(this.rowCache).length;c++)p.push(Number(Object.keys(this.rowCache)[c]));for(c=0;c<e.length;c++){var u=[],g=p.indexOf(d);u.push(e[c]),-1===g&&(this.rowCache[d]=this.rowModelGenerator.generateRows(u,{startIndex:d})[0]),d++}}}else{for(c=0;c<e.length;c++)(u=[]).push(e[c]),this.rowCache[c]=this.rowModelGenerator.generateRows(u,{startIndex:c})[0];for(var f=0,c=0;c<this.parent.pageSettings.pageSize;c++)l[f]=this.rowCache[c],f++}if(!t.isNullOrUndefined(i.virtualStartIndex))for(var f=0,c=i.startIndex;c<i.endIndex;c++)l[f]=this.rowCache[c],f++}else{for(var m=n.blockIndexes,c=0;c<m.length;c++){if(!this.isBlockAvailable(m[c])){v=this.rowModelGenerator.generateRows(e,{virtualInfo:n,startIndex:this.getStartIndex(m[c],e)});pe(this.parent)&&!this.parent.vcRows.length&&(this.parent.vRows=v,this.parent.vcRows=v,this.parent.notify("refresh-virtual-max-page",{}));C=void 0;pe(this.parent)?(C=this.model.pageSize/2,this.isBlockAvailable(a[0])||(this.cache[a[0]]=v.slice(0,C)),this.isBlockAvailable(a[1])||(this.cache[a[1]]=v.slice(C,this.model.pageSize))):(C=~~Math.max(v.length,this.model.pageSize)/2,this.isBlockAvailable(a[0])||(this.cache[a[0]]=v.slice(0,C)),this.isBlockAvailable(a[1])||(this.cache[a[1]]=v.slice(C)))}if(this.parent.groupSettings.columns.length&&!o&&this.cache[m[c]]&&(this.cache[m[c]]=this.updateGroupRow(this.cache[m[c]],m[c])),i.renderMovableContent&&!this.isMovableBlockAvailable(m[c])||i.renderFrozenRightContent&&!this.isFrozenRightBlockAvailable(m[c])){var y=i.renderMovableContent?this.movableCache:this.frozenRightCache,v=this.rowModelGenerator.generateRows(e,{virtualInfo:n,startIndex:this.getStartIndex(m[c],e)}),C=~~Math.max(v.length,this.model.pageSize)/2;(i.renderFrozenRightContent&&!this.isFrozenRightBlockAvailable(a[0])||i.renderMovableContent&&!this.isMovableBlockAvailable(a[0]))&&(y[a[0]]=v.slice(0,C)),(i.renderFrozenRightContent&&!this.isFrozenRightBlockAvailable(a[1])||i.renderMovableContent&&!this.isMovableBlockAvailable(a[1]))&&(y[a[1]]=v.slice(C))}i.renderMovableContent||i.renderFrozenRightContent||!this.cache[m[c]]?(y=i.renderMovableContent?this.movableCache:this.frozenRightCache)[m[c]]&&l.push.apply(l,y[m[c]]):l.push.apply(l,this.cache[m[c]]),this.isBlockAvailable(m[c])&&h.push(m[c])}n.blockIndexes=h}if(!t.isBlazor()||t.isBlazor()&&!this.parent.isServerRendered){this.parent.allowGrouping?this.parent.currentViewData.records=l.map(function(e){return e.data}):r?(i.renderMovableContent&&("Left"===this.parent.getFrozenMode()||"Right"===this.parent.getFrozenMode()||this.parent.getFrozenColumns())||i.renderFrozenRightContent)&&(this.parent.currentViewData=l.map(function(e){return e.data})):this.parent.currentViewData=l.map(function(e){return e.data})}return l},e.prototype.getBlockIndexes=function(e){return[e+(e-1),2*e]},e.prototype.getPage=function(e){return e%2==0?e/2:(e+1)/2},e.prototype.isBlockAvailable=function(e){return e in this.cache},e.prototype.isMovableBlockAvailable=function(e){return e in this.movableCache},e.prototype.isFrozenRightBlockAvailable=function(e){return e in this.frozenRightCache},e.prototype.getData=function(){return{page:this.model.currentPage,blockIndexes:this.getBlockIndexes(this.model.currentPage),direction:"down",columnIndexes:this.parent.getColumnIndexesInView()}},e.prototype.getStartIndex=function(e,t,i){void 0===i&&(i=!0);var r=e%2==0,n=(this.getPage(e)-1)*this.model.pageSize;return i||!r?n:n+~~(this.model.pageSize/2)},e.prototype.getColumnIndexes=function(e){var i=this;void 0===e&&(e=this.parent.getHeaderContent().querySelector(".e-headercontent")),this.parent.isFrozenGrid()&&(e=e.querySelector(".e-movableheader"));var r=[],n=0|e.scrollLeft,o=Object.keys(this.cOffsets),s=e.getBoundingClientRect().width;n=Math.min(this.cOffsets[o.length-1]-s,n);var l=t.Browser.isDevice?2*s:s/2,a=n+s+(0===n?l:0);return o.some(function(e,t,o){var s=Number(e),h=i.cOffsets[e];return n-l<=h&&a+l>=h&&r.push(s),a+l<h}),t.isBlazor()&&this.parent.isServerRendered&&(this.parent.contentModule.startColIndex=r[0],this.parent.contentModule.endColIndex=r[r.length-1]),this.addFrozenIndex(r),r},e.prototype.addFrozenIndex=function(e){if(this.parent.getFrozenColumns()&&this.parent.enableColumnVirtualization&&0===e[0])for(var t=0;t<this.parent.getFrozenColumns();t++)e.push(e[e.length-1]+1)},e.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","grouping","ungrouping","reorder","save","delete"];this.parent.getFrozenColumns()&&this.parent.frozenRows&&this.parent.enableColumnVirtualization&&"reorder"===e&&t.splice(t.indexOf(e),1);var i=t.some(function(t){return e===t});return i&&(this.cache={},this.data={},this.groups={},this.movableCache={},this.frozenRightCache={}),i},e.prototype.refreshColOffsets=function(){var e=this,t=0;this.cOffsets={};for(var i=this.parent.groupSettings.columns.length,r=this.parent.columns,n=r.length,o=this.parent.groupSettings.columns,s=0;s<o.length;s++)this.cOffsets[s]=30+(0|this.cOffsets[s-1]);for(var l=Array.apply(null,Array(n)).map(function(){return t++}),a=0;a<l.length;a++)l[a]=l[a]+i,this.cOffsets[l[a]]=(0|this.cOffsets[l[a]-1])+(function(t){return t.visible&&(e.parent.groupSettings.showGroupedColumn?t.visible:e.parent.groupSettings.columns.indexOf(t.field)<0)}(r[a])?parseInt(r[a].width,10):0)},e.prototype.updateGroupRow=function(e,t){for(var i=e[0],r=[],n=Object.keys(this.cache),o=0;o<n.length;o++)Number(n[o])<t&&(r=r.concat(this.cache[n[o]]));return i&&i.isDataRow||t%2==0?e:this.iterateGroup(e,r)},e.prototype.iterateGroup=function(e,t){var i=e[0],r=0;return i&&i.isDataRow?e:(e.some(function(e){return t.some(function(t,i){var n=t&&void 0!==t.data.field&&t.data.field===e.data.field&&t.data.key===e.data.key;return n&&(r=i),n})})&&(e.shift(),e=this.iterateGroup(e,t.slice(r))),e)},e.prototype.getRows=function(){for(var e=[],i=!(!t.isBlazor()||!this.parent.isServerRendered),r=i?Object.keys(this.rowCache):Object.keys(this.cache),n=0;n<r.length;n++)e=i?e.concat(this.rowCache[r[n]]):e.concat(this.cache[r[n]]);return e},e}(),Pn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nn=function(r){function n(e,t){var i=r.call(this,e,t)||this;return i.prevHeight=0,i.startIndex=0,i.preStartIndex=0,i.preventEvent=!1,i.actions=["filtering","searching","grouping","ungrouping"],i.offsets={},i.tmpOffsets={},i.virtualEle=new Hn,i.offsetKeys=[],i.isFocused=!1,i.isSelection=!1,i.isBottom=!1,i.rndrCount=0,i.empty=void 0,i.isCancel=!1,i.requestTypes=["beginEdit","cancel","delete","add","save"],i.isNormaledit="Normal"===i.parent.editSettings.mode,i.virtualData={},i.emptyRowData={},i.vfColIndex=[],i.frzIdx=1,i.orderRowObj=[],i.mvbOrderRowObj=[],i.frOrderRowObj=[],i.isContextMenuOpen=!1,i.locator=t,i.eventListener("on"),i.parent.on(jt,i.setVisible,i),i.vgenerator=i.generator,i}return Pn(n,r),n.prototype.renderTable=function(){this.header=this.locator.getService("rendererFactory").getRenderer(e.RenderType.Header),r.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.content=this.getPanel().querySelector(".e-content"),this.virtualEle.renderWrapper(this.parent.height),this.virtualEle.renderPlaceHolder(),this.virtualEle.wrapper.style.position="absolute";var t=this.parent.dataSource instanceof i.DataManager&&!this.parent.dataSource.dataSource.offline,n={container:this.content,pageHeight:2*this.getBlockHeight(),debounceEvent:t,axes:this.parent.enableColumnVirtualization?["X","Y"]:["Y"]};this.observer=new kn(this.virtualEle.wrapper,n)},n.prototype.renderEmpty=function(e){this.getTable().appendChild(e),this.virtualEle.adjustTable(0,0)},n.prototype.getReorderedFrozenRows=function(e){var t=e.virtualInfo.blockIndexes,i=e.virtualInfo.columnIndexes,r=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.renderMovableContent||(e.virtualInfo.columnIndexes=[]);var n=this.parent.getCurrentViewRecords().length,o=this.parent.renderModule.data.dataManager.dataSource.json.slice(0,n),s=this.vgenerator.generateRows(o,e);return e.virtualInfo.blockIndexes=t,e.virtualInfo.columnIndexes=i,e.virtualInfo.page=r,s.splice(0,this.parent.frozenRows)},n.prototype.scrollListener=function(e){if(this.scrollAfterEdit(),this.parent.enablePersistence&&(this.parent.scrollPosition=e.offset),this.preventEvent||this.parent.isDestroyed)return void(this.preventEvent=!1);t.isNullOrUndefined(document.activeElement)?this.isFocused=!1:this.isFocused=this.content===t.closest(document.activeElement,".e-content")||this.content===document.activeElement;var i=e.sentinel,r=this.preStartIndex,n=this.parent.getColumnIndexesInView(),o=this.currentInfo=this.getInfoFromView(e.direction,i,e.offset);if(t.isBlazor()&&this.parent.isServerRendered&&this.parent.enableColumnVirtualization&&JSON.stringify(n)!==JSON.stringify(o.columnIndexes)){this.parent.refreshHeader();var s=this.getColumnOffset(this.startColIndex-1),l=this.getColumnOffset(this.endColIndex-1)-s+"";this.parent.notify("refresh-virtual-indices",{requestType:"virtualscroll",startColumnIndex:o.columnIndexes[0],endColumnIndex:o.columnIndexes[o.columnIndexes.length-1],axis:"X",VTablewidth:l,translateX:this.getColumnOffset(o.columnIndexes[0]-1)}),this.parent.notify("setcolumnstyles",{})}return pe(this.parent)&&!t.isBlazor()?"Y"===i.axis&&o.blockIndexes&&this.prevInfo.blockIndexes.toString()===o.blockIndexes.toString()&&"up"===e.direction&&2!==o.blockIndexes[o.blockIndexes.length-1]?void 0:(o.event="refresh-virtual-block",t.isNullOrUndefined(o.offsets)||(o.offsets.top=this.content.scrollTop),void this.parent.notify(o.event,{requestType:"virtualscroll",virtualInfo:o,focusElement:e.focusElement})):(!t.isBlazor()||t.isBlazor()&&!this.parent.isServerRendered)&&this.prevInfo&&("Y"===i.axis&&this.prevInfo.blockIndexes.toString()===o.blockIndexes.toString()||"X"===i.axis&&this.prevInfo.columnIndexes.toString()===o.columnIndexes.toString())?(t.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,void this.restoreEdit()):(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?o.columnIndexes:[]),!t.isBlazor()||t.isBlazor()&&!this.parent.isServerRendered?this.parent.pageSettings.currentPage=o.loadNext&&!o.loadSelf?o.nextInfo.page:o.page:t.isBlazor()&&this.parent.isServerRendered&&this.preStartIndex!==r&&this.parent.pageSettings.currentPage===o.currentPage&&this.parent.notify("refresh-virtual-indices",{requestType:"virtualscroll",virtualStartIndex:o.startIndex,virtualEndIndex:o.endIndex,axis:"Y",RHeight:this.parent.getRowHeight()}),void(!t.isBlazor()||t.isBlazor()&&!this.parent.isServerRendered?(this.requestType="virtualscroll",this.parent.notify(o.event,{requestType:"virtualscroll",virtualInfo:o,focusElement:e.focusElement})):this.preStartIndex!==r&&this.parent.pageSettings.currentPage!==o.currentPage&&(this.parent.pageSettings.currentPage=o.currentPage,this.parent.notify(o.event,{requestType:"virtualscroll",virtualStartIndex:o.startIndex,virtualEndIndex:o.endIndex,axis:"Y",RHeight:this.parent.getRowHeight()}))))},n.prototype.block=function(e){return this.vgenerator.isBlockAvailable(e)},n.prototype.getInfoFromView=function(e,i,r){var n=!1,o=[],s={direction:e,sentinelInfo:i,offsets:r,startIndex:this.preStartIndex,endIndex:this.preEndIndex},l=this.parent.height.toString().indexOf("%")<0?this.content.getBoundingClientRect().height:this.parent.element.getBoundingClientRect().height;s.page=this.getPageFromTop(r.top,s),s.blockIndexes=o=this.vgenerator.getBlockIndexes(s.page),s.loadSelf=!this.vgenerator.isBlockAvailable(o[s.block]);var a=this.ensureBlocks(s);if("upArrow"===this.activeKey&&s.blockIndexes.toString()!==a.toString()){var h=a[a.length-1];-1===s.blockIndexes.indexOf(h)&&(n=!0)}if(s.blockIndexes=a,s.loadNext=!a.filter(function(e){return-1===o.indexOf(e)}).every(this.block.bind(this)),s.event=s.loadNext||s.loadSelf?Bt:Jt,s.nextInfo=s.loadNext?{page:Math.max(1,s.page+("down"===e?1:-1))}:{},n&&(s.blockIndexes=[s.blockIndexes[0]-1,s.blockIndexes[0],s.blockIndexes[0]+1]),"downArrow"===this.activeKey){var d=Math.ceil(this.rowIndex/this.getBlockSize());1!==d&&(s.blockIndexes[1]!==d||s.blockIndexes.length<3)&&(s.blockIndexes=[d-1,d,d+1])}if(s.columnIndexes="X"===i.axis?this.vgenerator.getColumnIndexes():this.parent.getColumnIndexesInView(),this.parent.enableColumnVirtualization&&"X"===i.axis&&(s.event=Jt),t.isBlazor()&&this.parent.isServerRendered){var p=this.parent.getRowHeight(),c=r.top/p,u=l/p,g=c+u,f=this.parent.pageSettings.pageSize/4;if("down"===s.direction){v=Math.round(g)-Math.round(f);if(t.isNullOrUndefined(s.startIndex)||g>s.startIndex+Math.round(this.parent.pageSettings.pageSize/2+f)&&s.endIndex!==this.count){s.startIndex=v>=0?Math.round(v):0,s.startIndex=s.startIndex>c?Math.floor(c):s.startIndex;y=s.startIndex+this.parent.pageSettings.pageSize;s.startIndex=y<g?Math.ceil(g)-this.parent.pageSettings.pageSize:s.startIndex,s.endIndex=y<this.count?y:this.count,s.startIndex=y>=this.count?s.endIndex-this.parent.pageSettings.pageSize:s.startIndex,s.currentPage=Math.ceil(s.endIndex/this.parent.pageSettings.pageSize),this.setKeyboardNavIndex()}}else if("up"===s.direction&&s.startIndex&&s.endIndex&&c<Math.round((s.startIndex*p+f*p)/p)){var m=f>u?f:u+u/4,y=Math.round(c+m);s.endIndex=y<this.count?y:this.count;var v=s.endIndex-this.parent.pageSettings.pageSize;s.startIndex=v>0?v:0,s.endIndex=v<0?this.parent.pageSettings.pageSize:s.endIndex,s.currentPage=Math.ceil(s.startIndex/this.parent.pageSettings.pageSize),this.setKeyboardNavIndex()}this.preStartIndex=this.startIndex=s.startIndex,this.preEndIndex=s.endIndex,s.event=s.currentPage!==this.parent.pageSettings.currentPage?Bt:Jt}return s},n.prototype.setKeyboardNavIndex=function(){this.blazorDataLoad=!0,"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey||(this.blzRowIndex="downArrow"===this.activeKey?this.rowIndex+1:this.rowIndex-1,document.activeElement.blur())},n.prototype.ensureBlocks=function(e){var t,i=this,r=e.blockIndexes[e.block],n=r,o=Math.max,s="down"===e.direction?[o(r,1),++r,++r]:[o(r-1,1),r,r+1];return this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&("X"===e.sentinelInfo.axis||"Y"===e.sentinelInfo.axis&&e.page===this.prevInfo.page)&&(s=this.prevInfo.blockIndexes),s=s.filter(function(e,t){return s.indexOf(e)===t}),this.prevInfo.blockIndexes.toString()===s.toString()?s:((e.loadSelf||"down"===e.direction&&this.isEndBlock(n))&&(s=this.vgenerator.getBlockIndexes(e.page)),s.some(function(e,r){var n=e===(pe(i.parent)?i.getGroupedTotalBlocks():i.getTotalBlocks());return n&&(t=r),n}),void 0!==t&&(s=s.slice(0,t+1),0===e.block&&1===s.length&&this.vgenerator.isBlockAvailable(s[0]-1)&&(s=[s[0]-1,s[0]])),s)},n.prototype.appendContent=function(e,i,r){var n=this,o=this.parent.isFrozenGrid(),s=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount(),l=this.parent.enableColumnVirtualization&&o;this.checkFirstBlockColIndexes(r);var a=r.virtualInfo.sentinelInfo&&"Y"===r.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==r.virtualInfo.page?this.currentInfo:r.virtualInfo;this.prevInfo=this.prevInfo||r.virtualInfo;var h=a.columnIndexes[0]-1;l&&a.columnIndexes[0]===s&&(h=a.columnIndexes[0]-s-1);var d,p=this.getColumnOffset(h),c=a.blockIndexes;this.parent.groupSettings.columns.length&&this.refreshOffsets(),"100%"===this.parent.height&&(this.parent.element.style.height="100%");var u=this.parent.height.toString().indexOf("%")<0?this.content.getBoundingClientRect().height:this.parent.element.getBoundingClientRect().height;if(!this.requestTypes.some(function(e){return e===n.requestType})){var g=this.getTranslateY(this.content.scrollTop,u,a);this.virtualEle.adjustTable(l?0:p,g),l&&this.virtualEle.adjustMovableTable(p,0)}if(this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(l?0:p,0),l&&this.header.virtualEle.adjustMovableTable(p,0)),this.parent.enableColumnVirtualization){var f=a.columnIndexes;d=this.getColumnOffset(f[f.length-1])-this.getColumnOffset(f[0]-1)+"",l?this.header.virtualEle.setMovableWrapperWidth(d):this.header.virtualEle.setWrapperWidth(d)}l?this.virtualEle.setMovableWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name):this.virtualEle.setWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name),t.isNullOrUndefined(e.parentNode)||t.remove(e);var m;if(o?r.renderFrozenRightContent?m=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector("tbody"):r.renderMovableContent?r.renderMovableContent&&(m=this.parent.getMovableVirtualContent().querySelector("tbody")):m=this.parent.getFrozenVirtualContent().querySelector("tbody"):m=this.parent.element.querySelector(".e-content").querySelector("tbody"),m&&(t.remove(m),e=null),this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?e=i:(e=this.parent.createElement("tbody")).appendChild(i),this.parent.frozenRows&&"virtualscroll"===r.requestType&&1===this.parent.pageSettings.currentPage)for(var y=0;y<this.parent.frozenRows;y++)e.children[0].remove();if(o?(r.renderFrozenRightContent?(this.parent.getContent().querySelector(".e-frozen-right-content").querySelector(".e-table").appendChild(e),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType):r.renderMovableContent?r.renderMovableContent&&(this.parent.getMovableVirtualContent().querySelector(".e-table").appendChild(e),"Left-Right"!==this.parent.getFrozenMode()&&(this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType)):this.parent.getFrozenVirtualContent().querySelector(".e-table").appendChild(e),this.vfColIndex.length&&(r.virtualInfo.columnIndexes=a.columnIndexes=t.extend([],this.vfColIndex),this.vfColIndex=r.renderMovableContent?[]:this.vfColIndex)):(this.getTable().appendChild(e),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType),this.parent.groupSettings.columns.length){if(!pe(this.parent)&&"up"===a.direction){var v=this.offsets[this.getTotalBlocks()]-this.prevHeight;this.preventEvent=!0;var C=this.content.scrollTop;this.content.scrollTop=C+v}this.setVirtualHeight(),this.observer.setPageHeight(this.getOffset(c[c.length-1])-this.getOffset(c[0]-1))}this.prevInfo=a,this.isFocused&&"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey&&this.content.focus();var w=Math.ceil(this.getTotalBlocks()/2);this.isBottom&&(this.isBottom=!1,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),this.parent.pageSettings.currentPage===w&&1===c.length&&(this.isBottom=!0,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-2]),"virtualscroll"===r.requestType&&"X"===r.virtualInfo.sentinelInfo.axis&&this.parent.notify(Yt,{}),this.focusCell(r),this.restoreEdit(r),this.restoreAdd(r),this.initialRowTop||(this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top)},n.prototype.checkFirstBlockColIndexes=function(e){if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&0===e.virtualInfo.columnIndexes[0]){var i=[],r=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount();if(!e.renderMovableContent&&e.virtualInfo.columnIndexes.length>r){this.vfColIndex=e.virtualInfo.columnIndexes;for(var n=0;n<r;n++)i.push(n);e.virtualInfo.columnIndexes=i}else e.renderMovableContent&&(this.vfColIndex.length||(this.vfColIndex=t.extend([],e.virtualInfo.columnIndexes)),e.virtualInfo.columnIndexes=t.extend([],this.vfColIndex),e.virtualInfo.columnIndexes.splice(0,r))}},n.prototype.focusCell=function(e){if("upArrow"===this.activeKey||"downArrow"===this.activeKey){var t=this.parent.getRowByIndex(this.rowIndex);t.cells[this.cellIndex].focus({preventScroll:!0}),this.parent.selectRow(parseInt(t.getAttribute("aria-rowindex"),10)),this.activeKey=this.empty}},n.prototype.restoreEdit=function(e){if(this.isNormaledit){var i=this.parent.getFrozenColumns(),r=e&&this.parent.isFrozenGrid(),n=this.parent.getFrozenMode(),o=e&&(i||"Left"===n||"Right"===n?e.renderMovableContent:e.renderFrozenRightContent);if((!r||r&&o)&&this.parent.editSettings.allowEditing&&this.parent.editModule&&!t.isNullOrUndefined(this.editedRowIndex)){var s=this.getRowByIndex(this.editedRowIndex);if(Object.keys(this.virtualData).length&&s&&!this.content.querySelector(".e-editedrow")){var l=s.getBoundingClientRect().top;l<this.content.offsetHeight&&l>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(s))}if(s&&this.content.querySelector(".e-editedrow")&&!Object.keys(this.virtualData).length){var a=t.extend({},this.getRowObjectByIndex(this.editedRowIndex));this.virtualData=this.getVirtualEditedData(a)}}this.restoreAdd(e)}},n.prototype.getVirtualEditedData=function(e){var t=[].slice.call(this.parent.element.querySelectorAll(".e-gridform")),i=this.parent.isFrozenGrid(),r=this.parent.editModule.getCurrentEditedData(t[0],e);return i&&("Left-Right"!==this.parent.getFrozenMode()?r=this.parent.editModule.getCurrentEditedData(t[1],e):(r=this.parent.editModule.getCurrentEditedData(t[1],e),r=this.parent.editModule.getCurrentEditedData(t[2],e))),r},n.prototype.restoreAdd=function(e){var t=this.parent.getFrozenColumns(),i=e&&this.parent.isFrozenGrid(),r=this.parent.getFrozenMode(),n=e&&(t||"Left"===r||"Right"===r?e.renderMovableContent:e.renderFrozenRightContent);if((!i||i&&n)&&this.isNormaledit&&this.isAdd&&!this.parent.element.querySelector(".e-addedrow")){var o="Top"===this.parent.editSettings.newRowPosition&&this.content.scrollTop<this.parent.getRowHeight(),s="Bottom"===this.parent.editSettings.newRowPosition&&this.parent.pageSettings.currentPage===this.maxPage;(o||s)&&(this.parent.isEdit=!1,this.parent.addRecord())}},n.prototype.onDataReady=function(e){t.isNullOrUndefined(e.count)||(this.count=e.count,this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize)),this.vgenerator.checkAndResetCache(e.requestType),["refresh","filtering","searching","grouping","ungrouping","reorder",void 0].some(function(t){return e.requestType===t})&&this.refreshOffsets(),this.setVirtualHeight(),this.resetScrollPosition(e.requestType)},n.prototype.setVirtualHeight=function(e){var i=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length+this.parent.groupSettings.columns.length-1)+"px":"100%";if(this.parent.isFrozenGrid()){var r=1===this.parent.pageSettings.currentPage&&Object.keys(this.offsets).length<=2?this.offsets[1]:this.offsets[this.getTotalBlocks()-2];r=r>this.content.clientHeight?r:0,this.virtualEle.setVirtualHeight(r,i)}else{var n=t.isBlazor()&&this.parent.isServerRendered&&this.parent.groupSettings.columns.length&&e?e:this.offsets[pe(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks()];this.virtualEle.setVirtualHeight(n,i)}this.parent.enableColumnVirtualization&&(this.header.virtualEle.setVirtualHeight(1,i),this.parent.isFrozenGrid()&&(this.virtualEle.setMovableVirtualHeight(1,i),this.header.virtualEle.setMovableVirtualHeight(1,i)))},n.prototype.getPageFromTop=function(e,t){var i=this,r=pe(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),n=0;this.offsets[r],this.prevHeight;return this.offsetKeys.some(function(o){var s=Number(o),l=e<=i.offsets[o]||s===r&&e>i.offsets[o];return l&&(i.offsetKeys.length%2!=0&&s.toString()===i.offsetKeys[i.offsetKeys.length-2]&&e<=i.offsets[i.offsetKeys.length-1]&&(s+=1),t.block=s%2==0?1:0,n=Math.max(1,Math.min(i.vgenerator.getPage(s),i.maxPage))),l}),n},n.prototype.getTranslateY=function(e,t,i,r){void 0===i&&((i={page:this.getPageFromTop(e,{})}).blockIndexes=this.vgenerator.getBlockIndexes(i.page));var n=(i.blockIndexes[0]||1)-1,o=this.getOffset(n),s=this.getOffset(i.blockIndexes[i.blockIndexes.length-1]);r&&(i=this.prevInfo);var l=o>e?this.getOffset(n-1):s<e+t?this.getOffset(n+1):o,a=this.offsets[i.blockIndexes[i.blockIndexes.length-1]]-this.tmpOffsets[i.blockIndexes[0]],h=pe(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return l+a>this.offsets[h]&&(l-=l+a-this.offsets[h]),l},n.prototype.getOffset=function(e){return Math.min(0|this.offsets[e],0|this.offsets[this.maxBlock])},n.prototype.onEntered=function(){var e=this;return function(i,r,n,o,s,l){t.Browser.isIE&&!s&&l&&!e.preventEvent&&e.parent.showSpinner();var a=e.parent.enableColumnVirtualization&&e.parent.isFrozenGrid(),h="X"===r.axis,d=e.prevInfo.offsets?e.prevInfo.offsets.top:null,p=e.content.getBoundingClientRect().height,c=e.getColumnOffset(h?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1),u=e.getTranslateY(o.top,p,h&&d===o.top?e.prevInfo:void 0,!0);t.isBlazor()&&e.parent.isServerRendered&&e.currentInfo&&e.currentInfo.startIndex&&h&&(u=e.currentInfo.startIndex*e.parent.getRowHeight()),e.virtualEle.adjustTable(a?0:c,Math.min(u,e.offsets[e.maxBlock])),a&&e.virtualEle.adjustMovableTable(c,0),t.isBlazor()&&e.parent.isServerRendered&&h&&e.parent.notify("setcolumnstyles",{refresh:!0}),e.parent.enableColumnVirtualization&&(!t.isBlazor()||t.isBlazor()&&!e.parent.isServerRendered)&&(e.header.virtualEle.adjustTable(a?0:c,0),a&&e.header.virtualEle.adjustMovableTable(c,0))}},n.prototype.dataBound=function(){this.parent.notify("refresh-virtual-frozen-height",{}),this.isSelection&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey?this.parent.selectRow(this.selectedRowIndex):t.isBlazor()||(this.activeKey=this.empty)},n.prototype.rowSelected=function(e){if(this.isSelection&&!this.isLastBlockRow(e.rowIndex)){var t=be(this.content.firstElementChild),i=e.row.getBoundingClientRect().top,r=this.content.getBoundingClientRect().height,n=r<i,o=n?i-r:this.initialRowTop-i,s=n?t.height-o:t.height+o;this.virtualEle.adjustTable(t.width,s)}this.isSelection=!1},n.prototype.isLastBlockRow=function(e){var t=this.parent.getContent().firstElementChild,i=Math.floor(t.offsetHeight/this.parent.getRowHeight())-1;return e>=this.maxPage*this.parent.pageSettings.pageSize-i},n.prototype.refreshVirtualCacheOnRowDD=function(e){var t=this.getBlockSize(),i=Math.ceil((e.objIndex+1)/t),r=e.objIndex-e.startIndex>=t?t:0,n=e.objIndex-e.startIndex>=t+t?t:0;if(this.orderRowObj.push(this.vgenerator.cache[i][e.objIndex-e.startIndex-r-n]),this.parent.isFrozenGrid()&&(this.mvbOrderRowObj.push(this.vgenerator.movableCache[i][e.objIndex-e.startIndex-r-n]),"Left-Right"===this.parent.getFrozenMode()&&this.frOrderRowObj.push(this.vgenerator.frozenRightCache[i][e.objIndex-e.startIndex-r-n])),!0===e.end){var o=this.currentInfo.blockIndexes;o||(o=[1,2]),Oe(this.parent,this.orderRowObj,e.startIndex),this.parent.isFrozenGrid()&&(Oe(this.parent,this.mvbOrderRowObj,e.startIndex),"Left-Right"===this.parent.getFrozenMode()&&Oe(this.parent,this.frOrderRowObj,e.startIndex));for(var s=0;s<o.length;s++)this.vgenerator.cache[o[s]]=this.orderRowObj.splice(0,t),this.parent.isFrozenGrid()&&(this.vgenerator.movableCache[o[s]]=this.mvbOrderRowObj.splice(0,t),"Left-Right"===this.parent.getFrozenMode()&&(this.vgenerator.frozenRightCache[o[s]]=this.frOrderRowObj.splice(0,t)));this.orderRowObj=[],this.orderRowObj=[],this.mvbOrderRowObj=[]}},n.prototype.refreshMaxPage=function(){this.parent.groupSettings.columns.length&&this.parent.vcRows.length&&(this.maxPage=Math.ceil(this.parent.vcRows.length/this.parent.pageSettings.pageSize))},n.prototype.eventListener=function(e){var t=this;this.parent[e](Et,this.onDataReady,this),this.parent.addEventListener(Ct,this.dataBound.bind(this)),this.parent.addEventListener(yt,this.actionBegin.bind(this)),this.parent.addEventListener(vt,this.actionComplete.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelected.bind(this)),this.parent[e](Jt,this.refreshContentRows,this),this.parent[e]("select-virtual-Row",this.selectVirtualRow,this),this.parent[e]("virtaul-cell-focus",this.virtualCellFocus,this),this.parent[e]("virtual-scroll-edit-action-begin",this.editActionBegin,this),this.parent[e]("virtual-scroll-add-action-begin",this.addActionBegin,this),this.parent[e]("virtual-scroll-edit",this.restoreEdit,this),this.parent[e]("virtual-scroll-edit-success",this.editSuccess,this),this.parent[e]("refresh-virtual-cache",this.refreshCache,this),this.parent[e]("edit-reset",this.resetIsedit,this),this.parent[e](hi,this.getVirtualData,this),this.parent[e]("virtual-scroll-edit-cancel",this.editCancel,this),this.parent[e]("refresh-Virtual-Cache-On-RowDD",this.refreshVirtualCacheOnRowDD,this),this.parent[e]("refresh-virtual-max-page",this.refreshMaxPage,this),this.parent[e]("select-row-on-context-open",this.selectRowOnContextOpen,this);for(var i=this.actions,r=0;r<i.length;r++)this.parent[e](i[r]+"-begin",this.onActionBegin,this);var n=function(){t.observer.observe(function(e){return t.scrollListener(e)},t.onEntered());var e=t.parent;if(e.enablePersistence&&e.scrollPosition){t.content.scrollTop=e.scrollPosition.top;var i={direction:"down",sentinel:t.observer.sentinelInfo.down,offset:e.scrollPosition,focusElement:e.element};t.scrollListener(i),e.enableColumnVirtualization&&(t.content.scrollLeft=e.scrollPosition.left)}t.parent.off(Mt,n)};this.parent.on(Mt,n,this)},n.prototype.getVirtualData=function(e){e.virtualData=this.virtualData,e.isAdd=this.isAdd,e.isCancel=this.isCancel},n.prototype.selectRowOnContextOpen=function(e){this.isContextMenuOpen=e.isOpen},n.prototype.editCancel=function(e){var i=Ie(this.parent,e.data);t.isNullOrUndefined(i)||(e.data=this.parent.getCurrentViewRecords()[i])},n.prototype.editSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewData(e.data),this.isAdd=!1)},n.prototype.updateCurrentViewData=function(e){var i=Ie(this.parent,e);t.isNullOrUndefined(i)||(this.parent.getCurrentViewRecords()[i]=e)},n.prototype.actionBegin=function(e){"virtualscroll"!==e.requestType&&(this.requestType=e.requestType),e.cancel||this.parent.notify("refresh-virtual-frozenrows",e)},n.prototype.virtualCellFocus=function(e){var i=document.activeElement;if(i.classList.contains("e-rowcell")&&e&&("upArrow"===e.action||"downArrow"===e.action)){var r=parseInt(i.parentElement.getAttribute("aria-rowindex"),10);if(e&&("downArrow"===e.action||"upArrow"===e.action)){var n=this.parent.getContent().firstElementChild;"downArrow"===e.action?r+=1:r-=1,this.rowIndex=r,this.cellIndex=parseInt(i.getAttribute("aria-colindex"),10);var o=this.parent.getRowByIndex(r),s=this.parent.pageSettings.currentPage,l=Math.floor(n.offsetHeight/this.parent.getRowHeight())-1,a=!1;t.isNullOrUndefined(o)&&(a=!0,("downArrow"===e.action&&s===this.maxPage-1||"upArrow"===e.action&&1===s)&&(a=!1)),a||Re(o,this.parent)&&"downArrow"===e.action||Fe(o,2*this.parent.getRowHeight())&&"upArrow"===e.action?(this.activeKey=e.action,n.scrollTop="downArrow"===e.action?(r-l)*this.parent.getRowHeight():r*this.parent.getRowHeight()):this.activeKey=this.empty,(!t.isBlazor()||t.isBlazor()&&!this.blazorDataLoad)&&this.parent.selectRow(r)}}},n.prototype.editActionBegin=function(e){this.editedRowIndex=e.index;var i=t.extend({},this.getRowObjectByIndex(e.index));e.data=Object.keys(this.virtualData).length?this.virtualData:i},n.prototype.refreshCache=function(e){var t=Math.ceil((this.editedRowIndex+1)/this.getBlockSize()),i=this.editedRowIndex-(t-1)*this.getBlockSize();this.vgenerator.cache[t][i].data=e,this.vgenerator.movableCache[t]&&(this.vgenerator.movableCache[t][i].data=e),this.vgenerator.frozenRightCache[t]&&(this.vgenerator.frozenRightCache[t][i].data=e)},n.prototype.actionComplete=function(e){"delete"!==e.requestType&&"save"!==e.requestType&&"cancel"!==e.requestType||(this.refreshOffsets(),this.refreshVirtualElement(),this.isNormaledit&&("cancel"===e.requestType&&(this.isCancel=!0),this.isAdd=!1,this.editedRowIndex=this.empty,this.virtualData={},this.parent.editModule.previousVirtualData={})),this.parent.enableColumnVirtualization&&"filterafteropen"===e.requestType&&this.currentInfo.columnIndexes&&this.currentInfo.columnIndexes[0]>0&&this.parent.resetFilterDlgPosition(e.columnName)},n.prototype.resetIsedit=function(){this.parent.enableVirtualization&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&Object.keys(this.virtualData).length||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},n.prototype.scrollAfterEdit=function(){if(this.parent.editModule&&this.parent.editSettings.allowEditing&&this.isNormaledit&&this.parent.element.querySelector(".e-gridform")){var e=this.parent.element.querySelector(".e-editedrow"),i=this.parent.element.querySelector(".e-addedrow");if(e||i){var r=e?t.extend({},this.getRowObjectByIndex(this.editedRowIndex)):t.extend({},this.emptyRowData);this.virtualData=this.getVirtualEditedData(r)}}},n.prototype.createEmptyRowdata=function(){var e=this;this.parent.getColumns().filter(function(t){e.emptyRowData[t.field]=e.empty})},n.prototype.addActionBegin=function(e){if(this.isNormaledit){Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.isAdd=!0;var t=this.parent.pageSettings.currentPage;t>1&&"Top"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.onActionBegin(),e.startEdit=!1,this.content.scrollTop=0),t<this.maxPage-1&&"Bottom"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.parent.setProperties({pageSettings:{currentPage:this.maxPage-1}},!0),e.startEdit=!1,this.content.scrollTop=this.offsets[this.offsetKeys.length])}},n.prototype.getRowObjectByIndex=function(e){return this.getRowCollection(e,!1,!0)},n.prototype.getBlockSize=function(){return this.parent.pageSettings.pageSize>>1},n.prototype.getBlockHeight=function(){return this.getBlockSize()*this.parent.getRowHeight()},n.prototype.isEndBlock=function(e){var t=this.getTotalBlocks();return e>=t||e===t-1},n.prototype.getGroupedTotalBlocks=function(){var e=this.parent.vcRows;return Math.floor(e.length/this.getBlockSize()<1?1:e.length/this.getBlockSize())},n.prototype.getTotalBlocks=function(){return Math.ceil(this.count/this.getBlockSize())},n.prototype.getColumnOffset=function(e){return 0|this.vgenerator.cOffsets[e]},n.prototype.getModelGenerator=function(){return new Ln(this.parent)},n.prototype.resetScrollPosition=function(e){this.actions.some(function(t){return t===e})&&(this.preventEvent=0!==this.content.scrollTop,this.content.scrollTop=0),"virtualscroll"!==e&&(this.isAdd=!1)},n.prototype.onActionBegin=function(e){this.parent.setProperties({pageSettings:{currentPage:1}},!0)},n.prototype.getRows=function(){return this.vgenerator.getRows()},n.prototype.getRowByIndex=function(e){return pe(this.parent)?this.parent.getDataRows()[e]:this.getRowCollection(e,!1)},n.prototype.getMovableVirtualRowByIndex=function(e){return this.getRowCollection(e,!0)},n.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},n.prototype.getRowCollection=function(e,i,r,n){var o=this.prevInfo.blockIndexes,s=!t.isBlazor()||t.isBlazor()&&!this.parent.isServerRendered?(o[0]-1)*this.getBlockSize():this.startIndex,l=i?this.parent.getMovableDataRows():this.parent.getDataRows();l=n?this.parent.getFrozenRightDataRows():l;var a=(r?this.parent.getCurrentViewRecords():l)[e-s];return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(a=r?e<=this.parent.frozenRows?this.parent.getRowsObject()[e].data:a:e<=this.parent.frozenRows?l[e]:l[e-s+this.parent.frozenRows]),a},n.prototype.getVirtualRowIndex=function(e){return(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize()+e},n.prototype.refreshOffsets=function(){var e=this.parent,t=0,i=this.getBlockSize(),r=pe(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();this.prevHeight=this.offsets[r],this.maxBlock=r%2==0?r-2:r-1,this.offsets={};for(var n=Array.apply(null,Array(r)).map(function(){return++t}),o=0;o<n.length;o++){var s=(this.vgenerator.cache[n[o]]||[]).length,l=pe(this.parent)?e.vcRows.length%i:this.count%i,a=!pe(this.parent)&&n[o]in this.vgenerator.cache?s*this.parent.getRowHeight():l&&n[o]===r?l*this.parent.getRowHeight():this.getBlockHeight();this.offsets[n[o]]=(0|this.offsets[n[o]-1])+a,this.tmpOffsets[n[o]]=0|this.offsets[n[o]-1]}this.offsetKeys=Object.keys(this.offsets),pe(this.parent)&&(this.parent.vGroupOffsets=this.offsets),this.parent.enableColumnVirtualization&&this.vgenerator.refreshColOffsets()},n.prototype.refreshVirtualElement=function(){this.vgenerator.refreshColOffsets(),this.setVirtualHeight()},n.prototype.setVisible=function(e){var i,r,n=this.parent,o=this.parent.getFrozenColumns();o&&(i=[].slice.call(this.parent.getFrozenVirtualContent().querySelectorAll("col")),r=[].slice.call(this.parent.getMovableVirtualContent().querySelectorAll("col"))),t.isBlazor()&&n.isServerRendered&&this.parent.notify("setvisibility",e);var s,l=[];(l=this.getRows()).some(function(e){return e.isDataRow&&(s=e),e.isDataRow});var a=!0;!n.groupSettings.columns.length&&s&&(a=!1);for(var h=n.getDataRows(),d=0,p=e.length;d<p;d++){var c=e[d],u=n.getNormalizedColumnIndex(c.uid),g=!0===c.visible?"":"none",f=void 0;if(i&&r?u>=o?(f=r,h=this.parent.getMovableRows(),u-=o):f=i:f=this.getColGroup().children,-1!==u&&s&&u<s.cells.length&&t.setStyleAttribute(f[u],{display:g}),!a){v=void 0;(v=c.visible?this.virtualEle.wrapper.offsetWidth+parseInt(c.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(c.width.toString(),10))>n.width?(this.setDisplayNone(h,u,g,l),this.parent.enableColumnVirtualization&&this.virtualEle.setWrapperWidth(v+""),this.refreshVirtualElement()):a=!0}!this.parent.invokedFromMedia&&c.hideAtMedia&&this.parent.updateMediaColumns(c),this.parent.invokedFromMedia=!1}if(t.isBlazor()&&this.parent.isServerRendered&&a){var m=this.parent.inViewIndexes,y=this.getColumnOffset(m[0]-1),v=this.getColumnOffset(m[m.length-1])-y+"";this.parent.notify("refresh-virtual-indices",{requestType:"virtualScrollRefresh",startColumnIndex:m[0],endColumnIndex:m[m.length-1],axis:"X",VTablewidth:v,translateX:y}),this.parent.notify("setcolumnstyles",{})}a||o?this.refreshContentRows({requestType:"refresh"}):this.parent.notify("partial-refresh",{rows:l,args:{isFrozen:!1,rows:l}})},n.prototype.selectVirtualRow=function(e){var i=this;if(!this.isContextMenuOpen&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey&&!this.requestTypes.some(function(e){return e===i.requestType})&&!this.parent.selectionModule.isInteracted){var r=this.parent.getRowByIndex(e.selectedIndex),n=this.parent.getRowHeight();if(!r||!this.isRowInView(r)){this.isSelection=!0,this.selectedRowIndex=e.selectedIndex;var o=(e.selectedIndex+1)*n;t.isNullOrUndefined(o)||(this.content.scrollTop=o)}}this.parent.isFrozenGrid()&&this.requestType?this.parent.getTablesCount()===this.frzIdx?(this.requestType=this.empty,this.frzIdx=1):this.frzIdx++:this.requestType=this.empty},n.prototype.isRowInView=function(e){var t=e.getBoundingClientRect().top;return t>=this.initialRowTop&&t<=this.content.offsetHeight},n}(zi),qn=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.virtualEle=new Hn,r.isMovable=!1,r.gen=new Ln(r.parent),r.parent.on(jt,r.setVisible,r),r.parent.on(Jt,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?r.refreshUI():null},r),r}return Pn(i,e),i.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector(".e-headercontent"))),t.isBlazor()&&this.parent.isServerRendered&&this.parent.notify("refresh-virtual-indices",{startColumnIndex:this.parent.contentModule.startColIndex,endColumnIndex:this.parent.contentModule.endColIndex,axis:"X"}),e.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().querySelector(".e-headercontent"),this.virtualEle.content.style.position="relative",this.virtualEle.renderWrapper(),this.virtualEle.renderPlaceHolder("absolute")},i.prototype.appendContent=function(e){this.isMovable?(this.virtualEle.movableWrapper.appendChild(e),this.isMovable=!1):this.virtualEle.wrapper.appendChild(e)},i.prototype.refreshUI=function(){this.isMovable=this.parent.isFrozenGrid(),this.setFrozenTable(this.parent.getMovableVirtualContent()),this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector(".e-headercontent"))),e.prototype.refreshUI.call(this),this.setFrozenTable(this.parent.getFrozenVirtualContent())},i.prototype.setVisible=function(e){var i,r,n,o,s,l=this.parent,a=this.parent.getFrozenColumns();a&&(o=[].slice.call(this.parent.getFrozenVirtualHeader().querySelectorAll("col")),s=[].slice.call(this.parent.getMovableVirtualHeader().querySelectorAll("col")));for(var h=0,d=e.length;h<d;h++){var p=e[h];r=l.getNormalizedColumnIndex(p.uid),i=p.visible?"":"none";var c=void 0;if(o&&s?r>=a?(c=s,r-=a):c=o:c=this.getColGroup().children,t.setStyleAttribute(c[r],{display:i}),l.enableColumnVirtualization&&!l.groupSettings.columns.length){var u=void 0;(u=p.visible?this.virtualEle.wrapper.offsetWidth+parseInt(p.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(p.width.toString(),10))>l.width?(this.setDisplayNone(p,i),this.virtualEle.setWrapperWidth(u+""),this.gen.refreshColOffsets()):n=!0}else n=!0;n&&!a&&this.refreshUI()}a&&this.parent.notify(Vt,{})},i.prototype.setFrozenTable=function(e){this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.parent.contentModule.isXaxis()&&this.parent.contentModule.setTable(e.querySelector(".e-table"))},i.prototype.setDisplayNone=function(e,i){var r=this.parent.isFrozenGrid(),n=this.getTable();r&&"movable"===e.getFreezeTableName()&&(n=this.parent.getMovableVirtualHeader().querySelector(".e-table"));for(var o=0,s=[].slice.apply(n.querySelectorAll("th.e-headercell"));o<s.length;o++){var l=s[o];if(l.querySelector("[e-mappinguid]")&&l.querySelector("[e-mappinguid]").getAttribute("e-mappinguid")===e.uid){t.setStyleAttribute(l,{display:i}),""===i&&t.removeClass([l],"e-hide");break}}},i}(Ii),Hn=function(){function e(){}return e.prototype.renderWrapper=function(e){t.isBlazor()?(this.wrapper=this.content.querySelector(".e-virtualtable")?this.content.querySelector(".e-virtualtable"):t.createElement("div",{className:"e-virtualtable"}),this.wrapper.setAttribute("styles","min-height:"+t.formatUnit(e))):this.wrapper=t.createElement("div",{className:"e-virtualtable",styles:"min-height:"+t.formatUnit(e)}),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},e.prototype.renderPlaceHolder=function(e){void 0===e&&(e="relative"),t.isBlazor()?(this.placeholder=this.content.querySelector(".e-virtualtrack")?this.content.querySelector(".e-virtualtrack"):t.createElement("div",{className:"e-virtualtrack"}),this.placeholder.setAttribute("styles","position:"+e)):this.placeholder=t.createElement("div",{className:"e-virtualtrack",styles:"position:"+e}),this.content.appendChild(this.placeholder)},e.prototype.renderFrozenWrapper=function(e){this.wrapper=t.createElement("div",{className:"e-virtualtable",styles:"min-height:"+t.formatUnit(e)+"; display: flex"}),this.content.appendChild(this.wrapper)},e.prototype.renderFrozenPlaceHolder=function(){this.placeholder=t.createElement("div",{className:"e-virtualtrack"}),this.content.appendChild(this.placeholder)},e.prototype.renderMovableWrapper=function(e){this.movableWrapper=t.createElement("div",{className:"e-virtualtable",styles:"min-height:"+t.formatUnit(e)}),this.movableContent.appendChild(this.movableWrapper)},e.prototype.renderMovablePlaceHolder=function(){this.movablePlaceholder=t.createElement("div",{className:"e-virtualtrack"}),this.movableContent.appendChild(this.movablePlaceholder)},e.prototype.adjustTable=function(e,t){this.wrapper.style.transform="translate("+e+"px, "+t+"px)"},e.prototype.adjustMovableTable=function(e,t){this.movableWrapper.style.transform="translate("+e+"px, "+t+"px)"},e.prototype.setMovableWrapperWidth=function(e,t){this.movableWrapper.style.width=e?e+"px":t?"100%":""},e.prototype.setMovableVirtualHeight=function(e,t){this.movablePlaceholder.style.height=e+"px",this.movablePlaceholder.style.width=t},e.prototype.setWrapperWidth=function(e,t){this.wrapper.style.width=e?e+"px":t?"100%":""},e.prototype.setVirtualHeight=function(e,t){this.placeholder.style.height=e+"px",this.placeholder.style.width=t},e.prototype.setFreezeWrapperWidth=function(e,t,i){e.style.width=t?t+"px":i?"100%":""},e}(),Un=function(){function i(e,t){this.parent=e,this.locator=t,this.addEventListener()}return i.prototype.getModuleName=function(){return"virtualscroll"},i.prototype.instantiateRenderer=function(){this.parent.log(["limitation","virtual_height"],"virtualization");var t=this.locator.getService("rendererFactory");this.parent.isFrozenGrid()||(this.parent.enableColumnVirtualization&&t.addRenderer(e.RenderType.Header,new qn(this.parent,this.locator)),t.addRenderer(e.RenderType.Content,new Nn(this.parent,this.locator))),this.ensurePageSize()},i.prototype.ensurePageSize=function(){var e=this.parent.getRowHeight(),i=this.parent.height.toString().indexOf("%")<0?this.parent.height:this.parent.element.getBoundingClientRect().height;this.blockSize=~~(i/e);var r=2*this.blockSize,n=this.parent.pageSettings.pageSize;this.parent.setProperties({pageSettings:{pageSize:n<r?r:n}},!0),t.isBlazor()&&this.parent.isServerRendered&&this.parent.notify("refresh-virtual-indices",{})},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(It,this.instantiateRenderer,this),this.parent.on("column-width-changed",this.refreshVirtualElement,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(It,this.instantiateRenderer),this.parent.off("column-width-changed",this.refreshVirtualElement))},i.prototype.refreshVirtualElement=function(t){this.parent.enableColumnVirtualization&&"resize"===t.module&&this.locator.getService("rendererFactory").getRenderer(e.RenderType.Content).refreshVirtualElement()},i.prototype.destroy=function(){this.removeEventListener()},i}(),jn=function(){function e(e){this.parent=e}return e.prototype.addNew=function(e,t){this.isEdit=!1;var i,r=Ve(this.parent),n=Ge(this.parent);if(i=this.parent.frozenRows&&"Top"===this.parent.editSettings.newRowPosition?this.parent.getHeaderTable().querySelector("tbody"):this.parent.getContentTable().querySelector("tbody"),t.row=this.parent.createElement("tr",{className:"e-row e-addedrow"}),i.querySelector(".e-emptyrow")){var o=i.querySelector(".e-emptyrow");if(o.parentNode.removeChild(o),this.parent.isFrozenGrid()){var s=this.parent.getContent().querySelector(".e-movablecontent").querySelector("tbody");if(s.firstElementChild.parentNode.removeChild(s.firstElementChild),"Left-Right"===this.parent.getFrozenMode()){var l=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector("tbody");l.firstElementChild.parentNode.removeChild(l.firstElementChild)}}}if("Top"===this.parent.editSettings.newRowPosition?i.insertBefore(t.row,i.firstChild):i.appendChild(t.row),t.row.appendChild(this.getEditElement(e,!1,void 0,t,!0)),this.parent.editModule.checkLastRow(t.row,t),this.parent.isFrozenGrid()){var a=this.renderMovableform(t.row,t);if("Top"===this.parent.editSettings.newRowPosition?r.insertBefore(a,r.firstChild):r.appendChild(a),t.row.querySelector(".e-normaledit").setAttribute("colspan",this.parent.getVisibleFrozenColumns()+""),a.setAttribute("colspan",""+(this.parent.getVisibleColumns().length-this.parent.getVisibleFrozenColumns())),n){var h=this.renderFrozenRightForm(t.row,t);"Top"===this.parent.editSettings.newRowPosition?n.insertBefore(h,n.firstChild):n.appendChild(h);var d=this.parent.getVisibleFrozenColumns()-this.parent.getFrozenRightColumnsCount();t.row.querySelector(".e-normaledit").setAttribute("colspan",d+""),h.querySelector(".e-normaledit").setAttribute("colspan",""+this.parent.getFrozenRightColumnsCount())}"auto"===this.parent.height&&this.parent.notify("frozenHeight",{})}},e.prototype.renderFrozenRightForm=function(e,t){var i=e.cloneNode(!0),r=t.frozenRightForm=i.querySelector("form");return this.parent.editSettings.template?(r.innerHTML="",this.appendChildren(r,t.rowData,!1),i):(this.renderRightFrozen(e,i),i.querySelector("colgroup").innerHTML=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("colgroup").innerHTML,i)},e.prototype.renderMovableform=function(e,t){var i=e.cloneNode(!0),r=t.movableForm=i.querySelector("form");return this.parent.editSettings.template?(r.innerHTML="",this.appendChildren(r,t.rowData,!1),i):(this.renderMovable(e,i),i.querySelector("colgroup").innerHTML=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").innerHTML,i)},e.prototype.updateFreezeEdit=function(e,t){return t=t.concat([].slice.call(this.getFreezeRow(e).querySelectorAll("td.e-rowcell"))),"Left-Right"===this.parent.getFrozenMode()&&(t=t.concat([].slice.call(this.getFreezeRightRow(e).querySelectorAll("td.e-rowcell")))),t},e.prototype.getFreezeRightRow=function(e){var t=parseInt(e.getAttribute("aria-rowindex"),10),i=this.parent.getFrozenLeftContentTbody(),r=this.parent.getFrozenHeaderTbody(),n=this.parent.getFrozenRightHeaderTbody(),o=this.parent.getFrozenRightContentTbody();return i.contains(e)||r.contains(e)?this.parent.getFrozenRightRowByIndex(t):o.contains(e)||n.contains(e)?this.parent.getRowByIndex(t):e},e.prototype.getFreezeRow=function(e){if(this.parent.isFrozenGrid()){var t=parseInt(e.getAttribute("aria-rowindex"),10),i=this.parent.getFrozenLeftContentTbody(),r=this.parent.getMovableContentTbody(),n=this.parent.getFrozenHeaderTbody(),o=this.parent.getMovableHeaderTbody();if(i.contains(e)||n.contains(e))return this.parent.getMovableRowByIndex(t);if(r.contains(e)||o.contains(e))return this.parent.getRowByIndex(t)}return e},e.prototype.update=function(e,i){this.isEdit=!0;if((t.closest(i.row,".e-movablecontent")||t.closest(i.row,".e-movableheader"))&&(i.row=this.getFreezeRow(i.row),t.isBlazor()&&this.parent.isServerRendered&&(i.cloneRow=i.row.cloneNode(!0))),(t.closest(i.row,".e-frozen-right-content")||t.closest(i.row,".e-frozen-right-header"))&&(i.row=this.getFreezeRightRow(i.row)),t.isBlazor()&&this.parent.isServerRendered){i.row.parentNode.insertBefore(i.cloneRow,i.row),i.row.classList.add("e-hiddenrow");r=[].slice.call(i.cloneRow.querySelectorAll("td.e-rowcell"));i.cloneRow.innerHTML="",r=this.updateFreezeEdit(i.cloneRow,r),i.cloneRow.appendChild(this.getEditElement(e,!0,r,i,!0)),i.cloneRow.classList.add("e-editedrow"),this.refreshFreezeEdit(i.cloneRow,i)}else{var r=[].slice.call(i.row.querySelectorAll("td.e-rowcell"));i.row.innerHTML="",r=this.updateFreezeEdit(i.row,r),i.row.appendChild(this.getEditElement(e,!0,r,i,!0)),i.row.classList.add("e-editedrow"),this.parent.editModule.checkLastRow(i.row,i),this.refreshFreezeEdit(i.row,i)}},e.prototype.refreshFreezeEdit=function(e,i){var r=e.firstChild;this.parent.getVisibleFrozenColumns()&&this.parent.editSettings.template&&(r.querySelector("colgroup").innerHTML=this.parent.getHeaderContent().querySelector(".e-frozenheader").querySelector("colgroup").innerHTML);var n,o,s=parseInt(e.getAttribute("aria-rowindex"),10);if(this.parent.isFrozenGrid()){s<this.parent.frozenRows?(o=this.parent.getHeaderContent(),n=".e-frozenheader"):(o=this.parent.getContent(),n=".e-frozencontent");var l=r.cloneNode(!0),a=r.cloneNode(!0),h=i.movableForm=l.querySelector("form");this.parent.editSettings.template&&this.refreshEditForm(h,i.rowData);var d=void 0,p=void 0;o.querySelector(n).contains(e)?(d=this.parent.getMovableRowByIndex(s),t.isBlazor()&&this.parent.isServerRendered?(i.frozen=d,i.cloneFrozen=d.cloneNode(!0),d.classList.add("e-hiddenrow"),d.parentNode.insertBefore(i.cloneFrozen,d),this.updateFrozenCont(i.cloneFrozen,r,l)):(this.updateFrozenCont(d,r,l),"Left-Right"===this.parent.getFrozenMode()&&(i.frozenRightForm=a.querySelector("form"),this.refreshEditForm(i.frozenRightForm,i.rowData),p=this.parent.getFrozenRightRowByIndex(s),this.updateFrozenRightCont(p,r,a)))):(d=this.parent.getRowByIndex(s),t.isBlazor()&&this.parent.isServerRendered?(i.frozen=d,i.cloneFrozen=d.cloneNode(!0),d.parentNode.insertBefore(i.cloneFrozen,d),d.classList.add("e-hiddenrow"),this.updateFrozenCont(i.cloneFrozen,l,r)):(this.updateFrozenCont(d,l,r),"Left-Right"===this.parent.getFrozenMode()&&(i.frozenRightForm=a.querySelector("form"),this.refreshEditForm(i.frozenRightForm,i.rowData),p=this.parent.getFrozenRightRowByIndex(s),this.updateFrozenRightCont(p,a,r)))),t.isBlazor()&&this.parent.isServerRendered?(i.cloneFrozen.appendChild(l),i.cloneFrozen.classList.add("e-editedrow")):(d.appendChild(l),d.classList.add("e-editedrow"),"Left-Right"===this.parent.getFrozenMode()&&(p.appendChild(a),p.classList.add("e-editedrow"),xe(i.frozenRightForm.querySelector("td:not(.e-hide)"),i.form.querySelector("td:not(.e-hide)")))),xe(i.movableForm.querySelector("td:not(.e-hide)"),i.form.querySelector("td:not(.e-hide)"))}},e.prototype.refreshEditForm=function(e,t){this.parent.editSettings.template&&(e.innerHTML="",this.appendChildren(e,t,!1))},e.prototype.updateFrozenRightCont=function(e,t,i){e.innerHTML="",this.renderRightFrozen(t,i),i.querySelector("colgroup").innerHTML=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("colgroup").innerHTML,t.setAttribute("colspan",this.parent.getVisibleFrozenColumns()-this.parent.getFrozenRightColumnsCount()+""),i.setAttribute("colspan",this.parent.getFrozenRightColumnsCount()+"")},e.prototype.updateFrozenCont=function(e,t,i){e.innerHTML="",this.renderMovable(t,i),i.querySelector("colgroup").innerHTML=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").innerHTML,t.setAttribute("colspan",this.parent.getVisibleFrozenColumns()+""),i.setAttribute("colspan",this.parent.getVisibleColumns().length-this.parent.getVisibleFrozenColumns()+"")},e.prototype.renderRightFrozen=function(e,t){t.querySelector("tr").innerHTML="";for(var i=this.parent.getColumns(),r=0,n=0;n<i.length;n++,r++)if("frozen-right"===i[n].getFreezeTableName()){var o=r-this.parent.getMovableColumnsCount();t.querySelector("tr").appendChild(e.querySelector("tr").removeChild(e.querySelector("tr").children[o])),r--}},e.prototype.renderMovable=function(e,t){t.querySelector("tr").innerHTML="";for(var i=this.parent.getColumns(),r=0,n=0;n<i.length;n++,r++)"movable"===i[n].getFreezeTableName()&&(t.querySelector("tr").appendChild(e.querySelector("tr").removeChild(e.querySelector("tr").children[r])),r--)},e.prototype.getEditElement=function(e,i,r,n,o){var s=this.parent,l=0,a=t.isNullOrUndefined(s.detailTemplate)&&t.isNullOrUndefined(s.childGrid)?0:1;s.allowGrouping&&(l=s.groupSettings.columns.length);var h=this.parent.createElement("td",{className:"e-editcell e-normaledit",attrs:{colspan:(s.getVisibleColumns().length-s.getVisibleFrozenColumns()+this.parent.getIndentCount()).toString()}}),d=n.form=this.parent.createElement("form",{id:s.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)return this.appendChildren(d,n.rowData,o),h.appendChild(d),h;var p=this.parent.createElement("table",{className:"e-table e-inline-edit",attrs:{cellspacing:"0.25"}});p.appendChild(s.getContentTable().querySelector("colgroup").cloneNode(!0));var c=this.parent.createElement("tbody"),u=this.parent.createElement("tr"),g=0;for(a&&u.insertBefore(this.parent.createElement("td",{className:"e-detailrowcollapse"}),u.firstChild),s.isRowDragable()&&u.appendChild(this.parent.createElement("td",{className:"e-dragindentcell"}));g<l;)u.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),g++;var f=0;for(g=0;i&&f<r.length&&g<s.getColumns().length||g<s.getColumns().length;){var m=i?r[f].getAttribute("colspan"):null,y=s.getColumns()[g],v=this.parent.createElement("td",{className:"e-rowcell",attrs:{style:"text-align:"+(y.textAlign?y.textAlign:""),colspan:m||""}});y.visible?(v.appendChild(e[y.uid]),"Vertical"===this.parent.rowRenderingMode&&(F(v,{"data-cell":y.headerText}),0===g&&v.classList.add("e-responsive-editcell")),"booleanedit"===y.editType?v.classList.add("e-boolcell"):(y.commands||y.commandsTemplate)&&t.addClass([v],"e-unboundcell")):v.classList.add("e-hide"),u.appendChild(v),g=m?g+parseInt(m,10):g+1,f++}return c.appendChild(u),p.appendChild(c),d.appendChild(p),h.appendChild(d),h},e.prototype.removeEventListener=function(){},e.prototype.appendChildren=function(e,i,r){var n=this,o=t.extend({},i,{isAdd:!this.isEdit,isFrozen:r},!0),s=this.parent.element.id+"editSettingsTemplate";this.parent.isReact&&"string"!=typeof this.parent.editSettings.template?(this.parent.getEditTemplate()(o,this.parent,"editSettingsTemplate",s,null,null,e),this.parent.renderTemplates()):q(e,this.parent.getEditTemplate()(o,this.parent,"editSettingsTemplate",s));var l=function(){for(var e=n.parent.getColumns(),t=0;t<e.length;t++)e[t].validationRules&&(n.parent.editModule.formObj.rules[e[t].field]=e[t].validationRules)};t.updateBlazorTemplate(s,"Template",this.parent.editSettings,!0,l)},e}(),Vn=function(){function e(e){this.parent=e}return e.prototype.update=function(e,i){if(t.isBlazor()&&this.parent.isServerRendered){i.cloneCell.innerHTML="",i.cloneCell.appendChild(this.getEditElement(e,i)),i.cloneCell.classList.remove("e-ellipsistooltip"),i.cloneCell.classList.add("e-editedbatchcell"),t.classList(i.row,["e-editedrow","e-batchrow"],[])}else{if(this.parent.isReact&&i.columnObject&&i.columnObject.template){var r=i.cell.parentElement,n=i.cell.cloneNode(!0);r.insertBefore(n,r.children[parseInt(i.cell.getAttribute("aria-colindex"),10)]),n.focus(),i.cell.remove(),i.cell=n}i.cell.innerHTML="",i.cell.appendChild(this.getEditElement(e,i)),i.cell.classList.remove("e-ellipsistooltip"),i.cell.classList.add("e-editedbatchcell"),t.classList(i.row,["e-editedrow","e-batchrow"],[])}},e.prototype.getEditElement=function(e,t){var i=this.parent,r=this.parent.createElement("form",{id:i.element.id+"EditForm",className:"e-gridform"});return r.appendChild(e[t.columnObject.uid]),"booleanedit"===t.columnObject.editType&&t.cell.classList.add("e-boolcell"),t.columnObject.editType||t.cell.classList.add("e-inputbox"),r},e.prototype.removeEventListener=function(){},e}(),Gn=function(){function i(e,t){this.parent=e,this.serviceLocator=t,this.parent.isDestroyed||(this.parent.on(ei,this.destroy,this),this.parent.on(Ut,this.destroy,this))}return i.prototype.setLocaleObj=function(){this.l10n=this.serviceLocator.getService("localization")},i.prototype.addNew=function(e,t){this.isEdit=!1,this.createDialog(e,t)},i.prototype.update=function(e,t){this.isEdit=!0,this.createDialog(e,t)},i.prototype.createDialogHeader=function(t){var i=this.parent;if(this.parent.enableAdaptiveUI){var r=new er(this.parent,this.serviceLocator);return r.action=this.isEdit?e.ResponsiveDialogAction.isEdit:e.ResponsiveDialogAction.isAdd,r.renderResponsiveHeader(t)}return i.editSettings.headerTemplate?this.getDialogEditTemplateElement("HeaderTemplate",t):this.isEdit?this.l10n.getConstant("EditFormTitle")+t.primaryKeyValue[0]:this.l10n.getConstant("AddFormTitle")},i.prototype.createDialog=function(e,i){var n=this.parent;this.dialog=this.parent.createElement("div",{id:n.element.id+"_dialogEdit_wrapper",styles:"width: auto"}),n.enableAdaptiveUI&&this.dialog.classList.add("e-responsive-dialog"),this.dialog.setAttribute("aria-label","Dialog edit"),n.element.appendChild(this.dialog),this.setLocaleObj(),this.dialogObj=new r.Dialog(t.extend({header:this.createDialogHeader(i),isModal:!0,visible:!0,cssClass:"e-edit-dialog",content:this.getEditElement(e,i),showCloseIcon:!0,allowDragging:!0,close:this.dialogClose.bind(this),created:this.dialogCreated.bind(this),closeOnEscape:!0,width:n.editSettings.template?"auto":"330px",target:i.target?i.target:document.body,animationSettings:{effect:"None"},footerTemplate:n.editSettings.footerTemplate?this.getDialogEditTemplateElement("FooterTemplate",i):null,buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.l10n.getConstant("SaveButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}]},n.editSettings.dialog?n.editSettings.dialog.params||{}:{})),t.isBlazor()?this.dialogObj.locale=this.parent.locale:i.dialog=this.dialogObj;this.dialogObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dialogObj.appendTo(this.dialog),Se(this.parent.element,this.dialogObj.element.parentElement),n.enableAdaptiveUI&&this.dialogObj.show(!0)},i.prototype.dialogCreated=function(){Ke(this.parent)},i.prototype.renderResponsiveDialog=function(){var e=this;this.parent.enableAdaptiveUI&&(this.parent.adaptiveDlgTarget&&(this.dialogObj.target=this.parent.adaptiveDlgTarget),this.dialogObj.buttons=[{}],this.dialogObj.showCloseIcon=!0,this.dialogObj.visible=!1,this.dialogObj.width="100%",this.dialogObj.open=function(){e.dialogObj.element.style.maxHeight="100%"})},i.prototype.btnClick=function(e){this.l10n.getConstant("CancelButton").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialogClose():this.parent.endEdit()},i.prototype.dialogClose=function(){this.parent.closeEdit()},i.prototype.destroy=function(e){for(var i=["template","headerTemplate","footerTemplate"],r=0;r<i.length;r++)if(this.parent.editSettings[i[r]]){var n=i[r].charAt(0).toUpperCase()+i[r].slice(1),o=this.parent.element.id+"editSettings"+n;t.updateBlazorTemplate(o,n,this.parent.editSettings)}this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.parent.notify(Xt,{}),this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),t.remove(this.dialog))},i.prototype.getDialogEditTemplateElement=function(e,i){var r=this.parent.createElement("div",{className:"e-dialog"+e}),n=t.extend({},i.rowData,{isAdd:!this.isEdit},!0),o=this.parent.element.id+"editSettings"+e;return q(r,("HeaderTemplate"===e?this.parent.getEditHeaderTemplate():this.parent.getEditFooterTemplate())(n,this.parent,"editSettings"+e,o)),t.updateBlazorTemplate(o,e,this.parent.editSettings),r},i.prototype.getEditElement=function(e,i){var r=this,n=this.parent,o=this.parent.createElement("div",{className:this.isEdit?"e-editedrow":"e-insertedrow"}),s=i.form=this.parent.createElement("form",{id:n.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template){var l=this.parent.element.id+"editSettingsTemplate",a=t.extend({},i.rowData,{isAdd:!this.isEdit},!0);this.parent.isReact&&"string"!=typeof this.parent.editSettings.template?(this.parent.getEditTemplate()(a,this.parent,"editSettingsTemplate",l,null,null,s),this.parent.renderTemplates()):q(s,this.parent.getEditTemplate()(a,this.parent,"editSettingsTemplate",l));var h=function(){for(var e=r.parent.getColumns(),t=0;t<e.length;t++)e[t].validationRules&&(r.parent.editModule.formObj.rules[e[t].field]=e[t].validationRules)};return t.updateBlazorTemplate(l,"Template",this.parent.editSettings,!0,h),o.appendChild(s),o}for(var d=this.parent.createElement("table",{className:"e-table",attrs:{cellspacing:"6px"}}),p=this.parent.createElement("tbody"),c=n.getColumns(),u=0;u<c.length;u++)if(!(this.parent.editModule.checkColumnIsGrouped(c[u])||c[u].commands||c[u].commandsTemplate||"checkbox"===c[u].type)){var g=this.parent.createElement("tr"),f=this.parent.createElement("td",{className:"e-rowcell",attrs:{style:"text-align:"+(this.parent.enableRtl?"right":"left")+";width:190px"}});this.parent.createElement("label",{innerHTML:c[u].field});e[c[u].uid].classList.remove("e-input"),f.appendChild(e[c[u].uid]),g.appendChild(f),p.appendChild(g)}return d.appendChild(p),s.appendChild(d),o.appendChild(s),o},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ei,this.destroy),this.parent.off(Ut,this.destroy))},i}(),_n=function(){function i(e,t){this.editType={Inline:jn,Normal:jn,Batch:Vn,Dialog:Gn},this.parent=e,this.serviceLocator=t,this.renderer=new this.editType[this.parent.editSettings.mode](e,t),this.focus=t.getService("focus")}return i.prototype.addNew=function(e){this.renderer.addNew(this.getEditElements(e),e),this.convertWidget(e)},i.prototype.update=function(e){this.renderer.update(this.getEditElements(e),e),this.parent.notify("edit-form",e),this.convertWidget(e)},i.prototype.convertWidget=function(e){var i,r,n,o,s=this.parent,l=s.isFrozenGrid(),a="Right"===s.getFrozenMode()&&"Normal"===s.editSettings.mode?1:0,h="Dialog"===s.editSettings.mode?t.select("#"+s.element.id+"_dialogEdit_wrapper .e-gridform",document):s.element.querySelectorAll(".e-gridform")[a];if(l&&"Normal"===s.editSettings.mode){var d=parseInt(e.row.getAttribute("aria-rowindex"),10);s.frozenRows&&("add"===e.requestType&&"Top"===s.editSettings.newRowPosition||d<s.frozenRows)?(n=s.element.querySelector(".e-movableheader").querySelector(".e-gridform"),"Left-Right"===this.parent.getFrozenMode()&&(o=e.frozenRightForm)):(n=s.element.querySelector(".e-movablecontent").querySelector(".e-gridform"),"Left-Right"===this.parent.getFrozenMode()&&(o=e.frozenRightForm))}for(var p=0,c="Batch"!==s.editSettings.mode?s.getColumns():[s.getColumnByField(e.columnName)];p<c.length;p++){var u=c[p];if(!this.parent.editSettings.template||t.isNullOrUndefined(u.field)){if(!this.parent.editModule.checkColumnIsGrouped(u)&&!u.commands){u.valueAccessor(u.field,e.rowData,u),r="movable"===u.getFreezeTableName()&&"Normal"===s.editSettings.mode?n.querySelector("[e-mappinguid="+u.uid+"]"):o&&"frozen-right"===u.getFreezeTableName()&&"Normal"===s.editSettings.mode?o.querySelector("[e-mappinguid="+u.uid+"]"):h.querySelector("[e-mappinguid="+u.uid+"]");var g=u.edit.write;t.isNullOrUndefined(r)||("string"==typeof g?(g=ce(g,window))({rowData:e.rowData,element:r,column:u,requestType:e.requestType,row:e.row,foreignKeyData:u.isForeignColumn()&&ce(u.field,e.foreignKeyData)}):u.edit.write({rowData:e.rowData,element:r,column:u,requestType:e.requestType,row:e.row,foreignKeyData:u.isForeignColumn()&&ce(u.field,e.foreignKeyData)}),i||r.getAttribute("disabled")||(this.focusElement(r,e.type),i=!0))}}else{var f=t.extend({},e);f.element=h.querySelector("[name="+W(u.field)+"]"),t.isNullOrUndefined(f.element)&&l&&(f.element=n.querySelector("[name="+W(u.field)+"]")),"string"==typeof u.edit.write?ce(u.edit.write,window)(f):u.edit.write(f)}}if(l&&!this.parent.allowTextWrap&&("add"===e.requestType||"beginEdit"===e.requestType)&&"Dialog"!==this.parent.editSettings.mode&&!t.isNullOrUndefined(h)&&!t.isNullOrUndefined(n)){var m=n.querySelector("tr").children[0],y=h.querySelector("tr").children[0];if(y.offsetHeight>m.offsetHeight)m.style.height=y.offsetHeight+"px",o&&((v=n.querySelector("tr").children[0]).style.height=y.offsetHeight+"px");else if(y.style.height=m.offsetHeight+"px",o){var v=n.querySelector("tr").children[0];v.style.height=m.offsetHeight+"px"}}},i.prototype.focusElement=function(e,i){var r=this.parent.element.querySelector(".e-edit-checkselect");t.isNullOrUndefined(r)||r.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode?this.focus.onClick({target:t.closest(e,"td")},!0):!this.parent.enableVirtualization||"Normal"!==this.parent.editSettings.mode||this.parent.enableVirtualization&&"Bottom"===this.parent.editSettings.newRowPosition&&O(e,"e-addedrow")?e.focus():e.focus({preventScroll:!0}),e.classList.contains("e-defaultcell")&&e.setSelectionRange(e.value.length,e.value.length)},i.prototype.getEditElements=function(i){var r=this,n=this.parent,o={},s="Batch"!==n.editSettings.mode?n.getColumns():[n.getColumnByField(i.columnName)];if(this.parent.editSettings.template)return{};for(var l=0,a=s.length;l<a;l++){var h=s[l];if(!this.parent.editModule.checkColumnIsGrouped(h))if(h.commands||h.commandsTemplate){var d=void 0,p=this.serviceLocator.getService("cellRendererFactory"),c=new Ci(this.parent),u=p.getCellRenderer(e.CellType.CommandColumn),g=(d=c.generateRows(i.rowData)[0].cells).filter(function(e){return e.rowID}),f=u.render(g[l],i.rowData,{index:i.row?i.row.getAttribute("aria-rowindex"):0});(b=f.firstElementChild).setAttribute("textAlign",f.getAttribute("textAlign")),o[h.uid]=b}else{var m={column:h,value:h.valueAccessor(h.field,i.rowData,h),type:i.requestType,data:i.rowData},y=h.edit.create,v=void 0;if(h.editTemplate){v=this.parent.createElement("span",{attrs:{"e-mappinguid":h.uid}});var C=this.parent.element.id+h.uid+"editTemplate",w=me({},i.rowData,{column:h});if(this.parent.isReact&&"string"!=typeof h.editTemplate?(h.getEditTemplate()(t.extend({index:i.rowIndex},w),this.parent,"editTemplate",C,null,null,v),this.parent.renderTemplates()):q(v,h.getEditTemplate()(t.extend({index:i.rowIndex},w),this.parent,"editTemplate",C)),t.isBlazor()){t.updateBlazorTemplate(C,"EditTemplate",h,!0,function(e){var t=e;return function(){r.parent.editModule.formObj.rules[t.field]=t.validationRules}}(h))}}else{if("string"==typeof(v="string"==typeof y?(y=ce(y,window))(m):h.edit.create(m))){var b=this.parent.createElement("div");b.innerHTML=v,v=b.firstChild}var S="input"!==v.tagName&&v.querySelectorAll("input").length,x=W(h.field);t.attributes(S?v.querySelector("input"):v,{name:x,"e-mappinguid":h.uid,id:n.element.id+x}),t.classList(v,["e-input","e-field"],[]),"Right"===h.textAlign&&v.classList.add("e-ralign"),((h.isPrimaryKey||h.isIdentity)&&"beginEdit"===i.requestType||h.isIdentity&&"add"===i.requestType)&&v.setAttribute("disabled","")}o[h.uid]=v}}return o},i.prototype.destroy=function(){this.renderer.removeEventListener()},i}(),Wn=function(){function e(e){this.activeClasses=["e-selectionbackground","e-active"],this.parent=e}return e.prototype.create=function(e){var t=e.column,i="e-field e-boolcell";"checkbox"===t.type&&(i="e-field e-boolcell e-edit-checkselect");var r=W(e.column.field);return this.parent.createElement("input",{className:i,attrs:{type:"checkbox",value:e.value,"e-mappinguid":t.uid,id:this.parent.element.id+r,name:r}})},e.prototype.read=function(e){return e.checked},e.prototype.write=function(e){var i,r;"add"===e.requestType||e.row.classList.contains("e-addedrow");if(t.isNullOrUndefined(e.row)||(i=e.row.querySelector(".e-edit-checkselect")),ce(e.column.field,e.rowData)&&(r=JSON.parse(ce(e.column.field,e.rowData).toString().toLowerCase())),!t.isNullOrUndefined(i)&&"checkbox"===e.column.type){if(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType){var o=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));r=!!o&&o.isSelected}$.apply(void 0,[[].slice.call(e.row.querySelectorAll(".e-rowcell")),r].concat(this.activeClasses))}this.obj=new n.CheckBox(t.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:r,disabled:!Q(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.checkBoxChange.bind(this)},e.column.edit.params)),t.isBlazor()&&(this.obj.locale=this.parent.locale),this.obj.appendTo(e.element)},e.prototype.checkBoxChange=function(e){if(this.editRow&&"Dialog"!==this.editType){var t=!1;e.checked?(t=!0,this.editRow.setAttribute("aria-selected",t.toString())):this.editRow.removeAttribute("aria-selected"),$.apply(void 0,[[].slice.call(this.editRow.querySelectorAll(".e-rowcell")),t].concat(this.activeClasses))}},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Kn=function(){function e(e){this.parent=e,this.flag=!1}return e.prototype.create=function(e){var t=W(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.write=function(e){this.column=e.column;var r="Dialog"!==this.parent.editSettings.mode,n=new i.Predicate(e.column.field,"notequal",null,!0,!1);this.obj=new s.DropDownList(t.extend({dataSource:this.parent.dataSource instanceof i.DataManager?this.parent.dataSource:new i.DataManager(this.parent.dataSource),query:(new i.Query).where(n).select(e.column.field),enabled:Q(e.column,e.requestType,e.element),fields:{value:e.column.field},value:ce(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.ddActionComplete.bind(this),created:this.dropdownCreated.bind(this),placeholder:r?"":e.column.headerText,popupHeight:"200px",floatLabelType:r?"Never":"Always",open:this.dropDownOpen.bind(this),sortOrder:"Ascending"},e.column.edit.params)),this.obj.query.params=this.parent.query.params,t.isBlazor()&&(this.obj.locale=this.parent.locale),this.obj.appendTo(e.element),e.element.setAttribute("name",W(e.column.field))},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.dropdownCreated=function(e){this.flag=!0},e.prototype.ddActionComplete=function(e){e.result=i.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.flag&&this.column.dataSource&&("result"in this.column.dataSource?this.column.dataSource.result=e.result:this.column.dataSource instanceof i.DataManager&&(this.column.dataSource.dataSource.json=e.result)),this.flag=!1},e.prototype.dropDownOpen=function(e){var i=O(this.obj.element,"e-dialog");if("Dialog"===this.parent.editSettings.mode&&!t.isNullOrUndefined(i)){var r=t.select("#"+i.id,document).ej2_instances[0];e.popup.element.style.zIndex=(r.zIndex+1).toString()}},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Qn=function(){function e(e){this.parent=e}return e.prototype.keyEventHandler=function(e){if(13===e.keyCode||9===e.keyCode){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.dispatchEvent(t)}},e.prototype.create=function(e){var i=W(e.column.field);return this.instances=new t.Internationalization(this.parent.locale),this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+i,name:i,"e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return this.obj.value},e.prototype.write=function(e){var i=e.column,r="Dialog"!==this.parent.editSettings.mode;this.obj=new o.NumericTextBox(t.extend({value:parseFloat(ce(e.column.field,e.rowData)),enableRtl:this.parent.enableRtl,placeholder:r?"":e.column.headerText,enabled:Q(e.column,e.requestType,e.element),floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",locale:this.parent.locale},i.edit.params)),e.element.setAttribute("name",W(e.column.field)),this.obj.appendTo(e.element),this.obj.element.addEventListener("keydown",this.keyEventHandler)},e.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy())},e}(),Jn=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var i=e.column;return this.parent.createElement("input",{className:"e-field e-input e-defaultcell",attrs:{type:"text",value:t.isNullOrUndefined(e.value)?"":e.value,"e-mappinguid":i.uid,id:this.parent.element.id+W(i.field),name:W(i.field),style:"text-align:"+i.textAlign}})},e.prototype.read=function(e){return e.value},e.prototype.write=function(e){var i=e.column,r="Dialog"!==this.parent.editSettings.mode;this.obj=new o.TextBox(t.extend({element:e.element,floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",enableRtl:this.parent.enableRtl,enabled:Q(e.column,e.requestType,e.element),placeholder:r?"":e.column.headerText},i.edit.params)),this.obj.appendTo(e.element)},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Xn=function(){function e(e,t,i){this.args={},this.currentVirtualData={},this.parent=e,this.renderer=i,this.serviceLocator=t,this.addEventListener()}return e.prototype.clickHandler=function(e){var t=e.target,i=this.parent;(O(t,"e-gridcontent")&&O(O(t,"e-gridcontent"),"e-grid").id===i.element.id||i.frozenRows&&O(t,"e-headercontent"))&&!O(t,"e-unboundcelldiv")&&(this.rowIndex=O(t,"e-rowcell")?parseInt(t.parentElement.getAttribute("aria-rowindex"),10):-1,i.isEdit&&i.editModule.endEdit())},e.prototype.dblClickHandler=function(e){O(e.target,"e-rowcell")&&this.parent.editSettings.allowEditOnDblClick&&this.parent.editModule.startEdit(O(e.target,"e-row"))},e.prototype.editComplete=function(e){this.parent.isEdit=!1;switch(t.isBlazor()&&!this.parent.isJsComponent&&(e.rows=null),e.requestType){case"save":(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&this.parent.isPersistSelection||"edit"!==e.action&&this.parent.selectRow(0),this.parent.trigger(vt,t.extend(e,{requestType:"save",type:vt}));break;case"delete":if(t.isBlazor()&&!this.parent.isJsComponent){var i="data";e[i]=e[i][0]}this.parent.trigger(vt,t.extend(e,{requestType:"delete",type:vt})),this.parent.isCheckBoxSelection||this.parent.selectRow(this.editRowIndex)}},e.prototype.startEdit=function(e){var i=this,r=this.parent,n=r.getPrimaryKeyFieldNames(),o=[];if(this.rowIndex=this.editRowIndex=parseInt(e.getAttribute("aria-rowindex"),10),r.enableVirtualization||r.enableInfiniteScrolling){var s='.e-row[aria-rowindex="'+this.rowIndex+'"]';if(!this.parent.element.querySelector(s))return}if(t.isBlazor())for(var l=this.parent.getColumns(),a=0;a<l.length;a++){var h=l[a];h.template&&t.resetBlazorTemplate(r.element.id+h.uid,"Template",this.rowIndex)}if(pe(r)){var d=r.getRowObjectFromUID(e.getAttribute("data-uid"));this.previousData=d.data}else if(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling){var p={data:this.previousData,index:this.rowIndex};this.parent.notify("virtual-scroll-edit-action-begin",p),this.previousData=p.data}else this.previousData=t.extend({},{},r.getCurrentViewRecords()[this.rowIndex],!0);for(a=0;a<n.length;a++)o.push(ce(n[a],this.previousData));this.uid=e.getAttribute("data-uid");var c=r.getRowObjectFromUID(this.uid),u={primaryKey:n,primaryKeyValue:o,requestType:"beginEdit",rowData:this.previousData,rowIndex:this.rowIndex,type:"edit",cancel:!1,foreignKeyData:c&&c.foreignKeyData,target:void 0};t.isBlazor()&&!this.parent.isJsComponent||(u.row=e),r.trigger("beginEdit",u,function(n){n.type="actionBegin",r.trigger(yt,n,function(n){if(!n.cancel){r.isEdit=!0,n.row=n.row?n.row:e,t.isBlazor()&&r.isServerRendered&&(i.originalRow=n.row,i.cloneRow=n.row.cloneNode(!0),n.cloneRow=i.cloneRow),"Dialog"!==r.editSettings.mode&&r.clearSelection(),"Dialog"===r.editSettings.mode&&r.selectionModule&&(r.selectionModule.preventFocus=!0,n.row.classList.add("e-dlgeditrow")),i.renderer.update(n),t.isBlazor()&&(n.form=null,i.cloneFrozen=n.cloneFrozen,i.frozen=n.frozen,i.cloneRow=n.cloneRow,i.originalRow=n.row),i.uid=e.getAttribute("data-uid"),r.editModule.applyFormValidation(),n.type="actionComplete",r.trigger(vt,n),i.args=n,i.parent.allowTextWrap&&i.parent.notify(ii,{case:"textwrap"}),t.isBlazor()&&(i.parent.notify(Xt,{}),r.element.querySelector(".e-gridpopup").style.display="none",i.parent.notify("start-edit",{}))}})})},e.prototype.updateRow=function(e,t){var i=this,r=this.parent;this.editRowIndex=e;var n={requestType:"save",action:"edit",type:yt,data:t,cancel:!1,previousData:r.getCurrentViewRecords()[e],row:r.getRowByIndex(e)};r.showSpinner(),r.notify($t,n),n.promise?n.promise.then(function(){return r.refresh()}).catch(function(e){return i.edFail(e)}):r.refresh()},e.prototype.editFormValidate=function(){var e=this.parent,t=e.editModule.formObj.validate(),i=!e.editModule.mFormObj||e.editModule.mFormObj.validate(),r=!e.editModule.frFormObj||e.editModule.frFormObj.validate();return t&&i&&r},e.prototype.endEdit=function(){var e=this.parent;if(this.parent.isEdit&&this.editFormValidate()){var i=t.extend({},{},this.previousData,!0),r=t.extend(this.args,{requestType:"save",type:yt,data:i,cancel:!1,previousData:this.previousData,selectedRow:e.selectedRowIndex,foreignKeyData:{}}),n="Right"===e.getFrozenMode()?1:0,o="Dialog"===e.editSettings.mode,s=t.select("#"+e.element.id+"_dialogEdit_wrapper",document),l=o?s.querySelector(".e-gridform"):e.element.querySelectorAll(".e-gridform")[n],a={virtualData:{},isAdd:!1};if(this.parent.notify(hi,a),!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||"Normal"!==this.parent.editSettings.mode||l?i=e.editModule.getCurrentEditedData(l,i):this.parent.isEdit&&(this.currentVirtualData=i=r.data=a.virtualData),e.isFrozenGrid()&&"Normal"===e.editSettings.mode){var h=e.getMovableVirtualHeader().querySelector(".e-gridform"),d=e.getMovableVirtualContent().querySelector(".e-gridform"),p=[h||d],c=void 0,u=void 0,g=[];"Left-Right"===e.getFrozenMode()&&(c=e.getFrozenRightHeader().querySelector(".e-gridform"),u=e.getFrozenRightContent().querySelector(".e-gridform"),g=[c||u]),Le(this.parent,function(t,r){for(var n=0,o=r;n<o.length;n++){var s=o[n];s&&(i=e.editModule.getCurrentEditedData(s,i))}},[[],p,g])}if(t.isBlazor()){r.form=null,r.movableForm=null,r.row={}}var f=[].slice.call(e.element.querySelectorAll(".e-editedrow")).length;if(a.isAdd||!Object.keys(this.currentVirtualData).length||f||(f=1),o?s.querySelectorAll(".e-editedrow").length:f)r.action="edit",e.trigger(yt,r,function(t){t.cancel||(e.showSpinner(),e.notify($t,t))});else if(r.action="add",r.selectedRow=0,r.index=this.addedRowIndex,e.notify("virtual-scroll-edit-success",{}),e.notify(Bt,r),this.addedRowIndex=null,r.cancel)return}},e.prototype.destroyElements=function(){var e=this.parent;e.editModule.destroyWidgets(),e.editModule.destroyForm(),this.parent.notify(ei,{})},e.prototype.editHandler=function(e){var t=this;e.promise?e.promise.then(function(i){return t.edSucc(i,e)}).catch(function(e){return t.edFail(e)}):this.editSuccess(e.data,e)},e.prototype.edSucc=function(e,t){this.editSuccess(e,t)},e.prototype.edFail=function(e){if(t.isBlazor()&&this.parent.isServerRendered){t.isNullOrUndefined(e.error)||t.isNullOrUndefined(e.error.message)||(e.error=e.error.message)}this.editFailure(e)},e.prototype.updateCurrentViewData=function(e){this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||(this.parent.getCurrentViewRecords()[this.editRowIndex]=e)},e.prototype.requestSuccess=function(e){this.parent.editModule.formObj&&!this.parent.editModule.formObj.isDestroyed&&(this.destroyElements(),this.stopEditStatus(),"Dialog"===this.parent.editSettings.mode&&"add"!==e.action&&this.parent.selectionModule&&this.parent.element.querySelector(".e-dlgeditrow").classList.remove("e-dlgeditrow"))},e.prototype.editSuccess=function(e,i){if(!(t.isNullOrUndefined(e)||e instanceof Array)){i.data=t.extend({},t.extend({},i.rowData,i.data),e)}var r;if(this.requestSuccess(i),this.parent.trigger("beforeDataBound",i),i.type=vt,this.parent.isEdit=!1,t.isBlazor()&&this.parent.isServerRendered){this.closeForm();var n="rowIndex";r={requestType:i.requestType,rowIndex:i[n],action:i.action,data:i.data},this.parent.notify("editsuccess",r)}else this.refreshRow(i.data);this.parent.notify("virtual-scroll-edit-success",i),this.parent.editModule.checkLastRow(i.row),this.parent.editModule.isLastRow=!1,this.updateCurrentViewData(i.data),this.blazorTemplate(),t.isBlazor()&&this.parent.isServerRendered||(this.editRowIndex=null,this.parent.trigger(vt,i)),t.isBlazor()&&this.parent.notify(Xt,{}),(!this.parent.isCheckBoxSelection&&"Multiple"!==this.parent.selectionSettings.type||!this.parent.isPersistSelection&&!this.parent.selectionSettings.checkboxOnly)&&"Dialog"!==this.parent.editSettings.mode&&(t.isBlazor()&&this.parent.isServerRendered?r[n="editRowIndex"]=this.rowIndex>-1?this.rowIndex:this.editRowIndex:this.parent.selectRow(this.rowIndex>-1?this.rowIndex:this.editRowIndex)),this.parent.hideSpinner()},e.prototype.closeForm=function(){!this.cloneRow&&this.parent.isEdit&&this.stopEditStatus(),this.cloneRow&&(this.cloneRow.remove(),this.cloneRow=null,this.originalRow.classList.remove("e-hiddenrow")),this.parent.isFrozenGrid()&&this.cloneFrozen&&(this.cloneFrozen.remove(),this.frozen.classList.remove("e-hiddenrow"))},e.prototype.blazorTemplate=function(){var e=this.parent.getColumns();this.parent.editSettings.template&&"Normal"===this.parent.editSettings.mode&&t.updateBlazorTemplate(this.parent.element.id+"editSettingsTemplate","Template",this.parent.editSettings);for(var i=0;i<e.length;i++){var r=e[i];r.template&&t.updateBlazorTemplate(this.parent.element.id+r.uid,"Template",r,!1),r.editTemplate&&t.updateBlazorTemplate(this.parent.element.id+r.uid+"editTemplate","EditTemplate",r)}},e.prototype.editFailure=function(e){this.parent.trigger("actionFailure",t.isBlazor()&&e instanceof Array?e[0]:{error:e}),this.parent.hideSpinner(),this.parent.log("actionfailure",{error:e})},e.prototype.needRefresh=function(){var e=!0,t=this.parent.element.querySelector(".e-gridform");return!this.parent.enableVirtualization&&!this.parent.infiniteScrollSettings.enableCache||"Normal"!==this.parent.editSettings.mode||t||(e=!1),e},e.prototype.refreshRow=function(e){var t=this.parent.isFrozenGrid(),i=new vi(this.serviceLocator,null,this.parent),r=this.parent.getRowObjectFromUID(this.uid);if(r){r.changes=e,this.parent.notify("refresh-virtual-cache",e),se(r,this.parent.getForeignKeyColumns(),r.changes),this.needRefresh()&&i.refresh(r,this.parent.getColumns(),!0);var n=[].slice.call(this.parent.element.querySelectorAll('[aria-rowindex="'+r.index+'"]'));if(t&&n.length)for(var o=0;o<n.length;o++){var s=n[o].getAttribute("data-uid");s!==this.uid&&((r=this.parent.getRowObjectFromUID(s)).changes=e,i.refresh(r,this.parent.getColumns(),!0),this.parent.editModule.checkLastRow(n[o]))}}},e.prototype.closeEdit=function(){var e=this;if(this.parent.isEdit){var i=this.parent,r=t.extend(this.args,{requestType:"cancel",type:yt,cancel:!1,data:this.previousData,selectedRow:i.selectedRowIndex});if(i.notify("virtual-scroll-edit-cancel",r),this.blazorTemplate(),t.isBlazor()){r.form=null}i.trigger(yt,r,function(r){if(!r.cancel){"Dialog"===e.parent.editSettings.mode&&e.parent.notify(ei,{}),i.isEdit=!1,e.stopEditStatus(),r.type=vt,"Dialog"!==i.editSettings.mode&&(t.isBlazor()&&i.isServerRendered?e.closeForm():e.refreshRow(r.data));var n=i.groupSettings.enableLazyLoading&&i.groupSettings.columns.length&&!i.getContentTable().querySelector("tr.e-emptyrow");i.getContentTable().querySelector("tr.e-emptyrow")||i.getContentTable().querySelector("tr.e-row")||n||i.renderModule.emptyRow(),"Dialog"!==i.editSettings.mode&&i.selectRow(e.rowIndex),i.trigger(vt,r),t.isBlazor()&&(e.parent.notify(Xt,{}),e.parent.notify("close-edit",{}))}})}},e.prototype.addRecord=function(e,r){var n=this,o=this.parent;if(this.addedRowIndex=r=t.isNullOrUndefined(r)?0:r,e)return void o.notify(Bt,{requestType:"save",type:yt,data:e,selectedRow:0,action:"add",index:r});if(!o.isEdit){this.previousData={},this.uid="";for(var s=o.columnModel,l=0;l<s.length;l++)s[l].field&&i.DataUtil.setValue(s[l].field,s[l].defaultValue,this.previousData);var a={cancel:!1,foreignKeyData:{},requestType:"add",data:this.previousData,type:yt,index:r,rowData:this.previousData,target:void 0},h={virtualData:{}};if(this.parent.notify(hi,h),(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&Object.keys(h.virtualData).length&&(a.data=a.rowData=h.virtualData),t.isBlazor()){a.form=null}o.trigger(yt,a,function(e){e.cancel||(o.isEdit=!0,"Dialog"!==o.editSettings.mode&&o.clearSelection(),n.renderer.addNew(e),o.editModule.applyFormValidation(),e.type=vt,e.row=o.element.querySelector(".e-addedrow"),o.trigger(vt,e),t.isBlazor()&&(n.parent.notify(Xt,{}),n.parent.notify("start-add",{})),n.args=e)})}},e.prototype.deleteRecord=function(e,i){if(this.editRowIndex=this.parent.selectedRowIndex,i){i=i instanceof Array?i:[i];var r=this.parent,n=Object.keys(i).length;e=e||this.parent.getPrimaryKeyFieldNames()[0];for(var o=0;o<n;o++)!function(t){var n,o,s=r.currentViewData.some(function(r){return o=r,i[t]===ce(e,r)||i[t]===r});i[t]=s?o:i[t][e]?i[t]:(n={},n[e]=i[t],n)}(o)}var s={requestType:"delete",type:yt,foreignKeyData:{},data:i||this.parent.getSelectedRecords(),tr:this.parent.getSelectedRows(),cancel:!1};if(t.isNullOrUndefined(this.parent.commandDelIndex)||(s.data[0]=this.parent.getRowObjectFromUID(this.parent.getRowByIndex(this.parent.commandDelIndex).getAttribute("data-uid")).data),this.parent.enableVirtualization&&s.data.length>1){var l=this.parent.getSelectedRows()[0].getAttribute("data-uid");s.data=[this.parent.getRowObjectFromUID(l).data]}t.isBlazor()&&!this.parent.isJsComponent&&(s.data=s.data[0]),this.parent.notify(Bt,s)},e.prototype.stopEditStatus=function(){for(var e=this.parent,i=[].slice.call(e.element.querySelectorAll(".e-addedrow")),r=[].slice.call(e.element.querySelectorAll(".e-editedrow")),n=0;n<i.length;n++)t.remove(i[n]);for(n=0;n<r.length;n++)r[n].classList.remove("e-editedrow")},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("crud-Action",this.editHandler,this),this.parent.on("double-tap",this.dblClickHandler,this),this.parent.on(Ht,this.clickHandler,this),this.parent.on("recordAdded",this.requestSuccess,this),this.parent.on("dblclick",this.dblClickHandler,this),this.parent.on("delete-complete",this.editComplete,this),this.parent.on("save-complete",this.editComplete,this),this.parent.on("row-mode-change",this.closeEdit,this),this.parent.on("closeinline",this.closeForm,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("crud-Action",this.editHandler),this.parent.off("double-tap",this.dblClickHandler),this.parent.off(Ht,this.clickHandler),this.parent.off("recordAdded",this.requestSuccess),this.parent.off("dblclick",this.dblClickHandler),this.parent.off("delete-complete",this.editComplete),this.parent.off("save-complete",this.editComplete),this.parent.off("row-mode-change",this.closeEdit),this.parent.off("closeinline",this.closeForm))},e.prototype.destroy=function(){this.removeEventListener(),this.renderer.destroy()},e}(),Yn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$n=function(e){function t(t,i,r){var n=e.call(this,t,i)||this;return n.parent=t,n.serviceLocator=i,n.renderer=r,n}return Yn(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,i){e.prototype.addRecord.call(this,t,i)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,i){e.prototype.updateRow.call(this,t,i)},t.prototype.deleteRecord=function(t,i){e.prototype.deleteRecord.call(this,t,i)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(Xn),Zn=function(){function r(e,t,i){this.cellDetails={},this.originalCell={},this.cloneCell={},this.editNext=!1,this.preventSaveCell=!1,this.parent=e,this.serviceLocator=t,this.renderer=i,this.focus=t.getService("focus"),this.addEventListener()}return r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ht,this.clickHandler,this),this.parent.on("dblclick",this.dblClickHandler,this),this.parent.on(Nt,this.onBeforeCellFocused,this),this.parent.on("cellfocused",this.onCellFocused,this),this.dataBoundFunction=this.dataBound.bind(this),this.batchCancelFunction=this.batchCancel.bind(this),this.parent.addEventListener(Ct,this.dataBoundFunction),this.parent.addEventListener("batchCancel",this.batchCancelFunction),this.parent.on("double-tap",this.dblClickHandler,this),this.parent.on(qt,this.keyDownHandler,this),this.parent.on("editNextValCell",this.editNextValCell,this),this.parent.on("closebatch",this.closeForm,this))},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ht,this.clickHandler),this.parent.off("dblclick",this.dblClickHandler),this.parent.off(Nt,this.onBeforeCellFocused),this.parent.off("cellfocused",this.onCellFocused),this.parent.removeEventListener(Ct,this.dataBoundFunction),this.parent.removeEventListener("batchCancel",this.batchCancelFunction),this.parent.off("double-tap",this.dblClickHandler),this.parent.off(qt,this.keyDownHandler),this.parent.off("editNextValCell",this.editNextValCell),this.parent.off("closebatch",this.closeForm))},r.prototype.batchCancel=function(e){this.parent.focusModule.restoreFocus()},r.prototype.dataBound=function(){this.parent.notify(Xt,{})},r.prototype.destroy=function(){this.removeEventListener()},r.prototype.clickHandler=function(e){O(e.target,this.parent.element.id+"_add",!0)||(this.parent.isEdit&&t.closest(this.form,"td")!==t.closest(e.target,"td")&&(this.saveCell(),this.editNextValCell()),O(e.target,"e-rowcell")&&!this.parent.isEdit&&this.setCellIdx(e.target))},r.prototype.dblClickHandler=function(e){var t=O(e.target,"e-rowcell"),i=O(e.target,"e-row");t&&i&&!isNaN(parseInt(t.getAttribute("aria-colindex"),10))&&!t.parentElement.classList.contains("e-editedrow")&&this.editCell(parseInt(i.getAttribute("aria-rowindex"),10),this.parent.getColumns()[parseInt(t.getAttribute("aria-colindex"),10)].field,this.isAddRow(parseInt(i.getAttribute("aria-rowindex"),10)))},r.prototype.onBeforeCellFocused=function(e){this.parent.isEdit&&this.validateFormObj()&&(e.byClick||["tab","shiftTab","enter","shiftEnter"].indexOf(e.keyArgs.action)>-1)&&(e.cancel=!0,e.byClick?e.clickArgs.preventDefault():e.keyArgs.preventDefault())},r.prototype.onCellFocused=function(e){var t=this.parent.getFrozenLeftCount(),i=this.parent.getFrozenRightColumnsCount(),r=this.parent.getContent().querySelector(".e-movablecontent"),n=this.parent.getHeaderContent().querySelector(".e-movableheader"),o=!(e.container.isContent&&e.container.isDataCell||this.parent.frozenRows&&e.container.isHeader);if(!e.byKey||o)return void(this.parent.isEdit&&o&&this.saveCell());var s=e.container.indexes,l=s[0],a=s[1];if(t&&(r.contains(e.element)||this.parent.frozenRows&&n.contains(e.element))&&(a+=t),i){var h=this.parent.getHeaderContent().querySelector(".e-frozen-right-header");(this.parent.getContent().querySelector(".e-frozen-right-content").contains(e.element)||this.parent.frozenRows&&h.contains(e.element))&&(a+=t+this.parent.getMovableColumnsCount())}this.parent.frozenRows&&e.container.isContent&&(l+=this.parent.frozenRows);var d=this.parent.isEdit;if(!this.parent.element.querySelectorAll(".e-popup-open").length)switch(d=d&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":var p=this.parent.getColumns()[e.indexes[1]];p&&!this.parent.isEdit&&this.editCell(e.indexes[0],p.field),(d||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(l,a);break;case"enter":case"shiftEnter":e.keyArgs.preventDefault();var c={cancel:!1,keyArgs:e.keyArgs};this.parent.notify("beforeFocusCellEdit",c),!c.cancel&&d&&this.editCell(l,this.cellDetails.column.field);break;case"f2":this.editCellFromIndex(l,a),this.focus.focus()}},r.prototype.isAddRow=function(e){return this.parent.getDataRows()[e].classList.contains("e-insertedrow")},r.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[t].field,this.isAddRow(e))},r.prototype.closeEdit=function(){var e=this,i=this.parent,r=this.parent.getRowsObject(),n={cancel:!1,batchChanges:this.getBatchChanges()};if(i.notify("before-batch-cancel",n),!n.cancel){var o=this.parent.getColumns();if(t.isBlazor())for(d=0;d<o.length;d++){var s=o[d];s.template&&t.updateBlazorTemplate(this.parent.element.id+s.uid,"Template",s,!1)}i.isEdit&&this.saveCell(!0),this.isAdded=!1,i.clearSelection();for(var l,a=Pe(this.parent),h=this,d=0;d<r.length;d++)!function(t){var i=!1,n=r[t].isDirty;Le(h.parent,function(r,o){(i=e.removeBatchElementChanges(o[t],n))&&o.splice(t,1)},a),i&&t--,l=t}(d),d=l;t.isBlazor()&&i.isServerRendered&&i.selectRow(i.selectionModule.prevRowIndex),i.getContentTable().querySelector("tr.e-row")||i.renderModule.renderEmptyRow();var p={requestType:"batchCancel",rows:this.parent.getRowsObject()};i.notify("batchCancel",{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new fi({isDataRow:!0,cells:[new mi({isDataCell:!0,visible:!0})]})]}),i.selectRow(this.cellDetails.rowIndex),this.refreshRowIdx(),i.notify(Xt,{}),this.parent.notify("tooltip-destroy",{}),p={requestType:"batchCancel",rows:this.parent.getRowsObject()},i.trigger("batchCancel",p)}},r.prototype.removeBatchElementChanges=function(e,i){var r=this.parent,n=new vi(this.serviceLocator,null,this.parent),o=!1;if(i){e.isDirty=i;var s=r.getRowElementByUID(e.uid);if(s&&(s.classList.contains("e-insertedrow")?(t.remove(s),o=!0):(se(e,this.parent.getForeignKeyColumns(),e.data),delete e.changes,delete e.edit,e.isDirty=!1,t.isBlazor()&&r.isServerRendered?(this.removeHideAndSelection(s),this.closeForm()):(t.classList(s,[],["e-hiddenrow","e-updatedtd"]),n.refresh(e,r.getColumns(),!1))),this.parent.aggregates.length>0)){var l=[];l.type="cancel",this.parent.notify("refresh-footer-rendered",l),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",l)}}return o},r.prototype.removeHideAndSelection=function(e){if(e.classList.contains("e-hiddenrow")){e.removeAttribute("aria-selected");for(var i=[].slice.call(e.querySelectorAll(".e-selectionbackground")),r=0;r<i.length;r++)t.removeClass([i[r]],["e-selectionbackground","e-active"])}t.classList(e,[],["e-hiddenrow","e-updatedtd"])},r.prototype.deleteRecord=function(e,t){this.saveCell(),this.validateFormObj()&&this.saveCell(!0),this.isAdded=!1,this.bulkDelete(e,t),this.parent.aggregates.length>0&&(this.parent.notify("refresh-footer-rendered",{}),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",{}))},r.prototype.addRecord=function(e){this.bulkAddRow(e)},r.prototype.endEdit=function(e){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},r.prototype.closeForm=function(){for(var e=0;e<Object.keys(this.originalCell).length;e++)for(var t=0;t<Object.keys(this.cloneCell).length;t++)Object.keys(this.originalCell)[e]===Object.keys(this.cloneCell)[t]&&(this.cloneCell[Object.keys(this.cloneCell)[t]].replaceWith(this.originalCell[Object.keys(this.originalCell)[e]]),this.originalCell[Object.keys(this.originalCell)[e]].classList.contains("e-selectionbackground")&&this.originalCell[Object.keys(this.originalCell)[e]].classList.remove("e-selectionbackground","e-cellselectionbackground","e-active"));this.cloneCell={},this.originalCell={}},r.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},r.prototype.batchSave=function(){var e=this,i=this.parent;if(i.isCheckBoxSelection){var r=i.element.querySelector(".e-checkselectall").parentElement;r.classList.contains("e-checkbox-disabled")&&i.pageSettings.totalRecordsCount>i.currentViewData.length&&t.removeClass([r],["e-checkbox-disabled"])}var n=this.parent.getColumns();if(t.isBlazor())for(var o=0;o<n.length;o++){var s=n[o];s.template&&(t.blazorTemplates[this.parent.element.id+s.uid]=[],t.resetBlazorTemplate(this.parent.element.id+s.uid,"Template"))}if(this.saveCell(),!(i.isEdit||this.editNextValCell()||i.isEdit)){var l=this.getBatchChanges();"Multiple"===this.parent.selectionSettings.type&&l.deletedRecords.length&&this.parent.selectionSettings.persistSelection&&(l.deletedRecords=this.removeSelectedData,this.removeSelectedData=[]);var a={changedRecords:this.parent.getRowsObject().filter(function(e){return e.isDirty&&-1===["add","delete"].indexOf(e.edit)}).map(function(e){return e.data})},h={batchChanges:l,cancel:!1};i.trigger("beforeBatchSave",h,function(r){if(!r.cancel){if(t.isBlazor()&&e.parent.isServerRendered){var n=e.parent.getContent();if(e.closeForm(),t.removeClass(n.querySelectorAll(".e-updatedtd"),["e-updatedtd"]),n.querySelector(".e-insertedrow, .e-hiddenrow")){t.removeClass(n.querySelectorAll(".e-hiddenrow"),["e-hiddenrow"]);for(var o=[].slice.call(n.querySelectorAll(".e-insertedrow")),s=0;s<o.length;s++)o[s].remove()}e.refreshRowIdx()}i.showSpinner(),i.notify("bulk-save",{changes:l,original:a})}})}},r.prototype.getBatchChanges=function(){for(var e={addedRecords:[],deletedRecords:[],changedRecords:[]},t=0,i=this.parent.getRowsObject();t<i.length;t++){var r=i[t];if(r.isDirty)switch(r.edit){case"add":e.addedRecords.push(r.changes);break;case"delete":e.deletedRecords.push(r.data);break;default:e.changedRecords.push(r.changes)}}return e},r.prototype.removeRowObjectFromUID=function(e){for(var t=this.parent.getRowsObject(),i=0,r=t.length;i<r&&t[i].uid!==e;i++);Le(this.parent,function(e,t){t.splice(i,1)},Pe(this.parent))},r.prototype.addRowObject=function(e){var t=this.parent,i="Top"===t.editSettings.newRowPosition;Le(this.parent,function(r,n){var o=e.clone();o.cells=ke(t,o.cells,r),i?n.unshift(o):n.push(o)},Pe(this.parent),!0)},r.prototype.bulkDelete=function(e,i){var r=this;this.removeSelectedData=[];var n=this.parent,o=n.selectedRowIndex,s=n.getSelectedRows(),l={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:o,rowData:i||n.getSelectedRecords()[0],cancel:!1};(t.isBlazor()&&!this.parent.isJsComponent||(l.row=i?n.editModule.deleteRowUid?n.getRowElementByUID(n.editModule.deleteRowUid):n.getRows()[n.getCurrentViewRecords().indexOf(i)]:i?n.getRows()[o]:s[0],l.row))&&n.trigger("beforeBatchDelete",l,function(e){if(!e.cancel){if(r.removeSelectedData=n.getSelectedRecords(),n.clearSelection(),e.row=e.row?e.row:i?n.getRows()[o]:s[0],r.parent.isFrozenGrid()){i&&(o=parseInt(e.row.getAttribute("aria-rowindex"),10),(s=[]).push(n.getRowByIndex(o)),s.push(n.getMovableRowByIndex(o)),"Left-Right"===n.getFrozenMode()&&s.push(n.getFrozenRightRowByIndex(o)));for(l=0;l<s.length;l++){d=s[l].getAttribute("data-uid");s[l].classList.contains("e-insertedrow")?(r.removeRowObjectFromUID(d),t.remove(s[l])):((p=n.getRowObjectFromUID(d)).isDirty=!0,p.edit="delete",t.classList(s[l],["e-hiddenrow","e-updatedtd"],[]),n.frozenRows&&o<n.frozenRows&&n.getMovableDataRows().length>=n.frozenRows&&(n.getMovableHeaderTbody().appendChild(n.getMovableRowByIndex(n.frozenRows-1)),n.getFrozenHeaderTbody().appendChild(n.getRowByIndex(n.frozenRows-1)),"Left-Right"===n.getFrozenMode()&&n.getFrozenRightHeaderTbody().appendChild(n.getFrozenRightRowByIndex(n.frozenRows-1))),n.frozenRows&&o<n.frozenRows&&n.getDataRows().length>=n.frozenRows&&n.getHeaderTable().querySelector("tbody").appendChild(n.getRowByIndex(n.frozenRows-1))),delete s[l]}}else if(r.parent.isFrozenGrid()||1!==s.length&&!i)for(var l=0;l<s.length;l++){var a=s[l].getAttribute("data-uid");if(s[l].classList.contains("e-insertedrow"))r.removeRowObjectFromUID(a),t.remove(s[l]);else{t.classList(s[l],["e-hiddenrow","e-updatedtd"],[]);var h=n.getRowObjectFromUID(a);h.isDirty=!0,h.edit="delete",delete s[l]}}else{var d=e.row.getAttribute("data-uid");if(d=i&&r.parent.editModule.deleteRowUid?d=r.parent.editModule.deleteRowUid:d,e.row.classList.contains("e-insertedrow"))r.removeRowObjectFromUID(d),t.remove(e.row);else{var p=n.getRowObjectFromUID(d);p.isDirty=!0,p.edit="delete",t.classList(e.row,["e-hiddenrow","e-updatedtd"],[])}delete e.row}r.refreshRowIdx(),i&&(n.editModule.deleteRowUid=void 0,n.getSelectedRows().length&&(o=parseInt(n.getSelectedRows()[0].getAttribute("aria-rowindex"),10))),n.isCheckBoxSelection||n.selectRow(o),n.trigger("batchDelete",e),n.notify("batchDelete",{rows:r.parent.getRowsObject()}),n.notify(Xt,{})}})},r.prototype.refreshRowIdx=function(){for(var e,t=this.parent.getAllDataRows(!0),i=Ne(this.parent),r=Pe(this.parent),n=this,o=0,s=0,l=t.length;o<l;o++)!function(o,s,l){t[o].classList.contains("e-row")&&!t[o].classList.contains("e-hiddenrow")?(Le(n.parent,function(e,t,i){t[o].setAttribute("aria-rowindex",s.toString()),i[o].index=s},i,null,r),s++):Le(n.parent,function(e,t,i){t[o].removeAttribute("aria-rowindex"),i[o].index=-1},i,null,r),e=s}(o,s),s=e},r.prototype.getIndexFromData=function(e){return B(e,this.parent.getCurrentViewRecords())},r.prototype.bulkAddRow=function(i){var r=this,n=this.parent;if(n.editSettings.allowAdding&&(n.isEdit&&(this.saveCell(),this.parent.notify("editNextValCell",{})),!n.isEdit)){this.parent.element.classList.add("e-editing");var o={defaultData:i||this.getDefaultData(),primaryKey:n.getPrimaryKeyFieldNames(),cancel:!1};n.trigger("beforeBatchAdd",o,function(o){if(!o.cancel){r.isAdded=!0,n.clearSelection();for(var s,l,a,h,d=new vi(r.serviceLocator,null,r.parent),p=new Ci(r.parent).generateRows([o.defaultData]),c=d.render(p[0],n.getColumns()),u=0;u<r.parent.groupSettings.columns.length;u++)c.insertBefore(r.parent.createElement("td",{className:"e-indentcell"}),c.firstChild),p[0].cells.unshift(new mi({cellType:e.CellType.Indent}));var g=n.getContentTable().querySelector("tbody");if(c.classList.add("e-insertedrow"),g.querySelector(".e-emptyrow")){var f=g.querySelector(".e-emptyrow");f.parentNode.removeChild(f),r.removeFrozenTbody()}n.isFrozenGrid()&&(l=c.cloneNode(!0),s=r.renderMovable(c,l),c="Right"===n.getFrozenMode()?l:c,r.renderFrozenAddRow(c,s,l)),g=n.frozenRows&&"Top"===n.editSettings.newRowPosition?n.getHeaderTable().querySelector("tbody"):n.getContentTable().querySelector("tbody"),"Top"===r.parent.editSettings.newRowPosition?g.insertBefore(c,g.firstChild):g.appendChild(c),t.addClass(c.querySelectorAll(".e-rowcell"),["e-updatedtd"]),p[0].isDirty=!0,p[0].changes=t.extend({},{},p[0].data,!0),p[0].edit="add",r.addRowObject(p[0]),r.refreshRowIdx(),r.focus.forgetPrevious(),n.notify("batchAdd",{rows:r.parent.getRowsObject(),args:{isFrozen:r.parent.isFrozenGrid()}});var m=r.getBatchChanges(),y=r.parent.getCurrentViewRecords().length+m.addedRecords.length-m.deletedRecords.length-1;"Top"===r.parent.editSettings.newRowPosition?n.selectRow(0):n.selectRow(y),i||(h=r.findNextEditableCell(0,!0),a=n.getColumns()[h],"Top"===r.parent.editSettings.newRowPosition?r.editCell(0,a.field,!0):r.editCell(y,a.field,!0)),r.parent.aggregates.length>0&&(i||m.addedRecords.length)&&r.parent.notify("refresh-footer-rendered",{});var v={defaultData:o.defaultData,row:c,columnObject:a,columnIndex:h,primaryKey:o.primaryKey,cell:c.cells[h]};n.trigger("batchAdd",v),n.isFrozenGrid()&&xe(s.querySelector("td:not(.e-hide)"),c.querySelector("td:not(.e-hide)")),t.isBlazor()&&(r.parent.notify(Xt,{}),r.parent.notify("start-add",{}))}})}},r.prototype.renderFrozenAddRow=function(e,i,r){var n=this.parent,o=Ve(this.parent),s=Ge(this.parent);"Top"===n.editSettings.newRowPosition?o.insertBefore(i,o.firstChild):o.appendChild(i),t.addClass(i.querySelectorAll(".e-rowcell"),["e-updatedtd"]),s&&r&&("Top"===n.editSettings.newRowPosition?s.insertBefore(r,s.firstChild):s.appendChild(r),t.addClass(r.querySelectorAll(".e-rowcell"),["e-updatedtd"]),xe(r.querySelector("td:not(.e-hide)"),e.querySelector("td:not(.e-hide)"))),"auto"===n.height&&n.notify("frozenHeight",{})},r.prototype.removeFrozenTbody=function(){var e=this.parent;if(e.isFrozenGrid()){var t=e.getContent().querySelector(".e-movablecontent").querySelector("tbody");if(t.firstElementChild.parentNode.removeChild(t.firstElementChild),"Left-Right"===e.getFrozenMode()){var i=e.getContent().querySelector(".e-frozen-right-content").querySelector("tbody");i.firstElementChild.parentNode.removeChild(i.firstElementChild)}}},r.prototype.renderMovable=function(e,t){var i=e.cloneNode(!0),r=this.parent.getMovableColumnsCount(),n=this.parent.getFrozenLeftCount(),o=this.parent.getFrozenRightColumnsCount();return qe(e,0,n),qe(i,n,o?i.children.length-o:i.children.length),qe(t,n+r,t.children.length),i},r.prototype.findNextEditableCell=function(e,i,r){for(var n,o=this.parent.getColumns(),s=o.length,l=e;l<s;l++){if(n=!!r&&t.isNullOrUndefined(o[l].validationRules),!i&&this.checkNPCell(o[l]))return l;if(i&&!o[l].template&&o[l].visible&&o[l].allowEditing&&(!o[l].isIdentity||!o[l].isPrimaryKey)&&!n)return l}return-1},r.prototype.checkNPCell=function(e){return!e.template&&e.visible&&!e.isPrimaryKey&&!e.isIdentity&&e.allowEditing},r.prototype.getDefaultData=function(){for(var e={},i={number:0,string:null,boolean:!1,date:null,datetime:null},r=0,n=this.parent.columnModel;r<n.length;r++){var o=n[r];o.field&&t.setValue(o.field,o.defaultValue?o.defaultValue:i[o.type],e)}return e},r.prototype.setCellIdx=function(e){var t=0;this.parent.allowGrouping&&(t=this.parent.groupSettings.columns.length),this.cellDetails.cellIndex=e.cellIndex-t,this.cellDetails.rowIndex=parseInt(e.getAttribute("index"),10)},r.prototype.editCell=function(e,i,r){var n=this.parent,o=n.getColumnByField(i);this.index=e,this.field=i,this.isAdd=r;var s=n.isEdit&&!(this.cellDetails.column.field===i&&this.cellDetails.rowIndex===e&&this.parent.getDataRows().length-1!==e);t.isBlazor()&&o.template&&!r&&t.resetBlazorTemplate(this.parent.element.id+o.uid,"Template",e),n.editSettings.allowEditing&&(!s&&o.allowEditing?this.editCellExtend(e,i,r):s&&(this.editNext=!0,this.saveCell()))},r.prototype.editCellExtend=function(e,i,r){var n=this,o=this.parent,s=o.getColumnByField(i),l=o.getPrimaryKeyFieldNames();if(!o.isEdit){var a,h,d=t.extend({},{},this.getDataByIndex(e),!0);if("movable"===s.getFreezeTableName()||"frozen-right"===s.getFreezeTableName()?(a="movable"===s.getFreezeTableName()?o.getMovableDataRows()[e]:o.getFrozenRightDataRows()[e],h=this.parent.getRowObjectFromUID(a.getAttribute("data-uid")),d=h.changes?t.extend({},{},h.changes,!0):d):(a=o.getDataRows()[e],d=t.extend({},{},this.getDataByIndex(e),!0)),l[0]===s.field&&!a.classList.contains("e-insertedrow")||s.columns||s.isPrimaryKey&&s.isIdentity)return void(this.parent.isLastCellPrimaryKey=!0);this.parent.isLastCellPrimaryKey=!1,this.parent.element.classList.add("e-editing");var p=o.getRowObjectFromUID(a.getAttribute("data-uid")),c=[].slice.apply(a.cells),u={columnName:s.field,isForeignKey:!t.isNullOrUndefined(s.foreignKeyValue),primaryKey:l,rowData:d,validationRules:t.extend({},s.validationRules?s.validationRules:{}),value:ce(s.field,d),type:r?"add":"edit",cancel:!1,foreignKeyData:p&&p.foreignKeyData};(t.isBlazor()&&!this.parent.isJsComponent||(u.cell=c[this.getColIndex(c,this.getCellIdx(s.uid))],u.row=a,u.columnObject=s,u.cell))&&o.trigger("cellEdit",u,function(i){if(!i.cancel){if(i.cell=i.cell?i.cell:c[n.getColIndex(c,n.getCellIdx(s.uid))],i.row=i.row?i.row:a,i.columnObject=i.columnObject?i.columnObject:s,i.columnObject.index=t.isNullOrUndefined(i.columnObject.index)?0:i.columnObject.index,n.cellDetails={rowData:d,column:s,value:i.value,isForeignKey:i.isForeignKey,rowIndex:e,cellIndex:parseInt(i.cell.getAttribute("aria-colindex"),10),foreignKeyData:i.foreignKeyData},i.cell.classList.contains("e-updatedtd")&&(n.isColored=!0,i.cell.classList.remove("e-updatedtd")),t.isBlazor()&&o.isServerRendered){var r=i.row.querySelectorAll(".e-indentcell, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop").length;n.cloneCell[""+n.cellDetails.rowIndex+i.columnObject.index]=i.cloneCell=i.cell.cloneNode(!0),O(i.cell,"e-movableheader")||O(i.cell,"e-movablecontent")?(i.row.insertCell(i.columnObject.index-o.getFrozenColumns()),i.row.replaceChild(i.cloneCell,i.row.cells[i.columnObject.index-o.getFrozenColumns()])):(i.row.insertCell(i.columnObject.index+r),i.row.replaceChild(i.cloneCell,i.row.cells[i.columnObject.index+r])),n.originalCell[""+n.cellDetails.rowIndex+i.columnObject.index]=i.cell.parentElement.removeChild(i.cell),t.removeClass([n.cloneCell[""+n.cellDetails.rowIndex+i.columnObject.index]],["e-focus","e-focused"])}o.isEdit=!0,o.clearSelection(),o.isCheckBoxSelection&&o.isPersistSelection||o.selectRow(n.cellDetails.rowIndex,!0),n.renderer.update(i),n.parent.notify("batcheditform-rendered",i),n.form=t.select("#"+o.element.id+"EditForm",o.element),o.editModule.applyFormValidation([s]),n.parent.element.querySelector(".e-gridpopup").style.display="none"}})}},r.prototype.updateCell=function(e,t,i){var r=this.parent,n=r.getColumnByField(t),o=r.getColumnIndexByField(t);if(n&&!n.isPrimaryKey){var s=Ue(this.parent,n,e,o),l="movable"===n.getFreezeTableName()?this.parent.getMovableRowsObject()[e]:"frozen-right"===n.getFreezeTableName()?r.getFrozenRightRowsObject()[e]:r.getRowObjectFromUID(s.parentElement.getAttribute("data-uid"));this.refreshTD(s,n,l,i),this.parent.trigger("queryCellInfo",{cell:s,column:n,data:l.changes})}},r.prototype.setChanges=function(e,r,n,o){var s;if(this.parent.isFrozenGrid()){var l=this.parent.getRowElementByUID(e.uid),a=parseInt(l.getAttribute("aria-rowindex"),10);(s=this.parent.getRowsObject()[a]).changes||(s.changes=t.extend({},{},e.data,!0)),t.isNullOrUndefined(r)||t.setValue(r,n,s.changes);var h=void 0;if(t.isBlazor()&&this.parent.isServerRendered&&(O(o,"e-movableheader")||O(o,"e-movablecontent"))){var d=this.parent.getMovableRowByIndex(this.cellDetails.rowIndex),p=parseInt(d.getAttribute("aria-rowindex"),10);h=this.parent.getMovableRowsObject()[p]}else h=this.parent.getMovableRowsObject()[a];if(h.changes=t.extend({},{},s.changes,!0),e.data[r]!==n&&(h.isDirty=!0,s.isDirty=!0),"Left-Right"===this.parent.getFrozenMode()){var c=this.parent.getFrozenRightRowsObject()[a];c.changes=t.extend({},{},s.changes,!0),e.data[r]!==n&&(c.isDirty=!0)}}else e.changes||(e.changes=t.extend({},{},e.data,!0)),t.isNullOrUndefined(r)||i.DataUtil.setValue(r,n,e.changes),e.data[r]!==n&&(e.isDirty=!0)},r.prototype.updateRow=function(e,t){for(var i=0,r=Object.keys(t);i<r.length;i++){var n=r[i];this.updateCell(e,n,t[n])}},r.prototype.getCellIdx=function(e){var i=this.parent.getColumnIndexByUid(e)+this.parent.groupSettings.columns.length;return t.isNullOrUndefined(this.parent.detailTemplate)&&t.isNullOrUndefined(this.parent.childGrid)||i++,this.parent.isRowDragable()&&i++,i},r.prototype.refreshTD=function(e,i,r,n){var o,s=new Ti(this.parent,this.serviceLocator);n="number"!==i.type||t.isNullOrUndefined(n)?n:parseFloat(n),this.setChanges(r,i.field,n,e);var l=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount();l=l&&this.parent.isRowDragable()?l+1:l,se(r,this.parent.getForeignKeyColumns(),r.changes),o=l&&"movable"===i.getFreezeTableName()&&this.parent.getColumns().length===r.cells.length?r.cells.slice(l,r.cells.length):r.cells;var a,h;this.parent.isReact&&(a=e.parentElement,h=e.cellIndex);var d=0;l&&(d="movable"===i.getFreezeTableName()&&"Right"!==this.parent.getFrozenMode()?l:"frozen-right"===i.getFreezeTableName()?this.parent.getFrozenLeftColumnsCount()+this.parent.getMovableColumnsCount():d),s.refreshTD(e,o[this.getCellIdx(i.uid)-d],r.changes,{index:this.getCellIdx(i.uid)}),this.parent.isReact?(this.newReactTd=a.cells[h],a.cells[h].classList.add("e-updatedtd")):e.classList.add("e-updatedtd"),e.classList.add("e-updatedtd"),this.parent.notify(Xt,{})},r.prototype.getColIndex=function(e,i){var r=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(r=this.parent.groupSettings.columns.length),t.isNullOrUndefined(this.parent.detailTemplate)&&t.isNullOrUndefined(this.parent.childGrid)||r++,this.parent.isRowDragable()&&r++;for(var n=0;n<e.length;n++)if(parseInt(e[n].getAttribute("aria-colindex"),10)===i-r)return n;return-1},r.prototype.editNextValCell=function(){var e=this.parent,t=this.getBatchChanges(),i=this.parent.getCurrentViewRecords().length+t.addedRecords.length-t.deletedRecords.length-1;if(this.isAdded&&!e.isEdit){for(var r=this.cellDetails.cellIndex;r<e.getColumns().length;r++){if(e.isEdit)return;var n=this.findNextEditableCell(this.cellDetails.cellIndex+1,!0,!0),o=e.getColumns()[n];if(o){if("Bottom"===this.parent.editSettings.newRowPosition)this.editCell(i,o.field,!0);else{var s={index:0,column:o};this.parent.notify("next-cell-index",s),this.editCell(s.index,o.field,!0)}this.saveCell()}}e.isEdit||(this.isAdded=!1)}},r.prototype.escapeCellEdit=function(){var e=this.generateCellArgs();e.value=e.previousValue,this.successCallBack(e,e.cell.parentElement,e.column,!0)(e)},r.prototype.generateCellArgs=function(){var e=this.parent;this.parent.element.classList.remove("e-editing");var i=this.cellDetails.column,r={};r[i.field]=ce(i.field,this.cellDetails.rowData);var n=e.editModule.getCurrentEditedData(this.form,r),o=t.extend({},n);n=t.extend({},n,this.cellDetails.rowData);var s=ce(i.field,o);t.isNullOrUndefined(i.field)||t.isUndefined(s)||t.setValue(i.field,s,n);var l={columnName:i.field,value:ce(i.field,n),rowData:this.cellDetails.rowData,column:i,previousValue:this.cellDetails.value,isForeignKey:this.cellDetails.isForeignKey,cancel:!1};return t.isBlazor()&&!this.parent.isJsComponent||(l.cell=this.form.parentElement,l.columnObject=i),l},r.prototype.saveCell=function(e){if(!this.preventSaveCell&&this.form){var i=this.parent;if(e||i.isEdit&&!this.validateFormObj()){this.preventSaveCell=!0;var r=this.generateCellArgs(),n=t.isBlazor()?O(this.form,"e-row"):r.cell.parentElement,o=t.isBlazor()?this.cellDetails.column:r.column;t.isBlazor()&&delete r.column,e?this.successCallBack(r,n,o)(r):(i.trigger("cellSave",r,this.successCallBack(r,n,o)),i.notify("batchedit-form",{formObj:this.form}))}}},r.prototype.successCallBack=function(e,i,r,n){var o=this;return function(e){var s=o.parent;if(e.cell=e.cell?e.cell:o.form.parentElement,e.columnObject=e.columnObject?e.columnObject:r,e.columnObject.index=t.isNullOrUndefined(e.columnObject.index)?0:e.columnObject.index,e.cancel){if(o.preventSaveCell=!1,o.editNext){if(o.editNext=!1,o.cellDetails.rowIndex===o.index&&o.cellDetails.column.field===o.field)return;o.editCellExtend(o.index,o.field,o.isAdd)}}else{if(s.editModule.destroyWidgets([r]),s.isEdit=!1,s.editModule.destroyForm(),t.isBlazor()&&r.template&&!e.cell.parentElement.classList.contains("e-insertedrow")&&t.updateBlazorTemplate(s.element.id+r.uid,"Template",r,!1),o.parent.notify("tooltip-destroy",{}),t.isBlazor()&&s.isServerRendered&&(O(e.cell,"e-movableheader")||O(e.cell,"e-movablecontent")))o.refreshTD(e.cell,r,s.getMovableRowsObject()[o.cellDetails.rowIndex],e.value);else{var l=O(e.cell,"e-movablecontent")||O(e.cell,"e-movableheader")?s.getRowObjectFromUID(i.getAttribute("data-uid"),!0):s.getRowObjectFromUID(i.getAttribute("data-uid"));"Left-Right"===s.getFrozenMode()&&(O(e.cell,"e-frozen-right-header")||O(e.cell,"e-frozen-right-content"))&&(l=s.getRowObjectFromUID(i.getAttribute("data-uid"),!1,!0)),o.refreshTD(e.cell,r,l,e.value),o.parent.isReact&&(e.cell=o.newReactTd)}if(t.removeClass([i],["e-editedrow","e-batchrow"]),t.removeClass([e.cell],["e-editedbatchcell","e-boolcell"]),(!t.isNullOrUndefined(e.value)&&e.value.toString()===(t.isNullOrUndefined(o.cellDetails.value)?"":o.cellDetails.value).toString()&&!o.isColored||t.isNullOrUndefined(e.value)&&t.isNullOrUndefined(o.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&(e.cell.classList.remove("e-updatedtd"),t.isBlazor()&&s.isServerRendered&&(t.isNullOrUndefined(e.value)?"":e.value).toString()===(t.isNullOrUndefined(o.cellDetails.value)?"":o.cellDetails.value).toString()&&(o.cloneCell[""+parseInt(i.getAttribute("aria-rowindex"),10)+e.columnObject.index].classList.contains("e-selectionbackground")?o.originalCell[""+parseInt(i.getAttribute("aria-rowindex"),10)+e.columnObject.index].classList.add("e-selectionbackground","e-active"):o.originalCell[""+parseInt(i.getAttribute("aria-rowindex"),10)+e.columnObject.index].classList.remove("e-selectionbackground","e-active"),o.cloneCell[""+parseInt(i.getAttribute("aria-rowindex"),10)+e.columnObject.index].replaceWith(o.originalCell[""+parseInt(i.getAttribute("aria-rowindex"),10)+e.columnObject.index]))),t.isNullOrUndefined(n)&&s.trigger("cellSaved",e),s.notify(Xt,{}),o.isColored=!1,o.parent.aggregates.length>0&&(o.parent.notify("refresh-footer-rendered",{}),o.parent.groupSettings.columns.length>0&&!o.isAddRow(o.cellDetails.rowIndex)&&o.parent.notify("group-aggregates",{})),o.preventSaveCell=!1,o.editNext){if(o.editNext=!1,o.cellDetails.rowIndex===o.index&&o.cellDetails.column.field===o.field)return;var a=s.getColumnByField(o.field);a&&a.allowEditing&&o.editCellExtend(o.index,o.field,o.isAdd)}n&&s.notify("restore-Focus",{})}}},r.prototype.getDataByIndex=function(e){var t=this.parent.getRowObjectFromUID(this.parent.getDataRows()[e].getAttribute("data-uid"));return t.changes?t.changes:t.data},r.prototype.keyDownHandler=function(e){if(("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit){var t=this.parent,i=this.getBatchChanges(),r=this.parent.getCurrentViewRecords().length+i.addedRecords.length-i.deletedRecords.length-1,n=O(e.target,"e-rowcell");if(n){var o=n.querySelector(".e-field");if(o){var s=this.parent.getVisibleColumns();s["tab"===e.action?s.length-1:0].field===o.getAttribute("id").slice(this.parent.element.id.length)&&(this.cellDetails.rowIndex===r&&"tab"===e.action?"Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord():this.saveCell())}}}},r.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.isColored=!1)},r}(),eo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),to=function(e){function t(t,i,r){var n=e.call(this,t,i)||this;return n.parent=t,n.serviceLocator=i,n.renderer=r,n}return eo(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,i){e.prototype.addRecord.call(this,t,i)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,i){e.prototype.updateRow.call(this,t,i)},t.prototype.deleteRecord=function(t,i){e.prototype.deleteRecord.call(this,t,i)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(Xn),io=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=W(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.write=function(e){"datepickeredit"===e.column.editType?this.obj=new l.DatePicker(t.extend(Xe(e,this.parent.editSettings.mode,this.parent.enableRtl),e.column.edit.params)):"datetimepickeredit"===e.column.editType&&(this.obj=new l.DateTimePicker(t.extend(Xe(e,this.parent.editSettings.mode,this.parent.enableRtl),e.column.edit.params))),t.isBlazor()&&(this.obj.locale=this.parent.locale),this.obj.appendTo(e.element)},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),ro=function(){function e(e){this.parent=e}return e.prototype.read=function(e,t){return t},e.prototype.write=function(){},e.prototype.destroy=function(){},e}(),no=function(){function e(e,t){this.editType={Inline:$n,Normal:$n,Batch:Zn,Dialog:to},this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener(),this.updateEditObj(),this.createAlertDlg(),this.createConfirmDlg()}return e.prototype.updateColTypeObj=function(){for(var i=this.parent.columnModel,r=0;r<i.length;r++)if(this.parent.editSettings.template||i[r].editTemplate){i[r].edit=t.extend(new e.editCellType.templateedit(this.parent),i[r].edit||{})}else i[r].edit=t.extend(new e.editCellType[i[r].editType&&e.editCellType[i[r].editType]?i[r].editType:"defaultedit"](this.parent,this.serviceLocator),i[r].edit||{});this.parent.log("primary_column_missing")},e.prototype.getModuleName=function(){return"edit"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=this.parent,i=(e.properties,0),r=Object.keys(e.properties);i<r.length;i++)switch(r[i]){case"allowAdding":case"allowDeleting":case"allowEditing":(t.editSettings.allowAdding||t.editSettings.allowEditing||t.editSettings.allowDeleting)&&this.initialEnd();break;case"mode":this.updateEditObj(),t.isEdit=!1,t.refresh()}},e.prototype.updateEditObj=function(){this.editModule&&this.editModule.destroy(),this.renderer=new _n(this.parent,this.serviceLocator),this.editModule=new this.editType[this.parent.editSettings.mode](this.parent,this.serviceLocator,this.renderer)},e.prototype.initialEnd=function(){this.updateColTypeObj()},e.prototype.startEdit=function(e){var i=this.parent;if(i.editSettings.allowEditing&&!i.isEdit&&"Batch"!==i.editSettings.mode){if(this.parent.element.classList.add("e-editing"),i.getSelectedRows().length)e||(e=i.getSelectedRows()[0]);else if(!e)return void this.showDialog("EditOperationAlert",this.alertDObj);this.isLastRow=e.rowIndex===this.parent.getContent().querySelector("tr:last-child").rowIndex,"none"!==e.style.display&&(this.editModule.startEdit(e),t.isBlazor()||(this.refreshToolbar(),i.element.querySelector(".e-gridpopup").style.display="none",this.parent.notify("start-edit",{})))}},e.prototype.checkLastRow=function(e,i){var r=this.isLastRow;"auto"!==this.parent.height&&"Bottom"===this.parent.editSettings.newRowPosition&&i&&"add"===i.requestType&&this.parent.height>this.parent.getContentTable().scrollHeight?t.addClass(e.querySelectorAll(".e-rowcell"),"e-lastrowadded"):r&&e&&e.classList&&t.addClass(e.querySelectorAll(".e-rowcell"),"e-lastrowcell")},e.prototype.closeEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&this.parent.element.querySelectorAll(".e-updatedtd").length)return void this.showDialog("CancelEdit",this.dialogObj);this.parent.element.classList.remove("e-editing"),this.editModule.closeEdit(),t.isBlazor()||(this.refreshToolbar(),this.parent.notify("close-edit",{}))},e.prototype.refreshToolbar=function(){this.parent.notify(Xt,{})},e.prototype.addRecord=function(e,i){if(this.parent.editSettings.allowAdding){var r={startEdit:!0};e||this.parent.notify("virtual-scroll-add-action-begin",r),r.startEdit&&(this.parent.element.classList.add("e-editing"),this.editModule.addRecord(e,i),t.isBlazor()||(this.refreshToolbar(),this.parent.notify("start-add",{})))}},e.prototype.deleteRecord=function(e,i){var r=this.parent;if(r.editSettings.allowDeleting)return i||r.getSelectedRecords().length||!t.isNullOrUndefined(r.commandDelIndex)?r.editSettings.showDeleteConfirmDialog?void this.showDialog("ConfirmDelete",this.dialogObj):void this.editModule.deleteRecord(e,i):void this.showDialog("DeleteOperationAlert",this.alertDObj)},e.prototype.deleteRow=function(e){this.deleteRowUid=e.getAttribute("data-uid");var i=this.parent.getRowObjectFromUID(this.deleteRowUid);t.isNullOrUndefined(i)||this.deleteRecord(null,i.data)},e.prototype.endEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&(t.isNullOrUndefined(this.formObj)||this.formObj.validate())&&(this.parent.editModule.saveCell(),this.parent.notify("editNextValCell",{}),t.isNullOrUndefined(this.formObj)||this.formObj.validate()))return void this.showDialog("BatchSaveConfirm",this.dialogObj);this.endEditing()},e.prototype.updateCell=function(e,t,i){this.editModule.updateCell(e,t,i)},e.prototype.updateRow=function(e,t){this.editModule.updateRow(e,t)},e.prototype.batchCancel=function(){this.closeEdit()},e.prototype.batchSave=function(){this.endEdit()},e.prototype.editCell=function(e,t){this.editModule.editCell(e,t)},e.prototype.editFormValidate=function(){return!!this.formObj&&this.formObj.validate()},e.prototype.getBatchChanges=function(){return this.editModule.getBatchChanges?this.editModule.getBatchChanges():{}},e.prototype.getCurrentEditCellData=function(){var e=this.getCurrentEditedData(this.formObj.element,{});return e[Object.keys(e)[0]]},e.prototype.saveCell=function(){this.editModule.saveCell()},e.prototype.endEditing=function(){this.parent.element.classList.remove("e-editing"),this.editModule.endEdit(),this.refreshToolbar()},e.prototype.showDialog=function(e,t){t.content="<div>"+this.l10n.getConstant(e)+"</div>",t.dataBind(),t.show()},e.prototype.getValueFromType=function(e,t){var i=t;switch(e.type){case"number":i=isNaN(parseFloat(t))?null:parseFloat(t);break;case"boolean":"booleanedit"!==e.editType&&(i=t===this.l10n.getConstant("True")||!0===t);break;case"date":case"datetime":"datepickeredit"!==e.editType&&"datetimepickeredit"!==e.editType&&t&&t.length?i=new Date(t):""===t&&(i=null)}return i},e.prototype.destroyToolTip=function(){for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-griderror"));e<i.length;e++){var r=i[e];t.remove(r)}this.parent.getContent().firstElementChild.style.position="relative"},e.prototype.createConfirmDlg=function(){this.dialogObj=this.dlgWidget([{click:this.dlgOk.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.dlgCancel.bind(this),buttonModel:{cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}],"EditConfirm")},e.prototype.createAlertDlg=function(){this.alertDObj=this.dlgWidget([{click:this.alertClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:"e-flat",isPrimary:!0}}],"EditAlert")},e.prototype.alertClick=function(){this.alertDObj.hide()},e.prototype.dlgWidget=function(e,t){var i=this.parent.createElement("div",{id:this.parent.element.id+t});this.parent.element.appendChild(i);var n={showCloseIcon:!1,isModal:!0,visible:!1,closeOnEscape:!0,target:this.parent.element,width:"320px",animationSettings:{effect:"None"}};n.buttons=e;var o=new r.Dialog(n);return o.isStringTemplate=!0,o.appendTo(i),o},e.prototype.dlgCancel=function(){this.parent.focusModule.clearIndicator(),this.parent.focusModule.restoreFocus(),this.dialogObj.hide()},e.prototype.dlgOk=function(e){switch(this.dialogObj.element.querySelector(".e-dlg-content").firstElementChild.innerText){case this.l10n.getConstant("ConfirmDelete"):this.editModule.deleteRecord();break;case this.l10n.getConstant("CancelEdit"):this.editModule.closeEdit();break;case this.l10n.getConstant("BatchSaveConfirm"):this.endEditing();break;case this.l10n.getConstant("BatchSaveLostChanges"):"Batch"===this.parent.editSettings.mode&&(this.editModule.addCancelWhilePaging(),t.isBlazor()&&this.parent.isServerRendered&&this.editModule.closeEdit()),this.executeAction()}this.dlgCancel()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(At,this.onPropertyChanged,this),this.parent.on(Tt,this.initialEnd,this),this.parent.on(qt,this.keyPressHandler,this),this.parent.on(Yt,this.updateColTypeObj,this),this.parent.on("tooltip-destroy",this.destroyToolTip,this),this.parent.on(Zt,this.preventBatch,this),this.parent.on("destroy-form",this.destroyForm,this),this.actionBeginFunction=this.onActionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(yt,this.actionBeginFunction),this.parent.addEventListener(vt,this.actionCompleteFunction))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(At,this.onPropertyChanged),this.parent.off(Tt,this.initialEnd),this.parent.off(qt,this.keyPressHandler),this.parent.off(Yt,this.updateColTypeObj),this.parent.off("tooltip-destroy",this.destroyToolTip),this.parent.off(Zt,this.preventBatch),this.parent.off("destroy-form",this.destroyForm),this.parent.removeEventListener(vt,this.actionCompleteFunction),this.parent.removeEventListener(yt,this.actionBeginFunction))},e.prototype.actionComplete=function(e){["add","beginEdit","save","delete","cancel"].indexOf(e.requestType)<0&&(this.parent.isEdit=!1),"batchsave"===e.requestType&&this.parent.focusModule.restoreFocus(),this.refreshToolbar()},e.prototype.getCurrentEditedData=function(e,r){var n=this.parent;if(n.editSettings.template){for(var o=[].slice.call(e.elements),s=0;s<o.length;s++)if(o[s].hasAttribute("name")&&"e-multi-hidden"!==o[s].className||o[s].classList.contains("e-multiselect")){var l=K(o[s].hasAttribute("name")?o[s].getAttribute("name"):o[s].getAttribute("id")),a=n.getColumnByField(l)||{field:l,type:o[s].getAttribute("type")},h=void 0;"checkbox"===a.type||"boolean"===a.type?h=o[s].checked:o[s].value?(h=o[s].value,o[s].ej2_instances&&o[s].ej2_instances.length&&!t.isNullOrUndefined(o[s].ej2_instances[0].value)&&(o[s].blur(),h=o[s].ej2_instances[0].value,"date"!==a.type&&"dateTime"!==a.type&&"datetime"!==a.type||!o[s].ej2_instances[0].isServerRendered||(h=o[s].value))):o[s].ej2_instances&&(h=o[s].ej2_instances[0].value),a.edit&&"string"==typeof a.edit.read?h=t.getValue(a.edit.read,window)(o[s],h):a.edit&&a.edit.read&&(h=a.edit.read(o[s],h)),h=n.editModule.getValueFromType(a,h),"radio"===o[s].type?o[s].checked&&i.DataUtil.setValue(a.field,h,r):i.DataUtil.setValue(a.field,h,r)}return r}for(var d=n.columnModel.filter(function(e){return e.editTemplate}),p=0;p<d.length;p++)if(e[W(d[p].field)]){var c=[].slice.call(e[W(d[p].field)]),u=(c=c.length?c:[e[W(d[p].field)]]).filter(function(e){return!t.isNullOrUndefined(e.ej2_instances)});0===u.length&&(u=c.filter(function(e){return e.hasAttribute("name")}));for(s=0;s<u.length;s++){h=this.getValue(d[p],u[s],r);i.DataUtil.setValue(d[p].field,h,r)}}for(var g=[].slice.call(e.querySelectorAll(".e-field")),f=0,m=g.length;f<m;f++){var y=n.getColumnByUid(g[f].getAttribute("e-mappinguid"));if(y&&y.field){h=this.getValue(y,g[f],r);i.DataUtil.setValue(y.field,h,r)}}return r},e.prototype.getValue=function(e,i,r){var n=!i.ej2_instances||t.isBlazor()&&i.ej2_instances[0].isServerRendered&&("date"===e.type||"datetime"===e.type)?i.value:i.ej2_instances[0].value,o=this.parent,s=e.edit.read;return"checkbox"!==e.type&&"boolean"!==e.type||(n=i.checked),"string"==typeof s?(s=t.getValue(s,window),n=o.editModule.getValueFromType(e,s(i,n))):n=o.editModule.getValueFromType(e,e.edit.read(i,n)),t.isNullOrUndefined(r[e.field])&&""===n&&(n=r[e.field]),n},e.prototype.onActionBegin=function(e){if("columnstate"===e.requestType&&this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode)this.closeEdit();else{var t=this.parent.element.querySelector(".e-editedrow");if(t&&this.parent.frozenRows&&"virtualscroll"===e.requestType&&parseInt(O(t,"e-row").getAttribute("aria-rowindex"),10)<this.parent.frozenRows)return;var i=["filterafteropen","filterbeforeopen","filterchoicerequest","save","infiniteScroll"];"Batch"===this.parent.editSettings.mode||!this.formObj||this.formObj.isDestroyed||-1!==i.indexOf(e.requestType)||e.cancel||(this.destroyWidgets(),this.destroyForm())}},e.prototype.destroyWidgets=function(e){this.parent.editSettings.template&&(this.parent.destroyTemplate(["editSettingsTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),(e=e||this.parent.getVisibleColumns()).some(function(e){return!t.isNullOrUndefined(e.editTemplate)})&&(this.parent.destroyTemplate(["editTemplate"]),this.parent.isReact&&this.parent.renderTemplates());for(var i=0,r=e;i<r.length;i++){var n=r[i],o=n.edit.destroy;t.isBlazor()&&n.editTemplate&&(t.resetBlazorTemplate(this.parent.element.id+n.uid+"editTemplate","EditTemplate"),t.updateBlazorTemplate(this.parent.element.id+n.uid+"editTemplate","EditTemplate",n,!1)),n.edit.destroy&&("string"==typeof o?(o=t.getValue(o,window))():n.edit.destroy())}for(var s=[].slice.call(this.formObj.element.elements),l=0;l<s.length;l++)s[l].hasAttribute("name")&&s[l].ej2_instances&&s[l].ej2_instances.length&&!s[l].ej2_instances[0].isDestroyed&&s[l].ej2_instances[0].destroy()},e.prototype.destroyForm=function(){this.destroyToolTip(),this.formObj&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.destroyToolTip()},e.prototype.destroy=function(){var e=this.parent.element;if(e){var i=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent"));i&&this.destroyForm(),this.removeEventListener();var r=this.dialogObj.element;r.childElementCount>0&&(this.dialogObj.destroy(),t.remove(r)),(r=this.alertDObj.element).childElementCount>0&&(this.alertDObj.destroy(),t.remove(r)),i&&this.editModule&&this.editModule.destroy()}},e.prototype.keyPressHandler=function(e){switch(e.action){case"insert":this.addRecord();break;case"delete":"INPUT"===e.target.tagName&&!e.target.classList.contains("e-checkselect")||document.querySelector(".e-popup-open")||this.deleteRecord();break;case"f2":this.startEdit();break;case"enter":O(e.target,"e-unboundcelldiv")||"Batch"===this.parent.editSettings.mode||!(O(e.target,"e-gridcontent")||this.parent.frozenRows&&O(e.target,"e-headercontent"))||document.querySelectorAll(".e-popup-open").length||(e.preventDefault(),this.endEdit());break;case"escape":this.parent.isEdit&&("Batch"===this.parent.editSettings.mode?this.editModule.escapeCellEdit():this.closeEdit())}},e.prototype.preventBatch=function(e){this.preventObj=e,this.showDialog("BatchSaveLostChanges",this.dialogObj)},e.prototype.executeAction=function(){this.preventObj.handler.call(this.preventObj.instance,this.preventObj.arg1,this.preventObj.arg2,this.preventObj.arg3,this.preventObj.arg4,this.preventObj.arg5,this.preventObj.arg6,this.preventObj.arg7,this.preventObj.arg8)},e.prototype.applyFormValidation=function(e){var i=this.parent,r=i.isFrozenGrid(),n="Normal"===this.parent.editSettings.mode,o="Right"===this.parent.getFrozenMode()&&n?1:0,s="Dialog"!==this.parent.editSettings.mode?i.element.querySelectorAll(".e-gridform")[o]:t.select("#"+i.element.id+"_dialogEdit_wrapper .e-gridform",document),l="Right"===this.parent.getFrozenMode()&&n?0:1,a=i.element.querySelectorAll(".e-gridform")[l],h={},d={},p={};e=e||i.getColumns();for(var c=0;c<e.length;c++)e[c].visible&&(t.isBlazor()&&e[c].editTemplate||e[c].validationRules&&je(e[c],l,h,d,p,e.length));if(r&&"Dialog"!==this.parent.editSettings.mode){if(this.parent.editModule.mFormObj=this.createFormObj(a,d),"Left-Right"===this.parent.getFrozenMode()){var u=i.element.querySelectorAll(".e-gridform")[2];this.parent.editModule.frFormObj=this.createFormObj(u,p)}}else h=t.extend(h,d,p);t.isBlazor()&&this.parent.editSettings.template?this.parent.editModule.formObj=this.createFormObj(s,{}):this.parent.editModule.formObj=this.createFormObj(s,h)},e.prototype.createFormObj=function(e,t){var i=this;return new o.FormValidator(e,{rules:t,locale:this.parent.locale,validationComplete:function(e){i.validationComplete(e)},customPlacement:function(e,t){var r=e.getAttribute("e-mappinguid"),n={column:i.parent.getColumnByUid(r),error:t,inputElement:e,value:e.value};i.valErrorPlacement(e,t),i.parent.notify("validation-custom-placement",n)}})},e.prototype.valErrorPlacement=function(e,t){if(this.parent.isEdit){var i=t.getAttribute("for"),r=this.getElemTable(e).querySelector("#"+i+"_Error");r?r.querySelector(".e-tip-content").innerHTML=t.outerHTML:this.createTooltip(e,t,i,"")}},e.prototype.getElemTable=function(e){var i;return"Dialog"!==this.parent.editSettings.mode&&(i=this.parent.frozenRows&&this.parent.frozenRows>(parseInt(t.closest(e,".e-row").getAttribute("aria-rowindex"),10)||0)),"Dialog"!==this.parent.editSettings.mode?i?this.parent.getHeaderTable():this.parent.getContentTable():t.select("#"+this.parent.element.id+"_dialogEdit_wrapper",document)},e.prototype.resetElemPosition=function(e,t){var i=O(t.element,"e-rowcell");if(i){var r=i.getBoundingClientRect().right,n=e.getBoundingClientRect().right;if(n>r){var o=n-r;e.style.left=e.offsetLeft-o+"px"}}},e.prototype.validationComplete=function(e){if(this.parent.isEdit){var t=this.getElemTable(e.element).querySelector("#"+e.inputName+"_Error");t&&("failure"===e.status?(t.style.display="",this.resetElemPosition(t,e)):t.style.display="none")}},e.prototype.createTooltip=function(e,i,n,o){var s=this.parent.getColumnByField(n),l="Left-Right"===this.parent.getFrozenMode()&&"Normal"===this.parent.editSettings.mode&&"frozen-right"===s.getFreezeTableName()?this.frFormObj.element:this.formObj.element,a=this.parent.getContent().firstElementChild,h=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount();h&&(a=this.parent.getMovableVirtualContent());var d,p,c=a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth,u="Dialog"!==this.parent.editSettings.mode,g=t.closest(e,".e-rowcell"),f=t.closest(e,".e-row"),m=this.parent.getContent().querySelector(".e-frozencontent"),y=!1,v=!1,C=Math.round(this.parent.getContent().clientHeight/this.parent.getRowHeight())-1,w=m?[].slice.call(this.parent.getFrozenVirtualContent().querySelectorAll(".e-row")):[].slice.call(this.parent.getContent().querySelectorAll(".e-row"));if("Batch"===this.parent.editSettings.mode&&C>1&&w.length>=C&&w[w.length-1].getAttribute("aria-rowindex")===f.getAttribute("aria-rowindex")&&(v=!0),u){if(this.parent.frozenRows){var b=h?this.parent.getFrozenVirtualHeader().querySelector("tbody").children:this.parent.getHeaderTable().querySelector("tbody").children;y=(d=b.length>(parseInt(f.getAttribute("aria-rowindex"),10)||0))&&parseInt(f.getAttribute("aria-rowindex"),10)===b.length-1}(y||C>1&&w.length>=C&&("Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType||g.classList.contains("e-lastrowcell")&&!f.classList.contains("e-addedrow"))||v)&&(p=!0)}var S=u?d?this.parent.getHeaderTable():this.parent.getContentTable():t.select("#"+this.parent.element.id+"_dialogEdit_wrapper .e-dlg-content",document),x=S.getBoundingClientRect(),R=u?this.parent.element.getBoundingClientRect().left:x.left,F=t.closest(e,"td"),z=F?F.getBoundingClientRect():e.parentElement.getBoundingClientRect(),I=this.parent.createElement("div",{className:"e-tooltip-wrap e-lib e-control e-popup e-griderror",id:n+"_Error",styles:"display:"+o+";top:"+((d?z.top+z.height:z.bottom-x.top-(h?m.scrollTop:0))+S.scrollTop+9)+"px;left:"+(z.left-R+S.scrollLeft+z.width/2)+"px;max-width:"+z.width+"px;text-align:center;"});u&&x.left<R&&(I.style.left=parseInt(I.style.left,10)-x.left+R+"px");var T=this.parent.createElement("div",{className:"e-tip-content"});T.appendChild(i);var E;p?((E=this.parent.createElement("div",{className:"e-arrow-tip e-tip-bottom"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-bottom"})),E.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-bottom"}))):((E=this.parent.createElement("div",{className:"e-arrow-tip e-tip-top"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),E.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-top"}))),I.appendChild(T),I.appendChild(E),(h||this.parent.frozenRows)&&"Dialog"!==this.parent.editSettings.mode?(("Normal"===this.parent.editSettings.mode?t.closest(e,".e-editcell"):t.closest(e,".e-table")).style.position="relative",I.style.position="absolute","Batch"===this.parent.editSettings.mode||t.closest(e,".e-frozencontent")||t.closest(e,".e-frozenheader")||this.parent.frozenRows&&!h?l.appendChild(I):this.mFormObj.element.appendChild(I)):this.formObj.element.appendChild(I),!p&&u&&a.getBoundingClientRect().bottom<z.bottom+z.height&&(a.scrollTop=a.scrollTop+I.offsetHeight+E.scrollHeight);var M=parseInt(document.defaultView.getComputedStyle(I,null).getPropertyValue("font-size"),10);if(I.getBoundingClientRect().width<z.width&&I.querySelector("label").getBoundingClientRect().height/(1.2*M)>=2&&(I.style.width=I.style.maxWidth),(h||this.parent.frozenRows)&&"Dialog"!==this.parent.editSettings.mode?I.style.left=F.offsetLeft+(F.offsetWidth/2-I.offsetWidth/2)+"px":I.style.left=parseInt(I.style.left,10)-I.offsetWidth/2+"px",u&&!c&&!this.parent.allowPaging||h||this.parent.frozenRows){a.style.position="static";var D=r.calculateRelativeBasedPosition(F,I);I.style.top=D.top+z.height+9+"px"}if(p){if(!c||h||"auto"===this.parent.height||this.parent.frozenRows||this.parent.enableVirtualization)I.style.bottom=z.height+9+"px";else{var O=a.scrollWidth>a.offsetWidth?j():0;I.style.bottom=this.parent.height-a.querySelector("table").offsetHeight-O+z.height+9+"px"}if(w.length<C&&"Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType){var A=(this.parent.frozenRows?this.parent.frozenRows+(w.length-1):w.length-1)*this.parent.getRowHeight(),B=this.parent.getContent().clientHeight-A;I.style.bottom=B+9+"px"}I.style.top=null}},e.prototype.checkColumnIsGrouped=function(e){return!(e.visible||this.parent.groupSettings.columns.indexOf(e.field)>-1)},e.AddEditors=function(i){e.editCellType=t.extend(e.editCellType,i)},e.editCellType={dropdownedit:Kn,numericedit:Qn,datepickeredit:io,datetimepickeredit:io,booleanedit:Wn,defaultedit:Jn,templateedit:ro},e}(),oo=function(){function e(e,i){this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.unchangedColumns=[],this.isDlgOpen=!1,this.dlghide=!1,this.initialOpenDlg=!0,this.stateChangeColumns=[],this.changedStateColumns=[],this.isInitialOpen=!1,this.isCustomizeOpenCC=!1,this.searchOperator="startswith",this.prevShowedCols=[],this.parent=e,this.serviceLocator=i,this.addEventListener(),this.cBoxTrue=n.createCheckBox(this.parent.createElement,!0,{checked:!0,label:" "}),this.cBoxFalse=n.createCheckBox(this.parent.createElement,!0,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"])}return e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.removeEventListener(),this.unWireEvents(),t.isNullOrUndefined(this.dlgObj)||!this.dlgObj.element||this.dlgObj.isDestroyed||this.dlgObj.destroy())},e.prototype.rtlUpdate=function(){this.parent.enableRtl?t.addClass(this.innerDiv.querySelectorAll(".e-checkbox-wrapper"),["e-rtl"]):t.removeClass(this.innerDiv.querySelectorAll(".e-checkbox-wrapper"),["e-rtl"])},e.prototype.addEventListener=function(){this.parent.isDestroyed||(t.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on(Dt,this.enableAfterRenderEle,this),this.parent.on(Tt,this.render,this),this.parent.addEventListener(Ct,this.hideDialog.bind(this)),this.parent.on(Ut,this.destroy,this),this.parent.on("rtl-updated",this.rtlUpdate,this),this.parent.on(qt,this.keyUpHandler,this),this.parent.on("reset-columns",this.onResetColumns,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.EventHandler.remove(document,"click",this.clickHandler),this.parent.off(Tt,this.render),this.parent.off(Ut,this.destroy),this.parent.off(Dt,this.enableAfterRenderEle),this.parent.off("rtl-updated",this.rtlUpdate),this.parent.on(qt,this.keyUpHandler,this),this.parent.off("reset-columns",this.onResetColumns))},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderDlgContent(),this.getShowHideService=this.serviceLocator.getService("showHideService")},e.prototype.clickHandler=function(e){var i=e.target;if(!this.isCustomizeOpenCC){if(t.isNullOrUndefined(t.closest(i,".e-cc"))&&t.isNullOrUndefined(t.closest(i,".e-cc-toolbar")))t.isNullOrUndefined(this.dlgObj)||!this.dlgObj.visible||i.classList.contains("e-toolbar-items")||(this.dlgObj.hide(),this.clearActions(),this.refreshCheckboxState(),this.isDlgOpen=!1);else if(i.classList.contains("e-columnchooser-btn")||i.classList.contains("e-cc-toolbar")){if(this.initialOpenDlg&&this.dlgObj.visible||!this.isDlgOpen)return void(this.isDlgOpen=!0)}else i.classList.contains("e-cc-cancel")&&(i.parentElement.querySelector(".e-ccsearch").value="",this.columnChooserSearch(""),this.removeCancelIcon(),this.refreshCheckboxButton());(this.parent.detailTemplate||this.parent.childGrid)&&(this.targetdlg=e.target)}this.isCustomizeOpenCC&&e.target.classList.contains("e-cc-cancel")&&this.refreshCheckboxState(),this.rtlUpdate()},e.prototype.hideDialog=function(){!t.isNullOrUndefined(this.dlgObj)&&this.dlgObj.visible&&(this.dlgObj.hide(),this.isDlgOpen=!1)},e.prototype.renderColumnChooser=function(e,i,n){if(this.dlgObj.visible||!this.parent.detailTemplate&&!this.parent.childGrid||this.hideOpenedDialog(),this.dlgObj.visible)this.hideDialog(),this.addcancelIcon(),this.clearActions(),this.refreshCheckboxState();else{if(this.beforeOpenColumnChooserEvent().cancel)return;n&&(this.targetdlg=n),this.refreshCheckboxState(),this.dlgObj.dataBind(),this.dlgObj.element.style.maxHeight="430px";var o=this.dlgObj.element.style.display;this.dlgObj.element.style.display="block";var s=r.calculateRelativeBasedPosition(t.closest(n,".e-toolbar-item"),this.dlgObj.element);this.dlgObj.element.style.display=o,this.dlgObj.element.style.top=s.top+t.closest(n,".e-cc-toolbar").getBoundingClientRect().height+"px";t.isNullOrUndefined(t.closest(n,".e-bigger"))||(this.dlgObj.width=258),t.Browser.isDevice?(this.dlgObj.target=document.body,this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition(),this.dlgObj.open=this.mOpenDlg.bind(this)):this.parent.enableRtl?this.dlgObj.element.style.left=n.offsetLeft+"px":this.dlgObj.element.style.left=s.left-250+t.closest(n,".e-cc-toolbar").clientWidth+2+"px",this.removeCancelIcon(),this.dlgObj.show(),this.parent.notify("columnChooserOpened",{dialog:this.dlgObj})}this.rtlUpdate()},e.prototype.openColumnChooser=function(e,i){if(this.isCustomizeOpenCC=!0,this.dlgObj.visible)return void this.hideDialog();this.beforeOpenColumnChooserEvent().cancel||(this.isInitialOpen?this.refreshCheckboxState():(this.dlgObj.content=this.renderChooserList(),this.updateIntermediateBtn()),this.dlgObj.dataBind(),this.dlgObj.position={X:"center",Y:"center"},t.isNullOrUndefined(e)?(this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition()):(this.dlgObj.element.style.top="",this.dlgObj.element.style.left="",this.dlgObj.element.style.top=i+"px",this.dlgObj.element.style.left=e+"px"),this.dlgObj.beforeOpen=this.customDialogOpen.bind(this),this.dlgObj.show(),this.isInitialOpen=!0,this.dlgObj.beforeClose=this.customDialogClose.bind(this))},e.prototype.enableAfterRenderEle=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.keyUpHandler=function(e){"escape"===e.action&&this.hideDialog()},e.prototype.customDialogOpen=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.add(e,"keyup",this.columnChooserManualSearch,this)},e.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.remove(e,"keyup",this.columnChooserManualSearch)},e.prototype.getColumns=function(){return this.parent.getColumns().filter(function(e){return"checkbox"!==e.type&&!0===e.showInColumnChooser||"checkbox"===e.type&&void 0!==e.field})},e.prototype.renderDlgContent=function(){this.dlgDiv=this.parent.createElement("div",{className:"e-ccdlg e-cc",id:this.parent.element.id+"_ccdlg"}),this.dlgDiv.setAttribute("aria-label",this.l10n.getConstant("ColumnChooserDialogARIA")),this.parent.element.appendChild(this.dlgDiv);this.parent.element.getBoundingClientRect().width,this.parent.enableRtl;var e=this.parent.element.querySelector(".e-ccdiv");t.isNullOrUndefined(e)||e.getBoundingClientRect().top,this.dlgObj=new r.Dialog({header:this.l10n.getConstant("ChooseColumns"),showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,target:document.getElementById(this.parent.element.id),buttons:[{click:this.confirmDlgBtnClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:"e-cc e-cc_okbtn"}},{click:this.clearBtnClick.bind(this),buttonModel:{cssClass:"e-flat e-cc e-cc-cnbtn",content:this.l10n.getConstant("CancelButton")}}],content:this.renderChooserList(),width:250,cssClass:"e-cc",animationSettings:{effect:"None"}});this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),this.wireEvents()},e.prototype.renderChooserList=function(){this.mainDiv=this.parent.createElement("div",{className:"e-main-div e-cc"});var e=this.parent.createElement("div",{className:"e-cc-searchdiv e-cc e-input-group"}),t=this.parent.createElement("input",{className:"e-ccsearch e-cc e-input",attrs:{placeholder:this.l10n.getConstant("Search")}}),i=this.parent.createElement("span",{className:"e-ccsearch-icon e-icons e-cc e-input-group-icon",attrs:{title:this.l10n.getConstant("Search")}}),r=this.parent.createElement("div",{className:"e-cc-contentdiv"});this.innerDiv=this.parent.createElement("div",{className:"e-innerdiv e-cc"}),e.appendChild(t),e.appendChild(i),this.searchBoxObj=new pr(t);var n=this.refreshCheckboxList(this.parent.getColumns());return this.innerDiv.appendChild(n),r.appendChild(this.innerDiv),this.mainDiv.appendChild(e),this.mainDiv.appendChild(r),this.mainDiv},e.prototype.confirmDlgBtnClick=function(e){this.stateChangeColumns=[],this.changedStateColumns=[],this.changedColumns=this.changedColumns.length>0?this.changedColumns:this.unchangedColumns,this.changedColumnState(this.changedColumns);var i=this.ulElement.querySelector(".e-uncheck")&&this.ulElement.querySelectorAll(".e-uncheck:not(.e-selectall)").length;t.isNullOrUndefined(e)||i<this.parent.getColumns().length&&(this.hideColumn.length&&this.columnStateChange(this.hideColumn,!1),this.showColumn.length&&this.columnStateChange(this.showColumn,!0),this.getShowHideService.setVisible(this.stateChangeColumns,this.changedStateColumns),this.clearActions(),this.parent.notify("tooltip-destroy",{module:"edit"}),0===this.parent.getCurrentViewRecords().length&&this.parent.element.querySelector(".e-emptyrow").querySelector("td").setAttribute("colSpan",this.parent.getVisibleColumns().length.toString()))},e.prototype.onResetColumns=function(e){if("columnstate"===e.requestType)return this.showColumn=[],this.hideColumn=[],void this.hideDialog()},e.prototype.resetColumnState=function(){this.showColumn=[],this.hideColumn=[],this.hideDialog()},e.prototype.changedColumnState=function(e){for(var i=0;i<e.length;i++){var r=e[i],n=this.parent.getColumnByUid(r);t.isBlazor()?this.changedStateColumns.push(JSON.parse(JSON.stringify(n))):this.changedStateColumns.push(n)}},e.prototype.columnStateChange=function(e,i){for(var r=0;r<e.length;r++){var n=e[r],o=this.parent.getColumnByUid(n);"checkbox"!==o.type&&(o.visible=i),t.isBlazor()?this.stateChangeColumns.push(JSON.parse(JSON.stringify(o))):this.stateChangeColumns.push(o)}},e.prototype.clearActions=function(){this.hideColumn=[],this.showColumn=[],this.hideDialog(),this.addcancelIcon()},e.prototype.clearBtnClick=function(){this.clearActions(),this.parent.notify("columnChooserCancelBtnClick",{dialog:this.dlgObj})},e.prototype.checkstatecolumn=function(e,t,i){void 0===i&&(i=!1),e?(-1!==this.hideColumn.indexOf(t)&&this.hideColumn.splice(this.hideColumn.indexOf(t),1),-1===this.showColumn.indexOf(t)&&this.showColumn.push(t)):(-1!==this.showColumn.indexOf(t)&&this.showColumn.splice(this.showColumn.indexOf(t),1),-1===this.hideColumn.indexOf(t)&&this.hideColumn.push(t)),i?e?this.unchangedColumns.push(t):this.changedColumns.push(t):-1!==this.changedColumns.indexOf(t)?this.changedColumns.splice(this.changedColumns.indexOf(t),1):this.changedColumns.push(t)},e.prototype.columnChooserSearch=function(e){var t,r,n=!1,o=this.dlgDiv.querySelector(".e-footer-content"),s=this.ulElement.querySelector(".e-check")&&this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;if(this.isInitialOpen=!0,o&&(r=o.querySelector(".e-btn").ej2_instances[0]),""===e?(this.removeCancelIcon(),t=this.getColumns(),n=!0):t=new i.DataManager(this.getColumns()).executeLocal((new i.Query).where("headerText",this.searchOperator,e,!0)),t.length)this.innerDiv.innerHTML=" ",this.innerDiv.classList.remove("e-ccnmdiv"),this.innerDiv.appendChild(this.refreshCheckboxList(t,e)),n?r&&s&&(r.disabled=!1):(this.addcancelIcon(),this.refreshCheckboxButton());else{var l=this.parent.createElement("span",{className:"e-cc e-nmatch"});l.innerHTML=this.l10n.getConstant("Matchs"),this.innerDiv.innerHTML=" ",this.innerDiv.appendChild(l),this.innerDiv.classList.add("e-ccnmdiv"),r&&(r.disabled=!0)}this.flag=!0,this.stopTimer()},e.prototype.wireEvents=function(){t.EventHandler.add(this.dlgObj.element,"click",this.checkBoxClickHandler,this),t.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),this.searchBoxObj.wireEvent()},e.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.dlgObj.element&&t.EventHandler.remove(this.dlgObj.element,"click",this.checkBoxClickHandler),t.EventHandler.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent())},e.prototype.checkBoxClickHandler=function(e){var t,i=O(e.target,"e-checkbox-wrapper");if(i){if(i.querySelector(".e-selectall")?this.updateSelectAll(!i.querySelector(".e-check")):ie(i.parentElement),i.querySelector(".e-chk-hidden").focus(),i.querySelector(".e-check"))t=!0;else{if(!i.querySelector(".e-uncheck"))return;t=!1}this.updateIntermediateBtn();var r=O(i,"e-ccheck").getAttribute("uid"),n=this.parent.getColumns();if("grid-selectAll"===r){this.changedColumns=[],this.unchangedColumns=[];for(var o=0;o<n.length;o++)n[o].showInColumnChooser&&this.checkstatecolumn(t,n[o].uid,!0)}else this.checkstatecolumn(t,r);this.refreshCheckboxButton()}},e.prototype.updateIntermediateBtn=function(){var e=this.ulElement.children.length-1,i=[],r=this.ulElement.children[0].querySelector(".e-frame"),n=this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length,o=this.dlgObj.btnObj[0];o.disabled=!1,e===n?i=["e-check"]:n?i=["e-stop"]:(i=["e-uncheck"],o.disabled=!0),o.dataBind(),t.removeClass([r],["e-check","e-stop","e-uncheck"]),t.addClass([r],i)},e.prototype.updateSelectAll=function(e){for(var t=0,i=[].slice.call(this.ulElement.querySelectorAll(".e-frame"));t<i.length;t++)oe(i[t],e)},e.prototype.refreshCheckboxButton=function(){this.dlgObj.element.querySelector(".e-cc.e-input").value;for(var e=this.parent.getVisibleColumns(),t=0;t<e.length;t++){a=e[t].uid;-1===this.prevShowedCols.indexOf(a)&&this.prevShowedCols.push(a)}for(var i,t=0;t<this.hideColumn.length;t++){var r=this.prevShowedCols.indexOf(this.hideColumn[t]);-1!==r&&this.prevShowedCols.splice(r,1)}i=0!==this.showColumn.length?1:this.prevShowedCols.length;var n=this.dlgDiv.querySelector(".e-footer-content").querySelector(".e-btn").ej2_instances[0];n.disabled=!1;for(var o=[],s=this.parent.element.querySelectorAll(".e-cc-chbox"),t=0,l=s.length;t<l;t++){var a=O(s[t],"e-ccheck").getAttribute("uid");o.push(a)}var h=this.showColumn.filter(function(e){return-1!==o.indexOf(e)});0===i&&0===h.length&&(n.disabled=!0),n.dataBind()},e.prototype.refreshCheckboxList=function(e,t){this.ulElement=this.parent.createElement("ul",{className:"e-ccul-ele e-cc"});var i=this.l10n.getConstant("SelectAll"),r=this.parent.createElement("li",{className:"e-cclist e-cc e-cc-selectall"}),n=this.createCheckBox(i,!1,"grid-selectAll");e.length&&(n.querySelector(".e-checkbox-wrapper").firstElementChild.classList.add("e-selectall"),n.querySelector(".e-frame").classList.add("e-selectall"),this.checkState(n.querySelector(".e-icons"),!0),r.appendChild(n),this.ulElement.appendChild(r));for(var o=0;o<e.length;o++){var s=e[o];this.renderCheckbox(s)}return this.ulElement},e.prototype.refreshCheckboxState=function(){this.dlgObj.element.querySelector(".e-cc.e-input").value="",this.columnChooserSearch("");for(var e=this.parent,t=this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)"),i=0,r=t.length;i<r;i++){var n=t[i],o=void 0;o=this.parent.childGrid||this.parent.detailTemplate?O(this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)")[i],"e-ccheck").getAttribute("uid"):O(n,"e-ccheck").getAttribute("uid");var s=e.getColumnByUid(o),l=n.parentElement.querySelectorAll(".e-uncheck");s.visible&&!l.length?(n.checked=!0,this.checkState(n.parentElement.querySelector(".e-icons"),!0)):(n.checked=!1,this.checkState(n.parentElement.querySelector(".e-icons"),!1))}},e.prototype.checkState=function(e,i){i?t.classList(e,["e-check"],["e-uncheck"]):t.classList(e,["e-uncheck"],["e-check"])},e.prototype.createCheckBox=function(e,t,i){var r=t?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);return r.querySelector(".e-label").innerHTML=e,ne(i,r,"e-ccheck")},e.prototype.renderCheckbox=function(e){var t,i,r;if(e.showInColumnChooser){t=this.parent.createElement("li",{className:"e-cclist e-cc",styles:"list-style:None",id:"e-ccli_"+e.uid}),i=-1!==this.hideColumn.indexOf(e.uid),r=-1!==this.showColumn.indexOf(e.uid);var n=this.createCheckBox(e.headerText,e.visible&&!i||r,e.uid);t.appendChild(n),this.ulElement.appendChild(t)}this.isInitialOpen&&this.updateIntermediateBtn()},e.prototype.columnChooserManualSearch=function(e){this.addcancelIcon(),this.searchValue=e.target.value,this.stopTimer(),this.startTimer(e)},e.prototype.startTimer=function(e){var t=this,i=t.flag||13===e.keyCode?0:500;this.timer=window.setInterval(function(){t.columnChooserSearch(t.searchValue)},i)},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.addcancelIcon=function(){this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.add("e-cc-cancel")},e.prototype.removeCancelIcon=function(){this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.remove("e-cc-cancel")},e.prototype.mOpenDlg=function(){t.Browser.isDevice&&(this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.remove("e-input-focus"),this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0].focus())},e.prototype.getModuleName=function(){return"columnChooser"},e.prototype.hideOpenedDialog=function(){for(var e=[].slice.call(document.getElementsByClassName("e-ccdlg")).filter(function(e){return e.classList.contains("e-popup-open")}),t=0,i=e.length;t<i;t++)(e[t].classList.contains("e-dialog")||this.parent.element.id+"_ccdlg"!==e[t].id)&&e[t].ej2_instances[0].hide()},e.prototype.beforeOpenColumnChooserEvent=function(){t.isBlazor()&&this.parent.isServerRendered&&"none"===this.parent.columnChooserSettings.operator&&(this.parent.columnChooserSettings.operator="startsWith");var e={requestType:"beforeOpenColumnChooser",element:this.parent.element,columns:this.getColumns(),cancel:!1,searchOperator:this.parent.columnChooserSettings.operator};return t.isBlazor()&&!this.parent.isJsComponent&&(e={requestType:"beforeOpenColumnChooser",cancel:!1,searchOperator:this.parent.columnChooserSettings.operator}),this.parent.trigger("beforeOpenColumnChooser",e),this.searchOperator=e.searchOperator,e},e}(),so=function(){function r(e,t){this.hideColumnInclude=!1,this.foreignKeyData={},this.parent=e,!e.parentDetails&&t&&(this.foreignKeyData=t)}return r.getQuery=function(e,t){var i=t.generateQuery(!0).requiresCount();return t.isRemote()&&(e.groupSettings.enableLazyLoading&&e.groupSettings.columns.length?i.lazyLoad=[]:i.take(e.pageSettings.totalRecordsCount)),i},r.prototype.getFData=function(e,t){return le(t,{},e,this.foreignKeyData[t.field])[0]},r.prototype.getGridRowModel=function(e,t,i,r){void 0===r&&(r=0);var n=[],o=t.length;if(o){for(var s=0;s<o;s++,r++){var l={isExpand:!1};l.data=t[s],l.index=r,i.childGrid&&("All"===i.hierarchyPrintMode?l.isExpand=!0:"Expanded"===i.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[r]&&(l.isExpand=i.expandedRows[r].isExpand));var a=new fi(l);a.cells=this.generateCells(e,i),n.push(a)}this.processColumns(n)}return n},r.prototype.generateCells=function(t,i){var r=[];if(i.childGridLevel)for(var n=i.childGridLevel,o=0;n>o;o++)r.push(this.generateCell({},e.CellType.Indent));for(var s=0,l=t;s<l.length;s++){var a=l[s];r.push(this.generateCell(a,e.CellType.Data))}return r},r.prototype.getColumnData=function(e){var t,r=this,n=[],o=e.getForeignKeyColumns();if(o.length){for(var s=0;s<o.length;s++){var l="result"in o[s].dataSource?new i.DataManager(o[s].dataSource.result):o[s].dataSource;n.push(l.executeQuery(new i.Query))}t=Promise.all(n).then(function(e){for(var t=0;t<o.length;t++)r.foreignKeyData[o[t].field]=e[t].result})}return t},r.prototype.getHeaders=function(e,t){this.hideColumnInclude=!!t,this.colDepth=ve(e);for(var i=[],r=0;r<this.colDepth;r++)i[r]=new fi({}),i[r].cells=[];return i=this.processColumns(i),i=this.processHeaderCells(i,e),{rows:i,columns:this.generateActualColumns(e)}},r.prototype.getConvertedWidth=function(e){var t=parseFloat(e);return-1!==e.indexOf("%")?this.parent.element.getBoundingClientRect().width*t/100:t},r.prototype.generateActualColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,r=e;i<r.length;i++){var n=r[i];n.commands||(n.columns?(n.visible||this.hideColumnInclude)&&0!==this.getCellCount(n,0)&&this.generateActualColumns(n.columns,t):(n.visible||this.hideColumnInclude)&&t.push(n))}return t},r.prototype.processHeaderCells=function(e,t){for(var i=t,r=0;r<i.length;r++)i[r].commands||(e=this.appendGridCells(i[r],e,0));return e},r.prototype.appendGridCells=function(t,i,r){if(t.columns||!1===t.visible&&!this.hideColumnInclude||t.commands){if(t.columns){var n=this.getCellCount(t,0);n&&i[r].cells.push(new mi({cellType:e.CellType.StackedHeader,column:t,colSpan:n}));for(var o=void 0,s=0,l=t.columns.length;s<l;s++)t.columns[s].visible&&!o&&(o=!0),i=this.appendGridCells(t.columns[s],i,r+1)}}else i[r].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-r,r));return i},r.prototype.generateCell=function(t,i,r,n){var o={visible:t.visible,isDataCell:i===e.CellType.Data,column:t,cellType:i,rowSpan:r,index:n};return(!o.rowSpan||o.rowSpan<2)&&delete o.rowSpan,new mi(o)},r.prototype.processColumns=function(t){var i=this.parent,r=[];i.enableColumnVirtualization&&(r=i.getColumnIndexesInView());for(var n=0,o=t.length;n<o;n++)if(i.allowGrouping)for(var s=0,l=i.groupSettings.columns.length;s<l;s++)i.enableColumnVirtualization&&-1===r.indexOf(s)||t[n].cells.splice(0,0,this.generateCell({},e.CellType.HeaderIndent));return t},r.prototype.getCellCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getCellCount(e.columns[i],t);else(e.visible||this.hideColumnInclude)&&t++;return t},r.prototype.checkAndExport=function(e,t){Object.keys(e).some(function(t){return!e[t]})||t()},r.prototype.failureHandler=function(e,t,i){var r=this;return function(){e[t.id]=!0,r.checkAndExport(e,i)}},r.prototype.createChildGrid=function(e,i,r,n){var o=new Wr(this.parent.detailRowModule.getGridModel(e,i,r));e.isPrinting=!1;o.parentDetails={parentID:e.element.id,parentPrimaryKeys:e.getPrimaryKeyFieldNames(),parentKeyField:e.childGrid.queryString,parentKeyFieldValue:t.getValue(o.queryString,i.data),parentRowData:i.data};var s=N("child-grid"),l=t.createElement("div",{id:s,styles:"display: none"});return document.body.appendChild(l),o.id=s,n[s]=!1,{childGrid:o,element:l}},r.prototype.getGridExportColumns=function(e){for(var t=[],i=0,r=e;i<r.length;i++)"checkbox"!==r[i].type&&t.push(r[i]);return t},r.prototype.getForeignKeyData=function(){return this.foreignKeyData},r}(),lo=function(){function e(e){this.valueFormatter=new ut(e),this.internationalization=new t.Internationalization(e)}return e.prototype.returnFormattedValue=function(e,i){return!t.isNullOrUndefined(e.value)&&e.value?this.valueFormatter.getFormatFunction(i)(e.value):""},e.prototype.formatCellValue=function(e,i){if(e.isForeignKey&&(e.value=t.getValue(e.column.foreignKeyValue,le(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format)return e.value||0===e.value?this.internationalization.getNumberFormat({format:e.column.format})(e.value):"";if("boolean"===e.column.type&&""!==e.value)return e.value?"true":"false";if("date"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format)return(t.isNullOrUndefined(e.column.type)||t.isNullOrUndefined(e.value))&&t.isNullOrUndefined(e.value)?"":e.value.toString();if("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format){var r=void 0,n=e.column.format;return r="date"===e.column.type?i?{type:"date",format:n}:{type:"date",skeleton:n}:"time"===e.column.type?i?{type:"time",format:n}:{type:"time",skeleton:n}:i?{type:"dateTime",format:n}:{type:"dateTime",skeleton:n},this.returnFormattedValue(e,r)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var o=void 0;return o="date"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,o)},e}(),ao=function(){function r(e,t){this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.isCsvExport=!1,this.isElementIdChanged=!1,this.foreignKeyData={},this.gridPool={},this.sheet={},this.parent=e,this.helper=new so(e),this.locator=t,this.l10n=this.locator.getService("localization")}return r.prototype.getModuleName=function(){return"ExcelExport"},r.prototype.init=function(e){null!==e.element&&""===e.element.id&&(e.element.id=(new Date).toISOString(),this.isElementIdChanged=!0),this.parent=e,this.parent.isDestroyed||(this.isExporting=void 0,this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.footer=void 0,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.exportValueFormatter=new lo(e.locale),e.id=N("main-grid"),this.gridPool[e.id]=!1)},r.prototype.Map=function(e,i,r,n,o,s){var l=e;this.gridPool={},e.childGrid&&(t.isNullOrUndefined(i)||"None"!==i.hierarchyExportMode)&&(e.expandedRows=fe(e).expandedRows);var a={requestType:"beforeExcelExport",gridObject:l,cancel:!1,isMultipleExport:r,workbook:n,isCsv:o,isBlob:s};return l.trigger("beforeExcelExport",a),a.cancel?new Promise(function(e,t){return e()}):(this.parent.log("exporting_begin",this.getModuleName()),this.data=new gi(l),this.isExporting=!0,this.isBlob=a.isBlob,this.isCsvExport=!!a.isCsv&&a.isCsv,y(i)&&v(i,l),this.processRecords(l,i,a.isMultipleExport,a.workbook))},r.prototype.exportingSuccess=function(e){this.isExporting=!1,this.parent.trigger("excelExportComplete",this.isBlob?{promise:this.blobPromise}:{}),this.parent.log("exporting_complete",this.getModuleName()),e(this.book),this.sheet.images=[]},r.prototype.processRecords=function(e,r,n,o){var s=this;if(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.dataSource)){if(t.isNullOrUndefined(r)||"CurrentPage"!==r.exportType){var l=[];return l.push(this.data.getData({},so.getQuery(e,this.data))),l.push(this.helper.getColumnData(e)),new Promise(function(t,i){Promise.all(l).then(function(i){s.init(e),s.processInnerRecords(e,r,n,o,i[0]).then(function(){s.exportingSuccess(t)})}).catch(function(e){i(s.book),s.parent.trigger("actionFailure",e)})})}return new Promise(function(t,i){s.init(e),s.processInnerRecords(e,r,n,o,s.parent.getCurrentViewRecords()),s.exportingSuccess(t)})}r.dataSource instanceof i.DataManager||(r.dataSource=new i.DataManager(r.dataSource));var a=r.query?r.query:new i.Query;return(t.isNullOrUndefined(a.isCountRequired)||e.aggregates)&&(a.isCountRequired=!0),new Promise(function(t,i){r.dataSource.executeQuery(a).then(function(i){s.init(e),s.processInnerRecords(e,r,n,o,i).then(function(){s.exportingSuccess(t)})})})},r.prototype.processInnerRecords=function(e,i,r,n,o){var s=this;this.groupedColLength=e.groupSettings.columns.length;var l,a=5,d=[],p=ve(e.columns),c=!t.isNullOrUndefined(i);return c&&!t.isNullOrUndefined(i.multipleExport)&&(this.expType=t.isNullOrUndefined(i.multipleExport.type)?"AppendToSheet":i.multipleExport.type,t.isNullOrUndefined(i.multipleExport.blankRows)||(a=i.multipleExport.blankRows)),t.isNullOrUndefined(n)?(this.workSheet=[],this.rows=[],this.columns=[],this.styles=[]):"NewSheet"===this.expType?(this.workSheet=n.worksheets,this.rows=[],this.columns=[],this.styles=n.styles):(this.workSheet=[],this.rows=n.worksheets[0].rows,this.columns=n.worksheets[0].columns,this.styles=n.styles,this.rowLength=this.rows[this.rows.length-1].index+a,this.rowLength++),c&&(t.isNullOrUndefined(r)?(t.isNullOrUndefined(i.header)||this.processExcelHeader(JSON.parse(JSON.stringify(i.header))),t.isNullOrUndefined(i.footer)||(this.footer=JSON.parse(JSON.stringify(i.footer)))):(t.isNullOrUndefined(i.header)||!r&&"NewSheet"!==this.expType||this.processExcelHeader(JSON.parse(JSON.stringify(i.header))),t.isNullOrUndefined(i.footer)||("AppendToSheet"===this.expType?r||(this.footer=JSON.parse(JSON.stringify(i.footer))):this.footer=JSON.parse(JSON.stringify(i.footer))))),this.includeHiddenColumn=!!c&&i.includeHiddenColumn,new Promise(function(t,r){e.childGridLevel=0,d=s.processGridExport(e,i,o),s.globalResolve=t,s.gridPool[e.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve)}).then(function(){var o=[];if(s.organiseRows(d,d[0].index,o),s.rows=s.rows.concat(o),t.isNullOrUndefined(s.footer)||("AppendToSheet"===s.expType&&!r||"NewSheet"===s.expType)&&s.processExcelFooter(s.footer),s.columns.length>0&&(s.sheet.columns=s.columns),s.sheet.rows=s.rows,s.sheet.enableRtl=s.parent.enableRtl,s.parent.allowFiltering&&e.getVisibleColumns().length&&c&&i.enableFilter){var a={row:p,column:s.groupedColLength?s.groupedColLength+1:s.sheet.columns[0].index,lastRow:s.sheet.rows.length,lastColumn:s.sheet.columns.length};s.sheet.autoFilters=a}if(s.workSheet.push(s.sheet),s.book.worksheets=s.workSheet,s.book.styles=s.styles,e.notify("finalPageSetup",s.book),!r){if(s.isCsvExport){t.isBlazor()&&e.isServerRendered&&(s.book.isServerRendered=e.isServerRendered),c&&!t.isNullOrUndefined(i.separator)&&","!==i.separator&&(l=i.separator);u=new h.Workbook(s.book,"csv",e.locale,e.currencyCode,l);s.isBlob?s.blobPromise=u.saveAsBlob("text/csv"):c&&i.fileName?u.save(i.fileName):u.save("Export.csv")}else{var u=new h.Workbook(s.book,"xlsx",e.locale,e.currencyCode);s.isBlob?s.blobPromise=u.saveAsBlob("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):c&&i.fileName?u.save(i.fileName):u.save("Export.xlsx")}s.isElementIdChanged&&(e.element.id=""),delete e.expandedRows}return n})},r.prototype.organiseRows=function(e,t,i){if(!e.length)return t;for(var r=0;r<e.length;r++){var n=e[r],o=n.childRows;o?(n.index=t++,delete n.childRows,i.push(n),t=this.organiseRows(o,t,i)):(n.index=t++,i.push(n))}return t},r.prototype.processGridExport=function(e,r,n){var o=[],s=this.parent.isFrozenGrid()&&!this.parent.getFrozenColumns();t.isNullOrUndefined(r)||t.isNullOrUndefined(r.theme)||(this.theme=r.theme),e.childGrid&&!t.isNullOrUndefined(r)&&(e.hierarchyPrintMode=r.hierarchyExportMode||"Expanded");var l=new so(e,this.helper.getForeignKeyData()),a=y(r)?T(r.columns,e.enableColumnVirtualization):l.getGridExportColumns(s?e.getColumns():e.columns),h=l.getHeaders(a,this.includeHiddenColumn),d=e.groupSettings.columns.length;return o=this.processHeaderContent(e,h,d,o),o=t.isNullOrUndefined(r)||t.isNullOrUndefined(r.dataSource)||r.dataSource instanceof i.DataManager?t.isNullOrUndefined(r)||"CurrentPage"!==r.exportType?this.processRecordContent(e,n,h,r,void 0,o,l):this.processRecordContent(e,n,h,r,e.currentViewData,o,l):this.processRecordContent(e,n,h,r,r.dataSource,o,l),e.notify("export-DataBound",{excelRows:o,type:"excel"}),o},r.prototype.processRecordContent=function(e,i,r,n,o,s,l){var a;if(a=!t.isNullOrUndefined(o)&&o.length?o:i.result,t.isNullOrUndefined(a.level)?this.processRecordRows(e,a,r,0,0,n,s,l):this.processGroupedRows(e,a,r,a.level,0,n,s,l),!t.isNullOrUndefined(i.aggregates))if(t.isNullOrUndefined(o)){var h=i.result.GroupGuid?i.result.records:i.result;this.processAggregates(e,h,s)}else this.processAggregates(e,i.result,s,o);return s},r.prototype.processGroupedRows=function(e,i,r,n,o,s,l,a){for(var h=0,d=i;h<d.length;h++){var p=d[h],c=[],u={};u.index=1+n;var g=e.getColumnByField(p.field),f={value:p.key,column:g,style:void 0,isForeignKey:g.isForeignColumn()},m=e.getColumnByField(p.field).headerText+": "+(g.enableGroupByFormat?p.key:this.exportValueFormatter.formatCellValue(f))+" - ";p.count>1?m+=p.count+" items":m+=p.count+" item";var y={captionText:m,type:this.isCsvExport?"CSV":"Excel"};this.parent.trigger("exportGroupCaption",y),u.value=y.captionText,u.style=this.getCaptionThemeStyle(this.theme);var v=new xi(e).generateRows(p);if(this.fillAggregates(e,v,i.level+i.childLevels,l,this.rowLength),c.push(u),l[l.length-1].cells.length>0){for(var C=i.level+i.childLevels+v[0].cells.length,w=0,b=0,S=l[l.length-1].cells;b<S.length;b++){var x=S[b];x.index<C&&(C=x.index),x.index>w&&(w=x.index),c[c.length-1].index!==x.index&&c.push(x)}for(C-u.index>1&&(u.colSpan=C-u.index);w<r.columns.length+n+i.childLevels;){var R={};R.index=w+1,R.style=this.getCaptionThemeStyle(this.theme),c.push(R),w++}}else{for(var F=0,z=0,I=r.columns;z<I.length;z++)I[z].visible&&F++;u.colSpan=i.childLevels+F}if(l[l.length-1].cells=c,this.rowLength++,this.groupedColLength<8&&n>1){var T={outlineLevel:n-1,isCollapsed:!0};l[l.length-1].grouping=T}!t.isNullOrUndefined(i.childLevels)&&i.childLevels>0?(this.processGroupedRows(e,p.items,r,p.items.level,o,s,l,a),this.processAggregates(e,p,l,void 0,n+i.childLevels,!0)):(o=this.processRecordRows(e,p.items,r,n,o,s,l,a),this.processAggregates(e,p,l,void 0,n,!0))}},r.prototype.processRecordRows=function(i,r,n,o,s,l,a,h){for(var d=1,p=[],c=n.columns,u=0,g=h.getGridRowModel(c,r,i,s);u<g.length;u++){var f=g[u];p=[],s++,d=1;for(var m=void 0,y=0,v=f.cells.length;y<v;y++){var C=f.cells[y];if(C.cellType===e.CellType.Data){var w=C.column,b=w.field,S=t.isNullOrUndefined(b)?"":w.valueAccessor(b,f.data,w),x=t.isNullOrUndefined(S)?"":S,R=void 0;if(w.isForeignColumn&&w.isForeignColumn()&&(R=h.getFData(x,w),x=t.getValue(w.foreignKeyValue,R)),!t.isNullOrUndefined(x)){var F={},z=d+o+i.childGridLevel,I={data:f.data,column:w,foreignKeyData:R,value:x,style:void 0,colSpan:1,cell:F};if(i.trigger("excelQueryCellInfo",I),!t.isNullOrUndefined(I.image)&&!t.isNullOrUndefined(I.image.base64)){t.isNullOrUndefined(this.sheet.images)&&(this.sheet.images=[]);var T={image:I.image.base64,row:this.rowLength,column:z,lastRow:this.rowLength,lastColumn:z};this.sheet.images.push(T),m=I.image.height||50,this.columns[z-1].width=I.image.width||this.columns[z-1].width}if(t.isNullOrUndefined(I.hyperLink)||(I.cell.hyperlink={target:I.hyperLink.target},I.value=I.hyperLink.displayText||I.value),F=I.cell,F.index=z,F.value=I.value,""===I.data&&i.childGridLevel&&1===d){var E={};E.hAlign="left",I={style:E},F.colSpan=i.getVisibleColumns().length,F.value=this.l10n.getConstant("EmptyRecord")}if(I.colSpan>1&&(F.colSpan=I.colSpan),t.isNullOrUndefined(I.style))F.style={name:i.element.id+"column"+(d+o)};else{var M=this.getColumnStyle(i,d+o);F.style=this.mergeOptions(this.styles[M],I.style)}p.push(F)}d++}}var D={index:this.rowLength++,cells:p};if(t.isNullOrUndefined(m)||(D.height=m),this.groupedColLength<8&&o>0?(D.grouping={outlineLevel:o,isCollapsed:!0},a.push(D)):a.push(D),!t.isNullOrUndefined(i.childGrid)){i.isPrinting=!0;var O=!t.isNullOrUndefined(l)&&l.exportType?l.exportType:"AllPages",A=this.helper.createChildGrid(i,f,O,this.gridPool),B=A.childGrid,k=A.element;B.actionFailure=h.failureHandler(this.gridPool,B,this.globalResolve),B.childGridLevel=i.childGridLevel+1;var L={childGrid:B,row:f,exportProperties:l};this.parent.trigger("exportdetaildatabound",L),B.beforeDataBound=this.childGridCell(D,B,l,f),B.appendTo(k)}i.notify("export-RowDataBound",{rowObj:f,type:"excel",excelRows:a})}return s},r.prototype.childGridCell=function(e,i,r,n){var o=this;return function(s){i.beforeDataBound=null,s.cancel=!0,0===s.result.length&&(s.result=[""]),e.childRows=o.processGridExport(i,r,s);for(var l=o.parent.groupSettings.columns.length,a=e.childRows,h=0;h<a.length;h++)a[h].grouping={outlineLevel:l+i.childGridLevel,isCollapsed:!n.isExpand,isHidden:!n.isExpand};return i.destroy(),t.detach(i.element),o.gridPool[i.id]=!0,o.helper.checkAndExport(o.gridPool,o.globalResolve),e}},r.prototype.processAggregates=function(e,i,r,n,o,s){var l=new bi(e),a=l.getColumns();a=a.filter(function(e){return t.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo();var h=void 0;if(h=t.isNullOrUndefined(n)?i:n,void 0===o&&(o=0),e.groupSettings.columns.length>0&&s){var d=new Si(e).generateRows(h,{level:h.level});d.length>0&&(r=this.fillAggregates(e,d,o,r))}else{o=e.groupSettings.columns.length>0&&!s?e.groupSettings.columns.length:o;var p=l.generateRows(h,i.aggregates,null,null,a);p.length>0&&!s&&(r=this.fillAggregates(e,p,o,r))}return r},r.prototype.fillAggregates=function(i,r,n,o,s){for(var l=0,a=r;l<a.length;l++){for(var h=a[l],d=[],p=!0,c=0,u=0,g=h.cells;u<g.length;u++){var f=g[u],m={};if(f.cellType!==e.CellType.DetailFooterIntent&&(f.visible||this.includeHiddenColumn))if(c++,f.isDataCell){p=!1;var y=!t.isNullOrUndefined(f.column.footerTemplate),v=!t.isNullOrUndefined(f.column.groupFooterTemplate),C=!t.isNullOrUndefined(f.column.groupCaptionTemplate);if(m.index=c+n+i.childGridLevel,y)m.value=this.getAggreateValue(e.CellType.Summary,f.column.footerTemplate,f,h);else if(v)m.value=this.getAggreateValue(e.CellType.GroupSummary,f.column.groupFooterTemplate,f,h);else if(C)m.value=this.getAggreateValue(e.CellType.CaptionSummary,f.column.groupCaptionTemplate,f,h);else for(var w=0,b=Object.keys(h.data[f.column.field]);w<b.length;w++)b[w]===f.column.type&&(t.isNullOrUndefined(h.data[f.column.field].Sum)?t.isNullOrUndefined(h.data[f.column.field].Average)?t.isNullOrUndefined(h.data[f.column.field].Max)?t.isNullOrUndefined(h.data[f.column.field].Min)?t.isNullOrUndefined(h.data[f.column.field].Count)?t.isNullOrUndefined(h.data[f.column.field].TrueCount)?t.isNullOrUndefined(h.data[f.column.field].FalseCount)?t.isNullOrUndefined(h.data[f.column.field].Custom)||(m.value=h.data[f.column.field].Custom):m.value=h.data[f.column.field][f.column.field+" - falsecount"]:m.value=h.data[f.column.field][f.column.field+" - truecount"]:m.value=h.data[f.column.field][f.column.field+" - count"]:m.value=h.data[f.column.field][f.column.field+" - min"]:m.value=h.data[f.column.field][f.column.field+" - max"]:m.value=h.data[f.column.field][f.column.field+" - average"]:m.value=h.data[f.column.field][f.column.field+" - sum"]);m.style=this.getCaptionThemeStyle(this.theme),this.aggregateStyle(f.column,m.style,f.column.field);var S=f.attributes.style;S.textAlign&&(m.style.hAlign=S.textAlign.toLowerCase());var x={row:h,type:y?"Footer":v?"GroupFooter":"GroupCaption",style:m};this.parent.trigger("excelAggregateQueryCellInfo",x),d.push(m)}else void 0===s&&(m.index=c+n+i.childGridLevel,m.style=this.getCaptionThemeStyle(this.theme),d.push(m))}if(t.isNullOrUndefined(s)){var R={};if(this.groupedColLength<8&&this.groupedColLength>0){var F={outlineLevel:o[o.length-1].grouping.outlineLevel,isCollapsed:!0};R={index:this.rowLength++,cells:d,grouping:F}}else R={index:this.rowLength++,cells:d};p||o.push(R)}else o.push({index:s,cells:d})}return o},r.prototype.aggregateStyle=function(e,i,r){var n=this.parent.getColumnByField(r);if("object"==typeof e.format){var o=e.format;i.numberFormat=t.isNullOrUndefined(o.format)?o.skeleton:o.format,t.isNullOrUndefined(o.type)||(i.type=o.type.toLowerCase())}else i.numberFormat=e.format;!t.isNullOrUndefined(n)&&t.isNullOrUndefined(i.type)&&(i.type=n.type.toLowerCase())},r.prototype.getAggreateValue=function(i,r,n,o){var s={};s[t.getEnumValue(e.CellType,n.cellType)]=t.compile(r);var l,a=o.data[n.column.field?n.column.field:n.column.columnName];return this.parent.isReact||this.parent.isVue?(l=s[t.getEnumValue(e.CellType,n.cellType)](a,this.parent),this.parent.isReact&&this.parent.renderTemplates()):l=s[t.getEnumValue(e.CellType,n.cellType)](a),l[0].textContent},r.prototype.mergeOptions=function(e,t){for(var i={},r=Object.keys(e),n=0;n<r.length;n++)"name"!==r[n]&&(i[r[n]]=e[r[n]]);r=Object.keys(t);for(n=0;n<r.length;n++)"name"!==r[n]&&(i[r[n]]=t[r[n]]);return i},r.prototype.getColumnStyle=function(e,t){for(var i=0,r=0,n=this.styles;r<n.length;r++){if(n[r].name===e.element.id+"column"+t)return i;i++}},r.prototype.processHeaderContent=function(i,r,n,o){var s=r.rows,l=r.columns,a=[];if(n>0)for(var h=0;h!==n;)this.columns.push({index:h+1,width:30}),h++;for(var d=0;d<s.length;d++){for(var p=1+n,c=[],u=0;u<s[d].cells.length;u++){var g={},f={},m=s[d].cells[u];if(m.cellType!==e.CellType.HeaderIndent&&m.cellType!==e.CellType.DetailHeader){for(var y={contains:!0,index:1};y.contains;)if(y=this.getIndex(a,1,p),p=y.index,!y.contains){f.index=y.index+i.childGridLevel;break}if(!t.isNullOrUndefined(m.rowSpan)&&1!==m.rowSpan){f.rowSpan=m.rowSpan;for(var v=1;v<m.rowSpan+1;v++){var C={rowIndex:0,columnIndex:0};C.rowIndex=v,C.columnIndex=p,a.push(C)}}t.isNullOrUndefined(m.colSpan)||1===m.colSpan||(f.colSpan=m.colSpan,p=p+f.colSpan-1),f.value=m.column.headerText,g=this.getHeaderThemeStyle(this.theme),t.isNullOrUndefined(m.column.textAlign)||(g.hAlign=m.column.textAlign.toLowerCase()),t.isNullOrUndefined(m.column.headerTextAlign)||(g.hAlign=m.column.headerTextAlign.toLowerCase());var w={cell:f,gridCell:m,style:g};i.trigger("excelHeaderQueryCellInfo",w),f.style=w.style,c.push(f),p++}}o.push({index:this.rowLength++,cells:c})}for(var b=0;b<l.length;b++)this.parseStyles(i,l[b],this.getRecordThemeStyle(this.theme),n+b+1);return o},r.prototype.getHeaderThemeStyle=function(e){var i={};return i.fontSize=12,i.borders={color:"#E0E0E0"},i.bold=!0,t.isNullOrUndefined(e)||t.isNullOrUndefined(e.header)||(i=this.updateThemeStyle(e.header,i)),i},r.prototype.updateThemeStyle=function(e,i){return t.extend(i,e)},r.prototype.getCaptionThemeStyle=function(e){var i={};return i.fontSize=13,i.backColor="#F6F6F6",t.isNullOrUndefined(e)||t.isNullOrUndefined(e.caption)||(i=this.updateThemeStyle(e.caption,i)),i},r.prototype.getRecordThemeStyle=function(e){var i={};return i.fontSize=13,i.borders={color:"#E0E0E0"},t.isNullOrUndefined(e)||t.isNullOrUndefined(e.record)||(i=this.updateThemeStyle(e.record,i)),i},r.prototype.processExcelHeader=function(e){if(!t.isNullOrUndefined(e.rows)&&("NewSheet"===this.expType||1===this.rowLength)){var i=void 0;void 0===e.headerRows?this.rowLength=e.rows.length:this.rowLength=e.headerRows,i=this.rowLength<e.rows.length?this.rowLength:e.rows.length,this.rowLength++;for(var r=0;r<i;r++){var n=e.rows[r];(null===n.index||t.isNullOrUndefined(n.index))&&(n.index=r+1),this.updatedCellIndex(n)}}},r.prototype.updatedCellIndex=function(e){for(var i=e.cells.length,r=0;r<i;r++){var n=e.cells[r];(null===n.index||t.isNullOrUndefined(n.index))&&(n.index=r+1)}this.rows.push(e)},r.prototype.processExcelFooter=function(e){if(!t.isNullOrUndefined(e.rows)){var i=void 0;void 0===e.footerRows?this.rowLength+=e.rows.length:e.footerRows>e.rows.length?(this.rowLength+=e.footerRows-e.rows.length,i=e.rows.length):i=e.footerRows;for(var r=0;r<i;r++){var n=e.rows[r];null===n.index||void 0===n.index?n.index=this.rowLength++:n.index+=this.rowLength,this.updatedCellIndex(n)}}},r.prototype.getIndex=function(e,t,i){for(var r=0,n=e;r<n.length;r++){var o=n[r];if(o.rowIndex===t&&o.columnIndex===i)return i+=1,{contains:!0,index:i}}return{contains:!1,index:i}},r.prototype.parseStyles=function(e,i,r,n){if(!t.isNullOrUndefined(i.format))if("object"==typeof i.format){var o=i.format;r.numberFormat=t.isNullOrUndefined(o.format)?o.skeleton:o.format,t.isNullOrUndefined(o.type)||(r.type=o.type.toLowerCase())}else r.numberFormat=i.format,r.type=i.type;t.isNullOrUndefined(i.textAlign)||(r.hAlign=i.textAlign.toLowerCase()),Object.keys(r).length>0&&(r.name=e.element.id+"column"+n,this.styles.push(r)),t.isNullOrUndefined(i.width)||"auto"===i.width||this.columns.push({index:n+e.childGridLevel,width:"number"==typeof i.width?i.width:this.helper.getConvertedWidth(i.width)})},r.prototype.destroy=function(){},r}(),ho=function(){function r(e){this.hideColumnInclude=!1,this.currentViewData=!1,this.customDataSource=!1,this.isGrouping=!1,this.headerOnPages=[],this.drawPosition={xPosition:0,yPosition:0},this.parent=e,this.helper=new so(e),this.gridPool={}}return r.prototype.getModuleName=function(){return"PdfExport"},r.prototype.init=function(e){this.exportValueFormatter=new lo(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=N("main-grid"),this.gridPool[e.id]=!1,this.pdfPageSettings=new d.PdfPageSettings},r.prototype.exportWithData=function(e,i,r,n,o,s,l){var a=this;this.init(e),t.isNullOrUndefined(i)?this.pdfDocument=new d.PdfDocument:this.pdfDocument=i,this.processExport(e,n,o,s).then(function(){a.isExporting=!1,e.trigger("pdfExportComplete",a.isBlob?{promise:a.blobPromise}:{}),a.parent.log("exporting_complete",a.getModuleName()),r(a.pdfDocument)}).catch(function(e){l(a.pdfDocument),a.parent.trigger("actionFailure",e)})},r.prototype.Map=function(e,r,n,o,s){var l=this;this.data=new gi(this.parent),this.isBlob=s,this.gridPool={};var a=new i.Query;e.childGrid&&(t.isNullOrUndefined(r)||"None"!==r.hierarchyExportMode)&&(e.expandedRows=fe(e).expandedRows);var h={requestType:"beforePdfExport",cancel:!1,headerPageNumbers:[],gridDrawPosition:{xPosition:0,yPosition:0},generateQuery:!1};if(!t.isBlazor()){h.gridObject=e}if(e.trigger("beforePdfExport",h),!0===h.cancel)return new Promise(function(e,t){return e()});if(y(r)&&v(r,e),h.generateQuery&&(a=so.getQuery(e,this.data)),this.headerOnPages=h.headerPageNumbers,this.drawPosition=h.gridDrawPosition,this.parent.log("exporting_begin",this.getModuleName()),!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.dataSource)&&r.dataSource instanceof i.DataManager)return new Promise(function(t,i){r.dataSource.executeQuery(a).then(function(s){l.exportWithData(e,o,t,s,r,n,i)})});if(t.isNullOrUndefined(r)||"CurrentPage"!==r.exportType){var p=[];return p.push(this.data.getData({},so.getQuery(e,this.data))),p.push(this.helper.getColumnData(e)),new Promise(function(i,s){Promise.all(p).then(function(a){l.init(e),t.isNullOrUndefined(o)?l.pdfDocument=new d.PdfDocument:l.pdfDocument=o,l.processExport(e,a[0],r,n).then(function(){l.isExporting=!1,e.trigger("pdfExportComplete",l.isBlob?{promise:l.blobPromise}:{}),l.parent.log("exporting_complete",l.getModuleName()),i(l.pdfDocument)}).catch(function(e){s(l.pdfDocument),l.parent.trigger("actionFailure",e)})})})}return new Promise(function(t,i){l.exportWithData(e,o,t,l.parent.getCurrentViewRecords(),r,n,i)})},r.prototype.processExport=function(e,i,r,n){var o,s=this,l=this.pdfDocument.sections.add();this.processSectionExportProperties(l,r);var a=l.pages.add();return new Promise(function(t,n){o=s.processGridExport(e,i,r),s.globalResolve=t,s.gridPool[e.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve)}).then(function(){return o.draw(a,s.drawPosition.xPosition,s.drawPosition.yPosition),s.drawHeader(r),n||(s.isBlob?s.blobPromise=s.pdfDocument.save():!t.isNullOrUndefined(r)&&r.fileName?s.pdfDocument.save(r.fileName):s.pdfDocument.save("Export.pdf"),s.pdfDocument.destroy(),delete e.expandedRows),s.pdfDocument})},r.prototype.processSectionExportProperties=function(e,i){return t.isNullOrUndefined(i)||t.isNullOrUndefined(i.pageOrientation)&&t.isNullOrUndefined(i.pageSize)||(this.pdfPageSettings.orientation="Landscape"===i.pageOrientation?d.PdfPageOrientation.Landscape:d.PdfPageOrientation.Portrait,this.pdfPageSettings.size=this.getPageSize(i.pageSize),e.setPageSettings(this.pdfPageSettings)),e},r.prototype.processGridExport=function(e,i,r){var n=!0,o=this.parent.isFrozenGrid()&&!this.parent.getFrozenColumns();t.isNullOrUndefined(r)||(this.gridTheme=r.theme,t.isBlazor()&&!t.isNullOrUndefined(this.gridTheme)&&this.getGridPdfFont(this.gridTheme),n=!!t.isNullOrUndefined(r.allowHorizontalOverflow)||r.allowHorizontalOverflow);var s=new so(e,this.helper.getForeignKeyData()),l=this.processExportProperties(r,i.result),a=y(r)?T(r.columns,e.enableColumnVirtualization):s.getGridExportColumns(o?e.getColumns():e.columns);a=a.filter(function(e){return t.isNullOrUndefined(e.commands)});var h=!1;e.groupSettings.columns.length&&(h=!0),e.childGrid&&!t.isNullOrUndefined(r)&&(e.hierarchyPrintMode=r.hierarchyExportMode||"Expanded");var p=new d.PdfGrid,c=this.getHeaderThemeStyle(),u=c.border,g=c.font,f=c.brush,m=s.getHeaders(a,this.hideColumnInclude),v=m.columns;p=this.processGridHeaders(e.groupSettings.columns.length,p,m.rows,v,u,g,f,e,n,a),this.setColumnProperties(v,p,s,e,n);var C=this.getSummaryCaptionThemeStyle();if(!t.isNullOrUndefined(l)&&l.length){if(h?(t.isNullOrUndefined(C.border)||(u=C.border),this.processGroupedRecords(p,l,v,e,u,0,C.font,C.brush,C.backgroundBrush,i,r,s,0)):this.processRecord(u,v,e,l,p,0,r,s,0),!t.isNullOrUndefined(i.aggregates)){var w=new bi(e),b=void 0,S=w.getColumns();S=S.filter(function(e){return t.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),b=this.customDataSource?w.generateRows(l,i.aggregates):this.currentViewData?w.generateRows(this.parent.getCurrentViewRecords(),i.aggregates):h?w.generateRows(l.records,i.aggregates):w.generateRows(i.result,i.aggregates,null,null,S),this.processAggregates(b,p,u,C.font,C.brush,C.backgroundBrush,!1)}}else p.rows.addRow().style.setBorder(u);return p},r.prototype.getSummaryCaptionThemeStyle=function(){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.caption))return{font:new d.PdfStandardFont(d.PdfFontFamily.Helvetica,9.75),brush:new d.PdfSolidBrush(new d.PdfColor(0,0,0)),backgroundBrush:new d.PdfSolidBrush(new d.PdfColor(246,246,246))};var e=t.isNullOrUndefined(this.gridTheme.caption.fontSize)?9.75:this.gridTheme.caption.fontSize,i=t.isNullOrUndefined(this.gridTheme.caption.fontName)?d.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),r=this.getFontStyle(this.gridTheme.caption),n=new d.PdfColor(0,0,0);if(!t.isNullOrUndefined(this.gridTheme.caption.fontColor)){var o=this.hexToRgb(this.gridTheme.caption.fontColor);n=new d.PdfColor(o.r,o.g,o.b)}var s=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,l=new d.PdfStandardFont(i,e,r);return t.isNullOrUndefined(this.gridTheme.caption.font)||(l=this.gridTheme.caption.font),{font:l,brush:new d.PdfSolidBrush(n),backgroundBrush:new d.PdfSolidBrush(new d.PdfColor(246,246,246)),border:s}},r.prototype.getGridPdfFont=function(e){var i=0;if(e.header&&e.header.font){var r=e.header.font.fontFamily,n=e.header.font.fontSize,o=e.header.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[o])?0:d.PdfFontStyle[o],e.header.font.isTrueType)e.header.font=new d.PdfTrueTypeFont(r,n,i);else{var s=t.isNullOrUndefined(r)?d.PdfFontFamily.Helvetica:this.getFontFamily(r);e.header.font=new d.PdfStandardFont(s,n,i)}}if(e.caption&&e.caption.font){var l=e.caption.font.fontFamily,a=e.caption.font.fontSize,h=e.caption.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[h])?0:d.PdfFontStyle[h],e.caption.font.isTrueType)e.caption.font=new d.PdfTrueTypeFont(l,a,i);else{var p=t.isNullOrUndefined(l)?d.PdfFontFamily.Helvetica:this.getFontFamily(l);e.caption.font=new d.PdfStandardFont(p,a,i)}}if(e.record&&e.record.font){var c=e.record.font.fontFamily,u=e.record.font.fontSize,g=e.record.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[g])?0:d.PdfFontStyle[g],e.record.font.isTrueType)e.record.font=new d.PdfTrueTypeFont(c,u,i);else{var f=t.isNullOrUndefined(c)?d.PdfFontFamily.Helvetica:this.getFontFamily(c);e.record.font=new d.PdfStandardFont(f,u,i)}}},r.prototype.getHeaderThemeStyle=function(){var e=new d.PdfBorders;if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.header))return e.all=new d.PdfPen(new d.PdfColor(234,234,234)),{border:e,font:new d.PdfStandardFont(d.PdfFontFamily.Helvetica,10.5),brush:new d.PdfSolidBrush(new d.PdfColor(102,102,102))};var i=t.isNullOrUndefined(this.gridTheme.header.fontName)?d.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),r=this.getFontStyle(this.gridTheme.header),n=t.isNullOrUndefined(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,o=new d.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.header.fontColor)){var s=this.hexToRgb(this.gridTheme.header.fontColor);o=new d.PdfColor(s.r,s.g,s.b)}var l=new d.PdfStandardFont(i,n,r);return t.isNullOrUndefined(this.gridTheme.header.font)||(l=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:l,brush:new d.PdfSolidBrush(o)}},r.prototype.processGroupedRecords=function(e,i,r,n,o,s,l,a,h,p,c,u,g){for(var f=this,m=s,y=this,v=0,C=i;v<C.length;v++)!function(s){var v=e.rows.addRow(),C=n.getColumnByField(s.field),w={value:s.key,column:C,style:void 0,isForeignKey:C.isForeignColumn()},b={captionText:y.parent.getColumnByField(s.field).headerText+": "+(C.enableGroupByFormat?s.key:y.exportValueFormatter.formatCellValue(w))+" - "+s.count+(i.count>1?" items":" item"),type:"PDF"};y.parent.trigger("exportGroupCaption",b,function(y){v.cells.getCell(m).value=y.captionText,v.cells.getCell(m+1).style.stringFormat=new d.PdfStringFormat(d.PdfTextAlignment.Left),v.style.setBorder(o),v.style.setFont(l),v.style.setTextBrush(a),v.style.setBackgroundBrush(h);var C,w=new xi(n);if(C=t.isNullOrUndefined(s.items.records)?w.generateRows(s.items,s):w.generateRows(s.items.records,s),t.isNullOrUndefined(C)||0!==C.length||(v.cells.getCell(m+1).columnSpan=e.columns.count-(m+1)),!t.isNullOrUndefined(i.childLevels)&&i.childLevels>0)f.processAggregates(C,e,o,l,a,h,!0,v,m),f.processGroupedRecords(e,s.items,r,n,o,m+1,l,a,h,p,c,u,g),C=(b=new Si(n)).generateRows(s.items.records,s),f.processAggregates(C,e,o,l,a,h,!1);else{f.processAggregates(C,e,o,l,a,h,!0,v,m),g=f.processRecord(o,r,n,s.items,e,m+1,c,u,g);var b=new Si(n);C=b.generateRows(s.items,s);f.processAggregates(C,e,o,l,a,h,!1,null,null,!0)}})}(C[v])},r.prototype.processGridHeaders=function(i,r,n,o,s,l,a,h,d,p){var c=this,u=o.length+i,g=ve(p),f=p,m=0;this.parent.allowGrouping&&(m=this.parent.groupSettings.columns.length),r.columns.add(u),r.headers.add(n.length);var y=function(i,o,h,d,p){var u=r.headers.getHeader(i),g=u.cells.getCell(o),f=n[i].cells[o];t.isNullOrUndefined(h.headerTextAlign)||(g.style.stringFormat=c.getHorizontalAlignment(h.headerTextAlign)),d>0&&(g.rowSpan=d,g.style.stringFormat=c.getVerticalAlignment("Bottom",g.style.stringFormat,h.textAlign)),p>0&&(g.columnSpan=p),u.style.setBorder(s),u.style.setFont(l),u.style.setTextBrush(a),g.value=h.headerText,t.isNullOrUndefined(f)||f.cellType!==e.CellType.HeaderIndent&&f.cellType!==e.CellType.DetailHeader||(g.value="",g.width=20);var m={cell:g,gridCell:f,style:g.style};c.parent.trigger("pdfHeaderQueryCellInfo",m)},v=function(e,t,i,r,n,o){for(var s=0,l=0;l<e.length;l++)if(o&&(r=s=s+i+(0===l?0:-1),i=0),e[l].columns&&e[l].columns.length){var a=v(e[l].columns,t-1,0,l+r,n+1,!1);y(n,l+r,e[l],0,a),i+=a,r=r+a-1}else(e[l].visible||c.hideColumnInclude)&&(i++,y(n,l+r+m,e[l],t,0));return i};return v(f,g,0,0,0,!0),r.columns.count>=6&&d&&(r.style.allowHorizontalOverflow=!0),r},r.prototype.processExportProperties=function(e,r){if(t.isNullOrUndefined(e))this.currentViewData=!1,this.customDataSource=!1;else{t.isNullOrUndefined(e.theme)||(this.gridTheme=e.theme);var n=this.pdfPageSettings.size;if(this.drawHeader(e),!t.isNullOrUndefined(e.footer)){var o=e.footer,s=new d.PointF(0,n.width-80-.75*o.fromBottom),l=new d.SizeF(n.width-80,.75*o.height),a=new d.RectangleF(s,l);this.pdfDocument.template.bottom=this.drawPageTemplate(new d.PdfPageTemplateElement(a),o)}t.isNullOrUndefined(e.includeHiddenColumn)||this.isGrouping||(this.hideColumnInclude=e.includeHiddenColumn),t.isNullOrUndefined(e.dataSource)?t.isNullOrUndefined(e.exportType)?(this.currentViewData=!1,this.customDataSource=!1):"CurrentPage"===e.exportType?(r=this.parent.currentViewData,this.currentViewData=!0,this.customDataSource=!1):(this.currentViewData=!1,this.customDataSource=!1):(e.dataSource instanceof i.DataManager||(r=e.dataSource),this.customDataSource=!0,this.currentViewData=!1)}return r},r.prototype.drawHeader=function(e){var i=this,r=this.pdfPageSettings.size;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.header)){var n=e.header,o=new d.PointF(0,n.fromTop),s=new d.SizeF(r.width-80,.75*n.height),l=new d.RectangleF(o,s);if(this.headerOnPages.length){var a=this.drawPageTemplate(new d.PdfPageTemplateElement(l),n);this.headerOnPages.filter(function(e){e-1>=0&&e-1<i.pdfDocument.pages.count-1&&i.pdfDocument.pages.getPageByIndex(e-1).graphics.drawPdfTemplate(a.template,new d.PointF(0,0))})}else this.pdfDocument.template.top=this.drawPageTemplate(new d.PdfPageTemplateElement(l),n)}},r.prototype.drawPageTemplate=function(e,t){for(var i=0,r=t.contents;i<r.length;i++){var n=r[i];switch(this.processContentValidation(n),n.type){case"Text":if(""===n.value||void 0===n.value||null===n.value||"string"!=typeof n.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,n);break;case"PageNumber":this.drawPageNumber(e,n);break;case"Image":if(void 0===n.src||null===n.src||""===n.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,n);break;case"Line":this.drawLine(e,n);break;default:throw new Error("Please set valid content type...")}}return e},r.prototype.processContentValidation=function(e){if(void 0===e.type||null===e.type)throw new Error("please set valid content type...");if("Line"===e.type){if(void 0===e.points||null===e.points)throw new Error("please enter valid points in "+e.type+" content...");if(void 0===e.points.x1||null===e.points.x1||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(void 0===e.points.y1||null===e.points.y1||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(void 0===e.points.x2||null===e.points.x2||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(void 0===e.points.y2||null===e.points.y2||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(void 0===e.position||null===e.position)throw new Error("please enter valid position in "+e.type+" content...");if(void 0===e.position.x||null===e.position.x||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(void 0===e.position.y||null===e.position.y||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},r.prototype.drawText=function(e,i){var r=this.getFont(i),n=this.getBrushFromContent(i),o=null;if(!t.isNullOrUndefined(i.style.textPenColor)){var s=this.hexToRgb(i.style.textPenColor);o=new d.PdfPen(new d.PdfColor(s.r,s.g,s.b))}null==n&&null==o&&(n=new d.PdfSolidBrush(new d.PdfColor(0,0,0)));var l=i.value.toString(),a=.75*i.position.x,h=.75*i.position.y,p=new d.PdfStringFormat,c=this.setContentFormat(i,p);null===c||t.isNullOrUndefined(c.format)||t.isNullOrUndefined(c.size)?e.graphics.drawString(l,r,o,n,a,h,p):e.graphics.drawString(l,r,o,n,a,h,c.size.width,c.size.height,c.format)},r.prototype.drawPageNumber=function(e,i){var r=this.getFont(i),n=null;if(t.isNullOrUndefined(i.style.textBrushColor))n=new d.PdfSolidBrush(new d.PdfColor(0,0,0));else{var o=this.hexToRgb(i.style.textBrushColor);n=new d.PdfSolidBrush(new d.PdfColor(o.r,o.g,o.b))}var s=new d.PdfPageNumberField(r,n);s.numberStyle=this.getPageNumberStyle(i.pageNumberType);var l,a;if(t.isNullOrUndefined(i.format))a="{0}",l=new d.PdfCompositeField(r,n,a,s);else if(-1!==i.format.indexOf("$total")&&-1!==i.format.indexOf("$current"))(h=new d.PdfPageCountField(r)).numberStyle=this.getPageNumberStyle(i.pageNumberType),a=i.format.indexOf("$total")>i.format.indexOf("$current")?(a=i.format.replace("$current","0")).replace("$total","1"):(a=i.format.replace("$current","1")).replace("$total","0"),l=new d.PdfCompositeField(r,n,a,s,h);else if(-1!==i.format.indexOf("$current")&&-1===i.format.indexOf("$total"))a=i.format.replace("$current","0"),l=new d.PdfCompositeField(r,n,a,s);else{var h=new d.PdfPageCountField(r);a=i.format.replace("$total","0"),l=new d.PdfCompositeField(r,n,a,h)}var p=.75*i.position.x,c=.75*i.position.y,u=this.setContentFormat(i,l.stringFormat);null===u||t.isNullOrUndefined(u.format)||t.isNullOrUndefined(u.size)||(l.stringFormat=u.format,l.bounds=new d.RectangleF(p,c,u.size.width,u.size.height)),l.draw(e.graphics,p,c)},r.prototype.drawImage=function(e,i){var r=.75*i.position.x,n=.75*i.position.y,o=t.isNullOrUndefined(i.size)?void 0:.75*i.size.width,s=t.isNullOrUndefined(i.size)?void 0:.75*i.size.height,l=new d.PdfBitmap(i.src);t.isNullOrUndefined(o)?e.graphics.drawImage(l,r,n):e.graphics.drawImage(l,r,n,o,s)},r.prototype.drawLine=function(e,i){var r=.75*i.points.x1,n=.75*i.points.y1,o=.75*i.points.x2,s=.75*i.points.y2,l=this.getPenFromContent(i);t.isNullOrUndefined(i.style)||null===i.style||(t.isNullOrUndefined(i.style.penSize)||null===i.style.penSize||"number"!=typeof i.style.penSize||(l.width=.75*i.style.penSize),l.dashStyle=this.getDashStyle(i.style.dashStyle)),e.graphics.drawLine(l,r,n,o,s)},r.prototype.processAggregates=function(i,r,n,o,s,l,a,h,d,p){for(var c=0,u=i;c<u.length;c++){for(var g=u[c],f=-1,m=0,y=!0,v=[],C=0;C<r.columns.count;C++){var w=g.cells[m];if(w.cellType!==e.CellType.DetailFooterIntent){if(!this.hideColumnInclude){for(;void 0===w.visible;)if(w.cellType!==e.CellType.DetailFooterIntent){if(t.isNullOrUndefined(h))v.push("");else if(t.isNullOrUndefined(h.cells.getCell(C).value))v.push("");else{z={row:g,type:"GroupCaption",style:h.cells};this.parent.trigger("pdfAggregateQueryCellInfo",z),v.push(""),v.push(h.cells.getCell(C).value),y=!1,a||(C+=1)}C+=1,m+=1,w=g.cells[m]}for(;!t.isNullOrUndefined(w.visible)&&!w.visible;)m+=1,w=g.cells[m]}if(w.isDataCell){var b={};if(t.isNullOrUndefined(w.column.footerTemplate)&&t.isNullOrUndefined(w.column.groupCaptionTemplate)&&t.isNullOrUndefined(w.column.groupFooterTemplate)){var S=this.getSummaryWithoutTemplate(g.data[w.column.field]);t.isNullOrUndefined(S)||v.push(S)}else{b=(S=this.getTemplateFunction(b,C,f,w)).templateFunction,f=S.leastCaptionSummaryIndex;var x=void 0,R=g.data[w.column.field?w.column.field:w.column.columnName];this.parent.isReact||this.parent.isVue?(x=b[t.getEnumValue(e.CellType,w.cellType)](R,this.parent),this.parent.isReact&&this.parent.renderTemplates()):x=b[t.getEnumValue(e.CellType,w.cellType)](R),v.push(x[0].textContent),y=!1}}else v.push("");y&&""!==v[C]&&!t.isNullOrUndefined(v[C])&&null!==v[C]&&(y=!1),m+=1}else C--,m++}if(a)for(C=this.parent.groupSettings.columns.length+1;C<v.length-1;C++)v[C]=v[C+1];if(!y)if(a)for(C=0;C<r.columns.count;C++)h.cells.getCell(C).value=v[C].toString(),C===d+1&&-1!==f&&1!==f?h.cells.getCell(C).columnSpan=f-(d+1):C===d+1&&-1===f&&(h.cells.getCell(C).columnSpan=r.columns.count-(d+1));else{var F=r.rows.addRow();F.style.setBorder(n),F.style.setFont(o),F.style.setTextBrush(s),F.style.setBackgroundBrush(l);var z={row:g,type:p?"GroupFooter":"Footer",style:F.cells};this.parent.trigger("pdfAggregateQueryCellInfo",z);for(C=0;C<r.columns.count;C++)F.cells.getCell(C).value=v[C].toString()}}},r.prototype.getTemplateFunction=function(i,r,n,o){return t.isNullOrUndefined(o.column.footerTemplate)||o.cellType!==e.CellType.Summary?t.isNullOrUndefined(o.column.groupCaptionTemplate)?i[t.getEnumValue(e.CellType,e.CellType.GroupSummary)]=t.compile(o.column.groupFooterTemplate):(-1===n&&(n=r),i[t.getEnumValue(e.CellType,e.CellType.CaptionSummary)]=t.compile(o.column.groupCaptionTemplate)):i[t.getEnumValue(e.CellType,e.CellType.Summary)]=t.compile(o.column.footerTemplate),{templateFunction:i,leastCaptionSummaryIndex:n}},r.prototype.getSummaryWithoutTemplate=function(e){return t.isNullOrUndefined(e.Sum)?t.isNullOrUndefined(e.Average)?t.isNullOrUndefined(e.Max)?t.isNullOrUndefined(e.Min)?t.isNullOrUndefined(e.Count)?t.isNullOrUndefined(e.TrueCount)?t.isNullOrUndefined(e.FalseCount)?t.isNullOrUndefined(e.Custom)?void 0:e.Custom:e.FalseCount:e.TrueCount:e.Count:e.Min:e.Max:e.Average:e.Sum},r.prototype.setColumnProperties=function(e,i,r,n,o){for(var s=n.groupSettings.columns.length,l=0;l<s;l++)i.columns.getColumn(l).width=20;for(l=0;l<e.length;l++)t.isNullOrUndefined(e[l].textAlign)||(i.columns.getColumn(l+s).format=this.getHorizontalAlignment(e[l].textAlign)),i.style.allowHorizontalOverflow&&!t.isNullOrUndefined(e[l].width)&&o&&(i.columns.getColumn(l+s).width="number"==typeof e[l].width?.75*e[l].width:.75*r.getConvertedWidth(e[l].width))},r.prototype.setRecordThemeStyle=function(e,i){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.record))e.style.setTextBrush(new d.PdfSolidBrush(new d.PdfColor(0,0,0)));else{var r=t.isNullOrUndefined(this.gridTheme.record.fontName)?d.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.record.fontName),n=t.isNullOrUndefined(this.gridTheme.record.fontSize)?9.75:this.gridTheme.record.fontSize,o=this.getFontStyle(this.gridTheme.record),s=new d.PdfStandardFont(r,n,o);t.isNullOrUndefined(this.gridTheme.record.font)||(s=this.gridTheme.record.font),e.style.setFont(s);var l=new d.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.record.fontColor)){var a=this.hexToRgb(this.gridTheme.record.fontColor);l=new d.PdfColor(a.r,a.g,a.b)}e.style.setTextBrush(new d.PdfSolidBrush(l))}var h=this.gridTheme&&this.gridTheme.record&&this.gridTheme.record.border?this.getBorderStyle(this.gridTheme.record.border):i;return e.style.setBorder(h),e},r.prototype.processRecord=function(i,r,n,o,s,l,a,h,p){for(var c=0,u=h.getGridRowModel(r,o,n,p);c<u.length;c++){var g=u[c];p++;for(var f=this.setRecordThemeStyle(s.rows.addRow(),i),m=g.cells.length,y=0;y<m;y++){var v=g.cells[y];if(v.cellType===e.CellType.Data){var C=v.column,w=C.field,b=t.isNullOrUndefined(w)?"":C.valueAccessor(w,g.data,C),S=t.isNullOrUndefined(b)?"":b,x=void 0;if(C.isForeignColumn&&C.isForeignColumn()&&(x=h.getFData(S,C),S=t.getValue(C.foreignKeyValue,x)),(O={data:g.data,value:S,column:C,style:void 0,colSpan:1,cell:I=f.cells.getCell(y)}).value="boolean"===O.column.type&&"string"==typeof O.value?O.value:this.exportValueFormatter.formatCellValue(O,n.isServerRendered),this.parent.trigger("pdfQueryCellInfo",O),t.isNullOrUndefined(O.image)||(O.value=new d.PdfBitmap(O.image.base64)),I.value=O.value,!t.isNullOrUndefined(O.hyperLink)){var R=new d.PdfTextWebLink;R.url=O.hyperLink.target,R.text=O.hyperLink.displayText||O.hyperLink.target,R.font=new d.PdfStandardFont(d.PdfFontFamily.Helvetica,9.75),R.brush=new d.PdfSolidBrush(new d.PdfColor(51,102,187)),I.value=R}if(t.isNullOrUndefined(O.style)||this.processCellStyle(I,O),O.colSpan>1){y+1+O.colSpan>f.cells.count&&(O.colSpan=f.cells.count-(y+1)),I.columnSpan=O.colSpan;for(var F=1;F<I.columnSpan;F++)f.cells.getCell(y+F).value="";y+=O.colSpan-1}}}if(g.isExpand){var z=this.setRecordThemeStyle(s.rows.addRow(),i),I=z.cells.getCell(l);I.columnSpan=z.cells.count-l,I.style.cellPadding=new d.PdfPaddings(10,10,10,10),n.isPrinting=!0;var T=!t.isNullOrUndefined(a)&&a.exportType?a.exportType:"AllPages",E=this.helper.createChildGrid(n,g,T,this.gridPool),M=E.childGrid,D=E.element;M.actionFailure=h.failureHandler(this.gridPool,M,this.globalResolve);var O={childGrid:M,row:g,cell:I,exportProperties:a};this.parent.trigger("exportdetaildatabound",O),M.beforeDataBound=this.childGridCell(I,M,a),M.appendTo(D)}this.parent.notify("export-RowDataBound",{type:"pdf",rowObj:g})}return p},r.prototype.childGridCell=function(e,i,r){var n=this;return function(o){return i.beforeDataBound=null,o.cancel=!0,e.value=n.processGridExport(i,o,r),i.destroy(),t.detach(i.element),n.gridPool[i.id]=!0,n.helper.checkAndExport(n.gridPool,n.globalResolve),e}},r.prototype.processCellStyle=function(e,i){if(!t.isNullOrUndefined(i.style.backgroundColor)){var r=this.hexToRgb(i.style.backgroundColor);e.style.backgroundBrush=new d.PdfSolidBrush(new d.PdfColor(r.r,r.g,r.b))}if(t.isNullOrUndefined(i.style.textAlignment)||(e.style.stringFormat=this.getHorizontalAlignment(i.style.textAlignment)),t.isNullOrUndefined(i.style.cellPadding)||(e.style.cellPadding=i.style.cellPadding),t.isNullOrUndefined(i.style.verticalAlignment)||(e.style.stringFormat=this.getVerticalAlignment(i.style.verticalAlignment,e.style.stringFormat)),!t.isNullOrUndefined(i.style.textBrushColor)){var n=this.hexToRgb(i.style.textBrushColor);e.style.textBrush=new d.PdfSolidBrush(new d.PdfColor(n.r,n.g,n.b))}if(!t.isNullOrUndefined(i.style.textPenColor)){var o=this.hexToRgb(i.style.textPenColor);e.style.textPen=new d.PdfPen(new d.PdfColor(o.r,o.g,o.b))}if(t.isNullOrUndefined(i.style.fontFamily)&&t.isNullOrUndefined(i.style.fontSize)&&t.isNullOrUndefined(i.style.bold)&&t.isNullOrUndefined(i.style.italic)&&t.isNullOrUndefined(i.style.underline)&&t.isNullOrUndefined(i.style.strikeout)||(e.style.font=this.getFont(i)),!t.isNullOrUndefined(i.style.border)){var s=new d.PdfBorders,l=i.style.border.width,a=t.isNullOrUndefined(l)||"number"!=typeof l?void 0:.75*l,h=new d.PdfColor(196,196,196);if(!t.isNullOrUndefined(i.style.border.color)){var p=this.hexToRgb(i.style.border.color);h=new d.PdfColor(p.r,p.g,p.b)}var c=new d.PdfPen(h,a);t.isNullOrUndefined(i.style.border.dashStyle)||(c.dashStyle=this.getDashStyle(i.style.border.dashStyle)),s.all=c,e.style.borders=s}t.isNullOrUndefined(i.style.paragraphIndent)||(e.style.stringFormat=new d.PdfStringFormat,e.style.stringFormat.paragraphIndent=i.style.paragraphIndent)},r.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new d.PdfStringFormat),e){case"Right":t.alignment=d.PdfTextAlignment.Right;break;case"Center":t.alignment=d.PdfTextAlignment.Center;break;case"Justify":t.alignment=d.PdfTextAlignment.Justify;break;case"Left":t.alignment=d.PdfTextAlignment.Left}return t},r.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new d.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=d.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=d.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=d.PdfVerticalAlignment.Top}return t},r.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},r.prototype.getFont=function(e){if(e.font)return e.font;var i=t.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,r=t.isNullOrUndefined(e.style.fontFamily)?d.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=d.PdfFontStyle.Regular;return!t.isNullOrUndefined(e.style.bold)&&e.style.bold&&(n|=d.PdfFontStyle.Bold),!t.isNullOrUndefined(e.style.italic)&&e.style.italic&&(n|=d.PdfFontStyle.Italic),!t.isNullOrUndefined(e.style.underline)&&e.style.underline&&(n|=d.PdfFontStyle.Underline),!t.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(n|=d.PdfFontStyle.Strikeout),new d.PdfStandardFont(r,i,n)},r.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},r.prototype.setContentFormat=function(e,i){if(!t.isNullOrUndefined(e.size)){var r=.75*e.size.width,n=.75*e.size.height;if(i=new d.PdfStringFormat(d.PdfTextAlignment.Left,d.PdfVerticalAlignment.Middle),!t.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":i.alignment=d.PdfTextAlignment.Right;break;case"Center":i.alignment=d.PdfTextAlignment.Center;break;case"Justify":i.alignment=d.PdfTextAlignment.Justify;break;default:i.alignment=d.PdfTextAlignment.Left}return t.isNullOrUndefined(e.style.vAlign)||(i=this.getVerticalAlignment(e.style.vAlign,i)),{format:i,size:new d.SizeF(r,n)}}return null},r.prototype.getPageSize=function(e){switch(e){case"Letter":return new d.SizeF(612,792);case"Note":return new d.SizeF(540,720);case"Legal":return new d.SizeF(612,1008);case"A0":return new d.SizeF(2380,3368);case"A1":return new d.SizeF(1684,2380);case"A2":return new d.SizeF(1190,1684);case"A3":return new d.SizeF(842,1190);case"A5":return new d.SizeF(421,595);case"A6":return new d.SizeF(297,421);case"A7":return new d.SizeF(210,297);case"A8":return new d.SizeF(148,210);case"A9":return new d.SizeF(105,148);case"B0":return new d.SizeF(2836,4008);case"B1":return new d.SizeF(2004,2836);case"B2":return new d.SizeF(1418,2004);case"B3":return new d.SizeF(1002,1418);case"B4":return new d.SizeF(709,1002);case"B5":return new d.SizeF(501,709);case"Archa":return new d.SizeF(648,864);case"Archb":return new d.SizeF(864,1296);case"Archc":return new d.SizeF(1296,1728);case"Archd":return new d.SizeF(1728,2592);case"Arche":return new d.SizeF(2592,3456);case"Flsa":return new d.SizeF(612,936);case"HalfLetter":return new d.SizeF(396,612);case"Letter11x17":return new d.SizeF(792,1224);case"Ledger":return new d.SizeF(1224,792);default:return new d.SizeF(595,842)}},r.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},r.prototype.getPenFromContent=function(e){var i=new d.PdfPen(new d.PdfColor(0,0,0));if(!t.isNullOrUndefined(e.style)&&null!==e.style&&!t.isNullOrUndefined(e.style.penColor)){var r=this.hexToRgb(e.style.penColor);i=new d.PdfPen(new d.PdfColor(r.r,r.g,r.b))}return i},r.prototype.getBrushFromContent=function(e){var i=null;if(!t.isNullOrUndefined(e.style.textBrushColor)){var r=this.hexToRgb(e.style.textBrushColor);i=new d.PdfSolidBrush(new d.PdfColor(r.r,r.g,r.b))}return i},r.prototype.hexToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color...");e=e.substring(1);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},r.prototype.getFontStyle=function(e){var i=d.PdfFontStyle.Regular;return!t.isNullOrUndefined(e)&&e.bold&&(i|=d.PdfFontStyle.Bold),!t.isNullOrUndefined(e)&&e.italic&&(i|=d.PdfFontStyle.Italic),!t.isNullOrUndefined(e)&&e.underline&&(i|=d.PdfFontStyle.Underline),!t.isNullOrUndefined(e)&&e.strikeout&&(i|=d.PdfFontStyle.Strikeout),i},r.prototype.getBorderStyle=function(e){var i=new d.PdfBorders;if(t.isNullOrUndefined(e))i.all=new d.PdfPen(new d.PdfColor(234,234,234));else{var r=e.width,n=t.isNullOrUndefined(r)||"number"!=typeof r?void 0:.75*r,o=new d.PdfColor(196,196,196);if(!t.isNullOrUndefined(e.color)){var s=this.hexToRgb(e.color);o=new d.PdfColor(s.r,s.g,s.b)}var l=new d.PdfPen(o,n);t.isNullOrUndefined(e.dashStyle)||(l.dashStyle=this.getDashStyle(e.dashStyle)),i.all=l}return i},r.prototype.destroy=function(){},r}(),po=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),co=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.buttonElement=r.parent.createElement("button",{}),r.unbounDiv=r.parent.createElement("div",{className:"e-unboundcelldiv",styles:"display: inline-block"}),r.element=r.parent.createElement("TD",{className:"e-rowcell e-unboundcell",attrs:{role:"gridcell",tabindex:"-1"}}),r}return po(i,e),i.prototype.render=function(e,i,r){var n=this.element.cloneNode();if(n.appendChild(this.unbounDiv.cloneNode()),n.setAttribute("aria-label","is Command column column header "+e.column.headerText),e.column.commandsTemplate)if(this.parent.isReact&&"string"!=typeof e.column.commandsTemplate){var o=this.parent+"commandsTemplate";e.column.getColumnTemplate()(i,this.parent,"commandsTemplate",o,null,null,n.firstElementChild),this.parent.renderTemplates()}else q(n.firstElementChild,e.column.getColumnTemplate()(i));else for(var s=0,l=e.commands;s<l.length;s++){var a=l[s];n=this.renderButton(n,a,r.index,a.uid)}return this.setAttributes(n,e,r),this.parent.isEdit?(t.addClass(n.querySelectorAll(".e-edit-delete"),"e-hide"),t.removeClass(n.querySelectorAll(".e-save-cancel"),"e-hide")):(t.addClass(n.querySelectorAll(".e-save-cancel"),"e-hide"),t.removeClass(n.querySelectorAll(".e-edit-delete"),"e-hide")),n},i.prototype.renderButton=function(e,i,r,o){var s=this.buttonElement.cloneNode();t.attributes(s,{id:this.parent.element.id+(i.type||"")+"_"+r+"_"+o,type:"button",title:t.isNullOrUndefined(i.title)?i.buttonOption.content||this.localizer.getConstant(i.type)||i.type:i.title,"data-uid":o}),s.onclick=i.buttonOption.click;var l=new n.Button(i.buttonOption,s);switch(l.commandType=i.type,e.firstElementChild.appendChild(l.element),i.type){case"Edit":case"Delete":t.addClass([s],["e-edit-delete","e-"+i.type.toLowerCase()+"button"]);break;case"Cancel":case"Save":t.addClass([s],["e-save-cancel","e-"+i.type.toLowerCase()+"button"])}return e},i}(Ti),uo=function(){function i(e,t){this.parent=e,this.locator=t,this.initiateRender(),this.addEventListener()}return i.prototype.initiateRender=function(){this.locator.getService("cellRendererFactory").addCellRenderer(e.CellType.CommandColumn,new co(this.parent,this.locator))},i.prototype.commandClickHandler=function(e){var i=this.parent,r=(i.element.id,t.closest(e.target,"button"));if(r&&t.closest(e.target,".e-unboundcell")){for(var n,o=r.ej2_instances[0],s=o.commandType,l=r.getAttribute("data-uid"),a=i.getRowObjectFromUID(t.closest(r,".e-row").getAttribute("data-uid")),h=this.parent.columnModel,d=0;d<h.length;d++)if(h[d].commands)for(var p=h[d].commands,c=0;c<p.length;c++){t.isBlazor()&&!i.isJsComponent&&p[c].uid===l?(n=p[c],s=p[c].type):p[c].uid===l&&p[c].type===s&&(n=p[c])}var u={cancel:!1,target:r,commandColumn:n,rowData:t.isNullOrUndefined(a)?void 0:a.data};this.parent.trigger("commandClick",u,function(e){if(!o.disabled&&i.editModule&&!e.cancel)switch(s){case"Edit":i.editModule.endEdit(),i.editModule.startEdit(t.closest(r,"tr"));break;case"Cancel":i.editModule.closeEdit();break;case"Save":i.editModule.endEdit();break;case"Delete":"Batch"!==i.editSettings.mode&&i.editModule.endEdit(),i.commandDelIndex=parseInt(t.closest(r,"tr").getAttribute("aria-rowindex"),10),i.clearSelection(),i.selectRow(i.commandDelIndex,!1),i.editModule.deleteRecord(),i.commandDelIndex=void 0}})}},i.prototype.getModuleName=function(){return"commandColumn"},i.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ht,this.commandClickHandler),this.parent.off(qt,this.keyPressHandler),this.parent.off(Tt,this.load))},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ht,this.commandClickHandler,this),this.parent.on(qt,this.keyPressHandler,this),this.parent.on(Tt,this.load,this))},i.prototype.keyPressHandler=function(e){"enter"===e.action&&t.closest(e.target,".e-unboundcelldiv")&&(this.commandClickHandler(e),e.preventDefault())},i.prototype.load=function(){if(!t.isBlazor()||this.parent.isJsComponent)for(var e=this.parent.columnModel,i=0;i<e.length;i++)if(e[i].commands)for(var r=e[i].commands,n=0;n<r.length;n++)r[n].uid=N("gridcommand")},i}(),go={header:".e-gridheader",content:".e-gridcontent",edit:".e-inline-edit",batchEdit:".e-editedbatchcell",editIcon:"e-edit",pager:".e-gridpager",delete:"e-delete",save:"e-save",cancel:"e-cancel",copy:"e-copy",pdf:"e-pdfexport",group:"e-icon-group",ungroup:"e-icon-ungroup",csv:"e-csvexport",excel:"e-excelexport",fPage:"e-icon-first",nPage:"e-icon-next",lPage:"e-icon-last",pPage:"e-icon-prev",ascending:"e-icon-ascending",descending:"e-icon-descending",groupHeader:"e-groupdroparea",touchPop:"e-gridpopup"},fo=function(){function e(e,t){this.defaultItems={},this.disableItems=[],this.hiddenItems=[],this.localeText=this.setLocaleKey(),this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Dt,this.enableAfterRenderMenu,this),this.parent.on(It,this.render,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(It,this.render),this.parent.off(Dt,this.enableAfterRenderMenu),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler.bind(this)))},e.prototype.keyDownHandler=function(e){"Tab"!==e.code&&9!==e.which||this.contextMenu.close(),"Escape"===e.code&&(this.contextMenu.close(),this.parent.notify("restore-Focus",{}))},e.prototype.render=function(){this.parent.element.classList.add("e-noselect"),this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_cmenu"}),t.EventHandler.add(this.element,"keydown",this.keyDownHandler.bind(this)),this.parent.element.appendChild(this.element);var e="#"+this.gridID;this.contextMenu=new a.ContextMenu({items:this.getMenuItems(),enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,target:e,select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-grid-menu"}),this.contextMenu.appendTo(this.element)},e.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),t.remove(this.element),this.parent.element.classList.remove("e-noselect")),this.render())},e.prototype.getMenuItems=function(){for(var e=[],t=[],i=0,r=this.parent.contextMenuItems;i<r.length;i++){var n=r[i];"string"==typeof n&&-1!==this.getDefaultItems().indexOf(n)?-1!==n.toLocaleLowerCase().indexOf("export")?t.push(this.buildDefaultItems(n)):e.push(this.buildDefaultItems(n)):"string"!=typeof n&&e.push(n)}if(t.length>0){var o=this.buildDefaultItems("export");o.items=t,e.push(o)}return e},e.prototype.getLastPage=function(){var e=Math.floor(this.parent.pageSettings.totalRecordsCount/this.parent.pageSettings.pageSize);return this.parent.pageSettings.totalRecordsCount%this.parent.pageSettings.pageSize&&(e+=1),e},e.prototype.contextMenuOpen=function(){this.isOpen=!0},e.prototype.contextMenuItemClick=function(e){switch(this.getKeyFromId(e.item.id)){case"AutoFitAll":this.parent.autoFitColumns([]);break;case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Edit":this.parent.editModule&&("Batch"===this.parent.editSettings.mode?this.row&&this.cell&&!isNaN(parseInt(this.cell.getAttribute("aria-colindex"),10))&&this.parent.editModule.editCell(parseInt(this.row.getAttribute("aria-rowindex"),10),this.parent.getColumns()[parseInt(this.cell.getAttribute("aria-colindex"),10)].field):(this.parent.editModule.endEdit(),this.parent.editModule.startEdit(this.row)));break;case"Delete":this.parent.editModule&&("Batch"!==this.parent.editSettings.mode&&this.parent.editModule.endEdit(),1===this.parent.getSelectedRecords().length?this.parent.editModule.deleteRow(this.row):this.parent.deleteRecord());break;case"Save":this.parent.editModule&&this.parent.editModule.endEdit();break;case"Cancel":this.parent.editModule&&this.parent.editModule.closeEdit();break;case"Copy":this.parent.copy();break;case"PdfExport":this.parent.pdfExport();break;case"ExcelExport":this.parent.excelExport();break;case"CsvExport":this.parent.csvExport();break;case"SortAscending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"FirstPage":this.parent.goToPage(1);break;case"PrevPage":this.parent.goToPage(this.parent.pageSettings.currentPage-1);break;case"LastPage":this.parent.goToPage(this.getLastPage());break;case"NextPage":this.parent.goToPage(this.parent.pageSettings.currentPage+1)}if(e.column=this.targetColumn,e.rowInfo=this.targetRowdata,t.isBlazor()){var i=e.rowInfo.row?{element:e.element,item:e.item,event:e.event,column:this.targetColumn,rowInfo:{rowData:this.targetRowdata.rowData,rowIndex:this.targetRowdata.rowIndex,cellIndex:this.targetRowdata.cellIndex}}:this.targetColumn?{element:e.element,item:e.item,event:e.event,column:this.targetColumn}:{element:e.element,item:e.item,event:e.event};this.parent.trigger("contextMenuClick",i)}else this.parent.trigger("contextMenuClick",e)},e.prototype.contextMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof a.ContextMenu&&this.updateItemStatus(),this.parent.notify("select-row-on-context-open",{isOpen:!1})},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[e])},e.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems),this.contextMenu.enableItems(this.disableItems),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},e.prototype.contextMenuBeforeOpen=function(e){var i=t.closest(e.event.target,".e-grid");if(e.event&&i&&i!==this.parent.element)e.cancel=!0;else if(e.event&&(t.closest(e.event.target,"."+go.groupHeader)||t.closest(e.event.target,"."+go.touchPop)||t.closest(e.event.target,".e-summarycell")||t.closest(e.event.target,".e-groupcaption")||t.closest(e.event.target,".e-filterbarcell")))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),this.targetRowdata=this.parent.getRowInfo(e.event.target),t.isNullOrUndefined(e.parentItem)&&this.targetColumn&&this.targetRowdata.cell&&(this.parent.notify("select-row-on-context-open",{isOpen:!0}),this.selectRow(e.event,!this.targetRowdata.cell.classList.contains("e-selectionbackground")||"Multiple"!==this.parent.selectionSettings.type));for(var r=[],n=[],o=0,s=e.items;o<s.length;o++){var l=s[o],a=this.getKeyFromId(l.id),h=this.defaultItems[a];if(-1!==this.getDefaultItems().indexOf(a))if(this.ensureDisabledStatus(a)&&this.disableItems.push(l.text),e.event&&(this.ensureTarget(e.event.target,go.edit)||this.ensureTarget(e.event.target,go.batchEdit)))"Save"!==a&&"Cancel"!==a&&this.hiddenItems.push(l.text);else{if(this.parent.editModule&&"Batch"===this.parent.editSettings.mode&&(t.closest(e.event.target,".e-gridform")||this.parent.editModule.getBatchChanges().changedRecords.length||this.parent.editModule.getBatchChanges().addedRecords.length||this.parent.editModule.getBatchChanges().deletedRecords.length)&&("Save"===a||"Cancel"===a))continue;t.isNullOrUndefined(e.parentItem)&&e.event&&!this.ensureTarget(e.event.target,h.target)&&this.hiddenItems.push(l.text)}else l.target&&e.event&&!this.ensureTarget(e.event.target,l.target)?l.separator?r.push(l.id):this.hiddenItems.push(l.text):this.ensureTarget(e.event.target,l.target)&&l.separator&&n.push(l.id)}n.length>0&&this.contextMenu.showItems(n,!0),this.contextMenu.enableItems(this.disableItems,!1),this.contextMenu.hideItems(this.hiddenItems),r.length>0&&this.contextMenu.hideItems(r,!0),this.eventArgs=e.event,e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger("contextMenuOpen",e),(e.cancel||this.hiddenItems.length===e.items.length&&!e.parentItem)&&(this.updateItemStatus(),e.cancel=!0)}Se(this.parent.element,this.contextMenu.element.parentElement)},e.prototype.ensureTarget=function(e,i){var r=e;return(r=!this.ensureFrozenHeader(e)||i!==go.header&&i!==go.content?i===go.content||i===go.header?O(t.closest(e,".e-table"),i.substr(1,i.length)):t.closest(e,i):t.closest(e,i===go.header?"thead":"tbody"))&&O(r,"e-grid")===this.parent.element},e.prototype.ensureFrozenHeader=function(e){return!(!this.parent.isFrozenGrid()&&!this.parent.frozenRows||!t.closest(e,go.header))},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"AutoFitAll":case"AutoFit":t=!(this.parent.ensureModuleInjected(Rn)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(In)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.field)&&(t=!0);break;case"Ungroup":(!this.parent.allowGrouping||!this.parent.ensureModuleInjected(In)||this.parent.ensureModuleInjected(In)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"Edit":case"Delete":case"Save":case"Cancel":this.parent.editModule&&0!==this.parent.getDataRows().length||(t=!0);break;case"Copy":0!==this.parent.getSelectedRowIndexes().length&&0!==this.parent.getCurrentViewRecords().length||(t=!0);break;case"export":this.parent.allowExcelExport&&this.parent.excelExport&&(this.parent.ensureModuleInjected(ho)||this.parent.ensureModuleInjected(ao))||(t=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected(ho)||(t=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(ao)||(t=!0);break;case"SortAscending":case"SortDescending":if(!this.parent.allowSorting||!this.parent.ensureModuleInjected(en)||this.targetColumn&&!this.targetColumn.field)t=!0;else if(this.parent.ensureModuleInjected(en)&&this.parent.sortSettings.columns.length>0&&this.targetColumn)for(var i=this.parent.sortSettings.columns,r=0;r<i.length;r++)i[r].field===this.targetColumn.field&&i[r].direction.toLowerCase()===e.toLowerCase().replace("sort","").toLocaleLowerCase()&&(t=!0);break;case"FirstPage":case"PrevPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected(hn)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected(hn)&&1===this.parent.pageSettings.currentPage)&&(t=!0);break;case"LastPage":case"NextPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected(hn)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected(hn)&&this.parent.pageSettings.currentPage===this.getLastPage())&&(t=!0)}return t},e.prototype.getContextMenu=function(){return this.element},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.contextMenu.destroy(),t.remove(this.element),this.removeEventListener(),this.parent.element.classList.remove("e-noselect"))},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.generateID=function(e){return this.gridID+"_cmenu_"+e},e.prototype.getKeyFromId=function(e){return e.replace(this.gridID+"_cmenu_","")},e.prototype.buildDefaultItems=function(e){var t;switch(e){case"AutoFitAll":case"AutoFit":t={target:go.header};break;case"Group":t={target:go.header,iconCss:go.group};break;case"Ungroup":t={target:go.header,iconCss:go.ungroup};break;case"Edit":t={target:go.content,iconCss:go.editIcon};break;case"Delete":t={target:go.content,iconCss:go.delete};break;case"Save":t={target:go.edit,iconCss:go.save};break;case"Cancel":t={target:go.edit,iconCss:go.cancel};break;case"Copy":t={target:go.content,iconCss:go.copy};break;case"export":t={target:go.content};break;case"PdfExport":t={target:go.content,iconCss:go.pdf};break;case"ExcelExport":t={target:go.content,iconCss:go.excel};break;case"CsvExport":t={target:go.content,iconCss:go.csv};break;case"SortAscending":t={target:go.header,iconCss:go.ascending};break;case"SortDescending":t={target:go.header,iconCss:go.descending};break;case"FirstPage":t={target:go.pager,iconCss:go.fPage};break;case"PrevPage":t={target:go.pager,iconCss:go.pPage};break;case"LastPage":t={target:go.pager,iconCss:go.lPage};break;case"NextPage":t={target:go.pager,iconCss:go.nPage}}return this.defaultItems[e]={text:this.getLocaleText(e),id:this.generateID(e),target:t.target,iconCss:t.iconCss?"e-icons "+t.iconCss:""},this.defaultItems[e]},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","Group","Ungroup","Edit","Delete","Save","Cancel","Copy","export","PdfExport","ExcelExport","CsvExport","SortAscending","SortDescending","FirstPage","PrevPage","LastPage","NextPage"]},e.prototype.setLocaleKey=function(){var e={AutoFitAll:"autoFitAll",AutoFit:"autoFit",Copy:"Copy",Group:"Group",Ungroup:"Ungroup",Edit:"EditRecord",Delete:"DeleteRecord",Save:"Save",Cancel:"CancelButton",PdfExport:"Pdfexport",ExcelExport:"Excelexport",CsvExport:"Csvexport",export:"Export",SortAscending:"SortAscending",SortDescending:"SortDescending",FirstPage:"FirstPage",LastPage:"LastPage",PrevPage:"PreviousPage",NextPage:"NextPage"};if(t.isBlazor()){e.AutoFitAll="AutoFitAll";e.AutoFit="AutoFit"}return e},e.prototype.getColumn=function(e){var i=t.closest(e.target,"th.e-headercell");if(i){var r=i.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("e-mappinguid");return this.parent.getColumnByUid(r)}return this.parent.getRowInfo(e.target).column||null},e.prototype.selectRow=function(e,i){this.cell=e.target,this.row=t.closest(e.target,"tr.e-row")||this.row,this.row&&i&&!O(e.target,"e-gridpager")&&this.parent.selectRow(parseInt(this.row.getAttribute("aria-rowindex"),10))},e}(),mo=function(){function e(e){this.parent=e,this.rowModelGenerator=new Ci(this.parent)}return e.prototype.generateRows=function(e,i,r){var n,o=this.parent.getFrozenColumns();if(n=i.renderFrozenRightContent||i.renderMovableContent&&!this.parent.enableVirtualization?"frozen-right":i.renderMovableContent||i.isFrozen?"movable":this.parent.getFrozenLeftCount()?"frozen-left":"frozen-right",o=o&&this.parent.isRowDragable()?o+1:o,"virtualscroll"===i.requestType&&"X"===i.virtualInfo.sentinelInfo.axis&&"movable"!==n)return null;var s=this.parent.enableVirtualization&&!i.isFrozenRowsRender?r:this.rowModelGenerator.generateRows(e,i);if(t.isBlazor()&&!this.parent.isJsComponent)return s;for(var l=0,a=s.length;l<a;l++)s[l].cells=ke(this.parent,s[l].cells,n);return s},e}(),yo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vo=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.isInitialRender=!0,r.widthService=i.getService("widthService"),r.addEventListener(),r}return yo(i,e),i.prototype.addEventListener=function(){this.parent.addEventListener(vt,this.actionComplete.bind(this)),this.parent.addEventListener("batchAdd",this.batchAdd.bind(this)),this.parent.on("batchCancel",this.batchAdd.bind(this)),this.parent.addEventListener("batchDelete",this.batchAdd.bind(this)),this.parent.on("set-height-to-frozen-element",this.refreshScrollOffset),this.parent.on(jt,this.widthService.refreshFrozenScrollbar,this)},i.prototype.batchAdd=function(e){var t="batchCancel"!==e.name&&!(this.parent.frozenRows&&"Top"===this.parent.editSettings.newRowPosition);if("auto"!==this.parent.height&&(t||"batchCancel"===e.name||"batchDelete"===e.name)){this.refreshScrollOffset();var i=this.getTable().offsetHeight;"add"===e.name&&"Bottom"===this.parent.editSettings.newRowPosition&&this.parent.getContent().firstChild.scroll(0,i)}},i.prototype.setHeightToContent=function(e){this.getFrozenContent().style.height=e.toString()+"px",this.getMovableContent().style.height=e.toString()+"px"},i.prototype.actionComplete=function(e){if("Dialog"!==this.parent.editSettings.mode&&("add"===e.requestType||"cancel"===e.requestType&&e.row.classList.contains("e-addedrow"))&&(!this.parent.frozenRows||"Bottom"===this.parent.editSettings.newRowPosition)&&"auto"!==this.parent.height){this.refreshScrollOffset();var t=this.getTable().offsetHeight;"add"===e.requestType&&"Bottom"===this.parent.editSettings.newRowPosition&&this.parent.getContent().firstChild.scroll(0,t)}},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.removeEventListener(vt,this.actionComplete),this.parent.removeEventListener("batchAdd",this.batchAdd),this.parent.off(jt,this.widthService.refreshFrozenScrollbar))},i.prototype.renderPanel=function(){e.prototype.renderPanel.call(this);var i=this.parent.element.querySelector(".e-frozencontent"),r=this.parent.element.querySelector(".e-movablecontent");t.isNullOrUndefined(i)&&(i=this.parent.createElement("div",{className:"e-frozencontent e-frozen-left-content"}),r=this.parent.createElement("div",{className:"e-movablecontent"}),this.getPanel().querySelector(".e-content").appendChild(i),this.getPanel().querySelector(".e-content").appendChild(r),r.style.scrollbarWidth="none"),this.setFrozenContent(i),this.setMovableContent(r),t.Browser.userAgent.indexOf("Mac OS")>-1&&"safari"===t.Browser.info.name&&!this.parent.enableVirtualization&&this.getPanel().firstElementChild.classList.add("e-mac-safari")},i.prototype.renderFrozenRigthPanel=function(){e.prototype.renderPanel.call(this)},i.prototype.renderEmpty=function(i){t.isBlazor()&&!this.parent.isJsComponent||(e.prototype.renderEmpty.call(this,i),this.getMovableContent().querySelector("tbody").innerHTML="<tr><td></td></tr>",t.addClass([this.getMovableContent().querySelector("tbody").querySelector("tr")],["e-emptyrow"]),this.getFrozenContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenColumns(),this.getFrozenContent().style.borderRightWidth="0px",this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody").innerHTML="",this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody").innerHTML=""))},i.prototype.renderFrozenRightEmpty=function(t){e.prototype.renderEmpty.call(this,t)},i.prototype.setFrozenContent=function(e){this.frozenContent=e},i.prototype.setMovableContent=function(e){this.movableContent=e},i.prototype.getFrozenContent=function(){return this.frozenContent},i.prototype.getMovableContent=function(){return this.movableContent},i.prototype.getModelGenerator=function(){return new mo(this.parent)},i.prototype.renderFrozenRightTable=function(){e.prototype.renderTable.call(this)},i.prototype.renderTable=function(){var i;null==this.getFrozenContent().querySelector(".e-table")?(e.prototype.renderTable.call(this),this.getFrozenContent().appendChild(this.getTable()),i=this.getTable().cloneNode(!0),this.getMovableContent().appendChild(i)):(this.setTable(this.getFrozenContent().querySelector(".e-table")),this.setColGroup(this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0)),this.getFrozenContent().querySelector(".e-table").appendChild(this.getColGroup()),i=this.getMovableContent().querySelector(".e-table"),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdrcont")),this.getMovableContent().querySelector("colgroup")&&t.remove(this.getMovableContent().querySelector("colgroup"));var r=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").cloneNode(!0);i.insertBefore(r,i.querySelector("tbody"));var n=this.parent.enableVirtualization?"":"flex";this.getPanel().firstChild.style.display=n,this.renderHorizontalScrollbar("e-frozenscrollbar e-frozen-left-scrollbar",this.getScrollbarDisplay())},i.prototype.getScrollbarDisplay=function(){var e="";return(this.parent.getFrozenColumns()&&!this.parent.getVisibleFrozenColumns()||this.parent.getFrozenLeftColumnsCount()&&!this.parent.getVisibleFrozenLeftCount())&&(e="none"),e},i.prototype.renderHorizontalScrollbar=function(e,t,i){var r=this.parent.createElement("div",{className:e,styles:"display:"+t}),n=this.parent.createElement("div",{className:"e-movablescrollbar"}),o=this.parent.createElement("div",{className:"e-movablechild"}),s=j().toString();this.setScrollbarHeight(n,s),this.setScrollbarHeight(o,s),n.appendChild(o),this.appendScrollbar(r,n,i)},i.prototype.appendScrollbar=function(e,t,i){var r=this.parent.createElement("div",{className:"e-scrollbar",styles:"display: flex"});r.appendChild(e),r.appendChild(t),this.parent.getContent().appendChild(r)},i.prototype.setScrollbarHeight=function(e,t){e.style.minHeight=t+"px",e.style.maxHeight=t+"px"},i.prototype.setIsFrozen=function(e,t){e.isFrozen=!e.isFrozen},i.prototype.setTbody=function(e,i){var r;t.isNullOrUndefined(e[0].cells[0])&&(this.getMovableContent().querySelector("tbody").innerHTML="");var n=e[0].cells[0],o=n.index;return t.isUndefined(o)&&this.parent.isRowDragable()&&(o=(n=e[0].cells[1]).index),0===o&&(this.getPanel().firstChild.style.overflowX="hidden",this.parent.enableColumnVirtualization&&(this.getMovableContent().style.overflowX="hidden")),this.parent.enableColumnVirtualization&&i.renderMovableContent&&"virtualscroll"===i.requestType&&this.getMovableContent().scrollLeft>0&&0!==i.virtualInfo.columnIndexes[0]&&(o=this.parent.getFrozenColumns()),n&&n.column&&(r=n.column.getFreezeTableName()),this.setIdx(o),r},i.prototype.splitRows=function(e){"frozen-left"===e?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):this.movableRows=this.rows},i.prototype.renderNextFrozentPart=function(e,i){var r=this.parent.enableVirtualization;"frozen-left"===i&&(r&&(e.renderMovableContent=!0),this.refreshContentRows(t.extend({},e)))},i.prototype.appendContent=function(e,i,r,n){this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?e=i:e.appendChild(i),"frozen-left"===n?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e)):(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset(),this.widthService.refreshFrozenScrollbar()),this.isInitialRender&&(this.parent.scrollModule.setHeight(),this.isInitialRender=!1)},i.prototype.refreshScrollOffset=function(){if("auto"!==this.parent.height){var e=this.getTable().offsetHeight+1;this.setHeightToContent(e)}this.parent.notify("refresh-frozen-height",{})},i.prototype.getFrozenHeader=function(e){return"frozen-left"===e?this.parent.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody"):this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody")},i.prototype.refreshTbody=function(e){e.childElementCount<1&&e.appendChild(this.parent.createElement("tr").appendChild(this.parent.createElement("td")))},i.prototype.refreshHeight=function(){this.parent.allowTextWrap||this.parent.notify(ii,{case:"refreshHeight"}),this.getFrozenContent().style.borderRightWidth="1px"},i.prototype.setIdx=function(e){this.idx=e},i.prototype.getIdx=function(){return this.idx},i.prototype.getTbody=function(e){return"frozen-left"===e?this.getTable().querySelector("tbody"):this.getMovableContent().querySelector("tbody")},i}(zi),Co=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.addEventListener(),r}return yo(i,e),i.prototype.addEventListener=function(){this.parent.on(ii,this.refreshFreeze,this),this.parent.on("frozenHeight",this.setFrozenHeight,this),this.parent.on(Dt,this.enableAfterRender,this)},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("frozenHeight",this.setFrozenHeight),this.parent.off(Dt,this.enableAfterRender))},i.prototype.renderTable=function(){t.isBlazor()?(this.setTable(this.createTable(this.getFrozenHeader().querySelector(".e-table"))),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!0}}),this.createTable(this.getMovableHeader().querySelector(".e-table"))):e.prototype.renderTable.call(this),this.rfshMovable(),this.updateColgroup(),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.renderPanel=function(){var i=this.parent.element.querySelector(".e-frozenheader"),r=this.parent.element.querySelector(".e-movableheader");e.prototype.renderPanel.call(this),t.isNullOrUndefined(i)&&(i=this.parent.createElement("div",{className:"e-frozenheader e-frozen-left-header"}),r=this.parent.createElement("div",{className:"e-movableheader"}),this.getPanel().querySelector(".e-headercontent").appendChild(i),this.getPanel().querySelector(".e-headercontent").appendChild(r)),this.setFrozenHeader(i),this.setMovableHeader(r)},i.prototype.renderFrozenRightPanel=function(){e.prototype.renderPanel.call(this)},i.prototype.renderFrozenRightTable=function(){e.prototype.renderTable.call(this)},i.prototype.refreshUI=function(){if(t.isBlazor()&&this.parent.isServerRendered&&0!==this.parent.frozenRows)this.parent.getFrozenColumns()&&this.freezeReorder&&(e.prototype.refreshUI.call(this),this.freezeReorder=!1,e.prototype.refreshUI.call(this)),this.rfshMovable();else{var i=this.getMovableHeader().querySelector("tbody");t.remove(this.getMovableHeader().querySelector("table")),e.prototype.refreshUI.call(this),this.rfshMovable(),this.getMovableHeader().querySelector("tbody").innerHTML=i.innerHTML}t.isBlazor()&&0!==this.parent.frozenRows||this.updateColgroup(),this.parent.enableVirtualization||this.widthService.setWidthToTable(),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&X([].slice.call(this.movableHeader.querySelectorAll("tr.e-columnheader")),!0),this.parent.updateDefaultCursor(),t.isBlazor()&&0!==this.parent.frozenRows||de(this.parent.getContentTable().querySelector("colgroup"),this.parent.getFrozenColumns(),this.parent),this.widthService.refreshFrozenScrollbar(),this.initializeHeaderDrag(),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.refreshFrozenLeftUI=function(){e.prototype.refreshUI.call(this)},i.prototype.rfshMovable=function(){t.isBlazor()&&0!==this.parent.frozenRows||(this.getFrozenHeader().appendChild(this.getTable()),this.getMovableHeader().appendChild(this.createHeader(void 0,"movable"))),this.refreshStackedHdrHgt(),this.addMovableFirstCls()},i.prototype.addMovableFirstCls=function(){if(this.parent.getVisibleFrozenColumns())for(var e=this.parent.element.querySelector(".e-movableheader").querySelector("thead").querySelectorAll(".e-columnheader"),i=e.length,r=0;r<i;r++){var n=e[r].cells[0];n&&(t.addClass([n],["e-movablefirst"]),e[r].cells[0].rowSpan>1&&(r+=e[r].cells[0].rowSpan-1))}},i.prototype.refreshFreeze=function(e){if("filter"===e.case){var t=this.getTable().querySelector(".e-filterbar");if(this.parent.allowFiltering&&t&&this.getMovableHeader().querySelector("thead")){this.getMovableHeader().querySelector("thead").appendChild(this.filterRenderer(t,this.parent.getFrozenColumns()));for(var i=0,r=[].slice.call(this.getMovableHeader().querySelectorAll("thead .e-filterbarcell .e-input"));i<r.length;i++){var n={element:r[i],floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0}};o.Input.bindInitialEvent(n)}}}else"textwrap"!==e.case&&"refreshHeight"!==e.case||(this.refreshHeight(e),this.parent.contentModule.refreshScrollOffset())},i.prototype.refreshHeight=function(e){var t,i,r=this.getFrozenHeader(),n=this.getMovableHeader(),o=this.parent.getContent(),s=this.parent.textWrapSettings.wrapMode,l=this.parent.getHeaderContent().querySelector(".e-headercontent").classList;"textwrap"===e.case?(("Header"!==s||e.isModeChg)&&(t=o.querySelector(".e-frozencontent").querySelectorAll("tr"),i=o.querySelector(".e-movablecontent").querySelectorAll("tr"),this.setWrapHeight(t,i,e.isModeChg,!0)),"Content"===s&&this.parent.allowTextWrap?l.add("e-wrap"):l.remove("e-wrap"),"Both"===s||e.isModeChg?(t=r.querySelectorAll("tr"),i=n.querySelectorAll("tr")):(i=n.querySelector("Content"===s?"tbody":"thead").querySelectorAll("tr"),t=r.querySelector("Content"===s?"tbody":"thead").querySelectorAll("tr")),this.parent.getHeaderContent().querySelectorAll(".e-stackedheadercell").length||this.setWrapHeight(t,i,e.isModeChg,!1,this.colDepth>1),this.refreshStackedHdrHgt()):"refreshHeight"===e.case&&(this.setWrapHeight(o.querySelector(".e-frozencontent").querySelectorAll("tr"),o.querySelector(".e-movablecontent").querySelectorAll("tr"),e.isModeChg),this.parent.getHeaderContent().querySelectorAll(".e-stackedheadercell").length||this.setWrapHeight(r.querySelectorAll("tr"),n.querySelectorAll("tr"),e.isModeChg))},i.prototype.enableAfterRender=function(e){"scroll"===e.module&&this.setFrozenHeight()},i.prototype.updateResizeHandler=function(){for(var e=[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-rhandler")),t=0;t<e.length;t++)e[t].style.height=e[t].parentElement.offsetHeight+"px"},i.prototype.setWrapHeight=function(e,i,r,n,o){for(var s,l,a=this.parent.allowTextWrap,h=this.parent.textWrapSettings.wrapMode,d=this.parent.getHeaderContent().querySelector("thead"),p=this.parent.getHeaderContent().querySelector("tbody"),c=[],u=[],g=0,f=e.length;g<f;g++)t.isNullOrUndefined(e[g])||t.isNullOrUndefined(i[g])||(c[g]=e[g].getBoundingClientRect().height,u[g]=i[g].getBoundingClientRect().height);for(var g=0,f=e.length;g<f;g++)(r&&("Header"===h&&n||"Content"===h&&d.contains(e[g])||"Header"===h&&p.contains(e[g]))||o)&&(e[g].style.height=null,i[g].style.height=null),s=c[g],l=u[g],!t.isNullOrUndefined(e[g])&&e[g].childElementCount&&(a&&s<l||!a&&s<l||this.parent.allowResizing&&this.parent.resizeModule&&!1===this.parent.resizeModule.isFrozenColResized)&&(e[g].style.height=l+"px"),i&&!t.isNullOrUndefined(i[g])&&i[g].childElementCount&&(a&&s>l||!a&&s>l||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(i[g].style.height=s+"px");a&&"auto"!==this.parent.height&&this.setFrozenHeight()},i.prototype.setFrozenHeight=function(e){void 0===e&&(e=j());var t=this.parent.element.querySelector(".e-movablecontent").getBoundingClientRect().height,i=this.parent.element.querySelector(".e-movablecontent"),r=this.parent.element.querySelector(".e-frozencontent"),n=this.parent.getContent().scrollWidth,o=this.parent.element.querySelector(".e-movablecontent table").scrollWidth+this.parent.getContentTable().scrollWidth;i.scrollWidth-i.clientWidth?(r.style.height=t-e+"px",r.style.borderBottom=""):(r.style.height=t+"px",(r.scrollHeight<=r.clientHeight||i.scrollHeight<=i.clientHeight)&&n===o&&this.parent.scrollModule.removePadding(),r.style.borderBottom="0px")},i.prototype.refreshStackedHdrHgt=function(){for(var e,t,i=this.getFrozenHeader().querySelectorAll(".e-columnheader"),r=this.getMovableHeader().querySelectorAll(".e-columnheader"),n=0,o=i.length;n<o;n++)e=this.getRowSpan(i[n]),t=this.getRowSpan(r[n]),e.min>1?this.updateStackedHdrRowHgt(n,e.max,i[n],r):t.min>1&&this.updateStackedHdrRowHgt(n,t.max,r[n],i);this.parent.allowResizing&&this.updateResizeHandler()},i.prototype.getRowSpan=function(e){for(var t,i,r,n=0,o=e.childElementCount;n<o;n++)0===n&&(i=e.children[0].rowSpan),t=e.children[n].rowSpan,i=Math.min(t,i),r=Math.max(t,i);return{min:i,max:r}},i.prototype.updateStackedHdrRowHgt=function(e,t,i,r){for(var n=0,o=0;o<t;o++)n+=r[e+o].style.height?parseInt(r[e+o].style.height,10):r[e+o].offsetHeight;i.style.height=n+"px"},i.prototype.setFrozenHeader=function(e){this.frozenHeader=e},i.prototype.setMovableHeader=function(e){this.movableHeader=e},i.prototype.getFrozenHeader=function(){return this.frozenHeader},i.prototype.getMovableHeader=function(){return this.movableHeader},i.prototype.updateColgroup=function(){var e=this.getMovableHeader().querySelector("table");t.remove(this.getMovableHeader().querySelector("colgroup")),e.insertBefore(de(this.getFrozenHeader().querySelector("colgroup"),this.parent.getFrozenColumns(),this.parent),e.querySelector("thead"))},i.prototype.filterRenderer=function(e,t,i){var r=e.cloneNode(!0);r.innerHTML="";for(var n=i||this.parent.getColumns().length,o=t;o<n;o++)r.appendChild(e.removeChild(e.children[t]));return r},i}(Ii),wo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bo=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.addEventListener(),r}return wo(i,e),i.prototype.addEventListener=function(){this.parent.on(ii,this.refreshFreeze,this),this.parent.on("refresh-frozen-columns",this.refreshFrozenColumns,this),this.parent.on("set-reorder-destination-element",this.setReorderElement,this),this.parent.on(jt,this.setVisible,this)},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ii,this.refreshFreeze),this.parent.off("refresh-frozen-columns",this.refreshFrozenColumns),this.parent.off("set-reorder-destination-element",this.setReorderElement),this.parent.off(jt,this.setVisible))},i.prototype.setReorderElement=function(e){this.destEle=e.ele},i.prototype.refreshFrozenColumns=function(e){e.parent||this.parent.setProperties({columns:e.columns},!0);var t=O(this.destEle,"e-frozen-left-header"),i=O(this.destEle,"e-frozen-right-header"),r=this.parent.getFrozenLeftColumnsCount(),n=this.parent.getFrozenRightColumnsCount();e.column.freeze=null,t?e.column.freeze="Left":i&&(e.column.freeze="Right"),this.parent.setFrozenCount(),e.cancel=r!==this.parent.getFrozenLeftColumnsCount()||n!==this.parent.getFrozenRightColumnsCount(),e.cancel&&this.parent.refreshColumns()},i.prototype.setWrapHeight=function(e,i,r,n,o,s){for(var l,a,h,d=this.parent.allowTextWrap,p=this.parent.getHeaderContent().querySelector("tbody"),c=this.parent.textWrapSettings.wrapMode,u=this.parent.getHeaderContent().querySelector("thead"),g=[],f=[],m=[],y=0,v=e.length;y<v;y++)t.isNullOrUndefined(e[y])||t.isNullOrUndefined(i[y])||(s&&(m[y]=s[y].getBoundingClientRect().height),f[y]=i[y].getBoundingClientRect().height,g[y]=e[y].getBoundingClientRect().height);for(var y=0,v=e.length;y<v;y++){(r&&("Content"===c&&u.contains(e[y])||"Header"===c&&p.contains(e[y])||"Header"===c&&n)||o)&&(s[y]&&(s[y].style.height=null),e[y].style.height=null,i[y].style.height=null),l=g[y],a=f[y],h=m[y]?m[y]:0;var C=Math.max(l,a,h);!t.isNullOrUndefined(e[y])&&e[y].childElementCount&&(d&&l<C||!d&&l<C||this.parent.allowResizing&&this.parent.resizeModule&&!1===this.parent.resizeModule.isFrozenColResized)&&(e[y].style.height=C+"px"),i&&!t.isNullOrUndefined(i[y])&&i[y].childElementCount&&(d&&C>a||!d&&C>a||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(i[y].style.height=C+"px"),s&&!t.isNullOrUndefined(s[y])&&s[y].childElementCount&&(d&&C>h||!d&&C>h||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(s[y].style.height=C+"px")}d&&this.setFrozenHeight()},i.prototype.refreshHeight=function(e){var t,i,r,n="Left-Right"===this.parent.getFrozenMode(),o=this.getFrozenRightHeader(),s=this.parent.getHeaderContent().querySelector(".e-frozenheader"),l=this.parent.getContent(),a=this.getMovableHeader(),h=this.parent.getHeaderContent().querySelector(".e-headercontent").classList,d=this.parent.textWrapSettings.wrapMode;"textwrap"===e.case?(("Header"!==d||e.isModeChg)&&(n&&(i=l.querySelector(".e-frozen-right-content").querySelectorAll("tr")),r=l.querySelector(".e-movablecontent").querySelectorAll("tr"),t=l.querySelector(".e-frozencontent").querySelectorAll("tr"),this.setWrapHeight(t,r,e.isModeChg,!0,!1,i)),"Content"===d&&this.parent.allowTextWrap?h.add("e-wrap"):h.remove("e-wrap"),"Both"===d||e.isModeChg?(n&&(i=o.querySelectorAll("tr")),t=s.querySelectorAll("tr"),r=a.querySelectorAll("tr")):(n&&(i=o.querySelector("Content"===d?"tbody":"thead").querySelectorAll("tr")),t=s.querySelector("Content"===d?"tbody":"thead").querySelectorAll("tr"),r=a.querySelector("Content"===d?"tbody":"thead").querySelectorAll("tr")),this.parent.getHeaderContent().querySelectorAll(".e-stackedheadercell").length||this.setWrapHeight(t,r,e.isModeChg,!1,this.colDepth>1,i),this.refreshStackedHdrHgt()):"refreshHeight"===e.case&&(r=l.querySelector(".e-movablecontent").querySelectorAll("tr"),t=l.querySelector(".e-frozencontent").querySelectorAll("tr"),n&&(i=l.querySelector(".e-frozen-right-content").querySelectorAll("tr")),this.setWrapHeight(t,r,e.isModeChg,!1,!1,i),this.parent.getHeaderContent().querySelectorAll(".e-stackedheadercell").length||(n&&(i=o.querySelectorAll("tr")),t=s.querySelectorAll("tr"),r=a.querySelectorAll("tr"),this.setWrapHeight(t,r,e.isModeChg,!1,!1,i)))},i.prototype.setVisible=function(e){for(var i,r,n=this.parent,o=this.parent.getFrozenLeftColumnsCount(),s=this.parent.getFrozenRightColumnsCount(),l=this.parent.getMovableColumnsCount(),a=0,h=e.length;a<h;a++){var d=e[a];if(r=n.getNormalizedColumnIndex(d.uid),i=d.visible?"":"none","Left"===d.freeze||"Right"===d.freeze){if(o&&!s){var p=n.getHeaderContent().querySelector(".e-frozen-left-header").querySelector("colgroup");t.setStyleAttribute(p.children[r],{display:i})}else if(!o&&s){var c=n.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("colgroup");t.setStyleAttribute(c.children[r-l],{display:i})}}else{var u=n.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup");t.setStyleAttribute(u.children[r-o],{display:i})}}this.refreshUI()},i.prototype.filterRenderer=function(t,i,r){return e.prototype.filterRenderer.call(this,t,i,r)},i.prototype.refreshUI=function(){var i,r=this.getMovableHeader().querySelector("tbody");t.remove(this.getMovableHeader().querySelector("table")),"Left-Right"===this.parent.getFrozenMode()&&(i=this.getFrozenRightHeader().querySelector("tbody"),t.remove(this.getFrozenRightHeader().querySelector("table"))),e.prototype.refreshFrozenLeftUI.call(this),this.rfshMovable(),this.getMovableHeader().querySelector("tbody").innerHTML=r.innerHTML,i&&(this.getFrozenRightHeader().querySelector("tbody").innerHTML=i.innerHTML),this.updateColgroup(),this.widthService.setWidthToColumns(),this.parent.notify(kt,{}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&X([].slice.call(this.getMovableHeader().querySelectorAll("tr.e-columnheader")),!0),this.parent.updateDefaultCursor();var n=this.parent.getContent().querySelector(".e-movablecontent").querySelector(".e-table");t.remove(n.querySelector("colgroup"));var o=this.getMovableHeader().querySelector("colgroup").cloneNode(!0);if(n.insertBefore(o,n.querySelector("tbody")),i){var s=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector(".e-table");t.remove(s.querySelector("colgroup"));var l=this.getFrozenRightHeader().querySelector("colgroup").cloneNode(!0);s.insertBefore(l,s.querySelector("tbody"))}this.widthService.refreshFrozenScrollbar(),this.initializeHeaderDrag(),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.refreshFreeze=function(e){var t=this.parent.getFrozenLeftColumnsCount(),i=this.parent.getFrozenRightColumnsCount(),r=this.parent.getMovableColumnsCount();if("filter"===e.case){var n=this.getTable().querySelector(".e-filterbar");if(this.parent.allowFiltering&&n&&this.getMovableHeader().querySelector("thead")){var o=this.parent.isRowDragable(),s=t?o?t+1:t:0,l=t+r+(t&&o?1:0);if(this.getMovableHeader().querySelector("thead").appendChild(this.filterRenderer(n,s,l)),"Left-Right"===this.parent.getFrozenMode()){var a=[].slice.call(this.getMovableHeader().querySelectorAll("thead .e-filterbarcell .e-input"));this.getFrozenRightHeader().querySelector("thead").appendChild(this.filterRenderer(n,s,s+i)),this.adjudtFilterBarCell(a)}var h=[].slice.call(this.getMovableHeader().querySelectorAll("thead .e-filterbarcell .e-input"));this.adjudtFilterBarCell(h)}}else"textwrap"!==e.case&&"refreshHeight"!==e.case||(this.refreshHeight(e),this.parent.contentModule.refreshScrollOffset())},i.prototype.updateFrozenColGroup=function(e,i){e&&!1===e.visible&&t.setStyleAttribute(i,{display:"none"})},i.prototype.adjudtFilterBarCell=function(e){for(var t=0,i=e;t<i.length;t++){var r={element:i[t],floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0}};o.Input.bindInitialEvent(r)}},i.prototype.renderPanel=function(){this.parent.getFrozenLeftColumnsCount()?(e.prototype.renderPanel.call(this),this.parent.getFrozenRightColumnsCount()&&this.renderLeftWithRightFrozenPanel()):this.renderRightFrozenPanelAlone(),this.getPanel().firstChild.style.display="flex",this.getMovableHeader().style.flex="1"},i.prototype.renderTable=function(){this.parent.getFrozenLeftColumnsCount()?e.prototype.renderTable.call(this):this.renderFrozenRightTableAlone()},i.prototype.rfshMovable=function(){if(this.parent.getFrozenLeftColumnsCount()){if(e.prototype.rfshMovable.call(this),this.parent.getFrozenRightColumnsCount()){var t=this.rows;this.getFrozenRightHeader().appendChild(this.createHeader(void 0,"frozen-right")),this.refreshStackedHdrHgt(),this.parent.notify(Lt,{rows:this.rows,args:{renderFrozenRightContent:!0}}),this.rows=t}}else this.getFrozenRightHeader().appendChild(this.getTable()),this.getMovableHeader().appendChild(this.createHeader(void 0,"movable")),this.refreshStackedHdrHgt(),this.addMovableFirstCls()},i.prototype.refreshStackedHdrHgt=function(){this.parent.getFrozenLeftColumnsCount()?(e.prototype.refreshStackedHdrHgt.call(this),this.parent.getFrozenRightColumnsCount()&&this.refreshFrozenRightStackedHdrHgt()):this.refreshFrozenRightStackedHdrHgt()},i.prototype.refreshFrozenRightStackedHdrHgt=function(){for(var e,t=this.getFrozenRightHeader().querySelectorAll(".e-columnheader"),i=this.getMovableHeader().querySelectorAll(".e-columnheader"),r=0,n=t.length;r<n;r++)e=this.getRowSpan(t[r]),this.getRowSpan(i[r]),e.min>1&&this.updateStackedHdrRowHgt(r,e.max,t[r],i)},i.prototype.updateColgroup=function(){this.updateMovableColGroup(),this.parent.getFrozenLeftColumnsCount()&&this.updateFrozenLeftColGroup(),this.parent.getFrozenRightColumnsCount()&&this.updateFrozenRightColGroup()},i.prototype.renderRightFrozenPanelAlone=function(){var i=this.parent.element.querySelector(".e-movableheader"),r=this.parent.element.querySelector(".e-frozen-right-header");e.prototype.renderFrozenRightPanel.call(this),t.isNullOrUndefined(r)&&(i=this.parent.createElement("div",{className:"e-movableheader"}),r=this.parent.createElement("div",{className:"e-frozenheader e-frozen-right-header"}),this.getPanel().querySelector(".e-headercontent").appendChild(i),this.getPanel().querySelector(".e-headercontent").appendChild(r)),e.prototype.setMovableHeader.call(this,i),this.setFrozenRightHeader(r)},i.prototype.renderLeftWithRightFrozenPanel=function(){var i=this.parent.element.querySelector(".e-frozen-right-header");e.prototype.renderFrozenRightPanel.call(this),t.isNullOrUndefined(i)&&(i=this.parent.createElement("div",{className:"e-frozenheader e-frozen-right-header"}),this.getPanel().querySelector(".e-headercontent").appendChild(i)),this.setFrozenRightHeader(i)},i.prototype.renderFrozenRightTableAlone=function(){e.prototype.renderFrozenRightTable.call(this),this.rfshMovable(),this.updateColgroup(),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.updateFrozenLeftColGroup=function(){for(var e=this.getFrozenHeader().querySelector("colgroup").children,i=this.parent.isRowDragable()?1:0,r=this.parent.isRowDragable()?this.parent.getFrozenLeftColumnsCount()+1:this.parent.getFrozenLeftColumnsCount(),n=i;n<e.length;n++)n>=r&&(t.remove(e[n]),n--)},i.prototype.updateMovableColGroup=function(){var e=this.getMovableHeader().querySelector("colgroup").children;this.parent.isRowDragable()&&t.remove(e[0]);for(var i=e.length,r=this.parent.getFrozenLeftColumnsCount(),n=this.parent.getMovableColumnsCount(),o=0,s=0;s<i;s++,o++)(s<r||s>=r+n)&&(t.remove(e[o]),o--)},i.prototype.updateFrozenRightColGroup=function(){var e=this.parent.isRowDragable(),i=this.parent.getFrozenRightColumns(),r=this.getFrozenRightHeader().querySelector("colgroup").children;"Left-Right"===this.parent.getFrozenMode()&&e&&t.remove(r[0]);for(var n=r.length,o=this.parent.getFrozenLeftColumnsCount(),s=this.parent.getMovableColumnsCount(),l=0,a=0;a<n;a++)a<o+s?t.remove(r[0]):(this.updateFrozenColGroup(i[l],r[l]),l++)},i.prototype.setFrozenRightHeader=function(e){this.frozenRightHeader=e},i.prototype.getFrozenRightHeader=function(){return this.frozenRightHeader},i}(Co),So=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.frzCount=0,r.isColGroupRefresh=!1,r.widthService=i.getService("widthService"),r}return wo(i,e),i.prototype.renderPanel=function(){this.parent.getFrozenLeftColumnsCount()?(e.prototype.renderPanel.call(this),this.parent.getFrozenRightColumnsCount()&&this.renderFrozenLeftWithRightPanel()):this.renderFrozenRightPanelAlone();var t=this.parent.enableVirtualization?"":"flex";this.getPanel().firstChild.style.display=t},i.prototype.renderTable=function(){if(this.parent.getFrozenLeftColumnsCount()){if(e.prototype.renderTable.call(this),this.parent.getFrozenRightColumnsCount()){this.renderFrozenLeftWithRightTable();t=this.parent.getVisibleFrozenRightCount()?"":"none";this.renderHorizontalScrollbar("e-frozenscrollbar e-frozen-right-scrollbar",t,!0)}}else{this.renderFrozenRightTableAlone();var t=this.parent.getVisibleFrozenRightCount()?"":"none";this.renderHorizontalScrollbar("e-frozenscrollbar e-frozen-right-scrollbar",t)}this.getMovableContent().style.flex="1"},i.prototype.appendScrollbar=function(e,t,i){var r=this.parent.createElement("div",{className:"e-scrollbar",styles:"display: flex"});if(this.parent.getFrozenLeftColumnsCount()){if(i)return void this.parent.getContent().querySelector(".e-scrollbar").appendChild(e);r.appendChild(e),r.appendChild(t)}else r.appendChild(t),r.appendChild(e);this.parent.getContent().appendChild(r)},i.prototype.renderFrozenRightPanelAlone=function(){this.renderFrozenRigthPanel();var i=this.parent.element.querySelector(".e-movablecontent"),r=this.parent.element.querySelector(".e-frozen-right-content");t.isNullOrUndefined(r)&&(i=this.parent.createElement("div",{className:"e-movablecontent"}),r=this.parent.createElement("div",{className:"e-frozencontent e-frozen-right-content"}),this.getPanel().querySelector(".e-content").appendChild(i),this.getPanel().querySelector(".e-content").appendChild(r)),e.prototype.setMovableContent.call(this,i),this.setFrozenRightContent(r)},i.prototype.renderFrozenLeftWithRightPanel=function(){this.renderFrozenRigthPanel();var e=this.parent.element.querySelector(".e-frozen-right-content");t.isNullOrUndefined(e)&&(e=this.parent.createElement("div",{className:"e-frozencontent e-frozen-right-content"}),this.getPanel().querySelector(".e-content").appendChild(e)),this.setFrozenRightContent(e)},i.prototype.renderFrozenRightTableAlone=function(){var i;null==this.getFrozenRightContent().querySelector(".e-table")?(e.prototype.renderFrozenRightTable.call(this),this.getFrozenRightContent().appendChild(this.getTable()),i=this.getTable().cloneNode(!0),this.getMovableContent().appendChild(i)):(this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdrcont"),this.setTable(this.getFrozenRightContent().querySelector(".e-table")),this.setColGroup(this.getFrozenRightHeaderColGroup()),i=this.getMovableContent().querySelector(".e-table"),this.getFrozenRightContent().querySelector(".e-table").appendChild(this.getColGroup())),this.getMovableContent().querySelector("colgroup")&&t.remove(this.getMovableContent().querySelector("colgroup"));var r=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").cloneNode(!0);i.insertBefore(r,i.querySelector("tbody"))},i.prototype.renderFrozenLeftWithRightTable=function(){var e=this.getTable().cloneNode(!0);this.getFrozenRightContent().appendChild(e);var i=this.getFrozenRightContent().querySelector("colgroup");i&&t.remove(i);var r=this.getFrozenRightContent().querySelector(".e-table");r.insertBefore(this.getFrozenRightHeaderColGroup(),r.querySelector("tbody"))},i.prototype.renderFrozenRightEmptyRowAlone=function(i){e.prototype.renderFrozenRightEmpty.call(this,i),this.getMovableContent().querySelector("tbody").innerHTML="<tr><td></td></tr>",t.addClass([this.parent.getMovableContentTbody().querySelector("tr")],["e-emptyrow"]),this.getFrozenRightContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenRightCount(),this.parent.frozenRows&&(this.parent.getFrozenRightHeaderTbody().innerHTML="",this.parent.getMovableHeaderTbody().innerHTML="")},i.prototype.getFrozenHeader=function(e){return"frozen-left"===e?this.parent.getHeaderContent().querySelector(".e-frozen-left-header").querySelector("tbody"):"movable"===e?this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody"):this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("tbody")},i.prototype.renderFrozenLeftWithRightEmptyRow=function(){this.getFrozenRightContent().querySelector("tbody").innerHTML="<tr><td></td></tr>",t.addClass([this.getFrozenRightContent().querySelector("tbody").querySelector("tr")],["e-emptyrow"]),this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("tbody").innerHTML="")},i.prototype.setFrozenRightContent=function(e){this.frozenRigthContent=e},i.prototype.getFrozenRightContent=function(){return this.frozenRigthContent},i.prototype.getHeaderColGroup=function(){var e=this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0);if(!this.parent.getFrozenLeftColumnsCount()){var t=this.getFrozenRightHeaderColGroup();e=t&&this.frzCount?t.cloneNode(!0):e,this.frzCount++,this.isColGroupRefresh=!0}return e},i.prototype.getFrozenRightHeaderColGroup=function(){var e=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("colgroup");return e||(e=this.parent.getHeaderContent().querySelector("colgroup")),e.cloneNode(!0)},i.prototype.setColGroup=function(i){return this.parent.getFrozenLeftColumnsCount()?e.prototype.setColGroup.call(this,i):(i=this.isColGroupRefresh?i:this.getFrozenRightHeaderColGroup(),t.isNullOrUndefined(i)||(i.id="content-"+i.id),this.isColGroupRefresh=!1,2===this.frzCount&&(this.frzCount=0),this.colgroup=i)},i.prototype.renderEmpty=function(t){this.parent.getFrozenLeftColumnsCount()?(e.prototype.renderEmpty.call(this,t),this.getFrozenContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenLeftCount(),this.parent.getFrozenRightColumnsCount()&&this.renderFrozenLeftWithRightEmptyRow()):this.renderFrozenRightEmptyRowAlone(t),this.parent.notify(ii,{case:"refreshHeight"})},i.prototype.setHeightToContent=function(e){this.parent.getFrozenRightColumnsCount()&&(this.getFrozenRightContent().style.height=e.toString()+"px"),this.parent.getFrozenLeftColumnsCount()&&(this.getFrozenContent().style.height=e.toString()+"px"),this.getMovableContent().style.height=e.toString()+"px"},i.prototype.actionComplete=function(t){e.prototype.actionComplete.call(this,t)},i.prototype.batchAdd=function(t){e.prototype.batchAdd.call(this,t)},i.prototype.getTbody=function(e){var t;return"frozen-left"===e?t=this.parent.getFrozenLeftContentTbody():"movable"===e?t=this.parent.getMovableContentTbody():"frozen-right"===e&&(t=this.parent.getFrozenRightContentTbody()),t},i.prototype.setIsFrozen=function(e,t){e.isFrozen="frozen-left"===t||"Right"===this.parent.getFrozenMode()&&"frozen-right"===t,e.renderFrozenRightContent="Left-Right"===this.parent.getFrozenMode()&&"frozen-right"===t,e.renderMovableContent="movable"===t},i.prototype.appendContent=function(e,i,r,n){!t.isNullOrUndefined(this.parent.rowTemplate)&&this.parent.isReact?e=i:e.appendChild(i),"Left"===this.parent.getFrozenMode()?"frozen-left"===n?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset()):"Right"===this.parent.getFrozenMode()?"movable"===n?(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset()):(this.isLoaded=!1,this.getFrozenRightContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):"Left-Right"===this.parent.getFrozenMode()&&("frozen-left"===n?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):"movable"===n?(this.refreshTbody(e),this.isLoaded=!1,this.getMovableContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):(this.isLoaded=!0,this.getFrozenRightContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset())),this.isInitialRender&&(this.parent.scrollModule.setHeight(),this.isInitialRender=!1),this.widthService.refreshFrozenScrollbar()},i.prototype.refreshHeight=function(){this.parent.allowTextWrap||this.parent.notify(ii,{case:"refreshHeight"})},i.prototype.splitRows=function(e){var t=this.parent.getFrozenLeftColumnsCount(),i=this.parent.getFrozenRightColumnsCount();t&&!i?"frozen-left"===e?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):this.movableRows=this.rows:!t&&i?"movable"===e?this.movableRows=this.rows:(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):t&&i&&("frozen-left"===e?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):"movable"===e?(this.movableRows=this.rows,this.movableRowElements=this.rowElements):(this.frozenRightRows=this.rows,this.frozenRightRowElements=this.rowElements))},i.prototype.getMovableRowElements=function(){return"Left-Right"!==this.parent.getFrozenMode()?this.rowElements:this.movableRowElements},i.prototype.getFrozenRightRowElements=function(){return"Left-Right"!==this.parent.getFrozenMode()?this.freezeRowElements:this.frozenRightRowElements},i.prototype.getFrozenRightRows=function(){return"Left-Right"===this.parent.getFrozenMode()?this.parent.enableInfiniteScrolling?this.rightFreezeRows:this.frozenRightRows:this.getRows()},i.prototype.getFrozenRightRowByIndex=function(e){return this.parent.getFrozenRightDataRows()[e]},i.prototype.getRows=function(){var e=this.getInfiniteRows();return e.length?e:this.freezeRows},i.prototype.getRowElements=function(){return this.freezeRowElements},i}(vo),xo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ro=function(t){function i(e,i){var r=t.call(this,e,i)||this;return r.frzRows=[],r.mvblRows=[],r.frRows=[],r.serviceLoc=i,r.eventListener("on"),r.rowModelGenerator=new Ci(r.parent),r}return xo(i,t),i.prototype.eventListener=function(e){this.parent[e](hi,this.getVirtualData,this),this.parent[e]("set-freeze-selection",this.setFreezeSelection,this),this.parent[e]("refresh-virtual-frozenrows",this.refreshVirtualFrozenRows,this),this.parent.addEventListener(vt,this.actionComplete.bind(this))},i.prototype.actionComplete=function(e){if("delete"===e.requestType&&this.parent.frozenRows)for(var t=0;t<this.parent.frozenRows;t++)pt(this,t)},i.prototype.refreshVirtualFrozenRows=function(e){var t=this,i=this.parent;if("delete"===e.requestType&&i.frozenRows){e.isFrozenRowsRender=!0;var r=i.getSelectedRowIndexes(),n=i.renderModule.data.generateQuery(!0).clone();n.page(1,i.pageSettings.pageSize),i.renderModule.data.getData({},n).then(function(n){Ye(e,n.result,r,i,t.rowModelGenerator,t.serviceLoc,t.virtualRenderer,t)})}},i.prototype.getVirtualData=function(e){this.virtualRenderer.getVirtualData(e)},i.prototype.setFreezeSelection=function(e){et(e,this.virtualRenderer)},i.prototype.renderTable=function(){this.freezeRowGenerator=new mo(this.parent),this.virtualRenderer=new Nn(this.parent,this.serviceLoc),this.virtualRenderer.header=this.serviceLoc.getService("rendererFactory").getRenderer(e.RenderType.Header).virtualHdrRenderer,t.prototype.renderTable.call(this),this.virtualRenderer.setPanel(this.parent.getContent()),this.scrollbar=this.parent.getContent().querySelector(".e-movablescrollbar");var i=this.getFrozenContent(),r=this.getMovableContent(),n=this.parent.height;if(this.virtualRenderer.virtualEle.content=this.virtualRenderer.content=this.getPanel().querySelector(".e-content"),this.virtualRenderer.virtualEle.content.style.overflowX="hidden",this.virtualRenderer.virtualEle.renderFrozenWrapper(n),this.virtualRenderer.virtualEle.renderFrozenPlaceHolder(),this.parent.enableColumnVirtualization){this.virtualRenderer.virtualEle.movableContent=this.virtualRenderer.movableContent=this.getPanel().querySelector(".e-movablecontent"),this.virtualRenderer.virtualEle.renderMovableWrapper(n),this.virtualRenderer.virtualEle.renderMovablePlaceHolder();var o=r.querySelector("table");this.virtualRenderer.virtualEle.movableTable=o,this.virtualRenderer.virtualEle.movableWrapper.appendChild(o),r.appendChild(this.virtualRenderer.virtualEle.movableWrapper),r.appendChild(this.virtualRenderer.virtualEle.movablePlaceholder)}this.virtualRenderer.virtualEle.wrapper.appendChild(i),this.virtualRenderer.virtualEle.wrapper.appendChild(r),this.virtualRenderer.virtualEle.table=this.getTable(),ct(this.parent,this.virtualRenderer,this.scrollbar,this.getMovableContent())},i.prototype.appendContent=function(e,t,i){it(this.virtualRenderer,this.widthService,e,t,i)},i.prototype.generateRows=function(e,t){return this.firstPageRecords||(this.firstPageRecords=e),rt(this.virtualRenderer,e,t,this.freezeRowGenerator,this.parent)},i.prototype.getRowByIndex=function(e){return this.virtualRenderer.getRowByIndex(e)},i.prototype.getMovableRowByIndex=function(e){return this.virtualRenderer.getMovableVirtualRowByIndex(e)},i.prototype.collectRows=function(e){return Ze(e,this.virtualRenderer,this.parent)},i.prototype.getMovableRows=function(){return this.collectRows("movable")},i.prototype.getRows=function(){return this.collectRows("frozen-left")},i.prototype.getColGroup=function(){var e=this.parent.getMovableVirtualContent();return this.isXaxis()?e.querySelector("colgroup"):this.colgroup},i.prototype.getReorderedFrozenRows=function(e){return nt(e,this.virtualRenderer,this.parent,this.freezeRowGenerator,this.firstPageRecords)},i.prototype.isXaxis=function(){return st(this.virtualRenderer)},i.prototype.getHeaderCells=function(){return lt(this.virtualRenderer,this.parent)},i.prototype.getVirtualFreezeHeader=function(){return at(this.virtualRenderer,this.parent)},i.prototype.ensureFrozenCols=function(e){return ht(e,this.parent)},i.prototype.getRowObjectByIndex=function(e){return this.virtualRenderer.getRowObjectByIndex(e)},i.prototype.setColGroup=function(e){return dt(e,this.virtualRenderer,this)},i}(vo),Fo=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.serviceLoc=i,r}return xo(t,e),t.prototype.renderTable=function(){this.virtualHdrRenderer=new qn(this.parent,this.serviceLoc),this.virtualHdrRenderer.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.virtualHdrRenderer.gen.getColumnIndexes(this.getPanel().querySelector(".e-headercontent"))),this.virtualHdrRenderer.virtualEle.content=this.getPanel().querySelector(".e-headercontent"),this.virtualHdrRenderer.virtualEle.renderFrozenWrapper(),this.virtualHdrRenderer.virtualEle.renderFrozenPlaceHolder(),this.parent.enableColumnVirtualization&&(this.virtualHdrRenderer.virtualEle.movableContent=this.getPanel().querySelector(".e-movableheader"),this.virtualHdrRenderer.virtualEle.renderMovableWrapper(),this.virtualHdrRenderer.virtualEle.renderMovablePlaceHolder()),e.prototype.renderTable.call(this),this.virtualHdrRenderer.setPanel(this.parent.getHeaderContent())},t.prototype.rfshMovable=function(){this.getFrozenHeader().appendChild(this.getTable()),this.virtualHdrRenderer.virtualEle.wrapper.appendChild(this.getFrozenHeader()),this.parent.enableColumnVirtualization?this.virtualHdrRenderer.virtualEle.movableWrapper.appendChild(this.createHeader(void 0,"movable")):this.getMovableHeader().appendChild(this.createTable()),this.virtualHdrRenderer.virtualEle.wrapper.appendChild(this.getMovableHeader())},t}(Co),zo=function(i){function r(e,t){var r=i.call(this,e,t)||this;return r.frRows=[],r.frzRows=[],r.mvblRows=[],r.serviceLoc=t,r.eventListener("on"),r.rowModelGenerator=new Ci(r.parent),r}return xo(r,i),r.prototype.actionComplete=function(e){if("delete"===e.requestType&&this.parent.frozenRows)for(var t=0;t<this.parent.frozenRows;t++){if(!this.virtualRenderer.vgenerator.frozenRightCache[1]){this.virtualRenderer.vgenerator.frozenRightCache[1]=this.frRows.length?this.frRows:this.frzRows;break}this.virtualRenderer.vgenerator.frozenRightCache[1][t]=this.frRows.length?this.frRows[t]:this.frzRows[t],pt(this,t)}},r.prototype.eventListener=function(e){this.parent.addEventListener(vt,this.actionComplete.bind(this)),this.parent[e]("refresh-virtual-frozenrows",this.refreshVirtualFrozenRows,this),this.parent[e](hi,this.getVirtualData,this),this.parent[e]("set-freeze-selection",this.setFreezeSelection,this)},r.prototype.refreshVirtualFrozenRows=function(e){var t=this;if("delete"===e.requestType&&this.parent.frozenRows){e.isFrozenRowsRender=!0;var i=this.parent.renderModule.data.generateQuery(!0).clone();i.page(1,this.parent.pageSettings.pageSize);var r=this.parent.getSelectedRowIndexes();this.parent.renderModule.data.getData({},i).then(function(i){Ye(e,i.result,r,t.parent,t.rowModelGenerator,t.serviceLoc,t.virtualRenderer,t)})}},r.prototype.setFreezeSelection=function(e){et(e,this.virtualRenderer)},r.prototype.getVirtualData=function(e){this.virtualRenderer.getVirtualData(e)},r.prototype.renderNextFrozentPart=function(e,i){e.renderMovableContent=this.parent.getFrozenLeftCount()?"frozen-left"===i:"frozen-right"===i,e.renderFrozenRightContent="Left-Right"===this.parent.getFrozenMode()&&"movable"===i,(e.renderMovableContent||e.renderFrozenRightContent)&&this.refreshContentRows(t.extend({},e))},r.prototype.renderTable=function(){this.virtualRenderer=new Nn(this.parent,this.serviceLoc),this.virtualRenderer.header=this.serviceLoc.getService("rendererFactory").getRenderer(e.RenderType.Header).virtualHdrRenderer,this.freezeRowGenerator=new mo(this.parent),i.prototype.renderTable.call(this),this.virtualRenderer.setPanel(this.parent.getContent()),this.scrollbar=this.parent.getContent().querySelector(".e-movablescrollbar");var t=this.getFrozenRightContent(),r=this.getFrozenContent(),n=this.getMovableContent();"Right"===this.parent.getFrozenMode()&&(r=t),this.virtualRenderer.virtualEle.content=this.virtualRenderer.content=this.getPanel().querySelector(".e-content"),this.virtualRenderer.virtualEle.content.style.overflowX="hidden";var o=this.parent.height;this.virtualRenderer.virtualEle.renderFrozenWrapper(o),this.virtualRenderer.virtualEle.renderFrozenPlaceHolder(),this.renderVirtualFrozenLeft(r,n),this.renderVirtualFrozenRight(r,n),this.renderVirtualFrozenLeftRight(r,n,t),this.virtualRenderer.virtualEle.table=this.getTable(),ct(this.parent,this.virtualRenderer,this.scrollbar,this.getMovableContent())},r.prototype.renderVirtualFrozenLeft=function(e,t){"Left"===this.parent.getFrozenMode()&&(this.virtualRenderer.virtualEle.wrapper.appendChild(e),this.virtualRenderer.virtualEle.wrapper.appendChild(t))},r.prototype.renderVirtualFrozenRight=function(e,t){"Right"===this.parent.getFrozenMode()&&(this.virtualRenderer.virtualEle.wrapper.appendChild(t),this.virtualRenderer.virtualEle.wrapper.appendChild(e))},r.prototype.renderVirtualFrozenLeftRight=function(e,t,i){"Left-Right"===this.parent.getFrozenMode()&&(this.virtualRenderer.virtualEle.wrapper.appendChild(e),this.virtualRenderer.virtualEle.wrapper.appendChild(t),this.virtualRenderer.virtualEle.wrapper.appendChild(i))},r.prototype.appendContent=function(e,t,i){it(this.virtualRenderer,this.widthService,e,t,i),this.refreshScrollOffset()},r.prototype.generateRows=function(e,t){return this.firstPageRecords||(this.firstPageRecords=e),rt(this.virtualRenderer,e,t,this.freezeRowGenerator,this.parent)},r.prototype.getRowByIndex=function(e){return this.virtualRenderer.getRowByIndex(e)},r.prototype.getFrozenRightRowByIndex=function(e){return this.virtualRenderer.getFrozenRightVirtualRowByIndex(e)},r.prototype.collectRows=function(e){return Ze(e,this.virtualRenderer,this.parent)},r.prototype.getMovableRowByIndex=function(e){return this.virtualRenderer.getMovableVirtualRowByIndex(e)},r.prototype.getFrozenRightRows=function(){return this.collectRows("frozen-right")},r.prototype.getMovableRows=function(){return this.collectRows("movable")},r.prototype.getColGroup=function(){var e=this.parent.getMovableVirtualContent();return st(this.virtualRenderer)?e.querySelector("colgroup"):this.colgroup},r.prototype.getRows=function(){return this.collectRows("Right"===this.parent.getFrozenMode()?"frozen-right":"frozen-left")},r.prototype.getReorderedFrozenRows=function(e){return nt(e,this.virtualRenderer,this.parent,this.freezeRowGenerator,this.firstPageRecords)},r.prototype.getHeaderCells=function(){return lt(this.virtualRenderer,this.parent)},r.prototype.isXaxis=function(){return st(this.virtualRenderer)},r.prototype.getVirtualFreezeHeader=function(){return at(this.virtualRenderer,this.parent)},r.prototype.getRowObjectByIndex=function(e){return this.virtualRenderer.getRowObjectByIndex(e)},r.prototype.ensureFrozenCols=function(e){return ht(e,this.parent)},r.prototype.setColGroup=function(e){return dt(e,this.virtualRenderer,this)},r}(So),Io=function(){function t(e,t){this.parent=e,this.locator=t,this.addEventListener()}return t.prototype.getModuleName=function(){return"freeze"},t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(It,this.instantiateRenderer,this)},t.prototype.instantiateRenderer=function(){this.parent.log("limitation",this.getModuleName());var t=this.locator.getService("rendererFactory");this.parent.getFrozenColumns()&&(this.parent.enableColumnVirtualization?t.addRenderer(e.RenderType.Header,new Fo(this.parent,this.locator)):t.addRenderer(e.RenderType.Header,new Co(this.parent,this.locator)),this.parent.enableVirtualization?t.addRenderer(e.RenderType.Content,new Ro(this.parent,this.locator)):t.addRenderer(e.RenderType.Content,new vo(this.parent,this.locator))),(this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount())&&(t.addRenderer(e.RenderType.Header,new bo(this.parent,this.locator)),this.parent.enableVirtualization?t.addRenderer(e.RenderType.Content,new zo(this.parent,this.locator)):t.addRenderer(e.RenderType.Content,new So(this.parent,this.locator)))},t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(It,this.instantiateRenderer)},t.prototype.destroy=function(){this.removeEventListener()},t}(),To=function(){function e(e,t){this.defaultItems={},this.localeText=this.setLocaleKey(),this.disableItems=[],this.hiddenItems=[],this.isOpen=!1,this.GROUP="e-icon-group",this.UNGROUP="e-icon-ungroup",this.ASCENDING="e-icon-ascending",this.DESCENDING="e-icon-descending",this.ROOT="e-columnmenu",this.FILTER="e-icon-filter",this.POP="e-filter-popup",this.WRAP="e-col-menu",this.CHOOSER="_chooser_",this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.wireEvents=function(){for(var e=this.getColumnMenuHandlers(),i=0;i<e.length;i++)t.EventHandler.add(e[i],"mousedown",this.columnMenuHandlerDown,this)},e.prototype.unwireEvents=function(){for(var e=this.getColumnMenuHandlers(),i=0;i<e.length;i++)t.EventHandler.remove(e[i],"mousedown",this.columnMenuHandlerDown)},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.columnMenu.destroy(),this.removeEventListener(),this.unwireFilterEvents(),this.unwireEvents(),t.remove(this.element))},e.prototype.columnMenuHandlerClick=function(e){e.target.classList.contains("e-columnmenu")&&(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.isOpen&&this.headerCell!==this.getHeaderCell(e)||document.querySelector(".e-grid-menu .e-menu-parent.e-ul")?(this.columnMenu.close(),this.openColumnMenu(e)):this.isOpen?this.columnMenu.close():this.openColumnMenu(e))},e.prototype.openColumnMenuByField=function(e){this.openColumnMenu({target:this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu")})},e.prototype.openColumnMenu=function(e){var i={top:0,left:0};this.element.style.cssText="display:block;visibility:hidden";var n=this.element.getBoundingClientRect();this.element.style.cssText="display:none;visibility:visible",this.headerCell=this.getHeaderCell(e),t.Browser.isDevice?(i.top=window.innerHeight/2-n.height/2,i.left=window.innerWidth/2-n.width/2):this.parent.enableRtl?i=r.calculatePosition(this.headerCell,"left","bottom"):(i=r.calculatePosition(this.headerCell,"right","bottom")).left-=n.width,this.columnMenu.open(i.top,i.left),e.preventDefault&&e.preventDefault(),Se(this.parent.element,this.columnMenu.element.parentElement)},e.prototype.columnMenuHandlerDown=function(e){this.isOpen=!("none"===this.element.style.display||""===this.element.style.display)},e.prototype.getColumnMenuHandlers=function(){return[].slice.call(this.parent.getHeaderTable().querySelectorAll("."+this.ROOT))},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Lt,this.wireEvents,this),this.parent.on(Dt,this.enableAfterRenderMenu,this),this.parent.on(Tt,this.render,this),this.isFilterItemAdded()&&this.parent.on("filterDialogCreated",this.filterPosition,this),this.parent.on(Ht,this.columnMenuHandlerClick,this),this.parent.on(qt,this.keyPressHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Lt,this.unwireEvents),this.parent.off(Dt,this.enableAfterRenderMenu),this.parent.off(Tt,this.render),this.isFilterItemAdded()&&this.parent.off("filterDialogCreated",this.filterPosition),this.parent.off(Ht,this.columnMenuHandlerClick),this.parent.off(qt,this.keyPressHandler))},e.prototype.keyPressHandler=function(e){var t=this.parent;if("altDownArrow"===e.action){var i=t.focusModule.currentInfo.element;if(i&&i.classList.contains("e-headercell")){var r=t.getColumnByUid(i.firstElementChild.getAttribute("e-mappinguid"));this.openColumnMenuByField(r.field)}}},e.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.columnMenu&&(this.columnMenu.destroy(),t.remove(this.element)),this.render())},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_columnmenu",className:"e-colmenu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ColumnMenuDialogARIA")),this.parent.element.appendChild(this.element),this.columnMenu=new a.ContextMenu({cssClass:"e-grid-menu",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,items:this.getItems(),select:this.columnMenuItemClick.bind(this),beforeOpen:this.columnMenuBeforeOpen.bind(this),onOpen:this.columnMenuOnOpen.bind(this),onClose:this.columnMenuOnClose.bind(this),beforeItemRender:this.beforeMenuItemRender.bind(this),beforeClose:this.columnMenuBeforeClose.bind(this)}),this.columnMenu.appendTo(this.element),this.wireFilterEvents()},e.prototype.wireFilterEvents=function(){!t.Browser.isDevice&&this.isFilterItemAdded()&&t.EventHandler.add(this.element,"mouseover",this.appendFilter,this)},e.prototype.unwireFilterEvents=function(){!t.Browser.isDevice&&this.isFilterItemAdded()&&t.EventHandler.remove(this.element,"mouseover",this.appendFilter)},e.prototype.beforeMenuItemRender=function(e){if(this.isChooserItem(e.item)){var t=this.getKeyFromId(e.item.id,this.CHOOSER),i=this.parent.columnModel.filter(function(e){return e.field===t}),r=n.createCheckBox(this.parent.createElement,!1,{label:e.item.text,checked:i[0].visible});this.parent.enableRtl&&r.classList.add("e-rtl"),e.element.innerHTML="",e.element.appendChild(r)}else e.item.id&&"Filter"===this.getKeyFromId(e.item.id)&&(e.element.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),e.element.className+="e-filter-item e-menu-caret-icon")},e.prototype.columnMenuBeforeClose=function(e){var i=e.event?t.closest(e.event.target,".e-menu-item"):null;!t.isNullOrUndefined(e.parentItem)&&"ColumnChooser"===this.getKeyFromId(e.parentItem.id)&&i&&this.isChooserItem(i)?e.cancel=!0:e.event&&(t.closest(e.event.target,"."+this.POP)||e.event.currentTarget&&e.event.currentTarget.activeElement&&O(e.event.currentTarget.activeElement,"e-filter-popup")||O(e.event.target,"e-popup")||O(e.event.target,"e-popup-wrapper"))&&!t.Browser.isDevice&&(e.cancel=!0)},e.prototype.isChooserItem=function(e){return e.id&&e.id.indexOf("_colmenu_")>=0&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},e.prototype.columnMenuBeforeOpen=function(e){e.column=this.targetColumn=this.getColumn(),this.parent.trigger("columnMenuOpen",e);for(var t=0,i=e.items;t<i.length;t++){var r=i[t],n=this.getKeyFromId(r.id),o=this.defaultItems[n];-1!==this.getDefaultItems().indexOf(n)&&this.ensureDisabledStatus(n)&&!o.hide&&this.disableItems.push(r.text),r.hide&&this.hiddenItems.push(r.text)}this.columnMenu.enableItems(this.disableItems,!1),this.columnMenu.hideItems(this.hiddenItems)},e.prototype.columnMenuOnOpen=function(e){"e-menu-parent e-ul "===e.element.className&&(e.element.offsetHeight>window.innerHeight?(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto"):this.parent.element.offsetHeight>window.innerHeight&&(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto"))},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(In)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.allowGrouping)&&(t=!0);break;case"AutoFitAll":case"AutoFit":t=!this.parent.ensureModuleInjected(Rn);break;case"Ungroup":(!this.parent.ensureModuleInjected(In)||this.parent.ensureModuleInjected(In)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"SortDescending":case"SortAscending":if(this.parent.allowSorting&&this.parent.ensureModuleInjected(en)&&this.parent.sortSettings.columns.length>0&&this.targetColumn&&this.targetColumn.allowSorting)for(var i=this.parent.sortSettings.columns,r=0;r<i.length;r++)i[r].field===this.targetColumn.field&&i[r].direction.toLocaleLowerCase()===e.toLocaleLowerCase().replace("sort","")&&(t=!0);else(!this.parent.allowSorting||!this.parent.ensureModuleInjected(en)||this.parent.allowSorting&&this.targetColumn&&!this.targetColumn.allowSorting)&&(t=!0);break;case"Filter":this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(Sn)&&this.targetColumn&&this.targetColumn.allowFiltering?t=!1:this.parent.ensureModuleInjected(Sn)&&this.parent.allowFiltering&&this.targetColumn&&(!this.targetColumn.allowFiltering||"FilterBar"===this.parent.filterSettings.type)&&(t=!0)}return t},e.prototype.columnMenuItemClick=function(e){switch(this.isChooserItem(e.item)?"ColumnChooser":this.getKeyFromId(e.item.id)){case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"AutoFitAll":this.parent.autoFitColumns([]);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"SortAscending":this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"ColumnChooser":var t=this.getKeyFromId(e.item.id,this.CHOOSER),i=e.element.querySelector(".e-checkbox-wrapper .e-frame");i&&i.classList.contains("e-check")?(i.classList.remove("e-check"),this.parent.hideColumns(t,"field")):i&&(this.parent.showColumns(t,"field"),i.classList.add("e-check"));break;case"Filter":this.getFilter(e.element,e.item.id)}e.column=this.targetColumn,this.parent.trigger("columnMenuClick",e)},e.prototype.columnMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof a.ContextMenu&&(this.columnMenu.enableItems(this.disableItems,!1),this.disableItems=[],this.columnMenu.showItems(this.hiddenItems),this.hiddenItems=[],this.isFilterPopupOpen()&&this.getFilter(e.element,e.element.id,!0)),this.parent.isFrozenGrid()||this.parent.notify("restore-Focus",{})},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},e.prototype.getItems=function(){for(var e=[],t=0,i=this.parent.columnMenuItems?this.parent.columnMenuItems:this.getDefault();t<i.length;t++){var r=i[t];if("string"==typeof r)if("ColumnChooser"===r){var n=this.getDefaultItem(r);n.items=this.createChooserItems(),e.push(n)}else e.push(this.getDefaultItem(r));else e.push(r)}return e},e.prototype.getDefaultItem=function(e){var t={};switch(e){case"SortAscending":t={iconCss:this.ASCENDING};break;case"SortDescending":t={iconCss:this.DESCENDING};break;case"Group":t={iconCss:this.GROUP};break;case"Ungroup":t={iconCss:this.UNGROUP};break;case"Filter":t={iconCss:this.FILTER}}return this.defaultItems[e]={text:this.getLocaleText(e),id:this.generateID(e),iconCss:t.iconCss?"e-icons "+t.iconCss:null},this.defaultItems[e]},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[e])},e.prototype.generateID=function(e,t){return this.gridID+"_colmenu_"+(t?t+e:e)},e.prototype.getKeyFromId=function(e,t){return e.indexOf("_colmenu_")>0&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},e.prototype.getColumnMenu=function(){return this.element},e.prototype.getModuleName=function(){return"columnMenu"},e.prototype.setLocaleKey=function(){var e={AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"};if(t.isBlazor()){e.AutoFitAll="AutoFitAll";e.AutoFit="AutoFit"}return e},e.prototype.getHeaderCell=function(e){return t.closest(e.target,"th.e-headercell")},e.prototype.getColumn=function(){if(this.headerCell){var e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");return this.parent.getColumnByUid(e)}return null},e.prototype.createChooserItems=function(){for(var e=[],t=0,i=this.parent.columnModel;t<i.length;t++){var r=i[t];r.showInColumnChooser&&r.field&&e.push({id:this.generateID(r.field,this.CHOOSER),text:r.headerText?r.headerText:r.field})}return e},e.prototype.appendFilter=function(e){if(this.defaultItems.Filter){var i=this.defaultItems.Filter.id;t.closest(e.target,"#"+i)&&!this.isFilterPopupOpen()?this.getFilter(e.target,i):!t.closest(e.target,"#"+i)&&this.isFilterPopupOpen()&&this.getFilter(e.target,i,!0)}},e.prototype.getFilter=function(e,i,r){var n=this.getFilterPop();n?n.style.display=!t.Browser.isDevice&&r?"none":"block":this.parent.notify("filterOpen",{col:this.targetColumn,target:e,isClose:r,id:i})},e.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),r=e.getBoundingClientRect(),n=r.left-i.left,o=r.top-i.top;i.height<o?o=o-t.offsetHeight+r.height:i.height<o+t.offsetHeight&&(o=i.height-t.offsetHeight),window.innerHeight<t.offsetHeight+o+i.top&&(o=window.innerHeight-t.offsetHeight-i.top),o+i.top<0&&(o=0),n+=this.parent.enableRtl?-t.offsetWidth:r.width,i.width<=n+t.offsetWidth?(n-=r.width+t.offsetWidth,r.left<t.offsetWidth&&(n=r.left+t.offsetWidth/2)):n<0&&(n+=t.offsetWidth+r.width),t.style.top=o+"px",t.style.left=n+"px"},e.prototype.filterPosition=function(e){var i=this.getFilterPop();if(i.classList.add(this.WRAP),!t.Browser.isDevice){var r=i.style.display;i.style.cssText+="display:block;visibility:hidden";var n=this.element.querySelector("."+this.FILTER);n&&(this.setPosition(n.parentElement,i),i.style.cssText+="display:"+r+";visibility:visible")}},e.prototype.getDefault=function(){var e=[];return this.parent.ensureModuleInjected(Rn)&&(e.push("AutoFitAll"),e.push("AutoFit")),this.parent.allowGrouping&&this.parent.ensureModuleInjected(In)&&(e.push("Group"),e.push("Ungroup")),this.parent.allowSorting&&this.parent.ensureModuleInjected(en)&&(e.push("SortAscending"),e.push("SortDescending")),e.push("ColumnChooser"),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(Sn)&&e.push("Filter"),e},e.prototype.isFilterPopupOpen=function(){var e=this.getFilterPop();return e&&"none"!==e.style.display},e.prototype.getFilterPop=function(){return t.Browser.isDevice&&null!==this.targetColumn&&"Menu"===this.parent.filterSettings.type?document.getElementById(this.targetColumn.uid+"-flmdlg"):this.parent.element.querySelector("."+this.POP)},e.prototype.isFilterItemAdded=function(){return this.parent.columnMenuItems&&this.parent.columnMenuItems.indexOf("Filter")>=0||!this.parent.columnMenuItems},e}(),Eo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mo=function(e){function r(t,i){var r=e.call(this,t,i)||this;return r.parent=t,r.serviceLocator=i,r.initEvent(),r}return Eo(r,e),r.prototype.initEvent=function(){this.parent.isDestroyed||(this.parent.on("initForeignKeyColumn",this.initForeignKeyColumns,this),this.parent.on("getForeignKeyData",this.getForeignKeyData,this),this.parent.on("generateQuery",this.generateQueryFormData,this))},r.prototype.initForeignKeyColumns=function(e){for(var r=0;r<e.length;r++)e[r].dataSource=e[r].dataSource instanceof i.DataManager?e[r].dataSource:t.isNullOrUndefined(e[r].dataSource)?new i.DataManager:"result"in e[r].dataSource?e[r].dataSource:new i.DataManager(e[r].dataSource)},r.prototype.eventfPromise=function(e,r,n,o){var s=this.getStateEventArgument(r),l=new i.Deferred,a=new i.Deferred;s.action=e.action;var h=this.parent.getDataModule();return!t.isNullOrUndefined(e.action)&&e.action.requestType&&!1!==h.foreignKeyDataState.isDataChanged?(h.setForeignKeyDataState({isPending:!0,resolver:a.resolve}),a.promise.then(function(){l.resolve(o.dataSource)}),s.setColumnData=this.parent.setForeignKeyData.bind(this.parent),this.parent.trigger("columnDataStateChange",s)):(h.setForeignKeyDataState({}),l.resolve(n)),l},r.prototype.getForeignKeyData=function(e){for(var r=this,n=e.column?[e.column]:this.parent.getForeignKeyColumns(),o=[],s=this,l=0;l<n.length;l++)!function(t){var i=void 0,r=e.isComplex?s.genarateColumnQuery(n[t]):s.genarateQuery(n[t],e.result.result,!1,!0);r.params=s.parent.query.params;var l=n[t].dataSource;i=l&&"result"in l?s.eventfPromise(e,r,l,n[t]).promise:!l.ready||l.dataSource.offline?l.executeQuery(r):l.ready.then(function(){return l.executeQuery(r)}),o.push(i)}(l);Promise.all(o).then(function(r){for(var o=0;o<r.length;o++)n[o].columnData=r[o].result,"dropdownedit"===n[o].editType&&"result"in n[o].dataSource&&(n[o].edit.params=t.extend(n[o].edit.params,{dataSource:r[o].result,query:new i.Query,fields:{value:n[o].foreignKeyField||n[o].field,text:n[o].foreignKeyValue}}));e.promise.resolve(e.result)}).catch(function(t){return r.parent.log(["actionfailure","foreign_key_failure"]),e.promise&&e.promise.reject&&e.promise.reject(t),t})},r.prototype.generateQueryFormData=function(e){e.predicate.predicate=this.genarateQuery(e.column,e.column.columnData,!0)},r.prototype.genarateQuery=function(e,t,r,n){var o=this.parent,s=[],l=new i.Query,a=r?e.foreignKeyField:e.field;if(o.allowPaging||o.enableVirtualization||r){t=new i.DataManager(o.allowGrouping&&o.groupSettings.columns.length&&!r?t.records:t).executeLocal((new i.Query).select(a));var h=i.DataUtil.distinct(t,a,!1);a=r?e.field:e.foreignKeyField;for(var d=0;d<h.length;d++)h[d]&&h[d].getDay?s.push(he({field:a,operator:"equal",value:h[d],matchCase:!1})):s.push(new i.Predicate(a,"equal",h[d],!1))}return n?s.length?l.where(i.Predicate.or(s)):l:s.length?i.Predicate.or(s):{predicates:[]}},r.prototype.genarateColumnQuery=function(e){var t=this.parent,r=new i.Query,n=this.isFiltered(e);if(n.isTrue&&(r=this.filterQuery(r,n.column,!0)),t.searchSettings.key.length){var o=t.searchSettings;e.dataSource instanceof i.DataManager&&e.dataSource.adaptor.getModuleName&&"ODataV4Adaptor"===e.dataSource.adaptor.getModuleName()?r=this.searchQuery(r,e,!0):r.search(o.key,e.foreignKeyValue,o.operator,o.ignoreCase)}return r},r.prototype.isFiltered=function(e){var t=this.parent.filterSettings.columns.filter(function(t){return t.field===e.foreignKeyValue&&t.uid===e.uid});return{column:t,isTrue:!!t.length}},r.prototype.getModuleName=function(){return"foreignKey"},r.prototype.destroy=function(){this.destroyEvent()},r.prototype.destroyEvent=function(){this.parent.isDestroyed||(this.parent.off("initForeignKeyColumn",this.initForeignKeyColumns),this.parent.off("getForeignKeyData",this.getForeignKeyData),this.parent.off("generateQuery",this.generateQueryFormData))},r}(gi),Do="https://ej2.syncfusion.com/documentation/grid",Oo="https://ej2.syncfusion.com/documentation/",Ao="[EJ2Grid.Warning]",Bo="[EJ2Grid.Error]",ko="[EJ2Grid.Info]",Lo=function(){function e(e){this.parent=e,this.parent.on("initial-end",this.patchadaptor,this)}return e.prototype.getModuleName=function(){return"logger"},e.prototype.log=function(e,t){e instanceof Array||(e=[e]);for(var i=e,r=0;r<i.length;r++){var n=Po[i[r]],o=n.check(t,this.parent);o.success&&console[n.logType](n.generateMessage(t,this.parent,o.options))}},e.prototype.patchadaptor=function(){var e=this.parent.getDataModule().dataManager.adaptor,t=e.beforeSend;t&&(e.beforeSend=function(i,r,n){t.call(e,i,r,n)})},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.off("initial-end",this.patchadaptor)},e}(),Po={module_missing:{type:"module_missing",logType:"warn",check:function(e,t){var i=t.getInjectedModules().map(function(e){return e.prototype.getModuleName()}),r=t.requiredModules().map(function(e){return e.member}).filter(function(e){return-1===i.indexOf(e)});return{success:r.filter(function(e){return"resize"!==e}).length>0,options:r}},generateMessage:function(e,t,i){return i=i.filter(function(e){return"resize"!==e}).reduce(function(e,t){return e+"* "+t+"\n"},""),Ao+": MODULES MISSING\nThe following modules are not injected:.\n"+i+"Refer to "+Do+"/module.html for documentation on importing feature modules."}},promise_enabled:{type:"promise_enabled",logType:"error",check:function(e,t){return{success:"undefined"==typeof Promise}},generateMessage:function(e,t){return Bo+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+Oo+"/base/browser.html?#required-polyfills for more information."}},primary_column_missing:{type:"primary_column_missing",logType:"warn",check:function(e,t){return{success:0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(e,t){return Ao+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+Do+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},selection_key_missing:{type:"selection_key_missing",logType:"warn",check:function(e,t){return{success:t.selectionSettings.persistSelection&&0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(e,t){return Ao+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+Do+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},actionfailure:{type:"actionfailure",logType:"error",check:function(e,t){return{success:!0}},generateMessage:function(e,t){var i="",r=No(e,t),n=qo(e,t);return i=""!==n?n:""!==r?r:e.error,Ao+": "+i}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,r){var n=i.DataUtil.getObject("locale."+r.locale+".grid",t.L10n);return{success:"en-US"!==r.locale&&t.isNullOrUndefined(n)}},generateMessage:function(e,t){return Ao+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+Do+"/globalization-and-localization.html?#localization \n for documentation on setting locale configuration."}},limitation:{type:"limitation",logType:"warn",check:function(e,i){var r;switch(e){case"freeze":r={success:i.allowGrouping||!t.isUndefined(i.detailTemplate)||!t.isUndefined(i.childGrid)||!t.isUndefined(i.rowTemplate)||i.enableVirtualization,options:{name:"freeze"}};break;case"virtualization":r={success:!t.isUndefined(i.detailTemplate)||!t.isUndefined(i.childGrid)||0!==i.frozenRows||0!==i.frozenColumns,options:{name:"virtualization"}};break;default:r={success:!1}}return r},generateMessage:function(e,t,i){var r,n=i.name;switch(n){case"freeze":r="Frozen rows and columns do not support the following features:\n* Virtualization\n* Row Template\n* Details Template\n* Hierarchy Grid\n* Grouping";break;case"virtualization":r="Virtualization does not support the following features.\n* Freeze rows and columns.\n* Details Template.\n* Hierarchy Grid.\n";break;default:r=""}return Ao+": "+n.toUpperCase()+" LIMITATIONS\n"+r}},check_datasource_columns:{type:"check_datasource_columns",logType:"warn",check:function(e,t){return{success:!(t.columns.length||t.dataSource instanceof i.DataManager||t.dataSource.length)}},generateMessage:function(e,t){return Ao+": GRID CONFIG MISSING\ndataSource and columns are not provided in the grid. At least one of either must be provided for grid configuration.\nRefer to "+Do+"/columns.html for documentation on configuring the grid data and columns."}},virtual_height:{type:"virtual_height",logType:"error",check:function(e,i){return{success:t.isNullOrUndefined(i.height)||"auto"===i.height}},generateMessage:function(e,t){return Bo+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+Do+"/virtual.html for documentation on configuring the virtual grid."}},grid_remote_edit:{type:"grid_remote_edit",logType:"error",check:function(e,t){return{success:Array.isArray(e)||Array.isArray(e.result)}},generateMessage:function(e,t){return Bo+": RETRUN VALUE MISSING \nRemote service returns invalid data. \nRefer to "+Do+"/edit.html for documentation on configuring editing with remote data."}},grid_sort_comparer:{type:"grid_sort_comparer",logType:"warn",check:function(e,t){return{success:t.getDataModule().isRemote()}},generateMessage:function(e,t){return Ao+": SORT COMPARER NOT WORKING \nSort comparer will not work with remote data.Refer to "+Do+"/sorting/#custom-sort-comparer for documentation on using the sort comparer."}},resize_min_max:{type:"resize_min_max",logType:"info",check:function(e,t){return{success:e.column.minWidth&&e.column.minWidth>=e.width||e.column.maxWidth&&e.column.maxWidth<=e.width}},generateMessage:function(e,t){return ko+": RESIZING COLUMN REACHED MIN OR MAX \nThe column resizing width is at its min or max."}},action_disabled_column:{type:"action_disabled_column",logType:"info",check:function(e,i){var r;switch(e.moduleName){case"reorder":r=t.isNullOrUndefined(e.destColumn)?"reordering action is disabled for the "+e.column.headerText+" column":"reordering action is disabled for the "+(e.column.allowReordering?e.destColumn.headerText:e.column.headerText)+" column";break;case"group":r="grouping action is disabled for the "+e.columnName+" column.";break;case"filter":r="filtering action is disabled for the "+e.columnName+" column.";break;case"sort":r="sorting action is disabled for the "+e.columnName+" column."}return{success:!0,options:{fn:r}}},generateMessage:function(e,t,i){return ko+": ACTION DISABLED \n "+i.fn}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e,t){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return ko+": EXPORTNIG INPROGRESS \n Grid "+i.args+"ing is in progress"}},exporting_complete:{type:"exporting_complete",logType:"info",check:function(e,t){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return ko+": EXPORTNIG COMPLETED \n Grid "+i.args+"ing is complete"}},foreign_key_failure:{type:"foreign_key_failure",logType:"error",check:function(e,t){return{success:!0}},generateMessage:function(e,t){return Bo+": FOREIGNKEY CONFIG \n Grid foreign key column needs a valid data source/service.Refer to "+Do+"/columns/#foreign-key-column for documentation on configuring foreign key columns."}},initial_action:{type:"initial_action",logType:"error",check:function(e,t){var i;switch(e.moduleName){case"group":i="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to group the column";break;case"filter":i="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to filter the column.";break;case"sort":i="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to sort the column."}return{success:!0,options:{fn:i}}},generateMessage:function(e,t,i){return Bo+": INITIAL ACTION FAILURE \n "+i.fn}},frozen_rows_columns:{type:"frozen_rows_columns",logType:"error",check:function(e,t){return{success:t.getColumns().length<=t.frozenColumns||t.frozenRows>=t.currentViewData.length}},generateMessage:function(e,t,i){return Bo+": OUT OF RANGE ERROR-\n "+(t.getColumns().length<=t.frozenColumns?"FROZEN COLUMNS,":"")+(t.frozenRows>=t.currentViewData.length?"FROZEN ROWS":"")+" invalid"}},column_type_missing:{type:"column_type_missing",logType:"error",check:function(e,i){return{success:t.isNullOrUndefined(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,i){return Bo+": COLUMN TYPE MISSING-\n "+i+" column type was invalid or not defined.Please go through below help link: "+Oo+"/grid/columns/#column-type"}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e,r){return{success:(e.dataState.dataSource instanceof i.DataManager||e.dataState.dataSource instanceof Array)&&!t.isNullOrUndefined(e.dataState.dataStateChange)}},generateMessage:function(e,t,i){return Ao+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},No=function(e,t){var i=e.error;return i.indexOf&&0!==i.indexOf("Format options")?"":"INVALID FORMAT\nFor more information, refer to the following documentation links:\nNumber format: "+Oo+"/base/intl.html?#supported-format-string.\nDate format: "+Oo+"/base/intl.html?#manipulating-datetime.\nMessage: "+i},qo=function(e,r){var n=i.DataUtil.getObject("error.error",e);if(t.isNullOrUndefined(n))return"";var o="";try{o=JSON.parse(n.responseText)}catch(e){o=""}return"XMLHTTPREQUEST FAILED\nUrl: "+n.responseURL+"\nStatus: "+n.status+" - "+n.statusText+"\n"+(""!==o?"Message: "+o:"")},Ho=function(){function e(e,t){this.infiniteCache={},this.infiniteCurrentViewData={},this.infiniteFrozenCache={},this.isDownScroll=!1,this.isUpScroll=!1,this.isScroll=!0,this.enableContinuousScroll=!1,this.initialRender=!0,this.isRemove=!1,this.isInitialCollapse=!1,this.prevScrollTop=0,this.actions=["filtering","searching","grouping","ungrouping","reorder","sorting"],this.keys=["downArrow","upArrow","PageUp","PageDown"],this.rowTop=0,this.isInitialMovableRender=!0,this.virtualInfiniteData={},this.isCancel=!1,this.emptyRowData={},this.isNormaledit=!1,this.isInfiniteScroll=!1,this.isLastPage=!1,this.isInitialRender=!0,this.parent=e,this.serviceLocator=t,this.isNormaledit="Normal"===this.parent.editSettings.mode,this.addEventListener(),this.widthService=t.getService("widthService"),this.rowModelGenerator=this.parent.isFrozenGrid()?new mo(this.parent):new Ci(this.parent)}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(Et,this.onDataReady,this),this.parent.on(Qt,this.dataSourceModified,this),this.parent.on("infinite-page-query",this.infinitePageQuery,this),this.parent.on("infinite-scroll-handler",this.infiniteScrollHandler,this),this.parent.on(Nt,this.infiniteCellFocus,this),this.parent.on("append-infinite-content",this.appendInfiniteRows,this),this.parent.on("remove-infinite-rows",this.removeInfiniteCacheRows,this),this.parent.on("reset-infinite-blocks",this.resetInfiniteBlocks,this),this.parent.on("set-infinite-cache",this.setCache,this),this.parent.on("initial-collapse",this.ensureIntialCollapse,this),this.parent.on(qt,this.infiniteCellFocus,this),this.parent.on("infinite-show-hide",this.setDisplayNone,this),this.parent.on("virtual-scroll-edit-action-begin",this.editActionBegin,this),this.parent.on(hi,this.getVirtualInfiniteData,this),this.parent.on("edit-reset",this.resetInfiniteEdit,this),this.parent.on("virtual-scroll-edit-success",this.infiniteEditSuccess,this),this.parent.on("refresh-virtual-cache",this.refreshInfiniteCache,this),this.parent.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.on("virtual-scroll-add-action-begin",this.infiniteAddActionBegin,this),this.parent.on(Bt,this.modelChanged,this),this.parent.on("refresh-infinite-current-view-data",this.refreshInfiniteCurrentViewData,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.on("delete-complete",this.deleteComplate,this),this.parent.addEventListener(yt,this.actionBeginFunction),this.parent.addEventListener(vt,this.actionCompleteFunction)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Et,this.onDataReady),this.parent.off(Qt,this.dataSourceModified),this.parent.off("infinite-page-query",this.infinitePageQuery),this.parent.off("infinite-scroll-handler",this.infiniteScrollHandler),this.parent.off(Nt,this.infiniteCellFocus),this.parent.off("append-infinite-content",this.appendInfiniteRows),this.parent.off("remove-infinite-rows",this.removeInfiniteCacheRows),this.parent.off("reset-infinite-blocks",this.resetInfiniteBlocks),this.parent.off("set-infinite-cache",this.setCache),this.parent.off("initial-collapse",this.ensureIntialCollapse),this.parent.off(qt,this.infiniteCellFocus),this.parent.off("infinite-show-hide",this.setDisplayNone),this.parent.off("virtual-scroll-edit-action-begin",this.editActionBegin),this.parent.off(hi,this.getVirtualInfiniteData),this.parent.off("edit-reset",this.resetInfiniteEdit),this.parent.off("virtual-scroll-edit-success",this.infiniteEditSuccess),this.parent.off("refresh-virtual-cache",this.refreshInfiniteCache),this.parent.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off("virtual-scroll-add-action-begin",this.infiniteAddActionBegin),this.parent.off(Bt,this.modelChanged),this.parent.off("refresh-infinite-current-view-data",this.refreshInfiniteCurrentViewData),this.parent.removeEventListener(yt,this.actionBeginFunction),this.parent.removeEventListener(vt,this.actionCompleteFunction))},e.prototype.updateCurrentViewData=function(){var e=this.parent;if(!e.groupSettings.columns.length){var t=Object.keys(this.infiniteCurrentViewData);e.currentViewData=[];for(var i=e.pageSettings.currentPage,r=e.infiniteScrollSettings.enableCache,n=e.infiniteScrollSettings.maxBlocks,o=r&&(i>n||this.isUpScroll&&i>1),s=o?this.isUpScroll?i:i-n+1:1,l=o?s+n-1:r?n:t.length,a=s;a<=l;a++)this.infiniteCurrentViewData[a]&&(e.currentViewData=e.currentViewData.concat(this.infiniteCurrentViewData[a]))}},e.prototype.refreshInfiniteCurrentViewData=function(e){var t=this.parent.pageSettings.currentPage,i=this.parent.pageSettings.pageSize,r=this.parent.infiniteScrollSettings.initialBlocks,n=Object.keys(this.infiniteCurrentViewData),o=this.parent.infiniteScrollSettings.enableCache;if(!this.parent.groupSettings.columns.length){var s="save"===e.args.requestType,l="delete"===e.args.requestType;o||!s&&!l?r>1&&e.data.length===r*i?this.setInitialCache(e.data.slice(),{},o&&"delete"===e.args.requestType,!0):this.infiniteCurrentViewData[t]=e.data.slice():s?this.infiniteCurrentViewData[1]=e.data.concat(this.infiniteCurrentViewData[1]):this.infiniteCurrentViewData[n[n.length-1]].push(e.data[0])}},e.prototype.deleteComplate=function(){this.parent.isFrozenGrid()&&!this.parent.infiniteScrollSettings.enableCache&&this.parent.contentModule.refreshScrollOffset()},e.prototype.modelChanged=function(e){if("infiniteScroll"!==e.requestType&&("delete"===e.requestType||"add"===this.requestType)){var t=this.parent.getRows();if(this.firstIndex=parseInt(t[0].getAttribute("aria-rowindex"),10),this.firstBlock=Math.ceil((this.firstIndex+1)/this.parent.pageSettings.pageSize),this.lastIndex=parseInt(t[t.length-1].getAttribute("aria-rowindex"),10),"delete"===e.requestType){var i=this.parent.getRowsObject();e.startIndex=this.parent.infiniteScrollSettings.enableCache?(this.firstBlock-1)*this.parent.pageSettings.pageSize:i[i.length-1].index}else e.startIndex=this.firstIndex;this.parent.infiniteScrollSettings.enableCache||this.parent.pageSettings.currentPage!==this.maxPage||"delete"!==e.requestType||(this.isLastPage=!0,this.lastIndex=this.lastIndex-1)}},e.prototype.infiniteAddActionBegin=function(e){this.isNormaledit&&(this.isAdd=!0,this.parent.infiniteScrollSettings.enableCache&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.parent.pageSettings.currentPage>1&&(e.startEdit=!1,this.resetInfiniteBlocks({},!0),this.makeRequest({currentPage:1}))))},e.prototype.infiniteEditHandler=function(e){if(!this.parent.infiniteScrollSettings.enableCache&&("delete"===e.e.requestType||"save"===e.e.requestType&&"add"===this.requestType)){var i=this.parent.isFrozenGrid(),r=this.parent.getRows(),n=this.parent.getRowsObject();if(this.ensureRowAvailability(n,e.result[0])){if(this.resetRowIndex(n,e.e,r,"add"===this.requestType,!0),i){var o=this.parent.getMovableRowsObject();if(this.resetRowIndex(o,e.e,this.parent.getMovableDataRows(),"add"===this.requestType),"Left-Right"===this.parent.getFrozenMode()){var s=this.parent.getFrozenRightRowsObject();this.resetRowIndex(s,e.e,this.parent.getFrozenRightRows(),"add"===this.requestType)}}if(this.isLastPage){if(this.isLastPage=!1,this.parent.pageSettings.currentPage=this.maxPage,this.parent.selectionModule.index<this.parent.frozenRows){if(t.remove(r[this.parent.frozenRows-1]),this.createRow([n[this.parent.frozenRows-1]],e,!1,!0),i){var l=this.parent.getMovableDataRows();if(t.remove(l[this.parent.frozenRows]),this.createRow([this.parent.getMovableRowsObject()[this.parent.frozenRows-1]],e,!0,!0),"Left-Right"===this.parent.getFrozenMode()){var a=this.parent.getFrozenRightDataRows();t.remove(a[this.parent.frozenRows]),this.createRow([this.parent.getFrozenRightRowsObject()[this.parent.frozenRows-1]],e,!1,!0,!0)}}Be(this.parent)}}else this.createRow(n,e)}this.parent.hideSpinner(),"delete"===this.requestType?this.parent.notify("delete-complete",e.e):this.parent.notify("save-complete",e.e)}this.parent.notify(ii,{case:"refreshHeight"})},e.prototype.createRow=function(e,i,r,n,o){var s,l=n?e:this.generateRows(i.result,i.e),a=new vi(this.serviceLocator,null,this.parent);s=o?this.parent.element.querySelector(".e-frozen-right-content").querySelector("tbody"):this.parent.isFrozenGrid()?r?this.parent.getMovableVirtualContent().querySelector("tbody"):this.parent.getFrozenVirtualContent().querySelector("tbody"):this.parent.getContent().querySelector("tbody"),this.parent.frozenRows&&(s=n&&"add"!==this.requestType||!n&&"add"===this.requestType?this.parent.isFrozenGrid()?r?this.parent.getMovableVirtualHeader().querySelector("tbody"):o?this.parent.element.querySelector(".e-frozen-right-header").querySelector("tbody"):this.parent.getFrozenVirtualHeader().querySelector("tbody"):this.parent.getHeaderContent().querySelector("tbody"):s);var h={rows:e,cancel:!1,args:i,isMovable:r,isFrozenRows:n,isFrozenRight:n,row:l};if(this.parent.notify("infinite-crud-cancel",h),!h.cancel)for(var d=l.length-1;d>=0;d--)"delete"===this.requestType?s.appendChild(a.render(l[d],this.parent.getColumns())):s.insertBefore(a.render(l[d],this.parent.getColumns()),s.firstElementChild);if(!n&&this.parent.frozenRows&&(this.parent.selectionModule.index<this.parent.frozenRows||"add"===this.requestType)){var p=r?this.parent.getMovableDataRows():o?this.parent.getFrozenRightDataRows():this.parent.getRows(),c=(r||o)&&"add"===this.requestType?this.parent.frozenRows:this.parent.frozenRows-1;t.remove(p[c]),this.createRow([e[this.parent.frozenRows-1]],i,r,!0,o)}this.parent.infiniteScrollSettings.enableCache||n||(o?(Be(this.parent),this.parent.contentModule.rightFreezeRows="add"===this.requestType?l.concat(e):e.concat(l)):!this.parent.isFrozenGrid()||r?(Be(this.parent),this.parent.contentModule.visibleRows="add"===this.requestType?l.concat(e):e.concat(l),"Left-Right"===this.parent.getFrozenMode()&&this.createRow(this.parent.getFrozenRightRowsObject(),i,!1,!1,!0)):(this.parent.contentModule.visibleFrozenRows="add"===this.requestType?l.concat(e):e.concat(l),this.createRow(this.parent.getMovableRowsObject(),i,!0)))},e.prototype.ensureRowAvailability=function(e,t){var i=!0;if(this.parent.frozenRows&&!this.parent.infiniteScrollSettings.enableCache&&this.parent.sortSettings.columns&&"add"===this.requestType)for(var r=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<e.length;n++)if(e[n].data[r]===t[r]){i=!1;break}return i},e.prototype.generateRows=function(e,t){return this.rowModelGenerator.generateRows(e,t)},e.prototype.resetRowIndex=function(e,i,r,n,o){var s=this,l=this.parent.getPrimaryKeyFieldNames()[0],a=!(r.length%this.parent.pageSettings.pageSize);n?a&&(o&&!this.parent.groupSettings.columns.length&&this.swapCurrentViewData(1,!0),t.remove(r[e.length-1]),r.splice(e.length-1,1),e.splice(e.length-1,1)):e.filter(function(n,a){if(n.data[l]===i.data[0][l]){if(o&&!s.parent.groupSettings.columns.length){var h=Math.ceil((a+1)/s.parent.pageSettings.pageSize);s.resetInfiniteCurrentViewData(h,a)}e.splice(a,1),t.remove(r[a]),r.splice(a,1)}});var h=n?1:0;De(this.parent,e,r,h)},e.prototype.resetInfiniteCurrentViewData=function(e,t){t-=(e-1)*this.parent.pageSettings.pageSize,this.infiniteCurrentViewData[e].splice(t,1),this.swapCurrentViewData(e,!1)},e.prototype.swapCurrentViewData=function(e,t){for(var i=Object.keys(this.infiniteCurrentViewData),r=t?i.length+1:i.length,n=e;n<r;n++)if(this.infiniteCurrentViewData[n+1]){var o=t?n:n+1,s=t?this.infiniteCurrentViewData[n].length-1:0,l=this.infiniteCurrentViewData[o].splice(s,1);t?(this.infiniteCurrentViewData[n+1]=l.concat(this.infiniteCurrentViewData[n+1]),n+1===r-1&&this.infiniteCurrentViewData[n+1].splice(this.infiniteCurrentViewData[n+1].length-1,1)):this.infiniteCurrentViewData[n].push(l[0])}this.updateCurrentViewData()},e.prototype.setDisplayNone=function(e){if(this.parent.infiniteScrollSettings.enableCache){for(var t=this.parent.isFrozenGrid(),i=t?Object.keys(this.infiniteFrozenCache):Object.keys(this.infiniteCache),r=1;r<=i.length;r++)(t?e.isFreeze?this.infiniteFrozenCache[r][0]:this.infiniteFrozenCache[r][1]:this.infiniteCache[r]).filter(function(t){t.cells[e.index].visible=""===e.visible});this.resetContentModuleCache(t?this.infiniteFrozenCache:this.infiniteCache)}},e.prototype.refreshInfiniteCache=function(e){this.getEditedRowObject().data=e},e.prototype.getEditedRowObject=function(){for(var e,t=this.parent.getRowsObject(),i=0;i<t.length;i++)t[i].index===this.editRowIndex&&(e=t[i]);return e},e.prototype.infiniteEditSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewRecords(e.data),this.isAdd=!1)},e.prototype.updateCurrentViewRecords=function(e){var i=Ie(this.parent,e);t.isNullOrUndefined(i)||(this.parent.getCurrentViewRecords()[i]=e)},e.prototype.actionBegin=function(e){"add"!==e.requestType&&"delete"!==e.requestType||(this.requestType=e.requestType),(this.parent.isFrozenGrid()&&!e.cancel&&"searching"===e.requestType||"sorting"===e.requestType||"filtering"===e.requestType)&&(this.isInitialRender=!0)},e.prototype.actionComplete=function(e){"delete"!==e.requestType&&"save"!==e.requestType&&"cancel"!==e.requestType||(this.requestType=this.empty,this.isCancel="cancel"===e.requestType||"save"===e.requestType,this.isAdd=this.isEdit=!1,this.isNormaledit&&(this.editRowIndex=this.empty,this.virtualInfiniteData={},this.parent.editModule.previousVirtualData={}))},e.prototype.resetInfiniteEdit=function(){this.parent.enableInfiniteScrolling&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.isEdit||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},e.prototype.getVirtualInfiniteData=function(e){e.virtualData=this.virtualInfiniteData,e.isAdd=this.isAdd,e.isCancel=this.isCancel},e.prototype.editActionBegin=function(e){this.isEdit=!0,this.editRowIndex=e.index;var i=t.extend({},this.getEditedRowObject().data);e.data=Object.keys(this.virtualInfiniteData).length?this.virtualInfiniteData:i},e.prototype.dataSourceModified=function(){this.resetInfiniteBlocks({requestType:this.empty},!0)},e.prototype.onDataReady=function(e){t.isNullOrUndefined(e.count)||(this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize))},e.prototype.ensureIntialCollapse=function(e){this.isInitialCollapse=!e},e.prototype.infiniteScrollHandler=function(e){this.restoreInfiniteEdit(),this.restoreInfiniteAdd();var i=e.target;if(i.classList.contains("e-content")&&this.parent.enableInfiniteScrolling&&!e.isLeft){var r=this.parent.getContent().firstElementChild;this.prevScrollTop=r.scrollTop;var n=this.parent.getRows(),o=parseInt(n[n.length-1].getAttribute("aria-rowindex"),10)+1,s=this.parent.pageSettings.currentPage,l=void 0,a=i.scrollHeight-i.scrollTop,h=Math.round(i.scrollHeight-i.scrollTop),d=(a<i.clientHeight?Math.ceil(a):Math.floor(a))===i.clientHeight||h===i.clientHeight;if(this.isScroll&&d&&(this.parent.pageSettings.currentPage<=this.maxPage-1||this.enableContinuousScroll)){this.parent.infiniteScrollSettings.enableCache&&(this.isUpScroll=!1,this.isDownScroll=!0);var p=[].slice.call(r.querySelectorAll(".e-row:not(.e-addedrow)")),c=p[p.length-1],u=parseInt(c.getAttribute("aria-rowindex"),10);this.parent.pageSettings.currentPage=Math.ceil(u/this.parent.pageSettings.pageSize)+1,l={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:s,startIndex:o,direction:"down"},this.makeRequest(l)}if(this.isScroll&&this.parent.infiniteScrollSettings.enableCache&&0===i.scrollTop&&1!==this.parent.pageSettings.currentPage){this.parent.infiniteScrollSettings.enableCache&&(this.isDownScroll=!1,this.isUpScroll=!0);var c=[].slice.call(r.querySelectorAll(".e-row")),u=parseInt(c[this.parent.pageSettings.pageSize-1].getAttribute("aria-rowindex"),10),g=parseInt(c[0].getAttribute("aria-rowindex"),10)-this.parent.pageSettings.pageSize;this.parent.pageSettings.currentPage=Math.ceil(u/this.parent.pageSettings.pageSize)-1,this.parent.pageSettings.currentPage&&(l={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:s,startIndex:g,direction:"up"},this.makeRequest(l))}this.parent.infiniteScrollSettings.enableCache&&!this.isScroll&&t.isNullOrUndefined(l)&&(this.isDownScroll||this.isUpScroll)&&(r.scrollTop=this.top)}},e.prototype.makeRequest=function(e){var i=this;this.parent.pageSettings.currentPage!==e.prevPage&&(this.parent.pageSettings.currentPage<=this.maxPage?(this.isInfiniteScroll=!0,t.isNullOrUndefined(this.infiniteCache[e.currentPage])?setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify("model-changed",e)},100):setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify(di,e)},100)):this.parent.pageSettings.currentPage=this.maxPage)},e.prototype.infinitePageQuery=function(e){this.initialRender?(this.initialRender=!1,this.intialPageQuery(e)):this.isInfiniteScroll||"delete"!==this.requestType&&"add"!==this.requestType?e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize):this.editPageQuery(e)},e.prototype.editPageQuery=function(e){var t=this.parent.infiniteScrollSettings.initialBlocks;if(this.parent.infiniteScrollSettings.enableCache)this.infiniteCache={},this.infiniteFrozenCache={},this.infiniteCurrentViewData={},e.skip(this.firstIndex),e.take(t*this.parent.pageSettings.pageSize);else{"Dialog"===this.parent.editSettings.mode&&this.parent.clearSelection();var i="delete"===this.requestType?this.lastIndex:this.firstIndex;e.skip(i),e.take(1)}},e.prototype.intialPageQuery=function(e){this.parent.infiniteScrollSettings.enableCache&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var t=this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks;e.page(1,t)},e.prototype.infiniteCellFocus=function(e){if(!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action)"PageDown"!==e.key&&"PageUp"!==e.key||(this.pressedKey=e.key);else{this.pressedKey=e.keyArgs.action;var t=document.activeElement,i=parseInt(t.parentElement.getAttribute("aria-rowindex"),10),r=this.parent.getContent().firstElementChild;this.rowIndex="downArrow"===e.keyArgs.action?i+1:i-1,this.cellIndex=parseInt(t.getAttribute("aria-colindex"),10);var n=this.parent.getRowByIndex(i),o=Math.floor(r.offsetHeight/this.parent.getRowHeight());if(!n||Re(n,this.parent)||Fe(n,this.rowTop)){var s=n?n.getBoundingClientRect().height:this.parent.getRowHeight();if(!this.parent.infiniteScrollSettings.enableCache){if("downArrow"===e.keyArgs.action&&(Re(n,this.parent)||!n)){var l=(this.rowIndex-o)*s,a=r.scrollTop+this.parent.getRowHeight();r.scrollTop=l<a?a:l}"upArrow"===e.keyArgs.action&&Fe(n,this.rowTop)&&(r.scrollTop=this.rowIndex*s)}}else this.pressedKey=this.empty}},e.prototype.createEmptyRowdata=function(){var e=this;this.parent.getColumns().filter(function(t){e.emptyRowData[t.field]=e.empty})},e.prototype.getVirtualInfiniteEditedData=function(){var e=this.parent.element.querySelector(".e-editedrow"),i=this.parent.element.querySelector(".e-addedrow"),r=this.parent.element.querySelector(".e-gridform");if(this.parent.infiniteScrollSettings.enableCache&&(e||i)){var n=e?t.extend({},this.getEditedRowObject().data):t.extend({},this.emptyRowData);this.virtualInfiniteData=this.parent.editModule.getCurrentEditedData(r,n),this.parent.isFrozenGrid()&&(this.virtualInfiniteData=this.parent.editModule.getCurrentEditedData(this.parent.getMovableVirtualContent().querySelector(".e-gridform"),n))}},e.prototype.restoreInfiniteEdit=function(){var e=this.parent.getContent().firstElementChild,i=!this.parent.frozenRows||this.editRowIndex>=this.parent.frozenRows;if(this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&i&&this.parent.editSettings.allowEditing&&!t.isNullOrUndefined(this.editRowIndex)){var r=this.parent.getRowByIndex(this.editRowIndex);if(Object.keys(this.virtualInfiniteData).length&&r&&!this.parent.getContent().querySelector(".e-editedrow")){var n=r.getBoundingClientRect().top;n<e.offsetHeight&&n>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(r))}}},e.prototype.restoreInfiniteAdd=function(){var e=this.parent.getContent().firstElementChild;this.parent.getCurrentViewRecords().length&&this.parent.getRowByIndex(0)&&this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&this.isAdd&&!e.querySelector(".e-addedrow")&&e.scrollTop<this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.addRecord())},e.prototype.appendInfiniteRows=function(e){document.activeElement;var t=this.parent.isFrozenGrid(),i=this.parent.getContent().firstElementChild,r=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType,n="Left-Right"===this.parent.getFrozenMode()&&"movable"===e.tableName;if((!r||e.args.isFrozen||n)&&r||(r&&"up"===e.args.direction?e.tbody.insertBefore(e.frag,e.tbody.firstElementChild):e.tbody.appendChild(e.frag)),t)if(r)if("frozen-left"===e.tableName||"Right"===this.parent.getFrozenMode()&&"frozen-right"===e.tableName)this.frozenFrag=e.frag;else if("Left-Right"===this.parent.getFrozenMode()&&"movable"===e.tableName)this.movableFrag=e.frag;else{var o=this.parent.getFrozenVirtualContent().querySelector("tbody");"up"===e.args.direction?o.insertBefore(this.frozenFrag,o.firstElementChild):o.appendChild(this.frozenFrag),"frozen-right"===e.tableName?(this.parent.getMovableVirtualContent().querySelector("tbody").appendChild(this.movableFrag),this.parent.element.querySelector(".e-frozen-right-content").querySelector("tbody").appendChild(e.frag)):this.parent.getMovableVirtualContent().querySelector(".e-table").appendChild(e.tbody),this.parent.contentModule.refreshScrollOffset(),this.updateCurrentViewData()}else{var s=void 0;"frozen-left"===e.tableName?s=this.parent.getFrozenVirtualContent().querySelector(".e-table"):"movable"===e.tableName?(s=this.parent.getMovableVirtualContent().querySelector(".e-table"),"Left-Right"!==this.parent.getFrozenMode()&&(this.parent.contentModule.refreshScrollOffset(),this.updateCurrentViewData())):(s=this.parent.element.querySelector(".e-frozen-right-content").querySelector(".e-table"),"Left-Right"===this.parent.getFrozenMode()&&(this.parent.contentModule.refreshScrollOffset(),this.updateCurrentViewData())),s.appendChild(e.tbody),this.widthService.refreshFrozenScrollbar()}else this.parent.contentModule.getTable().appendChild(e.tbody),this.updateCurrentViewData();this.isInitialRender&&!e.args.isFrozen&&(this.isInitialRender=!1,this.parent.scrollModule.setHeight()),e.args.isFrozen||(this.rowTop=this.rowTop?this.rowTop:this.parent.getRows()[0].getBoundingClientRect().top,r&&(this.parent.infiniteScrollSettings.enableCache&&this.isRemove&&(i.scrollTop=this.top),Be(this.parent),this.selectNewRow(e.tbody,e.args.startIndex),this.pressedKey=void 0),this.restoreInfiniteAdd(),this.isScroll=!0),this.isInfiniteScroll=!1},e.prototype.selectNewRow=function(e,t){var i=this,r=this.parent.getRowByIndex(this.rowIndex);if(this.keys.some(function(e){return e===i.pressedKey})){if(("downArrow"===this.pressedKey||this.parent.infiniteScrollSettings.enableCache&&"upArrow"===this.pressedKey)&&setTimeout(function(){r.cells[0].focus({preventScroll:!0}),i.parent.selectRow(i.rowIndex),i.parent.getContent().firstElementChild.scrollTop+=i.parent.getRowHeight()},0),"PageDown"===this.pressedKey){var n=this.parent.getRowByIndex(t);n&&n.cells[0].focus()}"PageUp"===this.pressedKey&&e.querySelector(".e-row").cells[0].focus()}},e.prototype.removeInfiniteCacheRows=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;if(!e.args.isFrozen&&t&&this.parent.infiniteScrollSettings.enableCache&&this.isRemove){var i=[].slice.call(this.parent.getContentTable().querySelectorAll(".e-row"));if("down"===e.args.direction){if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length){n=[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.removeCaptionRows(n,e.args)}var r=this.parent.element.querySelector(".e-addedrow")?0:1;this.removeTopRows(i,this.parent.pageSettings.pageSize-r)}if("up"===e.args.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length){var n=[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.removeCaptionRows(n,e.args)}else this.removeBottomRows(i,i.length-1,e.args);this.isScroll=!1,this.top=this.calculateScrollTop(e.args)}},e.prototype.calculateScrollTop=function(e){var i=0,r=this.parent.getContent().firstElementChild;if("down"===e.direction){this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse&&(i=this.captionRowHeight());var n=[].slice.call(this.parent.getContent().firstElementChild.querySelectorAll("tr:not(.e-row)")),o=0;this.isInitialCollapse&&!t.isNullOrUndefined(n)&&(o=Math.round((n.length-1)/this.parent.groupSettings.columns.length));for(var s=o||this.parent.pageSettings.pageSize*(this.parent.infiniteScrollSettings.maxBlocks-1),l=0,a=0;l<r.clientHeight;)l=++a*this.parent.getRowHeight();i+=(s-(a-=1))*this.parent.getRowHeight()}if("up"===e.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse)i=this.infiniteCache[this.parent.pageSettings.currentPage].length*this.parent.getRowHeight();else if(this.isInitialCollapse){for(var h=this.infiniteCache[this.parent.pageSettings.currentPage],d=0,a=0;a<h.length;a++)h[a].isCaptionRow&&d++;i+=Math.round(d/this.parent.groupSettings.columns.length)*this.parent.getRowHeight()}else i+=this.parent.pageSettings.pageSize*this.parent.getRowHeight()+j();return i},e.prototype.captionRowHeight=function(){return[].slice.call(this.parent.getContent().querySelectorAll("tr:not(.e-row)")).length*this.parent.getRowHeight()},e.prototype.removeTopRows=function(e,i){for(var r=this.parent.isFrozenGrid(),n="Left-Right"===this.parent.getFrozenMode()?[].slice.call(this.parent.element.querySelector(".e-frozen-right-content").querySelectorAll(".e-row")):null,o=r?[].slice.call(this.parent.getMovableVirtualContent().querySelectorAll(".e-row")):null,s=0;s<=i;s++)this.parent.frozenRows&&this.parent.pageSettings.currentPage===this.parent.infiniteScrollSettings.maxBlocks+1&&s>i-this.parent.frozenRows||(t.remove(e[s]),o&&t.remove(o[s]),n&&t.remove(n[s]))},e.prototype.removeBottomRows=function(e,i,r){var n=0,o=this.parent.isFrozenGrid(),s=o?[].slice.call(this.parent.getMovableVirtualContent().querySelectorAll(".e-row")):null,l="Left-Right"===this.parent.getFrozenMode()?[].slice.call(this.parent.element.querySelector(".e-frozen-right-content").querySelectorAll(".e-row")):null,a=this.parent.pageSettings.pageSize;!o&&this.infiniteCache[r.prevPage].length<a&&(n=this.parent.pageSettings.pageSize-this.infiniteCache[r.prevPage].length),o&&this.infiniteFrozenCache[r.prevPage][1].length<a&&(n=this.parent.pageSettings.pageSize-this.infiniteFrozenCache[r.prevPage][1].length);for(var h=i;n<a;h--)n++,t.remove(e[h]),s&&t.remove(s[h]),l&&t.remove(l[h])},e.prototype.removeCaptionRows=function(e,i){if("down"===i.direction)for(var r=this.parent.getRows()[this.parent.pageSettings.pageSize],n=parseInt(r.getAttribute("aria-rowindex"),10)-1,o=0,s=0;o<n;s++)e[s].classList.contains("e-row")?o=parseInt(e[s].getAttribute("aria-rowindex"),10):t.remove(e[s]);if("up"===i.direction){for(var l=[].slice.call(this.parent.getContent().querySelectorAll(".e-row")),a=parseInt(l[l.length-1].getAttribute("aria-rowindex"),10),h=Math.ceil(a/this.parent.pageSettings.pageSize),d=0,s=this.parent.pageSettings.currentPage+1;s<h;s++)d+=this.infiniteCache[s].length;for(s=d;s<e.length;s++)t.remove(e[s])}},e.prototype.resetInfiniteBlocks=function(e,i){var r=this.parent.enableInfiniteScrolling&&"infiniteScroll"!==e.requestType;if(!this.initialRender&&!t.isNullOrUndefined(this.parent.infiniteScrollModule)&&r&&(this.actions.some(function(t){return t===e.requestType})||i)){var n=this.parent.getContent().firstElementChild;this.initialRender=!0,n.scrollTop=0,this.parent.pageSettings.currentPage=1,this.infiniteCache=this.infiniteFrozenCache={},this.infiniteCurrentViewData={},this.resetContentModuleCache({}),this.isRemove=!1,this.top=0,this.isInitialMovableRender=!0,this.isInitialCollapse=!1,this.parent.contentModule.isRemove=this.isRemove,this.parent.contentModule.isAddRows=this.isRemove,this.parent.contentModule.visibleRows=[],this.parent.contentModule.visibleFrozenRows=[]}},e.prototype.setCache=function(e){if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache){var i=this.parent.isFrozenGrid(),r=e.args.isFrozen?1:0,n="infiniteScroll"!==e.args.requestType&&("delete"===this.requestType||"add"===this.requestType),o=this.parent.pageSettings.currentPage;(i&&this.isInitialMovableRender||!i&&!Object.keys(this.infiniteCache).length||n)&&(this.isInitialMovableRender=!e.args.isFrozen,this.setInitialCache(e.modelData,e.args,n)),!i&&t.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage])&&(this.infiniteCache[this.parent.pageSettings.currentPage]=e.modelData,this.resetContentModuleCache(this.infiniteCache)),i&&(0===r&&t.isNullOrUndefined(this.infiniteFrozenCache[o])||!this.infiniteFrozenCache[o][r].length)&&(this.createFrozenCache(o),this.infiniteFrozenCache[o][r]=e.modelData,1===r&&this.resetContentModuleCache(this.infiniteFrozenCache)),e.isInfiniteScroll&&!this.isRemove&&(this.isRemove=(o-1)%this.parent.infiniteScrollSettings.maxBlocks==0,this.parent.contentModule.isRemove=this.isRemove)}},e.prototype.setInitialCache=function(e,t,i,r){for(var n=this.parent.isFrozenGrid(),o=t.isFrozen?1:0,s=i?this.firstBlock:1,l=1;l<=this.parent.infiniteScrollSettings.initialBlocks;l++){var a=(l-1)*this.parent.pageSettings.pageSize,h=l*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!r?this.setInitialGroupCache(e,s,a,h):r?this.infiniteCurrentViewData[s]=e.slice(a,h):n?(this.createFrozenCache(s),this.infiniteFrozenCache[s][o]=e.slice(a,h),this.resetContentModuleCache(this.infiniteFrozenCache)):(this.infiniteCache[s]=e.slice(a,h),this.resetContentModuleCache(this.infiniteCache)),s++}},e.prototype.createFrozenCache=function(e){this.infiniteFrozenCache[e]||(this.infiniteFrozenCache[e]=[[],[]])},e.prototype.setInitialGroupCache=function(e,t,i,r){for(var n=[],o=0,s=1;s<=Object.keys(this.infiniteCache).length;s++)o+=this.infiniteCache[s].length;for(var l=i,s=o;s<e.length&&l<r&&((e[s].index<r||e[s].isCaptionRow)&&(l=e[s].isCaptionRow?l:e[s].index,n.push(e[s])),!(e[s].index>=r||e[s].index===r-1));s++);this.infiniteCache[t]=n,this.resetContentModuleCache(this.infiniteCache)},e.prototype.resetContentModuleCache=function(e){this.parent.contentModule.infiniteCache=e},e.prototype.destroy=function(){this.removeEventListener()},e}(),Uo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jo=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.childCount=0,r.scrollData=[],r.isFirstChildRow=!1,r.groupCache={},r.startIndexes={},r.captionCounts={},r.rowsByUid={},r.objIdxByUid={},r.initialGroupCaptions={},r.requestType=["paging","columnstate","reorder","cancel","save","beginEdit","add","delete"],r.cacheMode=!1,r.cacheBlockSize=5,r.ignoreAccent=!!r.parent.allowFiltering&&r.parent.filterSettings.ignoreAccent,r.allowCaseSensitive=!1,r.locator=i,r.groupGenerator=new Fi(r.parent),r.summaryModelGen=new Si(r.parent),r.captionModelGen=new xi(r.parent),r.rowRenderer=new vi(r.locator,null,r.parent),r.eventListener(),r}return Uo(i,e),i.prototype.eventListener=function(){this.parent.addEventListener(yt,this.actionBegin.bind(this)),this.parent.addEventListener(vt,this.actionComplete.bind(this)),this.parent.on(Tt,this.setLazyLoadPageSize,this),this.parent.on("group-cache",this.setCache,this),this.parent.on("lazy-load-scroll-handler",this.scrollHandler,this),this.parent.on(jt,this.setVisible,this),this.parent.on("group-collapse",this.collapseShortcut,this)},i.prototype.captionExpand=function(e){var t=this,i=this.parent.pageSettings.currentPage,r=this.groupCache[i],n=e.getAttribute("data-uid"),o=this.getRowObjectIndexByUid(n),s=!!r[o+1]&&r[o].indent<r[o+1].indent,l=r[o],a=this.getGroupKeysAndFields(o,r),h={captionRowElement:e,groupInfo:l,enableCaching:!0,cancel:!1};this.parent.trigger("lazyLoadGroupExpand",h,function(r){r.cancel||(r.keys=a.keys,r.fields=a.fields,r.rowIndex=e.rowIndex,r.makeRequest=!r.enableCaching||!s,!r.enableCaching&&s&&t.clearCache([n]),r.skip=0,r.take=t.pageSize,l.isExpand=t.rowsByUid[i][l.uid].isExpand=!0,t.captionRowExpand(r))})},i.prototype.captionCollapse=function(e){var t=this,i=this.groupCache[this.parent.pageSettings.currentPage],r=e.rowIndex,n=e.getAttribute("data-uid"),o=this.getRowObjectIndexByUid(n),s={captionRowElement:e,groupInfo:i[o],cancel:!1};this.parent.trigger("lazyLoadGroupCollapse",s,function(e){e.cancel||(e.isExpand=!1,t.removeRows(o,r))})},i.prototype.setLazyLoadPageSize=function(){var e=this.parent.getContent().firstElementChild,t=Math.floor(e.offsetHeight/this.parent.getRowHeight())-1;this.pageSize=this.pageSize?this.pageSize:3*t,this.blockSize=Math.ceil(this.pageSize/2)},i.prototype.clearLazyGroupCache=function(){this.clearCache()},i.prototype.clearCache=function(e){e=e||this.getInitialCaptionIndexes();var t=this.groupCache[this.parent.pageSettings.currentPage];if(e.length)for(var i=0;i<e.length;i++){var r=this.getRowObjectIndexByUid(e[i]),n=t[r];if(n){if(this.captionCounts[this.parent.pageSettings.currentPage][n.uid])for(var o=r+1;o<t.length;o++){if(t[o].indent===n.indent||t[o].indent<n.indent){delete this.captionCounts[this.parent.pageSettings.currentPage][n.uid];break}t[o].isCaptionRow&&delete this.captionCounts[this.parent.pageSettings.currentPage][t[o].uid]}if(n.isExpand){var s=this.parent.getRowElementByUID(n.uid);if(!s)return;this.parent.groupModule.expandCollapseRows(s.querySelector(".e-recordplusexpand"))}var l=this.getNextChilds(r);if(l.length){var a=[];l[l.length-1].isCaptionRow&&(a=this.getChildRowsByParentIndex(t.indexOf(l[l.length-1]),!1,!1,null,!0,!0));var h=t.indexOf(l[0]),d=a.length?t.indexOf(a[a.length-1]):t.indexOf(l[l.length-1]);t.splice(h,d-(h-1)),this.refreshCaches()}}}},i.prototype.refreshCaches=function(){var e=this.parent.pageSettings.currentPage,t=this.groupCache[e];this.rowsByUid={},this.objIdxByUid={};for(var i=0;i<t.length;i++)this.maintainRows(t[i],i)},i.prototype.getInitialCaptionIndexes=function(){for(var e=this.parent.pageSettings.currentPage,t=[],i=0;i<this.initialGroupCaptions[e].length;i++)t.push(this.initialGroupCaptions[e][i].uid);return t},i.prototype.getRowObjectIndexByUid=function(e){return this.objIdxByUid[this.parent.pageSettings.currentPage][e]},i.prototype.collapseShortcut=function(e){if(this.parent.groupSettings.columns.length&&e.target&&O(e.target,"e-content")&&"TR"===e.target.parentElement.tagName){if(!e.collapse&&O(e.target,"e-row"))return;var t=e.target.parentElement.getAttribute("data-uid");if(e.collapse){var i=this.getRowByUid(t);if((r=this.getRowByUid(i.parentUid)).isCaptionRow&&r.isExpand){n=this.getRowElementByUid(i.parentUid);this.parent.groupModule.expandCollapseRows(n.cells[i.indent-1])}}else{var r=this.getRowByUid(t);if(r.isCaptionRow&&!r.isExpand){var n=this.getRowElementByUid(t);this.parent.groupModule.expandCollapseRows(n.cells[r.indent])}}}},i.prototype.getRowByUid=function(e){return this.rowsByUid[this.parent.pageSettings.currentPage][e]},i.prototype.actionBegin=function(e){if(!e.cancel){if(this.requestType.some(function(t){return t===e.requestType})||(this.groupCache={},this.resetRowMaintenance()),"reorder"===e.requestType&&this.parent.groupSettings.columns.length)for(var t=Object.keys(this.groupCache),i=0;i<t.length;i++)for(var r=this.groupCache[t[i]],n=0;n<r.length;n++)if(r[n].isCaptionRow&&!this.captionModelGen.isEmpty()&&this.changeCaptionRow(r[n],null,t[i]),r[n].isDataRow){var o=e.fromIndex+r[n].indent,s=e.toIndex+r[n].indent;this.moveCells(r[n].cells,o,s)}("delete"===e.requestType||"add"===e.action&&"save"===e.requestType)&&(this.groupCache={},this.resetRowMaintenance())}},i.prototype.actionComplete=function(e){e.cancel||"columnstate"===e.requestType||"beginEdit"===e.requestType||"delete"===e.requestType||"save"===e.requestType||"reorder"===e.requestType||this.scrollReset()},i.prototype.resetRowMaintenance=function(){this.startIndexes={},this.captionCounts={},this.rowsByUid={},this.objIdxByUid={},this.initialGroupCaptions={}},i.prototype.moveCells=function(e,t,i){if(t>=e.length)for(var r=t-e.length;1+r--;)e.push(void 0);e.splice(t,0,e.splice(i,1)[0])},i.prototype.removeRows=function(e,i){var r,n=this.parent.pageSettings.currentPage,o=this.groupCache[n],s=[].slice.call(this.parent.getContent().querySelectorAll("tr"));if(this.parent.aggregates.length){var l=this.getAggregateByCaptionIndex(e);r=l.length?l[l.length-1].uid:void 0}var a=o[e].indent;this.addClass(this.getNextChilds(e)),o[e].isExpand=this.rowsByUid[n][o[e].uid].isExpand=!1;for(var h,d=e+1;d<o.length;d++){if(o[d].indent===a||o[d].indent<a){h=o[d].uid;break}o[d].isCaptionRow&&o[d].isExpand&&this.addClass(this.getNextChilds(d))}for(d=i+1;d<s.length&&s[d].getAttribute("data-uid")!==h;d++){if(s[d].getAttribute("data-uid")===r){t.remove(s[d]);break}t.remove(s[d])}},i.prototype.addClass=function(e){var t=e[this.blockSize];t&&(t.lazyLoadCssClass="e-lazyload-middle-down")},i.prototype.getNextChilds=function(e,t){for(var i=this.groupCache[this.parent.pageSettings.currentPage],r=t||i,n=i[e].indent+1,o=[],s=t?0:e+1;s<r.length&&!(r[s].indent<n);s++)r[s].indent===n&&o.push(r[s]);return o},i.prototype.lazyLoadHandler=function(e){this.setStartIndexes();var t=this.parent.getContent().querySelectorAll("tr")[e.index].getAttribute("data-uid"),i=this.getRowObjectIndexByUid(t),r=this.groupCache[this.parent.pageSettings.currentPage][i],n=e.isRowExist?e.isScroll?this.scrollData:this.getChildRowsByParentIndex(i,!0,!0,null,!0):[];if(this.scrollData=[],!e.isRowExist)if(this.setRowIndexes(i,r),this.refreshCaptionRowCount(this.groupCache[this.parent.pageSettings.currentPage][i],e.count),-1!==Object.keys(e.data).indexOf("GroupGuid"))for(var o=0;o<e.data.length;o++){var s=this.groupGenerator.generateCaptionRow(e.data[o],e.level,r.parentGid,void 0,0,r.uid);n.push(s),this.parent.aggregates.length&&(n=n.concat(this.summaryModelGen.generateRows(e.data[o],{level:e.level+1,parentUid:s.uid})))}else this.groupGenerator.index=this.getStartIndex(i,e.isScroll),n=this.groupGenerator.generateDataRows(e.data,e.level,r.parentGid,0,r.uid);var l=e.isScroll?this.rowIndex:e.index,a=this.getNextChilds(i,n),h=!!e.up||this.hasLastChildRow(e.isScroll,e.count,a.length);e.isRowExist||h||(a[this.blockSize].lazyLoadCssClass="e-lazyload-middle-down"),h||(a[a.length-1].lazyLoadCssClass="e-not-lazyload-end");var d=e.isScroll||e.isRowExist?[]:this.getAggregateByCaptionIndex(i);e.up||e.isRowExist||this.refreshRowObjects(n,e.isScroll?this.rowObjectIndex:i),this.render(l,n,h,d),this.isFirstChildRow&&!e.up&&(this.parent.getContent().firstElementChild.scrollTop=n.length*this.parent.getRowHeight()),this.isFirstChildRow=!1,this.rowIndex=void 0,this.rowObjectIndex=void 0,this.childCount=0},i.prototype.setRowIndexes=function(e,t){this.captionCounts[this.parent.pageSettings.currentPage]||(this.captionCounts[this.parent.pageSettings.currentPage]={}),t.isCaptionRow&&(this.captionCounts[this.parent.pageSettings.currentPage][t.uid]=t.data.count)},i.prototype.getStartIndex=function(e,t){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i];if(t)return r[this.rowObjectIndex].index+1;var n=0,o=0,s=this.getRowByUid(r[e].parentUid);if(s&&(o=this.prevCaptionCount(s)),r[e].indent>0)for(var l=e-1;l>=0&&!(r[l].indent<r[e].indent);l--)r[l].isCaptionRow&&r[l].indent===r[e].indent&&(n+=r[l].data.count);return n+o+this.startIndexes[i][r[e].parentGid]},i.prototype.prevCaptionCount=function(e){for(var t=this.parent.pageSettings.currentPage,i=this.groupCache[t],r=0,n=i.indexOf(e)-1;n>=0&&0!==i[n].indent&&!(i[n].indent<e.indent);n--)if(i[n].isCaptionRow&&i[n].indent===e.indent){var o=this.captionCounts[t][i[n].uid];r+=o||i[n].data.count}var s=this.getRowByUid(e.parentUid);return s&&(r+=this.prevCaptionCount(s)),r},i.prototype.setStartIndexes=function(){var e=this.groupCache[this.parent.pageSettings.currentPage];if(!this.startIndexes[this.parent.pageSettings.currentPage]){for(var t=[],i=void 0,r=0;r<e.length;r++)e[r].isCaptionRow&&(t.length?t.push(e[i].data.count+t[t.length-1]):t.push(0),i=r);this.startIndexes[this.parent.pageSettings.currentPage]=t}},i.prototype.hasLastChildRow=function(e,t,i){return e?t===this.childCount+i:t===i},i.prototype.refreshCaptionRowCount=function(e,t){e.data.count=t},i.prototype.render=function(e,t,i,r){var n=this.parent.getContent().querySelectorAll("tr")[e];if(n&&r.length)for(o=r.length-1;o>=0;o--)n.insertAdjacentElement("afterend",this.rowRenderer.render(r[o],this.parent.getColumns()));if(n&&t.length)for(var o=t.length-1;o>=0;o--)this.confirmRowRendering(t[o])&&n.insertAdjacentElement("afterend",this.rowRenderer.render(t[o],this.parent.getColumns()))},i.prototype.maintainRows=function(e,t){var i=this.parent.pageSettings.currentPage;this.rowsByUid[i]||(this.rowsByUid[i]={},this.objIdxByUid[i]={}),e.uid&&(this.rowsByUid[i][e.uid]=e),this.objIdxByUid[i][e.uid]=t},i.prototype.confirmRowRendering=function(e){var i=!0;if(t.isNullOrUndefined(e.indent)&&!e.isDataRow&&!e.isCaptionRow){var r=this.getRowByUid(e.parentUid);r.isCaptionRow&&!r.isExpand&&(i=!1)}return i},i.prototype.refreshRowObjects=function(e,i){var r=this.parent.pageSettings.currentPage,n=this.groupCache[r];this.rowsByUid[r]={},this.objIdxByUid[r]={};for(var o=[],s=0,l=0;l<n.length;l++)if(l===i){this.maintainRows(n[l],s),o.push(n[l]),s++;for(var a=0;a<e.length;a++)this.maintainRows(e[a],s),o.push(e[a]),s++}else this.maintainRows(n[l],s),o.push(n[l]),s++;this.groupCache[this.parent.pageSettings.currentPage]=t.extend([],o),this.updateCurrentViewData()},i.prototype.getAggregateByCaptionIndex=function(e){for(var i=this.groupCache[this.parent.pageSettings.currentPage],r=i[e],n=r.indent,o=r.uid,s=[],l=e+1;l<i.length&&i[l].indent!==n;l++)t.isNullOrUndefined(i[l].indent)&&i[l].parentUid===o&&s.push(i[l]);return s},i.prototype.getChildRowsByParentIndex=function(e,i,r,n,o,s){var l=n||this.groupCache[this.parent.pageSettings.currentPage],a=l[e],h=[];if(!a.isCaptionRow||a.isCaptionRow&&!a.isExpand&&!s)return[];o&&this.parent.aggregates.length&&(h=this.getAggregateByCaptionIndex(e));for(var d=a.indent,p=a.uid,c=[],u=0,g=e+1;g<l.length;g++){if(l[g].parentUid===p){if(t.isNullOrUndefined(l[g].indent))continue;if(u++,c.push(l[g]),i&&l[g].isCaptionRow&&(c=c.concat(this.getChildRowsByParentIndex(g,i,r,n,o))),r&&u===this.pageSize)break}if(l[g].indent===d)break}return c.concat(h)},i.prototype.initialGroupRows=function(e){var t=[],i=this.groupCache[this.parent.pageSettings.currentPage];if(e)return this.getRenderedRowsObject();for(var r=0;r<i.length;r++)0===i[r].indent&&(t.push(i[r]),t=t.concat(this.getChildRowsByParentIndex(r,!0,!0,i,!0)));return t},i.prototype.getRenderedRowsObject=function(){for(var e=[],t=[].slice.call(this.parent.getContent().querySelectorAll("tr")),i=0;i<t.length;i++)e.push(this.getRowByUid(t[i].getAttribute("data-uid")));return e},i.prototype.getCacheRowsOnDownScroll=function(e){for(var i=[],r=this.groupCache[this.parent.pageSettings.currentPage],n=e,o=0;o<this.pageSize&&(r[n]&&!(r[n].indent<r[e].indent));o++)r[n].indent===r[e].indent&&(i.push(r[n]),r[n].isCaptionRow&&r[n].isExpand&&(i=i.concat(this.getChildRowsByParentIndex(n,!0,!0,null,!0)))),(r[n].indent>r[e].indent||t.isNullOrUndefined(r[n].indent))&&o--,n++;return i},i.prototype.getCacheRowsOnUpScroll=function(e,t,i){for(var r=[],n=this.groupCache[this.parent.pageSettings.currentPage],o=!1,s=0;s<n.length&&(!o||n[s]&&!(n[s].indent<n[i].indent)&&n[s].uid!==t);s++)o||n[s].uid!==e||(o=!0),o&&n[s].indent===n[i].indent&&(r.push(n[s]),n[s].isCaptionRow&&n[s].isExpand&&(r=r.concat(this.getChildRowsByParentIndex(s,!0,!0,null,!0))));return r},i.prototype.scrollHandler=function(e){if(!this.parent.isDestroyed&&!this.childCount){var t,i=[].slice.call(this.parent.getContent().querySelectorAll(".e-lazyload-middle-down")),r=[].slice.call(this.parent.getContent().querySelectorAll(".e-lazyload-middle-up")),n=[].slice.call(this.parent.getContent().querySelectorAll(".e-not-lazyload-end")),o=!1,s=!1,l=!1;if(e.scrollDown&&i.length&&(t=(p=this.findRowElements(i)).tr,o=p.entered),!e.scrollDown&&n)for(var a=0;a<n.length;a++){var h=n[a].getBoundingClientRect().top,d=this.parent.getContent().scrollHeight;if(h>0&&h<d){t=n[a],l=!0,this.rowIndex=t.rowIndex;break}}if(!e.scrollDown&&r.length&&!l){var p=this.findRowElements(r);t=p.tr,s=p.entered}t&&(o&&e.scrollDown&&o&&t&&this.scrollDownHandler(t),!e.scrollDown&&l&&t&&this.scrollUpEndRowHandler(t),this.cacheMode&&!e.scrollDown&&!l&&s&&t&&this.scrollUpHandler(t))}},i.prototype.scrollUpEndRowHandler=function(e){var t=this.parent.pageSettings.currentPage,i=this.groupCache[t],r=e.getAttribute("data-uid"),n=this.rowObjectIndex=this.getRowObjectIndexByUid(r),o=n,s=i[n],l=this.getRowByUid(s.parentUid),a=this.getRowObjectIndexByUid(l.uid),h=this.parent.getContent().querySelector("tr[data-uid="+l.uid+"]").rowIndex,d=this.getChildRowsByParentIndex(a).indexOf(s),p=Math.ceil(d/this.pageSize);if(1!==p)if(this.childCount=p*this.pageSize,n=this.getCurrentBlockEndIndex(s,n),this.childCount<l.data.count){e.classList.remove("e-not-lazyload-end"),s.lazyLoadCssClass="";var c=!!i[n+1]&&s.indent===i[n+1].indent;this.scrollData=c?this.getCacheRowsOnDownScroll(n+1):[];var u=this.getGroupKeysAndFields(a,i),g={rowIndex:h,makeRequest:!c,groupInfo:l,fields:u.fields,keys:u.keys,skip:this.childCount,take:this.pageSize,isScroll:!0};if(this.cacheMode&&this.childCount>=this.pageSize*this.cacheBlockSize){var f=this.getChildRowsByParentIndex(a),m=Math.ceil(f.indexOf(i[o])/this.pageSize)-(this.cacheBlockSize-1);this.removeBlock(r,c,m,f),g.cachedRowIndex=m*this.pageSize}this.captionRowExpand(g)}else this.childCount=0},i.prototype.scrollDownHandler=function(e){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i],n=e.getAttribute("data-uid"),o=this.getRowObjectIndexByUid(n),s=o,l=r[o],a=this.getRowByUid(l.parentUid),h=this.getRowObjectIndexByUid(a.uid),d=this.getRowElementByUid(a.uid).rowIndex,p=this.getChildRowsByParentIndex(h),c=p.indexOf(l),u=Math.ceil(c/this.pageSize);this.childCount=u*this.pageSize;var g=r[o=this.rowObjectIndex=this.getRowObjectIndexByUid(p[this.childCount-1].uid)],f=this.getRowElementByUid(g.uid);if(this.rowIndex=f.rowIndex,o=this.getCurrentBlockEndIndex(g,o),this.childCount<a.data.count){var m=!!r[o+1]&&l.indent===r[o+1].indent;if(m&&!t.isNullOrUndefined(this.getRowElementByUid(r[o+1].uid)))return void(this.childCount=0);(u>1||!this.cacheMode)&&(e.classList.remove("e-lazyload-middle-down"),f.classList.remove("e-not-lazyload-end"),g.lazyLoadCssClass=""),this.scrollData=m?this.getCacheRowsOnDownScroll(this.rowObjectIndex+1):[];var y=this.getGroupKeysAndFields(h,r),v={rowIndex:d,makeRequest:!m,groupInfo:a,fields:y.fields,keys:y.keys,skip:this.childCount,take:this.pageSize,isScroll:!0};if(this.cacheMode&&this.childCount-this.pageSize>=this.pageSize*this.cacheBlockSize){var C=this.getChildRowsByParentIndex(h),w=Math.ceil(C.indexOf(r[s])/this.pageSize)-1-(this.cacheBlockSize-1)+1;this.removeBlock(n,m,w,C,g),v.cachedRowIndex=w*this.pageSize}this.captionRowExpand(v)}else this.childCount=0},i.prototype.getCurrentBlockEndIndex=function(e,t){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i];if(e.isCaptionRow){if(e.isExpand){var n=this.getChildRowsByParentIndex(t,!0).length;this.rowIndex=this.rowIndex+n}var o=this.getAggregateByCaptionIndex(t);this.rowObjectIndex=this.rowObjectIndex+o.length;for(var s=t,l=s+1;l<r.length;l++){if(r[l].indent===r[t].indent||r[l].indent<r[t].indent){t=s;break}s++}}return t},i.prototype.removeBlock=function(e,t,i,r,n){var o=this.parent.pageSettings.currentPage,s=this.groupCache[o],l=r[(i+1)*this.pageSize-1-this.blockSize].uid,a=r[i*this.pageSize-this.pageSize].uid,h=r[i*this.pageSize].uid;s[this.getRowObjectIndexByUid(l)].lazyLoadCssClass="e-lazyload-middle-up",this.getRowElementByUid(l).classList.add("e-lazyload-middle-up"),n&&(this.getRowElementByUid(h).classList.add("e-not-lazyload-first"),this.getRowByUid(h).lazyLoadCssClass="e-not-lazyload-first",this.getRowByUid(a).lazyLoadCssClass=""),t?this.removeTopRows(n?n.uid:e,a,h):(this.uid1=a,this.uid2=h,this.uid3=n?n.uid:e)},i.prototype.scrollUpHandler=function(e){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i],n=e.getAttribute("data-uid"),o=this.getRowByUid(n),s=this.rowObjectIndex=this.getRowObjectIndexByUid(n),l=this.getRowByUid(o.parentUid),a=this.rowIndex=this.getRowObjectIndexByUid(l.uid),h=this.parent.getRowElementByUID(l.uid).rowIndex,d=this.getChildRowsByParentIndex(a),p=d.indexOf(r[s]),c=Math.floor(p/this.pageSize),u=this.blockSize;2*this.blockSize>this.pageSize&&(u=2*this.blockSize-this.pageSize,u=this.blockSize-u);var g=d[p-(u-1)-this.pageSize].uid,f=d[p-(u-1)].uid;this.scrollData=this.getCacheRowsOnUpScroll(g,f,s-(u-1)),this.isFirstChildRow=c>1,this.isFirstChildRow&&(this.scrollData[0].lazyLoadCssClass="e-not-lazyload-first"),this.getRowByUid(f).lazyLoadCssClass="",this.getRowElementByUid(f).classList.remove("e-not-lazyload-first");var m=c+this.cacheBlockSize;if(d.length!==l.data.count&&m*this.pageSize>d.length)return this.isFirstChildRow=!1,this.scrollData[0].lazyLoadCssClass="",void this.getRowElementByUid(f).classList.add("e-not-lazyload-first");var y=m*this.pageSize>l.data.count?l.data.count:m*this.pageSize,v=m*this.pageSize>l.data.count?this.pageSize-(this.pageSize*m-l.data.count):this.pageSize,C=this.getChildRowsByParentIndex(r.indexOf(d[y-1]),!0,!1,null,!0),w=C.length?C[C.length-1].uid:d[y-1].uid,b=d[y-v].uid,S=d[y-v-1].uid,x=this.objIdxByUid[i][b]-u;if("e-lazyload-middle-down"===r[x].lazyLoadCssClass){var R=this.getRowElementByUid(r[x].uid);R&&R.classList.add("e-lazyload-middle-down")}if(this.getRowByUid(w).lazyLoadCssClass="",this.getRowByUid(S).lazyLoadCssClass="e-not-lazyload-end",this.getRowElementByUid(S).classList.add("e-not-lazyload-end"),this.removeBottomRows(w,b,S),this.rowIndex=e.rowIndex-u,e.classList.length>1?e.classList.remove("e-lazyload-middle-up"):e.removeAttribute("class"),!t.isNullOrUndefined(this.getRowElementByUid(g)))return this.childCount=0,void(this.scrollData=[]);var F=this.getGroupKeysAndFields(this.getRowObjectIndexByUid(l.uid),r),z={rowIndex:h,makeRequest:!1,groupInfo:l,fields:F.fields,keys:F.keys,skip:this.childCount,take:this.pageSize,isScroll:!0,scrollUp:!0};this.captionRowExpand(z)},i.prototype.findRowElements=function(e){for(var t,i=!1,r=0;r<e.length;r++){var n=e[r].rowIndex;if(ze(n,this.parent)){i=!0,this.rowIndex=n,t=e[r];break}}return{entered:i,tr:t}},i.prototype.getRowElementByUid=function(e){return this.parent.getContent().querySelector("tr[data-uid="+e+"]")},i.prototype.removeTopRows=function(e,i,r){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),o=(this.parent.pageSettings.currentPage,!1),s=0;s<n.length;s++){if(n[s].getAttribute("data-uid")===r){var l=this.parent.getContent().querySelector("tr[data-uid="+e+"]");l&&(this.rowIndex=l.rowIndex);break}n[s].getAttribute("data-uid")===i&&(o=!0),o&&t.remove(n[s])}},i.prototype.removeBottomRows=function(e,i,r){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),o=!1,s=0;s<n.length&&(n[s].getAttribute("data-uid")===i&&(o=!0),!o||(t.remove(n[s]),n[s].getAttribute("data-uid")!==e));s++);},i.prototype.setCache=function(e){var i=this.parent.pageSettings.currentPage;this.groupCache[i]=this.initialGroupCaptions[i]=t.extend([],e.data)},i.prototype.getGroupKeysAndFields=function(e,t){for(var i=[],r=[],n=e;n>=0&&(!t[n].isCaptionRow||-1!==i.indexOf(t[n].data.field)||!(t[n].indent<t[e].indent||n===e)||(i.push(t[n].data.field),r.push(t[n].data.key),0!==t[n].indent));n--);return{fields:i,keys:r}},i.prototype.generateExpandPredicates=function(e,i){for(var r=[],n=0;n<e.length;n++){var o=this.parent.getColumnByField(e[n]),s="null"===i[n]?null:i[n],l={field:e[n],predicate:"or",uid:o.uid,operator:"equal",type:o.type,matchCase:this.allowCaseSensitive,ignoreAccent:this.ignoreAccent};""===s||t.isNullOrUndefined(s)?r=r.concat(Yr.generateNullValuePredicates(l)):r.push(t.extend({},{value:s},l))}return Yr.getPredicate(r)},i.prototype.getPredicates=function(e){for(var t=[],i=0,r=Object.keys(e);i<r.length;i++){var n=r[i];t.push(e[n])}return t},i.prototype.captionRowExpand=function(e){var t=this,i=e.groupInfo,r=this.parent.groupSettings.columns.indexOf(i.data.field)+1,n=this.generateExpandPredicates(e.fields,e.keys),o=this.getPredicates(n),s={level:r,skip:e.skip,take:e.take,where:o};if(e.makeRequest){var l=this.parent.renderModule.data.generateQuery(!0);l.isCountRequired||(l.isCountRequired=!0),l.lazyLoad.push({key:"onDemandGroupInfo",value:s}),this.parent.showSpinner(),this.parent.renderModule.data.getData({},l).then(function(i){t.parent.hideSpinner(),0!==i.result.length&&(t.cacheMode&&t.uid1&&t.uid2&&(t.removeTopRows(t.uid3,t.uid1,t.uid2),t.uid1=t.uid2=t.uid3=void 0),t.lazyLoadHandler({data:i.result,count:i.count,level:r,index:e.rowIndex,isRowExist:!1,isScroll:e.isScroll,up:!1,rowIndex:e.cachedRowIndex}))}).catch(function(e){return t.parent.renderModule.dataManagerFailure(e,{requestType:"grouping"})})}else this.lazyLoadHandler({data:null,count:e.groupInfo.data.count,level:r,index:e.rowIndex,isRowExist:!0,isScroll:e.isScroll,up:e.scrollUp,rowIndex:e.cachedRowIndex})},i.prototype.scrollReset=function(e){this.parent.getContent().firstElementChild.scrollTop=e?this.parent.getContent().firstElementChild.scrollTop+e:0},i.prototype.updateCurrentViewData=function(){var e=[];this.getRows().filter(function(t){t.isDataRow&&(e[t.index]=t.data)}),this.parent.currentViewData=e.length?e:this.parent.currentViewData},i.prototype.getGroupCache=function(){return this.groupCache},i.prototype.getRows=function(){return this.groupCache[this.parent.pageSettings.currentPage]||[]},i.prototype.getRowElements=function(){return[].slice.call(this.parent.getContent().querySelectorAll(".e-row"))},i.prototype.getRowByIndex=function(e){for(var i,r=[].slice.call(this.parent.getContent().querySelectorAll(".e-row")),n=0;!t.isNullOrUndefined(e)&&n<r.length;n++)if(r[n].getAttribute("aria-rowindex")===e.toString()){i=r[n];break}return i},i.prototype.setVisible=function(e){var i,r=this.parent;this.getRows().some(function(e){return e.isDataRow&&(i=e),e.isDataRow});for(var n=this.getRows().filter(function(e){return!e.isDetailRow}),o=0;o<e.length;o++){var s=e[o],l=this.parent.getNormalizedColumnIndex(s.uid),a=this.parent.getColumnIndexByUid(s.uid),h=!0===s.visible?"":"none";-1!==l&&i&&l<i.cells.length&&t.setStyleAttribute(this.getColGroup().childNodes[l],{display:h}),this.setDisplayNone(r.getDataRows(),a,h,n,l),!this.parent.invokedFromMedia&&s.hideAtMedia&&this.parent.updateMediaColumns(s),this.parent.invokedFromMedia=!1}},i.prototype.setDisplayNone=function(e,i,r,n,o){var s=Object.keys(e);if(this.parent.groupSettings.columns.length)for(var l=Object.keys(this.groupCache),a=0;a<l.length;a++)for(var h=this.rowsByUid[l[a]],d=Object.keys(h),p=0;p<d.length;p++){var c=this.parent.getContent().querySelector("tr[data-uid="+d[p]+"]"),u=h[d[p]];u.isCaptionRow&&(this.captionModelGen.isEmpty()?(u.cells[u.indent+1].colSpan=""===r?u.cells[u.indent+1].colSpan+1:u.cells[u.indent+1].colSpan-1,c&&(c.cells[u.indent+1].colSpan=u.cells[u.indent+1].colSpan)):this.changeCaptionRow(u,c,l[a])),u.isDataRow&&(this.showAndHideCells(c,i,r,!1),u.cells[o].visible=""===r),u.isCaptionRow||u.isDataRow||!t.isNullOrUndefined(u.indent)||(u.cells[o].visible=""===r,u.visible=u.cells.some(function(e){return e.isDataCell&&e.visible}),this.showAndHideCells(c,i,r,!0,u))}else for(p=0;p<s.length;p++){var g=e[s[p]].querySelectorAll("td.e-rowcell")[i];e[s[p]].querySelectorAll("td.e-rowcell").length&&g&&(t.setStyleAttribute(e[s[p]].querySelectorAll("td.e-rowcell")[i],{display:r}),e[s[p]].querySelectorAll("td.e-rowcell")[i].classList.contains("e-hide")&&t.removeClass([e[s[p]].querySelectorAll("td.e-rowcell")[i]],["e-hide"]),n[s[p]].cells[i].visible=""===r)}},i.prototype.changeCaptionRow=function(e,t,i){var r=e,n=e.data,o=this.groupGenerator.generateCaptionRow(n,r.indent,r.parentGid,void 0,r.tIndex,r.parentUid);o.uid=e.uid,o.isExpand=e.isExpand,o.lazyLoadCssClass=e.lazyLoadCssClass,this.rowsByUid[i][e.uid]=o,this.groupCache[i][this.objIdxByUid[i][e.uid]]=o,t&&this.parent.getContentTable().querySelector("tbody").replaceChild(this.rowRenderer.render(o,this.parent.getColumns()),t)},i.prototype.showAndHideCells=function(e,i,r,n,o){if(e){var s=n?"td.e-summarycell":"td.e-rowcell";t.setStyleAttribute(e.querySelectorAll(s)[i],{display:r}),e.querySelectorAll(s)[i].classList.contains("e-hide")&&t.removeClass([e.querySelectorAll(s)[i]],["e-hide"]),n&&(o.visible&&e.classList.contains("e-hide")?t.removeClass([e],["e-hide"]):o.visible||t.addClass([e],["e-hide"]))}},i}(zi),Vo=function(){function t(e,t){this.parent=e,this.serviceLocator=t,this.addEventListener()}return t.prototype.getModuleName=function(){return"lazyLoadGroup"},t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(It,this.instantiateRenderer,this)},t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(It,this.instantiateRenderer)},t.prototype.instantiateRenderer=function(){"auto"===this.parent.height&&(this.parent.height=this.parent.pageSettings.pageSize*this.parent.getRowHeight());var t=this.serviceLocator.getService("rendererFactory");this.parent.groupSettings.enableLazyLoading&&t.addRenderer(e.RenderType.Content,new jo(this.parent,this.serviceLocator))},t.prototype.destroy=function(){this.removeEventListener()},t}(),Go=function(){function e(e){this.parentObj=e}return e.prototype.create=function(e){var t=W(e.column.field);return this.parentObj.createElement("input",{className:"e-field",attrs:{id:this.parentObj.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.write=function(e){this.column=e.column;var r="Dialog"!==this.parentObj.editSettings.mode;this.object=new s.AutoComplete(t.extend({dataSource:this.parentObj.dataSource instanceof i.DataManager?this.parentObj.dataSource:new i.DataManager(this.parentObj.dataSource),query:(new i.Query).select(e.column.field),enabled:Q(e.column,e.requestType,e.element),fields:{value:e.column.field},value:ce(e.column.field,e.rowData),actionComplete:this.selectedValues.bind(this),placeholder:r?"":e.column.headerText,floatLabelType:r?"Never":"Always"},e.column.edit.params)),t.isBlazor()&&(this.object.locale=this.parentObj.locale),this.object.appendTo(e.element),e.element.setAttribute("name",W(e.column.field))},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.selectedValues=function(e){e.result=i.DataUtil.distinct(e.result,this.object.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)},e.prototype.destroy=function(){this.object&&this.object.destroy()},e}(),_o=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=W(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.write=function(e){this.column=e.column;var r="Dialog"!==this.parent.editSettings.mode;this.obj=new s.ComboBox(t.extend({dataSource:this.parent.dataSource instanceof i.DataManager?this.parent.dataSource:new i.DataManager(this.parent.dataSource),query:(new i.Query).select(e.column.field),fields:{value:e.column.field},value:ce(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.finalValue.bind(this),placeholder:r?"":e.column.headerText,floatLabelType:r?"Never":"Always",enabled:Q(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.finalValue=function(e){e.result=i.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Wo=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=W(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parent.editSettings.mode;this.obj=new s.MultiSelect(t.extend({fields:{text:e.column.field,value:e.column.field},value:t.getValue(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:i?"":e.column.headerText,popupHeight:"200px",floatLabelType:i?"Never":"Always"},e.column.edit.params)),this.obj.appendTo(e.element),e.element.setAttribute("name",W(e.column.field))},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Ko=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=W(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.write=function(e){var i="Dialog"!==this.parent.editSettings.mode,r=ce(e.column.field,e.rowData);r=r?new Date(r):null,this.obj=new l.TimePicker(t.extend({floatLabelType:i?"Never":"Always",value:r,placeholder:i?"":e.column.headerText,enableRtl:this.parent.enableRtl,enabled:Q(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Qo=function(){function e(e){this.activeClasses=["e-selectionbackground","e-active"],this.parent=e}return e.prototype.create=function(e){var t=e.column,i="e-field e-boolcell";"checkbox"===t.type&&(i="e-field e-boolcell e-edit-checkselect");var r=W(e.column.field);return this.parent.createElement("input",{className:i,attrs:{type:"checkbox",value:e.value,"e-mappinguid":t.uid,id:this.parent.element.id+r,name:r}})},e.prototype.read=function(e){return e.checked},e.prototype.write=function(e){var i,r;if(t.isNullOrUndefined(e.row)||(i=e.row.querySelector(".e-edit-checkselect")),ce(e.column.field,e.rowData)&&(r=JSON.parse(ce(e.column.field,e.rowData).toString().toLowerCase())),!t.isNullOrUndefined(i)){if(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType){var o=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));r=!!o&&o.isSelected}$.apply(void 0,[[].slice.call(e.row.querySelectorAll(".e-rowcell")),r].concat(this.activeClasses))}this.obj=new n.Switch(t.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:r,disabled:!Q(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.switchModeChange.bind(this)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.switchModeChange=function(e){if(this.editRow&&"Dialog"!==this.editType){var t=!1;e.checked?(t=!0,this.editRow.setAttribute("aria-selected",t.toString())):this.editRow.removeAttribute("aria-selected"),$.apply(void 0,[[].slice.call(this.editRow.querySelectorAll(".e-rowcell")),t].concat(this.activeClasses))}},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),Jo=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=W(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parent.editSettings.mode;this.obj=new o.MaskedTextBox(t.extend({fields:{value:e.column.field},value:ce(e.column.field,e.rowData),floatLabelType:i?"Never":"Always",mask:"000-000-0000",enabled:Q(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}();return Wr.Inject(Sn,hn,br,en,In,Fn,zn,Tn,En,Bn,Sr,Un,no,Rn,ao,ho,uo,fo,Io,To,oo,Mo,Dr,Ho,Vo),e.CheckBoxFilterBase=Yr,e.ExcelFilterBase=Zr,e.SortDescriptor=Br,e.SortSettings=kr,e.Predicate=Lr,e.InfiniteScrollSettings=Pr,e.FilterSettings=Nr,e.SelectionSettings=qr,e.SearchSettings=Hr,e.RowDropSettings=Ur,e.TextWrapSettings=jr,e.ResizeSettings=Vr,e.GroupSettings=Gr,e.EditSettings=_r,e.Grid=Wr,e.doesImplementInterface=u,e.valueAccessor=g,e.headerValueAccessor=f,e.getUpdateUsingRaf=m,e.isExportColumns=y,e.updateColumnTypeForExportColumns=v,e.updatecloneRow=C,e.getCollapsedRowsCount=w,e.recursive=b,e.iterateArrayOrObject=S,e.iterateExtend=x,e.templateCompiler=R,e.setStyleAndAttributes=F,e.extend=z,e.setColumnIndex=I,e.prepareColumns=T,e.setCssInGridPopUp=E,e.getActualProperties=D,e.parentsUntil=O,e.getElementIndex=A,e.inArray=B,e.getActualPropFromColl=k,e.removeElement=L,e.getPosition=P,e.getUid=N,e.appendChildren=q,e.parents=H,e.calculateAggregate=U,e.getScrollBarWidth=j,e.getRowHeight=V,e.getActualRowHeight=G,e.isComplexField=_,e.getComplexFieldID=W,e.setComplexFieldID=K,e.isEditable=Q,e.isActionPrevent=J,e.wrap=X,e.setFormatter=Y,e.addRemoveActiveClasses=$,e.distinctStringValues=Z,e.getFilterMenuPostion=ee,e.getZIndexCalcualtion=te,e.toogleCheckbox=ie,e.setChecked=re,e.createCboxWithWrap=ne,e.removeAddCboxClasses=oe,e.refreshForeignData=se,e.getForeignData=le,e.getColumnByForeignKeyValue=ae,e.getDatePredicate=he,e.renderMovable=de,e.isGroupAdaptive=pe,e.getObject=ce,e.getCustomDateFormat=ue,e.getExpandedState=ge,e.getPrintGridModel=fe,e.extendObjWithFn=me,e.measureColumnDepth=ve,e.checkDepth=Ce,e.refreshFilteredColsUid=we,e.getTransformValues=be,e.applyBiggerTheme=Se,e.alignFrozenEditForm=xe,e.ensureLastRow=Re,e.ensureFirstRow=Fe,e.isRowEnteredInGrid=ze,e.getEditedDataIndex=Ie,e.eventPromise=Te,e.getStateEventArgument=Ee,e.ispercentageWidth=Me,e.resetRowIndex=De,e.resetRowObjectIndex=Oe,e.compareChanges=Ae,e.setRowElements=Be,e.splitFrozenRowObjectCells=ke,e.gridActionHandler=Le,e.getGridRowObjects=Pe,e.getGridRowElements=Ne,e.sliceElements=qe,e.getCellsByTableName=He,e.getCellByColAndRowIndex=Ue,e.setValidationRuels=je,e.getMovableTbody=Ve,e.getFrozenRightTbody=Ge,e.setRowsInTbody=_e,e.getNumberFormat=We,e.addBiggerDialog=Ke,e.performComplexDataOperation=Qe,e.created="create",e.destroyed="destroy",e.load="load",e.rowDataBound="rowDataBound",e.queryCellInfo="queryCellInfo",e.headerCellInfo="headerCellInfo",e.actionBegin=yt,e.actionComplete=vt,e.actionFailure="actionFailure",e.dataBound=Ct,e.rowSelecting="rowSelecting",e.rowSelected="rowSelected",e.rowDeselecting="rowDeselecting",e.rowDeselected="rowDeselected",e.cellSelecting="cellSelecting",e.cellSelected="cellSelected",e.cellDeselecting="cellDeselecting",e.cellDeselected="cellDeselected",e.columnSelecting="columnSelecting",e.columnSelected="columnSelected",e.columnDeselecting="columnDeselecting",e.columnDeselected="columnDeselected",e.columnDragStart=wt,e.columnDrag=bt,e.columnDrop=St,e.rowDragStartHelper=xt,e.rowDragStart=Rt,e.rowDrag=Ft,e.rowDrop=zt,e.beforePrint="beforePrint",e.printComplete="printComplete",e.detailDataBound="detailDataBound",e.toolbarClick="toolbarClick",e.batchAdd="batchAdd",e.batchCancel="batchCancel",e.batchDelete="batchDelete",e.beforeBatchAdd="beforeBatchAdd",e.beforeBatchDelete="beforeBatchDelete",e.beforeBatchSave="beforeBatchSave",e.beginEdit="beginEdit",e.cellEdit="cellEdit",e.cellSave="cellSave",e.cellSaved="cellSaved",e.endAdd="endAdd",e.endDelete="endDelete",e.endEdit="endEdit",e.recordDoubleClick="recordDoubleClick",e.recordClick="recordClick",e.beforeDataBound="beforeDataBound",e.beforeOpenColumnChooser="beforeOpenColumnChooser",e.resizeStart="resizeStart",e.onResize="resizing",e.resizeStop="resizeStop",e.checkBoxChange="checkBoxChange",e.beforeCopy="beforeCopy",e.beforePaste="beforePaste",e.beforeAutoFill="beforeAutoFill",e.filterChoiceRequest="filterchoicerequest",e.filterAfterOpen="filterafteropen",e.filterBeforeOpen="filterbeforeopen",e.filterSearchBegin="filtersearchbegin",e.commandClick="commandClick",e.exportGroupCaption="exportGroupCaption",e.lazyLoadGroupExpand="lazyLoadGroupExpand",e.lazyLoadGroupCollapse="lazyLoadGroupCollapse",e.initialLoad=It,e.initialEnd=Tt,e.dataReady=Et,e.contentReady=Mt,e.uiUpdate=Dt,e.onEmpty=Ot,e.inBoundModelChanged=At,e.modelChanged=Bt,e.colGroupRefresh=kt,e.headerRefreshed=Lt,e.pageBegin="paging-begin",e.pageComplete="paging-complete",e.sortBegin="sorting-begin",e.sortComplete="sorting-complete",e.filterBegin="filtering-begin",e.filterComplete="filtering-complete",e.searchBegin="searching-begin",e.searchComplete="searching-complete",e.reorderBegin="reorder-begin",e.reorderComplete=Pt,e.rowDragAndDropBegin="rowdraganddrop-begin",e.rowDragAndDropComplete="rowdraganddrop-complete",e.groupBegin="grouping-begin",e.groupComplete="grouping-complete",e.ungroupBegin="ungrouping-begin",e.ungroupComplete="ungrouping-complete",e.groupAggregates="group-aggregates",e.refreshFooterRenderer="refresh-footer-rendered",e.refreshAggregateCell="refresh-aggregate-cell",e.refreshAggregates="refresh-aggregates",e.rowSelectionBegin="rowselecting",e.rowSelectionComplete="rowselected",e.columnSelectionBegin="columnselecting",e.columnSelectionComplete="columnselected",e.cellSelectionBegin="cellselecting",e.cellSelectionComplete="cellselected",e.beforeCellFocused=Nt,e.cellFocused="cellfocused",e.keyPressed=qt,e.click=Ht,e.destroy=Ut,e.columnVisibilityChanged=jt,e.scroll="scroll",e.columnWidthChanged="column-width-changed",e.columnPositionChanged=Vt,e.rowDragAndDrop="row-drag-and-drop",e.rowsAdded=Gt,e.rowsRemoved=_t,e.columnDragStop=Wt,e.headerDrop=Kt,e.dataSourceModified=Qt,e.refreshComplete="refresh-complete",e.refreshVirtualBlock=Jt,e.dblclick="dblclick",e.toolbarRefresh=Xt,e.bulkSave="bulk-save",e.autoCol=Yt,e.tooltipDestroy="tooltip-destroy",e.updateData=$t,e.editBegin="edit-begin",e.editComplete="edit-complete",e.addBegin="add-begin",e.addComplete="add-complete",e.saveComplete="save-complete",e.deleteBegin="delete-begin",e.deleteComplete="delete-complete",e.preventBatch=Zt,e.dialogDestroy=ei,e.crudAction="crud-Action",e.addDeleteAction=ti,e.destroyForm="destroy-form",e.doubleTap="double-tap",e.beforeExcelExport="beforeExcelExport",e.excelExportComplete="excelExportComplete",e.excelQueryCellInfo="excelQueryCellInfo",e.excelHeaderQueryCellInfo="excelHeaderQueryCellInfo",e.exportDetailDataBound="exportdetaildatabound",e.beforePdfExport="beforePdfExport",e.pdfExportComplete="pdfExportComplete",e.pdfQueryCellInfo="pdfQueryCellInfo",e.pdfHeaderQueryCellInfo="pdfHeaderQueryCellInfo",e.accessPredicate="access-predicate",e.contextMenuClick="contextMenuClick",e.freezeRender=ii,e.freezeRefresh="freezerefresh",e.contextMenuOpen="contextMenuOpen",e.columnMenuClick="columnMenuClick",e.columnMenuOpen="columnMenuOpen",e.filterOpen="filterOpen",e.filterDialogCreated="filterDialogCreated",e.filterMenuClose="filter-menu-close",e.initForeignKeyColumn="initForeignKeyColumn",e.getForeignKeyData="getForeignKeyData",e.generateQuery="generateQuery",e.showEmptyGrid="showEmptyGrid",e.foreignKeyData="foreignKeyData",e.columnDataStateChange="columnDataStateChange",e.dataStateChange="dataStateChange",e.dataSourceChanged="dataSourceChanged",e.rtlUpdated="rtl-updated",e.beforeFragAppend="beforeFragAppend",e.frozenHeight="frozenHeight",e.textWrapRefresh="textWrapRefresh",e.recordAdded="recordAdded",e.cancelBegin="cancel-Begin",e.editNextValCell="editNextValCell",e.hierarchyPrint=ri,e.expandChildGrid=ni,e.printGridInit="printGrid-Init",e.exportRowDataBound="export-RowDataBound",e.exportDataBound="export-DataBound",e.rowPositionChanged=oi,e.columnChooserOpened="columnChooserOpened",e.batchForm="batchedit-form",e.beforeStartEdit="edit-form",e.beforeBatchCancel="before-batch-cancel",e.batchEditFormRendered="batcheditform-rendered",e.partialRefresh="partial-refresh",e.beforeCustomFilterOpen="beforeCustomFilterOpen",e.selectVirtualRow="select-virtual-Row",e.columnsPrepared=si,e.cBoxFltrBegin="cbox-filter-begin",e.cBoxFltrComplete=li,e.fltrPrevent=ai,e.beforeFltrcMenuOpen="before-filter-cmenu-open",e.valCustomPlacement="validation-custom-placement",e.filterCboxValue="filter-cbox-value",e.componentRendered="component-rendered",e.restoreFocus="restore-Focus",e.detailStateChange="detail-state-change",e.detailIndentCellInfo="detail-indentcell-info",e.virtaulKeyHandler="virtaul-key-handler",e.virtaulCellFocus="virtaul-cell-focus",e.virtualScrollEditActionBegin="virtual-scroll-edit-action-begin",e.virtualScrollEditSuccess="virtual-scroll-edit-success",e.virtualScrollEditCancel="virtual-scroll-edit-cancel",e.virtualScrollEdit="virtual-scroll-edit",e.refreshVirtualCache="refresh-virtual-cache",e.editReset="edit-reset",e.virtualScrollAddActionBegin="virtual-scroll-add-action-begin",e.getVirtualData=hi,e.refreshInfiniteModeBlocks=di,e.resetInfiniteBlocks="reset-infinite-blocks",e.infiniteScrollHandler="infinite-scroll-handler",e.infinitePageQuery="infinite-page-query",e.infiniteShowHide="infinite-show-hide",e.appendInfiniteContent="append-infinite-content",e.removeInfiniteRows="remove-infinite-rows",e.setInfiniteCache="set-infinite-cache",e.infiniteEditHandler="infinite-edit-handler",e.initialCollapse="initial-collapse",e.getAggregateQuery="get-aggregate-query",e.closeFilterDialog="close-filter-dialog",e.columnChooserCancelBtnClick="columnChooserCancelBtnClick",e.getFilterBarOperator="get-filterbar-operator",e.resetColumns="reset-columns",e.pdfAggregateQueryCellInfo="pdfAggregateQueryCellInfo",e.excelAggregateQueryCellInfo="excelAggregateQueryCellInfo",e.setGroupCache="group-cache",e.lazyLoadScrollHandler="lazy-load-scroll-handler",e.groupCollapse="group-collapse",e.beforeCheckboxRenderer="beforeCheckboxRenderer",e.refreshHandlers=pi,e.refreshFrozenColumns="refresh-frozen-columns",e.setReorderDestinationElement="set-reorder-destination-element",e.refreshVirtualFrozenHeight="refresh-virtual-frozen-height",e.setFreezeSelection="set-freeze-selection",e.setInfiniteFrozenHeight="set-infinite-frozen-height",e.setInfiniteColFrozenHeight="set-infinite-col-frozen-height",e.beforeRefreshOnDataChange="before-refresh-on-data-change",e.immutableBatchCancel="immutable-batch-cancel",e.refreshVirtualFrozenRows="refresh-virtual-frozenrows",e.checkScrollReset="check-scroll-reset",e.refreshFrozenHeight="refresh-frozen-height",e.setHeightToFrozenElement="set-height-to-frozen-element",e.preventFrozenScrollRefresh="prevent-frozen-scroll-refresh",e.nextCellIndex="next-cell-index",e.refreshInfiniteCurrentViewData="refresh-infinite-current-view-data",e.infiniteCrudCancel="infinite-crud-cancel",e.filterDialogClose="filter-dialog-close",e.setCustomFilterHeader="set-custom-filter-header",e.refreshCustomFilterOkBtn="refresh-cutsom-filter-ok-button",e.refreshCustomFilterClearBtn="refresh-cutsom-filter-clear-button",e.renderResponsiveCmenu="render-responsive-cmenu",e.filterCmenuSelect="filter-cmenu-select",e.customFilterClose="custom-filter-close",e.setFullScreenDialog="set-fullscreen-dialog",e.refreshVirtualCacheOnRowDD="refresh-Virtual-Cache-On-RowDD",e.refreshExpandandCollapse="refresh-Expand-and-Collapse",e.rowModeChange="row-mode-change",e.enterKeyHandler="enter-key-handler",e.refreshVirtualMaxPage="refresh-virtual-max-page",e.selectRowOnContextOpen="select-row-on-context-open",e.Data=gi,e.Sort=en,e.Page=hn,e.Selection=br,e.Filter=Sn,e.Search=Sr,e.Scroll=Rr,e.resizeClassList=xn,e.Resize=Rn,e.Reorder=Fn,e.RowDD=zn,e.Group=In,e.getCloneProperties=c,e.Print=Kr,e.DetailRow=Tn,e.Toolbar=En,e.Aggregate=Bn,e.summaryIterator=Je,e.VirtualScroll=Un,e.Edit=no,e.BatchEdit=Zn,e.InlineEdit=$n,e.NormalEdit=Xn,e.DialogEdit=to,e.ColumnChooser=oo,e.ExcelExport=ao,e.PdfExport=ho,e.ExportHelper=so,e.ExportValueFormatter=lo,e.Clipboard=Er,e.CommandColumn=uo,e.CheckBoxFilter=Cn,e.menuClass=go,e.ContextMenu=fo,e.Freeze=Io,e.ColumnMenu=To,e.ExcelFilter=bn,e.ForeignKey=Mo,e.Logger=Lo,e.detailLists=Po,e.gridObserver=Mr,e.BlazorAction=Dr,e.InfiniteScroll=Ho,e.LazyLoadGroup=Vo,e.Column=ft,e.CommandColumnModel=mt,e.Row=fi,e.Cell=mi,e.HeaderRender=Ii,e.ContentRender=zi,e.RowRenderer=vi,e.CellRenderer=Ti,e.HeaderCellRenderer=Oi,e.FilterCellRenderer=cn,e.StackedHeaderCellRenderer=Bi,e.Render=$i,e.IndentCellRenderer=Li,e.GroupCaptionCellRenderer=Ni,e.GroupCaptionEmptyCellRenderer=qi,e.BatchEditRender=Vn,e.DialogEditRender=Gn,e.InlineEditRender=jn,e.EditRender=_n,e.BooleanEditCell=Wn,e.DefaultEditCell=Jn,e.DropDownEditCell=Kn,e.NumericEditCell=Qn,e.DatePickerEditCell=io,e.CommandColumnRenderer=co,e.FreezeContentRender=vo,e.FreezeRender=Co,e.StringFilterUI=gn,e.NumberFilterUI=fn,e.DateFilterUI=yn,e.BooleanFilterUI=mn,e.FlMenuOptrUI=un,e.AutoCompleteEditCell=Go,e.ComboboxEditCell=_o,e.MultiSelectEditCell=Wo,e.TimePickerEditCell=Ko,e.ToggleEditCell=Qo,e.MaskedTextBoxCellEdit=Jo,e.VirtualContentRenderer=Nn,e.VirtualHeaderRenderer=qn,e.VirtualElementHandler=Hn,e.GroupLazyLoadRenderer=jo,e.ColumnFreezeHeaderRenderer=bo,e.ColumnFreezeContentRenderer=So,e.ResponsiveDialogRenderer=er,e.CellRendererFactory=Zi,e.ServiceLocator=tr,e.RowModelGenerator=Ci,e.GroupModelGenerator=Fi,e.FreezeRowModelGenerator=mo,e.ValueFormatter=ut,e.VirtualRowModelGenerator=Ln,e.InterSectionObserver=kn,e.Pager=sn,e.ExternalMessage=an,e.NumericContainer=tn,e.PagerMessage=rn,e.PagerDropDown=ln,e}({},ej.base,ej.data,ej.popups,ej.buttons,ej.inputs,ej.dropdowns,ej.calendars,ej.navigations,ej.excelexport,ej.pdfexport),this.ejs=ej;