@syncfusion/ej2-grids 33.2.8 → 33.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* filename: ej2-grids.min.js
|
|
3
|
+
* version : 33.2.10
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2025. 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
|
+
*/
|
|
1
10
|
this.ej=this.ej||{},this.ej.grids=function(e,t,i,n,r,s,o,a,l,d,h){"use strict";function p(e,t,i,n){if(n&&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","enableHtmlSanitizer"]}function u(e,t){return e.prototype&&t in e.prototype}function g(e,n,r){return t.isNullOrUndefined(e)||""===e?"":i.DataUtil.getObject(e,n)}function f(e,n){return t.isNullOrUndefined(e)||""===e?"":i.DataUtil.getObject(e,n)}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,n=t.columns,r=0;r<i.length;r++)if(n.length-1>=r)if(n[parseInt(r.toString(),10)].columns)for(var s=0;s<n[parseInt(r.toString(),10)].columns.length;s++)i[parseInt(r.toString(),10)].columns[parseInt(s.toString(),10)].type=n[parseInt(r.toString(),10)].columns[parseInt(s.toString(),10)].type;else i[parseInt(r.toString(),10)].type=n[parseInt(r.toString(),10)].type}function S(e){for(var t=[],i=e.vRows,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].isDataRow?t.push(i[parseInt(n.toString(),10)]):i[parseInt(n.toString(),10)].isDataRow||(t.push(i[parseInt(n.toString(),10)]),!i[parseInt(n.toString(),10)].isExpand&&i[parseInt(n.toString(),10)].isCaptionRow&&(n+=C(i[parseInt(n.toString(),10)],e)));e.vcRows=t}function C(e,i){Xr=0;var n=i.groupSettings.columns.length,r=e.gSummary,s=0,o="aggregatesCount";if(r===e.data.count)return i.groupSettings.columns.length&&!t.isNullOrUndefined(e[""+o])&&e[""+o]?1!==i.groupSettings.columns.length?Xr+=0!==e.indent&&r<2?e.gSummary*(n-e.indent+(n-e.indent)*e[""+o]):e.gSummary*(n-e.indent+(n-e.indent-1)*e[""+o])+e[""+o]:1===i.groupSettings.columns.length&&(Xr+=e.gSummary*(n-e.indent)+e[""+o]):i.groupSettings.columns.length&&(1!==i.groupSettings.columns.length?Xr+=e.gSummary*(i.groupSettings.columns.length-e.indent):Xr+=e.gSummary),Xr;for(var a=0,l=e.data.items.length;a<l;a++){var d=e.data.items[parseInt(a.toString(),10)];Xr+=d.items.length+(n===i.columns.length||t.isNullOrUndefined(d.items.records)?0:d.items.records.length),s+=t.isNullOrUndefined(d.items.records)||t.isNullOrUndefined(e[""+o])?d.items.length:d.items.records.length,d.items.GroupGuid&&0!==d.items.childLevels&&w(d)}return Xr+=e.data.items.length,t.isNullOrUndefined(e[""+o])||e[""+o]&&Xr&&0!==s&&(Xr+=(Xr-s)*e[""+o]+e[""+o]),Xr}function w(e){for(var t=0,i=e.items.length;t<i;t++){var n=e.items[parseInt(t.toString(),10)];Xr+=n.count,0!==n.items.childLevels&&w(n)}}function b(e,i){for(var n=[],r=0,s=e.length;r<s;r++){var o=i(e[parseInt(r.toString(),10)],r);t.isNullOrUndefined(o)||n.push(o)}return n}function I(e){for(var i=[],n=0;n<e.length;n++)i.push(t.extend({},A(e[parseInt(n.toString(),10)]),{},!0));return i}function x(e){if(e)try{var i="<"!==e[0];return"function"==typeof e?t.compile(e):i&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}}function R(e,i){var n={},r=["style","class"];t.extend(n,i,{}),"style"in n&&(t.setStyleAttribute(e,n[r[0]]),delete n[r[0]]),"class"in n&&(t.addClass([e],n[r[1]]),delete n[r[1]]),t.attributes(e,n)}function D(e,i,n,r){for(var s=t.extend(e,i,n),o=Object.keys(s),a=0;a<o.length;a++)r&&-1!==r.indexOf(o[parseInt(a.toString(),10)])&&delete s[o[parseInt(a.toString(),10)]];return s}function T(e,i){void 0===i&&(i=0);for(var n=0,r=t.isNullOrUndefined(e)?0:e.length;n<r;n++)e[parseInt(n.toString(),10)].columns?(e[parseInt(n.toString(),10)].index=t.isNullOrUndefined(e[parseInt(n.toString(),10)].index)?i:e[parseInt(n.toString(),10)].index,i++,i=T(e[parseInt(n.toString(),10)].columns,i)):(e[parseInt(n.toString(),10)].index=t.isNullOrUndefined(e[parseInt(n.toString(),10)].index)?i:e[parseInt(n.toString(),10)].index,i++);return i}function E(e,i,n){for(var r=0,s=t.isNullOrUndefined(e)?0:e.length;r<s;r++){var o=void 0;"string"==typeof e[parseInt(r.toString(),10)]?o=new Pt({field:e[parseInt(r.toString(),10)]},n):e[parseInt(r.toString(),10)]instanceof Pt&&!e[parseInt(r.toString(),10)].columns?o=e[parseInt(r.toString(),10)]:e[parseInt(r.toString(),10)].columns?(e[parseInt(r.toString(),10)].columns=E(e[parseInt(r.toString(),10)].columns,null,n),o=new Pt(e[parseInt(r.toString(),10)],n)):o=new Pt(e[parseInt(r.toString(),10)],n),o.type&&"checkbox"===o.type.toLowerCase()&&(o.allowReordering=!1),o.headerText=t.isNullOrUndefined(o.headerText)?o.foreignKeyValue||o.field||"":o.headerText,o.foreignKeyField=o.foreignKeyField||o.field,o.valueAccessor=("string"==typeof o.valueAccessor?t.getValue(o.valueAccessor,window):o.valueAccessor)||g,o.headerValueAccessor="string"==typeof o.headerValueAccessor?t.getValue(o.headerValueAccessor,window):o.headerValueAccessor,o.width=i&&t.isNullOrUndefined(o.width)?200:o.width,t.isNullOrUndefined(o.visible)&&(o.visible=!0),e[parseInt(r.toString(),10)]=o}return e}function O(e,i,n){var r=e.querySelector("span"),s=e.parentElement.getBoundingClientRect(),o=i.target.getBoundingClientRect();r.className=n,e.style.display="";var a=(t.isNullOrUndefined(i.clientY)?i.changedTouches[0].clientY:i.clientY)>e.offsetHeight+10;e.style.top=o.top-s.top+(a?-(e.offsetHeight+10):e.offsetHeight+10)+"px",e.style.left=k(e,i,o,s.left)+"px",a?(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 k(e,t,i,n){var r=e.offsetWidth/2,s=B(t).x;return s-i.left<r?i.left-n:i.right-s<r?i.right-n-2*r:s-n-r}function A(e){return e instanceof t.ChildProperty?t.getValue("properties",e):e}function F(e,t,i){for(var n=e;n&&(i?n.id!==t:!n.classList.contains(t));)n=n.parentElement;return n}function M(e,t){for(var i=-1,n=0,r=t.length;n<r;n++)if(t[parseInt(n.toString(),10)].isEqualNode(e)){i=n;break}return i}function L(e,t){for(var i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)]===e)return i;return-1}function P(e){for(var t=[],i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].hasOwnProperty("properties")?t.push(e[parseInt(i.toString(),10)].properties):t.push(e[parseInt(i.toString(),10)]);return t}function N(e,i){for(var n=[].slice.call(e.querySelectorAll(i)),r=0;r<n.length;r++)t.remove(n[parseInt(r.toString(),10)])}function B(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 z(e){return e+Yr++}function q(e,t){for(var i=0,n=t.length;i<n;i++)n===t.length?e.appendChild(t[parseInt(i.toString(),10)]):e.appendChild(t[0]);return e}function U(e,t,i){for(var n=e,r=[];n;)(i?n.id===t:n.classList.contains(t))&&r.push(n),n=n.parentElement;return r}function H(e,n,r,s){if("Custom"===e){var o=r.customAggregate;return"string"==typeof o&&(o=t.getValue(o,window)),o?o.call(s,n,r):""}return r.field in n||n instanceof Array?i.DataUtil.aggregates[e.toLowerCase()](n,r.field):null}function j(e){if(null!==Jr&&!e)return Jr;var t=document.createElement("div"),i=0;return t.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(t),i=t.offsetWidth-t.clientWidth|0,document.body.removeChild(t),Jr=i}function V(e,i){if(i&&void 0!==Ui)return Ui;if(void 0!==qi)return qi;var n=t.createElement("table",{className:Ji,attrs:{role:"grid"}});n.style.visibility="hidden",n.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(n);var r=n.querySelector("td").getBoundingClientRect();return e.removeChild(n),Ui=r.height,qi=Math.ceil(r.height),i?Ui:qi}function G(e){var i=t.createElement("table",{className:Ji,attrs:{role:"grid"}});i.style.visibility="hidden",i.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(i);var n=i.querySelector("tr").getBoundingClientRect();return e.removeChild(i),n.height}function _(e){return e.split(".").length>1}function K(e){return void 0===e&&(e=""),e.replace(/\./g,"___")}function W(e){return void 0===e&&(e=""),e.replace(/[^a-zA-Z0-9_.]/g,"\\$&")}function Q(e){return void 0===e&&(e=""),e.replace(/___/g,".")}function X(e,t,i){var n=F(i,Zi),r=!n||n&&!n.classList.contains("e-insertedrow");return"beginEdit"===t&&r?!(e.isIdentity||e.isPrimaryKey||!e.allowEditing):("add"!==t||!e.isIdentity)&&!(r&&!e.allowEditing&&!e.isIdentity&&!e.isPrimaryKey)}function Y(e,t){return!(!t||!t.element||0!==t.element.offsetWidth)||0!==e.getBoundingClientRect().width}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||t.selectAll(".e-gridform.e-formvalidator",e.element).length)&&e.editSettings.showConfirmDialog&&(!i||i.classList.contains("e-popup-close"))}function Z(e,t){e=e instanceof Array?e:[e];for(var i=0;i<e.length;i++)t?e[parseInt(i.toString(),10)].classList.add("e-wrap"):e[parseInt(i.toString(),10)].classList.remove("e-wrap")}function $(e,t){var i,n=e.getService("valueFormatter");switch("date"!==t.type&&"datetime"!==t.type&&"dateonly"!==t.type||(i={type:"dateonly"===t.type?"date":t.type,skeleton:t.format},"string"==typeof t.format&&"yMd"!==t.format&&(i.format=t.format)),t.type){case"date":case"dateonly":case"datetime":t.setFormatter(n.getFormatFunction(i)),t.setParser(n.getParserFunction(i));break;case"number":t.setFormatter(n.getFormatFunction({format:t.format})),t.setParser(n.getParserFunction({format:t.format}))}}function ee(e,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];for(var s=0,o=e.length;s<o;s++){var a=e[parseInt(s.toString(),10)];i?(t.classList(a,n.slice(),[]),a.classList.contains("e-detailrowcollapse")||a.classList.contains("e-detailrowexpand")||a.setAttribute("aria-selected","true")):(t.classList(a,[],n.slice()),a.removeAttribute("aria-selected"))}}function te(e){for(var t={},i=[],n=0;n<e.length;n++)e[parseInt(n.toString(),10)]in t||(i.push(e[parseInt(n.toString(),10)].toString()),t[e[parseInt(n.toString(),10)]]=1);return i}function ie(e,t,i){var r=t.element.style.display;t.element.style.display="block";var s=t.width,o=n.calculateRelativeBasedPosition(e,t.element);t.element.style.display=r,t.element.style.top=o.top+e.getBoundingClientRect().height-5+"px";var a=o.left-s+e.clientWidth;if(i&&i.enableRtl){var l=i.element?i.element.clientWidth:0,d=e.getBoundingClientRect().right+s-l;t.element.style.left=d>1?a-4+"px":s+a-16+"px",parseInt(t.element.style.left,10)<0&&(t.element.style.left="0px")}else if(t.element.style.left=a<1?s+a-16+"px":a-4+"px",i&&i.element){var h=i.element.offsetWidth-parseInt(t.element.style.left,10);i.element.offsetWidth>=s&&h<s&&(t.element.style.left=i.element.offsetWidth-s+"px")}}function ne(e,t){e.popup.element.style.zIndex=(t.zIndex+1).toString()}function re(e,i,n,r,s,o){if(t.isNullOrUndefined(n.filterTemplate)){var a="";"string"===r?a="strui-"+i:"number"===r?a="numberui-"+i:"boolean"===r?a="bool-ui-"+i:"date"!==r&&"datetime"!==r||(a="dateui-"+i);var l="in"===e||"notin"===e,d=F(s.element.querySelector("#multiselect"+a),"e-control-wrapper"),h=F(s.element.querySelector("#"+a),"e-popup-flmenu");d&&(d.style.display=l?"inline-flex":"none"),h&&(h.style.display=l?"none":"inline-flex")}}function se(e){var i=e.querySelector(".e-frame"),n=i.previousSibling;i.classList.contains("e-check")?(n.checked=!1,t.classList(i,["e-uncheck"],["e-check"])):(n.checked=!0,t.classList(i,["e-check"],["e-uncheck"]))}function oe(e,t){e.checked=t}function ae(e,i,n){var r=t.createElement("div",{className:n});return r.appendChild(i),r.setAttribute("data-uid",e),r}function le(e,i){t.removeClass([e],["e-check","e-stop","e-uncheck"]),i?e.classList.add("e-check"):e.classList.add("e-uncheck")}function de(e,i,n){for(s=0;s<(t.isNullOrUndefined(i)?0:i.length);s++)t.setValue(i[parseInt(s.toString(),10)].field,he(i[parseInt(s.toString(),10)],n),e.foreignKeyData);for(var r=e.cells,s=0;s<r.length;s++)r[parseInt(s.toString(),10)].isForeignKey&&t.setValue("foreignKeyData",t.getValue(r[parseInt(s.toString(),10)].column.field,e.foreignKeyData),r[parseInt(s.toString(),10)])}function he(e,n,r,s){var o=e.foreignKeyField,a=t.isNullOrUndefined(r)?g(e.field,n):r;a=t.isNullOrUndefined(a)?"":a;var l=new i.Query,d=s||(e.dataSource instanceof i.DataManager&&e.dataSource.dataSource.json.length?e.dataSource.dataSource.json:e.columnData);return a.getDay?l.where(ue({field:o,operator:"equal",value:a,matchCase:!1})):l.where(o,"==",a,!1),new i.DataManager(d).executeLocal(l)}function pe(e,t){var i;return t.some(function(t){return i=t,t.foreignKeyValue===e})&&i}function ce(e){return e<10?"0"+e:String(e)}function ue(e,n){var r,s,o,a=t.extend({},A(e)),l=t.extend({},A(e));if(t.isNullOrUndefined(e.value)||""===e.value)return r=new i.Predicate(a.field,a.operator,a.value,!1);var d=new Date(e.value);if("dateonly"===n){if("string"==typeof a.value){var h=a.value.split(/[^0-9.]/);a.value=new Date(parseInt(h[0],10),parseInt(h[1],10)-1,parseInt(h[2],10))}var p=a.value.getFullYear()+"-"+ce(a.value.getMonth()+1)+"-"+ce(a.value.getDate());r=g=new i.Predicate(a.field,a.operator,p,!1)}else if(e.operator=e.operator.toLowerCase(),"equal"===e.operator||"notequal"===e.operator){"datetime"===n?(s=new Date(d.setSeconds(d.getSeconds()-1)),o=new Date(d.setSeconds(d.getSeconds()+2)),e.value=new Date(d.setSeconds(o.getSeconds()-1))):(s=new Date(d.setHours(0)-1),o=new Date(d.setHours(24))),a.value=s,l.value=o,"equal"===e.operator?(a.operator="greaterthan",l.operator="lessthan"):"notequal"===e.operator&&(a.operator="lessthanorequal",l.operator="greaterthanorequal");var c=new i.Predicate(a.field,a.operator,a.value,!1),u=new i.Predicate(l.field,l.operator,l.value,!1);r="equal"===e.operator?c.and(u):c.or(u)}else{"date"!==n||"lessthanorequal"!==e.operator&&"greaterthan"!==e.operator||(a.value=new Date(d.setHours(24)-1)),"string"==typeof a.value&&(a.value=new Date(a.value));var g=new i.Predicate(a.field,a.operator,a.value,!1);r=g}return e.setProperties?e.setProperties({ejpredicate:r},!0):e.ejpredicate=r,r}function ge(e){return e.enableVirtualization&&e.groupSettings.columns.length>0&&e.isVirtualAdaptive&&!e.groupSettings.enableLazyLoading}function fe(e,i){if(void 0===e&&(e=""),e){for(var n=i,r=e.split("."),s=0;s<r.length&&!t.isNullOrUndefined(n);s++)if(n=n[r[parseInt(s.toString(),10)]],t.isUndefined(n)){var o=r[parseInt(s.toString(),10)].charAt(0).toUpperCase()+r[parseInt(s.toString(),10)].slice(1);n=i[""+o]||i[(""+o).charAt(0).toLowerCase()+(""+o).slice(1)]}return n}}function me(e,i){var n=new t.Internationalization;return"date"===i?"object"==typeof e?n.getDatePattern({type:e.type?e.type:"date",format:e.format},!1):n.getDatePattern({type:"dateTime",skeleton:e},!1):"object"==typeof e?n.getDatePattern({type:e.type?e.type:"dateTime",format:e.format},!1):n.getDatePattern({type:"dateTime",skeleton:e},!1)}function ye(e,i){for(var n={},r=0,s=e.getRowsObject();r<s.length;r++){var o=s[r];if(o.isExpand&&!o.isDetailRow){var a=e.allowPaging&&"AllPages"===e.printMode?o.index+e.pageSettings.currentPage*e.pageSettings.pageSize-e.pageSettings.pageSize:o.index;t.isNullOrUndefined(a)||(n[parseInt(a.toString(),10)]={},n[parseInt(a.toString(),10)].isExpand=!0,e.childGrid&&(n[parseInt(a.toString(),10)].gridModel=ve(o.childGrid,i),n[parseInt(a.toString(),10)].gridModel.query=e.childGrid.query))}}return n}function ve(e,t){void 0===t&&(t="Expanded");var i={};if(!e)return i;for(var n=0,r=Qr.printGridProp;n<r.length;n++){var s=r[n];i[""+s]="columns"===s?P(e[""+s]):"allowPaging"===s?"CurrentPage"===e.printMode:A(e[""+s])}return i.enableHover=!1,(e.childGrid||e.detailTemplate)&&"None"!==t&&(i.expandedRows=ye(e,t)),i}function Se(e,i,n,r){var s=e||{},o=arguments.length;r&&(o-=1);for(var a=1;a<o;a++)if(arguments[parseInt(a.toString(),10)])for(var l=arguments[parseInt(a.toString(),10)],d=Object.keys(Object.getPrototypeOf(l)).length?Object.keys(l).concat(Ce(l)):Object.keys(l),h=0;h<d.length;h++){var p=s[d[parseInt(h.toString(),10)]],c=l[d[parseInt(h.toString(),10)]],u=void 0;r&&(t.isObject(c)||Array.isArray(c))?t.isObject(c)?(u=p||{},s[d[parseInt(h.toString(),10)]]=t.extend({},u,c,r)):(u=p||[],s[d[parseInt(h.toString(),10)]]=t.extend([],u,c,r)):s[d[parseInt(h.toString(),10)]]=c}return s}function Ce(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 we(e){for(var i=0,n=0;n<(t.isNullOrUndefined(e)?0:e.length);n++){var r=be(e[parseInt(n.toString(),10)],0);i<r&&(i=r)}return i+1}function be(e,t){var i=t,n=[];if(e.columns){t++;for(var r=0;r<e.columns.length;r++)n[parseInt(r.toString(),10)]=be(e.columns[parseInt(r.toString(),10)],t);for(var s=0;s<n.length;s++)i<n[parseInt(s.toString(),10)]&&(i=n[parseInt(s.toString(),10)]);t=i}return t}function Ie(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].uid=t[parseInt(i.toString(),10)].isForeignKey?pe(t[parseInt(i.toString(),10)].field,e.getForeignKeyColumns()).uid:e.enableColumnVirtualization?ht(e,t[parseInt(i.toString(),10)].field).uid:e.getColumnByField(t[parseInt(i.toString(),10)].field).uid}function xe(e){var t=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace(/,/g,"");return{width:parseFloat(t.split(" ")[4]),height:parseFloat(t.split(" ")[5])}}function Re(e,t){e.classList.contains("e-bigger")&&t.classList.add("e-bigger")}function De(e){var t=e.getContent().firstElementChild;return t.scrollWidth>t.offsetWidth?j():0}function Te(e,t){var i=0,n=e.getColumns(),r=30*t;e.isRowDragable()&&(i++,r+=30),i+=e.groupSettings.columns.length-t,r+=30*(e.groupSettings.columns.length-t);for(var s=("auto"===e.width?e.element.offsetWidth:-1!==e.width.toString().indexOf("%")?e.element.getBoundingClientRect().width:parseInt(e.width.toString(),10))-De(e),o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].visible&&(r+=Oe(n[parseInt(o.toString(),10)],e),i++),r>s){i--;break}return i}function Ee(e,t){for(var i=0,n=0,r=t.getVisibleFrozenLeftCount(),s=0;s<e.childNodes.length;s++){var o=e.childNodes[parseInt(s.toString(),10)];if(r===n)break;if((o.classList.contains("e-groupcaption")||o.classList.contains("e-summarycell"))&&(n+=parseInt(o.getAttribute("colspan"),10)),o.classList.add("e-leftfreeze"),o.classList.contains("e-groupcaption")&&1===parseInt(o.getAttribute("colspan"),10)&&o.classList.add("e-freezeleftborder"),Ye(o,i,t.enableRtl,"Left"),(o.classList.contains("e-indentcell")||o.classList.contains("e-recordplusexpand")||o.classList.contains("e-recordpluscollapse"))&&(i+=30),o.classList.contains("e-groupcaption")){var a=parseInt(o.getAttribute("colspan"),10);t.isRowDragable()&&(a--,i+=30),a-=t.groupSettings.columns.length-s,i+=30*(t.groupSettings.columns.length-s);for(var l=t.getColumns(),d=0;d<l.length;d++){if(parseInt(o.getAttribute("colspan"),10)>1&&Oe(l[parseInt(d.toString(),10)],t)+i>parseInt(t.width.toString(),10)-De(t)){var h=Te(t,s);o.setAttribute("colspan",h.toString());break}if(l[parseInt(d.toString(),10)].visible&&(i+=Oe(l[parseInt(d.toString(),10)],t),a--),0===a)break}}if(o.classList.contains("e-summarycell")){var p=o.getAttribute("data-mappinguid");i+=Oe(t.getColumnByUid(p),t)}}}function Oe(e,i){if(t.isNullOrUndefined(e.width)||"auto"===e.width||-1!==e.width.toString().indexOf("%")){var n=i.getColumnHeaderByField(e.field);return t.isNullOrUndefined(n)?0:n.getBoundingClientRect().width}return parseInt(e.width.toString(),10)}function ke(e,t){var i=t.getContent().firstElementChild;return e&&e.getBoundingClientRect().top-i.getBoundingClientRect().top+t.getRowHeight()>i.offsetHeight}function Ae(e,t){return e&&e.getBoundingClientRect().top<t}function Fe(e,t){var i=t.getRowHeight(),n=t.getContent().firstElementChild.scrollTop/i;return e<n+t.getContent().firstElementChild.offsetHeight/i&&e>n}function Me(e,t){var i,n=e.getPrimaryKeyFieldNames()[0];return e.getCurrentViewRecords().filter(function(e,r){n.includes(".")?fe(n,e)===fe(n,t)&&(i=r):e[""+n]===t[""+n]&&(i=r)}),i}function Le(e,t){var n=Pe(t),r=new i.Deferred;return n.dataSource=r.resolve,n.action=e,{state:n,deffered:r}}function Pe(e){var t=new i.UrlAdaptor,n=new i.DataManager({url:"",adaptor:new i.UrlAdaptor}),r=t.processQuery(n,e);return JSON.parse(r.data)}function Ne(e){for(var i=e.getVisibleColumns(),n=0,r=0,s=0;s<i.length;s++)t.isUndefined(i[parseInt(s.toString(),10)].width)?r++:-1!==i[parseInt(s.toString(),10)].width.toString().indexOf("%")&&n++;return("auto"===e.width||"string"==typeof e.width&&-1!==e.width.indexOf("%"))&&!e.groupSettings.showGroupedColumn&&e.groupSettings.columns.length&&n&&!r}function Be(e,t,i,n,r){for(var s=n||0,o=r||0;o<t.length;o++)if(t[parseInt(o.toString(),10)]&&t[parseInt(o.toString(),10)].isDataRow){t[parseInt(o.toString(),10)].index=s,t[parseInt(o.toString(),10)].isAltRow=!!e.enableAltRow&&s%2!=0,i[parseInt(o.toString(),10)].setAttribute(an,(s+1).toString()),t[parseInt(o.toString(),10)].isAltRow?i[parseInt(o.toString(),10)].classList.add("e-altrow"):i[parseInt(o.toString(),10)].classList.remove("e-altrow");for(var a=0;a<i[parseInt(o.toString(),10)].cells.length;a++)i[parseInt(o.toString(),10)].cells[parseInt(a.toString(),10)].setAttribute("data-index",s.toString());s++}t.length||e.renderModule.emptyRow(!0)}function ze(e){for(var i=e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache?e.getRowsObject():e.vRows,n=e.getRows(),r=0,s=0,o=0;r<i.length;r++){var a=i[parseInt(r.toString(),10)];if(a.isDataRow){a.index=s,a.isAltRow=!!e.enableAltRow&&s%2!=0;var l=e.getRowElementByUID(a.uid);if(!t.isNullOrUndefined(l)){n[parseInt(o.toString(),10)]=l,l.setAttribute(an,(s+1).toString()),a.isAltRow?l.classList.add("e-altrow"):l.classList.remove("e-altrow");for(var d=0;d<l.cells.length;d++)l.cells[parseInt(d.toString(),10)].setAttribute("data-index",s.toString());o++}s++}}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(i)}function qe(e,i,n,r){for(var s,o=e.enableVirtualization?e.vRows:e.getRowsObject(),a=[],l=r||e.getRowObjectFromUID(i.target.closest("tr").getAttribute("data-uid")),d=0;d<i.rows.length;d++){var h=e.getRowObjectFromUID(i.rows[parseInt(d.toString(),10)].getAttribute("data-uid"));l===h&&(s=o.indexOf(l)),a.push(o.splice(o.indexOf(h),1)[0])}if(t.isNullOrUndefined(s)?(s=o.indexOf(l),i.fromIndex>i.dropIndex?o.splice.apply(o,[s,0].concat(a)):o.splice.apply(o,[s+1,0].concat(a))):o.splice.apply(o,[s,0].concat(a)),!e.enableVirtualization&&!e.infiniteScrollSettings.enableCache){for(var p={},c=e.getCurrentViewRecords(),d=0,u=n.length;d<u;d++){var g=parseInt(n[parseInt(d.toString(),10)].getAttribute(an),10)-1;p[parseInt(d.toString(),10)]=c[parseInt(g.toString(),10)]}for(var f=e.getRows(),d=0,u=n.length;d<u;d++)f[parseInt(d.toString(),10)]=n[parseInt(d.toString(),10)],c[parseInt(d.toString(),10)]=p[parseInt(d.toString(),10)]}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(o)}function Ue(e,t,i,n){var r=e.dataToBeUpdated[""+i].concat(t[""+i]).reduce(function(e,t){return e[t[""+n]]=void 0===e[t[""+n]]?t:Object.assign(e[t[""+n]],t),e},{});e.dataToBeUpdated[""+i]=Object.keys(r).map(function(e){return r[""+e]})}function He(e){if(e.enableInfiniteScrolling&&(e.childGrid||e.detailTemplate))return void(e.contentModule.rowElements=[].slice.call(e.getContentTable().rows).filter(function(e){return(e.classList.contains("e-row")||e.classList.contains("e-detailrow"))&&!e.classList.contains("e-addedrow")}));e.contentModule.rowElements=[].slice.call(e.element.querySelectorAll(".e-row:not(.e-addedrow):not(.e-cloneproperties .e-row)"))}function je(e,t,i){for(var n=e.children.length,r=0,s=0;s<n;s++,r++)s>=t&&s<i||(e.removeChild(e.children[parseInt(r.toString(),10)]),r--)}function Ve(e,t){Ge(e)&&(t.target=e.element.closest("mat-dialog-container"))}function Ge(e){return e&&e.isAngular&&e.element&&!t.isNullOrUndefined(e.element.closest("mat-dialog-container"))}function _e(e,i,r){var s=e.createElement("div",{className:"e-grid-popup",id:e.element.id+"_e-popup"}),o=n.calculatePosition(e.element,"left","Top");document.getElementById(e.element.id+"_e-popup")&&(s=document.getElementById(e.element.id+"_e-popup")),s.style.top=o.top+"px",s.style.left=o.left+"px",s.style.zIndex=i.zIndex.toString(),s.style.width=t.isNullOrUndefined(r)?i.element.offsetWidth+"px":r+"px",s.appendChild(i.element);var a=document.querySelector(".sb-demo-section,.e-grid-dialog-fixed");if(a){var l=n.calculateRelativeBasedPosition(e.element,a);s.style.top=l.top+"px",s.style.left=l.left+"px",a.insertBefore(s,a.firstChild)}else if(Ge(e)){var d=e.element.closest("mat-dialog-container");d&&d.insertBefore(s,d.firstChild)}else document.body.insertBefore(s,document.body.firstChild)}function Ke(e,t){var i=[];return i.push(e.uid),We(e,i),i.indexOf(t)>-1}function We(e,t){for(var i=0;i<e.columns.length;i++)e.columns[parseInt(i.toString(),10)].uid&&t.push(e.columns[parseInt(i.toString(),10)].uid),e.columns[parseInt(i.toString(),10)].columns&&e.columns[parseInt(i.toString(),10)].columns.length&&We(e.columns[parseInt(i.toString(),10)],t)}function Qe(e){return e.columns[0].freeze||e.columns[0].isFrozen?"Left"===e.columns[0].freeze||e.columns[0].isFrozen?"Left":"Right"===e.columns[0].freeze?"Right":"Fixed"===e.columns[0].freeze?"Fixed":"None":e.columns[0].columns&&e.columns[0].columns.length?Qe(e.columns[0]):"None"}function Xe(e){if(e.querySelector(".e-fixedfreeze"))for(var t=[].slice.call(e.querySelectorAll(".e-filterbarcell:not(.e-hide),.e-summarycell:not(.e-hide),.e-headercell:not(.e-hide),.e-rowcell:not(.e-hide)")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.contains("e-fixedfreeze")&&(!t[i-1]||t[i-1]&&!t[i-1].classList.contains("e-fixedfreeze"))&&t[parseInt(i.toString(),10)].classList.add("e-freezeleftborder"),t[parseInt(i.toString(),10)].classList.contains("e-fixedfreeze")&&(!t[i+1]||t[i+1]&&!t[i+1].classList.contains("e-fixedfreeze"))&&t[parseInt(i.toString(),10)].classList.add("e-freezerightborder")}function Ye(e,t,i,n){"Left"===n&&(i?e.style.right=t+"px":e.style.left=t+"px"),"Right"===n&&(i?e.style.left=t+"px":e.style.right=t+"px")}function Je(e,t,i,n){var r=e.getColumns(),s=t.index;if("Left"===t.freeze&&"Left"!==t.border){for(var o=s+(n-1);!1===r[parseInt(o.toString(),10)].visible;)o++;"Left"===r[parseInt(o.toString(),10)].border&&i.classList.add("e-freezeleftborder")}else if("Right"===t.freeze||"Fixed"===t.freeze){for(var a=0,l=s+1;l<s+n&&l!==r.length;l++)r[parseInt(l.toString(),10)].visible?a+=parseInt(r[parseInt(l.toString(),10)].width.toString(),10):n++;e.enableRtl?i.style.left=parseInt(i.style.left,10)-a+"px":i.style.right=parseInt(i.style.right,10)-a+"px"}}function Ze(e,t,i){for(var n=e.getRowByIndex(t),r=0;r<n.cells.length;r++)if(parseInt(n.cells[parseInt(r.toString(),10)].getAttribute("aria-colindex").toString(),10)-1===i)return n.cells[parseInt(r.toString(),10)];return null}function $e(e,t,i){if("Left"===t.freeze||t.isFrozen)if(i.classList.add("e-leftfreeze"),"Left"===t.border&&i.classList.add("e-freezeleftborder"),0===t.index)Ye(i,30*e.getIndentCount(),e.enableRtl,"Left"),e.enableColumnVirtualization&&(t.valueX=30*e.getIndentCount());else{for(var n=e.getColumns(),r=30*e.getIndentCount(),s=0;s<n.length&&t.uid!==n[parseInt(s.toString(),10)].uid;s++)n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));Ye(i,r,e.enableRtl,"Left"),e.enableColumnVirtualization&&(t.valueX=r)}else if("Right"===t.freeze){i.classList.add("e-rightfreeze");n=e.getColumns();if("Right"===t.border&&i.classList.add("e-freezerightborder"),t.index===n[n.length-1].index)Ye(i,r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0,e.enableRtl,"Right"),e.enableColumnVirtualization&&(t.valueX=r);else{for(var r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0,s=n.length-1;s>=0&&t.uid!==n[parseInt(s.toString(),10)].uid;s--)n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));Ye(i,r,e.enableRtl,"Right"),e.enableColumnVirtualization&&(t.valueX=r)}}else if("Fixed"===t.freeze){i.classList.add("e-fixedfreeze");var n=e.getColumns(),r=0;e.getVisibleFrozenLeftCount()?r=30*e.getIndentCount():"Right"===e.getFrozenMode()&&(r=30*e.groupSettings.columns.length);for(s=0;s<n.length&&t.uid!==n[parseInt(s.toString(),10)].uid;s++)("Left"===n[parseInt(s.toString(),10)].freeze||n[parseInt(s.toString(),10)].isFrozen||"Fixed"===n[parseInt(s.toString(),10)].freeze)&&n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));Ye(i,r-1,e.enableRtl,"Left"),r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0;for(s=n.length-1;s>=0&&t.uid!==n[parseInt(s.toString(),10)].uid;s--)"Right"!==n[parseInt(s.toString(),10)].freeze&&"Fixed"!==n[parseInt(s.toString(),10)].freeze||n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));Ye(i,r-1,e.enableRtl,"Right")}else i.classList.add("e-unfreeze")}function et(e,t,i){var n={rowIndex:i,elements:null};return e.notify("get-row-cells",n),n.elements?n.elements:[].slice.call(e.getDataRows()[parseInt(i.toString(),10)].getElementsByClassName(_i))}function tt(e,t,i,n){return et(e,t,i)[parseInt(n.toString(),10)]}function it(e,t,i,n,r,s,o){o?i[K(e.field)]=e.validationRules:e.getFreezeTableName()===sn||!t&&e.getFreezeTableName()===rn||1===s?i[K(e.field)]=e.validationRules:"movable"!==e.getFreezeTableName()&&e.getFreezeTableName()?e.getFreezeTableName()===rn&&(r[K(e.field)]=e.validationRules):n[K(e.field)]=e.validationRules}function nt(e,i,n,r){var s,o=new t.Internationalization;if("number"===i)try{s=o.getNumberPattern({format:e,currency:r,useGrouping:!0},!0)}catch(t){s=e}else if("date"===i||"time"===i||"datetime"===i)try{if(s=o.getDatePattern({skeleton:e,type:i},n),t.isNullOrUndefined(s))throw"error"}catch(t){try{s=o.getDatePattern({format:e,type:i},n)}catch(t){s=e}}else s=e;if("number"!==i){var a={G:"",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"};s=s.replace(/G|H|c|'| a|yy|y|EEEE|E/g,function(e){return a[""+e]})}return s}function rt(e){if(e.enableAdaptiveUI)for(var t=document.getElementsByClassName("e-responsive-dialog"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.add("e-bigger")}function st(e,t){for(var i,n=e.split(".").length,r=e.split("."),s=t,o=0;o<n;o++)s=i=s[r[parseInt(o.toString(),10)]];return i}function ot(e,i,n,r,s,o){for(var a=Object.keys(e),l=i,d=0;d<a.length;d++){var h=e[a[parseInt(d.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)];if(s&&!s.isFrozenGrid()&&!s.isRowDragable()){if(h=!t.isNullOrUndefined(h)&&(parseInt(h.getAttribute("aria-colindex"),10)-1===i||F(h,"e-addedrow")&&h.parentElement.childNodes[parseInt(i.toString(),10)]===h)?h:e[parseInt(d.toString(),10)].querySelector('td[aria-colindex="'+(i+1)+'"]'),t.isNullOrUndefined(h))continue;i=s.getContentTable().querySelector(".e-detailrowcollapse, .e-detailrowexpand")?h.cellIndex-1:h.cellIndex}if(e[a[parseInt(d.toString(),10)]].querySelectorAll("td.e-rowcell").length&&h){if(t.setStyleAttribute(e[a[parseInt(d.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)],{display:n}),e[a[parseInt(d.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)].classList.contains("e-hide")&&t.removeClass([e[a[parseInt(d.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)]],["e-hide"]),o&&s.isRowDragable()||s&&s.isDetail()){var p=i+1;r[a[parseInt(d.toString(),10)]].cells[parseInt(p.toString(),10)].visible=""===n}else t.isNullOrUndefined(r[a[parseInt(d.toString(),10)]])||(r[a[parseInt(d.toString(),10)]].cells[parseInt(i.toString(),10)].visible=""===n,!1===r[a[parseInt(d.toString(),10)]].cells[parseInt(i.toString(),10)].visible&&e[a[parseInt(d.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)].classList.add("e-hide"));i=l}}}function at(e,t,i,n){for(var r=0,s=t;r<s.length;r++){var o=s[r];i?e.on(o.event,o.handler,n):e.off(o.event,o.handler)}}function lt(e,t,i,n){var r=K(t.field);return n=Object.assign(n,{id:e.element.id+r,name:r,"data-mappinguid":t.uid}),e.createElement("input",{className:i,attrs:n})}function dt(e,t){for(var i,n=0,r=e.columnModel;n<r.length;n++){var s=r[n];if(s.uid===t){i=s;break}}return i}function ht(e,t){var i;e.columnModel||e.getColumns();for(var n=0,r=e.columnModel;n<r.length;n++){var s=r[n];if(s.field===t){i=s;break}}return i}function pt(e,t,i,n){n.eventHandlers[""+e]={};for(var r=0;r<t.length;r++)n.eventHandlers[""+e][t[parseInt(r.toString(),10)]]=i[t[parseInt(r.toString(),10)]]}function ct(e,t,i){for(var n=0;n<t.length&&!e.isDestroyed;n++)e.removeEventListener(t[parseInt(n.toString(),10)],i.eventHandlers[e.element.id][t[parseInt(n.toString(),10)]])}function ut(e,t,i){e.destroyTemplate(t,void 0,i),e.isReact&&e.renderTemplates()}function gt(e){for(var i=0;i<e.length;i++)t.remove(e[i])}function ft(e,t){for(var i=0;i<e.length;i++)t.insertBefore(e[i],t.children[i])}function mt(e,i){var n=i?t.createElement("li",{className:"e-cclist"}):t.createElement("div",{className:"e-ftrchk"});n.style.visibility="hidden",i&&(n.style.listStyle="none"),n.innerHTML=i?'<div class="e-ccheck"><div class="e-checkbox-wrapper"><span class="e-frame e-icons e-check"></span><span class="e-label">A</span></div></div>':'<div class="e-checkbox-wrapper"><span class="e-frame e-icons e-check"></span><span class="e-label e-checkboxfiltertext">A</div></span>',e.appendChild(n);var r=n.getBoundingClientRect();return e.removeChild(n),Math.round(r.height)}function yt(e){return parseInt(e.getAttribute(an),10)-1}function vt(e){return e.parentDetails&&e.parentDetails.parentInstObj?vt(e.parentDetails.parentInstObj):e}function St(e,i,n){for(var r=[],s=0;s<e.length;s++){var o=n.parent.getColumnByField(e[parseInt(s.toString(),10)]),a="null"===i[parseInt(s.toString(),10)]?null:i[parseInt(s.toString(),10)],l={field:e[parseInt(s.toString(),10)],predicate:"or",uid:o.uid,operator:"equal",type:o.type,matchCase:n.allowCaseSensitive,ignoreAccent:n.parent.filterSettings.ignoreAccent};""===a||t.isNullOrUndefined(a)?r=r.concat($r.generateNullValuePredicates(l)):r.push(D({},{value:a},l))}return $r.getPredicate(r)}function Ct(e){for(var t=[],i=0,n=Object.keys(e);i<n.length;i++){var r=n[i];t.push(e[""+r])}return t}function wt(e,t){for(var i=[],n=[],r=e;r>=0&&(!t[parseInt(r.toString(),10)].isCaptionRow||-1!==i.indexOf(t[parseInt(r.toString(),10)].data.field)||!(t[parseInt(r.toString(),10)].indent<t[parseInt(e.toString(),10)].indent||r===e)||(i.push(t[parseInt(r.toString(),10)].data.field),n.push(t[parseInt(r.toString(),10)].data.key),0!==t[parseInt(r.toString(),10)].indent));r--);return{fields:i,keys:n}}function bt(e,t,i){var n=e,r=t,s=!1;if(i)for(l=r[0];l<n.length;l++)for(var o=n[parseInt(l.toString(),10)],a=0;a<o.length;a++){if(s&&1===n[parseInt(l.toString(),10)][parseInt(a.toString(),10)])return r=[l,a];s||r.toString()!==[l,a].toString()||(s=!0)}else for(var l=r[0];l>=0;l--)for(a=(o=n[parseInt(l.toString(),10)]).length-1;a>=0;a--){if(s&&1===n[parseInt(l.toString(),10)][parseInt(a.toString(),10)])return r=[l,a];s||r.toString()!==[l,a].toString()||(s=!0)}return r}function It(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xt(e){return!(ge(e)||e.groupSettings.enableLazyLoading||!e.enableVirtualization&&e.enableColumnVirtualization)}function Rt(e){for(var t=[],i=0;i<e.length;i++){var n=Math.ceil(e[parseInt(i.toString(),10)]/2);-1===t.indexOf(n)&&t.push(n)}return t}function Dt(e){if(e.isTreeGrid){var t=e.getDataModule().dataManager.executeLocal(e.getDataModule().generateQuery(!0));return e.notify("partial-filter-update",{gridFiltered:t}),e.root.filterModule&&e.root.filterModule.filteredResult.length>0?e.root.filterModule.filteredResult:t}return e.getDataModule().dataManager.executeLocal(e.getDataModule().generateQuery(!0))}function Tt(){return Zr}function Et(e){Zr=e}function Ot(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].columns.length;n++)t(e[parseInt(i.toString(),10)].columns[parseInt(n.toString(),10)],e[parseInt(i.toString(),10)])}function kt(e,t,i,n,r){var s="Dialog"!==t,o=me(e.column.format,e.column.type),a=fe(e.column.field,e.rowData);return a=a?new Date(a):null,{floatLabelType:s?"Never":"Always",value:a,format:o,placeholder:s?"":e.column.headerText,enableRtl:i,enabled:X(e.column,e.requestType,e.element)&&Y(F(e.element,"e-rowcell"),r&&r.parent?r.parent:null),cssClass:n||null,close:At.bind(r)}}function At(e){e.event&&"escape"===e.event.action&&(this.edit.editCellDialogClose=!0)}var Ft=function(){function e(e){this.intl=new t.Internationalization,t.isNullOrUndefined(e)||(this.intl.culture=e)}return e.prototype.getFormatFunction=function(e){return t.isNullOrUndefined(e)||"dateTime"!==e.type&&"datetime"!==e.type&&"date"!==e.type&&"time"!==e.type?this.intl.getNumberFormat(e):this.intl.getDateFormat(e)},e.prototype.getParserFunction=function(e){return e.type?this.intl.getDateParser(e):this.intl.getNumberParser(e)},e.prototype.fromView=function(e,i,n){return"date"!==n&&"datetime"!==n&&"number"!==n||t.isNullOrUndefined(i)||t.isNullOrUndefined(e)?e:i(e)},e.prototype.toView=function(e,i){var n=e;return t.isNullOrUndefined(i)||t.isNullOrUndefined(e)||(n=i(e)),n},e.prototype.setCulture=function(e){t.isNullOrUndefined(e)||t.setCulture(e)},e}(),Mt=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Lt=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},Pt=function(){function e(e,n){var r=this;this.disableHtmlEncode=!0,this.enableRowSpan=!0,this.enableColumnSpan=!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 r.editTemplateFn},this.getFilterTemplate=function(){return r.filterTemplateFn},this.templateOptions={enableAriaLabel:!0},t.merge(this,e),this.parent=n,"none"===this.type?this.type=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=z("grid-column"));var s=new Ft;if(e.format&&(e.format.skeleton||e.format.format&&"string"==typeof e.format.format)&&(this.setFormatter(s.getFormatFunction(t.extend({},e.format))),this.setParser(s.getParserFunction(e.format))),this.toJSON=function(){for(var e={},t=["filter","dataSource","headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate","parent"],i=Object.keys(r),n=0;n<i.length;n++)if("columns"===i[parseInt(n.toString(),10)]){e[i[parseInt(n.toString(),10)]]=[];for(var s=0;s<r[i[parseInt(n.toString(),10)]].length;s++)e[i[parseInt(n.toString(),10)]].push(r[i[parseInt(n.toString(),10)]][parseInt(s.toString(),10)].toJSON())}else t.indexOf(i[parseInt(n.toString(),10)])<0&&(e[i[parseInt(n.toString(),10)]]=r[i[parseInt(n.toString(),10)]]);return e},this.field||(this.allowFiltering=!1,this.allowGrouping=!1,this.allowSorting=!1,this.enableColumnSpan=!1,this.enableRowSpan=!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=x(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=x(this.headerTemplate)),!t.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=x(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=x(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=x(this.filterTemplate)),this.isForeignColumn()&&(t.isNullOrUndefined(this.editType)||"dropdownedit"===this.editType||"defaultedit"===this.editType)&&(this.editType="dropdownedit",this.edit.params&&this.edit.params.dataSource&&(this.edit.params.ddEditedData=!0),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 o=this.sortComparer;this.sortComparer=function(e,t,i,n){if("string"==typeof o&&(o=fe(o,window)),"Descending"===r.sortDirection){var s=e;e=t,t=s;var a=i;i=n,n=a}return o(e,t,i,n)}}!this.sortComparer&&this.isForeignColumn()&&(this.sortComparer=function(e,t){return e=fe(r.foreignKeyValue,he(r,{},e)[0]),t=fe(r.foreignKeyValue,he(r,{},t)[0]),"Descending"===r.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=this,n=0;n<t.length;n++)!function(n){if("columns"===t[parseInt(n.toString(),10)])for(var r=e[t[parseInt(n.toString(),10)]],s=0;s<r.length;s++)!function(e){i.columns.find(function(t){return t.field===r[parseInt(e.toString(),10)].field}).setProperties(r[parseInt(e.toString(),10)])}(s);else i[t[parseInt(n.toString(),10)]]=e[t[parseInt(n.toString(),10)]];i.parent&&i.parent.isReact&&("template"===t[parseInt(n.toString(),10)]?(i.templateFn=x(e[t[parseInt(n.toString(),10)]]),i.parent.refreshReactColumnTemplateByUid(i.uid,!0)):"headerTemplate"===t[parseInt(n.toString(),10)]?(i.headerTemplateFn=x(e[t[parseInt(n.toString(),10)]]),i.parent.refreshReactHeaderTemplateByUid(i.uid)):"editTemplate"===t[parseInt(n.toString(),10)]?i.editTemplateFn=x(e[t[parseInt(n.toString(),10)]]):"filterTemplate"===t[parseInt(n.toString(),10)]?i.filterTemplateFn=x(e[t[parseInt(n.toString(),10)]]):"commandsTemplate"===t[parseInt(n.toString(),10)]&&(i.templateFn=x(e[t[parseInt(n.toString(),10)]])))}(n)},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}(),Nt=function(){function e(){}return Lt([t.Property()],e.prototype,"title",void 0),Lt([t.Property()],e.prototype,"type",void 0),Lt([t.Property()],e.prototype,"buttonOption",void 0),e}(),Bt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Mt(i,e),Lt([t.Property(null)],i.prototype,"columns",void 0),i}(Pt),zt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Mt(t,e),t}(Bt),qt="actionBegin",Ut="actionComplete",Ht="actionFailure",jt="dataBound",Vt="columnDragStart",Gt="columnDrag",_t="columnDrop",Kt="rowDragStartHelper",Wt="rowDragStart",Qt="rowDrag",Xt="rowDrop",Yt="initial-load",Jt="initial-end",Zt="data-ready",$t="content-ready",ei="ui-update",ti="on-empty",ii="inbound-model-changed",ni="model-changed",ri="colgroup-refresh",si="header-refreshed",oi="reorder-complete",ai="rowdraganddrop-complete",li="beforecellfocused",di="key-pressed",hi="click",pi="destroy",ci="column-visible-changed",ui="column-position-changed",gi="rows-added",fi="rows-removed",mi="column-drag-stop",yi="header-drop",vi="datasource-modified",Si="refresh-virtual-block",Ci="auto-col",wi="update-data",bi="prevent-batch",Ii="dialog-destroy",xi="add-delete-Action",Ri="freezerender",Di="filter-menu-close",Ti="cancel-Begin",Ei="hierarchyprint",Oi="row-position-changed",ki="columns-prepared",Ai="cbox-filter-complete",Fi="filter-Prevent",Mi="refresh-infinite-mode-blocks",Li="refreshResizeHandlers",Pi="refresh-cutsom-filter-ok-button",Ni="commandColumnDestroy",Bi="render-Responsive-Change-Action",zi="show-Add-New-Row-Focus";!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[e.isColMenu=4]="isColMenu",e[e.isColumnChooser=5]="isColumnChooser"}(e.ResponsiveDialogAction||(e.ResponsiveDialogAction={})),function(e){e[e.isInitial=0]="isInitial",e[e.isSearch=1]="isSearch"}(e.ResponsiveToolbarAction||(e.ResponsiveToolbarAction={}));var qi,Ui,Hi=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(gi,this.addRows,this),this.parent.on(Oi,this.reorderRows,this),this.parent.on(fi,this.removeRows,this),this.parent.on(vi,this.initDataManager,this),this.parent.on(pi,this.destroy,this),this.parent.on(wi,this.crudActions,this),this.parent.on(xi,this.getData,this),this.parent.on(Ci,this.refreshFilteredCols,this),this.parent.on(ki,this.refreshFilteredCols,this))}return e.prototype.reorderRows=function(e){this.parent.isRemote()?this.parent.getCurrentViewRecords().splice(e.toIndex,0,this.parent.getCurrentViewRecords().splice(e.fromIndex,1)[0]):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 instanceof i.Query||(e.query=new i.Query)):e.setProperties({query:new i.Query},!0)},e.prototype.generateQuery=function(e,n){var r=this.parent,s=t.isNullOrUndefined(r.getQuery())?new i.Query:r.getQuery().clone();if("ExcludeHidden"===this.parent.columnQueryMode)s.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 o=[],a=this.parent.columns,l=0;l<a.length;l++)o.push(a[parseInt(l.toString(),10)].field);s.select(o)}return this.filterQuery(s),this.searchQuery(s),this.aggregateQuery(s),this.sortQuery(s),ge(this.parent)?this.virtualGroupPageQuery(s):this.pageQuery(s,e),!t.isNullOrUndefined(n)&&n||this.groupQuery(s),s},e.prototype.pinnedDataQuery=function(e){return this.filterQuery(e),this.searchQuery(e),this.sortQuery(e),e},e.prototype.aggregateQuery=function(e){for(var t=this.parent.aggregates,i=0;i<t.length;i++)for(var n=t[parseInt(i.toString(),10)],r=0;r<n.columns.length;r++)for(var s=n.columns[parseInt(r.toString(),10)],o=s.type instanceof Array?s.type:[s.type],a=0;a<o.length;a++)e.aggregate(o[parseInt(a.toString(),10)].toLowerCase(),s.field);return e},e.prototype.virtualGroupPageQuery=function(e){if(e.queries.length)for(var t=0;t<e.queries.length;t++)"onPage"===e.queries[parseInt(t.toString(),10)].fn&&e.queries.splice(t,1);return e},e.prototype.pageQuery=function(e,n){var r=this.parent;if(n)return e;var s={query:e,skipPage:!1};if(r.notify("set-virtual-page-query",s),s.skipPage)return e;if((r.allowPaging||r.enableVirtualization||r.enableInfiniteScrolling)&&!0!==n){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 o=0;o<e.queries.length;o++)"onPage"===e.queries[parseInt(o.toString(),10)].fn&&e.queries.splice(o,1);!t.isNullOrUndefined(r.infiniteScrollModule)&&r.enableInfiniteScrolling?this.parent.notify("infinite-page-query",e):e.page(r.pageSettings.currentPage,!(r.allowPaging&&r.pagerModule&&r.pagerModule.pagerObj.isAllPage)||r.isManualRefresh||this.dataManager.dataSource.offline||this.dataManager.adaptor instanceof i.RemoteSaveAdaptor?r.pageSettings.pageSize:null)}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,n=0,r=i.length;n<r;n++){var s=this.getColumnByField(i[parseInt(n.toString(),10)]);s||this.parent.log("initial_action",{moduleName:"group",columnName:i[parseInt(n.toString(),10)]});var o=s.enableGroupByFormat,a=s.format;o?e.group(i[parseInt(n.toString(),10)],this.formatGroupColumn.bind(this),a):e.group(i[parseInt(n.toString(),10)],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,n=[],r=i.length-1;r>-1;r--){if(!(a=this.getColumnByField(i[parseInt(r.toString(),10)].field)))return this.parent.log("initial_action",{moduleName:"sort",columnName:i[parseInt(r.toString(),10)].field}),e;a.setSortDirection(i[parseInt(r.toString(),10)].direction);var s=i[parseInt(r.toString(),10)].direction;a.sortComparer&&(s=a.sortComparer.bind(a)),-1===t.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field)?a.isForeignColumn()||a.sortComparer?e.sortByForeignKey(a.field,s,void 0,i[parseInt(r.toString(),10)].direction.toLowerCase(),a.foreignKeyValue):e.sortBy(a.field,s):n.push({direction:s,field:a.field})}for(var r=0,o=n.length;r<o;r++)if("string"==typeof n[parseInt(r.toString(),10)].direction)e.sortBy(n[parseInt(r.toString(),10)].field,n[parseInt(r.toString(),10)].direction);else{var a=this.getColumnByField(n[parseInt(r.toString(),10)].field);e.sortByForeignKey(n[parseInt(r.toString(),10)].field,n[parseInt(r.toString(),10)].direction,void 0,a.getSortDirection().toLowerCase(),a.foreignKeyValue)}}return e},e.prototype.searchQuery=function(e,n,r){var s=this.parent.searchSettings,o=!t.isNullOrUndefined(s.fields)&&s.fields.length?s.fields:this.getSearchColumnFieldNames(),a=[],l=!1;if(!t.isNullOrUndefined(this.parent.searchSettings.key)&&this.parent.searchSettings.key.length){l=this.parent.getForeignKeyColumns().some(function(e){return o.indexOf(e.field)>-1});var d=r?n.dataSource.adaptor:this.dataManager.adaptor;if(l||d.getModuleName&&"ODataV4Adaptor"===d.getModuleName()){o=r?[n.foreignKeyValue]:o;for(var h=0;h<o.length;h++){var p=r?n:this.getColumnByField(o[parseInt(h.toString(),10)]);p.isForeignColumn()&&!r?a=this.fGeneratePredicate(p,a):a.push(new i.Predicate(o[parseInt(h.toString(),10)],s.operator,s.key,s.ignoreCase,s.ignoreAccent))}var c=i.Predicate.or(a);c.key=s.key,e.where(c)}else e.search(s.key,o,s.operator,s.ignoreCase,s.ignoreAccent)}return e},e.prototype.filterQuery=function(e,n,r){var s,o=this.parent,a=[],l=this.parent.getForeignKeyColumns();if(o.allowFiltering&&o.filterSettings.columns.length){for(var d=n||o.filterSettings.columns,h={},p=0,c=o.getColumns();p<c.length;p++)h[(R=c[p]).field]=R.filter.type?R.filter.type:o.filterSettings.type;for(var u=[],g=[],f=0,m=d;f<m.length;f++){var y=(R=m[f]).isForeignKey?o.getColumnByUid(R.uid):o.getColumnByField(R.field);t.isNullOrUndefined(R.type)&&y&&("date"===y.type||"datetime"===y.type||"dateonly"===y.type)&&(R.type=R.isForeignKey?o.getColumnByUid(R.uid).type:o.getColumnByField(R.field).type),R.isForeignKey?u.push(R):g.push(R)}if(g.length){for(var v=0,S=g.length;v<S;v++)g[parseInt(v.toString(),10)].uid=g[parseInt(v.toString(),10)].uid||this.parent.grabColumnByFieldFromAllCols(g[parseInt(v.toString(),10)].field,g[parseInt(v.toString(),10)].isForeignKey).uid;for(var C=$r.getPredicate(g),w=0,b=Object.keys(C);w<b.length;w++){O=b[w];a.push(C[""+O])}}if(u.length)for(var I=0,x=u;I<x.length;I++){var R=x[I];R.uid=R.uid||this.parent.grabColumnByFieldFromAllCols(R.field,R.isForeignKey).uid;var D=this.parent.grabColumnByUidFromAllCols(R.uid);if(D||this.parent.log("initial_action",{moduleName:"filter",columnName:R.field}),D.isForeignColumn()&&pe(R.field,l)&&!r)D.columnData.length||(s=!0),a=this.fGeneratePredicate(D,a);else for(var C=$r.getPredicate(d),T=0,E=Object.keys(C);T<E.length;T++){var O=E[T];a.push(C[""+O])}}a.length&&!s?e.where(i.Predicate.and(a)):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 n=this;void 0===e&&(e={requestType:""});var r=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,r).promise;var s=void 0;switch(e.requestType){case"delete":if(i=i||this.generateQuery(),1===Object.keys(e.data).length)s=this.dataManager.remove(r,e.data[0],i.fromTable,i);else{var o={addedRecords:[],deletedRecords:[],changedRecords:[]};o.deletedRecords=e.data,s=this.dataManager.saveChanges(o,r,i.fromTable,i.requiresCount())}break;case"save":i=i||this.generateQuery(),e.index=t.isNullOrUndefined(e.index)?0:e.index,s=this.dataManager.insert(e.data,i.fromTable,i,e.index)}return e.promise=s,!s||Array.isArray(s)||s.hasOwnProperty("deletedRecords")?this.insert(i,e):s.then(function(){return n.insert(i,e)})},e.prototype.insert=function(e,t){return"save"===t.requestType&&(t.query=e,this.parent.notify("recordAdded",t)),this.executeQuery(e)},e.prototype.executeQuery=function(e){var t=this;if(this.dataManager.ready){var n=new i.Deferred;return this.dataManager.ready.then(function(){t.dataManager.executeQuery(e).then(function(e){n.resolve(e)})}).catch(function(e){n.reject(e)}),n.promise}return this.dataManager.executeQuery(e)},e.prototype.formatGroupColumn=function(e,i){var n=this.serviceLocator,r=this.getColumnByField(i),s=e;return r.type||(r.type=s.getDay?s.getHours()>0||s.getMinutes()>0||s.getSeconds()>0||s.getMilliseconds()>0?"datetime":"date":typeof e),t.isNullOrUndefined(r.getFormatter())&&$(n,r),Ft.prototype.toView(e,r.getFormatter())},e.prototype.crudActions=function(e){var t=this.generateQuery(),i=null,n="promise",r=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,t,r),e.requestType){case"save":i=this.dataManager.update(r,e.data,t.fromTable,t,e.previousData)}e[""+n]=i||e[""+n],this.parent.notify("crud-Action",e)},e.prototype.saveChanges=function(e,t,n,r){if(void 0===r&&(r=this.generateQuery()),r.requiresCount(),"result"in this.parent.dataSource){var s=new i.Deferred,o={requestType:"batchsave",changes:e,key:t,query:r,endEdit:s.resolve};return this.setState({isPending:!0,resolver:s.resolve}),this.parent.trigger("dataSourceChanged",o),s.promise}return this.dataManager.saveChanges(e,t,r.fromTable,r,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.clearCache=function(){this.isRemote()&&this.parent.dataSource.clearCache()},e.prototype.addRows=function(e){for(var n=e.records.length;n>0;n--)this.parent.dataSource instanceof i.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[n-1]):this.parent.getDataModule().isRemote()||t.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||this.parent.dataSource.splice(e.toIndex,0,e.records[n-1])},e.prototype.removeRows=function(e){var n=this.dataManager.dataSource.json;this.parent.dataSource instanceof i.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json=n.filter(function(t){return-1===e.records.indexOf(t)}):this.parent.getDataModule().isRemote()||t.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||(this.parent.dataSource=n.filter(function(t){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(gi,this.addRows),this.parent.off(fi,this.removeRows),this.parent.off(vi,this.initDataManager),this.parent.off(pi,this.destroy),this.parent.off(wi,this.crudActions),this.parent.off(xi,this.getData),this.parent.off(Ci,this.refreshFilteredCols),this.parent.off(ki,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 n=new i.UrlAdaptor,r=new i.DataManager({url:"",adaptor:new i.UrlAdaptor}),s=n.processQuery(r,e),o=JSON.parse(s.data);return t.extend(o,s.pvtData)},e.prototype.eventPromise=function(e,t,n){var r=this,s=e,o=this.getStateEventArgument(t),a=new i.Deferred,l=new i.Deferred;if((void 0!==e.requestType||this.parent.groupSettings.disablePageWiseAggregates&&t.queries.some(function(e){return"onGroup"===e.fn}))&&!1!==this.dataState.isDataChanged)if(o.action=e,"save"===e.requestType||"delete"===e.requestType||"batchsave"===e.requestType){var d=e;d.key=n;d.promise=l.promise,d.state=o,this.setState({isPending:!0,resolver:l.resolve}),s.endEdit=l.resolve,s.cancelEdit=l.reject,this.parent.trigger("dataSourceChanged",d),l.promise.then(function(){r.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),"save"===d.requestType&&r.parent.notify("recordAdded",d),r.parent.trigger("dataStateChange",o)}).catch(function(){})}else this.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),this.parent.trigger("dataStateChange",o);else this.setState({}),a.resolve(this.parent.dataSource);return a},e.prototype.getSearchColumnFieldNames=function(){for(var e=[],i=0,n=this.parent.getColumns();i<n.length;i++){var r=n[i];r.allowSearching&&!t.isNullOrUndefined(r.field)&&e.push(r.field)}return e},e.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&Ie(this.parent,this.parent.filterSettings.columns)},e}(),ji=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],n=this.data[""+i];this.parent.setCellValue(n,e,t),this.makechanges(i,this.data)}},e.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)},e}(),Vi=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}(),Gi=function(){function i(e,t){this.serviceLocator=e,this.parent=t}return i.prototype.render=function(i,n,r,s){var o,a=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(n.cells[parseInt(r.toString(),10)].cellType||e.CellType.Data),l=n.cells[parseInt(r.toString(),10)].cellSpan?n.cells[parseInt(r.toString(),10)].cellSpan:i.colSpan?i.colSpan+r<=n.cells.length?i.colSpan:n.cells.length-r:1,d=i.rowSpan,h=0;if(n.index>this.parent.pinnedTopRecords.length){var p=n.index-this.parent.pinnedTopRecords.length,c=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),u=this.parent.groupSettings.columns.length>0&&!c[parseInt(p.toString(),10)-1].isDataRow?c[parseInt(p.toString(),10)].cells:c[parseInt(p.toString(),10)-1].cells,g=n.cells[parseInt(r.toString(),10)];o=u.filter(function(e){return e.column.uid===g.column.uid})[0]}for(var f=o&&o.colSpanRange>1&&o.rowSpanRange>1?o.colSpanRange:l,m=r+1;m<r+f&&m<n.cells.length;m++)!1===n.cells[parseInt(m.toString(),10)].visible?h++:n.cells[parseInt(m.toString(),10)].isSpanned=!0;if(h>0){for(m=r+l;m<r+l+h&&m<n.cells.length;m++)n.cells[parseInt(m.toString(),10)].isSpanned=!0;r+l+h>=n.cells.length&&(l-=r+l+h-n.cells.length)}if(n.cells[parseInt(r.toString(),10)].cellSpan){n.data[i.column.field]=n.cells[parseInt(r.toString(),10)].spanText;p=n.index-this.parent.pinnedTopRecords.length;s=a.render(n.cells[parseInt(r.toString(),10)],n.data,{index:t.isNullOrUndefined(p)?"":p.toString()})}return l>1&&t.attributes(s,{colSpan:l.toString(),"aria-colSpan":l.toString()}),d>1&&(t.attributes(s,{rowspan:d.toString(),"aria-rowspan":d.toString()}),n.cells[parseInt(r.toString(),10)].isRowSpanned=!0,n.cells[parseInt(r.toString(),10)].rowSpanRange=Number(d),l>1&&(n.cells[parseInt(r.toString(),10)].colSpanRange=Number(l))),n.index>this.parent.pinnedTopRecords.length&&o.rowSpanRange>1&&(n.cells[parseInt(r.toString(),10)].isSpanned=!0,n.cells[parseInt(r.toString(),10)].rowSpanRange=Number(o.rowSpanRange-1),n.cells[parseInt(r.toString(),10)].colSpanRange=o.rowSpanRange>0?o.colSpanRange:1),!this.parent.enableColumnVirtualization||n.cells[parseInt(r.toString(),10)].cellSpan||this.containsKey(i.column.field,i.data[i.column.field])||this.backupMergeCells(i.column.field,i.data[i.column.field],i.colSpan),s},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,n=Object.keys(t);i<n.length;i++){var r=n[i],s=t[""+r],o=this.splitKey(r),a=this.getIndexFromAllColumns(o[0]),l=this.parent.getColumnIndexesInView(),d=s-(l[0]-a);if(a<l[0]&&d>1)for(var h=0,p=e;h<p.length;h++){var c=p[h];if(c.data[o[0]].toString()===o[1].toString()){c.cells[0].cellSpan=d,c.cells[0].spanText=o[1];break}}}return e},i.prototype.getIndexFromAllColumns=function(e){return b(this.parent.getVisibleColumns(),function(t,i){if(t.field===e)return i})[0]},i}(),_i="e-rowcell",Ki="e-gridheader",Wi="e-gridcontent",Qi="e-gridfooter",Xi="e-headercontent",Yi="e-content",Ji="e-table",Zi="e-row",$i="e-gridchkbox",en="e-editedrow",tn="e-addedrow",nn="Left-Right",rn="frozen-right",sn="frozen-left",on="aria-colindex",an="aria-rowindex",ln="tbody",dn="colgroup",hn="open",pn="downArrow",cn="upArrow",un="enter",gn="shiftEnter",fn=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,n,r){return this.refreshRow(e,t,i,n,r)},i.prototype.refresh=function(e,t,i,n,r){var s=this;i&&(e.data=Se({},e.changes),this.refreshMergeCells(e));var o=this.parent.element.querySelector("[data-uid="+e.uid+"]"),a=this.refreshRow(e,t,n,r,null,i);o.classList.contains("e-grid-pin-row")&&a.classList.add("e-grid-pin-row"),i&&Xe(a);var l=[].slice.call(a.cells),d=[].slice.call(o.querySelectorAll(".e-templatecell"));if(this.parent.isReact&&d.length)for(var h=0,p=t;h<p.length&&"break"!==function(e){if(e.template)return setTimeout(function(){s.parent.refreshReactColumnTemplateByUid(e.uid,!0)},0),"break"}(p[h]);h++);[].slice.call(a.attributes).map(function(e){o.setAttribute(e.name,e.value)}),o.innerHTML="";for(var c=0,u=l;c<u.length;c++){var g=u[c];o.appendChild(g)}},i.prototype.refreshRow=function(i,n,r,s,o,a){var l=t.isNullOrUndefined(o)?this.element.cloneNode():o,d={data:i.data},h={data:i.data},p=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],c=!1,u=this.parent.isFrozenGrid(),g=!0;p&&(c=fe(p.field,d.data));var f=this.parent.getSelectedRowIndexes();if(i.isDataRow){var m=this.parent.getPrimaryKeyFieldNames()[0];i.isSelected=this.parent.isPersistSelection&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?!t.isNullOrUndefined(this.parent.selectionModule.selectedRowState[i.data[""+m]]):f.indexOf(i.index)>-1||c}var y=this.parent.currentViewData;i.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.parent.allowPaging&&this.parent.selectionModule&&this.parent.selectionModule.isPartialSelection)&&(i.isSelected=!0,-1===f.indexOf(i.index)&&f.push(i.index)),this.buildAttributeFromRow(l,i),t.attributes(l,t.extend({},r,{})),R(l,i.attributes);for(var v=this.serviceLocator.getService("cellRendererFactory"),S=this,C=0,w=i.cells.length;C<w;C++)!function(n,r){var s=i.cells[parseInt(n.toString(),10)];s.isSelected=i.isSelected,s.isColumnSelected=s.column.isSelected;var o=v.getCellRenderer(i.cells[parseInt(n.toString(),10)].cellType||e.CellType.Data),d={"data-index":t.isNullOrUndefined(i.index)?"":i.index.toString()};i.isExpand&&i.cells[parseInt(n.toString(),10)].cellType===e.CellType.DetailExpand&&(d.class=S.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand");var p=!S.parent.enableRtl&&g&&("Vertical"===S.parent.gridLines||"Both"===S.parent.gridLines),c=o.render(i.cells[parseInt(n.toString(),10)],i.data,d,i.isExpand,a);if(i.cells[parseInt(n.toString(),10)].cellType!==e.CellType.Filter){if(i.cells[parseInt(n.toString(),10)].cellType===e.CellType.Data||i.cells[parseInt(n.toString(),10)].cellType===e.CellType.CommandColumn){s.visible&&p&&(S.parent.groupSettings&&S.parent.groupSettings.columns.length?c.classList.add("e-grid-group-first-cell"):S.parent.renderModule&&S.parent.renderModule.isFirstColumnHidden&&!(S.parent.allowRowDragAndDrop||S.parent.childGrid||S.parent.detailTemplate)&&c.classList.add("e-first-visible-cell"),g=!1);var f=S.parent.parentDetails&&S.parent.parentDetails.parentInstObj&&S.parent.parentDetails.parentInstObj.isReact,m=S.parent.printGridParent&&S.parent.printGridParent.isReact;if((S.parent.isReact&&S.parent.requireTemplateRef||f&&S.parent.parentDetails.parentInstObj.requireTemplateRef||m&&S.parent.printGridParent.requireTemplateRef)&&s.isTemplate){var C=S;C.parent.renderTemplates(function(){if("string"!=typeof s.column.template){var e=c.getAttribute("aria-label");c.setAttribute("aria-label",c.innerText+e)}C.parent.trigger("queryCellInfo",t.extend(h,{cell:c,column:s.column,colSpan:1,rowSpan:1,foreignKeyData:i.cells[parseInt(n.toString(),10)].foreignKeyData,requestType:C.parent.requestTypeAction}))})}else S.parent.trigger("queryCellInfo",t.extend(h,{cell:c,column:s.column,colSpan:1,rowSpan:1,foreignKeyData:i.cells[parseInt(n.toString(),10)].foreignKeyData,requestType:S.parent.requestTypeAction}));if(!(S.parent.enableVirtualization||S.parent.enableColumnVirtualization||S.parent.enableInfiniteScrolling||S.parent.allowGrouping&&S.parent.groupSettings.columns.length&&S.parent.groupSettings.enableLazyLoading||i.index<S.parent.pinnedTopRecords.length)){var w="field",b=["date","datetime","dateonly"];if(i.isDataRow&&S.parent.enableColumnSpan&&s.column.enableColumnSpan&&!s.isSpanned&&s.visible&&!s.isTemplate&&""!==i.data[s.column[""+w]]&&!s.isForeignKey){var I=1,x=o.getValue(s.column[""+w],i.data,s.column);-1!==b.indexOf(s.column.type)&&!t.isNullOrUndefined(x)&&x instanceof Date&&(x=x.getTime());for(U=n;U<i.cells.length-1;U++){var R=i.cells[parseInt(U.toString(),10)+1],D=o.getValue(R.column[""+w],i.data,R.column);if(-1!==b.indexOf(R.column.type)&&!t.isNullOrUndefined(D)&&D instanceof Date&&(D=D.getTime()),x!==D||!R.visible||!R.column.enableColumnSpan||R.isForeignKey)break;I++}h.colSpan=I}if(i.isDataRow&&S.parent.enableRowSpan&&s.column.enableRowSpan&&!s.isSpanned&&!s.isTemplate&&s.visible&&""!==i.data[s.column[""+w]]&&!s.isForeignKey){var T=i.index-S.parent.pinnedTopRecords.length,E=S.parent.groupSettings.columns.length?i.groupDataIndex:T;i.isDataRow&&S.parent.groupSettings.columns.length&&!t.isNullOrUndefined(i.parentUid)&&(y=S.parent.getRowObjectFromUID(i.parentUid).data.items);var O=1,x=o.getValue(s.column[""+w],i.data,s.column);-1!==b.indexOf(s.column.type)&&!t.isNullOrUndefined(x)&&x instanceof Date&&(x=x.getTime());for(U=E+1;U<y.length;U++){var k=o.getValue(s.column[""+w],y[parseInt(U.toString(),10)],s.column);if(-1!==b.indexOf(s.column.type)&&!t.isNullOrUndefined(k)&&k instanceof Date&&(k=k.getTime()),x!==k)break;O++}h.rowSpan=O}}var A=!1;if(i.index>S.parent.pinnedTopRecords.length&&(S.isSpan||S.parent.isSpan&&a)){var T=i.index-S.parent.pinnedTopRecords.length,F=S.parent.getRowsObject().filter(function(e){return e.isDataRow});A=(_=(G=S.parent.groupSettings.columns.length>0&&!F[T-1].isDataRow?F[parseInt(T.toString(),10)].cells:F[parseInt(T.toString(),10)-1].cells).filter(function(e){return e.column.uid===i.cells[parseInt(n.toString(),10)].column.uid})[0]).isRowSpanned?_.isRowSpanned:_.rowSpanRange>1}if((h.rowSpan>1||h.colSpan>1)&&i.index>=S.parent.pinnedTopRecords.length){T=i.index-S.parent.pinnedTopRecords.length;if(S.resetrowSpanvalue(S.parent.frozenRows>T?S.parent.frozenRows:y.length,h,T),!1===h.column.visible)h.colSpan=1;else if(u){var M=S.parent.getColumns(),L=S.parent.getFrozenRightColumnsCount(),P=S.parent.getFrozenLeftCount(),N=M.length-L,B=h.column.index;if(P>B&&P<B+h.colSpan){z=B+h.colSpan-P;h.colSpan=h.colSpan-z}else if(N<=B&&M.length<B+h.colSpan){z=B+h.colSpan-M.length;h.colSpan=h.colSpan-z}else if("Fixed"===h.column.freeze){for(var z=1,q=B,U=q+1;U<q+h.colSpan&&"Fixed"===M[parseInt(U.toString(),10)].freeze;U++)z++;h.colSpan=z}else if(N>B&&N<B+h.colSpan){z=B+h.colSpan-N;h.colSpan=h.colSpan-z}}}if((h.colSpan>1||i.cells[parseInt(n.toString(),10)].cellSpan>1||h.rowSpan>1||A)&&i.index>=S.parent.pinnedTopRecords.length){S.parent.isSpan=!0,S.isSpan=!0;j=new Gi(S.serviceLocator,S.parent);c=j.render(h,i,n,c),u&&Je(S.parent,h.column,c,h.colSpan)}}if((s.cellType===e.CellType.Header||s.cellType===e.CellType.StackedHeader)&&p&&(s.visible||s.cellType===e.CellType.StackedHeader)){var H=S.parent.getVisibleColumns(),w="field";(s.column.type&&"checkbox"===s.column.type||s.cellType===e.CellType.Header&&s.column[""+w]&&H.length&&H[0].field===s.column[""+w]||s.cellType===e.CellType.StackedHeader)&&(S.parent.groupSettings&&S.parent.groupSettings.columns.length?c.classList.add("e-grid-group-first-cell"):S.parent.renderModule&&S.parent.renderModule.isFirstColumnHidden&&!(S.parent.allowRowDragAndDrop||S.parent.childGrid||S.parent.detailTemplate)&&c.classList.add("e-first-visible-cell")),g=!1}if(s.cellType===e.CellType.Header&&(i.cells[parseInt(n.toString(),10)].colSpan>1||i.cells[parseInt(n.toString(),10)].rowSpan>1)){var j=new Gi(S.serviceLocator,S.parent);c=j.render(i.cells[parseInt(n.toString(),10)],i,n,c)}if(S.isSpan){var F=S.parent.getRowsObject(),V=S.parent.enableRtl,T=i.index-S.parent.pinnedTopRecords.length;if(F[i.index-1]&&F[T-1].isDataRow){var G=F[T-1].cells,_=G[n-1],K=G[parseInt(n.toString(),10)],W=G[n+1],Q=G[parseInt(n.toString(),10)].column.freeze;_&&(_.isRowSpanned||_.rowSpanRange>1)&&_.visible&&(V||K.isRowSpanned&&!(_.rowSpanRange>K.rowSpanRange)||c.classList.add("e-rowcell-firstchild"),u&&("Fixed"===_.column.freeze&&"Fixed"===Q?c.classList.add(V?"e-removefreezerightborder":"e-removefreezeleftborder"):V||1!==n||"Left"!==Q||c.classList.add("e-addfreezefirstchildborder"))),W&&(W.isRowSpanned||W.rowSpanRange>1)&&W.visible&&(V&&(!K.isRowSpanned||W.rowSpanRange>K.rowSpanRange)&&c.classList.add("e-rowcell-lastchild"),u&&"Fixed"===W.column.freeze&&"Fixed"===Q&&h.colSpan<2&&c.classList.add(V?"e-removefreezeleftborder":"e-removefreezerightborder"))}}h.rowSpan>1&&y.length-(i.index-S.parent.pinnedTopRecords.length)===h.rowSpan&&c.classList.add("e-row-span-lastrowcell"),i.cells[parseInt(n.toString(),10)].isSpanned||l.appendChild(c)}else s.visible&&p&&(S.parent.groupSettings&&S.parent.groupSettings.columns.length?c.classList.add("e-grid-group-first-cell"):S.parent.renderModule&&S.parent.renderModule.isFirstColumnHidden&&!(S.parent.allowRowDragAndDrop||S.parent.childGrid||S.parent.detailTemplate)&&c.classList.add("e-first-visible-cell"),g=!1)}(C);var b=0;if(this.parent.groupSettings.columns.length&&this.parent.getFrozenLeftColumnsCount()){if(l.classList.contains("e-groupcaptionrow")){var I=[].slice.call(l.querySelectorAll(".e-leftfreeze,.e-unfreeze,.e-rightfreeze,.e-fixedfreeze,.e-freezerightborder,.e-freezeleftborder"));if(I.length&&t.removeClass(I,["e-leftfreeze","e-unfreeze","e-rightfreeze","e-fixedfreeze","e-freezerightborder","e-freezeleftborder"]),l.querySelector(".e-summarycell"))Ee(l,this.parent);else{for(var x=0;x<l.childNodes.length;x++)if((E=l.childNodes[parseInt(x.toString(),10)]).classList.add("e-leftfreeze"),Ye(E,30*x,this.parent.enableRtl,"Left"),E.classList.contains("e-groupcaption")){var D=parseInt(E.getAttribute("colspan"),10),T=Te(this.parent,x);E.setAttribute("colspan",T.toString()),b=D-T}if(b){E=this.parent.createElement("TD",{className:"e-groupcaption",attrs:{colspan:b.toString(),id:this.parent.element.id+"captioncell",tabindex:"-1"}});l.appendChild(E)}}}if((l.querySelectorAll(".e-leftfreeze").length||l.classList.contains("e-columnheader"))&&(l.querySelectorAll(".e-indentcell").length||l.querySelectorAll(".e-grouptopleftcell").length))for(var E=l.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),C=0;C<E.length;C++)E[parseInt(C.toString(),10)].classList.add("e-leftfreeze"),Ye(E[parseInt(C.toString(),10)],30*C,this.parent.enableRtl,"Left")}var O={row:l,rowHeight:this.parent.rowHeight};if(i.isDataRow){var k=t.extend(d,O);k.isSelectable=!0;var A=this.parent.getPrimaryKeyFieldNames()[0],F=i.data[""+A];this.parent.renderModule&&Object.keys(this.parent.renderModule.nonselectableDataKey).length&&!1===this.parent.renderModule.nonselectableDataKey[""+F]&&(k.isSelectable=!1);var M=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,L=k.row.querySelectorAll(".e-templatecell");if((this.parent.isReact&&this.parent.requireTemplateRef||M&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&L.length){var P=this;P.parent.renderTemplates(function(){P.parent.trigger("rowDataBound",k),k.isSelectable||(i.isSelectable=k.isSelectable,P.disableRowSelection(P,i,O,k))})}else this.parent.trigger("rowDataBound",k);i.isSelectable=k.isSelectable;var N=this.parent.isRowDragable();if(this.parent.allowPaging&&this.parent.selectionSettings.persistSelection){var B=i.data?i.data[""+A]:null,z=k.isSelectable?this.parent.partialSelectedRecords:this.parent.disableSelectedRecords;z.some(function(e){return e[""+A]===B})||z.push(i.data)}k.isSelectable||this.disableRowSelection(this,i,O,k),(this.parent.childGrid||N||this.parent.detailTemplate)&&(E=l.querySelectorAll(".e-rowcell:not(.e-hide)")[0])&&E.classList.add("e-detailrowvisible")}if(!this.parent.enableVirtualization||i.isAggregateRow&&!i.parentUid||(d.rowHeight=this.parent.rowHeight),d.rowHeight?l.style.height=d.rowHeight+"px":this.parent.rowHeight&&(l.querySelector(".e-headercell")||l.querySelector(".e-groupcaption"))&&(l.style.height=this.parent.rowHeight+"px"),i.cssClass&&l.classList.add(i.cssClass),i.lazyLoadCssClass&&l.classList.add(i.lazyLoadCssClass),"Vertical"!==this.parent.rowRenderingMode||!this.parent.allowTextWrap||"Header"!==this.parent.textWrapSettings.wrapMode&&"Both"!==this.parent.textWrapSettings.wrapMode||l.classList.add("e-verticalwrap"),!this.parent.enableColumnVirtualization&&this.parent.aggregates.length&&this.parent.element.scrollHeight>this.parent.height)for(C=0;C<this.parent.aggregates.length;C++){if(this.parent.aggregates[parseInt(C.toString(),10)].properties.columns[0].footerTemplate){var q=[].slice.call(l.getElementsByClassName("e-summarycell"));if(q.length){var U=q[q.length-1];t.addClass([U],["e-lastsummarycell"]);var H=q[0];t.addClass([H],["e-firstsummarycell"])}}}return l},i.prototype.resetrowSpanvalue=function(e,t,i){if(e>i&&e<i+t.rowSpan){var n=i+t.rowSpan-e;t.rowSpan=t.rowSpan-n}},i.prototype.disableRowSelection=function(e,i,n,r){var s=this.parent.getSelectedRowIndexes();this.parent.selectionModule.isPartialSelection=!0,i.isSelected=!1;var o=s.indexOf(i.index);o>-1&&s.splice(o,1);for(var a=n.row.querySelectorAll(".e-rowcell.e-gridchkbox"),l=r.row.querySelector(".e-rowdragdrop"),d=e.parent.groupSettings.columns.length+(l||e.parent.isDetail()?1:0),h=0;h<a.length;h++)a[parseInt(h.toString(),10)].firstElementChild.classList.add("e-checkbox-disabled"),a[parseInt(h.toString(),10)].querySelector(".e-frame").classList.remove("e-check");if(i.cells.length)for(h=d;h<i.cells.length;h++){var p=r.row.querySelector('.e-rowcell[aria-colindex="'+(i.cells[parseInt(h.toString(),10)].index+1)+'"]');p&&t.removeClass([p],["e-selectionbackground","e-active"])}l&&t.removeClass([l],["e-selectionbackground","e-active"])},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 n={},r={dataUID:"data-uid",ariaSelected:"aria-selected"},s=[];i.isDataRow&&s.push(Zi),i.isAltRow&&s.push("e-altrow"),i.isCaptionRow&&s.push("e-groupcaptionrow"),i.isAggregateRow&&i.parentUid&&s.push("e-groupfooterrow"),t.isNullOrUndefined(i.index)||(n[an]=i.index+1),i.rowSpan&&(n.rowSpan=i.rowSpan),i.uid&&(n[r.dataUID]=i.uid),i.isSelected&&(n[r.ariaSelected]=!0),!1===i.visible&&s.push("e-hide"),n.class=s,R(e,n)},i}(),mn=function(){function i(e){this.parent=e}return i.prototype.generateRows=function(e,t){var i=[],n=this.parent.enableVirtualization&&t?t.startIndex:0;n=this.parent.enableInfiniteScrolling&&t?this.getInfiniteIndex(t):n,this.parent.enableImmutableMode&&t&&t.startIndex&&(n=t.startIndex),!this.parent.enableVirtualization&&this.parent.pinnedTopRowModels.length&&t&&"infiniteScroll"!==t.requestType&&(n=this.parent.pinnedTopRowModels.length);for(var r=0,s=Object.keys(e).length;r<s;r++,n++)i[parseInt(r.toString(),10)]=this.generateRow(e[parseInt(r.toString(),10)],n);return i},i.prototype.generatePinnedTopRows=function(t){for(var i=[],n=0,r=0,s=Object.keys(t).length;r<s;r++,n++){i[parseInt(r.toString(),10)]=this.generateRow(t[parseInt(r.toString(),10)],n);for(var o=0;o<this.parent.groupSettings.columns.length;o++)this.parent.enableColumnVirtualization||i[parseInt(r.toString(),10)].cells.unshift(this.generateCell({},null,e.CellType.HeaderIndent))}return i},i.prototype.ensurePinnedColumns=function(){var t=[];return(this.parent.detailTemplate||this.parent.childGrid)&&t.push(this.generateCell({},null,e.CellType.HeaderIndent)),this.parent.isRowDragable()&&t.push(this.generateCell({},null,e.CellType.HeaderIndent)),t},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,n,r,s,o,a,l){var d={};d.foreignKeyData={},d.uid=z("grid-row"),d.data=e,d.index=i,d.indent=r,d.tIndex=o,d.isDataRow=!0,d.parentGid=s,d.parentUid=a,this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(d.groupDataIndex=l),this.parent.isPrinting&&("All"===this.parent.hierarchyPrintMode?d.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(i.toString(),10)]&&(d.isExpand=this.parent.expandedRows[parseInt(i.toString(),10)].isExpand)),d.cssClass=n,d.isAltRow=!!this.parent.enableAltRow&&i%2!=0,d.isAltRow=!!this.parent.enableAltRow&&i%2!=0;var h=this.parent.getPrimaryKeyFieldNames()[0];d.isSelected=this.parent.isPersistSelection&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?!t.isNullOrUndefined(this.parent.selectionModule.selectedRowState[e[""+h]]):this.parent.getSelectedRowIndexes().indexOf(i)>-1,this.refreshForeignKeyRow(d);var p=this.ensureColumns();this.parent.pinnedTopRecords.length&&i<this.parent.pinnedTopRecords.length&&(p=this.ensurePinnedColumns());var c=new ji(d,this.parent);return c.cells="Right"===this.parent.getFrozenMode()?this.generateCells(d).concat(p):p.concat(this.generateCells(d)),c},i.prototype.refreshForeignKeyRow=function(e){for(var i=this.parent.getForeignKeyColumns(),n=0;n<i.length;n++)t.setValue(i[parseInt(n.toString(),10)].field,he(i[parseInt(n.toString(),10)],e.data),e.foreignKeyData)},i.prototype.generateCells=function(i){for(var n=this.parent.getColumns(),r=[],s=0;s<n.length;s++)r.push(this.generateCell(n[parseInt(s.toString(),10)],i.uid,t.isNullOrUndefined(n[parseInt(s.toString(),10)].commands)?void 0:e.CellType.CommandColumn,null,s,i.foreignKeyData));return r},i.prototype.generateCell=function(i,n,r,s,o,a){var l={visible:i.visible,isDataCell:!t.isNullOrUndefined(i.field||i.template),isTemplate:!t.isNullOrUndefined(i.template),rowID:n,column:i,cellType:t.isNullOrUndefined(r)?e.CellType.Data:r,colSpan:s,commands:i.commands,isForeignKey:i.isForeignColumn&&i.isForeignColumn(),foreignKeyData:i.isForeignColumn&&i.isForeignColumn()&&t.getValue(i.field,a)};return(l.isDataCell||"checkbox"===l.column.type||l.commands)&&(l.index=o),new Vi(l)},i.prototype.refreshRows=function(e){for(var t=0;t<e.length;t++)this.refreshForeignKeyRow(e[parseInt(t.toString(),10)]),e[parseInt(t.toString(),10)].cells=this.generateCells(e[parseInt(t.toString(),10)]);return e},i.prototype.getInfiniteIndex=function(e){return"infiniteScroll"===e.requestType||"delete"===e.requestType||"add"===e.action?t.isNullOrUndefined(e.startIndex)?e.index:e.startIndex:0},i}(),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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vn=function(){function i(e){this.parent=e}return i.prototype.getData=function(){for(var e=this,t=[],i=this.parent.aggregates.slice(),n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)].columns.filter(function(t){return!(t.footerTemplate||t.groupFooterTemplate||t.groupCaptionTemplate)||e.columnSelector(t)});r.length&&t.push({columns:r})}return t},i.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},i.prototype.getColumns=function(e){var i=[];if(!this.parent.detailTemplate&&t.isNullOrUndefined(this.parent.childGrid)||i.push(new Pt({})),this.parent.allowGrouping)for(var n=0;n<this.parent.groupSettings.columns.length;n++)i.push(new Pt({}));return this.parent.isRowDragable()&&!e&&i.push(new Pt({})),i.push.apply(i,this.parent.getColumns()),i},i.prototype.generateRows=function(e,t,i,n,r){if(0===e.length&&(void 0===t||!t.count&&!t.loadSummaryOnEmpty))return[];for(var s=this.buildSummaryData(e,t),o=[],a=this.getData(),l=0;l<a.length;l++)o.push(this.getGeneratedRow(a[parseInt(l.toString(),10)],s[parseInt(l.toString(),10)],t?t.level:void 0,i,n,t?t.parentUid:void 0,r));return o},i.prototype.getGeneratedRow=function(i,n,r,s,o,a,l){var d=[],h=this.getIndentByLevel(),p=!t.isNullOrUndefined(this.parent.childGrid),c=this.parent.getIndentCount();this.parent.groupSettings.columns.length&&this.parent.allowRowDragAndDrop?h.push("e-indentcelltop"):this.parent.isRowDragable()&&!s&&(h=["e-indentcelltop"]);for(var u=l||this.getColumns(s),g=0;g<u.length;g++)d.push(this.getGeneratedCell(u[parseInt(g.toString(),10)],i,g>=c?this.getCellType():0===g&&(this.parent.childGrid||this.parent.detailTemplate)?e.CellType.DetailFooterIntent:e.CellType.Indent,h[parseInt(g.toString(),10)],p));var f=new ji({data:n,attributes:{class:"e-summaryrow"}});return f.cells=d,f.uid=z("grid-row"),f.parentUid=a,f.isAggregateRow=!0,f.visible=d.some(function(e){return e.isDataCell&&e.visible}),f},i.prototype.getGeneratedCell=function(e,i,n,r,s){var o=i.columns.filter(function(t){return t.columnName===e.field})[0],a={"data-mappinguid":e.uid,"data-index":e.index};if(e.textAlign){var l={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"};l[e.textAlign.toLowerCase()]&&(a.class=l[e.textAlign.toLowerCase()])}r&&(a.class=r),t.isNullOrUndefined(r)&&s&&(a.class="e-detailindentcelltop");var d={visible:e.visible,isDataCell:!t.isNullOrUndefined(o),isTemplate:o&&!t.isNullOrUndefined(o.footerTemplate||o.groupFooterTemplate||o.groupCaptionTemplate),column:o||{},attributes:a,cellType:n};return d.column.headerText=e.headerText,new Vi(d)},i.prototype.buildSummaryData=function(e,t){for(var i=[],n=this.getData(),r={},s=0;s<n.length;s++){r={};for(var o=n[parseInt(s.toString(),10)].columns,a=0;a<o.length;a++)r=this.setTemplate(o[parseInt(a.toString(),10)],t&&t.aggregates?t:e,r);i.push(r)}return i},i.prototype.getIndentByLevel=function(){return this.parent.groupSettings.columns.map(function(){return"e-indentcelltop"})},i.prototype.setTemplate=function(e,i,n){var r=e.type,s={},o=e.getFormatter()||function(){return function(e){return e}}(),a=i;r instanceof Array||(r=[e.type]);for(var l=0;l<r.length;l++){var d=e.field+" - "+r[parseInt(l.toString(),10)].toLowerCase(),h=e.columnName,p=!!(this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&a.items),c=("Custom"!==r[parseInt(l.toString(),10)]||p)&&a.aggregates&&d in a.aggregates?a.aggregates[""+d]:H(r[parseInt(l.toString(),10)],a.aggregates?a:i,e,this.parent);n[""+h]=n[""+h]||{},n[""+h][""+d]=c,n[""+h][r[parseInt(l.toString(),10)]]=t.isNullOrUndefined(c)?" ":o(c),a.field&&(n[""+h].field=a.field,n[""+h].key=a.key)}return s.format=e.getFormatter(),e.setTemplate(s),n},i.prototype.getCellType=function(){return e.CellType.Summary},i}(),Sn=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yn(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.allowRowDragAndDrop&&this.parent.groupSettings.columns.length&&(e-=1),this.parent.groupSettings.columns.map(function(t,i){return i<=e-1?"":"e-indentcelltop"})},i.prototype.getCellType=function(){return e.CellType.GroupSummary},i}(vn),Cn=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yn(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}(vn),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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bn=function(i){function n(e){var t=i.call(this,e)||this;return t.rows=[],t.index=0,t.infiniteChildCount=0,t.renderInfiniteAgg=!0,t.parent=e,t.summaryModelGen=new Sn(e),t.captionModelGen=new Cn(e),t}return wn(n,i),n.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:this.parent.pinnedTopRowModels.length;for(var n=0,r=e.length;n<r;n++)this.infiniteChildCount=0,this.renderInfiniteAgg=!0,this.getGroupedRecords(0,e[parseInt(n.toString(),10)],e.level,n,void 0,this.rows.length);return this.index=0,this.parent.isCollapseStateEnabled()&&this.ensureRowVisibility(),this.rows},n.prototype.getGroupedRecords=function(e,i,n,r,s,o,a){var l,d=n;if(t.isNullOrUndefined(i.items))if(t.isNullOrUndefined(i.GroupGuid))this.rows=this.rows.concat(this.generateDataRows(i,e,r,this.rows.length,a));else for(var h=0,p=i.length;h<p;h++)this.getGroupedRecords(e,i[parseInt(h.toString(),10)],i.level,r,e,this.rows.length,a);else{var c=void 0,u=this.generateCaptionRow(i,e,r,s,o,a);if(this.isInfiniteScroll&&(c=this.getPreCaption(e,u.data.key)),c?u.uid=c.uid:this.rows=this.rows.concat(u),i.items&&i.items.length&&this.getGroupedRecords(e+1,i.items,i.items.level,r,e+1,this.rows.length,u.uid),this.parent.aggregates.length&&this.isRenderAggregate(u)){var g=this.rows.length;(l=this.rows).push.apply(l,this.summaryModelGen.generateRows(i,{level:d,parentUid:u.uid}));for(var f=g-1;f>=0;f--)if(this.rows[parseInt(f.toString(),10)].isCaptionRow)this.rows[parseInt(f.toString(),10)].aggregatesCount=this.rows.length-g;else if(!this.rows[parseInt(f.toString(),10)].isCaptionRow&&!this.rows[parseInt(f.toString(),10)].isDataRow)break}c&&this.setInfiniteRowVisibility(c)}},n.prototype.isRenderAggregate=function(e){return this.parent.enableInfiniteScrolling?!!this.renderInfiniteAgg&&(this.getPreCaption(e.indent,e.data.key),this.renderInfiniteAgg=e.data.count===this.infiniteChildCount,this.renderInfiniteAgg):!this.parent.enableInfiniteScrolling},n.prototype.getPreCaption=function(e,t){var i,n=this.parent.getRowsObject().concat(this.rows);this.infiniteChildCount=0;for(var r=n.length;r--;){if(n[parseInt(r.toString(),10)].isCaptionRow&&n[parseInt(r.toString(),10)].indent===e){var s=n[parseInt(r.toString(),10)].data.key;(s&&t&&s.toString()===t.toString()&&s instanceof Date||s===t)&&(i=n[parseInt(r.toString(),10)])}if(n[parseInt(r.toString(),10)].indent===e||n[parseInt(r.toString(),10)].indent<e)break;n[parseInt(r.toString(),10)].indent===e+1&&this.infiniteChildCount++}return i},n.prototype.getCaptionRowCells=function(i,n,r){var s=[],o=[],a=this.parent.getColumnByField(i),l=this.parent.getColumnIndexesInView();this.parent.enableColumnVirtualization&&(a=this.parent.columns.filter(function(e){return e.field===i})[0]);var d=this.parent.groupSettings.columns.length,h=this.parent;if(!this.parent.enableColumnVirtualization||-1!==l.indexOf(n)){for(var p=0;p<n;p++)s.push(this.generateIndentCell());s.push(this.generateCell({},null,e.CellType.Expand))}if(n=this.parent.enableColumnVirtualization?1:this.parent.getVisibleColumns().length+d+(h.detailTemplate||h.childGrid?1:0)-n+(this.parent.getVisibleColumns().length?-1:0),this.parent.aggregates.length&&!this.captionModelGen.isEmpty()){var c=this.captionModelGen.generateRows(r)[0];t.extend(r,c.data);var u=0;c.cells.some(function(e,t){return u=t,e.visible&&e.isDataCell}),o=c.cells.slice(u).filter(function(e){return e.visible}),c.visible&&o[0].column.field===this.parent.getVisibleColumns()[0].field&&(o=o.slice(1)),1===this.parent.getVisibleColumns().length&&(o=[]),n-=o.length}for(var g=this.parent.enableColumnVirtualization?this.parent.getColumns():[a],f=!0,m=0;m<g.length;m++){var y=f&&-1!==l.indexOf(n);y&&(f=!1);var v=!this.parent.enableColumnVirtualization||y?e.CellType.GroupCaption:e.CellType.GroupCaptionEmpty;n=this.parent.enableColumnVirtualization&&v===e.CellType.GroupCaption?n+d:n,h.isRowDragable()&&n++,s.push(this.generateCell(a,null,v,n))}return s.push.apply(s,o),s},n.prototype.generateCaptionRow=function(e,i,n,r,s,o){var a={},l=this.parent.getColumnByField(e.field);a.data=t.extend({},e),l&&(a.data.field=e.field),a.isDataRow=!1,a.isExpand=!this.parent.groupSettings.enableLazyLoading&&!this.parent.isCollapseStateEnabled(),a.parentGid=n,a.childGid=r,a.tIndex=s,a.isCaptionRow=!0,a.parentUid=o,a.gSummary=t.isNullOrUndefined(e.items.records)?e.items.length:e.items.records.length,a.uid=z("grid-row");var d=new ji(a);return d.indent=i,this.getForeignKeyData(d),d.cells=this.getCaptionRowCells(e.field,i,d.data),d},n.prototype.getForeignKeyData=function(e){var i=e.data,n=this.parent.getColumnByField(i.field);if(n&&n.isForeignColumn&&n.isForeignColumn()){var r=t.isNullOrUndefined(i.key)?"":n.valueAccessor(n.foreignKeyValue,he(n,{},i.key)[0],n);t.setValue("foreignKey",r,e.data)}},n.prototype.generateDataRows=function(e,t,i,n,r){for(var s=[],o=this.parent.getColumnIndexesInView(),a=0,l=e.length;a<l;a++,n++){s[parseInt(a.toString(),10)]=this.generateRow(e[parseInt(a.toString(),10)],this.index,a?void 0:"e-firstchildrow",t,i,n,r,a);for(var d=0;d<t;d++)this.parent.enableColumnVirtualization&&-1===o.indexOf(t)||s[parseInt(a.toString(),10)].cells.unshift(this.generateIndentCell());this.index++}return s},n.prototype.generateIndentCell=function(){return this.generateCell({},null,e.CellType.Indent)},n.prototype.refreshRows=function(e){for(var t=this.parent.getColumnIndexesInView(),i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].isDataRow){e[parseInt(i.toString(),10)].cells=this.generateCells(e[parseInt(i.toString(),10)]);for(var n=0;n<e[parseInt(i.toString(),10)].indent;n++)this.parent.enableColumnVirtualization&&-1===t.indexOf(e[parseInt(i.toString(),10)].indent)||e[parseInt(i.toString(),10)].cells.unshift(this.generateIndentCell())}else{var r=this.generateCaptionRow(e[parseInt(i.toString(),10)].data,e[parseInt(i.toString(),10)].indent);e[parseInt(i.toString(),10)].cells=r.cells}return e},n.prototype.setInfiniteRowVisibility=function(e){if(!e.isExpand||!1===e.visible)for(var t=0,i=this.rows;t<i.length;t++){var n=i[t];n.parentUid===e.uid&&(n.visible=!1,n.isCaptionRow&&this.setInfiniteRowVisibility(n))}},n.prototype.ensureRowVisibility=function(){for(var e=0;e<this.rows.length;e++){var t=this.rows[parseInt(e.toString(),10)];if(t.isCaptionRow)for(var i=e+1;i<this.rows.length;i++){var n=this.rows[parseInt(i.toString(),10)];t.uid===n.parentUid&&(this.rows[parseInt(i.toString(),10)].visible=t.isExpand)}}},n}(mn),In=function(){function e(e,i){var n=this;this.rows=[],this.freezeRows=[],this.movableRows=[],this.freezeRowElements=[],this.currentInfo={},this.prevCurrentView=[],this.isLoaded=!0,this.drop=function(e){n.parent.notify(_t,{target:e.target,droppedElement:e.droppedElement}),t.remove(e.droppedElement)},this.infiniteCache={},this.visibleRows=[],this.visibleFrozenRows=[],this.rightFreezeRows=[],this.isAddRows=!1,this.isInfiniteFreeze=!1,this.useGroupCache=!1,this.tempFreezeRows=[],this.rafCallback=function(e){var t=e;return function(){if(n.ariaService.setBusy(n.getPanel().querySelector("."+Yi),!1),!n.parent.isDestroyed){var i=n.rows.slice(0);if(n.parent.enableInfiniteScrolling){if(n.parent.groupSettings.enableLazyLoading)for(a=0;a<n.visibleRows.length;a++)n.setRowsInLazyGroup(n.visibleRows[parseInt(a.toString(),10)],a);i=n.parent.getRowsObject();var r=t.prevPage;if(n.parent.infiniteScrollSettings.enableCache&&r){var s=n.parent.infiniteScrollSettings.maxBlocks;i=[];for(var o=parseInt(n.rowElements[0].getAttribute("aria-rowindex"),10),a=0,l=Math.ceil(o/n.parent.pageSettings.pageSize);a<s;a++,l++)n.infiniteCache[parseInt(l.toString(),10)]&&(i=i.concat(n.infiniteCache[parseInt(l.toString(),10)]))}}if(n.parent.notify($t,{rows:i,args:t}),n.parent.editSettings.showAddNewRow&&n.parent.addNewRowFocus&&(n.parent.notify(zi,{}),n.parent.addNewRowFocus=!1),n.parent.autoFit&&n.parent.preventAdjustColumns(),n.parent.isInitialLoad||n.parent.focusModule.setFirstFocusableTabIndex(),n.isLoaded){n.parent.isManualRefresh=!1,n.parent.enableInfiniteScrolling&&n.parent.groupSettings.enableLazyLoading&&"sorting"===e.requestType&&(n.parent.infiniteScrollModule.groupCaptionAction=void 0);var d=n.parent.parentDetails&&n.parent.parentDetails.parentInstObj&&n.parent.parentDetails.parentInstObj.isReact;if((n.parent.isReact||d)&&n.parent.element.querySelectorAll(".e-templatecell").length){var h=n;h.parent.renderTemplates(function(){h.parent.trigger(jt,{},function(){h.parent.allowTextWrap&&h.parent.notify(Ri,{case:"textwrap"})})})}else n.parent.trigger(jt,{},function(){n.parent.allowTextWrap&&n.parent.notify(Ri,{case:"textwrap"})});n.parent.allowTextWrap&&"auto"===n.parent.height&&(n.parent.getContentTable().scrollHeight>n.parent.getContent().clientHeight?n.parent.scrollModule.setPadding():n.parent.scrollModule.removePadding())}if(t){var p=(t.requestType||"").toLowerCase()+"-complete";n.parent.notify(p,t),"batchsave"===e.requestType&&(e.cancel=!1,n.parent.trigger(Ut,e))}n.isLoaded&&n.parent.hideSpinner()}}},this.parent=e,this.serviceLocator=i,this.widthService=i.getService("widthService"),this.ariaService=this.serviceLocator.getService("ariaService"),this.parent.enableDeepCompare=this.parent.getDataModule().isRemote(),this.generator=this.getModelGenerator(),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.enableVirtualization||this.parent.groupSettings.enableLazyLoading||this.parent.on(ci,this.setVisible,this),this.parent.on(ri,this.colGroupRefresh,this),this.parent.on(ei,this.enableAfterRender,this),this.parent.on(Mi,this.refreshContentRows,this),this.parent.on(li,this.beforeCellFocused,this),this.parent.on(pi,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("."+Wi);if(t)return this.ariaService.setOptions(this.parent.element.querySelector("."+Yi),{busy:!1}),void this.setPanel(t);t=this.parent.createElement("div",{className:Wi});var i=this.parent.createElement("div",{className:Yi});this.ariaService.setOptions(i,{busy:!1}),this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&(this.renderHorizontalScrollbar(t),i.classList.add("e-virtual-content")),t.appendChild(i),this.setPanel(t),e.element.appendChild(t)},e.prototype.renderHorizontalScrollbar=function(e){var t=this.parent.createElement("div",{className:"e-movablescrollbar"}),i=this.parent.createElement("div",{className:"e-movablechild"}),n=j().toString();this.setScrollbarHeight(i,n),this.setScrollbarHeight(t,n),t.appendChild(i),e.appendChild(t)},e.prototype.setScrollbarHeight=function(e,t){e.style.minHeight=t+"px",e.style.maxHeight=t+"px"},e.prototype.renderTable=function(){var e=this.getPanel(),i=e.querySelector(".e-virtualtable"),n=e.querySelector(".e-virtualtrack");!this.parent.enableVirtualization||t.isNullOrUndefined(i)||t.isNullOrUndefined(n)||(t.remove(i),t.remove(n));var r=e.querySelector(".e-virtual-vertical-scrollbar"),s=e.querySelector(".e-virtual-horizontal-scrollbar");this.parent.enableVirtualization&&!t.isNullOrUndefined(r)&&t.remove(r),this.parent.enableColumnVirtualization&&!t.isNullOrUndefined(s)&&t.remove(s),e.appendChild(this.createContentTable("_content_table")),this.setTable(e.querySelector("."+Ji)),"Multiple"===this.parent.selectionSettings.type&&this.ariaService.setOptions(this.parent.element,{multiselectable:!0}),this.initializeContentDrop(),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdr")},e.prototype.createContentTable=function(e){var i=this.getPanel().firstElementChild;this.getTable()&&t.remove(this.getTable());var n=i.querySelector("."+Ji)?i.querySelector("."+Ji):this.parent.createElement("table",{className:Ji,attrs:{role:"presentation",id:this.parent.element.id+e}});return n.style.cssText="border-collapse: separate; border-spacing: .25px;",this.setColGroup(this.parent.getHeaderTable().querySelector(dn).cloneNode(!0)),n.appendChild(this.getColGroup()),n.appendChild(this.parent.createElement(ln,{attrs:{role:"rowgroup"}})),i.appendChild(n),i},e.prototype.refreshContentRows=function(e){var n=this;void 0===e&&(e={});var r=this.parent;if(0!==r.currentViewData.length){r.editSettings&&r.editModule&&"Batch"===r.editSettings.mode&&r.editModule.formObj&&!1===r.editSettings.showConfirmDialog&&r.editModule.destroyForm();var s=this.currentMovableRows||r.currentViewData,o=r.isReact&&!t.isNullOrUndefined(r.rowTemplate),a=this.parent.printGridParent&&this.parent.printGridParent.isReact,l=o||a?r.createElement(ln,{attrs:{role:"rowgroup"}}):document.createDocumentFragment();this.initialPageRecords||(this.initialPageRecords=t.extend([],s));var d,h,p=o?r.createElement(ln,{attrs:{role:"rowgroup"}}):document.createDocumentFragment();(r.isReact||a)&&r.rowTemplate&&(d=l,h=p);var c,u,g,f=r.getColumns(),y=new fn(this.serviceLocator,null,this.parent),v=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType,S=this.isInfiniteColumnvirtualization()&&"virtualscroll"!==e.requestType,C=!(!r.enableInfiniteScrolling||!r.childGrid&&!r.detailTemplate),w=C&&("add"===e.action&&"save"===e.requestType||"delete"===e.requestType);w&&(e.startIndex=0,r.notify("detach-detail-template",{})),v&&(r.childGrid||r.detailTemplate)&&!r.infiniteScrollSettings.enableCache||(C&&(this.parent.infiniteScrollModule.infiniteDetailDestroy=!0),r.notify("destroy-child-grid",v&&(r.childGrid||r.detailTemplate)&&r.infiniteScrollSettings.enableCache?e:{})),this.rowElements=[],this.rows=[],this.tempFreezeRows=[];var b=!(!this.parent.frozenRows||!this.parent.groupSettings.columns.length);ge(r)&&["sorting","filtering","searching","grouping","ungrouping","reorder","save","delete","refresh-aggregate-on-save"].some(function(t){return e.requestType===t})&&this.emptyVcRows();var I;if(I=this.checkCache(I,e),r.isRowPinned){var x=new i.Query,R=this.parent.getDataModule(),D=R.pinnedData.executeLocal(R.pinnedDataQuery(x));r.pinnedTopRowModels=this.generator.generatePinnedTopRows(D)}this.isAddRows||this.useGroupCache||(I=this.generator.generateRows(s,e)),this.setGroupCache(I,e),this.parent.notify("set-infinite-cache",{isInfiniteScroll:v,modelData:I,args:e});var T=this.parent.registeredTemplate;if(this.parent.isAngular&&("infiniteScroll"!==e.requestType||this.parent.infiniteScrollSettings.enableCache)&&T&&T.detailTemplate&&!e.isFrozen&&this.parent.destroyTemplate(["detailTemplate"]),("infiniteScroll"!==e.requestType||this.parent.infiniteScrollSettings.enableCache)&&T&&T.template&&!e.isFrozen){for(var E=[],O=0;O<T.template.length;O++)for(var k=0;k<T.template[parseInt(O.toString(),10)].rootNodes.length;k++)t.isNullOrUndefined(T.template[parseInt(O.toString(),10)].rootNodes[parseInt(k.toString(),10)].parentNode)&&E.push(T.template[parseInt(O.toString(),10)]);this.parent.destroyTemplate(["template"],E)}if((this.parent.isReact||this.parent.isVue)&&("infiniteScroll"!==e.requestType||this.parent.infiniteScrollSettings.enableCache)&&!e.isFrozen){var A=[this.parent.isVue?"template":"columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"];"infiniteScroll"===e.requestType&&this.parent.infiniteScrollSettings.enableCache&&(A=[this.parent.isVue?"template":"columnTemplate","commandsTemplate"]),ut(this.parent,A)}for(O=0;O<r.pinnedTopRowModels.length;O++){var F=y.render(r.pinnedTopRowModels[parseInt(O.toString(),10)],f);Xe(F),F.classList.add("e-grid-pin-row");var M=[].slice.call(F.getElementsByClassName("e-grouptopleftcell"));M.length&&M[M.length-1].classList.add("e-lastgrouptopleftcell"),p.appendChild(F)}this.parent.enableColumnVirtualization&&new Gi(this.serviceLocator,this.parent).updateVirtualCells(I),this.tbody=this.getTable().querySelector(ln);var L=0,P=!0;if(ge(r)&&r.vcRows.length){var N=t.isNullOrUndefined(e.virtualInfo.offsets)?t.isNullOrUndefined(e.scrollTop)?0:e.scrollTop.top:e.virtualInfo.offsets.top;if(0!==N){for(var B=r.vGroupOffsets,z=r.pageSettings.pageSize/2,U=Object.keys(B).map(function(e){return B[""+e]}),H=0;H<U.length;H++)if(N<U[parseInt(H.toString(),10)]){if(t.isNullOrUndefined(e.virtualInfo)||"up"!==e.virtualInfo.direction){L=H*z,(this.parent.contentModule.isEndBlock(H)||this.parent.contentModule.isEndBlock(H+1))&&(e.virtualInfo.blockIndexes=[H,H+1]);break}L=H>0?(H-1)*z:H*z;break}Math.round(N+this.contentPanel.firstElementChild.offsetHeight)>=this.contentPanel.firstElementChild.scrollHeight&&!e.rowObject&&(P=!1)}}var j=r.frozenRows&&this.parent.enableVirtualization&&"reorder"===e.requestType;if(r.frozenRows&&"virtualscroll"===e.requestType&&"X"===e.virtualInfo.sentinelInfo.axis||j){var V=e.virtualInfo.blockIndexes,G=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],j&&(e.virtualInfo.page=1);var _=j?this.initialPageRecords:s,K=this.vgenerator.generateRows(_,e);K.splice(this.parent.frozenRows);for(O=0;O<this.parent.frozenRows;O++)Xe(c=y.render(K[parseInt(O.toString(),10)],f)),p.appendChild(c);e.virtualInfo.blockIndexes=V,e.virtualInfo.page=G,j&&1===e.virtualInfo.page&&I.splice(0,this.parent.frozenRows)}this.virtualFrozenHdrRefresh(p,I,y,e,s,f),this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&((this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]=[]),(this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&"delete"===e.requestType||w)&&(this.visibleRows=[]),"paging"===e.requestType&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&(this.parent.currentViewData=[]);for(var W=this,O=L,Q=I.length;O<Q&&"break"!==function(i,n){if(W.rows.push(I[parseInt(i.toString(),10)]),W.parent.groupSettings.enableLazyLoading&&!W.useGroupCache&&W.parent.groupSettings.columns.length&&((W.parent.enableVirtualization?W.parent.lazyLoadRender:W.parent.contentModule).refRowsObj[W.parent.pageSettings.currentPage].push(I[parseInt(i.toString(),10)]),W.setRowsInLazyGroup(I[parseInt(i.toString(),10)],i),t.isNullOrUndefined(I[parseInt(i.toString(),10)].indent)))return"continue";if("paging"===e.requestType&&W.parent.groupSettings.enableLazyLoading&&W.parent.groupSettings.columns.length&&(I[parseInt(i.toString(),10)].isDataRow?W.parent.currentViewData[I[parseInt(i.toString(),10)].index]=I[parseInt(i.toString(),10)].data:I[parseInt(i.toString(),10)].isCaptionRow&&!I.some(function(e){return e.isDataRow})&&W.parent.currentViewData.push(I[parseInt(i.toString(),10)].data)),W.setInfiniteVisibleRows(e,I[parseInt(i.toString(),10)]),ge(r)&&e.virtualInfo&&e.virtualInfo.blockIndexes&&W.rowElements.length>=e.virtualInfo.blockIndexes.length*W.parent.contentModule.getBlockSize()&&P)return W.parent.currentViewData.records=W.rows.map(function(e){return e.data}),"break";if(r.rowTemplate){var o=r.element.id+"rowTemplate",u=void 0;if(r.isReact||a){var m=r.frozenRows&&i<r.frozenRows,S=t.extend({index:i},s[parseInt(i.toString(),10)]);if(r.getRowTemplate()(S,r,"rowTemplate",o,null,null,m?p:l),r.requireTemplateRef){var C=W;return C.parent.renderTemplates(function(){r.frozenRows&&i<r.frozenRows?c=h.childNodes[parseInt(i.toString(),10)]:g=d.childNodes[parseInt(i.toString(),10)];var e={data:I[parseInt(i.toString(),10)].data,row:g||c};C.parent.trigger("rowDataBound",e),(I[parseInt(i.toString(),10)].isDataRow||C.parent.enableVirtualization&&C.parent.groupSettings.enableLazyLoading)&&C.rowElements.push(e.row),C.ariaService.setOptions(C.parent.element,{colcount:r.getColumns().length.toString()}),i===I.length-1&&(d=null,h=null)}),"continue"}}else u=r.getRowTemplate()(t.extend({index:i},s[parseInt(i.toString(),10)]),r,"rowTemplate",o,void 0,void 0,void 0,W.parent.root);if(r.isReact||"TBODY"!==u[0].tagName)r.frozenRows&&i<r.frozenRows?c=r.isReact?p.lastElementChild:q(p,u):(r.isReact||(c=q(l,u)),g=r.isReact?l.lastElementChild:c.lastElementChild);else{for(var w=0;w<u.length;w++){var x="tr"===u[parseInt(w.toString(),10)].nodeName.toLowerCase();(x||u[parseInt(w.toString(),10)].querySelectorAll&&u[parseInt(w.toString(),10)].querySelectorAll("tr").length)&&(c=x?u[parseInt(w.toString(),10)]:u[parseInt(w.toString(),10)].querySelector("tr"))}r.frozenRows&&i<r.frozenRows?p.appendChild(c):l.appendChild(c)}var R={data:I[parseInt(i.toString(),10)].data,row:g||c};W.parent.trigger("rowDataBound",R)}else{Xe(c=y.render(I[parseInt(i.toString(),10)],f));var D=W.ensureFrozenHeaderRender(e);if(r.frozenRows&&(i<r.frozenRows||b)&&!v&&"virtualscroll"!==e.requestType&&D&&W.ensureVirtualFrozenHeaderRender(e))p.appendChild(c);else{var T=r.getPrimaryKeyFieldNames()[0],E=I[parseInt(i.toString(),10)].data;t.isNullOrUndefined(T)||t.isNullOrUndefined(E)||!r.pinnedTopRowKeys[E[""+T]]||c.classList.add("e-grid-pin-row"),l.appendChild(c)}parseInt(c.getAttribute("aria-rowindex"),10)-1+1===r.frozenRows&&(b=!1),I[parseInt(i.toString(),10)].isExpand&&r.notify("expandchildgrid",c.cells[r.groupSettings.columns.length])}(I[parseInt(i.toString(),10)].isDataRow||W.parent.enableVirtualization&&W.parent.groupSettings.enableLazyLoading)&&(!t.isNullOrUndefined(r.rowTemplate)&&(r.isAngular||r.isVue3||r.isVue)?W.rowElements.push(g||c):W.rowElements.push(c)),W.ariaService.setOptions(W.parent.element,{colcount:r.getColumns().length.toString()})}(O);O++);var X=r.parentDetails&&r.parentDetails.parentInstObj&&r.parentDetails.parentInstObj.isReact;if(!r.isReact&&!X||r.requireTemplateRef||r.renderTemplates(),this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&(this.parent.contentModule.refRowsObj[this.parent.pageSettings.currentPage]=this.parent.contentModule.groupCache[this.parent.pageSettings.currentPage]),this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&this.parent.notify("refresh-Expand-and-Collapse",{rows:(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]}),r.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),(r.frozenRows||r.isRowPinned)&&"virtualscroll"!==e.requestType&&!v&&this.ensureVirtualFrozenHeaderRender(e)||"virtualscroll"===e.requestType&&e.virtualInfo.sentinelInfo&&"X"===e.virtualInfo.sentinelInfo.axis||("virtualscroll"===e.requestType||v||"delete"===e.requestType)&&r.isRowPinned){if(u=r.getHeaderTable().querySelector(ln),o){var Y=u.parentElement;t.remove(u),Y.appendChild(p)}else u.innerHTML="",u.appendChild(p);r.isInitialLoad||r.scrollModule.setHeight()}e.rows=this.rows.slice(0),m(function(){if(n.parent.notify("beforeFragAppend",e),n.parent.enableVirtualization||n.parent.enableColumnVirtualization&&!S||v||(r.isReact||(n.tbody.innerHTML=""),t.isNullOrUndefined(n.tbody.parentElement)?t.remove(r.getContentTable().querySelector(ln)):t.remove(n.tbody),n.tbody=n.parent.createElement(ln,{attrs:{role:"rowgroup"}})),r.rowTemplate&&t.updateBlazorTemplate(r.element.id+"rowTemplate","RowTemplate",r),!t.isNullOrUndefined(n.parent.infiniteScrollModule)&&(n.parent.enableInfiniteScrolling&&!n.isInfiniteColumnvirtualization()||S)){if(n.isAddRows=!1,n.parent.notify("remove-infinite-rows",{args:e}),n.parent.notify("append-infinite-content",{tbody:n.tbody,frag:l,args:e,rows:n.rows,rowElements:n.rowElements,visibleRows:n.visibleRows,tableName:void 0}),n.isInfiniteColumnvirtualization()&&n.parent.isFrozenGrid()){var i=xe(n.parent.getContent().querySelector(".e-virtualtable"));n.parent.contentModule.resetStickyLeftPos(i.width),n.widthService.refreshFrozenScrollbar()}}else n.useGroupCache=!1,n.appendContent(n.tbody,l,e);if(n.parent.editSettings.showAddNewRow&&(n.parent.enableVirtualization||n.parent.enableInfiniteScrolling)){var s=n.parent.element.querySelector(".e-addrow-removed");s&&t.remove(s)}var o=!n.parent.element.querySelector("."+tn);n.parent.editSettings.showAddNewRow&&"Normal"===n.parent.editSettings.mode&&(o&&((n.parent.enableVirtualization||n.parent.enableInfiniteScrolling)&&(n.parent.isAddNewRow=!0),n.parent.isEdit=!1,n.parent.addRecord()),(o||(n.parent.enableVirtualization||n.parent.enableInfiniteScrolling)&&["sorting","filtering","searching","grouping","ungrouping","reorder"].some(function(t){return e.requestType===t}))&&n.parent.notify(zi,{})),n.parent.getContent()&&(n.parent.frozenRightCount||n.parent.frozenLeftCount)&&De(n.parent)>0&&n.parent.scrollModule.updateFrozenShadow(),l=null},this.rafCallback(t.extend({},e)))}},e.prototype.isInfiniteColumnvirtualization=function(){return this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling},e.prototype.enableCacheOnInfiniteColumnVirtual=function(){return this.isInfiniteColumnvirtualization()&&this.parent.infiniteScrollSettings.enableCache},e.prototype.emptyVcRows=function(){this.parent.vcRows=[],this.parent.vRows=[]},e.prototype.appendContent=function(e,i,n,r){if(this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?this.getTable().appendChild(i):(e.appendChild(i),this.getTable().appendChild(e)),"Vertical"===this.parent.rowRenderingMode&&this.parent.allowTextWrap&&("Header"===this.parent.textWrapSettings.wrapMode||"Both"===this.parent.textWrapSettings.wrapMode))for(var s=e.querySelectorAll("td"),o=0;o<s.length;o++){var a=parseFloat(document.defaultView.getComputedStyle(s[parseInt(o.toString(),10)],"::before").getPropertyValue("height"));a>s[parseInt(o.toString(),10)].offsetHeight&&(s[parseInt(o.toString(),10)].style.height=a+"px",s[parseInt(o.toString(),10)].style.boxSizing="content-box")}this.parent.getVisibleFrozenLeftCount()&&this.parent.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar()},e.prototype.setRowsInLazyGroup=function(e,t){this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&(this.parent.enableVirtualization?this.parent.lazyLoadRender: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){if(this.isAddRows=!t.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage]),this.isAddRows){var n=this.infiniteCache[this.parent.pageSettings.currentPage];e=1===this.parent.pageSettings.currentPage?n.slice(this.parent.frozenRows):n}return e}return this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&("paging"===i.requestType||"columnstate"===i.requestType||"reorder"===i.requestType||"virtualscroll"===i.requestType)&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getGroupCache()[this.parent.pageSettings.currentPage]?(this.parent.enableVirtualization||(this.useGroupCache=!0),this.parent.enableVirtualization?this.parent.getRowsObject():this.parent.contentModule.initialGroupRows("reorder"===i.requestType)):null},e.prototype.setInfiniteVisibleRows=function(e,t){!this.parent.enableInfiniteScrolling||this.parent.infiniteScrollSettings.enableCache||this.isInfiniteColumnvirtualization()&&"virtualscroll"===e.requestType||this.visibleRows.push(t)},e.prototype.getCurrentBlockInfiniteRecords=function(){var e=[];if(this.parent.infiniteScrollSettings.enableCache){if(!Object.keys(this.infiniteCache).length)return[];var t=this.parent.getRows(),i=parseInt(t[this.parent.frozenRows].getAttribute(an),10)-1,n=Math.ceil((i+1)/this.parent.pageSettings.pageSize);i=parseInt(t[t.length-1].getAttribute(an),10)-1;for(var r=Math.ceil((i+(t.length?1:0))/this.parent.pageSettings.pageSize),s=n;s<=r;s++)e=e.length?e.concat(this.infiniteCache[parseInt(s.toString(),10)]):this.infiniteCache[parseInt(s.toString(),10)];this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(e=this.infiniteCache[1].slice(0,this.parent.frozenRows).concat(e))}return e},e.prototype.getReorderedRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},e.prototype.virtualFrozenHdrRefresh=function(e,t,i,n,r,s){if(this.parent.frozenRows&&this.parent.enableVirtualization&&("reorder"===n.requestType||"refresh"===n.requestType)){for(var o=void 0,a=this.getReorderedRows(n),l=0;l<a.length;l++)o=i.render(a[parseInt(l.toString(),10)],s),e.appendChild(o);1===n.virtualInfo.page&&t.splice(0,this.parent.frozenRows)}},e.prototype.getInfiniteRows=function(){var e=[];if(this.parent.enableInfiniteScrolling)if(this.parent.infiniteScrollSettings.enableCache)for(var t=Object.keys(this.infiniteCache),i=0;i<t.length;i++)e=e.concat(this.infiniteCache[t[parseInt(i.toString(),10)]]);else e=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.rows},e.prototype.getRowElements=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,n=this.parent;this.getRows().some(function(e){return e.isDataRow&&(i=e),e.isDataRow});var r=!0;!n.groupSettings.columns.length&&i&&(r=!1);for(var s=n.getDataRows(),o={},a=this.infiniteRowVisibility(),l=a||this.rows.filter(function(e){return!e.isDetailRow}),d=0,h=e.length;d<h;d++){var p=e[parseInt(d.toString(),10)],c=this.parent.getNormalizedColumnIndex(p.uid),u=this.parent.getColumnIndexByUid(p.uid),g=!0===p.visible?"":"none";-1!==c&&i&&c<i.cells.length&&t.setStyleAttribute(this.getColGroup().childNodes[parseInt(c.toString(),10)],{display:g}),r||this.setDisplayNone(s,u,g,l),!this.parent.invokedFromMedia&&p.hideAtMedia&&this.parent.updateMediaColumns(p),this.parent.invokedFromMedia=!1}"Both"!==n.gridLines&&"Vertical"!==n.gridLines||(r=!0),r?this.refreshContentRows({requestType:"refresh"}):(this.parent.notify("partial-refresh",{rows:l,args:o}),this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.notify(zi,{}))},e.prototype.setDisplayNone=function(e,t,i,n){ot(e,t,i,n,this.parent,this.parent.isRowDragable()),this.parent.notify("infinite-show-hide",{visible:i,index:t,isFreeze:this.isInfiniteFreeze})},e.prototype.infiniteRowVisibility=function(e){var t;return this.parent.enableInfiniteScrolling&&(this.isInfiniteFreeze=e,t=this.parent.infiniteScrollSettings.enableCache?this.getCurrentBlockInfiniteRecords():e?this.visibleFrozenRows:this.visibleRows),t},e.prototype.colGroupRefresh=function(){if(this.getColGroup()){var e=this.getHeaderColGroup();this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)}},e.prototype.getHeaderColGroup=function(){return this.parent.element.querySelector("."+Ki).querySelector("colgroup:not(.e-masked-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,n){return t.isNullOrUndefined(i)||t.isNullOrUndefined(e.visible)||i.cells[parseInt(n.toString(),10)].visible===e.visible},e.prototype.getModelGenerator=function(){return this.generator=this.parent.allowGrouping?new bn(this.parent):new mn(this.parent)},e.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(ln).innerHTML="")},e.prototype.setSelection=function(e,t,i){this.parent.notify("set-freeze-selection",{uid:e,set:t,clearAll:i});for(var n=this.getRows().filter(function(t){return i||e===t.uid}),r=0;r<n.length;r++){n[parseInt(r.toString(),10)].isSelected=t;for(var s=n[parseInt(r.toString(),10)].cells,o=0;o<s.length;o++)s[parseInt(o.toString(),10)].isSelected=t}},e.prototype.getRowByIndex=function(e){return e=this.getInfiniteRowIndex(e),t.isNullOrUndefined(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)]},e.prototype.getInfiniteRowIndex=function(e){if(this.parent.infiniteScrollSettings.enableCache&&!t.isNullOrUndefined(e)){var i=this.parent.frozenRows,n=i>e?0:i,r=parseInt(this.parent.getRows()[parseInt(n.toString(),10)].getAttribute(an),10)-1;e=i>e?e:e-r+i}return e},e.prototype.getVirtualRowIndex=function(e){return 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 n=this.parent;n.loadingIndicator&&"Shimmer"===n.loadingIndicator.indicatorType?n.removeMaskRow():n.hideSpinner();var r=n.getPrimaryKeyFieldNames()[0],s={},o={},a=[],l={},d=n.getRowsObject().slice(),h=this.getBatchEditedRecords(r,d),p={},c=0!==Object.keys(h).length;if(n.getContent().querySelector(".e-emptyrow")||"reorder"===e.requestType||this.parent.groupSettings.columns.length)this.refreshContentRows(e);else{if(0===n.currentViewData.length)return;var u={},g=n.createElement(ln,{attrs:{role:"rowgroup"}}),f=n.currentViewData,m=[].slice.call(this.getTable().querySelector(ln).children);if(this.prevCurrentView.length){var y=this.prevCurrentView.length,v=f.length;if(y===v)for(S=0;S<v;S++)"Batch"===this.parent.editSettings.mode&&m[parseInt(S.toString(),10)].classList.contains("e-insertedrow")?(m.splice(S,1),--S):(o[f[parseInt(S.toString(),10)][""+r]]=s[this.prevCurrentView[parseInt(S.toString(),10)][""+r]]=S,p[parseInt(S.toString(),10)]=f[parseInt(S.toString(),10)][""+r],u[d[parseInt(S.toString(),10)].uid]=m[parseInt(S.toString(),10)],l[parseInt(S.toString(),10)]=this.prevCurrentView[parseInt(S.toString(),10)][""+r]);else{for(S=0;S<v;S++)o[f[parseInt(S.toString(),10)][""+r]]=S,p[parseInt(S.toString(),10)]=f[parseInt(S.toString(),10)][""+r];for(S=0;S<y;S++)"Batch"===this.parent.editSettings.mode&&m[parseInt(S.toString(),10)].classList.contains("e-insertedrow")?(m.splice(S,1),--S):(u[d[parseInt(S.toString(),10)].uid]=m[parseInt(S.toString(),10)],s[this.prevCurrentView[parseInt(S.toString(),10)][""+r]]=S,l[parseInt(S.toString(),10)]=this.prevCurrentView[parseInt(S.toString(),10)][""+r])}}for(var S=0;S<f.length;S++){var C=s[f[parseInt(S.toString(),10)][""+r]];if(t.isNullOrUndefined(C)){var w=new fn(this.serviceLocator,null,n),b={startIndex:S},I=this.generator.generateRows([f[parseInt(S.toString(),10)]],b);a.push(I[0]);R=w.render(I[0],n.getColumns());g.appendChild(R),this.refreshImmutableContent(S,R,a[parseInt(S.toString(),10)])}else{var x=!1;this.parent.enableDeepCompare&&(x=this.objectEqualityChecker(this.prevCurrentView[parseInt(C.toString(),10)],f[parseInt(S.toString(),10)]));var R=u[d[parseInt(C.toString(),10)].uid];if(a.push(d[parseInt(C.toString(),10)]),this.rowElements[parseInt(C.toString(),10)]&&this.rowElements[parseInt(C.toString(),10)].getAttribute("data-uid")===a[parseInt(S.toString(),10)].uid&&(c&&t.isNullOrUndefined(h[p[parseInt(S.toString(),10)]])||!c&&(x||this.prevCurrentView[parseInt(C.toString(),10)]===f[parseInt(S.toString(),10)]))){C!==S&&this.refreshImmutableContent(S,R,a[parseInt(S.toString(),10)]),g.appendChild(R);continue}(c&&!t.isNullOrUndefined(h[p[parseInt(S.toString(),10)]])||!this.parent.enableDeepCompare&&f[parseInt(S.toString(),10)]!==this.prevCurrentView[parseInt(C.toString(),10)]||this.parent.enableDeepCompare&&!x)&&d[parseInt(C.toString(),10)].setRowValue(f[parseInt(S.toString(),10)]),g.appendChild(R),this.refreshImmutableContent(S,R,a[parseInt(S.toString(),10)])}}if(this.rows=a,this.rowElements=[].slice.call(g.children),t.remove(this.getTable().querySelector(ln)),this.getTable().appendChild(g),this.parent.trigger(jt,{},function(){i.parent.allowTextWrap&&i.parent.notify(Ri,{case:"textwrap"})}),e){var D=(e.requestType||"").toLowerCase()+"-complete";this.parent.notify(D,e)}}},e.prototype.objectEqualityChecker=function(e,t){for(var i=Object.keys(e),n=!0,r=0;r<i.length;r++)if(!(e[i[parseInt(r.toString(),10)]]===t[i[parseInt(r.toString(),10)]]||e[i[parseInt(r.toString(),10)]]instanceof Date&&t[i[parseInt(r.toString(),10)]]instanceof Date&&e[i[parseInt(r.toString(),10)]].getTime()===t[i[parseInt(r.toString(),10)]].getTime())){n=!1;break}return n},e.prototype.getBatchEditedRecords=function(e,t){var i={},n=this.parent.getBatchChanges(),r=[],s=[];Object.keys(n).length&&(r=n.changedRecords,s=n.addedRecords);var o={cancel:!1};this.parent.notify("immutable-batch-cancel",{rows:t,args:o}),s.length&&("Bottom"===this.parent.editSettings.newRowPosition?t.splice(t.length-1,s.length):o.cancel||t.splice(0,s.length));for(var a=0;a<r.length;a++)i[r[parseInt(a.toString(),10)][""+e]]=a;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(an,(e+1).toString()),this.updateCellIndex(t,e)},e.prototype.updateCellIndex=function(e,t){for(var i=0;i<e.cells.length;i++)e.cells[parseInt(i.toString(),10)].setAttribute("data-index",t.toString())},e}(),xn=function(){function i(e,i){var n=this;this.frzIdx=0,this.notfrzIdx=0,this.isFirstCol=!1,this.isReplaceDragEle=!0,this.helper=function(e){var i=n.parent,r=n.draggable.currentStateTarget,s=F(r,"e-headercell");if(!i.allowReordering&&!i.allowGrouping||!t.isNullOrUndefined(s)&&s.getElementsByClassName("e-checkselectall").length>0)return!1;var o=n.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-headerclone"}),a=r.classList.contains("e-headercell")?r:s;if(!a||!i.allowReordering&&a.classList.contains("e-stackedheadercell"))return!1;var l,d=a.offsetHeight,h=a.querySelector(".e-headercelldiv")||a.querySelector(".e-stackedheadercelldiv");if(h){if((l=i.getColumnByUid(h.getAttribute("data-mappinguid")))||!a.querySelector(".e-stackedheadercelldiv")||h.innerHTML.includes("<")||(l=i.getStackedHeaderColumnByHeaderText(h.innerText.trim(),i.columns)),n.column=l,!n.column||n.column.lockColumn)return!1;o.setAttribute("data-mappinguid",n.column.uid)}if(l&&!t.isNullOrUndefined(l.headerTemplate)){if(t.isNullOrUndefined(l.headerTemplate))o.innerHTML=l.headerTemplate;else{var p=i.getColumnIndexByField(l.field),c=l.getHeaderTemplate()(t.extend({index:p},l),i,"headerTemplate",null,null,null,null,i.root),u=i.isReact&&"string"!=typeof l.headerTemplate,g=i.parentDetails&&i.parentDetails.parentInstObj&&i.parentDetails.parentInstObj.isReact;(u||g)&&i.renderTemplates(),q(o,c)}t.isNullOrUndefined(o.firstChild)||1!==o.firstChild.nodeType||(o.firstChild.style.pointerEvents="none")}else o.innerHTML=h?l.headerText:a.firstElementChild.innerHTML;return o.style.width=a.offsetWidth+"px",o.style.height=a.offsetHeight+"px",o.style.lineHeight=(d-6).toString()+"px",i.element.appendChild(o),o},this.dragStart=function(e){var t=n.parent;t.element.querySelector(".e-gridpopup").style.display="none",t.notify(Vt,{target:n.draggable.currentStateTarget,column:n.column,event:e.event})},this.drag=function(e){var i=n.parent,r=e.target;if(r){var s=t.closest(r,".e-grid"),o=n.parent.element.querySelector(".e-cloneproperties");if(!(s&&s.getAttribute("id")===i.element.getAttribute("id")||(t.classList(o,["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(Gt,{target:e.target,column:n.column,event:e.event})}},this.dragStop=function(e){var i,r=n.parent;r.element.querySelector(".e-gridpopup").style.display="none",(!F(e.target,"e-headercell")&&!F(e.target,"e-groupdroparea")||!r.allowReordering&&F(e.target,"e-headercell")||!e.helper.getAttribute("data-mappinguid")&&F(e.target,"e-groupdroparea"))&&(t.remove(e.helper),i=!0),r.notify(mi,{target:e.target,event:e.event,column:n.column,cancel:i})},this.drop=function(e){var i=n.parent,r=e.droppedElement.getAttribute("data-mappinguid"),s=t.closest(e.target,".e-grid");t.remove(e.droppedElement),s&&s.getAttribute("id")!==i.element.getAttribute("id")||!i.allowReordering&&!i.allowGrouping||i.notify(yi,{target:e.target,uid:r,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.on(ci,this.setVisible,this),this.parent.on(ui,this.colPosRefresh,this),this.parent.on(Jt,this.renderCustomToolbar,this),"Vertical"===this.parent.rowRenderingMode&&this.parent.on(ei,this.updateCustomResponsiveToolbar,this))}return i.prototype.renderPanel=function(){var e=this.parent.element.querySelector("."+Ki),t=null!=e;e=t?e:this.parent.createElement("div",{className:"e-gridheader"});var i=t?e.querySelector("."+Xi):this.parent.createElement("div",{className:Xi});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("."+Ji)),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(si,{rows:this.rows})},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=this.createTable(),t=this.getPanel().querySelector("."+Xi);return t.appendChild(e),t},i.prototype.createHeader=function(e,i){var n=this.parent;this.getTable()&&t.remove(this.getTable());var r=this.parent.createElement("table",{className:Ji,attrs:{role:"presentation"}});r.style.cssText="border-collapse: separate; border-spacing: .25px;";var s=this.createHeaderContent(i),o=s.thead,a=this.parent.createElement(ln,{className:this.parent.frozenRows||this.parent.isRowPinned||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow?"":"e-hide",attrs:{role:"rowgroup"}});this.caption=this.parent.createElement("caption",{innerHTML:this.parent.element.id+"_header_table",className:"e-hide"});for(var l,d=this.parent.createElement(dn),h=this.parent.createElement("tr",{attrs:{role:"row"},className:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow?"e-hide":""}),p=this.rows=s.rows,c=0,u=p.length;c<u;c++)for(var g=0,f=p[parseInt(c.toString(),10)].cells.length;g<f;g++)l=this.parent.createElement("td"),h.appendChild(l);return(n.allowFiltering||n.allowSorting||n.allowGrouping)&&r.classList.add("e-sortfilter"),this.updateColGroup(d),a.appendChild(h),r.appendChild(this.caption),r.appendChild(this.setColGroup(d)),r.appendChild(o),r.appendChild(a),r},i.prototype.createTable=function(e){return void 0===e&&(e=null),this.createHeader(e)},i.prototype.createHeaderContent=function(t){var i=this.parent,n=i.getColumns(),r=this.parent.createElement("thead",{attrs:{role:"rowgroup"}}),s=this.parent.createElement("tr",{className:"e-columnheader",attrs:{role:"row"}}),o=new fn(this.serviceLocator,e.CellType.Header,i);o.element=s;var a,l=[];this.colDepth=we(i.columns);for(var d=0,h=this.colDepth;d<h;d++)l[parseInt(d.toString(),10)]=this.generateRow(d),l[parseInt(d.toString(),10)].cells=[];if(l=this.ensureColumns(l),l=this.getHeaderCells(l,t),i.isRowDragable()&&"Right"===this.parent.getFrozenMode())for(var d=0,h=l.length;d<h;d++)l[parseInt(d.toString(),10)].cells.push(this.generateCell({},e.CellType.RowDragHIcon));n.filter(function(e){return e.headerTemplate}).length&&(this.parent.isReact||this.parent.isVue)&&ut(this.parent,["headerTemplate"]),n&&n.length&&!n[0].visible?this.parent&&this.parent.renderModule&&(this.parent.renderModule.isFirstColumnHidden=!0):this.parent&&this.parent.renderModule&&(this.parent.renderModule.isFirstColumnHidden=!1);for(var d=0,h=this.colDepth;d<h;d++)a=o.render(l[parseInt(d.toString(),10)],n),this.parent.rowHeight&&a.querySelector(".e-headercell")&&(a.style.height=this.parent.rowHeight+"px"),Xe(a),r.appendChild(a);var p=Array.from(r.querySelectorAll(".e-headercell:not(.e-hide)"));return this.parent.allowResizing&&p.length>0&&(r.querySelector(".e-lastcell")&&r.querySelector(".e-lastcell").classList.contains("e-hide")?p[p.length-1].classList.add("e-last-visible-cell"):r.querySelector(".e-laststackcell")&&r.querySelector(".e-laststackcell").classList.contains("e-hide")&&p[p.length-1].classList.add("e-last-visible-stack-cell")),{thead:r,rows:l}},i.prototype.updateColGroup=function(e){var i,n=this.parent.getColumns(),r=this.parent.getColumnIndexesInView();if(e.id=this.parent.element.id+dn,this.parent.allowGrouping)for(var s=0,o=this.parent.groupSettings.columns.length;s<o;s++)this.parent.enableColumnVirtualization&&-1===r.indexOf(s)||(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 s=0,o=n.length;s<o;s++)i=this.parent.createElement("col"),!1===n[parseInt(s.toString(),10)].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,n=this.parent.getColumnIndexesInView(),r=0,s=t.length;r<s;r++){var o=0===r?this.colDepth:0;if(i.allowGrouping)for(var a=0,l=i.groupSettings.columns.length;a<l;a++)if(!this.parent.enableColumnVirtualization||-1!==n.indexOf(a)){h=this.generateCell({},e.CellType.HeaderIndent);this.colDepth>1&&(h.rowSpan=o),t[parseInt(r.toString(),10)].cells.push(h)}if(i.detailTemplate||i.childGrid){var d={};this.parent.notify("detail-indentcell-info",d);h=this.generateCell(d,e.CellType.DetailHeader);this.colDepth>1&&(h.rowSpan=o),t[parseInt(r.toString(),10)].cells.push(h)}if(i.isRowDragable()&&"Right"!==this.parent.getFrozenMode()){var h=this.generateCell({},e.CellType.RowDragHIcon);this.colDepth>1&&(h.rowSpan=o),t[parseInt(r.toString(),10)].cells.push(h)}}return t},i.prototype.getHeaderCells=function(e,i){var n=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(s=0;s<(t.isNullOrUndefined(r)?0:r.length);s++)this.lockColsRendered=!1,e=this.appendCells(r[parseInt(s.toString(),10)],e,0,0===s,!1,s===r.length-1,n,i,!1);for(var s=0,o=t.isNullOrUndefined(r)?0:r.length;s<o;s++)this.notfrzIdx=0,this.lockColsRendered=!0,e=this.appendCells(r[parseInt(s.toString(),10)],e,0,0===s,!1,s===o-1,n,i,!1);return e},i.prototype.appendCells=function(t,i,n,r,s,o,a,l,d){var h=o?d?"e-laststackcell":"e-lastcell":"",p=!this.parent.lockcolPositionCount||t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered;if(t.columns){this.isFirstCol=!1;var c=this.getCellCnt(t,0);if(c){var u=this.getStackedLockColsCount(t,0);(0===this.parent.lockcolPositionCount||!this.lockColsRendered&&0!==u||this.lockColsRendered&&c-u!=0)&&i[parseInt(n.toString(),10)].cells.push(new Vi({cellType:e.CellType.StackedHeader,column:t,colSpan:this.getColSpan(c,u),className:r?"":s?"e-firstcell":""}))}if(this.parent.lockcolPositionCount&&!this.lockColsRendered)for(g=0;g<t.columns.length;g++)i=this.appendCells(t.columns[parseInt(g.toString(),10)],i,n+1,r,0===g,g===t.columns.length-1&&o,a,l,!1);if(this.lockColsRendered)for(var g=0,f=t.columns.length;g<f;g++){r=r&&0===g;var m=this.isFirstCol=t.columns[parseInt(g.toString(),10)].visible&&!r,y=g===f-1&&o;i=this.appendCells(t.columns[parseInt(g.toString(),10)],i,n+1,r,m&&!y,y,a,l,!0)}}else p&&i[parseInt(n.toString(),10)].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-n,(r?"":s?"e-firstcell":"")+h,n,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.getStackedLockColsCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getStackedLockColsCount(e.columns[parseInt(i.toString(),10)],t);else e.lockColumn&&t++;return t},i.prototype.getColSpan=function(e,t){return e=this.lockColsRendered?e-t:t},i.prototype.generateRow=function(e){return new ji({})},i.prototype.generateCell=function(e,i,n,r,s,o){var a={visible:e.visible,isDataCell:!1,isTemplate:!t.isNullOrUndefined(e.headerTemplate),rowID:"",column:e,cellType:i,rowSpan:n,className:r,index:s,colIndex:o};return(!a.rowSpan||a.rowSpan<2)&&delete a.rowSpan,new Vi(a)},i.prototype.setVisible=function(e){for(var i,n,r=this.parent,s=0,o=e.length;s<o;s++){var a=e[parseInt(s.toString(),10)];n=r.getNormalizedColumnIndex(a.uid),i=a.visible?"":"none",t.setStyleAttribute(this.getColGroup().children[parseInt(n.toString(),10)],{display:i}),r.editSettings.showAddNewRow&&r.element.querySelector(".e-addedrow")&&t.setStyleAttribute(r.element.querySelector(".e-addedrow").querySelector("colgroup").childNodes[parseInt(n.toString(),10)],{display:i})}this.refreshUI(),this.parent.editSettings.showAddNewRow&&(this.parent.isAddNewRow=!0)},i.prototype.colPosRefresh=function(){this.refreshUI()},i.prototype.refreshUI=function(){var e=this.getPanel();this.toggleStackClass(e);var i=this.getTable();if(i){this.droppableDestroy(),this.parent.reorderModule&&(this.parent.reorderModule.element=null,this.parent.reorderModule.destElement=null),t.remove(i),this.parent.editSettings.showAddNewRow&&!this.parent.isAddNewRow&&i.querySelector(".e-addedrow")&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(i.querySelector(".e-addedrow").classList.add("e-addrow-removed"),this.parent.isAddNewRow=!0),i.removeChild(i.childNodes[1]),i.removeChild(i.childNodes[1]);var n=this.parent.createElement(dn),r=this.createHeaderContent(void 0);this.rows=r.rows,i.insertBefore(r.thead,i.childNodes[1]),this.updateColGroup(n),i.insertBefore(this.setColGroup(n),i.childNodes[1]),this.appendContent(i),this.parent.notify(ri,{}),this.widthService.setWidthToColumns(),this.parent.updateDefaultCursor(),this.initializeHeaderDrag(),this.initializeHeaderDrop();for(var s=[].slice.call(e.querySelectorAll("tr.e-columnheader")),o=0,a=s;o<a.length;o++){var l=a[o],d=[].slice.call(l.getElementsByClassName("e-grouptopleftcell"));d.length&&d[d.length-1].classList.add("e-lastgrouptopleftcell")}this.parent.notify(si,{rows:this.rows}),this.parent.enableColumnVirtualization&&F(i,"e-movableheader")&&this.parent.notify(si,{rows:this.rows,args:{isFrozen:!1,isXaxis:!0}}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&Z(s,!0)}var h=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)");t.isNullOrUndefined(h)||(h.tabIndex=0)},i.prototype.toggleStackClass=function(e){var i=this.parent.columns;!t.isNullOrUndefined(i)&&i.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("."+Xi).appendChild(e)},i.prototype.getCellCnt=function(e,t){if(e.columns)for(var i=0,n=e.columns.length;i<n;i++)t=this.getCellCnt(e.columns[parseInt(i.toString(),10)],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}),this.parent.on(pi,this.droppableDestroy,this))},i.prototype.initializeHeaderDrop=function(){var e=this.parent;this.droppable=new t.Droppable(e.getHeaderContent(),{accept:".e-dragclone",drop:this.drop}),this.parent.on(pi,this.droppableDestroy,this)},i.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy(),this.draggable&&!this.draggable.isDestroyed&&this.draggable.destroy()},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"}),n=t.createElement("div",{className:"e-toolbar-items"}),s=t.createElement("div",{className:"e-toolbar-left"}),o=this.parent.allowFiltering&&this.parent.allowSorting?2:1,a=0;a<o;a++){var l=t.createElement("div",{className:"e-toolbar-item e-gridresponsiveicons e-icons e-tbtn-align"}),d=1===o?this.parent.allowSorting?"sort":"filter":1===a?"sort":"filter",h=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"+d+"-icon e-icons"});h.appendChild(p),new r.Button({cssClass:this.parent.cssClass?this.parent.cssClass:""}).appendTo(h),h.onclick=function(t){t.target.classList.contains("e-ressort-btn")||t.target.classList.contains("e-ressort-icon")||t.target.querySelector(".e-ressort-icon")?e.parent.showResponsiveCustomSort():e.parent.showResponsiveCustomFilter()},l.appendChild(h),s.appendChild(l)}n.appendChild(s),i.appendChild(n),t.element.insertBefore(i,this.parent.element.querySelector("."+Ki))}else t.enableAdaptiveUI&&!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}(),Rn=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:_i,attrs:{role:"gridcell",tabindex:"-1"}}),this.rowChkBox=this.parent.createElement("input",{className:"e-checkselect",attrs:{type:"checkbox","aria-label":this.localizer.getConstant("SelectRow")}})}return i.prototype.getGui=function(){return""},i.prototype.format=function(e,i,n){if(!t.isNullOrUndefined(e.format)){if("number"===e.type&&isNaN(parseInt(i,10))&&(i=null),"dateonly"===e.type&&"string"==typeof i&&i){var r=i.split(/[^0-9.]/);i=new Date(parseInt(r[0],10),parseInt(r[1],10)-1,parseInt(r[2],10))}i=this.formatter.toView(i,e.getFormatter())}return t.isNullOrUndefined(i)?"":i.toString()},i.prototype.evaluate=function(e,i,n,r,s,o){var a,l;if(i.column.template){var d=this.parent.isReact&&"string"!=typeof i.column.template&&!(i.column.template.prototype&&i.column.template.prototype.CSPTemplate),h=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,p=this.parent.printGridParent&&this.parent.printGridParent.isReact,c=["data-index"],u=Se({},n,(a={},a.foreignKeyData=s,a.column=i.column,a)),g=this.parent.element.id+i.column.uid,f="isStringTemplate";if(d||h||p){var m={index:r[c[0]]};i.column.getColumnTemplate()(t.extend(m,u),this.parent,"columnTemplate",g,this.parent[""+f],null,e)}else l=i.column.getColumnTemplate()(t.extend({index:r[c[0]]},u),this.parent,"template",g,this.parent[""+f],void 0,void 0,this.parent.root);return d||h||p||q(e,l),this.parent.notify("template-result",{template:l}),l=null,i.column.templateOptions.enableAriaLabel&&e.setAttribute("aria-label",e.innerText+this.localizer.getConstant("TemplateCell")+this.localizer.getConstant("ColumnHeader")+i.column.headerText),!1}return!0},i.prototype.invokeFormatter=function(e,i,n){return t.isNullOrUndefined(e.formatter)||(i=u(e.formatter,"getValue")?(new(0,e.formatter)).getValue(e,n):"function"==typeof e.formatter?e.formatter(e,n):e.formatter.getValue(e,n)),i},i.prototype.render=function(e,t,i,n,r){return this.refreshCell(e,t,i,r)},i.prototype.refreshTD=function(e,i,n,r){var s="Batch"===this.parent.editSettings.mode&&e.classList.contains("e-editedbatchcell");if(this.parent.isReact){var o=e.cellIndex,a=e.parentElement;t.remove(e);var l=this.refreshCell(i,n,r,s);this.cloneAttributes(l,e),a.cells.length!==o-1?a.insertBefore(l,a.cells[parseInt(o.toString(),10)]):a.appendChild(l)}else{var d=this.refreshCell(i,n,r,s);e.innerHTML="";var h=d.getAttribute("aria-label");h&&e.setAttribute("aria-label",h);for(var p=0,c=[].slice.call(d.childNodes);p<c.length;p++){var u=c[p];e.appendChild(u)}}},i.prototype.cloneAttributes=function(e,t){for(var i,n=t.attributes,r=n.length;r--;)i=n[parseInt(r.toString(),10)],e.setAttribute(i.name,i.value)},i.prototype.refreshCell=function(e,i,n,s){var o,a,l=this.element.cloneNode(),d=e.column;e.isForeignKey&&(a=e.foreignKeyData&&e.foreignKeyData[0]?e.foreignKeyData[0]:(o={},o[d.foreignKeyValue]=d.format?null:"",o));var h=this.getGui(),p=e.isForeignKey?this.getValue(d.foreignKeyValue,a,d):this.getValue(d.field,i,d);if("date"!==d.type&&"datetime"!==d.type||t.isNullOrUndefined(p)||(p=new Date(p)),"dateonly"===d.type&&!t.isNullOrUndefined(p)&&"string"==typeof p){var c=p.split(/[^0-9.]/);p=new Date(parseInt(c[0],10),parseInt(c[1],10)-1,parseInt(c[2],10))}if(p=this.format(d,p,i),h=p.toString(),"boolean"===d.type&&!d.displayAsCheckBox){var u="true"!==p&&"false"!==p?null:"true"===p?"True":"False";h=u?this.localizer.getConstant(u):h}var g=this.invokeFormatter(d,p,i);if(h=t.isNullOrUndefined(d.formatter)?h:t.isNullOrUndefined(g)?"":g.toString(),this.evaluate(l,e,i,n,a,s)&&"checkbox"!==d.type)this.appendHtml(l,this.parent.sanitize(h),d.getDomSetter?d.getDomSetter():"innerHTML");else if("checkbox"===d.type){l.classList.add($i),p=!!this.parent.selectionSettings.persistSelection&&"true"===p;m=r.createCheckBox(this.parent.createElement,!1,{checked:p,label:" "});this.parent.cssClass&&t.addClass([m],[this.parent.cssClass]),this.rowChkBox.id="checkbox-"+e.rowID,m.insertBefore(this.rowChkBox.cloneNode(),m.firstChild),l.appendChild(m)}if("Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(e.isSelected=!0),this.setAttributes(l,e,n),"boolean"===d.type&&d.displayAsCheckBox){var f=isNaN(parseInt(p.toString(),10))?"true"===p:parseInt(p.toString(),10)>0,m=r.createCheckBox(this.parent.createElement,!1,{checked:f,label:" "});l.innerHTML="",l.classList.add("e-gridchkbox-cell"),m.classList.add("e-checkbox-disabled"),this.parent.cssClass&&t.addClass([m],[this.parent.cssClass]),l.appendChild(m)}if(l.classList.contains("e-summarycell")&&!i.key){var y=l.getAttribute("data-mappinguid");d=this.parent.getColumnByUid(y),l.setAttribute("aria-label",h+this.localizer.getConstant("ColumnHeader")+e.column.headerText)}return this.parent.isFrozenGrid()&&(!i||i&&!i.key)&&$e(this.parent,d,l),l},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 n=t.column;if(this.buildAttributeFromCell(e,t,"checkbox"===n.type),R(e,i),R(e,t.attributes),n.customAttributes&&R(e,n.customAttributes),"Vertical"===this.parent.rowRenderingMode&&R(e,{"data-cell":n.headerText}),n.textAlign){var r={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"};r[n.textAlign.toLowerCase()]&&e.classList.add(r[n.textAlign.toLowerCase()])}"Clip"===n.clipMode||!n.clipMode&&"Clip"===this.parent.clipMode?e.classList.add("e-gridclip"):"EllipsisWithTooltip"!==n.clipMode&&(n.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode||this.parent.allowTextWrap&&("Content"===this.parent.textWrapSettings.wrapMode||"Both"===this.parent.textWrapSettings.wrapMode))||"checkbox"!==n.type&&e.classList.add("e-ellipsistooltip")},i.prototype.buildAttributeFromCell=function(i,n,r){var s={},o=[];n.colSpan&&(s.colSpan=n.colSpan),n.rowSpan&&(s.rowSpan=n.rowSpan),n.isTemplate&&o.push("e-templatecell"),n.isSelected&&(o.push.apply(o,["e-selectionbackground","e-active"]),r&&i.querySelector(".e-frame").classList.add("e-check")),n.isColumnSelected&&o.push.apply(o,["e-columnselection"]),n.cellType===e.CellType.Header?s[on]=n.colIndex+1:t.isNullOrUndefined(n.index)||(s[on]=n.index+1),n.visible||o.push("e-hide"),s.class=o,R(i,s)},i.prototype.getValue=function(e,t,i){return i.valueAccessor(e,t,i)},i}(),Dn=function(){function e(){}return e.prototype.setOptions=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)p(e,Tn[i[parseInt(n.toString(),10)]],t[i[parseInt(n.toString(),10)]])},e.prototype.setExpand=function(e,t){p(e,Tn.expand,t)},e.prototype.setSort=function(e,t){p(e,Tn.sort,t,"boolean"==typeof t)},e.prototype.setBusy=function(e,t){p(e,Tn.busy,t),p(e,Tn.invalid,null,!0)},e.prototype.setGrabbed=function(e,t,i){p(e,Tn.grabbed,t,i)},e.prototype.setDropTarget=function(e,t){p(e,Tn.dropeffect,"copy",!t)},e}(),Tn={expand:"aria-expanded",role:"role",datarole:"data-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"},En=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),On=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell",attrs:{tabindex:"-1",role:"columnheader"}}),t.ariaService=new Dn,t.hTxtEle=t.parent.createElement("span",{className:"e-headertext"}),t.sortEle=t.parent.createElement("div",{className:"e-sortfilterdiv e-icons",attrs:{"aria-hidden":"true"}}),t.gui=t.parent.createElement("div"),t.chkAllBox=t.parent.createElement("input",{className:"e-checkselectall",attrs:{type:"checkbox","aria-label":t.localizer.getConstant("SelectAllCheckbox")}}),t}return En(i,e),i.prototype.getGui=function(){return this.gui.cloneNode()},i.prototype.render=function(e,t,i){var n=this.element.cloneNode(),r=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter",attrs:{"aria-hidden":"true"}});return this.prepareHeader(e,n,r)},i.prototype.refresh=function(e,t){this.clean(t);var i=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter",attrs:{"aria-hidden":"true"}});return this.prepareHeader(e,t,i)},i.prototype.clean=function(e){e.innerHTML=""},i.prototype.prepareHeader=function(e,i,n){var s,o=e.column,a={},l="",d=this.getGui(),h=this.parent.createElement("div",{className:"e-headercell-container"});if(t.attributes(d,{"data-mappinguid":o.uid,class:"e-headercelldiv"}),t.isNullOrUndefined(o.headerValueAccessor)||(s=this.getValue(o.headerText,o)),this.parent.rowHeight&&this.parent.allowSorting&&o.allowSorting&&!t.isNullOrUndefined(o.field)&&i.classList.add("e-sort-icon"),"checkbox"!==o.type){var p=o.headerText;t.isNullOrUndefined(s)||(p=s);var c=this.hTxtEle.cloneNode();c[o.getDomSetter()]=this.parent.sanitize(p),d.appendChild(c)}else{o.editType="booleanedit";var u=r.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "});this.chkAllBox.id="checkbox-"+o.uid,u.insertBefore(this.chkAllBox.cloneNode(),u.firstChild),this.parent.cssClass&&t.addClass([u],[this.parent.cssClass]),d.appendChild(u),d.classList.add("e-headerchkcelldiv"),h.classList.add("e-header-checkbox")}if(this.buildAttributeFromCell(i,e),h.appendChild(d),h.appendChild(this.sortEle.cloneNode()),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&o.allowFiltering&&!t.isNullOrUndefined(o.field)&&(!this.parent.showColumnMenu||!o.showColumnMenu)){t.attributes(n,{"data-mappinguid":"e-flmenu-"+o.uid}),l=l.length?l+". "+this.localizer.getConstant("FilterDescription"):this.localizer.getConstant("FilterDescription"),i.classList.add("e-fltr-icon");var g=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==g.length)for(var f=this.parent.getForeignKeyColumns(),m=0;m<this.parent.columns.length;m++)for(var y=0;y<this.parent.filterSettings.columns.length;y++)if(this.parent.filterSettings.columns[parseInt(y.toString(),10)].field===o.field||f.length&&o.foreignKeyValue===this.parent.filterSettings.columns[parseInt(y.toString(),10)].field){n.classList.add("e-filtered"),g.push(o.field);break}h.appendChild(n.cloneNode())}this.appendHtml(i,h),e.className&&i.classList.add(e.className),o.customAttributes&&R(i,o.customAttributes),this.parent.allowSorting&&o.allowSorting&&(a.sort="none",l=l.length?l+". "+this.localizer.getConstant("SortDescription"):this.localizer.getConstant("SortDescription")),(this.parent.allowGrouping&&o.allowGrouping||this.parent.allowReordering&&o.allowReordering)&&(a.grabbed=!1,l=l.length?l+". "+this.localizer.getConstant("GroupDescription"):this.localizer.getConstant("GroupDescription")),this.parent.showColumnMenu&&"checkbox"!==o.type&&!o.template&&(l=l.length?l+". "+this.localizer.getConstant("ColumnMenuDescription"):this.localizer.getConstant("ColumnMenuDescription")),i=this.extendPrepareHeader(o,i);var v,S=this.parent,C=S.getColumnIndexByField(o.field);if(!t.isNullOrUndefined(o.headerTemplate)){var w=S.element.id+o.uid+"headerTemplate",b="isStringTemplate",I=o,x=this.parent.isReact&&"string"!=typeof o.headerTemplate&&!(o.headerTemplate.prototype&&o.headerTemplate.prototype.CSPTemplate),D=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,T=this.parent.printGridParent&&this.parent.printGridParent.isReact,E=this.parent.createElement("div",{className:"e-headertext"}),O=i.querySelector(".e-headercelldiv");if(x||D||T){var k={index:C};i.querySelector(".e-headertext")&&i.querySelector(".e-headertext").remove(),O.appendChild(E),o.getHeaderTemplate()(t.extend(k,I),S,"headerTemplate",w,this.parent[""+b],null,O.querySelector(".e-headertext")),this.parent.renderTemplates()}else v=o.getHeaderTemplate()(t.extend({index:C},I),S,"headerTemplate",w,this.parent[""+b],void 0,void 0,this.parent.root),O.innerHTML="",!t.isNullOrUndefined(v)&&v[0]&&v[0].classList&&v[0].classList.contains("e-headertext")?q(O,v):(q(E,v),O.appendChild(E))}if(this.ariaService.setOptions(i,a),!t.isNullOrUndefined(o.headerTextAlign)||!t.isNullOrUndefined(o.textAlign)){var A=o.headerTextAlign||o.textAlign;"right"===A.toLowerCase()||"left"===A.toLowerCase()?i.classList.add("right"===A.toLowerCase()?"e-rightalign":"e-leftalign"):"center"===A.toLowerCase()?i.classList.add("e-centeralign"):"justify"===A.toLowerCase()&&i.classList.add("e-justifyalign")}if("Clip"===o.clipMode||!o.clipMode&&"Clip"===this.parent.clipMode?i.classList.add("e-gridclip"):"EllipsisWithTooltip"!==o.clipMode&&(o.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode)||S.allowTextWrap&&("Header"===S.textWrapSettings.wrapMode||"Both"===S.textWrapSettings.wrapMode)||"checkbox"!==o.type&&i.classList.add("e-ellipsistooltip"),l){var F=this.parent.createElement("span",{id:"headerTitle-"+o.uid,innerHTML:l});F.style.display="none",h.appendChild(F),i.setAttribute("aria-describedby",F.id)}i.setAttribute("aria-rowspan",(t.isNullOrUndefined(e.rowSpan)?1:e.rowSpan).toString()),i.setAttribute("aria-colspan","1");var M=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;if((this.parent.isReact&&this.parent.requireTemplateRef||M&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&!t.isNullOrUndefined(o.headerTemplate)){var L=this;L.parent.renderTemplates(function(){var t=i.querySelectorAll(".e-headertext");if(t)for(var n=1;n<t.length;n++)t[parseInt(n.toString(),10)].classList.remove("e-headertext");L.parent.trigger("headerCellInfo",{cell:e,node:i})})}else this.parent.trigger("headerCellInfo",{cell:e,node:i});return this.parent.isFrozenGrid()&&$e(this.parent,o,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 n=this.parent.createElement("div",{className:"e-icons e-columnmenu",attrs:{"aria-hidden":"true"}}),r=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==r.length)for(var s=0;s<this.parent.columns.length;s++)for(var o=0;o<this.parent.filterSettings.columns.length;o++)if(this.parent.filterSettings.columns[parseInt(o.toString(),10)].field===e.field){n.classList.add("e-filtered"),r.push(e.field);break}i.classList.add("e-fltr-icon"),i.querySelector(".e-headercell-container").appendChild(n)}if(this.parent.allowResizing){var a=this.parent.createElement("div");a.className=e.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",i.appendChild(a)}return i},i.prototype.appendHtml=function(e,t){return e.appendChild(t),e},i}(Rn),kn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),An=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:{tabindex:"-1",role:"columnheader"}}),t}return kn(i,e),i.prototype.render=function(e,i,n){var r=this.element.cloneNode(),s=this.parent.createElement("div",{className:"e-headercell-container e-stacked-header"}),o=this.parent.createElement("div",{className:"e-stackedheadercelldiv",attrs:{"data-mappinguid":e.column.uid}}),a=e.column;if(s.appendChild(o),r.appendChild(s),t.isNullOrUndefined(a.headerTemplate)?this.appendHtml(o,this.parent.sanitize(a.headerText),a.getDomSetter()):q(o,a.getHeaderTemplate()(a,this.parent,"headerTemplate",null,null,null,null,this.parent.root)),e.column.toolTip&&r.setAttribute("title",e.column.toolTip),"Clip"===a.clipMode||!a.clipMode&&"Clip"===this.parent.clipMode?r.classList.add("e-gridclip"):("EllipsisWithTooltip"===a.clipMode||!a.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&r.classList.add("e-ellipsistooltip"),!t.isNullOrUndefined(e.column.textAlign)){var l={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"};l[e.column.textAlign.toLowerCase()]&&r.classList.add(l[e.column.textAlign.toLowerCase()])}if(e.column.customAttributes&&R(r,e.column.customAttributes),r.setAttribute("colspan",e.colSpan.toString()),r.setAttribute("aria-colspan",e.colSpan.toString()),r.setAttribute("aria-rowspan","1"),this.parent.allowResizing){var d=this.parent.createElement("div");d.className=e.column.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",r.appendChild(d)}if(e.className&&r.classList.add(e.className),this.parent.trigger("headerCellInfo",{cell:e,node:r}),"Left"===Qe(a))if(r.classList.add("e-leftfreeze"),"Left"===a.border&&r.classList.add("e-freezeleftborder"),0===a.index)Ye(r,30*this.parent.getIndentCount(),this.parent.enableRtl,"Left");else{for(var h=this.parent.getColumns(),p=30*this.parent.getIndentCount(),c=0;c<h.length&&!(a.index<h[parseInt(c.toString(),10)].index);c++)h[parseInt(c.toString(),10)].visible&&(p+=parseFloat(h[parseInt(c.toString(),10)].width.toString()));Ye(r,p,this.parent.enableRtl,"Left")}else if("Right"===Qe(a)){r.classList.add("e-rightfreeze");for(var h=this.parent.getColumns(),p="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,c=h.length-1;c>=0&&!(Ke(a,h[parseInt(c.toString(),10)].uid)||a.index>h[parseInt(c.toString(),10)].index);c--)h[parseInt(c.toString(),10)].visible&&(p+=parseFloat(h[parseInt(c.toString(),10)].width.toString()));Ye(r,p,this.parent.enableRtl,"Right"),"Right"===a.border&&r.classList.add("e-freezerightborder")}else if("Fixed"===Qe(a)){r.classList.add("e-fixedfreeze");var h=this.parent.getColumns(),p=0;this.parent.getVisibleFrozenLeftCount()?p=30*this.parent.getIndentCount():"Right"===this.parent.getFrozenMode()&&(p=30*this.parent.groupSettings.columns.length);for(c=0;c<h.length;c++)a.index>h[parseInt(c.toString(),10)].index&&("Left"===h[parseInt(c.toString(),10)].freeze||h[parseInt(c.toString(),10)].isFrozen||"Fixed"===h[parseInt(c.toString(),10)].freeze)&&h[parseInt(c.toString(),10)].visible&&(p+=parseFloat(h[parseInt(c.toString(),10)].width.toString()));Ye(r,p-1,this.parent.enableRtl,"Left"),p="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0;for(c=h.length-1;c>=0;c--)if(a.index<h[parseInt(c.toString(),10)].index){if(Ke(a,h[parseInt(c.toString(),10)].uid)||a.index>h[parseInt(c.toString(),10)].index)break;"Right"!==h[parseInt(c.toString(),10)].freeze&&"Fixed"!==h[parseInt(c.toString(),10)].freeze||h[parseInt(c.toString(),10)].visible&&(p+=parseFloat(h[parseInt(c.toString(),10)].width.toString()))}Ye(r,p-1,this.parent.enableRtl,"Right")}else r.classList.add("e-unfreeze");return r},i}(Rn),Fn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Mn=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 Fn(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return R(i,e.attributes),i},t}(Rn),Ln=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pn=function(i){function n(){var e=null!==i&&i.apply(this,arguments)||this;return e.cellUid=0,e.element=e.parent.createElement("TD",{className:"e-groupcaption",attrs:{id:e.parent.element.id+"captioncell",tabindex:"-1"}}),e}return Ln(n,i),n.prototype.render=function(i,n){this.element.id=this.parent.element.id+"captioncell"+this.cellUid++;var r,s,o,a=this.element.cloneNode(),l=this.parent,d=i.column,h=d.getDomSetter?d.getDomSetter():"innerHTML";n.headerText=i.column.headerText,i.isForeignKey&&(s=this.format(i.column,i.column.valueAccessor("foreignKey",n,i.column)));for(var p=i.isForeignKey?s:i.column.enableGroupByFormat?n.key:this.format(i.column,i.column.valueAccessor("key",n,i.column)),c=0;c<l.aggregates.length;c++)for(var u=this,g=0;g<l.aggregates[parseInt(c.toString(),10)].columns.length&&"break"!==function(i){if(l.getVisibleColumns()[0].field===l.aggregates[parseInt(c.toString(),10)].columns[parseInt(i.toString(),10)].field&&l.aggregates[parseInt(c.toString(),10)].columns[parseInt(i.toString(),10)].groupCaptionTemplate){var r=l.aggregates[parseInt(c.toString(),10)].columns[parseInt(i.toString(),10)].groupCaptionTemplate;if("string"==typeof r&&r.includes("$"))o=l.aggregates[parseInt(c.toString(),10)].columns[parseInt(i.toString(),10)].groupCaptionTemplate.split("$")[0]+n[l.getVisibleColumns()[0].field][l.aggregates[parseInt(c.toString(),10)].columns[parseInt(i.toString(),10)].type]+l.aggregates[parseInt(c.toString(),10)].columns[parseInt(i.toString(),10)].groupCaptionTemplate.split("}")[1];else{var s=l.aggregates[parseInt(c.toString(),10)].columns[parseInt(i.toString(),10)],d=s.getTemplate(e.CellType.CaptionSummary);if(!t.isNullOrUndefined(d)){var h=d.fn(n[s.columnName],u.parent,d.property,""),p=u.parent.printGridParent&&u.parent.printGridParent.isReact;(u.parent.isReact||p)&&"string"!=typeof s.groupCaptionTemplate?u.parent.renderTemplates(function(){h&&h.length&&(t.isNullOrUndefined(l.groupSettings.captionTemplate)?a.innerText+=" "+h[0].textContent:a.appendChild(h[0]))}):h&&h.length&&(o=t.isNullOrUndefined(l.groupSettings.captionTemplate)?h[0].textContent:h)}}return"break"}}(g);g++);if(t.isNullOrUndefined(l.groupSettings.captionTemplate))l.groupSettings.enableLazyLoading?a[""+h]=this.parent.sanitize(i.column.headerText)+": "+this.parent.sanitize(p)+(o?" "+o:""):a[""+h]=this.parent.sanitize(i.column.headerText)+": "+this.parent.sanitize(p)+" - "+n.count+" "+(n.count<2?this.localizer.getConstant("Item"):this.localizer.getConstant("Items"))+(o?" "+o:"");else{var f=this.parent.isReact&&"string"!=typeof l.groupSettings.captionTemplate&&!(l.groupSettings.captionTemplate.prototype&&l.groupSettings.captionTemplate.prototype.CSPTemplate),m=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,y=this.parent.printGridParent&&this.parent.printGridParent.isReact;if(f||m||y){var v=l.element.id+"captionTemplate";n.groupKey=n.key,x(l.groupSettings.captionTemplate)(n,this.parent,"captionTemplate",v,null,null,a),this.parent.renderTemplates()}else r=this.parent.isVue||l.parentDetails&&l.parentDetails.parentInstObj&&l.parentDetails.parentInstObj.isVue?x(l.groupSettings.captionTemplate)(n,this.parent,"captionTemplate",null,null,null,null,l.root):x(l.groupSettings.captionTemplate)(n);f||m||y||(q(a,r),o&&o.length&&o[0].textContent&&a.appendChild(o[0]))}return a.setAttribute("colspan",i.colSpan.toString()),a.setAttribute("aria-label",a.innerHTML+this.localizer.getConstant("GroupCaption")),a.setAttribute("title",a.textContent),a},n}(Rn),Nn=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 Ln(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.innerHTML=" ",i.setAttribute("colspan",e.colSpan.toString()),i},t}(Rn),Bn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zn=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Bn(i,t),i.prototype.render=function(t,i,n,r){var s=this.element.cloneNode();return s.setAttribute("data-mappingname",i.field),s.setAttribute("data-mappingvalue",i.key),s.setAttribute("aria-expanded",r?"true":"false"),s.setAttribute("tabindex","-1"),this.parent.infiniteScrollSettings&&this.parent.infiniteScrollSettings.enableCache&&!this.parent.groupSettings.enableLazyLoading?(t.cellType=e.CellType.Indent,s.className=r?"e-recordplusexpand e-disablepointer":"e-recordpluscollapse e-disablepointer"):(s.className=r?"e-recordplusexpand":"e-recordpluscollapse",s.appendChild(this.parent.createElement("a",{className:r?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow",attrs:{href:"#",title:r?this.localizer.getConstant("Expanded"):this.localizer.getConstant("Collapsed")}}))),s},i}(Mn),qn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Un=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 qn(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:""})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan&&(i.style.display="none")),i},t}(Rn),Hn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),jn=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 Hn(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-emptycell"})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan&&(i.style.display="none")),i},t}(Rn),Vn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Gn=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",tabindex:"-1"}}),t}return Vn(i,e),i.prototype.render=function(e,i,n){var r=this.element.cloneNode();return n&&!t.isNullOrUndefined(n.class)?(r.className="",r.className=n.class,r.appendChild(this.parent.createElement("a",{className:"e-icons e-dtdiagonaldown e-icon-gdownarrow",attrs:{href:"#",title:this.localizer.getConstant("Expanded")}}))):r.appendChild(this.parent.createElement("a",{className:"e-icons e-dtdiagonalright e-icon-grightarrow",attrs:{href:"#",title:this.localizer.getConstant("Collapsed")}})),e.isSelected&&r.classList.add("e-selectionbackground","e-active"),r},i}(Rn),_n=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Kn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-rowdragdrop e-rowdragdropcell",attrs:{tabindex:"-1",role:"gridcell"}}),t}return _n(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",attrs:{"aria-hidden":"true"}})),e.isSelected&&(i.classList.add("e-selectionbackground"),i.classList.add("e-active")),(this.parent.getVisibleFrozenRightCount()||this.parent.getVisibleFrozenLeftCount())&&(i.classList.add("e-leftfreeze"),Ye(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left")),i},t}(Rn),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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Qn=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 Wn(i,e),i.prototype.render=function(e,i){var n=this.element.cloneNode();return n.appendChild(t.createElement("div",{className:"e-emptycell"})),e&&(e.rowSpan&&n.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan&&(n.style.display="none")),(this.parent.getVisibleFrozenRightCount()||this.parent.getVisibleFrozenLeftCount())&&(n.classList.add("e-leftfreeze"),Ye(n,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left")),n},i}(Rn),Xn=function(){function n(e,t){this.emptyGrid=!1,this.counter=0,this.selectableDataKey={},this.nonselectableDataKey={},this.isFirstColumnHidden=!1,this.parent=e,this.locator=t,this.data=new Hi(e,t),this.l10n=t.getService("localization"),this.ariaService=this.locator.getService("ariaService"),this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}return n.prototype.render=function(){var t=this.parent;this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer.renderPanel(),this.contentRenderer.renderPanel(),t.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(),this.refreshDataManager()},n.prototype.refresh=function(e){var i=this;void 0===e&&(e={requestType:"refresh"});var n=this.parent;n.notify(e.requestType+"-begin",e),n.trigger(qt,e,function(r){if(void 0===r&&(r={requestType:"refresh"}),r.cancel){if(n.notify(Ti,r),"clearFilter"===r.action&&"Menu"===i.parent.filterSettings.type){i.parent.filterSettings.columns[i.parent.filterModule.filterObjIndex]=i.parent.filterModule.prevFilterObject;var s=i.parent.showColumnMenu&&i.parent.filterModule.column.showColumnMenu?".e-columnmenu":".e-icon-filter",o=i.parent.element.querySelector('[data-mappinguid="'+i.parent.filterModule.column.uid+'"]').parentElement.querySelector(s);t.isNullOrUndefined(i.parent.filterModule.prevFilterObject)||o.classList.add("e-filtered")}if("clear-filter"!==r.action||"CheckBox"!==i.parent.filterSettings.type&&"Excel"!==i.parent.filterSettings.type||(i.parent.filterSettings.columns=i.parent.filterModule.checkboxPrevFilterObject),"grouping"===r.requestType){var a=n.groupSettings.columns.indexOf(r.columnName);if(-1!==a){n.setProperties({groupSettings:{Columns:n.groupSettings.columns.splice(a,1)}},!0),n.setProperties({sortSettings:{Columns:n.sortSettings.columns.splice(a,1)}},!0);var l=n.getColumnByField(r.columnName),d=n.getColumnHeaderByField(l.field);l.visible=!t.isNullOrUndefined(d)&&!d.classList.contains("e-hide")}}}else{e&&e.pageSize&&e.previousPageSize&&e.pageSize!==e.previousPageSize&&i.parent.getDataModule().clearCache(),i.parent.notify("destroy-edit-form",r),"virtualscroll"===r.requestType&&(i.parent.getDataModule().isRemote()||"result"in i.parent.dataSource)&&r.virtualInfo&&"down"===r.virtualInfo.direction&&(i.parent.contentModule.prevInfo=r.virtualInfo),i.parent.groupModule&&r.preventFocusOnGroup&&(i.parent.groupModule.preventFocusOnGroup=r.preventFocusOnGroup);var h=["filter","clearFilter","clear-filter","add"],p=["searching","sorting","grouping","ungrouping","delete"];if(!n.allowSelection||-1===h.indexOf(r.action)&&-1===p.indexOf(r.requestType)||(n.selectionModule.rmtHdrChkbxClicked=!1,n.selectionModule.isPartialSelection&&(n.selectionModule.isHdrSelectAllClicked=!1)),n.allowPaging&&n.pageSettings.pageSizes&&n.pagerModule.pagerObj.isAllPage&&"add"===r.action&&"save"===r.requestType&&n.pagerModule.pagerObj.checkAll&&n.setProperties({pageSettings:{pageSize:n.pageSettings.pageSize+1}},!0),"delete"===r.requestType&&n.allowPaging){var c=r.data.length,u=n.pageSettings.totalRecordsCount-c;(!(n.getCurrentViewRecords().length-c)&&u&&(n.pageSettings.currentPage-1)*n.pageSettings.pageSize===u||u&&u<=c)&&(n.prevPageMoving=!0,n.setProperties({pageSettings:{totalRecordsCount:u,currentPage:Math.ceil(u/n.pageSettings.pageSize)}},!0),n.pagerModule.pagerObj.totalRecordsCount=u)}"reorder"===r.requestType&&i.parent.dataSource&&"result"in i.parent.dataSource?i.contentRenderer.refreshContentRows(r):("paging"===r.requestType||"columnstate"===r.requestType||"reorder"===r.requestType)&&i.parent.groupSettings.enableLazyLoading&&i.parent.groupSettings.columns.length&&(i.parent.enableVirtualization?i.parent.lazyLoadRender:i.parent.contentModule).getGroupCache()[i.parent.pageSettings.currentPage]?i.contentRenderer.refreshContentRows(r):i.refreshDataManager(r)}})},n.prototype.resetTemplates=function(){var e=this.parent,i=e.getColumns();if(e.detailTemplate){var n=e.element.id+"detailTemplate";t.blazorTemplates[""+n]=[],t.resetBlazorTemplate(n,"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 r=0;r<i.length;r++)i[parseInt(r.toString(),10)].template&&(t.blazorTemplates[e.element.id+i[parseInt(r.toString(),10)].uid]=[],t.resetBlazorTemplate(e.element.id+i[parseInt(r.toString(),10)].uid,"Template")),i[parseInt(r.toString(),10)].headerTemplate&&t.resetBlazorTemplate(e.element.id+i[parseInt(r.toString(),10)].uid+"headerTemplate","HeaderTemplate"),i[parseInt(r.toString(),10)].filterTemplate&&t.resetBlazorTemplate(e.element.id+i[parseInt(r.toString(),10)].uid+"filterTemplate","FilterTemplate");for(var s=0;s<e.aggregates.length;s++)for(var o=0;o<e.aggregates[parseInt(s.toString(),10)].columns.length;o++){if(e.aggregates[parseInt(s.toString(),10)].columns[parseInt(o.toString(),10)].footerTemplate){a=e.element.id+e.aggregates[parseInt(s.toString(),10)].columns[parseInt(o.toString(),10)].guid+"footerTemplate";t.resetBlazorTemplate(a,"FooterTemplate")}if(e.aggregates[parseInt(s.toString(),10)].columns[parseInt(o.toString(),10)].groupFooterTemplate){a=e.element.id+e.aggregates[parseInt(s.toString(),10)].columns[parseInt(o.toString(),10)].guid+"groupFooterTemplate";t.resetBlazorTemplate(a,"GroupFooterTemplate")}if(e.aggregates[parseInt(s.toString(),10)].columns[parseInt(o.toString(),10)].groupCaptionTemplate){var a=e.element.id+e.aggregates[parseInt(s.toString(),10)].columns[parseInt(o.toString(),10)].guid+"groupCaptionTemplate";t.resetBlazorTemplate(a,"GroupCaptionTemplate")}}},n.prototype.refreshComplete=function(e){this.parent.trigger(Ut,e)},n.prototype.refreshDataManager=function(e){var t=this;void 0===e&&(e={});var n=this.parent,r=this.parent.getColumns();r&&r.length&&!r[0].visible?this.isFirstColumnHidden=!0:this.isFirstColumnHidden=!1;var s="Shimmer"===n.loadingIndicator.indicatorType&&"virtualscroll"!==e.requestType&&"infiniteScroll"!==e.requestType||("virtualscroll"===e.requestType||"infiniteScroll"===e.requestType)&&n.enableVirtualMaskRow;"virtualscroll"===e.requestType||e.isCaptionCollapse||s||this.parent.showSpinner(),s&&n.showMaskRow("virtualscroll"===e.requestType?e.virtualInfo.sentinelInfo.axis:"infiniteScroll"===e.requestType?e.direction:void 0),this.parent.notify("reset-infinite-blocks",e),this.emptyGrid=!1;var o,a=this.isNeedForeignAction();if(this.ariaService.setBusy(this.parent.getContent().querySelector("."+Yi),!0),a){var l=new i.Deferred;o=this.getFData(l,e)}o?o=o.then(function(n){var r=t.data.generateQuery().requiresCount();if(t.emptyGrid){var s=new i.Deferred;return s.resolve({result:[],count:0}),s.promise}return t.data.getData(e,r)}):(n.allowPaging&&!n.getDataModule().dataManager.dataSource.offline&&n.pageSettings&&n.pageSettings.pageSizes&&n.pagerModule&&n.pagerModule.pagerObj&&n.pagerModule.pagerObj.isAllPage&&(n.pagerModule.pagerObj.isAllPage=void 0),o=this.data.getData(e,this.data.generateQuery().requiresCount()));var d=this.parent.getForeignKeyColumns(),h=d.length;if("ExcludeHidden"===this.parent.columnQueryMode&&h&&(h=d.filter(function(e){return!1!==e.visible}).length),h&&(!a||this.parent.searchSettings.key.length)){var p=new i.Deferred;o=o.then(function(i){return t.parent.notify("getForeignKeyData",{dataManager:o,result:i,promise:p,action:e}),p.promise})}this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&(o=o.then(function(e){return t.validateGroupRecords(e)})),o.then(function(i){return t.dataManagerSuccess(i,e)}).catch(function(i){return t.dataManagerFailure(i,e)})},n.prototype.getFData=function(e,t){return this.parent.notify("getForeignKeyData",{isComplex:!0,promise:e,action:t}),e.promise},n.prototype.isNeedForeignAction=function(){var e=this.parent;return!!(e.allowFiltering&&e.filterSettings.columns.length||!t.isNullOrUndefined(e.searchSettings.key)&&e.searchSettings.key.length)&&this.foreignKey(this.parent.getForeignKeyColumns())},n.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)})},n.prototype.sendBulkRequest=function(e){var t=this;e.requestType="batchsave";var i=this.parent;if(i.allowPaging&&i.pageSettings.pageSizes&&i.pagerModule.pagerObj.isAllPage&&i.pagerModule.pagerObj.checkAll){var n=e.changes.addedRecords.length;n&&i.setProperties({pageSettings:{pageSize:i.pageSettings.pageSize+n}},!0)}i.allowPaging&&(e.changes.addedRecords.length||e.changes.deletedRecords.length||e.changes.changedRecords.length)&&i.pageSettings&&i.pageSettings.pageSizes&&i.pagerModule&&i.pagerModule.pagerObj&&!i.getDataModule().dataManager.dataSource.offline&&i.pagerModule.pagerObj.isAllPage&&(i.pagerModule.pagerObj.isAllPage=void 0);var r=this.data.saveChanges(e.changes,this.parent.getPrimaryKeyFieldNames()[0],e.original),s=this.data.generateQuery().requiresCount();if(this.data.dataManager.dataSource.offline)return void this.refreshDataManager({requestType:"batchsave"});r.then(function(i){t.data.getData(e,s).then(function(i){return t.dmSuccess(i,e)}).catch(function(i){return t.dmFailure(i,e)})}).catch(function(i){return t.dmFailure(i,e)})},n.prototype.dmSuccess=function(e,t){this.dataManagerSuccess(e,t)},n.prototype.dmFailure=function(e,t){this.dataManagerFailure(e,t)},n.prototype.renderEmptyRow=function(){this.emptyRow(!0)},n.prototype.emptyRow=function(e){var i=this.parent,n=this.contentRenderer.getTable().querySelector(ln);t.isNullOrUndefined(n)||t.remove(n),n=this.parent.createElement(ln,{attrs:{role:"rowgroup"}});var r=i.allowRowDragAndDrop&&t.isNullOrUndefined(i.rowDropSettings.targetID)?1:0;(i.detailTemplate||i.childGrid)&&++r;var s,o=i.editSettings.showAddNewRow&&"Bottom"===i.editSettings.newRowPosition?"e-emptyrow e-show-added-row":"e-emptyrow",a=this.parent.createElement("tr",{className:o,attrs:{role:"row"}});if(i.emptyRecordTemplate){var l=i.element.id+"emptyRecordTemplate";s=this.parent.createElement("td",{attrs:{colspan:(i.getVisibleColumns().length+r+i.groupSettings.columns.length).toString()}}),i.isVue||i.parentDetails&&i.parentDetails.parentInstObj&&i.parentDetails.parentInstObj.isVue?s.appendChild(i.getEmptyRecordTemplate()(i.dataSource,i,"emptyRecordTemplate",l,void 0,void 0,void 0,this.parent.root)[1]):s.appendChild(i.getEmptyRecordTemplate()(i.dataSource,i,"emptyRecordTemplate",l,void 0,void 0,void 0,this.parent.root)[0]),i.isReact&&this.parent.renderTemplates()}else s=this.parent.createElement("td",{innerHTML:this.l10n.getConstant("EmptyRecord"),attrs:{colspan:(i.getVisibleColumns().length+r+(t.isNullOrUndefined(i.groupSettings.columns)?0:i.groupSettings.columns.length)).toString()}});i.isFrozenGrid()&&(s.classList.add("e-leftfreeze"),s.style.left="0px"),(i.frozenRows||i.pinnedTopRowModels.length)&&i.element.querySelector(".e-frozenrow-border")&&this.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty"),a.appendChild(s),n.appendChild(a),this.contentRenderer.renderEmpty(n),e&&(!this.parent.isInitialLoad&&this.parent.focusModule&&this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.trigger(jt,{}),this.parent.notify(ti,{rows:[new ji({isDataRow:!0,cells:[new Vi({isDataCell:!0,visible:!0})]})]}),i.editSettings.showAddNewRow&&(i.addRecord(),this.parent.notify(zi,{})))},n.prototype.dynamicColumnChange=function(){this.parent.getCurrentViewRecords().length&&this.updateColumnType(this.parent.getCurrentViewRecords()[0])},n.prototype.updateColumnType=function(e){for(var i,n=this.parent.enableColumnVirtualization?this.parent.columns:this.parent.getColumns(),r=e&&e.items?e.items[0]:e,s=this.locator.getService("valueFormatter"),o=0,a=n.length;o<a;o++){i=fe(n[parseInt(o.toString(),10)].field||"",r),t.isNullOrUndefined(n[parseInt(o.toString(),10)].customFormat)||(n[parseInt(o.toString(),10)].format=n[parseInt(o.toString(),10)].customFormat),t.isNullOrUndefined(n[parseInt(o.toString(),10)].validationRules)||t.isNullOrUndefined(n[parseInt(o.toString(),10)].validationRules.equalTo)||(n[parseInt(o.toString(),10)].validationRules.equalTo[0]=this.parent.element.id+n[parseInt(o.toString(),10)].validationRules.equalTo[0]),n[parseInt(o.toString(),10)].isForeignColumn()&&n[parseInt(o.toString(),10)].columnData&&(i=fe(n[parseInt(o.toString(),10)].foreignKeyValue||"",n[parseInt(o.toString(),10)].columnData[0])),t.isNullOrUndefined(i)?n[parseInt(o.toString(),10)].type=n[parseInt(o.toString(),10)].type||null:(this.isColTypeDef=!0,n[parseInt(o.toString(),10)].type||(n[parseInt(o.toString(),10)].type=i.getDay?i.getHours()>0||i.getMinutes()>0||i.getSeconds()>0||i.getMilliseconds()>0?"datetime":"date":typeof i));var l=new Ft;n[parseInt(o.toString(),10)].format&&(n[parseInt(o.toString(),10)].format.skeleton||n[parseInt(o.toString(),10)].format.format&&"string"==typeof n[parseInt(o.toString(),10)].format.format)&&(!n[parseInt(o.toString(),10)].format.skeleton&&!n[parseInt(o.toString(),10)].format.format||!t.isNullOrUndefined(n[parseInt(o.toString(),10)].format.type)||"date"!==n[parseInt(o.toString(),10)].type&&"datetime"!==n[parseInt(o.toString(),10)].type||(n[parseInt(o.toString(),10)].format.type="date"===n[parseInt(o.toString(),10)].type?"date":"dateTime"),n[parseInt(o.toString(),10)].setFormatter(l.getFormatFunction(t.extend({},n[parseInt(o.toString(),10)].format))),n[parseInt(o.toString(),10)].setParser(l.getParserFunction(n[parseInt(o.toString(),10)].format))),"string"==typeof n[parseInt(o.toString(),10)].format?$(this.locator,n[parseInt(o.toString(),10)]):n[parseInt(o.toString(),10)].format||"number"!==n[parseInt(o.toString(),10)].type||n[parseInt(o.toString(),10)].setParser(s.getParserFunction({format:"n2"})),"dateonly"!==n[parseInt(o.toString(),10)].type||n[parseInt(o.toString(),10)].format||(n[parseInt(o.toString(),10)].format="yMd",$(this.locator,n[parseInt(o.toString(),10)]))}},n.prototype.dataManagerSuccess=function(n,r){var s=this,o=this.parent;this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),n.actionArgs=r;var a=!(!o.childGrid&&!o.detailTemplate),l=this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&!o.groupSettings.enableLazyLoading&&("delete"===r.requestType&&!a||"save"===r.requestType&&"add"===this.parent.infiniteScrollModule.requestType&&!(o.sortSettings.columns.length||o.filterSettings.columns.length||this.parent.groupSettings.columns.length||o.searchSettings.key||a));o.trigger("beforeDataBound",n,function(e){if(!e.cancel){e.result=t.isNullOrUndefined(e.result)?[]:e.result;var a=Object.keys(e.result).length;if(!s.parent.isDestroyed){if(!(o.getColumns().length||a||o.columns.length&&o.columns[0]instanceof Pt))return void o.hideSpinner();if(o.isRowSelectable){var d={e:e,isResetPartialRecords:!1};if(o.notify("beforeSetPartialRecords",d),!o.isInitialLoad||s.parent.isRemote()||"add"===r.action&&"save"===r.requestType||"batchsave"===r.requestType||d.isResetPartialRecords){p=o.getDataModule().isRemote()||!t.isNullOrUndefined(o.dataSource)&&o.dataSource.result?e.result:o.getDataModule().dataManager.executeLocal(o.getDataModule().generateQuery(!0));o.isTreeGrid&&!s.parent.isRemote()?s.resetPartialRecords():s.setPartialRecord(p)}}var h=["virtualscroll","infiniteScroll","grouping","paging","sorting","filtering"];if(o.isRowPinned&&(!o.isInitialLoad||o.getDataModule().isRemote()&&r.requestType&&-1!==h.indexOf(r.requestType))){for(var p=o.getDataModule().isRemote()||!t.isNullOrUndefined(o.dataSource)&&o.dataSource.result?e.result:o.dataSource,c=s.parent.getPrimaryKeyFieldNames()[0],u=0;u<p.length;u++){var g=p[parseInt(u.toString(),10)];!o.pinnedTopRowKeys[g[""+c]]&&o.isRowPinned(g)&&(o.pinnedTopRecords.push(g),o.pinnedTopRowKeys[p[parseInt(u.toString(),10)][""+c]]=!0)}o.getDataModule().pinnedData=new i.DataManager(o.pinnedTopRecords)}if(!s.parent.isReact||t.isNullOrUndefined(r)||"infiniteScroll"===r.requestType&&!s.parent.infiniteScrollSettings.enableCache||r.isFrozen)s.extendDataManagerSuccess(n,r,a,e,l);else{var f=["columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"];"infiniteScroll"===r.requestType&&s.parent.infiniteScrollSettings.enableCache&&(f=["columnTemplate","commandsTemplate"]),ut(s.parent,f,function(){s.extendDataManagerSuccess(n,r,a,e,l)})}}}})},n.prototype.resetPartialRecords=function(){if(this.parent.isRowSelectable)if(this.parent.isRemote())this.selectableDataKey={},this.nonselectableDataKey={},this.parent.partialSelectedIndexes=[],this.parent.partialSelectedRecords=[],this.parent.disableSelectedRecords=[];else{var e=Dt(this.parent);this.setPartialRecord(e)}},n.prototype.setPartialRecord=function(e){var i=this.parent.getPrimaryKeyFieldNames()[0],n=this.parent.allowGrouping&&!t.isNullOrUndefined(e.records)?e.records:e;if(this.parent.isRemote())for(h=0;h<n.length;h++){var r=(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize,s=this.parent.allowPaging?parseInt(h.toString(),10):r+parseInt(h.toString(),10),o=n[parseInt(h.toString(),10)][""+i];this.parent.isRowSelectable(n[parseInt(h.toString(),10)],this.parent.columns)?this.selectableDataKey.hasOwnProperty(o)||(this.parent.partialSelectedRecords.push(n[parseInt(h.toString(),10)]),this.parent.partialSelectedIndexes.push(s),this.selectableDataKey[n[parseInt(h.toString(),10)][""+i]]=!0):(this.parent.selectionModule.isPartialSelection=!0,this.nonselectableDataKey.hasOwnProperty(o)||(this.parent.disableSelectedRecords.push(n[parseInt(h.toString(),10)]),this.nonselectableDataKey[n[parseInt(h.toString(),10)][""+i]]=!1))}else{var a=[],l=[],d=[];this.selectableDataKey={},this.nonselectableDataKey={};for(var h=0;h<n.length;h++)this.parent.isRowSelectable(n[parseInt(h.toString(),10)],this.parent.columns)?(a.push(n[parseInt(h.toString(),10)]),d.push(parseInt(h.toString(),10)),this.selectableDataKey[n[parseInt(h.toString(),10)][""+i]]=!0):(this.parent.selectionModule.isPartialSelection=!0,l.push(n[parseInt(h.toString(),10)]),this.nonselectableDataKey[n[parseInt(h.toString(),10)][""+i]]=!1);this.parent.partialSelectedRecords=a,this.parent.disableSelectedRecords=l,this.parent.partialSelectedIndexes=d}},n.prototype.extendDataManagerSuccess=function(e,i,n,r,s){var o=this.parent;if(this.isInfiniteEnd(i)&&!n)return void this.parent.notify("infinite-edit-handler",{e:i,result:e.result,count:e.count,agg:e.aggregates});if(this.parent.isEdit=!1,o.editSettings.showAddNewRow&&"delete"===i.requestType&&(o.editModule.destroyWidgets(),o.editModule.destroyForm()),this.parent.notify("edit-reset",{}),this.parent.notify("tooltip-destroy",{}),i&&("infiniteScroll"!==i.requestType&&"delete"!==i.requestType&&"add"!==i.action||!o.enableInfiniteScrolling)&&this.parent.notify(Ni,{type:"refreshCommandColumn"}),this.contentRenderer.prevCurrentView=!t.isNullOrUndefined(this.parent.currentViewData)&&this.parent.currentViewData.slice(),o.currentViewData=r.result,o.notify("refresh-infinite-current-view-data",{args:i,data:r.result}),r.count&&!o.allowPaging&&(o.enableVirtualization||o.enableInfiniteScrolling)&&(o.totalDataRecordsCount=r.count),r.actual&&!t.isNullOrUndefined(r.actual.lazyLoadRecordsCount)&&this.parent.groupSettings.enableLazyLoading&&(o.totalDataRecordsCount=r.actual.lazyLoadRecordsCount),!n&&r.count&&o.allowPaging&&i&&"delete"!==i.requestType)return!this.parent.groupSettings.enableLazyLoading||"grouping"!==i.requestType&&"ungrouping"!==i.requestType||this.parent.notify("grouping-complete",i),o.prevPageMoving=!0,o.pageSettings.totalRecordsCount=r.count,"paging"!==i.requestType&&(o.pageSettings.currentPage=Math.ceil(r.count/o.pageSettings.pageSize)),void o.dataBind();if((o.getColumns().length||!n)&&this.isLayoutRendered||ge(o)||(o.removeMaskRow(),this.updatesOnInitialRender(r)),!this.isColTypeDef&&o.getCurrentViewRecords()&&(this.data.dataManager.dataSource.offline&&o.dataSource&&o.dataSource.length?this.updateColumnType(o.dataSource[0]):this.updateColumnType(o.getCurrentViewRecords()[0])),this.parent.isInitialLoad||!this.parent.groupSettings.disablePageWiseAggregates||this.parent.groupSettings.columns.length||(r.result=this.parent.dataSource instanceof Array?this.parent.dataSource:this.parent.currentViewData),!this.parent.isReact&&!this.parent.isVue||t.isNullOrUndefined(i)||"infiniteScroll"===i.requestType||i.isFrozen||ut(this.parent,["footerTemplate"]),this.parent.isAngular&&this.parent.allowGrouping&&this.parent.groupSettings.captionTemplate&&(t.isNullOrUndefined(i)||"infiniteScroll"!==i.requestType)&&this.parent.destroyTemplate(["groupSettings_captionTemplate"]),this.parent.notify(Zt,t.extend({count:r.count,result:r.result,aggregates:r.aggregates,loadSummaryOnEmpty:!1},i)),(o.groupSettings.columns.length||i&&"ungrouping"===i.requestType)&&i&&"filtering"!==i.requestType&&this.headerRenderer.refreshUI(),n){if(ge(o)){i.scrollTop={top:this.contentRenderer.content.scrollTop}}s?this.parent.notify("infinite-edit-handler",{e:i,result:e.result,count:e.count,agg:e.aggregates}):this.parent.enableImmutableMode?this.contentRenderer.immutableModeRendering(i):this.contentRenderer.refreshContentRows(i)}else{if(i&&i.isCaptionCollapse)return;if(!o.getColumns().length)return o.element.innerHTML="",void alert(this.l10n.getConstant("EmptyDataSourceError"));if(this.contentRenderer.setRowElements([]),this.contentRenderer.setRowObjects([]),this.ariaService.setBusy(this.parent.getContent().querySelector("."+Yi),!1),o.removeMaskRow(),this.renderEmptyRow(),o.enableColumnVirtualization&&!n&&this.parent.notify($t,{rows:o.getRowsObject(),args:{}}),i){var a=(i.requestType||"").toLowerCase()+"-complete";this.parent.notify(a,i),"batchsave"===i.requestType&&(i.cancel=!1,i.rows=[],i.isFrozen=!i.isFrozen,this.parent.trigger(Ut,i))}this.parent.autoFit&&this.parent.preventAdjustColumns(),this.parent.hideSpinner()}this.parent.notify("toolbar-refresh",{}),this.setRowCount(this.parent.getCurrentViewRecords().length),"query"in e&&(this.parent.getDataModule().isQueryInvokedFromData=!1)},n.prototype.dataManagerFailure=function(e,i){t.isNullOrUndefined(this.parent.contentModule)||(this.ariaService.setOptions(this.parent.getContent().querySelector("."+Yi),{busy:!1,invalid:!0}),this.setRowCount(1)),this.parent.trigger(Ht,e&&e.error?e:{error:e}),this.parent.hideSpinner(),this.parent.removeMaskRow(),"save"!==i.requestType&&"delete"!==i.requestType&&"bulk-save"!==i.name&&(this.parent.currentViewData=[],this.renderEmptyRow(),!this.parent.isInitialLoad&&this.parent.focusModule&&this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.log("actionfailure",{error:e}))},n.prototype.setRowCount=function(e){this.ariaService.setOptions(this.parent.element,{rowcount:e?e.toString():"1"})},n.prototype.isInfiniteEnd=function(e){return this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&"delete"===e.requestType},n.prototype.updatesOnInitialRender=function(e){this.isLayoutRendered=!0;var t=!1;this.parent.columns.length<1&&(this.buildColumns(e.result[0]),t=!0),E(this.parent.columns,null,this.parent),t&&this.parent.notify("refresh-Split-Frozen-Column",{}),this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.parent.isAutoGen=!0,this.parent.notify(Ci,{})},n.prototype.iterateComplexColumns=function(e,t,i){for(var n=Object.keys(e),r=0;r<n.length;r++)("object"!=typeof e[n[parseInt(r.toString(),10)]]||!e[n[parseInt(r.toString(),10)]]||e[n[parseInt(r.toString(),10)]]instanceof Date?[]:Object.keys(e[n[parseInt(r.toString(),10)]])).length?this.iterateComplexColumns(e[n[parseInt(r.toString(),10)]],t+(n[parseInt(r.toString(),10)]+"."),i):(i[this.counter]=t+n[parseInt(r.toString(),10)],this.counter++)},n.prototype.buildColumns=function(e){var i=[],n={};this.iterateComplexColumns(e,"",n);for(var r=Object.keys(n).filter(function(e){return"BlazId"!==n[""+e]}).map(function(e){return n[""+e]}),s=0,o=r.length;s<o;s++)i[parseInt(s.toString(),10)]={field:r[parseInt(s.toString(),10)]},this.parent.enableColumnVirtualization&&(i[parseInt(s.toString(),10)].width=t.isNullOrUndefined(i[parseInt(s.toString(),10)].width)?200:i[parseInt(s.toString(),10)].width);this.parent.setProperties({columns:i},!0)},n.prototype.instantiateRenderer=function(){this.renderer.addRenderer(e.RenderType.Header,new xn(this.parent,this.locator)),this.renderer.addRenderer(e.RenderType.Content,new In(this.parent,this.locator));var t=this.locator.getService("cellRendererFactory");t.addCellRenderer(e.CellType.Header,new On(this.parent,this.locator)),t.addCellRenderer(e.CellType.Data,new Rn(this.parent,this.locator)),t.addCellRenderer(e.CellType.StackedHeader,new An(this.parent,this.locator)),t.addCellRenderer(e.CellType.Indent,new Mn(this.parent,this.locator)),t.addCellRenderer(e.CellType.GroupCaption,new Pn(this.parent,this.locator)),t.addCellRenderer(e.CellType.GroupCaptionEmpty,new Nn(this.parent,this.locator)),t.addCellRenderer(e.CellType.Expand,new zn(this.parent,this.locator)),t.addCellRenderer(e.CellType.HeaderIndent,new Un(this.parent,this.locator)),t.addCellRenderer(e.CellType.StackedHeader,new An(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailHeader,new jn(this.parent,this.locator)),t.addCellRenderer(e.CellType.RowDragHIcon,new Qn(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailExpand,new Gn(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailFooterIntent,new Mn(this.parent,this.locator)),t.addCellRenderer(e.CellType.RowDragIcon,new Kn(this.parent,this.locator))},n.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(this.parent.on(Yt,this.instantiateRenderer,this),this.parent.on("refreshdataSource",this.dataManagerSuccess,this),this.parent.on(ni,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(Ci,this.dynamicColumnChange,this))},n.prototype.validateGroupRecords=function(e){var t=this,n=e.result.length-1;if(n<0)return Promise.resolve(e);var r=e.result[0],s=e.result[parseInt(n.toString(),10)],o=[],a=function(e){for(var a=0===n?[r]:[r,s],l=0;l<a.length;l++)o.push(new i.Predicate("field","==",a[parseInt(l.toString(),10)].field).and(t.getPredicate("key","equal",a[parseInt(l.toString(),10)].key)));e.where(i.Predicate.or(o))},l=new i.Query;a(l);var d=new i.DataManager(e.result).executeLocal(l),h=this.data.generateQuery(!0),p=[];if(this.data.isRemote()){for(var c=0===n?[r]:[r,s],u=0;u<c.length;u++)p.push(this.getPredicate(c[parseInt(u.toString(),10)].field,"equal",c[parseInt(u.toString(),10)].key));h.where(i.Predicate.or(p))}else a(h);var g=new i.Deferred;return this.data.getData({},h).then(function(i){t.updateGroupInfo(d,i.result),g.resolve(e)}).catch(function(e){return g.reject(e)}),g.promise},n.prototype.getPredicate=function(e,t,n){return n instanceof Date?ue({field:e,operator:t,value:n}):new i.Predicate(e,t,n)},n.prototype.updateGroupInfo=function(e,n){for(var r=new i.DataManager(n),s=e,o=0;o<s.length;o++){var a=r.executeLocal((new i.Query).where(new i.Predicate("field","==",s[parseInt(o.toString(),10)].field).and(this.getPredicate("key","equal",s[parseInt(o.toString(),10)].key))))[0];if(!t.isNullOrUndefined(a)){s[parseInt(o.toString(),10)].count=a.count;var l=s[parseInt(o.toString(),10)].items,d=a.items;l.GroupGuid&&(s[parseInt(o.toString(),10)].items=this.updateGroupInfo(s[parseInt(o.toString(),10)].items,a.items));for(var h=this.parent.aggregates,p=0;p<h.length;p++)for(var c=h[parseInt(p.toString(),10)],u=0;u<c.columns.length;u++)for(var g=c.columns[parseInt(u.toString(),10)],f=g.type instanceof Array?g.type:[g.type],m=0;m<f.length;m++){var y=g.field+" - "+f[parseInt(m.toString(),10)].toLowerCase(),v=l.level?d.records:a.items,S=this.parent;if("Custom"===f[parseInt(m.toString(),10)]){var C=l.level?d:a,w=g.customAggregate;"string"==typeof w&&(w=t.getValue(w,window)),s[parseInt(o.toString(),10)].aggregates[""+y]=w?w.call(S,C,c.columns[parseInt(u.toString(),10)]):""}else s[parseInt(o.toString(),10)].aggregates[""+y]=i.DataUtil.aggregates[f[parseInt(m.toString(),10)].toLowerCase()](v,c.columns[parseInt(u.toString(),10)].field)}}}return e},n}(),Yn=function(){function i(){this.cellRenderMap={}}return i.prototype.addCellRenderer=function(i,n){i="string"==typeof i?i:t.getEnumValue(e.CellType,i),t.isNullOrUndefined(this.cellRenderMap[""+i])&&(this.cellRenderMap[""+i]=n)},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}(),Jn=function(){function i(e,t){this.sortedCols=[],this.sortPredicate=[],this.isCustomDialog=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}return i.prototype.addEventListener=function(){this.evtHandlers=[{event:"filter-dialog-close",handler:this.closeCustomDialog},{event:Pi,handler:this.refreshCustomFilterOkBtn},{event:"render-responsive-cmenu",handler:this.renderResponsiveContextMenu},{event:"filter-cmenu-select",handler:this.renderCustomFilterDiv},{event:"custom-filter-close",handler:this.customExFilterClose},{event:"refresh-cutsom-filter-clear-button",handler:this.refreshCustomFilterClearBtn}],at(this.parent,this.evtHandlers,!0,this),this.onActionCompleteFn=this.editComplate.bind(this),this.parent.addEventListener(Ut,this.onActionCompleteFn)},i.prototype.customExFilterClose=function(){this.isCustomDlgRender=!1},i.prototype.renderCustomFilterDiv=function(){if(!t.isNullOrUndefined(this.customResponsiveDlg)){var e=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),i=e.querySelector(".e-dlg-custom-header"),n=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",n.style.display="",i.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&&!t.isNullOrUndefined(this.customResponsiveDlg)){var n=this.customResponsiveDlg.element.querySelector(".e-dlg-content"),s=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),o=s.querySelector(".e-dlg-closeicon-btn"),a=s.querySelector(".e-dlg-custom-header");if(i.isOpen){n.firstChild.style.display="none",n.appendChild(i.target),o.style.display="none",this.saveBtn.element.style.display="none",this.filterClearBtn.element.style.display="none",a.innerHTML=i.header;var l=this.parent.createElement("button"),d=this.parent.createElement("span",{className:"e-btn-icon e-resfilterback e-icons"});l.appendChild(d),this.backBtn=new r.Button({cssClass:this.parent.cssClass?"e-res-back-btn "+this.parent.cssClass:"e-res-back-btn"}),this.backBtn.appendTo(l),a.parentElement.insertBefore(l,a)}else this.backBtn&&!this.isCustomDlgRender&&(n.firstChild.style.display="",t.remove(this.backBtn.element),o.style.display="",this.saveBtn.element.style.display="",this.isFiltered&&(this.filterClearBtn.element.style.display=""),a.innerHTML=this.getHeaderTitle({action:e.ResponsiveDialogAction.isFilter},i.col))}},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),this.parent.columnChooserModule&&this.parent.columnChooserModule.responsiveDialogRenderer&&this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn&&(this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn.disabled=e.disabled)},i.prototype.columnMenuResponsiveContent=function(e,t,i){var n=this.parent.createElement("div",{className:"e-responsivecoldiv e-responsive"+e.toLowerCase()+"div"+(i?" e-disabled":"")}),r=this.parent.createElement("span",{className:"e-icons e-res"+e.toLowerCase()+"-icon e-btn-icon"}),s=this.parent.createElement("span",{innerHTML:t,className:"e-rescolumn-menu e-res-header-text"});n.appendChild(r),n.appendChild(s),this.customColumnDiv.appendChild(n)},i.prototype.renderResponsiveContent=function(i,n){var s=this,o=this.parent,a=this.action===e.ResponsiveDialogAction.isColumnChooser;if(i||a)return this.filterParent=this.parent.createElement("div",{className:(a?"e-maincolumnchooserdiv ":"")+"e-mainfilterdiv e-default-filter",id:(a?"columchooser":i.uid)+"-main-filter"}),this.filterParent;if(this.customColumnDiv=o.createElement("div",{className:"columndiv columnmenudiv"}),this.customColumnDiv.style.width="100%",this.parent.showColumnMenu&&"Horizontal"===this.parent.rowRenderingMode&&this.action===e.ResponsiveDialogAction.isColMenu){if(this.columnMenuResponsiveContent("AutoFitAll",o.localeObj.getConstant("AutoFitAll")),this.columnMenuResponsiveContent("AutoFit",o.localeObj.getConstant("AutoFit")),n.allowGrouping&&o.allowGrouping&&(this.columnMenuResponsiveContent("Group",o.localeObj.getConstant("Group"),o.groupSettings.columns.indexOf(n.field)>=0),this.columnMenuResponsiveContent("UnGroup",o.localeObj.getConstant("Ungroup"),o.groupSettings.columns.indexOf(n.field)<0)),n.allowSorting&&o.allowSorting){for(var l="None",d=this.parent.sortSettings.columns,h=0;h<d.length;h++)if(d[parseInt(h.toString(),10)].field===n.field){l=d[parseInt(h.toString(),10)].direction;break}this.columnMenuResponsiveContent("ascending",o.localeObj.getConstant("SortAscending"),"Ascending"===l),this.columnMenuResponsiveContent("descending",o.localeObj.getConstant("SortDescending"),"Descending"===l)}o.showColumnChooser&&this.columnMenuResponsiveContent("Column",o.localeObj.getConstant("Columnchooser")),n.allowFiltering&&o.allowFiltering&&this.columnMenuResponsiveContent("Filter",o.localeObj.getConstant("FilterMenu"))}else{var p=o.getColumns(),c=o.createElement("div",{className:"e-ressortbutton-parent"}),u=[],g=this.action===e.ResponsiveDialogAction.isSort,f=this.action===e.ResponsiveDialogAction.isFilter;if(f)for(h=0;h<o.filterSettings.columns.length;h++)u.push(o.filterSettings.columns[parseInt(h.toString(),10)].field);for(h=0;h<p.length;h++)if(!(!p[parseInt(h.toString(),10)].visible||!p[parseInt(h.toString(),10)].allowSorting&&g||!p[parseInt(h.toString(),10)].allowFiltering&&f)){var m=o.createElement("div",{className:"e-responsivecoldiv"});m.setAttribute("data-mappingname",p[parseInt(h.toString(),10)].field),m.setAttribute("data-mappinguid",p[parseInt(h.toString(),10)].uid);var y=o.createElement("span",{innerHTML:p[parseInt(h.toString(),10)].headerText,className:"e-res-header-text"});if(m.appendChild(y),this.customColumnDiv.appendChild(m),g){var v=this.getSortedFieldsAndDirections("field").indexOf(p[parseInt(h.toString(),10)].field),S=o.createElement("button",{id:o.element.id+p[parseInt(h.toString(),10)].field+"sortbutton"}),C=c.cloneNode();C.appendChild(S),m.appendChild(C),new r.Button({cssClass:this.parent.cssClass?"e-ressortbutton "+this.parent.cssClass:"e-ressortbutton"}).appendTo(S);var w=void 0;t.isNullOrUndefined(this.parent.sortSettings.columns[parseInt(v.toString(),10)])||(w="Ascending"===this.parent.sortSettings.columns[parseInt(v.toString(),10)].direction?this.parent.localeObj.getConstant("AscendingText"):this.parent.localeObj.getConstant("DescendingText")),S.innerHTML=v>-1?w:this.parent.localeObj.getConstant("NoneText"),S.onclick=function(e){s.sortButtonClickHandler(e.target)}}if(f&&u.indexOf(p[parseInt(h.toString(),10)].field)>-1){var b=o.createElement("div",{className:"e-icons e-res-icon e-filtersetdiv"}),I=o.createElement("span",{className:"e-icons e-res-icon e-filterset"});I.setAttribute("data-coltype",p[parseInt(h.toString(),10)].type),b.appendChild(I),m.appendChild(b)}}}return t.EventHandler.add(this.customColumnDiv,t.Browser.isDevice?"touchend":"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[parseInt(i.toString(),10)][""+e]);return t},i.prototype.sortButtonClickHandler=function(e){if(e){var t=F(e,"e-responsivecoldiv").getAttribute("data-mappingname");this.parent.allowMultiSorting||(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1,this.resetSortButtons(e));var i=e.textContent,n=i===this.parent.localeObj.getConstant("NoneText")?this.parent.localeObj.getConstant("AscendingText"):i===this.parent.localeObj.getConstant("AscendingText")?this.parent.localeObj.getConstant("DescendingText"):this.parent.localeObj.getConstant("NoneText"),r=n===this.parent.localeObj.getConstant("AscendingText")?"Ascending":n===this.parent.localeObj.getConstant("DescendingText")?"Descending":"None";e.innerHTML=n,this.setSortedCols(t,r)}},i.prototype.resetSortButtons=function(e){for(var t=[].slice.call(this.customColumnDiv.getElementsByClassName("e-ressortbutton")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)]!==e&&(t[parseInt(i.toString(),10)].innerHTML=this.parent.localeObj.getConstant("NoneText"))},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[parseInt(t.toString(),10)]);return e},i.prototype.customFilterColumnClickHandler=function(i){var n=this.parent,r=i.target;if(F(r,"columnmenudiv")&&this.action===e.ResponsiveDialogAction.isColMenu&&!F(r,"e-disabled")){var s=this.menuCol?this.menuCol:this.filteredCol;F(r,"e-responsiveautofitalldiv")?(n.autoFitColumns([]),this.closeCustomFilter()):F(r,"e-responsiveautofitdiv")?(n.autoFitColumns(s.field),this.closeCustomFilter()):F(r,"e-responsivegroupdiv")?(n.groupColumn(s.field),this.closeCustomFilter()):F(r,"e-responsiveungroupdiv")?(n.ungroupColumn(s.field),this.closeCustomFilter()):F(r,"e-responsiveascendingdiv")?(n.sortColumn(s.field,"Ascending"),this.closeCustomFilter()):F(r,"e-responsivedescendingdiv")?(n.sortColumn(s.field,"Descending"),this.closeCustomFilter()):F(r,"e-responsivecolumndiv")?(n.notify(Bi,{action:5}),n.showResponsiveCustomColumnChooser()):F(r,"e-responsivefilterdiv")&&(n.notify(Bi,{action:3}),this.isRowResponsive=!0,this.isCustomDialog=!1,n.filterModule&&n.filterModule.responsiveDialogRenderer.showResponsiveDialog(s)),i.preventDefault()}if(this.action===e.ResponsiveDialogAction.isFilter&&"FilterBar"!==n.filterSettings.type)if(r.classList.contains("e-responsivecoldiv")||r.parentElement.classList.contains("e-responsivecoldiv")){if((l=r.getAttribute("data-mappingname"))||(l=r.parentElement.getAttribute("data-mappingname")),l){var o=n.getColumnByField(l);this.isRowResponsive=!0,this.showResponsiveDialog(o)}}else if(r.classList.contains("e-filterset")||r.parentElement.classList.contains("e-filtersetdiv")){var a=F(r,"e-responsivecoldiv");if(a){var l=a.getAttribute("data-mappingname");("Menu"===(o=n.getColumnByField(l)).filter.type||!o.filter.type&&"Menu"===n.filterSettings.type)&&(this.isDialogClose=!0),t.isNullOrUndefined(this.parent.filterModule.filterModule)?this.parent.filterModule.clearFiltering([l]):this.parent.filterModule.filterModule.clearCustomFilter(o),this.removeCustomDlgFilterEle(r)}}},i.prototype.showResponsiveDialog=function(t,i){if(this.isCustomDialog&&this.action===e.ResponsiveDialogAction.isFilter&&!this.isRowResponsive||i&&this.action===e.ResponsiveDialogAction.isColMenu)this.menuCol=i,this.renderCustomFilterDialog(null,i);else{if(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.action===e.ResponsiveDialogAction.isColumnChooser&&this.parent.notify("render-Responsive-Column-Chooser-Div",{action:"open"}),this.action===e.ResponsiveDialogAction.isSort){var n={cancel:!1,dialogObj:this.customResponsiveDlg,requestType:"beforeOpenAptiveSortDialog"};if(this.parent.trigger("beforeOpenAdaptiveDialog",n),n.cancel)return}this.customResponsiveDlg.show(!0),this.customResponsiveDlg.element.style.maxHeight="100%",this.setTopToChildDialog(this.customResponsiveDlg.element),this.parent.enableAdaptiveUI&&this.parent.filterSettings&&("CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)&&this.parent.filterSettings.enableInfiniteScrolling&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&("CheckBox"===this.parent.filterSettings.type?this.parent.filterModule.filterModule.checkBoxBase:this.parent.filterModule.filterModule.excelFilterBase).showMask()}},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,i){var n=this.parent,r=this.action===e.ResponsiveDialogAction.isColMenu;if(this.action!==e.ResponsiveDialogAction.isFilter||"FilterBar"!==n.filterSettings.type){var s=r?"e-customcolumnmenudiv ":"",o=this.parent.createElement("div",{id:n.element.id+(r?"customcolumnmenu":"customfilter"),className:this.parent.cssClass?s+"e-customfilterdiv e-responsive-dialog "+this.parent.cssClass:s+"e-customfilterdiv e-responsive-dialog"});this.parent.element.appendChild(o),this.customFilterDlg=this.getDialogOptions(t,!0,null,i);var a={cancel:!1,dialogObj:this.customFilterDlg,requestType:"beforeOpenAptiveFilterDialog"};this.parent.trigger("beforeOpenAdaptiveDialog",a),a.cancel||(this.customFilterDlg.appendTo(o),this.customFilterDlg.show(!0),this.customFilterDlg.element.style.maxHeight="100%")}},i.prototype.getDialogOptions=function(t,i,r,s){var o=new n.Dialog({isModal:!0,showCloseIcon:!("columnchooser"===r&&this.parent.columnChooserSettings.headerTemplate&&!this.parent.enableColumnVirtualization),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,s),open:this.dialogOpen.bind(this),created:this.dialogCreated.bind(this),close:this.beforeDialogClose.bind(this),width:"100%",height:"100%",animationSettings:{effect:"None"},cssClass:this.parent.cssClass?this.parent.cssClass:""});if(o.isStringTemplate=!0,i){o.header=this.renderResponsiveHeader(t,void 0,!0);var a=this.action===e.ResponsiveDialogAction.isColMenu?"e-customcolumnmenu ":"";o.cssClass=a+"e-customfilter"}else o.header=this.renderResponsiveHeader(t),o.cssClass="Vertical"===this.parent.rowRenderingMode&&this.action===e.ResponsiveDialogAction.isFilter?"e-res"+r+" e-row-responsive-filter":"e-res"+r;return o},i.prototype.renderResponsiveDialog=function(t){var i=this.parent;if(this.action!==e.ResponsiveDialogAction.isFilter||"FilterBar"!==i.filterSettings.type){var n=this.action===e.ResponsiveDialogAction.isFilter?"filter":"sort";n=this.action===e.ResponsiveDialogAction.isColumnChooser?"columnchooser":n;var r=this.parent.createElement("div",{id:i.element.id+"responsive"+n,className:this.parent.cssClass?"e-res"+n+"div e-responsive-dialog "+this.parent.cssClass:"e-res"+n+"div e-responsive-dialog"});this.parent.element.appendChild(r),this.customResponsiveDlg=this.getDialogOptions(t,!1,n),Ve(i,this.customResponsiveDlg),this.customResponsiveDlg.appendTo(r)}},i.prototype.dialogCreated=function(){rt(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[parseInt(t.toString(),10)].field);var i=this.parent.sortSettings.columns[parseInt(t.toString(),10)].field,n=this.parent.sortSettings.columns[parseInt(t.toString(),10)].direction;this.sortPredicate.push({field:i,direction:n})}},i.prototype.beforeDialogClose=function(i){if(this.isDialogClose=i.element&&!i.element.querySelector(".e-xl-customfilterdiv")&&i.element.classList.contains("e-resfilterdiv"),this.action===e.ResponsiveDialogAction.isFilter)i.element.classList.contains("e-resfilterdiv")?this.parent.filterModule.filterModule.closeResponsiveDialog(this.isCustomDlgRender):i.element.classList.contains("e-customfilterdiv")&&this.closeCustomFilter(),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&(this.parent.notify(Bi,{action:4}),(n=document.querySelector(".e-resfilter"))&&t.remove(n));else if(this.action===e.ResponsiveDialogAction.isSort)this.closeCustomDialog();else if(this.action===e.ResponsiveDialogAction.isColMenu)this.closeCustomFilter(),(n=document.querySelector(".e-rescolummenu"))&&t.remove(n);else if(this.action===e.ResponsiveDialogAction.isColumnChooser){this.parent.notify("render-Responsive-Column-Chooser-Div",{action:"clear"});var n=document.querySelector(".e-rescolumnchooser");n&&t.remove(n),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&this.parent.notify(Bi,{action:4}),this.isCustomDialog=!1,this.isDialogClose=!1}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[parseInt(e.toString(),10)].field,this.sortPredicate[parseInt(e.toString(),10)].direction,this.parent.allowMultiSorting);this.sortPredicate.length||this.parent.clearSorting(),this.closeCustomDialog()},i.prototype.getHeaderTitle=function(t,i){var n,r=this.parent;return this.action===e.ResponsiveDialogAction.isEdit?n=r.localeObj.getConstant("EditFormTitle")+t.primaryKeyValue[0]:this.action===e.ResponsiveDialogAction.isAdd?n=r.localeObj.getConstant("AddFormTitle"):this.action===e.ResponsiveDialogAction.isFilter?n=i?i.headerText||i.field:r.localeObj.getConstant("FilterTitle"):this.action===e.ResponsiveDialogAction.isSort?n=r.localeObj.getConstant("Sort"):this.action===e.ResponsiveDialogAction.isColMenu?n=r.localeObj.getConstant("ColumnMenu"):this.action===e.ResponsiveDialogAction.isColumnChooser&&(n=r.localeObj.getConstant("ChooseColumns")),n},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":t===e.ResponsiveDialogAction.isColumnChooser&&(i="responsive_column_chooser_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&&t!==e.ResponsiveDialogAction.isColumnChooser&&this.action!==e.ResponsiveDialogAction.isColumnChooser||(i="OKButton"),i},i.prototype.renderResponsiveHeader=function(t,i,n){var s=this,o=this.parent;o.on("enter-key-handler",this.keyHandler,this);var a=o.element.id+this.getDialogName(this.action);if(this.parent.columnChooserSettings.headerTemplate&&!this.parent.enableColumnVirtualization&&this.getHeaderTitle(i,t)===o.localeObj.getConstant("ChooseColumns"))return this.parent.columnChooserModule.renderHeader();var l=o.createElement("div",{className:"e-res-custom-element"}),d=o.createElement("div",{className:"e-dlg-custom-header",id:a});d.innerHTML=this.getHeaderTitle(i,t),l.appendChild(d);var h=o.createElement("button");n||(this.saveBtn=new r.Button({cssClass:this.parent.cssClass?"e-primary e-flat e-res-apply-btn "+this.parent.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){s.dialogHdrBtnClickHandler()});var p=this.action===e.ResponsiveDialogAction.isSort,c=this.action===e.ResponsiveDialogAction.isFilter;if(c||p){var u=p?"sort":"filter",g=o.createElement("button");if(this.filterClearBtn=new r.Button({cssClass:this.parent.cssClass?"e-primary e-flat e-res-"+u+"-clear-btn "+this.parent.cssClass:"e-primary e-flat e-res-"+u+"-clear-btn"}),c){var f=o.createElement("span",{className:"e-btn-icon e-icon-filter-clear e-icons"});g.appendChild(f)}else g.innerHTML=o.localeObj.getConstant("Clear");l.appendChild(g),this.filterClearBtn.appendTo(g),g.onclick=function(e){F(e.target,"e-customfilter")?(s.parent.filterModule.clearFiltering(),s.removeCustomDlgFilterEle()):c?s.filterClear():(s.resetSortButtons(),s.sortedCols=[],s.sortPredicate=[],s.isSortApplied=!0)},l.appendChild(g)}return n||l.appendChild(h),l},i.prototype.filterClear=function(){this.parent.filterModule.filterModule.clearCustomFilter(this.filteredCol),this.parent.filterModule.filterModule.closeResponsiveDialog()},i.prototype.removeCustomFilterElement=function(){var e=document.getElementById(this.parent.element.id+"customcolumnmenu");if(e){t.remove(e);var i=document.querySelector(".e-customfilter");i&&t.remove(i)}var n=document.querySelector(".e-rescolumnchooser");n&&t.remove(n)},i.prototype.hideResponsiveColumnChooser=function(){var e=document.querySelector(".e-rescolumnchooser");e&&(t.remove(e),this.isCustomDialog=!1,this.isDialogClose=!1)},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.removeCustomFilterElement()):this.action===e.ResponsiveDialogAction.isSort?(this.sortColumn(),this.removeCustomFilterElement()):this.action===e.ResponsiveDialogAction.isColumnChooser&&(this.parent.notify("render-Responsive-Column-Chooser-Div",{action:"confirm"}),this.removeCustomFilterElement(),this.isCustomDialog=!1,this.isDialogClose=!1)},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.isCustomDialog=!1,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,n=0;n<i.length;n++)(e=i[parseInt(n.toString(),10)].querySelector(".e-filtersetdiv"))&&(t.remove(e),n--)},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,t.Browser.isDevice?"touchend":"click",this.customFilterColumnClickHandler),at(this.parent,this.evtHandlers,!0,this),this.parent.removeEventListener(Ut,this.onActionCompleteFn)},i}(),Zn=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 Jn(e.parent,e.serviceLocator),e.responsiveDialogRenderer.action=i):e.responsiveDialogRenderer&&(e.responsiveDialogRenderer.removeEventListener(),e.responsiveDialogRenderer=void 0)},e}(),$n=function(){function i(){this.rendererMap={}}return i.prototype.addRenderer=function(i,n){var r=t.getEnumValue(e.RenderType,i);t.isNullOrUndefined(this.rendererMap[""+r])&&(this.rendererMap[""+r]=n)},i.prototype.getRenderer=function(i){var n=t.getEnumValue(e.RenderType,i);if(t.isNullOrUndefined(this.rendererMap[""+n]))throw"The renderer "+n+" is not found";return this.rendererMap[""+n]},i}(),er=function(){function e(e){this.parent=e}return e.prototype.setWidthToColumns=function(){var e=0,i=this.parent.getColumnIndexesInView(),n=!0,r=0;if(this.parent.allowGrouping)for(var s=this.parent.groupSettings.columns.length;e<s;e++)this.parent.enableColumnVirtualization&&-1===i.indexOf(e)?n=!1:this.setColumnWidth(new Pt({width:"30px"}),e);(this.parent.detailTemplate||this.parent.childGrid)&&(this.setColumnWidth(new Pt({width:"30px"}),e),e++),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(this.setColumnWidth(new Pt({width:"30px"}),e),e++);for(var o=this.parent.getColumns(),a=0;a<o.length;a++)this.setColumnWidth(o[parseInt(a.toString(),10)],n&&this.parent.enableColumnVirtualization?void 0:a+e);if(this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&this.setColumnWidth(new Pt({width:"30px"}),this.parent.groupSettings.columns.length+o.length),"auto"!==(r=this.getTableWidth(this.parent.getColumns()))){"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(r);var l=o.filter(function(e){return!t.isNullOrUndefined(e.maxWidth)}),d=this.parent.getHeaderTable(),h=this.parent.getContentTable();this.parent.allowResizing&&this.parent.element.getBoundingClientRect().width>r&&l.length===o.length&&d&&h&&t.addClass([d,h],["e-tableborder"])}},e.prototype.setMinwidthBycalculation=function(e){var i=this,n=0,r=this.parent.getColumns().filter(function(e){return i.parent.allowResizing?(t.isNullOrUndefined(e.width)||"auto"===e.width)&&t.isNullOrUndefined(e.maxWidth):t.isNullOrUndefined(e.width)||"auto"===e.width});if(r.length){n=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:parseInt(this.parent.width,10)-e;for(var s=0,o=0,a=r;o<a.length;o++){var l=a[o];s+=t.isNullOrUndefined(l.minWidth)?0:"string"==typeof l.minWidth?parseInt(l.minWidth,10):l.minWidth}for(var d=0;d<r.length;d++){0===e&&this.parent.allowResizing&&this.isWidthUndefined()&&d!==r.length-1&&this.setUndefinedColumnWidth(r);var h=this.parent.getColumnIndexByField(r[parseInt(d.toString(),10)].field)+this.parent.getIndentCount();0!==e&&n<s?this.setWidth(r[parseInt(d.toString(),10)].minWidth,h):0!==e&&n>s&&this.setWidth("",h,!0)}}},e.prototype.setUndefinedColumnWidth=function(e){for(var t=0;t<e.length;t++)t!==e.length-1&&(e[parseInt(t.toString(),10)].width=200,this.setWidth(200,this.parent.getColumnIndexByField(e[parseInt(t.toString(),10)].field)))},e.prototype.setColumnWidth=function(e,i,n){if(!(this.parent.getColumns().length<1)){var r=t.isNullOrUndefined(i)?this.parent.getNormalizedColumnIndex(e.uid):i,s=this.getWidth(e),o=this.getTableWidth(this.parent.getColumns());if(null!==s){if(this.setWidth(s,r),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&"auto"!==o&&this.setMinwidthBycalculation(o),this.parent.allowResizing&&("resize"===n||this.parent.getFrozenColumns())){var a=this.parent.getContentTable();this.setWidthToTable(this.parent.getFrozenColumns()&&-1===a.style.width.indexOf("px")&&o<a.clientWidth)}this.parent.notify("column-width-changed",{index:r,width:s,column:e,module:n})}}},e.prototype.setWidth=function(e,i,n){!(this.parent.groupSettings.columns.length>i&&Ne(this.parent))||this.parent.resizeModule&&this.parent.resizeModule.resizeProcess||(e=(30/this.parent.element.offsetWidth*100).toFixed(1)+"%");var r=this.parent.getHeaderTable(),s=this.parent.getContentTable(),o=t.formatUnit(e),a=r.querySelector(dn).children[parseInt(i.toString(),10)];a&&!n?a.style.width=o:a&&n&&(a.style.width="");var l=s.querySelector(dn).children[parseInt(i.toString(),10)];if(l&&!n?l.style.width=o:l&&n&&(l.style.width=""),!this.parent.enableColumnVirtualization&&this.parent.isEdit){for(var d=this.parent.element.querySelectorAll(".e-table.e-inline-edit"),h=[],p=0;p<d.length;p++)if(F(d[parseInt(p.toString(),10)],"e-grid").id===this.parent.element.id)for(var c=0;c<d[parseInt(p.toString(),10)].querySelector("colgroup").children.length;c++)h.push(d[parseInt(p.toString(),10)].querySelector("colgroup").children[parseInt(c.toString(),10)]);d.length&&h.length&&h[parseInt(i.toString(),10)]&&(h[parseInt(i.toString(),10)].style.width=o)}this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.refreshFrozenScrollbar()},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-movablescrollbar"),n=this.parent.getContent().firstElementChild.getBoundingClientRect().width;if(this.parent.enableColumnVirtualization){var r=this.parent.getContent().querySelector(".e-virtualtrack");r&&(n=r.scrollWidth)}"auto"!==this.parent.height&&(n+=t),i.firstElementChild.style.width=n+"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"],n=0,r=[Ki,Qi,"e-groupdroparea","e-gridpager","e-toolbar","e-temp-toolbar"];i;)r.some(function(e){return i.classList.contains(e)})&&(n+=i.offsetHeight),i=i[t+"ElementSibling"];return n},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(this.parent.allowResizing&&t.isNullOrUndefined(e.width)&&(t.isNullOrUndefined(e.minWidth)&&t.isNullOrUndefined(e.maxWidth)&&!this.isWidthUndefined()?e.width=200:e.maxWidth&&(e.width=e.maxWidth)),!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,t){for(var i=0,n=!1,r=0,s=e;r<s.length;r++){var o=s[r];if(!1!==o.visible){var a=this.getWidth(o);"auto"!==o.width&&o.width||(this.parent.allowResizing&&!t?o.maxWidth||(n=!0):a=0),null!==a&&(i+=parseInt(a.toString(),10))}}return i=n?"auto":i},e.prototype.setWidthToTable=function(e){var i=t.formatUnit(this.getTableWidth(this.parent.getColumns()));(this.parent.detailTemplate||this.parent.childGrid)&&this.setColumnWidth(new Pt({width:"30px"})),i=this.isAutoResize()||"auto"===i||e?"100%":i,this.parent.getHeaderTable().style.width=i,this.parent.getContentTable().style.width=i;var n=this.parent.element.querySelector(".e-table.e-inline-edit");n&&(n.style.width=i)},e.prototype.isAutoResize=function(){return this.parent.allowResizing&&"Auto"===this.parent.resizeSettings.mode},e}(),tr=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ir=function(){function e(e){this.currentInfo={},this.oneTime=!0,this.swap={},this.isInfiniteScroll=!1,this.virtualSelectionInfo={},this.forget=!1,this.skipFocus=!0,this.focusByClick=!1,this.firstHeaderCellClick=!1,this.prevIndexes={},this.refMatrix=this.refreshMatrix(!0),this.actions=["downArrow","upArrow"],this.isVirtualScroll=!1,this.groupedFrozenRow=0,this.parent=e,this.rowModelGen=new mn(this.parent),this.addEventListener()}return e.prototype.focusCheck=function(e){var t=e.target;this.focusByClick=!0,this.firstHeaderCellClick=!0,this.skipFocus=t.classList.contains("e-grid")},e.prototype.focusIn=function(e){if(!this.parent.enableHeaderFocus&&!this.focusByClick&&(t.closest(e.target,".e-filterbarcell")||t.closest(e.target,".e-checkselectall"))){var i=this.parent.element.querySelector(".e-rowcell:not(.e-hide)");i&&i.focus()}},e.prototype.onFocus=function(e){if(!(this.parent.isDestroyed||t.Browser.isDevice||this.parent.enableVirtualization||this.parent.element.querySelector(".e-masked-table")||!this.parent.isInitialLoad&&e&&e.target===this.parent.element&&this.parent.element.querySelector(".e-spin-show"))){this.setActive(this.parent.enableHeaderFocus&&0===this.parent.frozenRows),this.parent.enableHeaderFocus&&!this.parent.getCurrentViewRecords().length&&("Batch"!==this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&!this.parent.editModule.getBatchChanges().addedRecords.length)&&this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new ji({isDataRow:!0})]}),this.getContent().selector,!1);var i=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator(),this.active);this.getContent().matrix.select(i[0],i[1]),!this.skipFocus||e&&e.target===this.parent.element||(this.focus(e),this.skipFocus=!1)}},e.prototype.passiveFocus=function(e){if(!this.parent.isDestroyed){var i=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)"),n=this.parent.getContentTable().querySelector("tr:last-child"),r=n&&Array.from(n.querySelectorAll(".e-rowcell:not(.e-hide)")),s=r&&r[r.length-1],o=t.closest(e.target,".e-templatecell");if(e.target===i&&e.relatedTarget&&!F(e.relatedTarget,"e-grid")&&!this.firstHeaderCellClick){var a=[0,0];0===this.active.matrix.matrix[a[0]][a[1]]&&(a=bt(this.active.matrix.matrix,a,!0)),this.active.matrix.current=a,this.currentInfo.element=e.target,this.currentInfo.elementToFocus=e.target,this.currentInfo.element.querySelector(".e-checkselectall")?(this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)):t.addClass([this.currentInfo.element],["e-focused","e-focus"])}(e.target===s||o&&o===s)&&e.relatedTarget&&!F(e.relatedTarget,"e-grid")&&!this.firstHeaderCellClick&&(this.setActive(!0),this.setLastContentCellActive(),this.currentInfo.element=s,this.currentInfo.elementToFocus=s,o&&o.focus(),t.addClass([this.currentInfo.element],["e-focused","e-focus"])),this.firstHeaderCellClick=!1,e.target&&e.target.classList.contains("e-detailcell")&&!t.isNullOrUndefined(this.currentInfo.element)&&(this.currentInfo.skipAction=!1,t.addClass([this.currentInfo.element],["e-focused","e-focus"]))}},e.prototype.onBlur=function(e){this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").removeAttribute("aria-hidden");var i=this.parent.getContentTable().querySelector("tr:last-child"),n=i&&i.lastElementChild===e.target,r=!(!e||this.parent.isEdit||"tab"!==this.focusKey||!t.closest(e.target,".e-gridpager")&&!n||!t.isNullOrUndefined(e.relatedTarget)||!t.closest(e.target,".e-grid")||t.closest(document.activeElement,".e-grid"));this.focusKey="";var s=!(!F(e.target,"e-gantt")||!e.target.classList.contains("e-rowcell")||t.isNullOrUndefined(e.target.nextElementSibling)||!e.target.nextElementSibling.classList.contains("e-rowcell"));(!this.parent.isEdit&&(!e||e.relatedTarget&&!t.closest(e.relatedTarget,".e-grid")&&!t.closest(e.relatedTarget,".e-grid-popup")||this.parent.element.classList.contains("e-childgrid")&&!this.parent.element.matches(":focus-within"))||!s&&t.isNullOrUndefined(e.relatedTarget)&&parseInt(e.target.getAttribute("aria-colindex"),10)-1==0&&0===parseInt(e.target.getAttribute("data-index"),10)||!s&&t.isNullOrUndefined(e.relatedTarget)&&!t.closest(document.activeElement,".e-grid")&&!t.isNullOrUndefined(e.sourceCapabilities)||r)&&(this.removeFocus(),this.skipFocus=!0,this.currentInfo.skipAction=!1,this.setLastContentCellTabIndex(),this.setFirstFocusableTabIndex(),this.firstHeaderCellClick=!1)},e.prototype.setFirstFocusableTabIndex=function(){var e=this.parent;if(e.element.tabIndex=-1,e.allowGrouping&&e.groupSettings.showDropArea){var i=e.groupModule,n=i.getFocusableGroupedItems();return void(n.length>0?(i.element.tabIndex=-1,n[0].tabIndex=0):i.element.tabIndex=0)}if(e.toolbar||e.toolbarTemplate){var r=e.toolbarModule.element,s=this.parent.toolbarModule.getFocusableToolbarItems();if(s.length>0&&s[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input"))return r.tabIndex=-1,void(s[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").tabIndex=0);if(e.toolbarTemplate)return void(r.tabIndex=0)}if(e.getColumns().length)if(this.parent.enableHeaderFocus){if(e.getHeaderContent().querySelector(".e-headercell:not(.e-hide)").tabIndex=0,this.setActive(!1),!t.isNullOrUndefined(this.active)&&(t.isNullOrUndefined(this.active.target)||!this.active.target.classList.contains("e-columnmenu"))){var o=[0,0];0===this.active.matrix.matrix[o[0]][o[1]]&&(o=bt(this.active.matrix.matrix,o,!0)),this.active.matrix.current=o}}else{var a=e.element.querySelector(".e-rowcell:not(.e-hide)");a&&(a.tabIndex=0),e.frozenRows>0||e.pinnedTopRowModels.length>0?(this.setActive(!1),this.active.matrix.current=e.element.querySelector(".e-filterbarcell")?[2,0]:[1,0]):(this.setActive(!0),this.active.matrix.current=[0,0])}else;},e.prototype.setLastContentCellTabIndex=function(){var e=this.parent.getContentTable();if(e.rows[e.rows.length-1]){var i=e.rows[e.rows.length-1].lastElementChild;t.isNullOrUndefined(i)||(i.tabIndex=0)}},e.prototype.onClick=function(e,i,n){if(!F(e.target,"e-filterbarcell")||!F(e.target,"e-multiselect")&&!e.target.classList.contains("e-input-group-icon")){var r=!t.isNullOrUndefined(t.closest(e.target,"."+Wi)),s=!t.isNullOrUndefined(t.closest(e.target,"."+Ki));if(!(!(r=r&&s?!r:r)&&t.isNullOrUndefined(t.closest(e.target,"."+Ki))||e.target.classList.contains(Yi)||e.target.classList.contains(Xi)||!t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))&&!i)){this.setActive(r);var o={cancel:!1,byKey:!1,byClick:!t.isNullOrUndefined(e.target),clickArgs:e};if(this.parent.notify(li,o),!(o.cancel||t.closest(e.target,".e-inline-edit")&&!this.parent.editSettings.showAddNewRow&&this.parent.editSettings.showAddNewRow&&!this.parent.element.querySelector(".e-editedrow"))&&(this.setActive(r),this.getContent())){if(!1===this.getContent().onClick(e,i))return;this.focus(),this.currentInfo.element.classList.contains("e-rowcell")&&e.type&&"click"===e.type&&!n&&t.addClass([this.currentInfo.element],["e-focused","e-focus"]),n&&e&&e.target&&t.addClass([e.target],["e-focused","e-focus"])}}}},e.prototype.handleFilterNavigation=function(e,t,i){e.target===document.querySelector(t)&&"Tab"===e.key&&e.shiftKey?(e.preventDefault(),document.querySelector(i).focus()):e.target!==document.querySelector(i)||"Tab"!==e.key||e.shiftKey||document.activeElement!==document.querySelector(i)||(e.preventDefault(),document.querySelector(t).focus())},e.prototype.onKeyPress=function(e){if(this.focusKey=e.action,this.content&&this.content.target&&(this.content.target=null),this.parent.allowPaging){var i=this.parent.pagerModule.pagerObj.element,n=this.parent.pagerModule.pagerObj.getFocusablePagerElements(i,[]);if(this.parent.childGrid&&!F(e.target,"e-gridpager")&&this.allowToPaging(e)&&n.length&&(n[0].tabIndex=0),this.parent.pagerModule.pagerObj.checkPagerHasFocus()){if("shiftTab"===e.action&&n.length&&n[0]===e.target){this.setActive(!0);b=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1];return 0===this.active.matrix.matrix[b[0]][b[1]]&&(b=bt(this.active.matrix.matrix,b,!1)),this.active.matrix.current="Batch"===this.parent.editSettings.mode?this.isValidBatchEditCell(b)?b:this.findBatchEditCell(b,!1):b,e.preventDefault(),void this.focus(e)}if("tab"!==e.action||!this.parent.element.classList.contains("e-childgrid")||(this.parent.pageSettings.pageSizes||!n.length||n[n.length-1]!==e.target)&&this.parent.pagerModule.pagerObj.getDropDownPage()!==e.target)return void this.parent.pagerModule.pagerObj.changePagerFocus(e);var r=F(this.parent.element,"e-detailcell");t.removeClass([this.parent.element],["e-focus"]),t.removeClass([r],["e-focused"]),r.tabIndex=-1}if(0===this.parent.pagerModule.pagerObj.element.tabIndex&&(38===e.keyCode||e.shiftKey&&9===e.keyCode))return e.preventDefault(),void this.focus(e);if(0===this.parent.pagerModule.pagerObj.element.tabIndex&&9===e.keyCode)return e.preventDefault(),void this.parent.pagerModule.pagerObj.setPagerFocus();if(this.parent.pagerModule.pagerObj.checkFirstPagerFocus()){var s=this.getContent().matrix.rows,o=this.getContent().matrix.columns;this.getContent().matrix.current=[s,o]}}if("Excel"===this.parent.filterSettings.type&&this.handleFilterNavigation(e,".e-excelfilter .e-menu-item:not(.e-disabled)",".e-excelfilter .e-footer-content button:nth-child(2)"),"CheckBox"===this.parent.filterSettings.type){var a=this.parent.getColumnByUid(this.focusedColumnUid),l=a&&a.filter&&a.filter.hideSearchbox?".e-chk-hidden":".e-searchinput.e-input";this.handleFilterNavigation(e,l,".e-checkboxfilter .e-footer-content button:nth-child(2)")}if("Menu"===this.parent.filterSettings.type&&this.handleFilterNavigation(e,".e-flmenu .e-input-group.e-popup-flmenu",".e-flmenu .e-footer-content button:nth-child(2)"),this.parent.showColumnChooser&&this.handleFilterNavigation(e,".e-ccdlg .e-ccsearch.e-cc.e-input",".e-ccdlg .e-footer-content button:nth-child(2)"),"shiftTab"===e.action&&e.target&&F(e.target,"e-gridcontent")&&e.target.closest(".e-unboundcell")){h=(d=[].slice.call(this.parent.getContentTable().rows))[d.length-1].lastElementChild;e.target.closest(".e-unboundcell")===h&&this.commandColumnFocusElement(e.target.closest(".e-unboundcell"),!0)===e.target&&(this.currentInfo.skipAction=!0,this.setActive(!0),this.setLastContentCellActive())}if(!this.skipOn(e)){if(e.target&&F(e.target,"e-gridcontent")){var d=[].slice.call(this.parent.getContentTable().rows),h=d[d.length-1].lastElementChild;e.target===h&&(this.setActive(!0),this.setLastContentCellActive())}if("shiftTab"===e.action&&e.target&&(e.target===this.parent.element||F(e.target,"e-toolbar")||F(e.target,"e-groupdroparea"))){if(e.target===this.parent.element)return void(this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e));if(F(e.target,"e-groupdroparea"))return void(this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus()));if(F(e.target,"e-toolbar")){if(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea){var p=(u=this.parent.groupModule).getFocusableGroupedItems();e.preventDefault(),p.length>0?p[p.length-1].focus():u.element.focus()}else this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus());return}}var c=!1;if("tab"===e.action&&e.target&&(e.target===this.parent.element||F(e.target,"e-toolbar")||F(e.target,"e-groupdroparea"))){if(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea&&(e.target===this.parent.element||e.target.classList.contains("e-groupdroparea"))){var u=this.parent.groupModule;if((p=u.getFocusableGroupedItems()).length>0)return e.preventDefault(),void p[0].focus();if(!e.target.classList.contains("e-groupdroparea"))return e.preventDefault(),void u.element.focus()}if((this.parent.toolbar||this.parent.toolbarTemplate)&&(e.target===this.parent.element||F(e.target,"e-groupdroparea")||e.target.classList.contains("e-toolbar"))){var g=this.parent.toolbarModule.element,f=this.parent.toolbarModule.getFocusableToolbarItems();if(f.length>0)return e.preventDefault(),void f[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").focus();if(!e.target.classList.contains("e-toolbar")&&this.parent.toolbarTemplate)return e.preventDefault(),void g.focus()}(e.target===this.parent.element||F(e.target,"e-toolbar")||F(e.target,"e-groupdroparea"))&&(c=!0)}c&&(this.parent.allowGrouping&&!t.isNullOrUndefined(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length===this.parent.columns.length?this.setActive(!0):this.setActive(!1),this.active.matrix.current=[0,-1]),this.activeKey=e.action;var m={cancel:!1,byKey:!0,byClick:!1,keyArgs:e};if(this.parent.notify(li,m),!m.cancel){var y=this.getContent().matrix.current,v=this.active&&this.active.matrix.current?[this.active.matrix.current[0],this.active.matrix.current[1]]:void 0;this.currentInfo.outline=!0;var S=this.getContent().jump(e.action,y);this.swap=S,S.swap&&("Batch"!==this.parent.editSettings.mode||t.closest(e.target,".e-headercell")||"tab"!==e.action&&"shiftTab"!==e.action)&&(this.setActive(!S.toHeader),this.getContent().matrix.current=this.getContent().getNextCurrent(y,S,this.active,e.action),this.prevIndexes={}),this.setActiveByKey(e.action,this.getContent());var C=(!this.content||!this.content.lastIdxCell)&&this.getContent().onKeyPress(e);if(e.target&&!this.parent.enableHeaderFocus)if("tab"===e.action&&(e.target.classList.contains("e-grid")||t.closest(e.target,".e-groupdroparea")||t.closest(e.target,".e-toolbar-item")||t.closest(e.target,".e-headercell")||t.closest(e.target,".e-filterbarcell")))this.parent.frozenRows>0||this.parent.pinnedTopRowModels.length>0?(this.setActive(!1),this.active.matrix.current=this.parent.element.querySelector(".e-filterbarcell")?[2,0]:[1,0]):(this.setActive(!0),this.active.matrix.current=[0,0]);else{if(("leftArrow"===e.action||"rightArrow"===e.action)&&(t.closest(e.target,".e-headercell")||t.closest(e.target,".e-filterbarcell")))return void(this.active.matrix.current=y);if("upArrow"===e.action&&0===parseInt(e.target.getAttribute("data-index"),10))return void(this.parent.frozenRows>0||this.parent.pinnedTopRowModels.length>0?this.active.matrix.current=y:this.setActive(!0))}if(e.target&&F(e.target,"e-gridheader")){if((this.parent.enableHeaderFocus||this.parent.frozenRows>0||this.parent.pinnedTopRowModels.length>0)&&!t.isNullOrUndefined(this.active)&&"tab"===e.action&&y.toString()===this.active.matrix.current.toString()){var w=bt(this.active.matrix.matrix,this.active.matrix.current,!0),b=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1];0===this.active.matrix.matrix[b[0]][b[1]]&&(b=bt(this.active.matrix.matrix,b,!1));var I=t.getValue(w[0]+".cells."+w[1],this.active.matrix.getRowsFromIndex(w[0],this.active));if(I&&0===I.getBoundingClientRect().width&&this.active.matrix.matrix.length-1===w[0]&&(b=this.active.matrix.nextVisibleCellFocus(w[0],w[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current.toString()===b.toString()&&this.content.matrix.matrix.length){C=!0,this.setActive(!0);E=[0,0];if(this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").setAttribute("aria-hidden","true"),0===this.active.matrix.matrix[E[0]][E[1]]&&(E=bt(this.active.matrix.matrix,[0,0],!0)),(O=t.getValue(E[0]+".cells."+E[1],this.active.matrix.getRowsFromIndex(E[0],this.active)))&&0===O.getBoundingClientRect().width&&(E=this.active.matrix.nextVisibleCellFocus(E[0],E[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current="Batch"===this.parent.editSettings.mode?this.isValidBatchEditCell(E)?E:this.findBatchEditCell(E,!0):E,this.parent.enableVirtualization&&!this.parent.enableColumnVirtualization&&1!==this.parent.contentModule.prevInfo.blockIndexes[0]){e.preventDefault(),this.removeFocus();var x=this.parent.contentModule;return x.firstCellFocus=!0,void(x.content.scrollTop=0)}}else this.active.matrix.current.toString()!==w.toString()&&(this.active.matrix.current=w)}if(!t.isNullOrUndefined(this.active)&&"shiftTab"===e.action&&(y.toString()===this.active.matrix.current.toString()||!this.parent.enableHeaderFocus&&(t.closest(e.target,".e-headercell")||t.closest(e.target,".e-filterbarcell")))){var R=bt(this.active.matrix.matrix,this.active.matrix.current,!1),D=t.getValue(R[0]+".cells."+R[1],this.active.matrix.getRowsFromIndex(R[0],this.active));if(D&&0===D.getBoundingClientRect().width&&0===R[0]&&(R=this.active.matrix.nextVisibleCellFocus(R[0],R[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),R.toString()===this.active.matrix.current.toString()||!this.parent.enableHeaderFocus&&!D.classList.contains("e-rowcell"))return void this.focusOutFromHeader(e);if(this.active.matrix.current.toString()!==R.toString()&&!C){C=!0;var T=t.getValue(R[0]+".cells."+R[1],this.active.matrix.getRowsFromIndex(R[0],this.active));T&&0===T.getBoundingClientRect().width&&0===R[0]&&(R=this.active.matrix.nextVisibleCellFocus(R[0],R[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current=R}}}if(e.target&&F(e.target,"e-gridcontent")&&(this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").removeAttribute("aria-hidden"),"Batch"!==this.parent.editSettings.mode||"tab"!==e.action&&"shiftTab"!==e.action||(this.active.matrix.current=this.findBatchEditCell(v,"tab"===e.action),"tab"===e.action&&v.toString()===this.active.matrix.current.toString()&&(this.parent.editModule.editModule.addBatchRow=!0)),"shiftTab"===e.action&&y.toString()===this.active.matrix.current.toString())){if(!this.parent.enableHeaderFocus&&!this.parent.frozenRows&&!this.parent.pinnedTopRowModels.length||this.parent.allowGrouping&&!t.isNullOrUndefined(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length===this.parent.columns.length)return void this.focusOutFromHeader(e);var E=[0,0];0===this.active.matrix.matrix[E[0]][E[1]]&&(E=bt(this.active.matrix.matrix,[0,0],!0));var O=t.getValue(E[0]+".cells."+E[1],this.active.matrix.getRowsFromIndex(E[0],this.active));O&&0===O.getBoundingClientRect().width&&(E=this.active.matrix.nextVisibleCellFocus(E[0],E[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),C||E.toString()!==this.active.matrix.current.toString()&&("Batch"!==this.parent.editSettings.mode||v.toString()!==this.active.matrix.current.toString())||(C=!0,this.setActive(!1),this.setLastContentCellActive())}if(!1===C){if(this.clearIndicator(),"shiftTab"===e.action&&y.toString()===[0,0].toString()&&(this.parent.element.tabIndex=-1),this.parent.allowPaging&&!this.parent.pagerModule.pagerObj.checkPagerHasFocus()&&this.allowToPaging(e)&&y.toString()!==[0,0].toString()){if(e.preventDefault(),40===e.keyCode)return void this.parent.pagerModule.pagerObj.setPagerContainerFocus();if(9===e.keyCode)return void this.parent.pagerModule.pagerObj.setPagerFocus()}return void(this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e))}if(this.header.action=e.action,this.header.currentTarget=null,this.header.focusType="key",e.target&&F(e.target,"e-fltrtemp")&&("tab"===e.action||"shiftTab"===e.action)){var k=e.target,A=[].slice.call(t.closest(k,"th").querySelectorAll(".e-fltrtemp-focus"));if(A.length){var M=A.indexOf(k);("tab"===e.action&&M<A.length-1||"shiftTab"===e.action&&M>0)&&(this.setActive(!1),this.active.matrix.current=y,this.active.currentTarget=k)}}c&&F(this.active.getTable(),"e-gridheader")&&e.target&&e.target.id===this.parent.element.id+"_searchbar"&&(this.parent.searchModule.headerFocus=!0),e.preventDefault(),this.focus(e)}}},e.prototype.isValidBatchEditCell=function(e){var i=this.active.getTable().rows[e[0]].cells[e[1]],n=t.closest(i,"tr"),r=parseInt(i.getAttribute("aria-colindex"),10)-1,s=this.parent.getColumns()[parseInt(r.toString(),10)];return!(1!==this.active.matrix.matrix[e[0]][e[1]]||n.classList.contains("e-row")&&(!n.classList.contains("e-insertedrow")&&s.isPrimaryKey||!s.allowEditing))},e.prototype.findBatchEditCell=function(e,i,n){for(var r=e,s=e,o=!1;!o;){var a=s;s=bt(this.active.matrix.matrix,s,i);var l=t.getValue(s[0]+".cells."+s[1],this.active.getTable().rows);l&&0===l.getBoundingClientRect().width&&(s=this.active.matrix.nextVisibleCellFocus(s[0],s[1],this.activeKey,this.active.keyActions[this.activeKey],this.active,this.active.matrix.current[1])),a.toString()===s.toString()||n&&a[0]!==s[0]?o=!0:this.isValidBatchEditCell(s)&&(r=s,o=!0)}return r},e.prototype.setLastContentCellActive=function(){var e=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1];0===this.active.matrix.matrix[e[0]][e[1]]&&(e=bt(this.active.matrix.matrix,e,!1));var i=t.getValue(e[0]+".cells."+e[1],this.active.matrix.getRowsFromIndex(e[0],this.active));i&&0===i.getBoundingClientRect().width&&(e=this.active.matrix.nextVisibleCellFocus(e[0],e[1],this.activeKey,this.active.keyActions[this.activeKey],this.active,this.active.matrix.current[1])),this.active.matrix.current=e},e.prototype.focusOutFromChildGrid=function(e){var i=F(F(this.parent.element,"e-table"),"e-grid").ej2_instances[0],n=F(this.parent.element,"e-detailcell"),r=F(this.parent.element,"e-detailrow").getAttribute("data-uid"),s=[].slice.call(i.getContentTable().rows),o=s.map(function(e){return e.getAttribute("data-uid")}).indexOf(r);if(!("tab"===e.action&&o>=s.length-1)){t.removeClass([this.parent.element],["e-focus"]),t.removeClass([n],["e-focused"]),n.tabIndex=-1,e.preventDefault();var a;if(i.focusModule.removeFocus(),"shiftTab"===e.action){for(var l=s[o-1].cells,d=l.length-1;d>=0;d--)if(!(a=l[parseInt(d.toString(),10)]).classList.contains("e-hide")){i.focusModule.active.matrix.current=[o-1,d];break}}else a=s[o+1].cells[0],i.focusModule.active.matrix.current=[o+1,0];i.focusModule.currentInfo.element=a,i.focusModule.currentInfo.elementToFocus=a,t.addClass([a],["e-focused","e-focus"]),a.tabIndex=0,a.focus()}},e.prototype.focusOutFromHeader=function(e){if(this.removeFocus(),this.parent.toolbar||this.parent.toolbarTemplate){var t=this.parent.toolbarModule.element,i=this.parent.toolbarModule.getFocusableToolbarItems();if(i.length>0)return e.preventDefault(),void i[i.length-1].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").focus();if(this.parent.toolbarTemplate)return e.preventDefault(),void t.focus()}if(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea){var n=this.parent.groupModule,r=n.getFocusableGroupedItems();return e.preventDefault(),void(r.length>0?r[r.length-1].focus():n.element.focus())}this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus())},e.prototype.allowToPaging=function(e){return"Batch"!==this.parent.editSettings.mode||!this.parent.editSettings.allowAdding||40===e.keyCode},e.prototype.skipOn=function(e){var i=e.target;if(!i)return!1;if(!this.parent.isEdit&&i&&i.closest(".e-unboundcell")&&this.currentInfo.skipAction&&("shiftTab"===e.action&&this.commandColumnFocusElement(i.closest(".e-unboundcell"),!1)===i||"tab"===e.action&&this.commandColumnFocusElement(i.closest(".e-unboundcell"),!0)===i))return this.currentInfo.skipAction=!1;if(this.currentInfo.skipAction)return this.clearIndicator(),!0;if(["pageUp","pageDown","altDownArrow"].indexOf(e.action)>-1)return this.clearIndicator(),!0;if(this.parent.allowGrouping){var n=this.parent.groupModule.getFocusableGroupedItems();if(F(e.target,"e-groupheadercell")&&!(e.target===n[0]&&"shiftTab"===e.action||e.target===n[n.length-1]&&"tab"===e.action))return!0}if(this.parent.toolbar||this.parent.toolbarTemplate){var r=this.parent.toolbarModule.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)");if(F(e.target,"e-toolbar-item")&&!(r.length>0&&(F(e.target,"e-toolbar-item")===r[0]&&"shiftTab"===e.action||F(e.target,"e-toolbar-item")===r[r.length-1]&&"tab"===e.action)))return!0}var s=t.closest(i,"th")&&!t.closest(i,"th").tabIndex;!e.target.classList.contains("e-filterbaroperator")||13!==e.keyCode&&27!==e.keyCode||(l=t.closest(e.target,".e-filterbarcell")).querySelector("input").focus();var o=this.parent.editSettings.showAddNewRow&&null!==t.closest(document.activeElement,".e-addedrow");if((s&&null!==t.closest(document.activeElement,".e-filterbarcell")||o)&&this.removeFocus(),this.parent.isEdit&&("tab"===e.action||"shiftTab"===e.action)&&"Normal"===this.parent.editSettings.mode&&!this.parent.editSettings.showAddNewRow&&!t.isNullOrUndefined(F(i,"e-addedrow"))){var a=this.parent.editModule.formObj.element.querySelectorAll('input:not([type="hidden"],.e-numeric-hidden,.e-disabled), select:not([aria-hidden="true"]), button:not(.e-hide), textarea:not(.e-hide,.e-disabled,[disabled])'),l=i.classList.contains("e-ddl")?i.querySelector("input"):i,d="tab"===e.action&&l===a[a.length-1],h="shiftTab"===e.action&&l===a[0];if(d||h){e.preventDefault();var p=a[d?0:a.length-1];(p=p.parentElement.classList.contains("e-ddl")?p.parentElement:p).focus()}}return"delete"===e.action||"Batch"!==this.parent.editSettings.mode&&(this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&(!t.isNullOrUndefined(this.parent.element.querySelector(".e-editedrow"))||!t.isNullOrUndefined(F(i,"e-addedrow"))&&!t.isNullOrUndefined(t.closest(e.target,"input"))&&!t.isNullOrUndefined(document.querySelector(".e-popup-open"))||!t.isNullOrUndefined(F(i,"e-addedrow"))&&i&&!i.querySelector(".e-cancel-icon")&&!t.isNullOrUndefined(F(i,"e-unboundcell"))))||["insert","f2"].indexOf(e.action)>-1)||null!==t.closest(document.activeElement,".e-filterbarcell")&&this.parent.enableHeaderFocus&&"ctrlPlusA"===e.action||(null!==t.closest(document.activeElement,".e-filterbarcell")||o)&&"tab"!==e.action&&"shiftTab"!==e.action||null!==t.closest(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)>-1||null===t.closest(i,"."+Wi)&&null===t.closest(i,"."+Ki)&&!(e.target===this.parent.element||F(e.target,"e-toolbar")||F(e.target,"e-groupdroparea"))||"space"===e.action&&!i.classList.contains($i)&&null===t.closest(i,"."+$i)&&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("get-virtual-data",i);var n=this.actions.some(function(e){return e===t.activeKey}),r=!!this.parent.contentModule&&this.parent.contentModule.selectedRowIndex>-1;i.isAdd||Object.keys(i.virtualData).length||n||i.isCancel||r?(this.parent.notify("reset-virtual-focus",{isCancel:!1}),i.isCancel=!1,(this.parent.enableVirtualization&&!this.parent.selectVirtualRowOnAdd&&(!e||e&&"ctrlHome"!==e.action&&"ctrlEnd"!==e.action)||!this.parent.enableVirtualization)&&(this.parent.contentModule.selectedRowIndex=-1),this.parent.selectVirtualRowOnAdd=!1,n&&(this.activeKey=this.empty,this.parent.notify("virtaul-key-handler",e)),this.currentInfo.elementToFocus.focus({preventScroll:!0})):this.isVirtualScroll||this.isInfiniteScroll?this.currentInfo.elementToFocus.focus({preventScroll:!0}):this.currentInfo.elementToFocus.focus()}this.isVirtualScroll=this.isInfiniteScroll=!1},e.prototype.getFocusedElement=function(){return this.currentInfo.elementToFocus},e.prototype.getContent=function(){return this.active||this.content},e.prototype.setActive=function(e){this.active=e?this.content:this.header},e.prototype.setFocusedElement=function(e,i){var n=this;this.currentInfo.elementToFocus=e,setTimeout(function(){if(!t.isNullOrUndefined(n.currentInfo.elementToFocus)){var e=t.isNullOrUndefined(n.parent.element.querySelector(".e-flmenu"))?document.querySelector(".e-grid-popup .e-flmenu"):n.parent.element.querySelector(".e-flmenu");(n.parent.enableVirtualization||n.parent.enableInfiniteScrolling)&&t.isNullOrUndefined(e)?n.focusVirtualElement(i):(t.isNullOrUndefined(e)||F(document.activeElement,"e-flmenu-valuediv")!==e.querySelector(".e-flmenu-valuediv"))&&n.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){if(this.currentInfo.element){if(this.parent.isReact&&!this.parent.isEdit&&this.currentInfo.element.classList.contains("e-rowcell")&&!this.currentInfo.element.parentElement&&(!this.parent.allowGrouping||t.isNullOrUndefined(this.parent.groupSettings.columns)||!this.parent.groupSettings.columns.length)&&this.parent.getRowByIndex(this.prevIndexes.rowIndex)){var i=this.parent.getCellFromIndex(this.prevIndexes.rowIndex,this.prevIndexes.cellIndex);this.currentInfo.element=i||this.currentInfo.element}var n=this.currentInfo.elementToFocus;n&&n.matches(".e-focus.e-checkbox")&&(n.closest(".e-headerchkcelldiv")||n.closest(".e-gridchkbox"))&&t.removeClass([n],["e-checkbox"]),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.resetFocus()},e.prototype.focusContent=function(){this.setActive(!0),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)||this.isVirtualScroll),this.isInfiniteScroll&&(this.currentInfo.outline=!0),e.element){var n=e.elementToFocus.classList.contains("e-focus");if(!n){this.currentInfo.outline&&t.addClass([e.element],["e-focused"]),t.addClass([e.elementToFocus],["e-focus"]),e.elementToFocus&&e.elementToFocus.classList.contains("e-focus")&&e.elementToFocus.parentElement&&!e.elementToFocus.parentElement.classList.contains("e-checkbox-disabled")&&(e.elementToFocus.classList.contains("e-checkselect")||e.elementToFocus.classList.contains("e-checkselectall"))&&e.elementToFocus.classList.add("e-checkbox"),e.element.tabIndex=0,n||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 r=this.getContent().matrix.current,s=r[0],o=r[1];this.prevIndexes={rowIndex:s,cellIndex:o},this.focusedColumnUid=this.parent.getColumnByIndex(o).uid,this.focusByClick=!1}}},e.prototype.refreshMatrix=function(e){var i=this;return function(n){e&&!i.content&&(i.content=new rr(i.parent)),e||i.header||(i.header=new sr(i.parent)),e&&i.parent.pinnedTopRowModels.length&&(n.rows=i.parent.pinnedTopRowModels.concat(n.rows));var r=e?i.content:i.header,s=i.parent.frozenRows||i.parent.pinnedTopRowModels.length,o=0;if(s&&"Batch"===i.parent.editSettings.mode&&(o=i.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length+i.parent.getHeaderContent().querySelectorAll(".e-hiddenrow").length),!t.isNullOrUndefined(i.parent.groupSettings.columns)&&i.parent.groupSettings.columns.length&&s&&!i.parent.pinnedTopRecords.length&&e){s=0;for(var a=0;a<n.rows.length&&(s++,n.rows[parseInt(a.toString(),10)].index+1!==i.parent.frozenRows);a++);i.groupedFrozenRow=s}var l=e?n.rows.slice(s+o):n.rows,d=e?n.rows.slice(0,s+o):n.rows;i.parent.isCollapseStateEnabled()&&e&&(l=l.filter(function(e){return!1!==e.visible}));var h=!t.isNullOrUndefined(i.parent.rowTemplate);if(s&&("Batch"===i.parent.editSettings.mode&&e&&("batchDelete"===n.name||"batchAdd"===n.name||"batchCancel"===n.name||n.args&&"batchsave"===n.args.requestType)||n.args&&("delete"===n.args.requestType||"save"===n.args.requestType))||n.args&&("pin-row"===n.args.requestType||"unpin-row"===n.args.requestType)){var p=i.header.matrix.matrix,c=i.parent.headerModule.rows.length;p.splice(c,p.length-c)}var u=r.matrix.generate(d,r.selector,h);r.matrix.generate(l,r.selector,h);var g=i.parent.enableVirtualization||i.parent.enableInfiniteScrolling;if(i.parent.editSettings.showAddNewRow&&e&&i.header&&i.header.matrix&&(!g||g&&i.parent.isAddNewRow)){var f=i.header.matrix.matrix,m=i.parent.allowFiltering&&"FilterBar"===i.parent.filterSettings.type?2:1;r.matrix.rows=i.parent.frozenRows&&"Top"===i.parent.editSettings.newRowPosition?r.matrix.rows:++r.matrix.rows,"Top"===i.parent.editSettings.newRowPosition?(i.parent.frozenRows||g?u:r.matrix.matrix).unshift(i.refreshAddNewRowMatrix(f[f.length-m])):r.matrix.matrix.push(i.refreshAddNewRowMatrix(f[f.length-m])),i.parent.isAddNewRow=!1}if((!i.parent.isFrozenGrid()||!n.args||"sorting"!==n.args.requestType&&"batchsave"!==n.args.requestType&&"paging"!==n.args.requestType||s&&"Batch"===i.parent.editSettings.mode&&e&&("batchDelete"===n.name||"batchAdd"===n.name||"batchCancel"===n.name||"batchsave"===n.args.requestType))&&r.generateRows(d,{matrix:u,handlerInstance:i.header}),!t.Browser.isDevice&&n&&n.args&&(i.focusByClick||"paging"!==n.args.requestType||i.parent.pagerModule.pagerObj.checkPagerHasFocus()||(i.skipFocus=!1,i.parent.element.focus()),"grouping"===n.args.requestType&&(i.skipFocus=!0)),n&&n.args&&"virtualscroll"===n.args.requestType){if(i.currentInfo.uid){var y;if(n.rows.some(function(e,t){return y=t,e.uid===i.currentInfo.uid})){i.content.matrix.current[0]=y,i.content.matrix.current[1]=i.parent.getColumnIndexByUid(i.focusedColumnUid)||0;var v=i.parent.getVisibleFrozenLeftCount(),S=i.parent.getVisibleFrozenRightCount();!i.parent.enableColumnVirtualization||v&&S||!i.parent.isFrozenGrid()||"right"!==n.args.virtualInfo.direction||(i.content.matrix.current[1]=i.content.matrix.current[1]-(v+(S?S+1:0)));var C=!(!i.parent.allowGrouping||!i.parent.groupSettings.columns.length);if(C&&(i.content.matrix.current[1]=i.prevIndexes.cellIndex,i.virtualSelectionInfo.isPending&&(i.content.matrix.current[0]="downArrow"===i.virtualSelectionInfo.direction?i.content.matrix.current[0]+1:i.content.matrix.current[0]-1)),R=i.getContent().getFocusInfo().elementToFocus){var w=R.getBoundingClientRect(),b=i.parent.element.getBoundingClientRect(),I=0,x=0;!i.parent.enableColumnVirtualization||v&&S||!i.parent.isFrozenGrid()||"right"!==n.args.virtualInfo.direction||(v?I=i.parent.leftrightColumnWidth("left"):x=i.parent.leftrightColumnWidth("right")),(w.top>=0&&w.left>=0&&w.right-I-x<=Math.min(b.right,window.innerWidth||document.documentElement.clientWidth)+x&&w.bottom<=Math.min(b.bottom,window.innerHeight||document.documentElement.clientHeight)||C)&&(i.isVirtualScroll=!0,i.focus(C&&i.virtualSelectionInfo.isPending?i.virtualSelectionInfo.event:void 0))}}}else if(n.args.focusElement&&n.args.focusElement.classList.contains("e-filtertext")){var R=i.parent.element.querySelector("#"+n.args.focusElement.id);R&&R.focus()}i.virtualSelectionInfo={}}n&&n.args&&"infiniteScroll"===n.args.requestType&&(i.isInfiniteScroll=!0)}},e.prototype.refreshAddNewRowMatrix=function(e){for(var t=this.parent.getColumns(),i=this.parent.getIndentCount(),n=i;n<e.length-1;n++)t[n-i]&&t[n-i].visible&&t[n-i].allowEditing?e[parseInt(n.toString(),10)]=1:e[parseInt(n.toString(),10)]=0;return e},e.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(t.EventHandler.add(this.parent.element,"mousedown",this.focusCheck,this),t.EventHandler.add(this.parent.element,"touchstart",this.focusCheck,this),t.EventHandler.add(this.parent.element,"focus",this.onFocus,this),t.EventHandler.add(this.parent.element,"focusin",this.focusIn,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.evtHandlers=[{event:di,handler:this.onKeyPress},{event:hi,handler:this.onClick},{event:$t,handler:this.refMatrix},{event:"partial-refresh",handler:this.refMatrix},{event:"refresh-Expand-and-Collapse",handler:this.refMatrix},{event:zi,handler:this.showAddNewRowFocus},{event:si,handler:this.refreshMatrix()},{event:"close-edit",handler:this.restoreFocus},{event:"restore-Focus",handler:this.restoreFocus},{event:"start-edit",handler:this.clearIndicator},{event:"start-add",handler:this.clearIndicator},{event:"sorting-complete",handler:this.restoreFocus},{event:"filtering-complete",handler:this.filterfocus},{event:"custom-filter-close",handler:this.filterfocus},{event:"grouping-complete",handler:this.restoreFocusWithAction},{event:"ungrouping-complete",handler:this.restoreFocusWithAction},{event:"batchAdd",handler:this.refMatrix},{event:"batchCancel",handler:this.refMatrix},{event:"batchDelete",handler:this.refMatrix},{event:"detailDataBound",handler:this.refMatrix},{event:ti,handler:this.refMatrix},{event:"cellfocused",handler:this.internalCellFocus}],at(this.parent,this.evtHandlers,!0,this))},e.prototype.showAddNewRowFocus=function(){if(this.parent.editSettings.showAddNewRow){var e="Top"===this.parent.editSettings.newRowPosition?0:this.content.matrix.matrix.length-1,t=this.parent.getIndentCount();if("Top"===this.parent.editSettings.newRowPosition&&(this.parent.frozenRows||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)){var i=this.header.matrix.matrix.length-(this.groupedFrozenRow?this.groupedFrozenRow:this.parent.frozenRows);t=this.findNextCellFocus(this.header.matrix.matrix[i-1],t),this.header.matrix.current=[i-1,t],this.active=this.header}else t=this.findNextCellFocus(this.content.matrix.matrix[parseInt(e.toString(),10)],t),this.content.matrix.current=[e,t],this.active=this.content;var n=this.parent.element.querySelector(".e-addedrow");n&&n.querySelectorAll("tr")&&n.querySelector("tr").cells[parseInt(t.toString(),10)].querySelector("input")&&n.querySelector("tr").cells[parseInt(t.toString(),10)].querySelector("input").select()}},e.prototype.findNextCellFocus=function(e,t){for(var i=t;i<e.length;i++)if(1===e[parseInt(i.toString(),10)])return i;return t},e.prototype.filterfocus=function(){"FilterBar"!==this.parent.filterSettings.type&&(this.removeFocus(),this.restoreFocus())},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.EventHandler.remove(this.parent.element,"mousedown",this.focusCheck),t.EventHandler.remove(this.parent.element,"touchstart",this.focusCheck),t.EventHandler.remove(this.parent.element,"focus",this.onFocus),t.EventHandler.remove(this.parent.element,"focusin",this.focusIn),t.EventHandler.remove(this.parent.element,"focusout",this.onBlur),this.parent.element.removeEventListener("focus",this.passiveHandler,!0),at(this.parent,this.evtHandlers,!1))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.restoreFocus=function(e){if(!e||"sorting"!==e.requestType||!t.isNullOrUndefined(e.target)){var i=this.parent.groupModule;if(this.parent.allowGrouping&&i&&(i.groupSortFocus||i.groupTextFocus))return i.groupSortFocus=!1,void(i.groupTextFocus=!1);this.firstHeaderCellClick=!0,this.addFocus(this.getContent().getFocusInfo());var n=["add","save","delete","cancel","batchsave","batchDelete","batchCancel"],r=this.getContent().getFocusInfo();if(e&&n.indexOf(e.requestType)>-1&&r&&r.elementToFocus){var s=r.elementToFocus.matches(".e-rowcell.e-focus")?r.elementToFocus:r.elementToFocus.matches(".e-checkselect.e-focus")?r.elementToFocus.closest(".e-rowcell"):null;s&&t.addClass([s],["e-focused","e-focus"])}}},e.prototype.restoreFocusWithAction=function(e){if(!(this.parent.enableInfiniteScrolling||this.parent.groupModule&&this.parent.groupModule.preventFocusOnGroup)){var i=this.getContent().matrix,n=i.current;switch(e.requestType){case"grouping":case"ungrouping":n[1]=!n.length||this.parent.groupSettings.showGroupedColumn||t.isNullOrUndefined(i.matrix[n[0]])?"grouping"===e.requestType?n[1]+1:n[1]-1:i.matrix[n[0]].indexOf(1)}this.getContent().matrix.current=n,this.prevIndexes={rowIndex:n[0],cellIndex:n[1]};var r=this.parent.groupModule;if(this.parent.allowGrouping&&r&&r.groupCancelFocus){var s=r.getFocusableGroupedItems();return s.length?s[0].parentElement.getAttribute("data-mappingname")===e.columnName?s[3].focus():s[0].focus():r.element.focus(),void(r.groupCancelFocus=!1)}this.addFocus(this.getContent().getFocusInfo())}},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){if(0!==this.parent.frozenRows){var i,n={home:function(){return{toHeader:!i.isContent,toFrozen:!0}},end:function(){return{toHeader:!i.isContent,toFrozen:!1}},ctrlHome:function(){return{toHeader:!0,toFrozen:!1}},ctrlEnd:function(){return{toHeader:!1,toFrozen:!1}}};if(e in n){i=t.getInfo();var r=n[""+e]();this.setActive(!r.toHeader),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")||("tab"===e.keyArgs.action||"shiftTab"===e.keyArgs.action)&&e.parent.classList.contains("e-unboundcell"))){this.clearIndicator();var t;t=e.parent&&e.parent.closest(".e-unboundcell")&&"shiftTab"===e.keyArgs.action?this.commandColumnFocusElement(e.parent,!0):this.getContent().getFocusable(this.getFocusedElement()),this.setFocusedElement(t),this.currentInfo.skipAction=!0}},e.prototype.commandColumnFocusElement=function(e,t){var i=e.querySelectorAll("button:not(.e-hide)");return t?i[i.length-1]:i[0]},e}(),nr=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[parseInt(e.toString(),10)]=this.matrix[parseInt(e.toString(),10)]||[],this.matrix[parseInt(e.toString(),10)][parseInt(t.toString(),10)]=i?1:0},e.prototype.get=function(e,i,n,r,s,o){var a=i;if(e+n[0]<0)return[e,i];e=Math.max(0,Math.min(e+n[0],this.rows));var l=!0;if(t.isNullOrUndefined(this.matrix[parseInt(e.toString(),10)]))return null;if(i=Math.max(0,Math.min(i+n[1],this.matrix[parseInt(e.toString(),10)].length-1)),a+n[1]>this.matrix[parseInt(e.toString(),10)].length-1&&s(e,i,r))return[e,-1!==["downArrow","upArrow"].indexOf(r)?this.matrix[parseInt(e.toString(),10)].lastIndexOf(1):a];var d=this.first(this.matrix[parseInt(e.toString(),10)],i,n,!0,r);i=null===d?a:d;var h=t.getValue(e+"."+i,this.matrix);e!==this.rows||"downArrow"!==r&&"enter"!==r||(n[0]=-1);var p;if(o){var c=this.getRowsFromIndex(e,o);p=t.getValue(e+".cells."+i,c)}if(p&&0===p.getBoundingClientRect().width){var u=this.nextVisibleCellFocus(e,i,r,n,o,a);e=u[0],i=u[1]}if(null===d){for(var g=0;g<this.rows;g++)if(this.matrix[parseInt(g.toString(),10)].some(function(e){return 1===e})){l=!1;break}if(l)return e=this.current.length?this.current[0]:0,[e,i]}return this.inValid(h)||!s(e,i,r)?this.get(e,a,n,r,s):[e,i]},e.prototype.getRowsFromIndex=function(e,t){var i=t.getTable().rows[parseInt(e.toString(),10)];return i.classList.contains("e-addedrow")&&i.querySelector("table")?i.querySelector("table").rows:t.getTable().rows},e.prototype.nextVisibleCellFocus=function(e,i,n,r,s,o){var a=this.getRowsFromIndex(e,s),l=t.getValue(e+".cells."+i,a),d=s.matrix.matrix,h=d.length-1,p="tab"===n,c="shiftTab"===n;if("enter"===n||"shiftEnter"===n||"downArrow"===n||"upArrow"===n)return[e,i];for(;l&&0===l.getBoundingClientRect().width;){if(p&&e===h&&i===d[parseInt(e.toString(),10)].lastIndexOf(1)||c&&0===e&&i===d[parseInt(e.toString(),10)].indexOf(1))return i=o,[e,i];p?i===d[parseInt(e.toString(),10)].lastIndexOf(1)?(e++,i=d[parseInt(e.toString(),10)].indexOf(1),i=this.first(this.matrix[parseInt(e.toString(),10)],i,r,!0,n),a=this.getRowsFromIndex(e,s)):(i++,i=this.first(this.matrix[parseInt(e.toString(),10)],i,r,!0,n)):c?i===d[parseInt(e.toString(),10)].indexOf(1)?(e--,i=d[parseInt(e.toString(),10)].lastIndexOf(1),i=this.first(this.matrix[parseInt(e.toString(),10)],i,r,!0,n),a=this.getRowsFromIndex(e,s)):(i--,i=this.first(this.matrix[parseInt(e.toString(),10)],i,r,!0,n)):"rightArrow"===n||"shiftRight"===n?i===d[parseInt(e.toString(),10)].lastIndexOf(1)?i=o:(i++,i=this.first(this.matrix[parseInt(e.toString(),10)],i,r,!0,n)):"leftArrow"===n||"shiftLeft"===n?i===d[parseInt(e.toString(),10)].indexOf(1)?i=o:(i--,i=this.first(this.matrix[parseInt(e.toString(),10)],i,r,!0,n)):null===n&&(i++,i=this.first(this.matrix[parseInt(e.toString(),10)],i,r,!0,n)),l=t.getValue(e+".cells."+i,a)}return[e,i]},e.prototype.first=function(e,t,i,n,r){return(t<0||t===e.length)&&this.inValid(e[parseInt(t.toString(),10)])&&"upArrow"!==r&&"downArrow"!==r||!e.some(function(e){return 1===e})?null:this.inValid(e[parseInt(t.toString(),10)])?this.first(e,-1!==["upArrow","downArrow","shiftUp","shiftDown","enter","shiftEnter"].indexOf(r)?n?0:++t:t+i[1],i,!1,r):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[parseInt(e.toString(),10)].length-1)),this.current=[e,t]},e.prototype.generate=function(e,t,i){this.rows=e.length-1,this.matrix=[];for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)].cells.filter(function(e){return!0!==e.isSpanned});this.columns=Math.max(r.length-1,0|this.columns);for(var s=0,o=0;o<r.length;o++)r[parseInt(o.toString(),10)].column&&r[parseInt(o.toString(),10)].column.columns?s=this.columnsCount(r[parseInt(o.toString(),10)].column.columns,s):s++,this.set(n,o,!1!==e[parseInt(n.toString(),10)].visible&&t(e[parseInt(n.toString(),10)],r[parseInt(o.toString(),10)],i));this.columns=Math.max(s-1,0|this.columns)}return this.matrix},e.prototype.columnsCount=function(e,t){for(var i=e,n=t,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].columns?n=this.columnsCount(i[parseInt(r.toString(),10)].columns,n):n++;return n},e.prototype.inValid=function(e){return 0===e||void 0===e},e}(),rr=function(){function i(e){var t=this;this.matrix=new nr,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.getContentTable()},i.prototype.onKeyPress=function(e){if(/(Mac)/i.test(navigator.platform)&&e.metaKey)if("home"===e.action)e.action="ctrlHome";else if("end"===e.action)e.action="ctrlEnd";else if(-1!==["downArrow","upArrow","leftArrow","rightArrow"].indexOf(e.action))return;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()||this.parent.allowPaging&&!this.parent.pagerModule.pagerObj.checkPagerHasFocus()&&this.matrix.current[0]===this.matrix.rows&&("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.allowAdding&&40===e.keyCode||40===e.keyCode)){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()||this.parent.allowGrouping&&this.parent.infiniteScrollSettings.enableCache&&i.toString()===[0,1].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 n=this.parent,r=n.editSettings.allowNextRowEdit&&(n.isEdit||n.isLastCellPrimaryKey),s=n.getColumnIndexByField(n.getVisibleColumns()[0].field),o=this.getTable().rows[parseInt(e.toString(),10)],a=n.editSettings.showAddNewRow&&o.classList.contains("e-addedrow")?o.querySelectorAll("td:not(.e-editcell)")[parseInt(t.toString(),10)]:o.cells[parseInt(t.toString(),10)];return"tab"===i&&r&&(e++,t=s+(this.getTable().rows[parseInt(e.toString(),10)].getElementsByClassName("e-indentcell").length+this.getTable().rows[parseInt(e.toString(),10)].getElementsByClassName("e-detailrowcollapse").length)),"shiftTab"===i&&r&&(e--,t=n.getColumnIndexByField(n.getVisibleColumns()[n.getVisibleColumns().length-1].field)),!a||a.classList.contains(_i)||a.classList.contains("e-headercell")||a.classList.contains("e-groupcaption")||a.classList.contains("e-filterbarcell")?[e,t]:this.editNextRow(e,t,i)},i.prototype.getCurrentFromAction=function(e,i,n,r){if(void 0===i&&(i=[0,0]),!n&&!this.indexesByKey(e)||0===this.matrix.current.length)return null;if(!this.shouldFocusChange(r))return this.matrix.current;var s=this.indexesByKey(e)||this.matrix.current.concat(i),o=s[0],a=s[1],l=s[2],d=s[3];if(this.parent.allowGrouping&&!t.isNullOrUndefined(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length&&this.parent.aggregates.length&&"enter"===e)for(var h=o;h<this.matrix.matrix.length;h++){var p=this.getTable().rows[h+1];if(p&&p.cells[parseInt(a.toString(),10)]&&p.cells[parseInt(a.toString(),10)].classList.contains("e-rowcell"))return[h+1,a];if(h===this.matrix.matrix.length-1)return[o,a]}if("ctrlEnd"===e||"end"===e){var c=[this.matrix.matrix.length-1,this.matrix.matrix[this.matrix.matrix.length-1].length-1];"end"===e&&(c=[o,this.matrix.matrix[parseInt(o.toString(),10)].length-1]),0===this.matrix.matrix[c[0]][c[1]]&&(c=bt(this.matrix.matrix,c,!1)),o=c[0],a=c[1]+1}return this.matrix.get(o,a,[l,d],e,this.validator(),this)},i.prototype.checkRowCellFocus=function(e){return!e.classList.contains(_i)||e.classList.contains("e-focused")},i.prototype.onClick=function(e,i){var n=e.target;if(this.target=n,n=n.classList.contains(_i)?n:t.closest(n,"td"),n=n||(t.closest(e.target,"td.e-detailrowcollapse")||t.closest(e.target,"td.e-detailrowexpand")),n=t.closest(e.target,"td.e-detailcell")&&t.isNullOrUndefined(t.closest(t.closest(e.target,".e-grid"),"td.e-detailcell"))?null:n,!(n=n&&t.closest(n,"table").classList.contains(Ji)?n:null))return!1;var r=n.parentElement.rowIndex;this.parent.editSettings.showAddNewRow&&F(n,"e-addedrow")&&(r=F(n,"e-addedrow").rowIndex);var s=[r,n.cellIndex],o=s[0],a=s[1],l=this.matrix.current,d=l[0],h=l[1],p=t.getValue(o+"."+a,this.matrix.matrix);if(this.matrix.inValid(p)||!i&&d===o&&h===a&&this.checkRowCellFocus(n)&&!n.querySelector(".e-focus.e-checkbox")||!F(e.target,_i)&&!F(e.target,"e-groupcaption")&&!F(e.target,"e-recordpluscollapse")&&!F(e.target,"e-recordplusexpand")&&!F(e.target,"e-detailrowcollapse")&&!F(e.target,"e-detailrowexpand")&&!F(e.target,"e-templatecell"))return!1;this.matrix.select(o,a)},i.prototype.getFocusInfo=function(){var e={},i=this.matrix.current,n=i[0],r=void 0===n?0:n,s=i[1],o=void 0===s?0:s;this.matrix.current=[r,o];var a=this.getTable().rows[parseInt(r.toString(),10)];return e.element=t.isNullOrUndefined(a)?null:this.parent.editSettings.showAddNewRow&&a.classList.contains("e-addedrow")?a.querySelectorAll("td:not(.e-editcell)")[parseInt(o.toString(),10)]:a.cells[parseInt(o.toString(),10)],e.element?(e.elementToFocus=e.element.classList.contains("e-unboundcell")&&!(this.parent.editSettings.showAddNewRow&&e.element.classList.contains("e-unboundcell")&&F(e.element,"e-addedrow"))||e.element.classList.contains("e-detailcell")?e.element:this.getFocusable(e.element),e.elementToFocus=e.element.classList.contains("e-detailcell")&&e.element.querySelector(".e-childgrid")?e.element.querySelector(".e-childgrid"):e.elementToFocus,"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&"input"===e.elementToFocus.tagName.toLowerCase()&&e.elementToFocus.classList.contains("e-dropdownlist")&&(e.elementToFocus=e.elementToFocus.parentElement),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"])',n=!t.isNullOrUndefined(t.closest(e,".e-templatecell"));this.parent.isEdit&&(i='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea'+(this.parent.editSettings.showAddNewRow&&F(e,"e-addedrow")?", button:not(.e-hide)":""));var r=[].slice.call(e.querySelectorAll(i));if(e.classList.contains("e-fltrtemp")){var s=[].slice.call(e.querySelectorAll(".e-fltrtemp-focus"));if("click"===this.focusType&&this.target&&this.target.classList.contains("e-fltrtemp-focus"))return this.target;if("key"===this.focusType&&s.length&&("tab"===this.action||"shiftTab"===this.action)){var o=s.indexOf(this.currentTarget);return-1===o?s["tab"===this.action?0:s.length-1]:s["tab"===this.action?o+1:o-1]}}return r.length?!(n&&r.length>1)||"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&this.target?r[0]:this.target?this.target:e:e},i.prototype.selector=function(i,n,r){var s=[e.CellType.Expand,e.CellType.GroupCaption,e.CellType.CaptionSummary,e.CellType.GroupSummary];return(i.isDataRow&&n.visible&&(n.isDataCell||n.isTemplate)||i.isDataRow&&n.cellType===e.CellType.DetailExpand&&t.isNullOrUndefined(n.visible)||!i.isDataRow&&s.indexOf(n.cellType)>-1&&!!(n.cellType!==e.CellType.GroupSummary&&n.cellType!==e.CellType.CaptionSummary||n.isDataCell&&n.visible)||n.column&&n.visible&&"checkbox"===n.column.type||n.cellType===e.CellType.CommandColumn||i.isDataRow&&r)&&!("delete"===i.edit&&i.isDirty)},i.prototype.nextRowFocusValidate=function(e){for(var t=e,i=e,n=this.matrix.rows;i<=n;i++){if(-1!==this.matrix.matrix[parseInt(e.toString(),10)].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[parseInt(e.toString(),10)].indexOf(1))return e;if((e-=1)<0)return this.lastIdxCell=!0,t}return t},i.prototype.jump=function(e,i){this.lastIdxCell=!1;var n=0!==this.parent.frozenRows&&"shiftEnter"===e,r=("upArrow"===e||n)&&0===i[0];this.matrix.matrix[i[0]]&&"tab"===e&&this.matrix.matrix.length&&i[1]===this.matrix.matrix[i[0]].lastIndexOf(1)&&this.matrix.matrix.length-1!==i[0]&&(this.matrix.current[0]=this.nextRowFocusValidate(this.matrix.current[0]+1),this.matrix.current[1]=-1),"shiftTab"===e&&0!==i[0]&&this.matrix.matrix[i[0]].indexOf(1)===i[1]&&(this.matrix.current[0]=this.previousRowFocusValidate(this.matrix.current[0]-1),this.matrix.current[1]=this.matrix.matrix[i[0]].length);var s=!1,o=F(document.activeElement,"e-addedrow")&&this.parent.editSettings.showAddNewRow?F(document.activeElement,"e-addedrow"):document.activeElement.parentElement;return(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&!t.isNullOrUndefined(o)&&o.classList.contains(Zi)&&(s=parseInt(o.getAttribute(an),10)-1>0),{swap:!s&&(("upArrow"===e||n)&&0===i[0]),toHeader:r}},i.prototype.getNextCurrent=function(e,t,i,n){void 0===e&&(e=[]);var r=[];return"rightArrow"!==n&&"tab"!==n||(r[0]=e[0],r[1]=-1),"downArrow"!==n&&"enter"!==n||(r[0]=-1,r[1]=e[1]),r},i.prototype.generateRows=function(e,t){var i,n=t.matrix,r=t.handlerInstance,s=r.matrix.matrix.length,o=this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type?s+1:s;r.matrix.matrix=r.matrix.matrix.slice(0,o),r.matrix.rows=o,(i=r.matrix.matrix).push.apply(i,n),r.matrix.rows+=n.length},i.prototype.getInfo=function(e){var t=this.getFocusInfo(),i=this.matrix.current,n=i[0],r=i[1],s=t.element.classList.contains(_i),o=s||e&&"enter"!==e.action&&(t.element.classList.contains("e-detailrowcollapse")||t.element.classList.contains("e-detailrowexpand")),a=[Math.min(parseInt(t.element.parentElement.getAttribute(an),10)-1,n),Math.min(parseInt(t.element.getAttribute(on),10)-1,r)],l=a[0],d=a[1];return this.parent.allowGrouping&&this.parent.groupSettings.enableLazyLoading&&s&&(l=this.parent.getDataRows().indexOf(t.element.parentElement)),this.parent.enableVirtualization&&this.parent.groupSettings.columns.length&&(l=n,d=r),this.parent.editSettings.showAddNewRow&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&e&&"downArrow"===e.action&&l++,{isContent:!0,isDataCell:s,indexes:[l,d],isSelectable:o}},i.prototype.validator=function(){var e=this.getTable();return function(i,n,r){if(!t.isNullOrUndefined(e.rows[parseInt(i.toString(),10)])){var s=void 0;n=e.querySelector(".e-emptyrow")?0:n;var o=0!==(s=e.rows[parseInt(i.toString(),10)].cells[0].classList.contains("e-editcell")?e.rows[parseInt(i.toString(),10)].cells[0].querySelectorAll("td")[parseInt(n.toString(),10)]:e.rows[parseInt(i.toString(),10)].cells[parseInt(n.toString(),10)]).getBoundingClientRect().width;if("enter"===r||"shiftEnter"===r)return o&&s.classList.contains(_i);if(("shiftUp"===r||"shiftDown"===r)&&s.classList.contains(_i))return o;if("shiftUp"!==r&&"shiftDown"!==r)return o}return!1}},i.prototype.shouldFocusChange=function(e){var i=this.matrix.current,n=i[0],r=void 0===n?-1:n,s=i[1],o=void 0===s?-1:s;if(r<0||o<0)return!0;var a=t.getValue(r+".cells."+o,this.getTable().rows);return!a||("enter"!==e.action&&"shiftEnter"!==e.action||(a.classList.contains(_i)&&!a.classList.contains("e-unboundcell")||a.classList.contains("e-editedbatchcell")&&!a.classList.contains("e-detailcell")))},i.prototype.getGridSeletion=function(){return this.parent.allowSelection&&this.parent.selectionSettings.allowColumnSelection},i}(),sr=function(i){function n(e){return i.call(this,e)||this}return tr(n,i),n.prototype.getTable=function(){return this.parent.getHeaderTable()},n.prototype.onClick=function(e){this.focusType="click";var i=e.target;if(this.target=i,!(i=i.classList.contains("e-headercell")?i:t.closest(i,"th"))&&(0!==this.parent.frozenRows||0!==this.parent.pinnedTopRecords.length||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&(i=e.target.classList.contains(_i)?e.target:t.closest(e.target,"td")),e.target.classList.contains("e-columnheader")||e.target.querySelector(".e-stackedheadercell"))return!1;if(i){var n=i.parentElement.rowIndex;this.parent.editSettings.showAddNewRow&&F(i,"e-addedrow")&&(n=F(i,"e-addedrow").rowIndex);var r=[n,i.cellIndex],s=r[0],o=r[1],a=t.getValue(s+"."+o,this.matrix.matrix);if(this.matrix.inValid(a))return!1;this.matrix.select(n,i.cellIndex)}},n.prototype.getFocusInfo=function(){var e={},i=this.matrix.current,n=i[0],r=void 0===n?0:n,s=i[1],o=void 0===s?0:s,a=this.getTable().rows[parseInt(r.toString(),10)];return e.element=t.isNullOrUndefined(a)?null:this.parent.editSettings.showAddNewRow&&a.classList.contains("e-addedrow")?a.querySelectorAll("td:not(.e-editcell)")[parseInt(o.toString(),10)]:a.cells[parseInt(o.toString(),10)],t.isNullOrUndefined(e.element)||(e.elementToFocus=this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell")),e},n.prototype.selector=function(i,n){return n.visible&&(void 0!==n.column.field||n.isTemplate||!t.isNullOrUndefined(n.column.template)||!t.isNullOrUndefined(n.column.commands)||"checkbox"===n.column.type)||n.cellType===e.CellType.StackedHeader},n.prototype.jump=function(e,t){var i,n,r=0!==this.parent.frozenRows&&"enter"===e;return this.parent.enableHeaderFocus&&"tab"===e&&(n=this.matrix.matrix.length-1===t[0],(i=t[1]===this.matrix.matrix[t[0]].lastIndexOf(1))&&(this.matrix.current[0]=n?0:this.matrix.current[0]+1,this.matrix.current[1]=-1)),{swap:("downArrow"===e||r)&&t[0]===this.matrix.matrix.length-1||"tab"===e&&n&&i}},n.prototype.getNextCurrent=function(e,t,i,n){void 0===e&&(e=[]);var r=[];return("rightArrow"===n||"shiftRight"===n&&this.getGridSeletion()||"tab"===n)&&(r[0]=e[0],r[1]=-1),"upArrow"!==n&&"shiftEnter"!==n||(r[0]=this.matrix.matrix.length,r[1]=e[1]),r},n.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,n=0,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].column&&i[parseInt(r.toString(),10)].column.columns?n=this.checkFilterColumn(i[parseInt(r.toString(),10)].column.columns,t,n):(this.matrix.set(t,n,i[parseInt(r.toString(),10)].visible&&!1!==i[parseInt(r.toString(),10)].column.allowFiltering),n++)}},n.prototype.checkFilterColumn=function(e,t,i){for(var n=e,r=i,s=0;s<n.length;s++)n[parseInt(s.toString(),10)].columns?r=this.checkFilterColumn(n[parseInt(s.toString(),10)].columns,t,r):(this.matrix.set(t,r,n[parseInt(s.toString(),10)].visible&&!1!==n[parseInt(s.toString(),10)].allowFiltering),r++);return r},n.prototype.getInfo=function(e){return t.extend(i.prototype.getInfo.call(this,e),{isContent:!1,isHeader:!0})},n.prototype.validator=function(){return function(){return!0}},n.prototype.shouldFocusChange=function(e){var i=this.matrix.current,n=i[0],r=i[1];if(n<0||r<0)return!0;var s=t.getValue(n+".cells."+r,this.getTable().rows);return!s||("enter"!==e.action&&"altDownArrow"!==e.action||!s.classList.contains("e-headercell"))},n.prototype.getHeaderType=function(){return"HeaderFocus"},n}(rr),or=function(){function e(e,t){this.searchBox=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization")}return e.prototype.searchFocus=function(e){if(e.target.parentElement.classList.add("e-input-focus"),e.target.classList.contains("e-input")&&e.target.classList.contains("e-search")&&e.target.value){var t=e.target.parentElement.querySelector(".e-sicon");t.classList.add("e-clear-icon"),t.setAttribute("title",this.l10n.getConstant("Clear")),t.style.cursor="pointer"}},e.prototype.searchBlur=function(e){var i=e.relatedTarget?e.relatedTarget:null;if(i&&i.classList.contains("e-sicon")?i.classList.contains("e-clear-icon")&&e.target.parentElement.classList.remove("e-input-focus"):e.target.parentElement.classList.remove("e-input-focus"),e.target.classList.contains("e-search")&&(i&&!i.classList.contains("e-sicon e-clear-icon")&&!i.classList.contains("e-sicon")||t.isNullOrUndefined(i))){var n=e.target.parentElement.querySelector(".e-sicon");n.classList.remove("e-clear-icon"),n.removeAttribute("title"),n.style.cursor="default"}},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}(),ar=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lr=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},dr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ar(i,e),lr([t.Property(12)],i.prototype,"pageSize",void 0),lr([t.Property(8)],i.prototype,"pageCount",void 0),lr([t.Property(1)],i.prototype,"currentPage",void 0),lr([t.Property()],i.prototype,"totalRecordsCount",void 0),lr([t.Property(!1)],i.prototype,"enableQueryString",void 0),lr([t.Property(!1)],i.prototype,"pageSizes",void 0),lr([t.Property(null)],i.prototype,"template",void 0),i}(t.ChildProperty),hr=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),pr=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},cr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return hr(i,e),pr([t.Property("startsWith")],i.prototype,"operator",void 0),pr([t.Property(!1)],i.prototype,"ignoreAccent",void 0),pr([t.Property(null)],i.prototype,"headerTemplate",void 0),pr([t.Property(null)],i.prototype,"template",void 0),pr([t.Property(null)],i.prototype,"footerTemplate",void 0),pr([t.Property(!0)],i.prototype,"enableSearching",void 0),pr([t.Property(null)],i.prototype,"renderCustomColumnChooser",void 0),i}(t.ChildProperty),ur=function(){function n(e,t,i){this.selectedRowIndexes=[],this.selectedRowCellIndexes=[],this.selectedRecords=[],this.preventFocus=!1,this.selectedColumnsIndexes=[],this.checkBoxState=!1,this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=!1,this.enableSelectMultiTouch=!1,this.clearRowCheck=!1,this.selectRowCheck=!1,this.selectedRowState={},this.unSelectedRowState={},this.totalRecordsCount=0,this.chkAllCollec=[],this.isCheckedOnAdd=!1,this.persistSelectedData=[],this.virtualSelectedData=[],this.partialSelectedData=[],this.deSelectedData=[],this.partialSelectableRecordsCount=0,this.disableSelectableRecordsCount=0,this.persistSelectedRecordsCount=0,this.partialSelectedRecordsCount=0,this.isHdrSelectAllClicked=!1,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.isKeyAction=!1,this.isRowDragSelected=!1,this.isPartialSelection=!1,this.rmtHdrChkbxClicked=!1,this.isCheckboxReset=!1,this.isRowDeselect=!1,this.autoFillRLselection=!0,this.isFocusLastCell=!1,this.bottom="0 0 2px 0",this.top="2px 0 0 0",this.right_bottom="0 2px 2px 0",this.bottom_left="0 0 2px 2px",this.top_right="2px 2px 0 0",this.top_left="2px 0 0 2px",this.top_bottom="2px 0 2px 0",this.top_right_bottom="2px 2px 2px 0",this.top_bottom_left="2px 0 2px 2px",this.top_right_left="2px 2px 0 2px",this.right_bottom_left="0 2px 2px 2px",this.all_border="2px",this.parent=e,this.selectionSettings=t,this.factory=i.getService("rendererFactory"),this.focus=i.getService("focus"),this.addEventListener(),this.wireEvents()}return n.prototype.initializeSelection=function(){this.parent.log("selection_key_missing"),this.render()},n.prototype.onActionBegin=function(e,t){this.parent.trigger(t,this.fDataUpdate(e))},n.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},n.prototype.onActionComplete=function(e,t){this.parent.trigger(t,this.fDataUpdate(e)),this.isMultiSelection=!1},n.prototype.getModuleName=function(){return"selection"},n.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Ki)||e.querySelector("."+Wi))&&(this.hidePopUp(),this.clearSelection(),this.parent.partialSelectedRecords=[],this.parent.partialSelectedIndexes=[],this.parent.disableSelectedRecords=[],this.parent.renderModule.selectableDataKey={},this.parent.renderModule.nonselectableDataKey={},this.destroyAutoFillElements(),this.removeEventListener(),this.unWireEvents(),t.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler))},n.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.editSettings.showAddNewRow&&!this.parent.isPersistSelection},n.prototype.getCurrentBatchRecordChanges=function(){var e=this.parent;if("Batch"===e.editSettings.mode&&e.editModule){var t=I(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,n=this.parent.getPrimaryKeyFieldNames()[0],r=0;r<i.length;r++)for(var s=0;s<t.length;s++)if(i[parseInt(r.toString(),10)][""+n]===t[parseInt(s.toString(),10)][""+n]){t.splice(s,1);break}return t}return this.parent.enableVirtualization&&this.parent.groupSettings.columns.length&&!this.parent.isPersistSelection?e.getCurrentViewRecords().filter(function(e){return void 0===e.key}):e.getCurrentViewRecords()},n.prototype.selectRow=function(e,t){if(this.selectedRowIndexes.length&&this.selectionSettings.enableSimpleMultiRowSelection)return void this.addRowsToSelection([e]);var i=this.parent,n=i.getRowByIndex(e),r=n&&i.getRowObjectFromUID(n.getAttribute("data-uid"));if(!(this.isPartialSelection&&r&&r.isDataRow)||r.isSelectable){if(this.parent.pinnedTopRecords.length&&n&&n.classList.contains("e-grid-pin-row"))return this.parent.isCheckBoxSelection?void(-1===this.selectedRowIndexes.indexOf(e)&&this.addRowsToSelection([e])):void(-1===this.selectedRowIndexes.indexOf(e)?this.selectRows([e]):this.clearRowSelection());var s;if(i.enableVirtualization&&e>-1){var o={selectedIndex:e,isAvailable:!0};if(this.parent.notify("select-virtual-Row",o),!n||!i.getRowObjectFromUID(n.getAttribute("data-uid")))return void(o.isAvailable&&!i.selectionSettings.persistSelection&&this.parent.getSelectedRecords().length>0&&this.clearRowSelection());s=i.getRowObjectFromUID(n.getAttribute("data-uid")).data}else s=this.getRowObj(e).data;if(this.isRowType()&&n&&!this.isEditing()){var a=n.hasAttribute("aria-selected");if(this.activeTarget(),t&&this.selectedRowIndexes.length){var l="ResetOnRowClick"===this.selectionSettings.checkboxMode,d=!this.parent.isCheckBoxSelection&&"Multiple"===this.selectionSettings.type;t=!((l||d)&&(1!==this.selectedRowIndexes.length||!l&&!d))&&((!this.isKeyAction||!this.parent.isCheckBoxSelection)&&-1!==this.selectedRowIndexes.indexOf(e))}else t=!1;this.isKeyAction=!1;var h;if(t){if("ResetOnRowClick"!==this.selectionSettings.checkboxMode&&this.selectionSettings.persistSelection){if(this.rowDeselect("rowDeselecting",[r.index],[r.data],[n],[r.foreignKeyData],this.actualTarget),this.isCancelDeSelect)return;this.parent.isCheckBoxSelection||(this.selectedRowIndexes=[],this.selectedRecords=[],this.isRowSelected=!1,this.selectRowIndex(-1)),this.rowDeselect("rowDeselected",[r.index],[r.data],[n],[r.foreignKeyData],this.actualTarget,void 0,void 0,void 0)}this.rowSelectingCallBack(h,t,e,s,!1,a,"cancel")(h)}else h={data:s,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,row:n,previousRow:i.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},this.parent.trigger("rowSelecting",this.fDataUpdate(h),this.rowSelectingCallBack(h,t,e,s,!1,a,"cancel"))}}},n.prototype.rowSelectingCallBack=function(e,i,n,r,s,o,a){var l=this;return function(e){if(!t.isNullOrUndefined(e)&&!0===e[""+a])return void l.disableInteracted();l.index=n,l.toggle=i,l.data=r,l.removed=s,o&&l.selectionSettings.persistSelection&&"ResetOnRowClick"!==l.selectionSettings.checkboxMode?(l.clearSelectedRow(n),l.selectRowCallBack()):!o&&l.selectionSettings.persistSelection&&l.parent.isCheckBoxSelection&&"ResetOnRowClick"!==l.selectionSettings.checkboxMode&&l.selectRowCallBack(),"ResetOnRowClick"===l.selectionSettings.checkboxMode&&(l.isCheckboxReset=!0,l.clearSelection()),(!l.selectionSettings.persistSelection||"ResetOnRowClick"===l.selectionSettings.checkboxMode||!l.parent.isCheckBoxSelection&&l.selectionSettings.persistSelection)&&(l.selectRowCheck=!0,l.clearRow())}},n.prototype.selectRowCallBack=function(){var e,t=this.parent,i=this.index,n=this.toggle,r=this.data,s=this.removed,o=t.getRowByIndex(i);n||s||(this.selectedRowIndexes.indexOf(i)<=-1&&this.updateRowSelection(o,i),this.selectRowIndex(i)),n||(e={data:r,rowIndex:i,row:o,previousRow:t.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked,rowIndexes:i},this.onActionComplete(e,"rowSelected")),this.isInteracted=!1,this.updateRowProps(i)},n.prototype.selectRowsByRange=function(e,t){this.selectRows(this.getCollectionFromIndexes(e,t)),this.selectRowIndex(t)},n.prototype.selectedDataUpdate=function(e,t,i,n,r){for(var s=0,o=n.length;s<o;s++){var a=this.parent.getDataRows()[n[parseInt(s.toString(),10)]];this.parent.enableVirtualization&&(a=this.parent.getRowByIndex(n[parseInt(s.toString(),10)]));var l=this.getRowObj(a);l&&l.isDataRow&&l.isSelectable?(e.push(l.data),i.push(a),t.push(l.foreignKeyData)):this.isPartialSelection&&r&&r.splice(r.indexOf(n[parseInt(s.toString(),10)]),1)}},n.prototype.selectRows=function(e){var i=this,n=this.parent,r=e.slice(),s=this.isSingleSel()?e[e.length-1]:e[0];this.isMultiSelection=!0;var o=[],a=[],l=[];if(this.isRowType()&&!this.isEditing()){this.parent.pinnedTopRecords.length&&(e=this.selectPinnedRowIndexes(e).concat(e),r=e.slice()),this.selectedDataUpdate(l,a,o,e,r),this.activeTarget();var d={cancel:!1,rowIndexes:r,row:o,rowIndex:s,target:this.actualTarget,prevRow:n.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:l,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:a};this.parent.trigger("rowSelecting",this.fDataUpdate(d),function(e){if(!t.isNullOrUndefined(e)&&!0===e.cancel)return void i.disableInteracted();i.selectionSettings.persistSelection&&n.allowRowDragAndDrop&&i.isDragged||i.clearRow(),i.selectRowIndex(r.slice(-1)[0]);var l=function(e,t){i.updateRowSelection(n.getRowByIndex(e),e,t),i.updateRowProps(s)};if(i.isSingleSel())l(s);else for(var d=0,h=r;d<h.length;d++)l(h[d],!!n.enableVirtualization);if(i.checkVirtualCheckBox()&&!i.parent.isPersistSelection)if(r.length===i.totalRecordsCount)i.virtualSelectedData=i.virtualCheckBoxData().slice(),i.selectedRowIndexes=Object.keys(i.virtualSelectedData).map(function(e){return parseInt(e,10)}),i.setCheckAllState();else{var p=r.filter(function(e){return-1===i.selectedRowIndexes.indexOf(e)});if(p.length>0){for(var c=i.virtualCheckBoxData().slice(),u=0;u<p.length;u++){var g=c[p[u]];t.isNullOrUndefined(g)||(i.virtualSelectedData.push(g),i.selectedRowIndexes.push(p[u]))}i.setCheckAllState()}}e={rowIndexes:r,row:o,rowIndex:s,target:i.actualTarget,prevRow:n.getRows()[i.prevRowIndex],previousRowIndex:i.prevRowIndex,data:i.getSelectedRecords(),isInteracted:i.isInteracted,isHeaderCheckboxClicked:i.isHeaderCheckboxClicked,foreignKeyData:a},i.isRowSelected&&i.onActionComplete(e,"rowSelected"),i.isInteracted=!1})}},n.prototype.addRowsToSelection=function(e){var i=this.parent,n=this.target;this.isMultiSelection=!0;var r=[],s=[],o=[],a=i.getSelectedRowIndexes().concat(e),l=this.isSingleSel()?i.getRowByIndex(e[e.length-1]):i.getRowByIndex(e[0]),d=t.isNullOrUndefined(l.querySelector(".e-checkselect"))&&t.isNullOrUndefined(l.querySelector(".e-edit-checkselect"));if(this.isRowType()&&!this.isEditing()||!d){this.parent.pinnedTopRecords.length&&!t.isNullOrUndefined(l)&&l.classList.contains("e-grid-pin-row")&&(e=this.selectPinnedRowIndexes(e).concat(e));var h,p=this.parent.getColumns().filter(function(e){return"checkbox"===e.type});this.isMultiCtrlRequest&&!p.length&&this.selectedDataUpdate(o,s,r,a);for(var c=0,u=e;c<u.length;c++){var g=u[c],f=this.getRowObj(g),m=this.parent.getPrimaryKeyFieldNames()[0],y=this.isLazyLoadPersistSelection()?!t.isNullOrUndefined(this.parent.selectionModule.selectedRowState[f.data[""+m]]):this.selectedRowIndexes.indexOf(g)>-1;if(!(this.isPartialSelection&&f&&f.isDataRow)||f.isSelectable){if(this.parent.pinnedTopRecords.length&&!t.isNullOrUndefined(l)&&l.classList.contains("e-grid-pin-row")){var v=this.parent.getRowByIndex(g);l=t.isNullOrUndefined(v)?l:v}if(this.selectRowIndex(g),y&&(p.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.isAddRowsToSelection=!0,this.rowDeselect("rowDeselecting",[g],[f.data],[l],[f.foreignKeyData],n),this.isCancelDeSelect)return;this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?this.virtualSelectedData.splice(this.virtualSelectedData.indexOf(f.data),1):!this.parent.isRemote()&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection&&this.partialSelectedData.splice(this.partialSelectedData.indexOf(f.data),1),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(g),1),this.selectedRecords.splice(this.selectedRecords.indexOf(l),1),this.selectRowIndex(this.selectedRowIndexes.length?this.selectedRowIndexes[this.selectedRowIndexes.length-1]:-1),l.removeAttribute("aria-selected"),this.addRemoveClassesForRow(l,!1,null,"e-selectionbackground","e-active"),this.rowDeselect("rowDeselected",[g],[f.data],[l],[f.foreignKeyData],n,void 0,void 0,void 0),this.isInteracted=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.isHdrSelectAllClicked=!1}else{if(this.activeTarget(),h={cancel:!1,data:o.length?o:f.data,rowIndex:g,row:r.length?r:l,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:s.length?s:f.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:a},this.parent.trigger("rowSelecting",this.fDataUpdate(h)),!t.isNullOrUndefined(h)&&!0===h.cancel)return void this.disableInteracted();this.isSingleSel()&&this.clearRow(),this.updateRowSelection(l,g)}if(y||(h={data:o.length?o:f.data,rowIndex:g,row:r.length?r:l,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,foreignKeyData:s.length?s:f.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:a},this.onActionComplete(h,"rowSelected")),this.isInteracted=!1,this.updateRowProps(g),this.isSingleSel())break}}}},n.prototype.selectPinnedRowIndexes=function(e){var t=[],i=this.parent.pinnedRowIndexes,n=this.parent.contentRowIndexes;return e.map(function(r){i[parseInt(r.toString(),10)]&&null!==i[parseInt(r.toString(),10)].contentIndex&&-1===e.indexOf(i[parseInt(r.toString(),10)].contentIndex)&&t.push(i[parseInt(r.toString(),10)].contentIndex),n[parseInt(r.toString(),10)]&&null!==n[parseInt(r.toString(),10)].pinnedIndex&&-1===e.indexOf(n[parseInt(r.toString(),10)].pinnedIndex)&&t.push(n[parseInt(r.toString(),10)].pinnedIndex)}),t},n.prototype.setPinnedSelectionIndexes=function(){this.parent.pinnedRowIndexes={},this.parent.contentRowIndexes={};for(var e=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),t=this.parent.pinnedTopRowModels,i=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)].index,s=t[parseInt(n.toString(),10)].data[""+i],o=this.parent.getRowIndexByPrimaryKey(s);this.parent.pinnedRowIndexes[parseInt(r.toString(),10)]={pinnedIndex:r,contentIndex:-1===o?null:o}}for(var a=0;a<e.length;a++){var o=e[parseInt(a.toString(),10)].index,s=e[parseInt(a.toString(),10)].data[""+i],l=this.parent.getPinnedRowObjectByKey(s),r=null===l?null:l.index;this.parent.contentRowIndexes[parseInt(o.toString(),10)]={pinnedIndex:r,contentIndex:o}}},n.prototype.getCollectionFromIndexes=function(e,t){for(var i=[],n=e<=t?{i:e,max:t}:{i:t,max:e},r=n.i,s=n.max;r<=s;r++)i.push(r);return e>t&&i.reverse(),i},n.prototype.clearRow=function(){this.clearRowCheck=!0,this.clearRowSelection()},n.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),this.isSingleSel()&&this.parent.isPersistSelection&&(this.selectedRowState={}))},n.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)}},n.prototype.updateRowProps=function(e){this.prevRowIndex=e,this.isRowSelected=this.selectedRowIndexes.length&&!0},n.prototype.getPkValue=function(e,t){return e&&_(e)?fe(e,t):t[""+e]},n.prototype.updatePersistCollection=function(e,i){var n=this;if((this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)||this.parent.isPersistSelection||this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0)&&!t.isNullOrUndefined(e)){this.parent.isPersistSelection||this.ensureCheckboxFieldSelection();var r=this.getRowObj(e),s=r.data?this.getPkValue(this.primaryKey,r.data):null;if(null===s)return;r.isSelected=i,i&&!this.isPartialSelection||this.isPartialSelection&&r.isSelectable&&r.isSelected?(this.selectedRowState[""+s]=i,delete this.unSelectedRowState[""+s],this.persistSelectedData.some(function(e){return n.getPkValue(n.primaryKey,e)===s})||(this.persistSelectedData.push(r.data),this.persistSelectedRecordsCount+=1)):this.parent.isPersistSelection||t.isNullOrUndefined(this.contentRenderer.requestType)?this.updatePersistDelete(s):(this.persistSelectedData=[],this.selectedRowState={})}},n.prototype.updatePersistDelete=function(e,t){var i=this;delete this.selectedRowState[""+e],this.rmtHdrChkbxClicked&&(this.unSelectedRowState[""+e]=!0);var n;this.persistSelectedData.some(function(t,r){return n=r,i.getPkValue(i.primaryKey,t)===e})&&(this.persistSelectedData.splice(n,1),this.persistSelectedRecordsCount-=1,t&&(this.parent.partialSelectedRecords.splice(n,1),this.parent.partialSelectedIndexes.splice(n,1),this.selectedRowIndexes.splice(n,1)))},n.prototype.updateCheckBoxes=function(e,i,n){if(!t.isNullOrUndefined(e)){var r=t.isNullOrUndefined(e.querySelector(".e-checkselect"))?e.querySelector(".e-edit-checkselect"):e.querySelector(".e-checkselect");t.isNullOrUndefined(r)||(le(r.nextElementSibling,i),oe(r,i),(t.isNullOrUndefined(this.checkedTarget)||!t.isNullOrUndefined(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(n))}},n.prototype.updateRowSelection=function(e,t,i){if(e&&(-1===this.selectedRowIndexes.indexOf(t)&&(this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?this.virtualSelectedData.push(this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data):!this.parent.isRemote()&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection&&this.partialSelectedData.push(this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data),this.selectedRowIndexes.push(t),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||this.parent.isFocusFirstCell||this.isFocusLastCell)){var n=this.focus.getPrevIndexes().cellIndex?e.cells[this.focus.getPrevIndexes().cellIndex]:e.querySelector(".e-selectionbackground:not(.e-hide, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop)");if(this.parent.contextMenuModule&&2===this.mouseButton&&(n=this.parent.contextMenuModule.cell),this.parent.isFocusFirstCell||this.isFocusLastCell){this.parent.isFocusFirstCell=!1;var r=this.isFocusLastCell?"last-child":"first-child";n=e.querySelector(".e-selectionbackground.e-rowcell:not(.e-hide, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop, .e-gridchkbox):"+r),this.isFocusLastCell=!1}if(!n||i||this.parent.isCheckBoxSelection&&this.isLazyLoadGroup()&&this.parent.enableInfiniteScrolling)return;this.focus.onClick({target:n},!0,!(this.parent.contextMenuModule&&2===this.mouseButton))}},n.prototype.clearSelection=function(){if(this.checkSelectAllClicked=!0,this.selectionSettings.persistSelection&&this.persistSelectedData.length&&(this.deSelectedData=this.persistSelectedData.slice()),!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.parent.isRemote())&&(this.persistSelectedData=[],this.selectedRowState={},this.persistSelectedRecordsCount=0),this.clearRowSelection(),this.clearCellSelection(),this.clearColumnSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0,this.enableSelectMultiTouch=!1,"ResetOnRowClick"===this.selectionSettings.checkboxMode&&this.target&&F(this.target,"e-rowcell")||(this.isInteracted=!1),this.checkSelectAllClicked=!1,this.isHdrSelectAllClicked=!1,this.rmtHdrChkbxClicked=!1}},n.prototype.clearRowSelection=function(){var e=this;if(this.isRowSelected){var t=this.parent.getDataRows(),i=[],n=[],r=[],s=[],o=this.target;this.isRowDeselect=!0;for(var a=0,l=this.selectedRowIndexes.length;a<l;a++){var d=void 0;d=this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache?this.parent.getRowByIndex(this.selectedRowIndexes[parseInt(a.toString(),10)]):"Batch"===this.parent.editSettings.mode?this.parent.getRows()[this.selectedRowIndexes[parseInt(a.toString(),10)]]:this.parent.getDataRows()[this.selectedRowIndexes[parseInt(a.toString(),10)]];var h=this.getRowObj(d);h&&(i.push(h.data),n.push(d),r.push(this.selectedRowIndexes[parseInt(a.toString(),10)]),s.push(h.foreignKeyData))}this.selectionSettings.persistSelection&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode&&(this.isRowClicked=!!this.checkSelectAllClicked),this.rowDeselect("rowDeselecting",r,i,n,s,o,null,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"))||e.parent.isPersistSelection)for(var a=0;a<e.selectedRecords.length;a++)e.updatePersistCollection(e.selectedRecords[parseInt(a.toString(),10)],!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 l=[].slice.call(t.filter(function(e){return e.hasAttribute("aria-selected")})),d=0;d<l.length;d++)e.disableUI||(l[parseInt(d.toString(),10)].removeAttribute("aria-selected"),e.addRemoveClassesForRow(l[parseInt(d.toString(),10)],!1,!0,"e-selectionbackground","e-active")),e.isPrevRowSelection||e.updatePersistCollection(l[parseInt(d.toString(),10)],!1),e.updateCheckBoxes(l[parseInt(d.toString(),10)]);!(e.parent.enableVirtualization||e.parent.enableInfiniteScrolling&&e.parent.infiniteScrollSettings.enableCache)||!e.selectedRecords.length||l.length||e.parent.selectionSettings.persistSelection||e.disableUI||e.parent.isCheckBoxSelection||e.addRemoveClassesForRow(null,!1,!0),e.virtualSelectedData=[],e.selectedRowIndexes=[],e.partialSelectedData=[],e.selectedRecords=[],e.partialSelectedRecordsCount=0,e.isRowSelected=!1,e.selectRowIndex(-1),e.isPrevRowSelection=!1,e.rowDeselect("rowDeselected",r,i,n,s,o,null,void 0,null),e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1))},null),this.isRowDeselect=!1}else this.clearRowCheck&&(this.clearRowCallBack(),this.clearRowCheck=!1,this.selectRowCheck&&(this.selectRowCallBack(),this.selectRowCheck=!1))},n.prototype.rowDeselect=function(e,i,n,r,s,o,a,l,d){var h=this;if(this.selectionSettings.persistSelection&&(this.isRowClicked||!this.isRowDeselect||this.checkSelectAllClicked||this.focus.activeKey&&this.focus.currentInfo.element.classList.contains("e-gridchkbox")&&"space"===this.focus.activeKey)||!this.selectionSettings.persistSelection){var p=1===i.length&&1===this.deSelectedData.length,c={rowIndex:i[0],data:this.selectionSettings.persistSelection&&"Uncheck"===this.parent.checkAllRows&&!p&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode?this.deSelectedData:n,foreignKeyData:s,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked};"rowDeselected"===e&&delete c.cancel;c.row=r,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)),this.parent.trigger(e,c,function(e){h.isCancelDeSelect=e.cancel,h.isCancelDeSelect&&(h.isRowClicked||h.isInteracted||h.checkSelectAllClicked)||(h.updatePersistCollection(r[0],!1),h.updateCheckBoxes(r[0],void 0,i[0])),void 0!==l&&l()})}else this.selectionSettings.persistSelection&&!this.isInteracted&&void 0!==l&&l()},n.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"))||{}:{})},n.prototype.selectCell=function(e,i){if(!(!this.isCellType()||this.isCellType()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache))){var n,r=this.parent.getCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex));this.currentIndex=e.rowIndex;var s=this.getCurrentBatchRecordChanges()[this.currentIndex];if(this.isCellType()&&r&&!this.isEditing()){var o=r.classList.contains("e-cellselectionbackground");if(i=i?!t.isUndefined(this.prevCIdxs)&&e.rowIndex===this.prevCIdxs.rowIndex&&e.cellIndex===this.prevCIdxs.cellIndex&&o:i)this.successCallBack(n,i,e,r,s)(n);else{(n={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}).currentCell=r;n.previousRowCellIndex=this.prevECIdxs,this.parent.trigger("cellSelecting",this.fDataUpdate(n),this.successCallBack(n,i,e,r,s)),this.cellselected=!0}}}},n.prototype.successCallBack=function(e,i,n,r,s){var o=this;return function(e){if((t.isNullOrUndefined(e)||!0!==e.cancel)&&(i||(e.currentCell=e.currentCell?e.currentCell:r),o.clearCell(),i||o.updateCellSelection(r,n.rowIndex,n.cellIndex),!i)){var a={data:s,cellIndex:n,currentCell:r,selectedRowCellIndex:o.selectedRowCellIndexes,previousRowCell:o.prevECIdxs?o.getCellIndex(o.prevECIdxs.rowIndex,o.prevECIdxs.cellIndex):void 0};a.previousRowCellIndex=o.prevECIdxs,o.updateCellProps(n,n),o.onActionComplete(a,"cellSelected")}}},n.prototype.getCellIndex=function(e,t){return this.parent.getCellFromIndex(e,t)},n.prototype.selectCellsByRange=function(e,i){var n=this;if(this.isCellType()){var r,s,o,a=this.parent,l=this.parent.isSpan?Ze(this.parent,e.rowIndex,e.cellIndex):a.getCellFromIndex(e.rowIndex,e.cellIndex),d=e,h=i=i||e;this.currentIndex=e.rowIndex;var p=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var c={data:p,cellIndex:e,currentCell:l,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};c.previousRowCellIndex=this.prevECIdxs,this.parent.trigger("cellSelecting",this.fDataUpdate(c),function(c){if(t.isNullOrUndefined(c)||!0!==c.cancel){if(n.clearCell(),e.rowIndex>i.rowIndex){var u=e;e=i,i=u}for(var g=e.rowIndex;g<=i.rowIndex;g++){n.selectionSettings.cellSelectionMode.indexOf("Box")<0?(r=g===e.rowIndex?e.cellIndex:0,s=g===i.rowIndex?i.cellIndex:n.getLastColIndex(g)):(r=e.cellIndex,s=i.cellIndex),o=[];for(var f=r<s?r:s,m=r>s?r:s;f<=m;f++)(l=n.parent.isSpan?Ze(a,g,f):a.getCellFromIndex(g,f))&&(o.push(f),n.updateCellSelection(l),n.addAttribute(l));n.selectedRowCellIndexes.push({rowIndex:g,cellIndexes:o})}var y={data:p,cellIndex:h,currentCell:a.getCellFromIndex(h.rowIndex,h.cellIndex),selectedRowCellIndex:n.selectedRowCellIndexes,previousRowCell:n.prevECIdxs?n.getCellIndex(n.prevECIdxs.rowIndex,n.prevECIdxs.cellIndex):void 0};y.previousRowCellIndex=n.prevECIdxs,n.isDragged||(n.onActionComplete(y,"cellSelected"),n.cellselected=!0),n.updateCellProps(d,h)}})}}},n.prototype.selectCells=function(e){if(this.isCellType()){var t=this.parent,i=t.getCellFromIndex(e[0].rowIndex,e[0].cellIndexes[0]);this.currentIndex=e[0].rowIndex;var n=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var r={data:n,cellIndex:e[0].cellIndexes[0],currentCell:i,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};r.previousRowCellIndex=this.prevECIdxs,this.onActionBegin(r,"cellSelecting");for(var s=0,o=e.length;s<o;s++)for(var a=0,l=e[parseInt(s.toString(),10)].cellIndexes.length;a<l;a++)(i=t.getCellFromIndex(e[parseInt(s.toString(),10)].rowIndex,e[parseInt(s.toString(),10)].cellIndexes[parseInt(a.toString(),10)]))&&(this.updateCellSelection(i),this.addAttribute(i),this.addRowCellIndex({rowIndex:e[parseInt(s.toString(),10)].rowIndex,cellIndex:e[parseInt(s.toString(),10)].cellIndexes[parseInt(a.toString(),10)]}));this.updateCellProps({rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]},{rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]});var d={data:n,cellIndex:e[0].cellIndexes[0],currentCell:i,selectedRowCellIndex:this.selectedRowCellIndexes,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};d.previousRowCellIndex=this.prevECIdxs,this.onActionComplete(d,"cellSelected")}}},n.prototype.addCellsToSelection=function(e){if(!(!this.isCellType()||this.isCellType()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache))){var i,n,r=this.parent;this.currentIndex=e[0].rowIndex;var s=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){this.hideAutoFill();var o;o=r.getRowsObject()[e[0].rowIndex],r.groupSettings.columns.length>0&&(o=r.getRowObjectFromUID(this.target.parentElement.getAttribute("data-uid")));for(var a=[],l=0,d=e;l<d.length;l++){for(var h=d[l],p=0,c=this.selectedRowCellIndexes.length;p<c;p++)if(this.selectedRowCellIndexes[parseInt(p.toString(),10)].rowIndex===h.rowIndex){n=p;break}i=r.getCellFromIndex(h.rowIndex,this.getColIndex(h.rowIndex,h.cellIndex));var u=h.cellIndex;r.groupSettings.columns.length>0?a.push(o.cells[u+r.groupSettings.columns.length].foreignKeyData):a.push(o.cells[parseInt(u.toString(),10)].foreignKeyData);var g={cancel:!1,data:s,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,currentCell:i,isCtrlPressed:this.isMultiCtrlRequest,previousRowCell:this.prevECIdxs?r.getCellFromIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};g.previousRowCellIndex=this.prevECIdxs;var f=n>-1;if(f){var m=this.selectedRowCellIndexes[parseInt(n.toString(),10)].cellIndexes;m.indexOf(h.cellIndex)>-1||"Both"===this.selectionSettings.mode&&i.classList.contains("e-gridchkbox")&&!i.getAttribute("aria-selected")?(this.cellDeselect("cellDeselecting",[{rowIndex:h.rowIndex,cellIndexes:[h.cellIndex]}],s,[i],a),m.splice(m.indexOf(h.cellIndex),1),0===m.length&&this.selectedRowCellIndexes.splice(n,1),i.classList.remove("e-cellselectionbackground"),i.removeAttribute("aria-selected"),this.cellDeselect("cellDeselected",[{rowIndex:h.rowIndex,cellIndexes:[h.cellIndex]}],s,[i],a)):(f=!1,this.onActionBegin(g,"cellSelecting"),this.addRowCellIndex({rowIndex:h.rowIndex,cellIndex:h.cellIndex}),this.updateCellSelection(i),this.addAttribute(i))}else{if(this.onActionBegin(g,"cellSelecting"),!t.isNullOrUndefined(g)&&!0===g.cancel)return;this.updateCellSelection(i,h.rowIndex,h.cellIndex)}if(!f){var y={data:s,cellIndex:e[0],currentCell:i,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,selectedRowCellIndex:this.selectedRowCellIndexes};y.previousRowCellIndex=this.prevECIdxs,this.onActionComplete(y,"cellSelected"),this.cellselected=!0}this.updateCellProps(h,h)}}}},n.prototype.getColIndex=function(e,t){var i=this.parent.getColumnByIndex(t),n=et(this.parent,i,e);if(n)for(var r=0;r<n.length;r++)if(parseInt(n[parseInt(r.toString(),10)].getAttribute(on),10)-1===t)return r;return-1},n.prototype.getLastColIndex=function(e){var t=this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll("td.e-rowcell");return parseInt(t[t.length-1].getAttribute(on),10)-1},n.prototype.clearCell=function(){this.clearCellSelection()},n.prototype.cellDeselect=function(e,i,n,r,s){if(r&&r.length>0)for(var o=0,a=r;o<a.length;o++){var l=a[o];l&&l.classList.contains($i)&&this.updateCheckBoxes(t.closest(l,"tr"))}var d={cells:r,data:n,cellIndexes:i,foreignKeyData:s,cancel:!1};this.parent.trigger(e,d),this.isPreventCellSelect=d.cancel},n.prototype.updateCellSelection=function(e,i,n){t.isNullOrUndefined(i)||this.addRowCellIndex({rowIndex:i,cellIndex:n}),e.classList.add("e-cellselectionbackground"),e.classList.contains($i)&&this.updateCheckBoxes(t.closest(e,"tr"),!0),this.addAttribute(e)},n.prototype.addAttribute=function(e){this.target=e,t.isNullOrUndefined(e)||(e.setAttribute("aria-selected","true"),this.preventFocus||this.focus.onClick({target:e},!0,!0))},n.prototype.updateCellProps=function(e,t){this.prevCIdxs=e,this.prevECIdxs=t,this.isCellSelected=this.selectedRowCellIndexes.length&&!0},n.prototype.addRowCellIndex=function(e){for(var t,i,n=0,r=this.selectedRowCellIndexes.length;n<r;n++)if(this.selectedRowCellIndexes[parseInt(n.toString(),10)].rowIndex===e.rowIndex){t=!0,i=n;break}t?this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes.indexOf(e.cellIndex)<0&&this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes.push(e.cellIndex):this.selectedRowCellIndexes.push({rowIndex:e.rowIndex,cellIndexes:[e.cellIndex]})},n.prototype.clearCellSelection=function(){if(this.isCellSelected){var e=this.parent,t=this.getSelectedCellsElement(),i=this.selectedRowCellIndexes,n=[],r=[],s=[],o=this.getCurrentBatchRecordChanges();this.hideAutoFill();for(var a=0,l=i.length;a<l;a++){n.push(o[i[parseInt(a.toString(),10)].rowIndex]);for(var d=this.getRowObj(i[parseInt(a.toString(),10)].rowIndex),h=0,p=i[parseInt(a.toString(),10)].cellIndexes.length;h<p;h++)d.cells&&s.push(d.cells[i[parseInt(a.toString(),10)].cellIndexes[parseInt(h.toString(),10)]].foreignKeyData),r.push(e.getCellFromIndex(i[parseInt(a.toString(),10)].rowIndex,i[parseInt(a.toString(),10)].cellIndexes[parseInt(h.toString(),10)]))}if(this.cellDeselect("cellDeselecting",i,n,r,s),!0===this.isPreventCellSelect)return;for(var a=0,l=t.length;a<l;a++)t[parseInt(a.toString(),10)].classList.remove("e-cellselectionbackground"),t[parseInt(a.toString(),10)].removeAttribute("aria-selected");this.bdrElement&&this.showHideBorders("none"),this.selectedRowCellIndexes=[],this.isCellSelected=!1,!this.isDragged&&this.cellselected&&this.cellDeselect("cellDeselected",i,n,r,s)}},n.prototype.getSelectedCellsElement=function(){for(var e=this.parent.getDataRows(),t=[],i=0,n=e.length;i<n;i++)t=t.concat([].slice.call(e[parseInt(i.toString(),10)].getElementsByClassName("e-cellselectionbackground")));return t},n.prototype.mouseMoveHandler=function(e){e.preventDefault(),this.stopTimer();var i,n=this.parent.element.getBoundingClientRect(),r=this.x,s=this.y,o=B(e),a=o.x-n.left,l=o.y-n.top,d=t.closest(e.target,"tr");if(this.isDragged=!0,this.isCellDrag||(d||(d=t.closest(document.elementFromPoint(this.parent.element.offsetLeft+2,e.clientY),"tr")),r>a&&(i=a,a=r,r=i),s>l&&(i=l,l=s,s=i),this.element.style.left=r+"px",this.element.style.top=s+"px",this.element.style.width=a-r+"px",this.element.style.height=l-s+"px"),d&&!e.ctrlKey&&!e.shiftKey){var h=parseInt(d.getAttribute(an),10)-1;if(this.isCellDrag){var p=F(e.target,_i);p&&(this.startAFCell=this.startCell,this.endAFCell=F(e.target,_i),h>-1&&this.selectLikeExcel(e,h,parseInt(p.getAttribute(on),10)-1))}else this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,h),this.isRowDragSelected=!0}e.ctrlKey||e.shiftKey||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.parent.enableColumnVirtualization||this.parent.groupSettings.columns.length||!this.isCellDrag||this.updateScrollPosition(e,o,this.parent.getContent())},n.prototype.updateScrollPosition=function(e,t,i){var n=this,r=i.getBoundingClientRect();r.left>=t.x-20-(this.parent.enableRtl&&"auto"!==this.parent.height?j():0)?this.timer1=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,n.parent.enableRtl?"right":"left",e)},200):r.left+i.clientWidth-20-(this.parent.enableRtl||"auto"===this.parent.height?0:j())<t.x&&(this.timer1=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,n.parent.enableRtl?"left":"right",e)},200)),r.top>=t.y-.5*this.parent.getRowHeight()?this.timer2=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,"up",e)},200):r.top+i.clientHeight-.5*this.parent.getRowHeight()-(i.firstElementChild.scrollWidth>i.firstElementChild.offsetWidth?j():0)<=t.y&&(this.timer2=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,"down",e)},200))},n.prototype.stopTimer=function(){this.timer1&&(window.clearInterval(this.timer1),this.timer1=null),this.timer2&&(window.clearInterval(this.timer2),this.timer2=null),this.preventFocus=!1},n.prototype.setScrollPosition=function(e,i,n){var r=-1,s=-1;switch((this.endAFCell||this.prevECIdxs)&&(r=this.endAFCell?parseInt(this.endAFCell.getAttribute("data-index"),10):this.prevECIdxs.rowIndex,s=this.endAFCell?parseInt(this.endAFCell.getAttribute("aria-colindex"),10)-1:this.prevECIdxs.cellIndex),i){case"up":if(n&&t.closest(n.target,".e-headercontent"))return;this.isAutoFillSel&&this.startAFCell&&this.selectedRowCellIndexes.length&&(1===this.selectedRowCellIndexes.length&&this.startAFCell!==this.startCell||this.selectedRowCellIndexes.length>1&&this.startAFCell.getBoundingClientRect().top>0)&&(r=parseInt(this.startAFCell.getAttribute("data-index"),10)),r-=1,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(r+=(this.parent.frozenRows||this.parent.pinnedTopRecords.length)+1),r<1?e.scrollTop=0:e.scrollTop-=this.parent.getRowByIndex(r).offsetHeight;break;case"down":this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(r=parseInt(this.startAFCell.getAttribute("data-index"),10)),r<this.parent.getRows().length-1?(r+=1,this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(this.startAFCell=this.parent.getCellFromIndex(r,this.selectedRowCellIndexes[0].cellIndexes[0])),e.scrollTop+=this.parent.getRowByIndex(r).offsetHeight):e.scrollTop=e.scrollHeight;break;case"left":if(s>0&&r>-1){this.isAutoFillSel&&this.startAFCell&&this.selectedRowCellIndexes.length&&(this.selectedRowCellIndexes[0].cellIndexes.length>0&&this.startAFCell!==this.startCell||this.selectedRowCellIndexes[0].cellIndexes.length>1&&(!this.parent.enableRtl&&this.startAFCell.getBoundingClientRect().left>0||this.parent.enableRtl&&this.startAFCell.getBoundingClientRect().left<this.parent.element.offsetWidth))&&(s=parseInt(this.startAFCell.getAttribute("aria-colindex"),10)-1);var o=this.findNextCell(e,i,s,r);s=o?parseInt(o.getAttribute("aria-colindex"),10)-1:-1,this.parent.enableRtl&&o?s<1?e.scrollLeft=e.scrollWidth:e.scrollLeft+=o.offsetWidth:o&&(s<1?e.scrollLeft=0:e.scrollLeft-=o.offsetWidth)}break;case"right":this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(s=parseInt(this.startAFCell.getAttribute("aria-colindex"),10)-1);var a=this.parent.getCellFromIndex(r,s),l=this.findNextCell(e,i,s,r);l&&this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(this.startAFCell=this.parent.getCellFromIndex(this.selectedRowCellIndexes[0].rowIndex,parseInt(l.getAttribute("aria-colindex"),10)-1)),s=l?parseInt(l.getAttribute("aria-colindex"),10)-1:-1,this.parent.enableRtl&&l?s<this.parent.columns.length-1?e.scrollLeft-=a.offsetWidth:e.scrollLeft=-e.scrollWidth:l&&(s<this.parent.columns.length-1?e.scrollLeft+=a.offsetWidth:e.scrollLeft=e.scrollWidth),this.isAutoFillSel&&(s===this.parent.columns.length-1||-1===s)&&this.startAFCell&&this.endAFCell&&(this.positionAFBorders(),e.scrollLeft=this.parent.enableRtl?-e.scrollWidth:e.scrollWidth)}if(r>-1&&r<this.parent.getRows().length&&s>-1){var d={target:this.parent.getCellFromIndex(r,s)};if(this.isAutoFillSel&&d.target.classList.contains("e-cellselectionbackground")&&("down"===i&&parseInt(d.target.getAttribute("data-index"),10)===this.parent.getRows().length-1||"right"===i&&parseInt(d.target.getAttribute("aria-colindex"),10)-1==this.parent.columns.length-1))return;this.endAFCell=d.target,this.preventFocus=!0,this.selectLikeExcel(d,r,s)}},n.prototype.findNextCell=function(e,t,i,n){var r=this.parent.getCellFromIndex(n,"left"===t?i-1:i+1);if(r&&r.classList.contains("e-hide")){var s=r.closest("tr").querySelectorAll(".e-rowcell:not(.e-hide)"),o=Array.from(s).indexOf(r.nextElementSibling);return o>0&&o<s.length-1?r=s[o+("left"===t?-1:1)]:(e.scrollLeft=0,null)}return r},n.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())},n.prototype.setFrozenBorders=function(e,t,i){var n=t.style.borderWidth.toString().split(" "),r=["","e-leftfreeze","e-unfreeze","e-leftfreeze","e-unfreeze","e-rightfreeze","e-rightfreeze"],s=[].slice.call(e.querySelectorAll(".e-cellselectionbackground."+r[""+i])).filter(function(e){return""===e.style.display}),o=[].slice.call(e.querySelectorAll(".e-cellselectionbackground.e-fixedfreeze")).filter(function(e){return""===e.style.display}),a=this.parent.enableRtl;if(s.length)for(var l=s[0].getAttribute("data-index"),d=s[0].getAttribute("aria-colindex"),h=s[s.length-1].getAttribute("data-index"),p=s[s.length-1].getAttribute("aria-colindex"),c=0;c<s.length;c++)s[parseInt(c.toString(),10)].getAttribute("data-index")===l&&(1===n.length||3===n.length&&2===parseInt(n[0],10)||4===n.length&&2===parseInt(n[0],10))&&s[parseInt(c.toString(),10)].classList.add("e-xlsel-top-border"),s[parseInt(c.toString(),10)].getAttribute("aria-colindex")===d&&(1===n.length||3===n.length&&2===parseInt(n[1],10)||4===n.length&&(!a&&2===parseInt(n[3],10)||a&&2===parseInt(n[1],10)))&&s[parseInt(c.toString(),10)].classList.add(a?"e-xlsel-right-border":"e-xlsel-left-border"),s[parseInt(c.toString(),10)].getAttribute("data-index")===h&&(1===n.length||3===n.length&&2===parseInt(n[2],10)||4===n.length&&2===parseInt(n[2],10))&&s[parseInt(c.toString(),10)].classList.add("e-xlsel-bottom-border"),s[parseInt(c.toString(),10)].getAttribute("aria-colindex")===p&&(1===n.length||3===n.length&&2===parseInt(n[1],10)||4===n.length&&!a&&2===parseInt(n[1],10)||a&&2===parseInt(n[3],10))&&s[parseInt(c.toString(),10)].classList.add(a?"e-xlsel-left-border":"e-xlsel-right-border");if(o.length)for(var l=o[0].getAttribute("data-index"),d=(parseInt(o[0].getAttribute("aria-colindex"),10)-1).toString(),h=o[o.length-1].getAttribute("data-index"),p=(parseInt(o[o.length-1].getAttribute("aria-colindex"),10)-1).toString(),c=0;c<o.length;c++){var u=o[parseInt(c.toString(),10)].getAttribute("data-index"),g=(parseInt(o[parseInt(c.toString(),10)].getAttribute("aria-colindex"),10)-1).toString();u!==l||(this.parent.getHeaderContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!F(e,"e-content"))&&F(e,"e-content")||o[parseInt(c.toString(),10)].classList.add("e-xlsel-top-border"),u!==h||(this.parent.getContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!F(e,"e-headercontent"))&&F(e,"e-headercontent")||o[parseInt(c.toString(),10)].classList.add("e-xlsel-bottom-border");var f=o[parseInt(c.toString(),10)].parentElement.children[parseInt(g,10)-1];g!==d||f&&(!f||f.classList.contains("e-cellselectionbackground"))||o[parseInt(c.toString(),10)].classList.add(a?"e-xlsel-right-border":"e-xlsel-left-border");var m=o[parseInt(c.toString(),10)].parentElement.children[parseInt(g,10)+1];g!==p||m&&(!m||m.classList.contains("e-cellselectionbackground"))||o[parseInt(c.toString(),10)].classList.add(a?"e-xlsel-left-border":"e-xlsel-right-border")}},n.prototype.refreshFrozenBorders=function(){this.bdrElement&&(this.setFrozenBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&this.parent.getFrozenMode()===nn&&this.setFrozenBorders(this.parent.getContentTable(),this.frcBdrElement,"5"),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.setFrozenBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid()&&this.parent.getFrozenMode()===nn&&this.setFrozenBorders(this.parent.getHeaderTable(),this.frhBdrElement,"6")))},n.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.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders())):this.showHideBorders("none")},n.prototype.isLastCell=function(e){var t=[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"));return t[t.length-1]===e},n.prototype.isLastRow=function(e){var i=[].slice.call(t.closest(e,ln).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===i[i.length-1]},n.prototype.isFirstRow=function(e){var i=[].slice.call(t.closest(e,ln).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===i[0]},n.prototype.isFirstCell=function(e){return[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"))[0]===e},n.prototype.setBorders=function(e,i,n){var r=[].slice.call(e.getElementsByClassName("e-cellselectionbackground")).filter(function(e){return""===e.style.display});if(r.length&&this.parent.isFrozenGrid()){var s=["","e-leftfreeze","e-unfreeze","e-leftfreeze","e-unfreeze","e-rightfreeze","e-rightfreeze"];r=[].slice.call(e.querySelectorAll(".e-cellselectionbackground."+s[""+n]+":not(.e-hide)")).filter(function(e){return""===e.style.display})}if(r.length){var o=this.parent.isFrozenGrid(),a=r[0],l=r[r.length-1],d=a.getBoundingClientRect(),h=l.getBoundingClientRect();if(!t.isNullOrUndefined(a.offsetParent)){var p=a.offsetParent.getBoundingClientRect();(a.offsetParent.classList.contains("e-content")||a.offsetParent.classList.contains("e-headercontent"))&&(p=a.offsetParent.querySelector("table").getBoundingClientRect());var c=o||!this.isLastRow(l)||"1"!==n&&"2"!==n&&"5"!==n?0:2,u=o&&("2"===n||"4"===n)&&this.isFirstCell(a)?1:0,g=("Right"!==this.parent.getFrozenMode()||"1"!==n&&"3"!==n)&&(this.parent.getFrozenMode()!==nn||"5"!==n&&"6"!==n)||!this.isFirstCell(a)?0:1;this.parent.enableRtl?(i.style.right=p.right-d.right-u+"px",i.style.width=d.right-h.left+u+1+"px"):(i.style.left=d.left-p.left-u-g+"px",i.style.width=h.right-d.left+u-g+1+"px"),i.style.top=d.top-p.top-0+"px",i.style.height=h.top-d.top>0?h.top-p.top+h.height+(o?0:1)-(d.top-p.top)-c+0+"px":h.height+0-c+(o?0:1)+"px",this.selectDirection+=n}}else i.style.display="none"},n.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.getContentTable(),this.mcBdrElement,"2"),this.parent.getFrozenMode()===nn&&this.setBorders(this.parent.getContentTable(),this.frcBdrElement,"5")),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.setBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.getHeaderTable(),this.mhBdrElement,"4"),this.parent.getFrozenMode()===nn&&this.setBorders(this.parent.getHeaderTable(),this.frhBdrElement,"6"))),this.applyBorders(this.selectDirection))},n.prototype.applyBothFrozenBorders=function(e){var t=this.parent.enableRtl;switch(e.length){case 6:this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=this.bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=this.top,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right;break;case 4:e.includes("1")&&e.includes("2")&&e.includes("3")&&e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom),e.includes("2")&&e.includes("4")&&e.includes("5")&&e.includes("6")&&(this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 3:this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mcBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mhBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom);break;case 2:e.includes("1")&&(this.mcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.top_right_left)),e.includes("2")&&(this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.mhBdrElement.style.borderWidth=this.top_right_left)),e.includes("3")&&(this.mhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.bdrElement.style.borderWidth=this.right_bottom_left),e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.mcBdrElement.style.borderWidth=this.right_bottom_left),e.includes("5")&&(this.mcBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.frhBdrElement.style.borderWidth=this.top_right_left)),e.includes("6")&&(this.mhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=this.right_bottom_left);break;default:this.bdrElement.style.borderWidth=this.all_border,this.mcBdrElement.style.borderWidth=this.all_border,this.frcBdrElement.style.borderWidth=this.all_border,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.all_border,this.mhBdrElement.style.borderWidth=this.all_border,this.frhBdrElement.style.borderWidth=this.all_border)}},n.prototype.applyBorders=function(e){var t=this.parent.enableRtl;if(this.parent.getFrozenMode()===nn)this.applyBothFrozenBorders(e);else switch(e.length){case 4:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.fhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left):(this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 2:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left,this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom,this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left)):(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left,this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom)));break;default:this.bdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=this.all_border),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth=this.all_border))}},n.prototype.createBorders=function(){if(!this.bdrElement){var e=t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdr"});if(e.style.cssText="width: 2px; border-width: 0;",this.bdrElement=this.parent.getContentTable().parentElement.appendChild(e),this.parent.isFrozenGrid()){var i=t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mcbdr"});if(i.style.cssText="height: 2px; border-width: 0;",this.mcBdrElement=this.parent.getContentTable().parentElement.appendChild(i),this.parent.getFrozenMode()===nn){var n=t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frcbdr"});n.style.cssText="height: 2px; border-width: 0;",this.frcBdrElement=this.parent.getContentTable().parentElement.appendChild(n)}}if(this.parent.frozenRows||this.parent.pinnedTopRecords.length){var r=t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_fhbdr"});r.style.height="2px",this.fhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(r)}if((this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&this.parent.isFrozenGrid()){var s=t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mhbdr"});if(s.style.height="2px",this.mhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(s),this.parent.getFrozenMode()===nn){var o=t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frhbdr"});o.style.height="2px",this.frhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(o)}}}},n.prototype.showHideBorders=function(e,i){if(this.bdrElement){if(this.bdrElement.style.display=e,this.parent.isFrozenGrid()){n=this.parent.getContentTable();t.removeClass(n.querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),t.removeClass(n.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),t.removeClass(n.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),t.removeClass(n.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),i||(this.mcBdrElement.style.display=e),this.parent.getFrozenMode()===nn&&(this.frcBdrElement.style.display=e)}if(this.parent.frozenRows||this.parent.pinnedTopRecords.length){var n=this.parent.getHeaderTable();t.removeClass(n.querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),t.removeClass(n.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),t.removeClass(n.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),t.removeClass(n.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),this.fhBdrElement.style.display=e}(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&this.parent.isFrozenGrid()&&(i||(this.mhBdrElement.style.display=e),this.parent.getFrozenMode()===nn&&(this.frhBdrElement.style.display=e))}},n.prototype.drawAFBorders=function(){this.bdrAFBottom||this.createAFBorders(),this.positionAFBorders()},n.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,n=t.top-e.top>=0&&(F(this.startAFCell,"e-movablecontent")||F(this.startAFCell,"e-frozencontent"))&&this.isFirstRow(this.startAFCell)?1.5:0,r=(F(this.startAFCell,"e-movablecontent")||F(this.startAFCell,"e-movableheader"))&&this.isFirstCell(this.startAFCell)?1:0,s=this.isLastRow(this.endAFCell)&&(F(this.endAFCell,"e-movablecontent")||F(this.endAFCell,"e-frozencontent"))?2:0,o=this.startAFCell.offsetParent.getBoundingClientRect(),a=this.parent.element.getBoundingClientRect(),l=this.startAFCell.offsetParent.parentElement.scrollTop,d=this.startAFCell.offsetParent.parentElement.scrollLeft,h=l-this.startAFCell.offsetTop,p=d-this.startAFCell.offsetLeft,c=this.parent.element.clientHeight-j();this.parent.allowPaging&&(c-=this.parent.element.querySelector(".e-pager").offsetHeight),this.parent.aggregates.length&&(c-=this.parent.getFooterContent().offsetHeight);var u=this.parent.element.clientWidth-("auto"!==this.parent.height?j():0);h=h>0?Math.floor(h)-1:0,p=p>0?p:0;var g=e.left-a.left;if(this.parent.enableRtl){var f=F(this.startAFCell,"e-movablecontent")||F(this.startAFCell,"e-movableheader")?e.right-this.startAFCell.offsetParent.parentElement.getBoundingClientRect().width-a.left:0;this.bdrAFLeft.style.right=a.right-t.right-2+t.width+"px",this.bdrAFLeft.style.width=u<=parseInt(this.bdrAFLeft.style.right,10)?"0px":"2px";var m=a.right-e.right-r+f-1;this.bdrAFRight.style.right=m>0?m+"px":"0px",this.bdrAFTop.style.left=t.left-a.left-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFLeft.style.right,10)-parseInt(this.bdrAFRight.style.right,10)-r+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","auto"!==this.parent.height&&j()?(this.bdrAFTop.style.left=j()+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-j()+"px"):this.bdrAFTop.style.left="0px")}else if(this.bdrAFLeft.style.left=g-r+p-1+"px",this.bdrAFRight.style.left=t.left-a.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)-r+1+"px",u<=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)){var y=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)-u;this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-y+"px"}if(this.bdrAFLeft.style.top=e.top-a.top-n+h+"px",this.bdrAFLeft.style.height=t.top-e.top>0?t.top-o.top+t.height+1-(e.top-o.top)+n-s-h+"px":t.height+n-s-h+"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 v=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)-c;this.bdrAFLeft.style.height=parseInt(this.bdrAFLeft.style.height,10)-v+"px",this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px"}}},n.prototype.createAFBorders=function(){if(!this.bdrAFLeft){var e=t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafleft"});e.style.width="2px",this.bdrAFLeft=this.parent.element.appendChild(e);var i=t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafright"});i.style.width="2px",this.bdrAFRight=this.parent.element.appendChild(i);var n=t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafbottom"});n.style.height="2px",this.bdrAFBottom=this.parent.element.appendChild(n);var r=t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdraftop"});r.style.height="2px",this.bdrAFTop=this.parent.element.appendChild(r)}},n.prototype.destroyAutoFillElements=function(){this.bdrAFLeft&&(this.bdrAFLeft.remove(),this.bdrAFRight.remove(),this.bdrAFBottom.remove(),this.bdrAFTop.remove(),this.bdrAFLeft=this.bdrAFRight=this.bdrAFBottom=this.bdrAFTop=null),this.autofill&&(this.autofill.remove(),this.autofill=null)},n.prototype.showAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="",this.bdrAFRight.style.display="",this.bdrAFBottom.style.display="",this.bdrAFTop.style.display="")},n.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")},n.prototype.updateValue=function(e,t,i){var n=this.createBeforeAutoFill(e,t,i);if(!n.cancel){var r=this.parent.getColumnByIndex(t);this.parent.editModule&&i&&("number"===r.type?this.parent.editModule.updateCell(e,r.field,parseFloat(n.value)):this.parent.editModule.updateCell(e,r.field,n.value))}},n.prototype.createBeforeAutoFill=function(e,t,i){var n={column:this.parent.getColumnByIndex(t),value:i.innerText};return this.parent.trigger("beforeAutoFill",n),n},n.prototype.getAutoFillCells=function(e,t){return[].slice.call(this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll(".e-cellselectionbackground"))},n.prototype.selectLikeAutoFill=function(e,t){var i=parseInt(F(this.startAFCell,Zi).getAttribute(an),10)-1,n=parseInt(this.startAFCell.getAttribute(on),10)-1,r=parseInt(F(this.endAFCell,Zi).getAttribute(an),10)-1,s=parseInt(this.endAFCell.getAttribute(on),10)-1,o=this.selectedRowCellIndexes.length-1,a=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!F(e.target,_i):this.startAFCell=this.parent.getCellFromIndex(i,n),this.endAFCell=this.parent.getCellFromIndex(i+o,n+a),this.drawAFBorders();break;case this.autoFillRLselection&&n+a<s&&s-n-a+1>r-i-o&&s-n-a+1>i-r:if(this.endAFCell=this.parent.getCellFromIndex(i+o,s),r=parseInt(F(this.endAFCell,Zi).getAttribute(an),10)-1,s=parseInt(this.endAFCell.getAttribute(on),10)-1,t){for(var l=parseInt(this.endCell.getAttribute(on),10)-1,d=i;d<=r;d++)for(var h=this.getAutoFillCells(d,n),p=0,c=l+1;c<=s;c++)p>a&&(p=0),this.updateValue(d,c,h[parseInt(p.toString(),10)]),p++;this.selectCellsByRange({rowIndex:i,cellIndex:this.startCellIndex},{rowIndex:r,cellIndex:s})}else this.drawAFBorders();break;case this.autoFillRLselection&&n>s&&n-s+1>r-i-o&&n-s+1>i-r:if(this.startAFCell=this.parent.getCellFromIndex(i,s),this.endAFCell=this.endCell,t){for(d=i;d<=i+o;d++){(h=this.getAutoFillCells(d,n)).reverse();for(var p=0,c=this.startCellIndex-1;c>=s;c--)p>a&&(p=0),this.updateValue(d,c,h[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:i,cellIndex:s},{rowIndex:i+o,cellIndex:this.startCellIndex+a})}else this.drawAFBorders();break;case i>r:if(this.startAFCell=this.parent.getCellFromIndex(r,n),this.endAFCell=this.endCell,t){for(var u=g=parseInt(this.endCell.parentElement.getAttribute(an),10)-1,d=i-1;d>=r;d--){u===this.startIndex-1&&(u=g);var h=this.getAutoFillCells(u,n),p=0;u--;for(c=this.startCellIndex;c<=this.startCellIndex+a;c++)this.updateValue(d,c,h[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:r,cellIndex:n+a},{rowIndex:i+o,cellIndex:n})}else this.drawAFBorders();break;default:if(this.endAFCell=this.parent.getCellFromIndex(r,n+a),t){for(var g=parseInt(this.endCell.parentElement.getAttribute(an),10)-1,u=this.startIndex,d=g+1;d<=r;d++){u===g+1&&(u=this.startIndex);h=this.getAutoFillCells(u,n);u++;for(var p=0,f=this.startCellIndex;f<=this.startCellIndex+a;f++)this.updateValue(d,f,h[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:g-o,cellIndex:n},{rowIndex:r,cellIndex:n+a})}else this.drawAFBorders()}},n.prototype.mouseUpHandler=function(e){this.stopTimer(),document.body.classList.remove("e-disableuserselect"),this.element&&!t.isNullOrUndefined(this.element.parentElement)&&t.remove(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=F(e.target,_i):this.mUPTarget=null;var i=t.closest(e.target,".e-rowcell");if(this.isDragged&&!this.isAutoFillSel&&"Cell"===this.selectionSettings.mode&&i&&i.classList.contains(_i)){var n=parseInt(i.parentElement.getAttribute(an),10)-1,r=parseInt(i.getAttribute(on),10)-1;this.isDragged=!1,this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:n,cellIndex:r})}if(this.isDragged=!1,this.updateAutoFillPosition(),this.isAutoFillSel){this.preventFocus=!0;var s=F(e.target,_i);this.endAFCell=s||(this.endCell===this.endAFCell?this.startAFCell:this.endAFCell),this.startAFCell=this.startCell,t.isNullOrUndefined(this.endAFCell)||t.isNullOrUndefined(this.startAFCell)||(this.updateStartCellsIndex(),this.selectLikeAutoFill(e,!0),this.updateAutoFillPosition(),this.hideAFBorders(),this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders()),this.parent.aggregates.length>0&&this.parent.notify("refresh-footer-rendered",{})),this.isAutoFillSel=!1,this.preventFocus=!1}t.EventHandler.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&t.EventHandler.remove(this.parent.getHeaderContent(),"mousemove",this.mouseMoveHandler),t.EventHandler.remove(document,"mouseup",this.mouseUpHandler)},n.prototype.hideAutoFill=function(){this.autofill&&(this.autofill.style.display="none")},n.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(on),10)-1,i=parseInt(this.target.getAttribute("data-index"),10),n=this.selectedRowCellIndexes[this.selectedRowCellIndexes.length-1].rowIndex,r=this.getAutoFillCells(n,e).filter(function(e){return""===e.style.display}),s=this.parent.getColumnByIndex(e),o=(s.getFreezeTableName(),i<(this.parent.frozenRows||this.parent.pinnedTopRecords.length)),a=this.parent.getFrozenMode()===nn&&s.getFreezeTableName()===rn;t.select("#"+this.parent.element.id+"_autofill",F(this.target,Ji))||(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",(this.target.classList.contains("e-leftfreeze")||this.target.classList.contains("e-rightfreeze")||this.target.classList.contains("e-fixedfreeze"))&&this.autofill.classList.add("e-freeze-autofill"),o?this.parent.getHeaderTable().parentElement.appendChild(this.autofill):this.parent.getContentTable().parentElement.appendChild(this.autofill),a&&(o?this.parent.getHeaderTable().parentElement.appendChild(this.autofill):this.parent.getContentTable().parentElement.appendChild(this.autofill)));var l=r[r.length-1];if(l&&l.offsetParent){var d=l.getBoundingClientRect(),h=l.offsetParent.getBoundingClientRect();(l.offsetParent.classList.contains("e-content")||l.offsetParent.classList.contains("e-headercontent"))&&(h=l.offsetParent.querySelector("table").getBoundingClientRect());var p=this.isLastCell(l)?4:0,c=this.isLastRow(l)?3:0;this.parent.enableRtl?this.autofill.style.right=h.right-d.right+d.width-4-p+"px":this.autofill.style.left=d.left-h.left+d.width-4-p+"px",this.autofill.style.top=d.top-h.top+d.height-5-c+"px"}this.autofill.style.display=""}else this.hideAutoFill()},n.prototype.mouseDownHandler=function(e){this.mouseButton=e.button;var i,n=e.target,r=this.parent,s=F(n,"e-grid");if(!(s&&s.id!==r.element.id||F(n,Xi)&&!this.parent.frozenRows||F(n,"e-editedbatchcell")||F(n,en))){if((e.shiftKey||e.ctrlKey)&&e.preventDefault(),F(n,_i)&&!e.shiftKey&&!e.ctrlKey){if(r.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel())this.isCellDrag=!0,i=!0;else if(r.allowRowDragAndDrop&&!r.isEdit&&!this.parent.selectionSettings.checkboxOnly){if(this.isRowDragSelected=!1,!this.isRowType()||this.isSingleSel()||t.closest(n,"td").classList.contains("e-selectionbackground"))return void(this.isDragged=!1);i=!0,this.element=this.parent.createElement("div",{className:"e-griddragarea"}),r.getContent().appendChild(this.element)}i&&this.enableDrag(e,!0)}this.updateStartEndCells(),(n.classList.contains("e-autofill")||n.classList.contains("e-xlsel"))&&(this.isCellDrag=!0,this.isAutoFillSel=!0,this.enableDrag(e))}},n.prototype.updateStartEndCells=function(){var e=[].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground"));this.startCell=e[0],this.endCell=e[e.length-1],this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(an),10)-1,this.startCellIndex=parseInt(F(this.startCell,_i).getAttribute(on),10)-1)},n.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(an),10)-1,this.startCellIndex=parseInt(F(this.startCell,_i).getAttribute(on),10)-1)},n.prototype.enableDrag=function(e,i){var n=this.parent;if(i){var r=t.closest(e.target,"tr");this.startDIndex=parseInt(r.getAttribute(an),10)-1,this.startDCellIndex=parseInt(F(e.target,_i).getAttribute(on),10)-1}document.body.classList.add("e-disableuserselect");var s=n.element.getBoundingClientRect(),o=B(e);this.x=o.x-s.left,this.y=o.y-s.top,t.EventHandler.add(n.getContent(),"mousemove",this.mouseMoveHandler,this),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&t.EventHandler.add(n.getHeaderContent(),"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)},n.prototype.clearSelAfterRefresh=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;if("virtualscroll"===e.requestType||this.parent.isPersistSelection||t||this.clearSelection(),("virtualscroll"===e.requestType||t)&&this.parent.isPersistSelection&&!this.isPartialSelection&&this.isHdrSelectAllClicked){var i=this.parent.getRowsObject().filter(function(e){return e.isSelectable}),n=[];this.selectedRowState={},this.persistSelectedData=[];for(var r=0;r<i.length;r++){n.push(i[parseInt(r.toString(),10)].index);var s=this.getPkValue(this.primaryKey,i[parseInt(r.toString(),10)].data);this.selectedRowState[""+s]=!0,this.persistSelectedData.push(i[parseInt(r.toString(),10)].data)}}},n.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:ei,handler:this.enableAfterRender},{event:Jt,handler:this.initializeSelection},{event:"rowselected",handler:this.onActionComplete},{event:"cellselected",handler:this.onActionComplete},{event:ii,handler:this.onPropertyChanged},{event:"cellfocused",handler:this.onCellFocused},{event:"beforeFragAppend",handler:this.clearSelAfterRefresh},{event:ui,handler:this.columnPositionChanged},{event:$t,handler:this.initialEnd},{event:fi,handler:this.rowsRemoved},{event:si,handler:this.refreshHeader},{event:"destroy-autofill-elements",handler:this.destroyAutoFillElements},{event:pi,handler:this.destroy}],at(this.parent,this.evtHandlers,!0,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(qt,this.actionBeginFunction),this.parent.addEventListener(Ut,this.actionCompleteFunction),this.addEventListener_checkbox())},n.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.EventHandler.remove(document,"mouseup",this.mouseUpHandler),t.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler),at(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(qt,this.actionBeginFunction),this.parent.removeEventListener(Ut,this.actionCompleteFunction),this.removeEventListener_checkbox(),this.parent.off("destroy-autofill-elements",this.destroyAutoFillElements))},n.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)):this.parent.allowKeyboard||t.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this)},n.prototype.unWireEvents=function(){this.isMacOS?(t.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.parent.element,"keyup",this.keyUpHandler)):this.parent.allowKeyboard||t.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler)},n.prototype.columnPositionChanged=function(){this.parent.isPersistSelection||this.clearSelection()},n.prototype.refreshHeader=function(){this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&!this.parent.getDataModule().isRemote()&&(this.gridCurrentRecord=this.getData()),this.setCheckAllState()},n.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++){var i=this.getPkValue(this.primaryKey,e.records[parseInt(t.toString(),10)]);delete this.selectedRowState[""+i],--this.totalRecordsCount}this.setCheckAllState()},n.prototype.beforeFragAppend=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||this.clearSelection()},n.prototype.getCheckAllBox=function(){return this.parent.getHeaderContent().querySelector(".e-checkselectall")},n.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.initPerisistSelection())},n.prototype.render=function(e){t.EventHandler.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler,this)},n.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){var i=this.parent;t.isNullOrUndefined(e.properties.type)||("Single"===this.selectionSettings.type?(i.element.removeAttribute("aria-multiselectable"),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()):"Multiple"===this.selectionSettings.type&&i.element.setAttribute("aria-multiselectable","true")),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.parent.isCheckBoxSelection||this.initPerisistSelection(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&(i.isCheckBoxSelection=!("ResetOnRowClick"===this.selectionSettings.checkboxMode)),this.drawBorders()}},n.prototype.hidePopUp=function(){this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},n.prototype.initialEnd=function(){this.selectedRowIndexes.length||(this.parent.off($t,this.initialEnd),this.selectRow(this.parent.selectedRowIndex))},n.prototype.checkBoxSelectionChanged=function(){var e=this.parent;e.off($t,this.checkBoxSelectionChanged);var i=(e.enableColumnVirtualization?e.columns: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())},n.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={})},n.prototype.ensureCheckboxFieldSelection=function(){var e=this.parent;this.primaryKey=this.parent.getPrimaryKeyFieldNames()[0],!e.enableVirtualization&&this.chkField&&(e.isPersistSelection&&0===Object.keys(this.selectedRowState).length||!e.isPersistSelection)&&this.dataSuccess(!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||this.parent.getDataModule().isRemote()?this.parent.getCurrentViewRecords():this.parent.renderModule.data.dataManager.dataSource.json)},n.prototype.dataSuccess=function(e){for(var i=0;i<e.length;i++){var n=this.getPkValue(this.primaryKey,e[parseInt(i.toString(),10)]),r=e[parseInt(i.toString(),10)][this.chkField];t.isNullOrUndefined(this.selectedRowState[""+n])&&r&&"boolean"==typeof r&&(this.selectedRowState[""+n]=r,this.parent.isPersistSelection&&this.persistSelectedData.push(e[parseInt(i.toString(),10)]))}},n.prototype.setRowSelection=function(e){if(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)if(e){var i=Object.keys(this.selectedRowState),n=Object.keys(this.unSelectedRowState);if(!this.isCheckboxReset)for(var r=0,s=this.parent.groupSettings.columns.length&&!this.parent.groupSettings.enableLazyLoading&&this.parent.isPersistSelection?this.parent.currentViewData.records:this.parent.currentViewData;r<s.length;r++){f=s[r];if(!t.isNullOrUndefined(f)&&!t.isNullOrUndefined(f[this.primaryKey])){var o=f[this.primaryKey].toString();-1===i.indexOf(o)&&-1===n.indexOf(o)&&(this.selectedRowState[f[this.primaryKey]]=!0)}}}else this.selectedRowState={},this.unSelectedRowState={},this.rmtHdrChkbxClicked=!1;else if(e)if(this.isPartialSelection&&!this.isHdrSelectAllClicked&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))for(var a=0,l=this.parent.getRowsObject().filter(function(e){return e.isSelectable});a<l.length;a++){var d=l[a];this.selectedRowState[this.getPkValue(this.primaryKey,d.data)]=!0}else{var h=this.isPartialSelection?this.parent.partialSelectedRecords:this.getData();if(this.parent.groupSettings.columns.length)for(var p=0,c=this.isPartialSelection?h:h.records;p<c.length;p++){f=c[p];this.selectedRowState[this.getPkValue(this.primaryKey,f)]=!0}else for(var u=0,g=h;u<g.length;u++){var f=g[u];this.selectedRowState[this.getPkValue(this.primaryKey,f)]=!0}}else this.selectedRowState={}},n.prototype.getData=function(){return Dt(this.parent)},n.prototype.getAvailableSelectedData=function(e){var t=new i.DataManager(e).executeLocal(this.parent.getDataModule().generateQuery(!0));return this.parent.groupSettings.columns.length&&t&&t.records&&(t=t.records.slice()),t},n.prototype.refreshPersistSelection=function(){var e=this.parent.pinnedTopRecords.length||this.isLazyLoadGroup()?this.parent.getAllDataRows(!0):this.parent.getRows();if(this.isLazyLoadGroup()&&(e=e.filter(function(e){return!e.classList.contains("e-groupcaptionrow")})),this.totalRecordsCount=this.parent.getCurrentViewRecords().length,this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),!t.isNullOrUndefined(e)&&e.length>0&&(this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)||this.parent.isPersistSelection||this.chkField)){for(var i=[],n=0;n<e.length;n++){var r=this.getRowObj(e[parseInt(n.toString(),10)]),s=r&&r.data?this.getPkValue(this.primaryKey,r.data):null;if(null===s)return;if(!this.isPartialSelection||r.isSelectable||this.selectedRowState.hasOwnProperty(s)){var o=void 0,a=e[parseInt(n.toString(),10)].querySelector(".e-checkselect");this.selectedRowState[""+s]||"Check"===this.parent.checkAllRows&&this.selectedRowState[""+s]&&this.totalRecordsCount===Object.keys(this.selectedRowState).length&&this.chkAllCollec.indexOf(s)<0||"Uncheck"===this.parent.checkAllRows&&this.chkAllCollec.indexOf(s)>0&&!this.parent.selectedRowIndex||"Intermediate"===this.parent.checkAllRows&&!t.isNullOrUndefined(this.chkField)&&r.data[this.chkField]?(i.push(parseInt(e[parseInt(n.toString(),10)].getAttribute(an),10)-1),o=!0):(o=!1,this.checkedTarget!==a&&this.parent.isCheckBoxSelection&&a&&le(a.nextElementSibling,o)),this.updatePersistCollection(e[parseInt(n.toString(),10)],o)}}this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableSelectedData(this.persistSelectedData).length,this.isSingleSel()&&i.length>0?this.selectRow(i[0],!0):this.selectRows(i)}else this.parent.isCheckBoxSelection&&this.isLazyLoadPersistSelection()&&(this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableSelectedData(this.persistSelectedData).length,this.selectedRecords=[],this.parent.allowPaging?this.selectedRowIndexes=[]:this.selectedRowIndexes=Object.keys(this.persistSelectedData).map(function(e){return parseInt(e,10)}));(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode)&&this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState()},n.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 n=t.closest(i,"."+en);if(n){"Dialog"===this.parent.editSettings.mode&&(n=this.parent.element.querySelector(".e-dlgeditrow"));var r=this.getRowObj(n);if(!r)return;this.selectedRowState[this.getPkValue(this.primaryKey,r.data)]=r.isSelected=i.checked}else this.isCheckedOnAdd=i.checked,this.isCheckedOnAdd&&"add"===e.action&&(this.selectedRowState[this.getPkValue(this.primaryKey,e.data)]=!0)}}this.parent.isPersistSelection&&this.isPartialSelection&&"paging"===e.requestType&&(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.selectedRowIndexes=[])},n.prototype.actionComplete=function(e){if("save"===e.requestType&&this.parent.isPersistSelection&&("add"===e.action&&(this.isHdrSelectAllClicked=!1),this.isPartialSelection&&(this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),(!t.isNullOrUndefined(this.getCheckAllBox())&&this.getCheckAllBox().nextElementSibling.classList.contains("e-check")||!t.isNullOrUndefined(e.row.querySelector(".e-checkselect"))&&e.row.querySelector(".e-checkselect").parentElement.classList.contains("e-checkbox-disabled"))&&(this.updatePersistCollection(e.row,!0),this.setCheckAllState()))),"delete"===e.requestType&&this.parent.isPersistSelection){for(var i=e.data.slice(),n=0;n<i.length;n++){var r=this.getPkValue(this.primaryKey,i[parseInt(n.toString(),10)]);t.isNullOrUndefined(r)||this.updatePersistDelete(r,this.isPartialSelection)}this.isHdrSelectAllClicked=!1,this.setCheckAllState(),this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount}if("paging"===e.requestType){if(this.parent.isPersistSelection&&this.isPartialSelection&&this.isHdrSelectAllClicked){for(var s=this.parent.getRowsObject(),o=[],n=0;n<s.length;n++)s[parseInt(n.toString(),10)].isSelectable&&o.push(s[parseInt(n.toString(),10)].index);o.length&&this.selectRows(o)}this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0}},n.prototype.onDataBound=function(){if(this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&!this.parent.getDataModule().isRemote()&&(this.gridCurrentRecord=this.getData()),this.parent.pinnedTopRecords.length&&this.setPinnedSelectionIndexes(),!this.parent.enableVirtualization&&this.parent.isPersistSelection&&this.selectedRecords.length&&(this.isPrevRowSelection=!0),((this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.rmtHdrChkbxClicked||this.isPartialSelection&&this.parent.isPersistSelection&&this.isHdrSelectAllClicked)&&("Intermediate"===this.parent.checkAllRows?this.setRowSelection(!0):"Uncheck"===this.parent.checkAllRows&&this.setRowSelection(!1)),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),this.parent.enableVirtualization&&this.setCheckAllState(),(this.parent.isPersistSelection||this.contentRenderer&&t.isNullOrUndefined(this.contentRenderer.requestType)&&this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&this.refreshPersistSelection(),this.initialRowSelection=!!(this.isRowType()&&this.parent.element.querySelectorAll(".e-selectionbackground")&&this.parent.getSelectedRows().length),this.parent.isCheckBoxSelection&&!this.initialRowSelection&&!this.isLazyLoadPersistSelection()){for(var e=this.parent.getRowsObject(),i=[],n=0;n<e.length;n++)e[parseInt(n.toString(),10)].isSelected&&i.push(n);i.length&&this.selectRows(i),this.initialRowSelection=!0}},n.prototype.updatePersistSelectedData=function(e){var i=this;if(this.parent.isPersistSelection||this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)){var n=[];if("Check"===this.parent.checkAllRows&&(this.parent.searchSettings.key.length>0||this.parent.filterSettings.columns.length>0)&&this.persistSelectedData.length&&!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection){var r=this.getAvailableSelectedData(this.persistSelectedData),s=new Set(r.map(function(e){return e[i.primaryKey]}));n=this.persistSelectedData.filter(function(e){return!s.has(e[i.primaryKey])})}var o=this.isLazyLoadPersistSelection()?this.parent.getDataRows():this.parent.getRows();this.isLazyLoadPersistSelection()&&(o=o.filter(function(e){return!e.classList.contains("e-groupcaptionrow")}));for(a=0;a<o.length;a++)this.updatePersistCollection(o[parseInt(a.toString(),10)],e);if("Uncheck"===this.parent.checkAllRows)this.setRowSelection(!1),this.persistSelectedData=this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result?this.persistSelectedData:[];else if("Check"===this.parent.checkAllRows&&(this.setRowSelection(!0),this.persistSelectedData=this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||this.isPartialSelection?this.isPartialSelection?this.parent.partialSelectedRecords.slice():this.persistSelectedData:this.parent.groupSettings.columns.length?this.getData().records.slice():this.getData().slice(),n.length>0))for(var a=0;a<n.length;a++)this.persistSelectedData.push(n[parseInt(a.toString(),10)]);this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData)}},n.prototype.checkSelectAllAction=function(e){var i=this.getRenderer(),n=this.parent.element.querySelector(".e-gridform");if(this.checkedTarget=this.getCheckAllBox(),this.isLazyLoadPersistSelection()&&!this.parent.isRemote()&&(this.isRowSelected=this.selectedRowIndexes.length&&!0),e&&this.getCurrentBatchRecordChanges().length?(this.parent.checkAllRows="Check",this.updatePersistSelectedData(e),this.selectRowsByRange(i.getVirtualRowIndex(0),i.getVirtualRowIndex(this.getCurrentBatchRecordChanges().length-1+this.parent.pinnedTopRowModels.length)),this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?(this.virtualSelectedData=this.virtualCheckBoxData().slice(),this.selectedRowIndexes=Object.keys(this.virtualSelectedData).map(function(e){return parseInt(e,10)})):!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.isLazyLoadPersistSelection()&&this.parent.partialSelectedRecords.length>0?this.parent.isPersistSelection?(this.persistSelectedData=this.parent.partialSelectedRecords.slice(),this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData)):(this.partialSelectedData=this.parent.partialSelectedRecords.slice(),this.partialSelectedRecordsCount=this.partialSelectedData.length&&this.getAvailableDataCount(this.partialSelectedData)):this.isLazyLoadPersistSelection()&&!this.parent.isRemote()?(this.persistSelectedData=this.isPartialSelection?this.parent.partialSelectedRecords.slice():this.getData().records.slice(),this.parent.allowPaging||(this.selectedRowIndexes=this.isPartialSelection?this.parent.partialSelectedIndexes.slice():Object.keys(this.persistSelectedData).map(function(e){return parseInt(e,10)}))):this.parent.isPersistSelection&&this.parent.isRemote()&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading&&(this.persistSelectedData=(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getAllPagesData(),this.persistSelectedRecordsCount=this.persistSelectedData.length)):(this.parent.checkAllRows="Uncheck",this.updatePersistSelectedData(e),this.clearSelection()),this.chkAllCollec=[],!t.isNullOrUndefined(n)){var r=n.querySelector(".e-edit-checkselect");t.isNullOrUndefined(r)||le(r.nextElementSibling,e)}},n.prototype.checkSelectAll=function(e){var i=this,n=this.getCheckAllStatus(e),r="Check"===n;if(this.isHeaderCheckboxClicked=!0,(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&("Uncheck"===n||this.isCheckboxReset||"Intermediate"===n&&(this.parent.isPersistSelection||this.parent.isRemote()))?this.rmtHdrChkbxClicked=!0:this.rmtHdrChkbxClicked=!1,this.rmtHdrChkbxClicked&&this.isCheckboxReset&&(this.unSelectedRowState={}),this.isCheckboxReset=!1,"Intermediate"===n&&(this.chkField||this.parent.isPersistSelection||(r=this.getCurrentBatchRecordChanges().some(function(e){return i.getPkValue(i.primaryKey,e)in i.selectedRowState})),this.parent.isPersistSelection||this.parent.isRemote()))if(this.parent.allowPaging&&this.isPartialSelection)for(var s=this.parent.getRowsObject(),o=0;o<s.length;o++){if(s[o].isDataRow&&s[o].isSelectable&&!s[o].isSelected){r=!1;break}r=!0}else if(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result){var a=this.parent.renderModule&&this.parent.renderModule.selectableDataKey,l=this.getCurrentBatchRecordChanges();this.isLazyLoadPersistSelection()&&(l=l.filter(function(e){return!e.key})).length&&(l=Object.keys(l).map(function(e){return l[parseInt(e,10)]}));for(o=0;o<l.length;o++){var d=this.getPkValue(this.primaryKey,l[parseInt(o.toString(),10)]);if(!this.isPartialSelection&&!t.isNullOrUndefined(d)||this.isPartialSelection&&a[""+d]){if(!Object.keys(this.selectedRowState).includes(d.toString())){r=!1;break}r=!0}}}this.parent.isPersistSelection&&this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),this.checkSelectAllAction(!r),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),this.target=null,this.getCurrentBatchRecordChanges().length>0&&(this.setCheckAllState(),this.updateSelectedRowIndexes()),this.triggerChkChangeEvent(e,!r)},n.prototype.getCheckAllStatus=function(e){var i;t.isNullOrUndefined(e)?t.isNullOrUndefined(this.getCheckAllBox())||(i=this.getCheckAllBox().nextElementSibling.classList):i=e.nextElementSibling.classList;var n="None";return i instanceof DOMTokenList&&(i.contains("e-check")?n="Check":i.contains("e-uncheck")?n="Uncheck":i.contains("e-stop")&&(n="Intermediate")),n},n.prototype.checkSelect=function(e){var i=t.closest(this.checkedTarget,"."+_i),n=this.parent;this.isMultiCtrlRequest=!0;var r=0;if(this.isHeaderCheckboxClicked=!1,ge(n)){var s=i.parentElement.getAttribute("data-uid");r=this.parent.enableVirtualization&&this.parent.groupSettings.columns.length?parseInt(i.parentElement.getAttribute(an),10)-1:n.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(s)}else r=parseInt(i.parentElement.getAttribute(an),10)-1;this.parent.isPersistSelection&&this.parent.element.getElementsByClassName(tn).length>0&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.editSettings.showAddNewRow&&++r,this.rowCellSelectionHandler(r,parseInt(i.getAttribute(on),10)-1),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),this.parent.isPersistSelection?this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData):this.partialSelectedRecordsCount=this.partialSelectedData.length&&this.getAvailableDataCount(this.partialSelectedData),this.moveIntoUncheckCollection(t.closest(i,"."+Zi)),this.setCheckAllState(),this.isMultiCtrlRequest=!1,this.triggerChkChangeEvent(e,e.nextElementSibling.classList.contains("e-check"))},n.prototype.moveIntoUncheckCollection=function(e){if("Check"===this.parent.checkAllRows||"Uncheck"===this.parent.checkAllRows){var t=this.getRowObj(e),i=t&&t.data?this.getPkValue(this.primaryKey,t.data):null;if(!i)return;this.chkAllCollec.indexOf(i)<0?this.chkAllCollec.push(i):this.chkAllCollec.splice(this.chkAllCollec.indexOf(i),1)}},n.prototype.triggerChkChangeEvent=function(e,t){this.parent.trigger("checkBoxChange",{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e}),this.parent.isEdit||(this.checkedTarget=null)},n.prototype.updateSelectedRowIndexes=function(){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.isPartialSelection&&!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.selectionSettings.persistSelection&&!this.isHdrSelectAllClicked&&"Uncheck"!==this.parent.checkAllRows)for(var e=0,i=n=this.parent.getRowsObject().filter(function(e){return e.isSelectable});e<i.length;e++){o=i[e];this.selectedRowIndexes.push(o.index)}if(this.parent.isCheckBoxSelection&&this.parent.enableVirtualization&&!this.isPartialSelection&&(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.parent.isPersistSelection&&"Check"===this.parent.checkAllRows){var n=this.parent.getRowsObject().filter(function(e){return e.isSelectable});if(n.length!==this.selectedRowIndexes.length)for(var r=0,s=n;r<s.length;r++){var o=s[r];this.selectedRowIndexes.indexOf(o.index)<=-1&&this.selectedRowIndexes.push(o.index)}}},n.prototype.updateSelectedRowIndex=function(e){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result))if("Check"===this.parent.checkAllRows&&t.isNullOrUndefined(e))if(this.selectedRowIndexes=[],this.isPartialSelection)this.selectedRowIndexes=this.parent.partialSelectedIndexes.slice();else{var i=this.parent.groupSettings.columns.length?this.getData().records.length:this.getData().length;this.parent.pinnedTopRowModels.length&&(i+=this.parent.pinnedTopRowModels.length);for(var n=0;n<i;n++)this.selectedRowIndexes.push(n)}else if("Uncheck"===this.parent.checkAllRows)this.selectedRowIndexes=[];else{var r=this.parent.getRowByIndex(e);if(e&&r&&"false"===r.getAttribute("aria-selected")){var s=this.selectedRowIndexes.indexOf(e);this.selectedRowIndexes.splice(s,1)}}},n.prototype.isAllSelected=function(e){if(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)return this.getAvailableSelectedData(this.persistSelectedData).length===(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.isLazyLoadGroup()?this.parent.totalDataRecordsCount:this.totalRecordsCount);if(this.isPartialSelection){if(this.parent.allowPaging&&!this.selectionSettings.persistSelection&&this.parent.pageSettings.pageSize<this.parent.pageSettings.totalRecordsCount){for(var i=this.parent.partialSelectedRecords,n=0;n<i.length;n++){r=this.getPkValue(this.primaryKey,i[parseInt(n.toString(),10)]);if(!this.selectedRowState[""+r])return!1}return!0}return this.isSelectAllRowCount(e)}i=this.getData();this.parent.groupSettings.columns.length&&i.records&&(i=i.records);for(n=0;n<i.length;n++){var r=this.getPkValue(this.primaryKey,i[parseInt(n.toString(),10)]);if(!this.selectedRowState[""+r])return!1}return!0},n.prototype.someDataSelected=function(){if((this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.parent.searchSettings.key.length||this.parent.filterSettings.columns.length))for(var e=this.getAvailableSelectedData(this.persistSelectedData),i=0;i<e.length;i++){r=this.getPkValue(this.primaryKey,e[parseInt(i.toString(),10)]);if(this.selectedRowState[""+r])return!1}for(var n=this.isPartialSelection?this.getAvailableSelectedData(this.parent.partialSelectedRecords):this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result?[]:this.isLazyLoadPersistSelection()?this.parent.getCurrentViewRecords():this.getData(),i=0;i<n.length;i++){var r=this.getPkValue(this.primaryKey,n[parseInt(i.toString(),10)]);if(this.selectedRowState[""+r])return!1}return!0},n.prototype.setCheckAllState=function(e,i){if(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode){var n=!1,r=!1,s=Object.keys(this.selectedRowState).length;this.parent.element.classList.contains("e-treelistgrid")&&this.parent.isPersistSelection&&!this.parent.enableVirtualization&&!this.parent.getDataModule().isRemote()&&Array.isArray(this.parent.dataSource)&&s===this.parent.dataSource.length&&s>this.totalRecordsCount&&(s=this.totalRecordsCount),this.parent.isPersistSelection||this.parent.isRemote()&&!this.parent.allowPaging||(s=this.selectedRowIndexes.length,this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),!this.parent.isPersistSelection||(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.isPartialSelection||!this.parent.searchSettings.key.length&&!this.parent.filterSettings.columns.length||(r=!0,n=this.isAllSelected(s));var o=this.getCheckAllBox();if(o){var a=o.nextElementSibling;t.removeClass([a],["e-check","e-stop","e-uncheck"]),oe(o,!1),o.indeterminate=!1;var l=this.parent.getDataModule().isRemote()?[]:this.gridCurrentRecord;if(this.parent.groupSettings.columns.length&&l.records&&(l=l.records),this.totalRecordsCount=this.checkVirtualCheckBox()||this.isLazyLoadPersistSelection()?l.length:this.totalRecordsCount,n&&r&&(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||l.length)||!r&&(s===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&(!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)||this.parent.allowPaging)||this.parent.isRemote()&&this.isLazyLoadPersistSelection()&&s===this.parent.totalDataRecordsCount||!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&this.isPartialSelection&&(this.isSelectAllRowCount(s)||this.isHdrSelectAllClicked&&!this.parent.isPersistSelection)||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.allowPaging&&(!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&l.length&&s===l.length||(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection&&(s===this.parent.totalDataRecordsCount||(this.isSelectAllRowCount(s)||s===this.totalRecordsCount)&&!this.parent.isPersistSelection&&!this.parent.isRemote())||this.isPartialSelection&&(s>0&&this.isHdrSelectAllClicked||this.isSelectAllRowCount(s)))||s===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&!this.parent.allowPaging&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling)?(t.addClass([a],["e-check"]),oe(o,!0),i&&this.getRenderer().setSelection(null,!0,!0),this.parent.checkAllRows="Check"):(!this.selectedRowIndexes.length&&(!this.parent.enableVirtualization||!this.persistSelectedData.length&&!r||r&&this.someDataSelected())||0===s&&0===this.getCurrentBatchRecordChanges().length)&&!this.parent.allowPaging||this.parent.allowPaging&&!this.isLazyLoadPersistSelection()&&(0===s||s&&r&&this.someDataSelected())||this.isLazyLoadPersistSelection()&&0===this.persistSelectedRecordsCount?(t.addClass([a],["e-uncheck"]),i&&this.getRenderer().setSelection(null,!1,!0),this.parent.checkAllRows="Uncheck"):(t.addClass([a],["e-stop"]),this.parent.checkAllRows="Intermediate",o.indeterminate=!0),this.parent.isEdit&&!(this.parent.editModule&&this.parent.editModule.editModule&&this.parent.editModule.editModule.initialRender)&&!this.parent.isPersistSelection||0===s&&0===this.getCurrentBatchRecordChanges().length||this.parent.isRemote()&&"Uncheck"===this.parent.checkAllRows&&this.isLazyLoadPersistSelection()&&0===(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getAllPagesData().length?t.addClass([a.parentElement],["e-checkbox-disabled"]):t.removeClass([a.parentElement],["e-checkbox-disabled"]),this.isPartialSelection){var d=this.parent.getRowsObject().filter(function(e){return e.isSelectable}).length;this.parent.isEdit&&!(this.parent.editModule&&this.parent.editModule.editModule&&this.parent.editModule.editModule.initialRender)&&!this.parent.isPersistSelection||0===d&&this.disableSelectableRecordsCount===this.totalRecordsCount&&a.parentElement.querySelector(".e-frame").classList.contains("e-uncheck")?t.addClass([a.parentElement],["e-checkbox-disabled"]):t.removeClass([a.parentElement],["e-checkbox-disabled"])}!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.allowPaging||this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||this.updateSelectedRowIndex(e)}}},n.prototype.checkVirtualCheckBox=function(){return this.parent.enableVirtualization&&!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&!this.isPartialSelection},n.prototype.isLazyLoadGroup=function(){return this.parent.groupSettings&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading},n.prototype.isLazyLoadPersistSelection=function(){return this.parent.isPersistSelection&&this.isLazyLoadGroup()},n.prototype.virtualCheckBoxData=function(){var e=this.getData();return this.parent.groupSettings.columns.length&&e.records&&(e=e.records),e},n.prototype.isSelectAllRowCount=function(e){var i=0,n=this.parent.getRowsObject();if(!this.isPartialSelection&&(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))return(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result?this.parent.totalDataRecordsCount:this.getData()&&this.getData().length)===n.length&&((i=n.filter(function(e){return e.isSelectable}).length)&&e===i);if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.isPartialSelection){r=this.parent.isPersistSelection||this.parent.isRemote()?this.persistSelectedRecordsCount:this.partialSelectedRecordsCount;return(i=this.disableSelectableRecordsCount+this.partialSelectableRecordsCount)===(this.parent.isRemote()?this.parent.totalDataRecordsCount:this.parent.allowGrouping&&"records"in this.getData()?this.getData().records.length:this.getData()&&this.getData().length)&&0!==r&&r===this.partialSelectableRecordsCount}if((this.parent.allowPaging||this.isPartialSelection)&&this.parent.selectionSettings.persistSelection){var r=this.persistSelectedRecordsCount;return(i=this.disableSelectableRecordsCount+this.partialSelectableRecordsCount)===this.totalRecordsCount&&0!==r&&r===this.partialSelectableRecordsCount}return(i=n.filter(function(e){return e.isSelectable}).length)&&e===i},n.prototype.keyDownHandler=function(e){("opera"===t.Browser.info.name&&17===e.keyCode||"mozilla"===t.Browser.info.name&&224===e.keyCode||("safari"===t.Browser.info.name||"chrome"===t.Browser.info.name)&&(91===e.keyCode||93===e.keyCode))&&(this.cmdKeyPressed=!0);var i=F(e.target,"e-headercell"),n=F(e.target,_i);(i?i.children[0].classList.contains("e-headerchkcelldiv"):!!n&&n.classList.contains("e-gridchkbox"))&&!this.parent.allowKeyboard&&32===e.keyCode&&e.preventDefault()},n.prototype.keyUpHandler=function(e){("opera"===t.Browser.info.name&&17===e.keyCode||"mozilla"===t.Browser.info.name&&224===e.keyCode||("safari"===t.Browser.info.name||"chrome"===t.Browser.info.name)&&(91===e.keyCode||93===e.keyCode))&&(this.cmdKeyPressed=!1)},n.prototype.clickHandler=function(e){var i=e.target;this.actualTarget=i,this.isAutoFillSel||e.ctrlKey||e.shiftKey||(this.startAFCell=this.endAFCell=null),this.selectionSettings.persistSelection&&(this.deSelectedData=this.persistSelectedData.slice()),(F(i,Zi)||F(i,"e-headerchkcelldiv")||this.selectionSettings.allowColumnSelection&&i.classList.contains("e-headercell"))&&(this.isInteracted=!0),this.cmdKeyPressed=e.metaKey,this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch||this.isMacOS&&this.cmdKeyPressed,this.parent.allowKeyboard?this.isMultiShiftRequest=e.shiftKey:(this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1),this.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.popUpClickHandler(e);var n=!1;this.preventFocus=!0;var r,s=F(i,"e-checkbox-wrapper");if(this.checkSelectAllClicked=!!(s&&s.getElementsByClassName("e-checkselectall")||this.selectionSettings.persistSelection&&F(i,Zi)),this.selectionSettings.persistSelection&&this.isPartialSelection&&F(i,"e-headerchkcelldiv")&&!i.querySelector(".e-checkbox-disabled")&&!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.isHdrSelectAllClicked=!0),s&&s.querySelectorAll(".e-checkselect,.e-checkselectall").length>0&&(r=s.querySelector('input[type="checkbox"]'),n=!0),this.drawBorders(),this.updateAutoFillPosition(),i=F(i,_i),this.parent.isReact&&i&&!i.parentElement&&i.classList.contains("e-rowcell")&&(i=this.parent.getCellFromIndex(parseInt(i.getAttribute("data-index"),10),parseInt(i.getAttribute("aria-colindex"),10)-1)),this.isRowDragSelected&&t.isNullOrUndefined(i)&&this.parent.allowRowDragAndDrop&&this.checkSelectAllClicked&&(this.isRowDragSelected=!1),(i&&i.parentElement.classList.contains(Zi)&&!this.parent.selectionSettings.checkboxOnly||n)&&!this.isRowDragSelected){if(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=i,t.isNullOrUndefined(r)){var o=0;o=parseInt(i.parentElement.getAttribute(an),10)-1,this.parent.isPersistSelection&&!this.parent.editSettings.showAddNewRow&&this.parent.element.getElementsByClassName(tn).length>0&&++o,this.mUPTarget&&this.mUPTarget.isEqualNode(i)||this.rowCellSelectionHandler(o,parseInt(i.getAttribute(on),10)-1),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection(t.closest(i,"."+Zi)),this.setCheckAllState())}else this.checkedTarget=r,r.classList.contains("e-checkselectall")?this.checkSelectAll(r):this.checkSelect(r);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("data-mappinguid");this.headerSelectionHandler(this.parent.getColumnIndexByUid(a))}this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.isMultiShiftRequest=!1,t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))&&(this.preventFocus=!1)},n.prototype.popUpClickHandler=function(e){var i=e.target;t.closest(i,".e-headercell")||e.target.classList.contains(_i)||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"},n.prototype.showPopup=function(e){this.selectionSettings.enableSimpleMultiRowSelection||O(this.parent.element.querySelector(".e-gridpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(!this.isSingleSel()&&(this.selectedRecords.length>1||this.selectedRowCellIndexes.length>1)?" e-spanclicked":""))},n.prototype.rowCellSelectionHandler=function(e,i){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){var n=t.closest(this.target,"."+_i).classList.contains($i);this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!n||this.parent.getColumns().some(function(e){return"checkbox"===e.type})&&"ResetOnRowClick"===this.selectionSettings.checkboxMode&&n?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]),"Both"===this.selectionSettings.mode){var r=this.parent.getColumns().find(function(e){return"checkbox"===e.type}),s=r&&r.index!==i;s&&!this.isMultiCtrlRequestCell?this.selectCell({rowIndex:e,cellIndex:i},this.selectionSettings.enableToggle):r&&!s||this.addCellsToSelection([{rowIndex:e,cellIndex:i}])}else this.addCellsToSelection([{rowIndex:e,cellIndex:i}]);this.showHideBorders("none")}this.isDragged=!1},n.prototype.onCellFocused=function(e){if((this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&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(an))-1;e.isJump=0===i}else"ctrlHome"===e.keyArgs.action&&(e.isJump=!0);var n=(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")),r=e.container.isHeader&&"TD"!==e.element.tagName&&!t.closest(e.element,"."+_i)&&!(e.byKey&&"space"===e.keyArgs.action);if(!e.byKey||n)return void(n&&!(this.parent.isCheckBoxSelection||this.selectionSettings.persistSelection&&(e.parent.classList.contains("e-recordplusexpand")||e.parent.classList.contains("e-recordpluscollapse")||e.parent.classList.contains("e-groupcaption")))&&this.clearSelection());var s=e.container.isContent?e.container.indexes:e.indexes,o=s[0],a=s[1],l=this.focus.getPrevIndexes();if((e.element.parentElement.querySelector(".e-rowcelldrag")||e.element.parentElement.querySelector(".e-dtdiagonalright")||e.element.parentElement.querySelector(".e-dtdiagonaldown"))&&(l.cellIndex=l.cellIndex-1),this.parent.frozenRows||this.parent.pinnedTopRecords.length)if(e.container.isHeader&&("TD"===e.element.tagName||t.closest(e.element,"."+_i))){var d=this.parent.getHeaderTable().querySelector("thead").childElementCount;this.parent.editSettings.showAddNewRow&&"Top"===this.parent.editSettings.newRowPosition&&"upArrow"===e.keyArgs.action&&d++,o-=d,l.rowIndex=t.isNullOrUndefined(l.rowIndex)?null:l.rowIndex-d}else o+=this.parent.frozenRows||this.parent.pinnedTopRecords.length,l.rowIndex=0!==l.rowIndex&&t.isNullOrUndefined(l.rowIndex)?null:l.rowIndex+(this.parent.frozenRows||this.parent.pinnedTopRecords.length);if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&(o=parseInt(e.element.parentElement.getAttribute("aria-rowindex"),10)-1),!(r||-1===["ctrlPlusA","escape"].indexOf(e.keyArgs.action)&&"space"!==e.keyArgs.action&&o===l.rowIndex&&a===l.cellIndex)||this.selectionSettings.allowColumnSelection){this.parent.enableVirtualization&&(o=parseInt(e.element.parentElement.getAttribute("aria-rowindex"),10)-1,!this.parent.enableColumnVirtualization&&!this.parent.groupSettings.columns.length&&this.parent.totalDataRecordsCount>=1&&("ctrlHome"===e.keyArgs.action?(o=0,this.parent.isFocusFirstCell=!0):"ctrlEnd"===e.keyArgs.action&&(o=this.parent.totalDataRecordsCount-1,this.isFocusLastCell=!0))),!this.parent.editSettings.showAddNewRow||"Top"!==this.parent.editSettings.newRowPosition||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||"downArrow"!==e.keyArgs.action||o--,this.preventFocus=!0;var h=this.getKeyColIndex(e);if(this.needColumnSelection&&(a=h),this.parent.element.classList.contains("e-gridcell-read")&&("tab"===e.keyArgs.action||"shiftTab"===e.keyArgs.action||"rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)){var p=this.target.getAttribute("aria-label");p=this.target.innerHTML+" column header "+this.parent.getColumnByIndex(a).field,this.target.setAttribute("aria-label",p)}switch(e.keyArgs.action){case"downArrow":case"upArrow":case"enter":case"shiftEnter":this.target=e.element,this.isKeyAction=!0,this.applyDownUpKey(o,a);break;case"rightArrow":case"leftArrow":this.applyRightLeftKey(o,a);break;case"shiftDown":case"shiftUp":this.shiftDownKey(o,a);break;case"shiftLeft":case"shiftRight":this.applyShiftLeftRightKey(o,a);break;case"home":case"end":a="end"===e.keyArgs.action?this.getLastColIndex(o):0,this.applyHomeEndKey(o,a);break;case"ctrlHome":case"ctrlEnd":this.applyCtrlHomeEndKey(o,a);break;case"escape":this.clearSelection(),this.parent.clipboardModule&&window.navigator.clipboard.writeText("");break;case"ctrlPlusA":this.ctrlPlusA();break;case"space":this.applySpaceSelection(e.element);break;case"tab":this.parent.editSettings.allowNextRowEdit&&this.selectRow(o)}this.needColumnSelection=!1,this.preventFocus=!1,this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders()),this.updateAutoFillPosition()}},n.prototype.getKeyColIndex=function(e){var i,n=null,r=e.element.querySelector(".e-stackedheadercelldiv");if(this.selectionSettings.allowColumnSelection&&F(e.element,"e-columnheader"))if(this.needColumnSelection=!!e.container.isHeader,r){if("rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)return n;i=r.getAttribute("data-mappinguid");var s=this.getstackedColumns(this.parent.getColumnByUid(i).columns),o=this.parent.getColumnIndexByUid(s[s.length-1].uid),a=this.parent.getColumnIndexByUid(s[0].uid);n=this.prevColIndex>=o?a:o}else t.isNullOrUndefined(e.element.querySelector(".e-headercelldiv"))||(n=this.parent.getColumnIndexByUid(e.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")));return n},n.prototype.ctrlPlusA=function(){if(this.isRowType()&&!this.isSingleSel()){var e=this.parent.getRowsObject();this.selectRowsByRange(e[0].index,e[e.length-1].index)}this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange({rowIndex:0,cellIndex:0},{rowIndex:this.parent.getRows().length-1,cellIndex:this.parent.getColumns().length-1})},n.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))},n.prototype.applyDownUpKey=function(e,t){var i=this.parent;!this.parent.isCheckBoxSelection||"Check"!==this.parent.checkAllRows||this.selectionSettings.persistSelection||this.selectionSettings.checkboxOnly||(this.checkSelectAllAction(!1),this.checkedTarget=null),!this.isRowType()||this.selectionSettings.checkboxOnly||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||(this.parent.frozenRows||this.parent.pinnedTopRecords.length,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)},n.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(on),10)-1,i=this.contentRenderer.getRowByIndex(e);if(i&&(this.target=i.getElementsByClassName(_i)[parseInt(t.toString(),10)]),this.addAttribute(this.target),this.parent.element.classList.contains("e-gridcell-read")){var n=this.target.getAttribute("aria-label");n=this.target.innerHTML,this.target.setAttribute("aria-label",n)}}},n.prototype.applyRightLeftKey=function(e,t){this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumn(t):this.isCellType()&&(this.selectCell({rowIndex:e,cellIndex:t},!0),this.addAttribute(this.target))},n.prototype.applyHomeEndKey=function(e,t){this.isCellType()?this.selectCell({rowIndex:e,cellIndex:t},!0):this.addAttribute(this.parent.getCellFromIndex(e,t))},n.prototype.shiftDownKey=function(e,i){this.isMultiShiftRequest=!0,this.isRowType()&&!this.isSingleSel()&&(t.isUndefined(this.prevRowIndex)?this.isPartialSelection?this.selectRow(e,!0):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},n.prototype.applyShiftLeftRightKey=function(e,t){this.isMultiShiftRequest=!0,this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumnsByRange(this.prevColIndex,t):this.selectCellsByRange(this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},n.prototype.getstackedColumns=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?this.getstackedColumns(e[parseInt(i.toString(),10)].columns):t.push(e[parseInt(i.toString(),10)]);return t},n.prototype.applyCtrlHomeEndKey=function(e,t){this.isRowType()&&(this.selectRow(e,!0),this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.addAttribute(this.parent.getCellFromIndex(e,t))),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0)},n.prototype.addRemoveClassesForRow=function(e,t,i){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];if(e){var s=[].slice.call(e.getElementsByClassName(_i)),o=e.querySelector(".e-detailrowcollapse")||e.querySelector(".e-detailrowexpand"),a=e.querySelector(".e-rowdragdrop");o&&s.push(o),a&&s.push(a),ee.apply(void 0,[s,t].concat(n))}this.getRenderer().setSelection(e?e.getAttribute("data-uid"):null,t,i)},n.prototype.isRowType=function(){return"Row"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},n.prototype.isCellType=function(){return"Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},n.prototype.isSingleSel=function(){return"Single"===this.selectionSettings.type},n.prototype.getRenderer=function(){return t.isNullOrUndefined(this.contentRenderer)&&(this.contentRenderer=this.factory.getRenderer(e.RenderType.Content)),this.contentRenderer},n.prototype.getSelectedRecords=function(){var e=[];return e=!this.selectionSettings.persistSelection&&this.selectedRecords.length?this.parent.getRowsObject().filter(function(e){return e.isSelected}).map(function(e){return e.data}):this.persistSelectedData,this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?e=this.virtualSelectedData:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection?e=this.partialSelectedData:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.isRemote()&&this.isPartialSelection&&!this.parent.isPersistSelection&&(e=this.persistSelectedData),e},n.prototype.selectColumn=function(e){var i=this.parent;if(!t.isNullOrUndefined(i.getColumns()[parseInt(e.toString(),10)])){var n=i.getColumnByIndex(e),r=i.getColumnHeaderByUid(n.uid),s=r.classList.contains("e-columnselection");if(i.selectionSettings.allowColumnSelection){var o=this.selectedColumnsIndexes.length>1&&this.selectedColumnsIndexes.indexOf(e)>-1;if(this.clearColDependency(),!this.selectionSettings.enableToggle||o||!s){var a={columnIndex:e,headerCell:r,column:n,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(a,"columnSelecting"),a.cancel)return void this.disableInteracted();!o&&s&&i.selectionSettings.enableToggle&&e===this.prevColIndex||this.updateColSelection(r,e);var l={columnIndex:e,headerCell:r,column:n,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(l,"columnSelected")}this.updateColProps(e)}}},n.prototype.selectColumnsByRange=function(e,i){var n=this.parent;if(!t.isNullOrUndefined(n.getColumns()[parseInt(e.toString(),10)])){var r=[];if("Single"===n.selectionSettings.type||t.isNullOrUndefined(i))r[0]=e;else for(var s=e<i,o=e;s?o<=i:o>=i;s?o++:o--)r.push(o);this.selectColumns(r)}},n.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 n={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(n,"columnSelecting"),n.cancel)return void this.disableInteracted();for(var r=0,s=e.length;r<s;r++)this.updateColSelection(t.getColumnHeaderByUid(t.getColumnByIndex(e[parseInt(r.toString(),10)]).uid),e[parseInt(r.toString(),10)]);i=this.getselectedCols();var o={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(o,"columnSelected"),this.updateColProps(e[0])}},n.prototype.selectColumnWithExisting=function(e){var i=this.parent;if(!t.isNullOrUndefined(i.getColumns()[parseInt(e.toString(),10)])){var n=i.getColumnHeaderByUid(i.getColumnByIndex(e).uid),r=this.getselectedCols();if("Single"===i.selectionSettings.type&&this.clearColDependency(),i.selectionSettings.allowColumnSelection){if(this.selectedColumnsIndexes.indexOf(e)>-1)this.clearColumnSelection(e);else{var s={columnIndex:e,headerCell:r,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(s,"columnSelecting"),s.cancel)return void this.disableInteracted();this.updateColSelection(n,e);var o={columnIndex:e,headerCell:r=this.getselectedCols(),column:i.getColumnByIndex(e),columnIndexes:this.selectedColumnsIndexes,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(o,"columnSelected")}this.updateColProps(e)}}},n.prototype.clearColumnSelection=function(e){if(this.isColumnSelected){var i=this.parent;if(!t.isNullOrUndefined(e)&&-1===this.selectedColumnsIndexes.indexOf(e))return;var n=t.isNullOrUndefined(e)?this.selectedColumnsIndexes[this.selectedColumnsIndexes.length-1]:e,r=i.getColumnByIndex(n),s=i.getColumnHeaderByUid(r.uid),o={columnIndex:n,headerCell:s,columnIndexes:this.selectedColumnsIndexes,column:r,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted};if(this.columnDeselect(o,"columnDeselecting"))return void this.disableInteracted();for(var a=t.isNullOrUndefined(e)?[].slice.call(i.getHeaderContent().getElementsByClassName("e-columnselection")):[s],l=this.getSelectedColumnCells(e),d=0,h=a.length;d<h;d++)ee([a[parseInt(d.toString(),10)]],!1,"e-columnselection");for(var d=0,h=l.length;d<h;d++)ee([l[parseInt(d.toString(),10)]],!1,"e-columnselection");t.isNullOrUndefined(e)?(this.columnDeselect(o,"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()[parseInt(e.toString(),10)].isSelected=!1)}},n.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[parseInt(i.toString(),10)]).uid))}else e=t.getColumnHeaderByUid(t.getColumnByIndex(this.selectedColumnsIndexes[0]).uid);return e},n.prototype.getSelectedColumnCells=function(e){for(var i=this.parent,n=!t.isNullOrUndefined(this.parent.rowTemplate)?i.getRows():i.getDataRows(),r=[],s=t.isNullOrUndefined(e)?".e-columnselection":'[aria-colindex="'+(e+1)+'"]',o=0,a=n.length;o<a;o++)r=r.concat([].slice.call(n[parseInt(o.toString(),10)].querySelectorAll(s)));return r},n.prototype.columnDeselect=function(e,t){return"columnDeselected"===t&&delete e.cancel,this.onActionComplete(e,t),e.cancel},n.prototype.updateColProps=function(e){this.prevColIndex=e,this.isColumnSelected=this.selectedColumnsIndexes.length&&!0},n.prototype.clearColDependency=function(){this.clearColumnSelection(),this.selectedColumnsIndexes=[]},n.prototype.updateColSelection=function(e,i){if(!t.isNullOrUndefined(this.parent.getColumns()[parseInt(i.toString(),10)])){var n=!t.isNullOrUndefined(this.parent.rowTemplate)?this.parent.getRows():this.parent.getDataRows();this.selectedColumnsIndexes.push(i),this.parent.getColumns()[parseInt(i.toString(),10)].isSelected=!0,i+=this.parent.getIndentCount(),ee([e],!0,"e-columnselection");for(var r=0,s=n.length;r<s;r++)if(n[parseInt(r.toString(),10)].classList.contains(Zi))if(!n[parseInt(r.toString(),10)].classList.contains(en)&&!n[parseInt(r.toString(),10)].classList.contains(tn)||"Normal"!==this.parent.editSettings.mode||t.isNullOrUndefined(n[parseInt(r.toString(),10)].querySelector("tr").childNodes[parseInt(i.toString(),10)]))if(this.parent.isSpan&&this.parent.isFrozenGrid())for(var o=n[parseInt(r.toString(),10)].querySelectorAll(".e-rowcell"),a=0;a<o.length;a++)o[parseInt(a.toString(),10)].getAttribute("aria-colindex")===e.getAttribute("aria-colindex")&&ee([o[parseInt(a.toString(),10)]],!0,"e-columnselection");else t.isNullOrUndefined(n[parseInt(r.toString(),10)].childNodes[parseInt(i.toString(),10)])||ee([n[parseInt(r.toString(),10)].childNodes[parseInt(i.toString(),10)]],!0,"e-columnselection");else ee([n[parseInt(r.toString(),10)].querySelector("tr").childNodes[parseInt(i.toString(),10)]],!0,"e-columnselection")}},n.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)},n.prototype.addEventListener_checkbox=function(){var e=this;this.parent.on(Zt,this.dataReady,this),this.onDataBoundFunction=this.onDataBound.bind(this),this.parent.addEventListener(jt,this.onDataBoundFunction),this.parent.on("refresh-infinite-persist-selection",this.onDataBoundFunction),this.parent.on($t,this.checkBoxSelectionChanged,this),this.parent.on("before-refresh-on-data-change",this.initPerisistSelection,this),this.parent.on(ti,this.setCheckAllForEmptyGrid,this),this.parent.on(hi,this.clickHandler,this),this.resizeEndFn=function(){e.updateAutoFillPosition(),e.drawBorders()},this.resizeEndFn.bind(this),this.parent.addEventListener("resizeStop",this.resizeEndFn)},n.prototype.removeEventListener_checkbox=function(){this.parent.off(Zt,this.dataReady),this.parent.removeEventListener(jt,this.onDataBoundFunction),this.parent.off("refresh-infinite-persist-selection",this.onDataBoundFunction),this.parent.off(ti,this.setCheckAllForEmptyGrid),this.parent.off(hi,this.clickHandler),this.parent.removeEventListener("resizeStop",this.resizeEndFn),this.parent.off("before-refresh-on-data-change",this.initPerisistSelection)},n.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"]),t.addClass([i.parentElement],["e-checkbox-disabled"]),e.classList.contains("e-checkbox")&&e.classList.remove("e-checkbox")}},n.prototype.dataReady=function(e){this.isHeaderCheckboxClicked=!1;var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||this.parent.isPersistSelection&&(!this.parent.isPersistSelection||"Single"!==this.selectionSettings.type)||t||(this.disableUI=!(this.parent.enableImmutableMode||"save"===e.requestType&&"add"===e.action),this.clearSelection(),this.setCheckAllState(),this.disableUI=!1)},n.prototype.actionCompleteHandler=function(e){"save"===e.requestType&&this.parent.isPersistSelection&&this.refreshPersistSelection()},n.prototype.selectRowIndex=function(e){this.parent.isSelectedRowIndexUpdating=!0,t.isNullOrUndefined(this.parent.selectedRowIndex)||-1===this.parent.selectedRowIndex||!this.parent.enablePersistence?this.parent.selectedRowIndex=e:this.parent.selectedRowIndex=-1},n.prototype.disableInteracted=function(){this.isInteracted=!1},n.prototype.activeTarget=function(){this.actualTarget=this.isInteracted?this.actualTarget:null},n.prototype.getAvailableDataCount=function(e){return this.parent.isTreeGrid&&!this.parent.isRemote()?e.length:this.getAvailableSelectedData(e).length},n}(),gr=function(){function e(e){this.headerFocus=!1,this.parent=e,this.addEventListener()}return e.prototype.hasNonNumericCharacters=function(e){for(var t=!1,i=0,n=e;i<n.length;i++){var r=n[i];if((r<"0"||r>"9")&&"."!==r)return!0;if("."===r){if(t)return!0;t=!0}}return!1},e.prototype.search=function(e){var i=this.parent;if(e=t.isNullOrUndefined(e)?"":e,J(i))return void i.notify(bi,{instance:this,handler:this.search,arg1:e});if(e!==i.searchSettings.key){if(this.headerFocus=!1,""===e||this.hasNonNumericCharacters(e))i.searchSettings.key=e.toString();else{var n=e.split(".");"."===e||-1===e.indexOf(".")||n[0].startsWith("0")&&n[0].length>1?i.searchSettings.key=e.toString():i.searchSettings.key=parseFloat(e).toString()}this.parent.renderModule.resetPartialRecords(),i.dataBind()}else this.refreshSearch?i.refresh():this.headerFocus=!1},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ii,this.onPropertyChanged,this),this.parent.on("searching-complete",this.onSearchComplete,this),this.parent.on(pi,this.destroy,this),this.actionCompleteFunc=this.onActionComplete.bind(this),this.parent.addEventListener(Ut,this.actionCompleteFunc),this.parent.on(Ti,this.cancelBeginEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ii,this.onPropertyChanged),this.parent.off("searching-complete",this.onSearchComplete),this.parent.off(pi,this.destroy),this.parent.removeEventListener(Ut,this.actionCompleteFunc),this.parent.off(Ti,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(ni,{requestType:"searching",type:qt}):this.parent.notify(ni,{requestType:"searching",type:qt,searchString:this.parent.searchSettings.key}))},e.prototype.onSearchComplete=function(e){this.parent.trigger(Ut,t.extend(e,{searchString:this.parent.searchSettings.key,requestType:"searching",type:Ut}))},e.prototype.onActionComplete=function(e){this.refreshSearch&&"refresh"===e.requestType&&this.headerFocus&&(this.headerFocus=!1,this.parent.focusModule.focus(),t.addClass([this.parent.focusModule.currentInfo.element],["e-focused"])),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}(),fr=function(){function e(e){this.colName=[],this.isShowHide=!1,this.parent=e,this.addEventListener(),this.widthService=new er(e)}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:"batchCancel",handler:this.batchChanges},{event:"cancelcnfrmDlg",handler:this.resetColumnState}],at(this.parent,this.evtHandlers,!0,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||at(this.parent,this.evtHandlers,!1)},e.prototype.batchChanges=function(){this.isShowHide&&(this.isShowHide=!1,this.setVisible(this.colName,this.changedCol),this.changedCol=this.colName=[])},e.prototype.show=function(e,t){var i=this.getToggleFields(e),n=this.getColumns(i,t);if(this.parent.notify("tooltip-destroy",{module:"edit"}),this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length){var r=n.filter(function(e){return!e.visible});r.forEach(function(e){return e.visible=!0}),r.length>0&&this.setVisible(r)}else{for(var s=0;s<n.length;s++)n[parseInt(s.toString(),10)].visible=!0;this.setVisible(n)}},e.prototype.hide=function(e,t){var i=this.getToggleFields(e),n=this.getColumns(i,t);if(this.parent.notify("tooltip-destroy",{module:"edit"}),this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length){var r=n.filter(function(e){return e.visible});r.forEach(function(e){return e.visible=!1}),r.length>0&&this.setVisible(r)}else{for(var s=0;s<n.length;s++)n[parseInt(s.toString(),10)].visible=!1;this.setVisible(n)}},e.prototype.getToggleFields=function(e){return"string"==typeof e?[e]:e},e.prototype.getColumns=function(e,t){var i=this;return b(e,function(e){return b(i.parent.columnModel,function(i){if(i[""+t]===e)return i})[0]})},e.prototype.batchActionPrevent=function(e,t){return void 0===t&&(t=[]),!J(this.parent)||(this.colName=e,this.changedCol=t,this.parent.closeEdit(),!1)},e.prototype.resetColumnState=function(){if(this.isShowHide)for(var e=0;e<this.colName.length;e++)this.colName[parseInt(e.toString(),10)].visible=!this.colName[parseInt(e.toString(),10)].visible},e.prototype.setVisible=function(e,i){var n=this;if(void 0===i&&(i=[]),this.isShowHide=!0,this.batchActionPrevent(e,i)){var r={requestType:"columnstate",cancel:!1,columns:i=i.length>0?i:e};if(this.parent.enableInfiniteScrolling&&this.parent.allowGrouping&&this.parent.groupModule.groupSettings.columns.length>0&&(this.parent.contentModule.visibleRows=[]),this.parent.trigger(qt,r,function(s){var o=n.parent.getColumns();if(e=t.isNullOrUndefined(e)?o:e,s.cancel)return n.parent.notify("reset-columns",{showHideArgs:s}),void(e.length>0&&(e[0].visible=!0));n.parent.notify("destroy-edit-form",r),ge(n.parent)&&n.parent.contentModule.emptyVcRows();var a=n.parent.element.querySelector(".e-addedrow");n.parent.editSettings.showAddNewRow&&a&&(t.remove(a),(n.parent.enableVirtualization||n.parent.enableInfiniteScrolling)&&(n.parent.isAddNewRow=!0),n.parent.addNewRowFocus=!0,n.parent.isEdit=!1),n.parent.allowSelection&&n.parent.getSelectedRecords().length&&!n.parent.selectionSettings.persistSelection&&n.parent.clearSelection(),n.parent.enableColumnVirtualization?n.parent.notify("refresh-Frozen-Position",{isModeChg:!0}):(n.parent.isFrozenGrid()||n.parent.enableColumnSpan)&&e.length?n.parent.notify("refresh-Frozen-Position",{isModeChg:!0}):n.parent.notify(ci,e);var l={requestType:"columnstate",columns:i};n.parent.trigger(Ut,l);var d=!n.parent.element.querySelector(".e-addedrow");n.parent.editSettings.showAddNewRow&&d&&(n.parent.isEdit=!1,n.parent.addRecord(),n.parent.enableVirtualization||n.parent.enableInfiniteScrolling||n.parent.notify(zi,{})),"All"!==n.parent.columnQueryMode&&n.parent.refresh()}),!this.parent.groupSettings.columns.length)if(this.parent.autoFit)this.parent.preventAdjustColumns();else if(this.parent.allowResizing&&"Normal"===this.parent.resizeSettings.mode){var s=-1===this.parent.getHeaderTable().style.width.indexOf("px");this.widthService.setWidthToTable(s)}}},e}(),mr=function(){function e(e){this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new er(e),this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(e){if(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){var i=this.parent.toolbarModule.toolbar.element,n=i.querySelector(".e-toolbar-left"),r=i.querySelector(".e-toolbar-center"),s=i.querySelector(".e-toolbar-right"),o=i.querySelector(".e-toolbar-items"),a=n?n.clientWidth:0,l=r?r.clientWidth:0,d=s?s.clientWidth:0,h=o?o.clientWidth:0,p=i?i.clientWidth:0;(!this.parent.enableAdaptiveUI||a>p||l>p||d>p||h>p)&&this.parent.toolbarModule.toolbar.refreshOverflow()}},e.prototype.setHeight=function(){var i=0,n=this.parent.getContent().querySelector("."+Yi),r=this.parent.height;if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()){"auto"!==this.parent.height&&this.parent.height.toString().indexOf("%")<0&&(r=parseInt(r,10)-e.getScrollBarWidth());var s=this.parent.getContent().querySelector(".e-movablescrollbar");this.parent.height.toString().indexOf("%")>0&&!t.isNullOrUndefined(s)&&(r="calc("+r+" - "+s.scrollHeight+"px)")}if(!this.parent.enableVirtualization&&this.parent.frozenRows&&"auto"!==this.parent.height&&"100%"!==this.parent.height){var o=this.parent.getHeaderContent().querySelector(ln+":not(.e-masked-tbody)");i=o?o.offsetHeight:0,o&&i?i-=o.getElementsByClassName(tn).length*this.parent.getRowHeight():!this.parent.isInitialLoad&&"Shimmer"===this.parent.loadingIndicator.indicatorType&&this.parent.getHeaderContent().querySelector(".e-masked-table")&&(r=parseInt(r,10)-this.parent.frozenRows*this.parent.getRowHeight()),n.style.height=t.formatUnit(parseInt(r,10)-i)}else n.style.height=t.formatUnit(r);this.ensureOverflow(n),this.parent.isFrozenGrid()&&this.refresh()},e.prototype.setPadding=function(){var t=this.parent.getHeaderContent(),i=e.getScrollBarWidth()-this.getThreshold(),n=this.getCssProperties();t.querySelector("."+Xi).style[n.border]=i>0?"1px":"0px",t.style[n.padding]=i>0?i+"px":"0px"},e.prototype.removePadding=function(e){var t=this.getCssProperties(e),i=this.parent.getHeaderContent().querySelector("."+Xi);i.style[t.border]="",i.parentElement.style[t.padding]="";var n=this.parent.getFooterContent();n&&n.classList.contains("e-footerpadding")&&n.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)"}},e.prototype.getThreshold=function(){return"mozilla"===t.Browser.info.name?.5:1-window.devicePixelRatio+1},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ti,this.wireEvents,this),this.parent.on($t,this.wireEvents,this),this.parent.on(ei,this.onPropertyChanged,this),this.parent.on("textWrapRefresh",this.wireEvents,this),this.parent.on(si,this.setScrollLeft,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ti,this.wireEvents),this.parent.off($t,this.wireEvents),this.parent.off(ei,this.onPropertyChanged),this.parent.off("textWrapRefresh",this.wireEvents),this.parent.off(si,this.setScrollLeft),this.unwireEvents())},e.prototype.unwireEvents=function(){this.parent.frozenRows&&this.header&&(t.EventHandler.remove(this.header,"touchstart pointerdown",this.setPageXY),t.EventHandler.remove(this.header,"touchmove pointermove",this.onTouchScroll));var e=this.parent.getContent()?this.parent.getContent().querySelector(".e-movablescrollbar"):null;this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&(e&&t.EventHandler.remove(e,"scroll",this.onCustomScrollbarScroll),this.content&&(t.EventHandler.remove(this.content,"scroll",this.onCustomScrollbarScroll),t.EventHandler.remove(this.content,"touchstart pointerdown",this.setPageXY),/macintosh|ipad/.test(t.Browser.userAgent.toLowerCase())&&t.Browser.isDevice||t.EventHandler.remove(this.content,"touchmove pointermove",this.onTouchScroll)),this.header&&(t.EventHandler.remove(this.header,"scroll",this.onCustomScrollbarScroll),t.EventHandler.remove(this.header,"touchstart pointerdown",this.setPageXY),t.EventHandler.remove(this.header,"touchmove pointermove",this.onTouchScroll))),this.content&&t.EventHandler.remove(this.content,"scroll",this.contentScrollHandler),this.header&&t.EventHandler.remove(this.header,"scroll",this.headerScrollHandler),this.contentScrollHandler=null,this.headerScrollHandler=null,this.parent.aggregates.length&&this.parent.getFooterContent()&&t.EventHandler.remove(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll)},e.prototype.setScrollLeft=function(){this.parent.getHeaderContent().querySelector("."+Xi).scrollLeft=this.previousValues.left},e.prototype.updateFrozenShadow=function(e){var i=this.parent.getContent().firstElementChild;if(!t.isNullOrUndefined(i)||!t.isNullOrUndefined(i)){var n=e||i,r=(this.parent.enableRtl?Math.abs(n.scrollLeft):n.scrollLeft)<=1;this.parent.getVisibleFrozenLeftCount()&&!r?t.addClass([this.parent.element],"e-left-shadow"):t.removeClass([this.parent.element],"e-left-shadow");var s=this.parent.enableRtl?Math.abs(n.scrollLeft):n.scrollLeft,o=Math.round(s+n.clientWidth)>=n.scrollWidth-1;this.parent.getVisibleFrozenRightCount()?o?t.removeClass([this.parent.element],"e-right-shadow"):t.addClass([this.parent.element],"e-right-shadow"):t.removeClass([this.parent.element],"e-right-shadow")}},e.prototype.onContentScroll=function(e){var i=this,n=e,r=n.classList.contains(Xi);return function(e){if(null!==i.content.querySelector(ln)&&!i.parent.isPreventScrollEvent){var s=e.target;if(i.parent.frozenRows&&(i.content.scrollTop>0&&i.parent.frozenRows?t.addClass([i.parent.element],"e-top-shadow"):t.removeClass([i.parent.element],"e-top-shadow")),i.parent.element.querySelectorAll(".e-leftfreeze,.e-fixedfreeze,.e-rightfreeze").length){var o=i.parent.getContent().querySelectorAll('.e-freezeerror:not([style*="display: none"])'),a=i.parent.getContent().querySelectorAll('.e-fixederror:not([style*="display: none"])');i.updateFrozenShadow(s);var l=[].slice.call(i.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)"));if((1===l.length&&o.length||i.parent.element.querySelector('.e-freeze-autofill:not([style*="display: none"])')||a.length)&&s.scrollLeft!==i.previousValues.left)return void(s.scrollLeft=i.previousValues.left);if(1!==l.length&&(o.length||a.length)&&s.scrollTop!==i.previousValues.top)return void(s.scrollTop=i.previousValues.top)}var d=s.scrollLeft;if(t.isNullOrUndefined(i.parent.infiniteScrollModule)||!i.parent.enableInfiniteScrolling||i.parent.isEdit&&(!i.parent.editSettings.showAddNewRow||i.parent.element.querySelector(".e-editedrow"))||i.parent.notify("infinite-scroll-handler",{target:e.target,isLeft:i.previousValues.left!==d}),i.parent.groupSettings.columns.length&&i.parent.groupSettings.enableLazyLoading){var h=i.previousValues.top<i.parent.getContent().firstElementChild.scrollTop;i.parent.notify("lazy-load-scroll-handler",{scrollDown:h})}i.parent.notify("virtual-scroll-edit",{});var p=s.classList.contains("e-summarycontent");if(i.previousValues.left===d)return void(i.previousValues.top=r?s.scrollTop:i.previousValues.top);i.parent.notify("close-filter-dialog",e),n.scrollLeft=d,p&&(i.header.scrollLeft=d),i.previousValues.left=d,i.parent.notify("scroll",{left:d})}}},e.prototype.onCustomScrollbarScroll=function(e,t){var i=this,n=e,r=t;return function(e){if(null!==i.content.querySelector(ln)){var t=e.target.scrollLeft;i.previousValues.left!==t&&(n.scrollLeft=t,r.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 n=t.parent.isFrozenGrid(),r=t.getPointXY(e),s=i.scrollLeft+(t.pageXY.x-r.x),o=t.parent.getHeaderContent().querySelector("."+Xi),a=t.parent.getContent().querySelector("."+Yi);t.previousValues.left===s||s<0||o.scrollWidth-o.clientWidth<s||(e.preventDefault(),o.scrollLeft=s,a.scrollLeft=s,n&&t.parent.enableColumnVirtualization&&(t.parent.getContent().querySelector(".e-movablescrollbar").scrollLeft=s),t.pageXY.x=r.x,t.previousValues.left=s)}}},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.getScrollbleParent=function(e){if(null===e)return null;var i=t.isNullOrUndefined(e.tagName)?e.scrollingElement:e,n=document.defaultView.getComputedStyle(i,null).overflowY;return i.scrollHeight>i.clientHeight&&"hidden"!==n&&"visible"!==n||"HTML"===e.tagName||"BODY"===e.tagName?e:this.getScrollbleParent(e.parentNode)},e.prototype.addStickyListener=function(e){this.parentElement=this.getScrollbleParent(this.parent.element.parentElement),e&&this.parentElement?(this.eventElement="HTML"===this.parentElement.tagName||"BODY"===this.parentElement.tagName?document:this.parentElement,this.stickyScrollHandler=this.makeStickyHeader(),t.EventHandler.add(this.eventElement,"scroll",this.stickyScrollHandler,this)):this.eventElement&&(t.EventHandler.remove(this.eventElement,"scroll",this.stickyScrollHandler),this.stickyScrollHandler=null,this.eventElement=null)},e.prototype.resizeFrozenRowBorder=function(){var t;this.parent.element.querySelector(".e-frozenrow-border")?t=this.parent.element.querySelector(".e-frozenrow-border"):(t=this.parent.createElement("div",{className:"e-frozenrow-border"}),this.parent.element.insertBefore(t,this.parent.element.querySelector(".e-gridcontent")));var i="auto"!==this.parent.height?e.getScrollBarWidth():0;t.style.width=this.parent.element.offsetWidth-i-.5+"px"},e.prototype.wireEvents=function(){var e=this;if(this.oneTimeReady){var i=this.parent.isFrozenGrid();this.content=this.parent.getContent().querySelector("."+Yi),this.header=this.parent.getHeaderContent().querySelector("."+Xi);var n=this.parent.getContent().querySelector(".e-movablescrollbar");(this.parent.frozenRows||this.parent.isRowPinned)&&this.header&&this.content&&(t.EventHandler.add(this.header,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this)),i&&n&&this.parent.enableColumnVirtualization&&(t.EventHandler.add(n,"scroll",this.onCustomScrollbarScroll(this.content,this.header),this),t.EventHandler.add(this.content,"scroll",this.onCustomScrollbarScroll(n,this.header),this),t.EventHandler.add(this.header,"scroll",this.onCustomScrollbarScroll(n,this.content),this),t.EventHandler.add(this.header,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this),t.EventHandler.add(this.content,"touchstart pointerdown",this.setPageXY(),this),/macintosh|ipad/.test(t.Browser.userAgent.toLowerCase())&&t.Browser.isDevice||t.EventHandler.add(this.content,"touchmove pointermove",this.onTouchScroll(this.header),this)),this.contentScrollHandler=this.onContentScroll(this.header),this.headerScrollHandler=this.onContentScroll(this.content),t.EventHandler.add(this.content,"scroll",this.contentScrollHandler,this),t.EventHandler.add(this.header,"scroll",this.headerScrollHandler,this),this.parent.aggregates.length&&t.EventHandler.add(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll(this.content),this),this.parent.enableStickyHeader&&this.addStickyListener(!0),this.refresh(),this.oneTimeReady=!1}var r,s,o,a=this.parent.getContentTable();m(function(){r=e.header.scrollLeft,s=a.scrollHeight,o=e.parent.getContent().clientHeight},function(){var t={cancel:!1};e.parent.notify("check-scroll-reset",t),s<o&&"auto"!==e.parent.height&&(e.setLastRowCell(),e.parent.notify("last-rowcell-border-updated",t)),(e.parent.frozenRows||e.parent.pinnedTopRowModels.length)&&e.resizeFrozenRowBorder(),e.parent.element.querySelector(".e-frozenrow-border")&&((e.parent.pinnedTopRowModels.length||e.parent.frozenRows)&&e.parent.currentViewData.length?e.parent.element.querySelector(".e-frozenrow-border").classList.remove("e-frozenrow-empty"):e.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty")),e.parent.enableVirtualization||e.parent.enableInfiniteScrolling||t.cancel||(e.header.scrollLeft=e.previousValues.left,e.content.scrollLeft=e.previousValues.left,e.content.scrollTop=e.previousValues.top),e.parent.enableColumnVirtualization||(e.content.scrollLeft=r,e.parent.isFrozenGrid()&&(e.previousValues.left=r))}),this.parent.isPreventScrollEvent=!1},e.prototype.setLastRowCell=function(){var e=this.parent.getContentTable();t.removeClass(e.querySelectorAll("td"),"e-lastrowcell"),e.querySelector("tr:nth-last-child(2)")&&this.parent.editSettings.showAddNewRow&&"Bottom"===this.parent.editSettings.newRowPosition&&t.addClass(e.querySelector("tr:nth-last-child(2)").querySelectorAll("td"),"e-lastrowcell"),t.addClass(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.parent.isSpan&&t.addClass(e.querySelectorAll(".e-row-span-lastrowcell"),"e-lastrowcell")},e.prototype.getCssProperties=function(e){var i={},n=t.isNullOrUndefined(e)?this.parent.enableRtl:e;return i.border=n?"borderLeftWidth":"borderRightWidth",i.padding=n?"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.makeStickyHeader=function(){var e=this;return function(){if(e.parent.enableStickyHeader&&e.parent.element&&e.parent.getContent()){var i=e.parent.getContent().getClientRects()[0];if(i){var n=window.devicePixelRatio,r=e.parent.getHeaderContent(),s=e.parent.element.querySelector(".e-toolbar"),o=e.parent.element.querySelector(".e-groupdroparea"),a=r.offsetHeight+(s?s.offsetHeight:0)+(o?o.offsetHeight:0),l=e.parentElement.getClientRects()[0].top,d=i.top-(l<0?0:l),h=i.left,p=document.body.querySelector("#"+e.parent.element.id+"_columnmenu");if(1!==n&&(d=Math.ceil(d)),d<a&&i.bottom>0){r.classList.add("e-sticky");var c=0;o&&e.parent.groupSettings.showDropArea&&(e.setSticky(o,c,i.width,h,!0),c+=o.getClientRects()[0].height),s&&(e.setSticky(s,c,i.width,h,!0),c+=s.getClientRects()[0].height),e.setSticky(r,c,i.width,h,!0),t.isNullOrUndefined(p)||(p.style.position="fixed",p.style.top=a+"px")}else if(r.classList.contains("e-sticky")){e.setSticky(r,null,null,null,!1),s&&e.setSticky(s,null,null,null,!1),o&&e.setSticky(o,null,null,null,!1);var u=e.parent.element.querySelector(".e-ccdlg");if(u&&u.classList.remove("e-sticky"),!t.isNullOrUndefined(p)){p.style.position="absolute";var g=i.top-l;p.style.top=g+"px"}}e.parent.notify("sticky-scroll-complete",{})}}}},e.prototype.setSticky=function(e,t,i,n,r){r?e.classList.add("e-sticky"):e.classList.remove("e-sticky"),e.style.width=null!=i?i+"px":"",e.style.top=null!=t?t+"px":"",e.style.left=null!==n?parseInt(e.style.left,10)!==n?n+"px":e.style.left:""},e.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+Ki)||e.querySelector("."+Wi))){this.removeEventListener();var i=this.parent.getContent().querySelector("."+Yi);t.EventHandler.remove(i,"scroll",this.onContentScroll),this.parent.enableStickyHeader&&this.addStickyListener(!1),this.removePadding(),t.removeClass([this.parent.getHeaderContent().querySelector("."+Xi)],Xi),t.removeClass([i],Yi),i.style.height="",this.parent.element.style.width=""}},e.getScrollBarWidth=function(){return j()},e}(),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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vr=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},Sr=function(i){function n(){var e=null!==i&&i.apply(this,arguments)||this;return e.templateFn={},e}return yr(n,i),n.prototype.setFormatter=function(e){this.formatFn=e},n.prototype.getFormatter=function(){return this.formatFn},n.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"})},n.prototype.getTemplate=function(i){return this.templateFn[t.getEnumValue(e.CellType,i)]},n.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},vr([t.Property()],n.prototype,"type",void 0),vr([t.Property()],n.prototype,"field",void 0),vr([t.Property()],n.prototype,"columnName",void 0),vr([t.Property()],n.prototype,"format",void 0),vr([t.Property()],n.prototype,"footerTemplate",void 0),vr([t.Property()],n.prototype,"groupFooterTemplate",void 0),vr([t.Property()],n.prototype,"groupCaptionTemplate",void 0),vr([t.Property()],n.prototype,"customAggregate",void 0),n}(t.ChildProperty),Cr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return yr(i,e),vr([t.Collection([],Sr)],i.prototype,"columns",void 0),i}(t.ChildProperty),wr=function(){function e(e,t){this.copyContent="",this.isSelect=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on($t,this.initialEnd,this),this.parent.on(di,this.keyDownHandler,this),this.parent.on(hi,this.clickHandler,this),this.parent.on(ti,this.initialEnd,this),t.EventHandler.add(this.parent.element,"keydown",this.pasteHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(di,this.keyDownHandler),this.parent.off($t,this.initialEnd),this.parent.off(hi,this.clickHandler),this.parent.off(ti,this.initialEnd),t.EventHandler.remove(this.parent.element,"keydown",this.pasteHandler))},e.prototype.clickHandler=function(e){var t=e.target;t=F(t,"e-rowcell")},e.prototype.pasteHandler=function(e){var i=this,n=this.parent,r=/(Mac)/i.test(navigator.platform),s=this.parent.getSelectedRowCellIndexes();if(!n.isEdit&&67===e.keyCode&&r&&e.metaKey&&this.copy(),s.length&&86===e.keyCode&&(!r&&e.ctrlKey||r&&e.metaKey)&&!n.isEdit){var o=t.closest(document.activeElement,"."+_i);if(!this.clipBoardTextArea||!o||!n.editSettings.allowEditing||"Batch"!==n.editSettings.mode||"Cell"!==n.selectionSettings.mode||"Flow"===n.selectionSettings.cellSelectionMode)return;this.activeElement=document.activeElement;var a=window.scrollX,l=window.scrollY;this.clipBoardTextArea.focus(),setTimeout(function(){i.activeElement.focus(),window.scrollTo(a,l),i.paste(i.clipBoardTextArea.value,s[0].rowIndex,s[0].cellIndexes[0])},r?100:10)}},e.prototype.paste=function(e,i,n){for(var r,s,o,a=this.parent,l=n,d=i,h=e.split("\n"),p=0;p<h.length;p++){if(o=h[parseInt(p.toString(),10)].split("\t"),l=n,p===h.length-1&&""===h[parseInt(p.toString(),10)]||t.isUndefined(a.getRowByIndex(d))){l++;break}for(var c=0;c<o.length;c++){if(!a.getCellFromIndex(d,l)){l++;break}if(r=a.getColumnByIndex(l),s=r.getParser()?r.getParser()(o[parseInt(c.toString(),10)]):o[parseInt(c.toString(),10)],r.allowEditing&&!r.isPrimaryKey){var u={column:r,data:s,rowIndex:d};this.parent.trigger("beforePaste",u),d=u.rowIndex,u.cancel||a.editModule&&("number"===r.type?this.parent.editModule.updateCell(d,r.field,parseFloat(u.data)):a.editModule.updateCell(d,r.field,u.data))}l++}d++}a.selectionModule.selectCellsByRange({rowIndex:i,cellIndex:n},{rowIndex:d-1,cellIndex:l-1});var g=this.parent.getCellFromIndex(d-1,l-1);g&&t.classList(g,["e-focus","e-focused"],[]),this.clipBoardTextArea.value=""},e.prototype.initialEnd=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.off($t,this.initialEnd),this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{id:this.parent.element.id+"_clipboard",tabindex:"-1","aria-label":this.l10n.getConstant("ClipBoard")}}),this.clipBoardTextArea.style.opacity="0",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()){this.clipBoardTextArea.value=this.copyContent="";var i=this.parent.getDataRows();if(this.parent.selectionSettings&&this.parent.selectionSettings.allowColumnSelection&&this.parent.selectionModule&&this.parent.selectionModule.selectedColumnsIndexes.length){if(e){for(var n=this.parent.selectionModule.selectedColumnsIndexes,r=[],s=0;s<n.length;s++){var o=n[parseInt(s.toString(),10)],a=this.parent.getColumnHeaderByIndex(o);a&&!a.classList.contains("e-hide")&&r.push(a)}this.getCopyData(r,!1,"\t",e),this.copyContent+="\n"}for(var l=0;l<i.length;l++){var d=[];l>0&&(this.copyContent+="\n"),d.push.apply(d,[].slice.call(i[parseInt(l.toString(),10)].querySelectorAll(".e-columnselection:not(.e-hide)"))),this.getCopyData(d,!1,"\t",e)}}else if("Cell"!==this.parent.selectionSettings.mode){var h=this.parent.getSelectedRowIndexes().sort(function(e,t){return e-t});if(e){for(var p=[],s=0;s<this.parent.getVisibleColumns().length;s++)p[parseInt(s.toString(),10)]=this.parent.getVisibleColumns()[parseInt(s.toString(),10)].headerText;this.getCopyData(p,!1,"\t",e),this.copyContent+="\n"}if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&h.length>i.length){h=[];for(s=0;s<i.length;s++){var c=i[parseInt(s.toString(),10)];"true"===c.getAttribute("aria-selected")&&h.push(parseInt(c.getAttribute("data-rowindex"),10))}}for(s=0;s<h.length;s++){s>0&&(this.copyContent+="\n");var u=[],g=h[parseInt(s.toString(),10)];!ge(this.parent)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache||this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading)&&(g=i.map(function(e){return e.getAttribute("data-rowindex")}).indexOf(h[parseInt(s.toString(),10)].toString()));var f=i[parseInt(g.toString(),10)];t.isNullOrUndefined(f)||(u.push.apply(u,[].slice.call(f.querySelectorAll(".e-rowcell:not(.e-hide)"))),this.getCopyData(u,!1,"\t",e))}}else if(this.parent.selectionModule&&this.parent.selectionModule.selectedRowCellIndexes.length){var m=this.checkBoxSelection();if(m.status){if(e){for(var y=[],s=0;s<m.colIndexes.length;s++){var v=this.parent.getColumnHeaderByIndex(m.colIndexes[parseInt(s.toString(),10)]);v.classList.contains("e-hide")||y.push(v)}this.getCopyData(y,!1,"\t",e),this.copyContent+="\n"}for(s=0;s<m.rowIndexes.length;s++){s>0&&(this.copyContent+="\n");var S=[].slice.call(i[m.rowIndexes[parseInt(s.toString(),10)]].querySelectorAll(".e-cellselectionbackground:not(.e-hide)"));this.getCopyData(S,!1,"\t",e)}}else this.getCopyData([].slice.call(this.parent.element.getElementsByClassName("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,t,i,n){for(var r="string"!=typeof e[0],s=0;s<e.length;s++){if(n&&t){var o=parseInt(e[parseInt(s.toString(),10)].getAttribute(on),10)-1;this.copyContent+=this.parent.getColumns()[parseInt(o.toString(),10)].headerText+"\n"}r?e[parseInt(s.toString(),10)].classList.contains("e-hide")||(this.copyContent+=e[parseInt(s.toString(),10)].innerText):this.copyContent+=e[parseInt(s.toString(),10)],s<e.length-1&&(this.copyContent+=i)}},e.prototype.copy=function(e){document.queryCommandSupported("copy")&&this.clipBoardTextArea&&(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),this.clipBoardTextArea=null)},e.prototype.checkBoxSelection=function(){var e=this.parent,t={status:!1};if("Cell"===e.selectionSettings.mode){var i=e.getSelectedRowCellIndexes(),n=void 0,r=[],s=void 0;for(s=0;s<i.length&&(i[parseInt(s.toString(),10)].cellIndexes.length&&r.push(i[parseInt(s.toString(),10)].rowIndex),!i[parseInt(s.toString(),10)].cellIndexes.length||(n||(n=JSON.stringify(i[parseInt(s.toString(),10)].cellIndexes.sort())),n===JSON.stringify(i[parseInt(s.toString(),10)].cellIndexes.sort())));s++);r.sort(function(e,t){return e-t}),s===i.length&&(t={status:!0,rowIndexes:r,colIndexes:i[0].cellIndexes})}return t},e}(),br="https://ej2.syncfusion.com/documentation/grid",Ir="https://ej2.syncfusion.com/documentation/",xr="[EJ2Grid.Warning]",Rr="[EJ2Grid.Error]",Dr="[EJ2Grid.Info]",Tr=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,n=0;n<i.length;n++){var r=Er[i[parseInt(n.toString(),10)]],s=r.check(t,this.parent);s.success&&console[r.logType](r.generateMessage(t,this.parent,s.options))}},e.prototype.patchadaptor=function(){var e=this.parent.getDataModule().dataManager.adaptor,t=e.beforeSend;t&&(e.beforeSend=function(i,n,r){t.call(e,i,n,r)})},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.off("initial-end",this.patchadaptor)},e}(),Er={module_missing:{type:"module_missing",logType:"warn",check:function(e,t){var i=t.getInjectedModules().map(function(e){return e.prototype.getModuleName()}),n=t.requiredModules().map(function(e){return e.member}).filter(function(e){return-1===i.indexOf(e)});return{success:n.filter(function(e){return"resize"!==e}).length>0,options:n}},generateMessage:function(e,t,i){return i=i.filter(function(e){return"resize"!==e}).reduce(function(e,t){return e+"* "+t+"\n"},""),xr+": MODULES MISSING\nThe following modules are not injected:.\n"+i+"Refer to "+br+"/module.html for documentation on importing feature modules."}},promise_enabled:{type:"promise_enabled",logType:"error",check:function(){return{success:"undefined"==typeof Promise}},generateMessage:function(){return Rr+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+Ir+"/base/browser.html?#required-polyfills for more information."}},primary_column_missing:{type:"primary_column_missing",logType:"warn",check:function(e,t){return{success:t.enableColumnVirtualization?0===t.getPrimaryKeyFieldNames().length:0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return xr+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+br+"/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(){return xr+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+br+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},actionfailure:{type:"actionfailure",logType:"error",check:function(){return{success:!0}},generateMessage:function(e,t){var i="",n=Or(e),r=kr(e);return i=""!==r?r:""!==n?n:e.error,xr+": "+i}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,n){var r=i.DataUtil.getObject("locale."+n.locale+".grid",t.L10n);return{success:"en-US"!==n.locale&&t.isNullOrUndefined(r)}},generateMessage:function(e,t){return xr+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+br+"/globalization-and-localization.html?#localization \n for documentation on setting locale configuration."}},limitation:{type:"limitation",logType:"warn",check:function(e,i){var n;switch(e){case"freeze":n={success:!t.isUndefined(i.detailTemplate)||!t.isUndefined(i.childGrid),options:{name:"freeze"}};break;case"virtualization":n={success:!t.isUndefined(i.detailTemplate)||!t.isUndefined(i.childGrid),options:{name:"virtualization"}};break;default:n={success:!1}}return n},generateMessage:function(e,t,i){var n,r=i.name;switch(r){case"freeze":n="Frozen rows and columns do not support the following features:\n* Details Template\n* Hierarchy Grid\n";break;case"virtualization":n="Virtualization does not support the following features.\n* Details Template.\n* Hierarchy Grid.\n";break;default:n=""}return xr+": "+r.toUpperCase()+" LIMITATIONS\n"+n}},check_datasource_columns:{type:"check_datasource_columns",logType:"warn",check:function(e,n){return{success:!(n.columns.length||n.dataSource instanceof i.DataManager||!t.isNullOrUndefined(n.dataSource)&&n.dataSource.length)}},generateMessage:function(){return xr+": 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 "+br+"/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(){return Rr+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+br+"/virtual.html for documentation on configuring the virtual grid."}},grid_remote_edit:{type:"grid_remote_edit",logType:"error",check:function(e){return{success:Array.isArray(e)||Array.isArray(e.result)}},generateMessage:function(){return Rr+": RETRUN VALUE MISSING \nRemote service returns invalid data. \nRefer to "+br+"/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(){return xr+": SORT COMPARER NOT WORKING \nSort comparer will not work with remote data.Refer to "+br+"/sorting/#custom-sort-comparer for documentation on using the sort comparer."}},resize_min_max:{type:"resize_min_max",logType:"info",check:function(e){return{success:e.column.minWidth&&e.column.minWidth>=e.width||e.column.maxWidth&&e.column.maxWidth<=e.width}},generateMessage:function(){return Dr+": 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){var i;switch(e.moduleName){case"reorder":i=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":i="grouping action is disabled for the "+e.columnName+" column.";break;case"filter":i="filtering action is disabled for the "+e.columnName+" column.";break;case"sort":i="sorting action is disabled for the "+e.columnName+" column."}return{success:!0,options:{fn:i}}},generateMessage:function(e,t,i){return Dr+": ACTION DISABLED \n "+i.fn}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return Dr+": EXPORTING INPROGRESS \n Grid "+i.args+"ing is in progress"}},exporting_complete:{type:"exporting_complete",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return Dr+": EXPORTING COMPLETED \n Grid "+i.args+"ing is complete"}},foreign_key_failure:{type:"foreign_key_failure",logType:"error",check:function(){return{success:!0}},generateMessage:function(){return Rr+": FOREIGNKEY CONFIG \n Grid foreign key column needs a valid data source/service.Refer to "+br+"/columns/#foreign-key-column for documentation on configuring foreign key columns."}},initial_action:{type:"initial_action",logType:"error",check:function(e){var t;switch(e.moduleName){case"group":t="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":t="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":t="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:t}}},generateMessage:function(e,t,i){return Rr+": 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.currentViewData.length&&t.frozenRows>=t.currentViewData.length}},generateMessage:function(e,t){return Rr+": 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){return{success:t.isNullOrUndefined(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,i){return Rr+": COLUMN TYPE MISSING-\n "+i+" column type was invalid or not defined.Please go through below help link: "+Ir+"/grid/columns/#column-type"}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e){return{success:e.dataState.dataSource&&!(e.dataState.dataSource instanceof i.DataManager||"result"in e.dataState.dataSource||e.dataState.dataSource instanceof Array)&&!t.isNullOrUndefined(e.dataState.dataStateChange)}},generateMessage:function(){return xr+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},Or=function(e){var t=e.error;return t.indexOf&&0!==t.indexOf("Format options")?"":"INVALID FORMAT\nFor more information, refer to the following documentation links:\nNumber format: "+Ir+"/common/internationalization#supported-format-string\nDate format: "+Ir+"/common/internationalization#manipulating-datetime\nMessage: "+t},kr=function(e){var n=i.DataUtil.getObject("error.error",e);if(t.isNullOrUndefined(n))return"";var r="";try{r=JSON.parse(n.responseText)}catch(e){r=""}return"XMLHTTPREQUEST FAILED\nUrl: "+n.responseURL+"\nStatus: "+n.status+" - "+n.statusText+"\n"+(""!==r?"Message: "+r:"")},Ar=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fr=function(){return(Fr=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},Mr=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},Lr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([t.Property()],i.prototype,"field",void 0),Mr([t.Property()],i.prototype,"direction",void 0),Mr([t.Property(!1)],i.prototype,"isFromGroup",void 0),i}(t.ChildProperty),Pr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([t.Collection([],Lr)],i.prototype,"columns",void 0),Mr([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),Nr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([t.Property()],i.prototype,"field",void 0),Mr([t.Property()],i.prototype,"operator",void 0),Mr([t.Property()],i.prototype,"value",void 0),Mr([t.Property()],i.prototype,"matchCase",void 0),Mr([t.Property(!1)],i.prototype,"ignoreAccent",void 0),Mr([t.Property()],i.prototype,"predicate",void 0),Mr([t.Property({})],i.prototype,"actualFilterValue",void 0),Mr([t.Property({})],i.prototype,"actualOperator",void 0),Mr([t.Property()],i.prototype,"type",void 0),Mr([t.Property()],i.prototype,"ejpredicate",void 0),Mr([t.Property()],i.prototype,"uid",void 0),Mr([t.Property()],i.prototype,"isForeignKey",void 0),Mr([t.Property()],i.prototype,"condition",void 0),i}(t.ChildProperty),Br=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([t.Property(!1)],i.prototype,"enableCache",void 0),Mr([t.Property(3)],i.prototype,"maxBlocks",void 0),Mr([t.Property(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),zr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([t.Collection([],Nr)],i.prototype,"columns",void 0),Mr([t.Property("FilterBar")],i.prototype,"type",void 0),Mr([t.Property("OnEnter")],i.prototype,"mode",void 0),Mr([t.Property(!0)],i.prototype,"showFilterBarStatus",void 0),Mr([t.Property(1500)],i.prototype,"immediateModeDelay",void 0),Mr([t.Property()],i.prototype,"operators",void 0),Mr([t.Property(!1)],i.prototype,"ignoreAccent",void 0),Mr([t.Property(!1)],i.prototype,"enableInfiniteScrolling",void 0),Mr([t.Property(50)],i.prototype,"itemsCount",void 0),Mr([t.Property("Shimmer")],i.prototype,"loadingIndicator",void 0),Mr([t.Property(!1)],i.prototype,"enableCaseSensitivity",void 0),Mr([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 Ar(i,e),Mr([t.Property("Row")],i.prototype,"mode",void 0),Mr([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),Mr([t.Property("Single")],i.prototype,"type",void 0),Mr([t.Property(!1)],i.prototype,"checkboxOnly",void 0),Mr([t.Property(!1)],i.prototype,"persistSelection",void 0),Mr([t.Property("Default")],i.prototype,"checkboxMode",void 0),Mr([t.Property(!1)],i.prototype,"enableSimpleMultiRowSelection",void 0),Mr([t.Property(!0)],i.prototype,"enableToggle",void 0),Mr([t.Property(!1)],i.prototype,"allowColumnSelection",void 0),i}(t.ChildProperty),Ur=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([t.Property([])],i.prototype,"fields",void 0),Mr([t.Property("")],i.prototype,"key",void 0),Mr([t.Property("contains")],i.prototype,"operator",void 0),Mr([t.Property(!0)],i.prototype,"ignoreCase",void 0),Mr([t.Property(!1)],i.prototype,"ignoreAccent",void 0),i}(t.ChildProperty),Hr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([t.Property()],i.prototype,"targetID",void 0),i}(t.ChildProperty),jr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([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 Ar(i,e),Mr([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 Ar(i,e),Mr([t.Property(!0)],i.prototype,"showDropArea",void 0),Mr([t.Property(!1)],i.prototype,"allowReordering",void 0),Mr([t.Property(!1)],i.prototype,"showToggleButton",void 0),Mr([t.Property(!1)],i.prototype,"showGroupedColumn",void 0),Mr([t.Property(!0)],i.prototype,"showUngroupButton",void 0),Mr([t.Property(!1)],i.prototype,"disablePageWiseAggregates",void 0),Mr([t.Property([])],i.prototype,"columns",void 0),Mr([t.Property()],i.prototype,"captionTemplate",void 0),Mr([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 Ar(i,e),Mr([t.Property(!1)],i.prototype,"allowAdding",void 0),Mr([t.Property(!1)],i.prototype,"allowEditing",void 0),Mr([t.Property(!1)],i.prototype,"allowDeleting",void 0),Mr([t.Property("Normal")],i.prototype,"mode",void 0),Mr([t.Property(!0)],i.prototype,"allowEditOnDblClick",void 0),Mr([t.Property(!0)],i.prototype,"showConfirmDialog",void 0),Mr([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),Mr([t.Property()],i.prototype,"template",void 0),Mr([t.Property()],i.prototype,"headerTemplate",void 0),Mr([t.Property()],i.prototype,"footerTemplate",void 0),Mr([t.Property("Top")],i.prototype,"newRowPosition",void 0),Mr([t.Property({})],i.prototype,"dialog",void 0),Mr([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),Mr([t.Property(!1)],i.prototype,"showAddNewRow",void 0),i}(t.ChildProperty),Kr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ar(i,e),Mr([t.Property("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),Wr=function(r){function s(e,i){var n=r.call(this,e,i)||this;return n.isPreventScrollEvent=!1,n.inViewIndexes=[],n.keyA=!1,n.frozenRightCount=0,n.freezeColumnRefresh=!0,n.rightcount=0,n.frozenLeftCount=0,n.leftcount=0,n.tablesCount=1,n.movableCount=0,n.movablecount=0,n.fixedcount=0,n.fixedCount=0,n.visibleFrozenLeft=0,n.visibleFrozenFixed=0,n.isPreparedFrozenColumns=!1,n.visibleFrozenRight=0,n.visibleMovable=0,n.frozenLeftColumns=[],n.frozenRightColumns=[],n.movableColumns=[],n.fixedColumns=[],n.stackedLeft=[],n.stackedRight=[],n.stackedFixed=[],n.stackedMovable=[],n.stackedarrayLeft=[],n.stackedarrayRight=[],n.stackedarrayFixed=[],n.stackedarrayMovable=[],n.media={},n.autoFitColumnsResize=!1,n.tableIndex=0,n.componentRefresh=t.Component.prototype.refresh,n.isChangeDataSourceCall=!1,n.mergedColumns=!1,n.isVirtualAdaptive=!1,n.requireTemplateRef=!0,n.vRows=[],n.vcRows=[],n.vGroupOffsets={},n.rowUid=0,n.translateX=0,n.isManualRefresh=!1,n.isAutoFitColumns=!1,n.enableDeepCompare=!1,n.totalDataRecordsCount=0,n.disableSelectedRecords=[],n.partialSelectedRecords=[],n.partialSelectedIndexes=[],n.pinnedTopRowModels=[],n.pinnedTopRecords=[],n.pinnedTopRowKeys={},n.pinnedRowIndexes={},n.contentRowIndexes={},n.isSpan=!1,n.islazyloadRequest=!1,n.isAddNewRow=!1,n.addNewRowFocus=!0,n.selectVirtualRowOnAdd=!1,n.lockcolPositionCount=0,n.prevPageMoving=!1,n.pageTemplateChange=!1,n.isAutoGen=!1,n.isAutoGenerateColumns=!1,n.pageRequireRefresh=!0,n.mediaBindInstance={},n.commandDelIndex=void 0,n.preventAutoFit=!1,n.enableSeamlessScrolling=!1,n.asyncTimeOut=50,n.isExportGrid=!1,n.isWidgetsDestroyed=!1,n.enableLogger=!1,n.needsID=!0,o.Inject(ur),t.setValue("mergePersistData",n.mergePersistGridData,n),n}Ar(s,r),o=s,s.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:[]},n=0;n<e.length;n++)for(var r=this[e[parseInt(n.toString(),10)]],s=0,o=i[e[parseInt(n.toString(),10)]];s<o.length;s++)delete r[""+o[s]];var a=this.pageSettings.template,l=Object.assign({template:void 0},this.pageSettings);this.enableVirtualization&&this.enablePersistence&&this.contentModule&&this.contentModule.getPageFromTop&&!t.isNullOrUndefined(this.scrollPosition)&&!t.isNullOrUndefined(this.scrollPosition.top)&&(l.properties.currentPage=this.contentModule.getPageFromTop(this.scrollPosition.top,{block:1})),this.setProperties({pageSettings:l},!0);var d=this.groupSettings.captionTemplate,h=d&&this.isAngular;h&&delete this.groupSettings.properties.captionTemplate,this.pageTemplateChange=!t.isNullOrUndefined(this.pagerTemplate);var p=this.addOnPersist(e);return l.template=a,this.setProperties({pageSettings:l},!0),h&&(this.groupSettings.captionTemplate=d),p},s.prototype.requiredModules=function(){this.setFrozenCount(),this.enableInfiniteAggrgate();var e=[];return this.isDestroyed?e:(this.allowFiltering&&e.push({member:"filter",args:[this,this.filterSettings,this.serviceLocator],name:"Filter"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this,this.serviceLocator],name:"ExcelExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.allowSorting&&e.push({member:"sort",args:[this,this.sortSettings,this.sortedColumns,this.serviceLocator],name:"Sort"}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowSelection&&e.push({member:"selection",args:[this,this.selectionSettings,this.serviceLocator],name:"Selection"}),this.resizeCheck()&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowReordering&&e.push({member:"reorder",args:[this],name:"Reorder"}),this.allowRowDragAndDrop&&e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"}),this.allowGrouping&&e.push({member:"group",args:[this,this.groupSettings,this.sortedColumns,this.serviceLocator],name:"Group"}),this.aggregates.length&&e.push({member:"aggregate",args:[this,this.serviceLocator],name:"Aggregate"}),this.isDetail()&&e.push({member:"detailRow",args:[this,this.serviceLocator],name:"DetailRow"}),(this.toolbar||this.toolbarTemplate)&&e.push({member:"toolbar",args:[this,this.serviceLocator],name:"Toolbar"}),(this.enableVirtualization||this.enableColumnVirtualization)&&e.push({member:"virtualscroll",args:[this,this.serviceLocator],name:"VirtualScroll"}),(this.getFrozenColumns()||this.frozenRows||this.frozenRightCount||this.frozenLeftCount)&&e.push({member:"freeze",args:[this,this.serviceLocator],name:"Freeze"}),!t.isNullOrUndefined(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this,this.serviceLocator],name:"CommandColumn"}),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this,this.serviceLocator],name:"Edit"}),this.extendRequiredModules(e),e)},s.prototype.extendRequiredModules=function(e){this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this,this.serviceLocator],name:"InfiniteScroll"}),this.groupSettings.enableLazyLoading&&e.push({member:"lazyLoadGroup",args:[this,this.serviceLocator],name:"LazyLoadGroup"}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this,this.serviceLocator],name:"ContextMenu"}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this,this.serviceLocator],name:"ColumnMenu"}),this.showColumnChooser&&e.push({member:"columnChooser",args:[this,this.serviceLocator],name:"ColumnChooser"}),!t.isNullOrUndefined(this.columns)&&this.isForeignKeyEnabled(this.columns)&&e.push({member:"foreignKey",args:[this,this.serviceLocator],name:"ForeignKey"}),this.enableLogger&&e.push({member:"logger",args:[this],name:"Logger"})},s.prototype.resizeCheck=function(){var e=!!this.getColumns().filter(function(e){return!0===e.autoFit}).length;t.isNullOrUndefined(this.columnModel)||!this.columnModel.length||this.columnModel[0]instanceof Pt||(this.columnModel=[]);var i=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),n=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||this.autoFitColumnsResize||e||i||n},s.prototype.preRender=function(){this.serviceLocator=new Zn,this.initProperties(),this.initializeServices()},s.prototype.initProperties=function(){this.isInitial=!0,this.sortedColumns=[],this.inViewIndexes=[],this.mediaCol=[],this.isInitialLoad=!1,this.allowServerDataBinding=!1,this.ignoreCollectionWatch=!0,this.mergeCells={},this.isEdit=!1,this.checkAllRows="None",this.isCheckBoxSelection=!1,this.isPersistSelection=!1,this.componentRefresh=t.Component.prototype.refresh,this.freezeColumnRefresh=!0,this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith",wildCard:"wildcard",isNull:"isnull",notNull:"notnull",like:"like"},this.defaultChartLocale={Chart:"Chart",BarChart:"Bar Chart",Bar:"Bar",StackingBar:"Stacked Bar",StackingBar100:"100% Stacked Bar",Pie:"Pie Chart",ColumnChart:"Column Chart",Column:"Column",StackingColumn:"Stacked Column",StackingColumn100:"100% Stacked Column",LineChart:"Line Chart",Line:"Line",StackingLine:"Stacked Line",StackingLine100:"100% Stacked Line",AreaChart:"Area Chart",Area:"Area",StackingArea:"Stacked Area",StackingArea100:"100% Stacked Area",Scatter:"Scatter Chart"},this.defaultLocale=Fr({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",ColumnMenu:"Column Menu",SearchColumns:"search columns",Matchs:"No matches found",FilterButton:"Filter",FilterTitle:"Filter",FilterIcon:"Filter",ClearButton:"Clear",StartsWith:"Starts With",NotStartsWith:"Does Not Start With",Like:"Like",EndsWith:"Ends With",NotEndsWith:"Does Not End With",Contains:"Contains",NotContains:"Does Not Contain",IsNull:"Null",NotNull:"Not Null",IsEmpty:"Empty",IsNotEmpty:"Not Empty",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",In:"In",NotIn:"Not In",ChooseDate:"Choose a Date",EnterValue:"Enter the value",Copy:"Copy",Group:"Group by this column",Ungroup:"Ungroup by this column",GroupButton:"Group button",UnGroupAria:"ungroup button",GroupSeperator:"Separator for the grouped columns",UnGroupIcon:"ungroup the grouped column ",GroupedSortIcon:"sort the grouped column ",GroupedDrag:"Drag the grouped column",GroupCaption:" is groupcaption cell",CheckBoxLabel:"checkbox",SelectAllCheckbox:"Select all checkbox",SelectRow:"Select row",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",AddCurrentSelection:"Add current selection to filter",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:",ToolbarMenuDialogARIA:"Toolbar menu dialog",FilterMenuDialogARIA:"Filter menu",ExcelFilterDialogARIA:"Excel filter",CheckBoxFilterDialogARIA:"Checkbox filter",DialogEditARIA:"Edit 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",SortIcon:"Sort",FilterDescription:"Press Alt Down to open filter Menu",SortDescription:"Press Enter to sort",ColumnMenuDescription:"Press Alt Down to open Column Menu",GroupDescription:"Press Ctrl space to group",ColumnHeader:" column header ",TemplateCell:" is template cell",CommandColumnAria:"is Command column column header ",DialogEdit:"Dialog edit",ClipBoard:"clipboard",AscendingText:"Ascending",DescendingText:"Descending",NoneText:"None",Expanded:"Expanded",Collapsed:"Collapsed",PinRow:"Pin Row",UnpinRow:"Unpin Row"},this.defaultChartLocale),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"}},s.prototype.render=function(){if(this.log(["module_missing","promise_enabled","locale_missing","check_datasource_columns"]),this.ariaService.setOptions(this.element,{role:"grid"}),n.createSpinner({target:this.element,cssClass:this.cssClass?this.cssClass:null},this.createElement),this.renderModule=new Xn(this,this.serviceLocator),this.searchModule=new gr(this),this.scrollModule=new mr(this),this.notify(Yt,{}),this.pageSettings.enableQueryString){var e=new URL(window.location.href).searchParams.get("page");if(!t.isNullOrUndefined(e)&&window.location.href.indexOf("?page=")>0){var i=parseInt(e,10);this.setProperties({pageSettings:{currentPage:i}},!0),this.pageSettings.currentPage=i}}if(!0!==this.getDataModule().dataManager.dataSource.offline&&void 0!==this.getDataModule().dataManager.dataSource.url||!t.isNullOrUndefined(this.dataSource)&&this.dataSource.result||(this.isVirtualAdaptive=!0),this.aggregateModule&&this.aggregates.length)for(var r=0;r<this.aggregates.length;r++)for(var s=0;s<this.aggregates[parseInt(r.toString(),10)].columns.length;s++){var o=this.aggregates[parseInt(r.toString(),10)].columns[parseInt(s.toString(),10)];o.types&&(o.type=o.types)}if(this.isReact){a={requireTemplateRef:this.requireTemplateRef};this.enableVirtualization||this.enableColumnVirtualization?(a.enableSeamlessScrolling=this.enableSeamlessScrolling,this.trigger("load",a),this.enableSeamlessScrolling=a.enableSeamlessScrolling,Et(this.enableSeamlessScrolling)):this.trigger("load",a),a.requireTemplateRef||(this.requireTemplateRef=a.requireTemplateRef)}else if(this.enableVirtualization||this.enableColumnVirtualization){var a={enableSeamlessScrolling:this.enableSeamlessScrolling};this.trigger("load",a),this.enableSeamlessScrolling=a.enableSeamlessScrolling,Et(this.enableSeamlessScrolling)}else this.trigger("load");"string"==typeof this.isRowSelectable&&(this.isRowSelectable=t.getValue(this.isRowSelectable,window)),"string"==typeof this.isRowPinned&&(this.isRowPinned=t.getValue(this.isRowPinned,window)),this.isRowPinned&&this.allowSelection&&(this.selectionSettings.persistSelection=!0,this.selectionSettings.type="Multiple"),E(this.columns,this.enableColumnVirtualization,this),this.enableColumnVirtualization&&this.isChangeDataSourceCall&&this.columnModel&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.isPreparedFrozenColumns=!0,this.enablePersistence&&this.notify(ki,{}),this.getMediaColumns(),T(this.columns),this.isFrozenGrid()&&!this.mergedColumns&&this.setInitialFrozenColumnIndex(this.columns),this.checkLockColumns(this.columns),this.getColumns(),this.processModel(),this.gridRender(),this.wireEvents(),this.addListener(),this.updateDefaultCursor(),this.updateStackedFilter(),"Spinner"===this.loadingIndicator.indicatorType&&this.showSpinner(),this.notify(Jt,{}),"Shimmer"===this.loadingIndicator.indicatorType&&this.refreshMaskRow(),this.refreshing&&this.trigger("created")},s.prototype.setInitialFrozenColumnIndex=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.initialFrozenColumnIndex=i.index,i.columns&&this.setInitialFrozenColumnIndex(i.columns)}},s.prototype.showSpinner=function(){this.isExportGrid||n.showSpinner(this.element)},s.prototype.hideSpinner=function(){this.isExportGrid||n.hideSpinner(this.element)},s.prototype.showMaskRow=function(e,i){if(!t.isNullOrUndefined(this.headerModule)&&!t.isNullOrUndefined(this.contentModule)){var n=this.getHeaderContent().firstChild,r=this.getContent().firstChild,s=this.getFooterContent();if(i){var o=i.querySelector(".e-checkboxlist");if(!t.isNullOrUndefined(o)){var a=Math.floor(o.getBoundingClientRect().height/this.getRowHeight()),l='<div class="e-ftrchk e-mask-ftrchk"><div class="e-checkbox-wrapper"><input class="e-chk-hidden">'+this.getShimmerTemplate()+this.getShimmerTemplate()+"</div></div>";o.innerHTML="";for(var d=0;d<a;d++){o.innerHTML+=l,o.querySelector(".e-ftrchk.e-mask-ftrchk").style.width="100%",o.querySelector(".e-checkbox-wrapper").style.width="100%";var h=[].slice.call(o.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)"));h[0].classList.add("e-mask-checkbox-filter-intent"),h[1].classList.add("e-mask-checkbox-filter-span-intent")}}}else{if((!this.enableRtl&&!this.getHeaderContent().style.paddingRight||this.enableRtl&&!this.getHeaderContent().style.paddingLeft)&&(r.style.overflowY="hidden"),!this.isInitialLoad&&!this.getColumns().length){var p=r.getBoundingClientRect().height,c=0===p?this.allowPaging?this.pageSettings.pageSize*this.getRowHeight():window.innerHeight:p,u=Math.ceil(c/this.getRowHeight());return"Vertical"!==this.rowRenderingMode&&(this.headerMaskTable=this.createEmptyMaskTable(n,1)),void(this.contentMaskTable=this.createEmptyMaskTable(r,u))}if(this.maskRowContentScroll=!(!this.enableVirtualization&&!this.enableColumnVirtualization||!e),!this.contentMaskTable){g=r;(this.enableVirtualization||this.enableColumnVirtualization)&&(g=g.querySelector(".e-virtualtable")),t.isNullOrUndefined(g.querySelector("tbody"))||(this.contentMaskTable=this.createMaskTable(g,this.getContentMaskColumns(),e))}if(!this.headerMaskTable&&(this.isFrozenGrid()&&!this.isRowPinned&&!this.pinnedTopRowModels.length||this.enableColumnVirtualization&&"X"===e)){var g=n;this.enableColumnVirtualization&&"X"===e&&(g=g.querySelector(".e-virtualtable")),this.headerMaskTable=this.createMaskTable(g,this.getContentMaskColumns(),e)}if(s&&s.querySelector(".e-summaryrow")){var f=s.firstChild;if(!this.footerContentMaskTable){var m=f;this.footerContentMaskTable=this.createMaskTable(m)}}this.enableVirtualization&&e||t.EventHandler.add(r,"scroll",this.translateMaskRow,this)}}},s.prototype.getContentMaskColumns=function(){return this.getColumns()},s.prototype.createEmptyMaskTable=function(e,t){var i=this.createElement("table",{className:"e-table e-masked-table"}),n=this.createElement("tbody",{className:"e-masked-tbody"}),r=this.createElement("tr",{className:"e-masked-row e-row"});r.style.height=this.getRowHeight()+"px";var s=this.createElement("td",{className:"e-masked-cell e-rowcell"});s.innerHTML=this.getShimmerTemplate(),r.appendChild(s);for(var o=0;o<t;o++)n.appendChild(r.cloneNode(!0));return i.appendChild(n),e.appendChild(i),i},s.prototype.createFrozenMaskRow=function(e,t){for(var i=0;i<e.length;i++)i<this.frozenLeftCount?(this.frozenLeftCount-1===i&&e[parseInt(i.toString(),10)].classList.add("e-freezeleftborder"),e[parseInt(i.toString(),10)].classList.add("e-leftfreeze"),e[parseInt(i.toString(),10)].setAttribute("aria-colindex",(i+1).toString()),e[parseInt(i.toString(),10)].style.left=t[parseInt(i.toString(),10)].valueX-this.translateX+"px"):e.length-this.frozenRightCount<=i&&t[parseInt(i.toString(),10)]&&(e.length-this.frozenRightCount===i&&e[parseInt(i.toString(),10)].classList.add("e-freezerightborder"),e[parseInt(i.toString(),10)].classList.add("e-rightfreeze"),e[parseInt(i.toString(),10)].setAttribute("aria-colindex",(i+1).toString()),e[parseInt(i.toString(),10)].style.right=this.translateX+t[parseInt(i.toString(),10)].valueX+"px")},s.prototype.createMaskTable=function(e,i,n){var r=e,s=!!t.closest(r,".e-gridheader"),o=!!t.closest(r,".e-gridcontent"),a=!!t.closest(r,".e-gridfooter"),l=this.getContent().firstChild,d=l.scrollHeight,h=r.querySelector("table"),p=h.cloneNode();p.removeAttribute("role"),p.removeAttribute("id"),t.updateCSSText(p,"position: absolute; z-index: 5; width: "+h.getBoundingClientRect().width+"px;"),!s||this.enableColumnVirtualization&&"X"===n||(p.style.transform="translate(0px,"+h.querySelector("thead").getBoundingClientRect().height+"px)"),p.setAttribute("class","e-table e-masked-table");var c=h.querySelector("colgroup").cloneNode(!0);if(c.removeAttribute("id"),c.setAttribute("class","e-masked-colgroup"),p.appendChild(c),s&&this.enableColumnVirtualization&&"X"===n){var u=this.createMaskRow(c,i);if(this.isFrozenGrid()){E=[].slice.call(u.querySelectorAll(".e-rowcell"));this.createFrozenMaskRow(E,i)}var g=h.querySelector("thead"),f=[].slice.call(g.querySelectorAll("tr")),m=g.cloneNode();m.removeAttribute("role"),m.setAttribute("class","e-masked-thead");for(var y=f.length,v=0;v<y;v++)m.appendChild(u.cloneNode(!0)),m.childNodes[parseInt(v.toString(),10)].style.height=f[parseInt(v.toString(),10)].getBoundingClientRect().height+"px";p.appendChild(m)}var S=h.querySelector("tbody").cloneNode();S.removeAttribute("role"),S.setAttribute("class","e-masked-tbody");var C=h.querySelector("tbody");if(o||s){var w=l,y=Math.ceil(w.getBoundingClientRect().height/this.getRowHeight());if(this.allowPaging&&this.pageSettings.pageSize!==this.currentViewData.length&&this.pagerModule.pagerObj.totalPages!==this.pageSettings.currentPage){(b=(u=this.createMaskRow(c,i)).cloneNode(!0)).classList.add("e-altrow");for(v=0;v<this.pageSettings.pageSize-this.currentViewData.length;v++)S.appendChild(v%2==1?b.cloneNode(!0):u.cloneNode(!0))}if(C.querySelector(".e-emptyrow")||!C.childNodes.length||o&&this.childGrid){var b=(u=this.createMaskRow(c,i)).cloneNode(!0);b.classList.add("e-altrow");for(v=0;v<y;v++){S.appendChild((v+1)%2==0?b.cloneNode(!0):u.cloneNode(!0))}}else{var I='tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"])';this.isTreeGrid&&(I='tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"]):not(.e-childrow-hidden)');var f=[].slice.call(C.querySelectorAll(I)),x=C.querySelector(".e-addedrow, .e-editedrow"),R=void 0;if(x){if(R=f.indexOf(x),this.isFrozenGrid()&&this.enableColumnVirtualization)for(var D=[].slice.call(f[R+1].querySelectorAll(".e-rowcell")),v=0;v<D.length;v++)v<this.frozenLeftCount?(D[parseInt(v.toString(),10)].classList.add("e-leftfreeze"),D[parseInt(v.toString(),10)].setAttribute("aria-colindex",(v+1).toString()),D[parseInt(v.toString(),10)].style.left=i[parseInt(v.toString(),10)].valueX-this.translateX+"px"):D.length-this.frozenRightCount<=v&&i[parseInt(v.toString(),10)]&&(D[parseInt(v.toString(),10)].classList.add("e-rightfreeze"),D[parseInt(v.toString(),10)].setAttribute("aria-colindex",(v+1).toString()),D[parseInt(v.toString(),10)].style.right=this.translateX+i[parseInt(v.toString(),10)].valueX+"px");x.classList.contains("e-addedrow")?f.splice(R,2):f.splice(R,1)}y=(this.enableVirtualization||this.enableColumnVirtualization)&&n?f.length:y<=f.length?y:f.length;for(v=0;v<y;v++){var T=this.applyMaskRow(f[parseInt(v.toString(),10)].cloneNode(!0),f[parseInt(v.toString(),10)].getBoundingClientRect().height);if(this.enableColumnVirtualization&&"X"===n&&this.isFrozenGrid()){var E=[].slice.call(T.querySelectorAll(".e-masked-cell"));this.createFrozenMaskRow(E,i)}S.appendChild(T)}if(this.addMaskRows(S,y/2,f[0],o,n),x&&x.classList.contains("e-editedrow")&&R<y){var O=S.childNodes[parseInt(R.toString(),10)];O.style.height=this.getRowHeight()+"px",O.classList.add("e-row"),x.classList.contains("e-altrow")&&O.classList.add("e-altrow")}}}if(p.appendChild(S),a){var k=h.querySelector("tfoot"),A=k.cloneNode();A.setAttribute("class","e-masked-tfoot");for(var f=[].slice.call(k.querySelectorAll("tr")),v=0;v<f.length;v++)A.appendChild(this.applyMaskRow(f[parseInt(v.toString(),10)].cloneNode(!0),f[parseInt(v.toString(),10)].getBoundingClientRect().height));p.appendChild(A)}if(s&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+Xi).style.position="relative"),r.insertBefore(p,r.firstChild),o&&(!this.enableVirtualization||!n)){var F=d-p.getBoundingClientRect().height;F=F<0?0:F;var M=l.scrollTop<=F?l.scrollTop:F;this.enableVirtualization&&(M-=xe(t.closest(r,".e-virtualtable")).height),p.style.transform="translate(0px,"+M+"px)"}return p},s.prototype.addMaskRows=function(e,t,i,n,r){if(this.isTreeGrid&&this.enableVirtualization&&n&&"Y"===r)for(var s=0;s<t;s++){var o=i.cloneNode(!0),a=i.getBoundingClientRect().height,l=this.applyMaskRow(o,a);e.appendChild(l)}},s.prototype.applyMaskRow=function(e,i){var n=e;n.removeAttribute("role"),n.removeAttribute("aria-rowindex"),n.removeAttribute("data-uid"),n.classList.add("e-masked-row"),n.style.height=i+"px";for(var r=[].slice.call(n.childNodes),s=0;s<r.length;s++){var o=r[parseInt(s.toString(),10)],a=o.firstChild&&o.firstChild.classList&&o.firstChild.classList.contains("e-checkbox-wrapper");o.removeAttribute("role"),o.removeAttribute("tabindex"),o.removeAttribute("aria-label"),this.enableColumnVirtualization&&o.classList.contains("e-fixedfreeze")&&(t.removeClass([o],["e-fixedfreeze","e-freezeleftborder","e-freezerightborder"]),t.addClass([o],["e-unfreeze"])),o.removeAttribute("aria-colindex"),o.removeAttribute("data-index"),o.removeAttribute("data-mappingname"),o.removeAttribute("data-mappingvalue"),o.removeAttribute("data-mappinguid"),o.removeAttribute("aria-expanded"),o.classList.add("e-masked-cell"),o.innerHTML=this.getShimmerTemplate(),o.classList.contains("e-recordplusexpand")||o.classList.contains("e-recordpluscollapse")?o.firstChild.classList.add("e-mask-group-intent"):o.classList.contains("e-gridchkbox")||a?o.firstChild.classList.add("e-mask-checkbox-intent"):o.classList.contains("e-rowdragdrop")?o.firstChild.classList.add("e-mask-drag-intent"):o.classList.contains("e-indentcell")&&(o.innerHTML="")}return n},s.prototype.createMaskRow=function(e,t){var i=e,n=t,r=this.createElement("tr",{className:"e-masked-row e-row"});"Vertical"!==this.rowRenderingMode&&(r.style.height=this.getRowHeight()+"px");for(var s=this.createElement("td",{className:"e-masked-cell e-rowcell"}),o=0,a=0;o<i.childNodes.length;o++){var l=i.childNodes[parseInt(o.toString(),10)],d=s.cloneNode();d.innerHTML=this.getShimmerTemplate(),l.classList.contains("e-group-intent")||l.classList.contains("e-detail-intent")||l.classList.contains("e-drag-intent")?l.classList.contains("e-group-intent")?d.firstChild.classList.add("e-mask-group-intent"):l.classList.contains("e-detail-intent")?d.firstChild.classList.add("e-mask-detail-intent"):l.classList.contains("e-drag-intent")&&d.firstChild.classList.add("e-mask-drag-intent"):("Vertical"===this.rowRenderingMode&&n[parseInt(a.toString(),10)]&&d.setAttribute("data-cell",n[parseInt(a.toString(),10)].headerText?n[parseInt(a.toString(),10)].headerText:n[parseInt(a.toString(),10)].field),"none"===l.style.display?d.classList.add("e-hide"):(d.style.textAlign=n[parseInt(a.toString(),10)]&&n[parseInt(a.toString(),10)].textAlign?n[parseInt(a.toString(),10)].textAlign.toLowerCase():this.enableRtl?"right":"left",n[parseInt(a.toString(),10)]&&("checkbox"===n[parseInt(a.toString(),10)].type||n[parseInt(a.toString(),10)].displayAsCheckBox)&&d.firstChild.classList.add("e-mask-checkbox-intent")),a++),r.appendChild(d)}return r},s.prototype.getShimmerTemplate=function(){return this.maskRowContentScroll?'<span class="e-mask e-skeleton e-skeleton-text"></span>':'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},s.prototype.addShimmerEffect=function(){this.maskRowContentScroll=!1;for(var e=[].slice.call(this.element.querySelectorAll(".e-mask:not(.e-shimmer-wave)")),t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].classList.add("e-shimmer-wave")},s.prototype.translateMaskRow=function(e){for(var i=e.target,n=i.querySelectorAll(".e-masked-table"),r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)];if(s){var o=i.scrollHeight-s.getBoundingClientRect().height;o=o<0?0:o;var a=i.scrollTop<=o?i.scrollTop:o;this.enableVirtualization&&(a-=xe(t.closest(s,".e-virtualtable")).height),s.style.transform="translate(0px,"+a+"px)"}}},s.prototype.removeMaskRow=function(){if(!t.isNullOrUndefined(this.contentModule)){var e=this.getContent().firstChild;t.EventHandler.remove(e,"scroll",this.translateMaskRow)}this.headerMaskTable&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+Xi).style.position="");for(var i=[this.headerMaskTable,this.contentMaskTable,this.footerContentMaskTable],n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)];r&&t.remove(r)}this.headerMaskTable=null,this.contentMaskTable=null,this.footerContentMaskTable=null},s.prototype.refreshMaskRow=function(){var e=this.getContent().firstChild;if((this.isInitialLoad||this.getColumns().length)&&this.contentMaskTable&&e.querySelector(".e-masked-table")){var t=e;this.enableVirtualization&&(t=t.querySelector(".e-virtualtable")),this.refreshMaskRowColgroupWidth(t)}},s.prototype.refreshMaskRowColgroupWidth=function(e){var i=e.querySelector("table:not(.e-masked-table)"),n=i.querySelector(dn).cloneNode(!0),r=e.querySelector(".e-masked-table");n.removeAttribute("id"),n.setAttribute("class","e-masked-colgroup");for(var s=0;s<n.childNodes.length;s++)n.childNodes[parseInt(s.toString(),10)].removeAttribute("class");t.remove(r.querySelector(".e-masked-colgroup")),r.insertBefore(n,r.firstChild),r.style.width=i.getBoundingClientRect().width+"px"},s.prototype.updateStackedFilter=function(){this.allowFiltering&&"FilterBar"===this.filterSettings.type&&this.getHeaderContent().getElementsByClassName("e-stackedheadercell").length?this.getHeaderContent().classList.add("e-stackedfilter"):this.getHeaderContent().classList.remove("e-stackedfilter")},s.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[parseInt(i.toString(),10)].hideAtMedia)||!t.isNullOrUndefined(e[parseInt(i.toString(),10)].visible)&&!e[parseInt(i.toString(),10)].visible||this.pushMediaColumn(e[parseInt(i.toString(),10)],i)}this.updateFrozenColumnsWidth()},s.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[parseInt(t.toString(),10)]=this.mediaQueryUpdate.bind(this,t),this.media[e.uid].addListener(this.mediaBindInstance[parseInt(t.toString(),10)])},s.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[parseInt(i.toString(),10)].uid)return void this.mediaCol.splice(i,1);this.pushMediaColumn(e,t)}},s.prototype.mediaQueryUpdate=function(e,t){var i=this.getColumns()[parseInt(e.toString(),10)];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")))},s.prototype.refreshMediaCol=function(){this.isInitialLoad=!0;var e=this.element.querySelector("."+Qi);this.aggregates.length&&this.element.scrollHeight>parseInt(this.height.toString(),10)&&e&&t.addClass([e],["e-footerpadding"]);var i=(this.enableColumnVirtualization?this.columns:this.getColumns()).filter(function(e){return"checkbox"===e.type});(0===i.length||i.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")),this.enableAdaptiveUI&&this.scrollModule&&this.scrollModule.refresh(),this.isFrozenGrid()&&this.isAutoGenerateColumns&&(this.widthService.setWidthToColumns(),this.isAutoGenerateColumns=!1)},s.prototype.removeMediaListener=function(){for(var e=0;e<this.mediaCol.length;e++)this.media[this.mediaCol[parseInt(e.toString(),10)].uid].removeListener(this.mediaBindInstance[this.mediaCol[parseInt(e.toString(),10)].index])},s.prototype.eventInitializer=function(){},s.prototype.destroy=function(){var e=this.element;if(e){var i=!(!e.querySelector("."+Ki)||!e.querySelector("."+Wi));i&&this.unwireEvents(),this.removeListener(),this.removeMediaListener(),this.notify(pi,{}),this.destroyDependentModules(),this.isReact&&this.destroyTemplate(["template"]),this.isVue&&this.destroyTemplate(),i&&r.prototype.destroy.call(this),this.toolTipObj.destroy(),this.isReact&&!t.Browser.isIE&&(this.element.innerHTML="");for(var n=["renderModule","headerModule","contentModule","valueFormatterService","serviceLocator","ariaService","keyboardModule","widthService","searchModule","showHider","scrollModule","printModule","clipboardModule","focusModule","editModule"],s=0;s<n.length;s++)this[n[parseInt(s.toString(),10)]]&&(this[n[parseInt(s.toString(),10)]]=null);this.element.innerHTML="",t.classList(this.element,[],["e-rtl","e-gridhover","e-responsive","e-default","e-device","e-grid-min-height"])}},s.prototype.destroyDependentModules=function(){var e=this.element;e&&(e.querySelector("."+Ki)||e.querySelector("."+Wi))&&(this.scrollModule.destroy(),this.keyboardModule.destroy(),this.focusModule.destroy(),this.clipboardModule.destroy(),this.printModule.destroy())},s.prototype.getModuleName=function(){return"grid"},s.prototype.enableBoxSelection=function(){this.enableAutoFill?(this.selectionSettings.cellSelectionMode="BoxWithBorder",this.element.classList.add("e-afenabled")):(this.element.classList.remove("e-afenabled"),this.notify("destroy-autofill-elements",{}))},s.prototype.setCSSClass=function(e){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),e&&t.removeClass([this.element],e.split(" "))},s.prototype.onPropertyChanged=function(e,i){var n,r=!1,s=!1,o=!1,a={requestType:"refresh"},l=null,d=null;if(!this.isDestroyed){this.log("module_missing"),this.isEllipsisTooltip()&&this.toolTipObj.close();var h=Object.keys(e);h.indexOf("columns")>-1&&(this.enableColumnVirtualization&&(this.columnModel=[]),this.updateColumnObject(),s=!0);for(var p=0,c=h;p<c.length;p++){var u=c[p];switch(u){case"allowPaging":this.notify(ei,{module:"pager",enable:this.allowPaging}),r=!0,"100%"===this.height&&this.scrollModule.refresh(),this.getDataModule().clearCache();break;case"pageSettings":if(this.pageTemplateChange){this.pageTemplateChange=!1,this.notify(ii,{module:"pager",properties:e.pageSettings});break}if(this.pagerModule&&this.pagerModule.isCancel)return void(this.pagerModule.isCancel=!1);this.notify(ii,{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.pageRequireRefresh&&this.pageSettings.totalRecordsCount<=this.pageSettings.pageSize)&&(r=!0),this.pageRequireRefresh||(this.pageRequireRefresh=!0),this.pagerModule&&this.pagerModule.isCancel&&(this.pagerModule.isCancel=!1);break;case"allowSorting":this.notify(ei,{module:"sort",enable:this.allowSorting}),r=!0,n=!0;break;case"allowFiltering":this.updateStackedFilter(),this.notify(ei,{module:"filter",enable:this.allowFiltering}),r=!0,"FilterBar"!==this.filterSettings.type||this.editSettings.showAddNewRow&&"FilterBar"===this.filterSettings.type?this.refreshHeader():"100%"===this.height&&this.scrollModule.refresh();break;case"height":case"width":this.notify(ei,{module:"scroll",properties:{width:e.width,height:e.height}}),this.allowPaging&&this.pagerModule.refresh();break;case"allowReordering":this.headerModule.refreshUI(),n=!0;break;case"allowRowDragAndDrop":this.notify(ei,{module:"rowDragAndDrop",enable:this.allowRowDragAndDrop}),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"allowSelection":this.notify(ei,{module:"selection",enable:this.allowSelection}),this.renderModule.refresh();break;case"cssClass":this.setCSSClass(i.cssClass);break;case"enableAutoFill":this.selectionModule&&(this.enableBoxSelection(),this.selectionModule.updateAutoFillPosition());break;case"rowTemplate":this.rowTemplateFn=x(this.rowTemplate),r=!0;break;case"emptyRecordTemplate":this.emptyRecordTemplateFn=x(this.emptyRecordTemplate),r=!0;break;case"detailTemplate":this.detailTemplateFn=x(this.detailTemplate),r=!0;break;case"allowGrouping":this.notify(ei,{module:"group",enable:this.allowGrouping}),this.headerModule.refreshUI(),r=!0,n=!0,"100%"===this.height&&this.scrollModule.refresh();break;case"enableInfiniteScrolling":case"childGrid":if(r=!0,l=this.parentDetails?document.querySelector("#"+this.parentDetails.parentID):null,d=l?l.ej2_instances[0]:null,this.childGrid&&d&&t.isNullOrUndefined(d.childGrid.childGrid)){var g=Object.assign({},d.childGrid,{childGrid:e.childGrid});for(d.setProperties({childGrid:g},!0);!t.isNullOrUndefined(d.parentDetails);){var f=document.querySelector("#"+d.parentDetails.parentID),m=f?f.ej2_instances[0]:null;if(m){var y=Object.assign({},m.childGrid);y.childGrid=d.childGrid,m.setProperties({childGrid:y},!0)}d=m}}this.headerModule.refreshUI();break;case"toolbar":this.notify(ei,{module:"toolbar"}),"100%"===this.height&&this.scrollModule.refresh();break;case"groupSettings":this.notify(ii,{module:"group",properties:e.groupSettings,oldProperties:i.groupSettings});break;case"aggregates":!this.aggregates.length&&this.allowGrouping&&this.groupSettings.columns.length&&(r=!0),this.notify(ei,{module:"aggregate",properties:e}),"100%"===this.height&&this.scrollModule.refresh();break;case"frozenColumns":case"frozenRows":case"enableVirtualization":case"enableColumnVirtualization":case"currencyCode":case"locale":"frozenColumns"===u&&null===e.frozenColumns&&this.resetFrozenColumns(),this.isFrozenGrid()&&this.log("frozen_rows_columns"),o=!0,s=!0,this.addNewRowFocus=!0;break;case"query":this.getDataModule().isQueryInvokedFromData||(r=!0),this.getDataModule().isQueryInvokedFromData=!1;break;case"autoFit":this.autoFit?this.preventAdjustColumns():this.restoreAdjustColumns();break;default:this.extendedPropertyChange(u,e,s)}}n&&this.updateDefaultCursor(),s?o||this.getFrozenColumns()||this.frozenRows||this.frozenLeftColumns.length||this.frozenRightColumns.length?this.freezeRefresh():this.refresh():r&&(this.notify(ni,a),r=!1,this.maintainSelection(e.selectedRowIndex))}},s.prototype.extendedPropertyChange=function(e,n,r){switch(e){case"enableRtl":this.updateRTL(),this.allowPaging&&(this.element.querySelector(".e-gridpager").ej2_instances[0].enableRtl=n.enableRtl,this.element.querySelector(".e-gridpager").ej2_instances[0].dataBind()),"auto"!==this.height&&(this.scrollModule.removePadding(!n.enableRtl),this.scrollModule.setPadding()),this.toolbar&&this.toolbarModule&&(this.toolbarModule.getToolbar().ej2_instances[0].enableRtl=n.enableRtl,this.toolbarModule.getToolbar().ej2_instances[0].dataBind()),this.contextMenuItems&&this.contextMenuModule&&(this.contextMenuModule.getContextMenu().ej2_instances[0].enableRtl=n.enableRtl,this.contextMenuModule.getContextMenu().ej2_instances[0].dataBind()),this.showColumnMenu&&this.columnMenuModule&&!this.enableAdaptiveUI&&(this.columnMenuModule.getColumnMenu().ej2_instances[0].enableRtl=n.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.resizeModule&&this.resizeModule.render(),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(ei,{module:"columnMenu",enable:!0});break;case"columnMenuItems":this.notify(ei,{module:"columnMenu",enable:this.columnMenuItems});break;case"contextMenuItems":this.notify(ei,{module:"contextMenu",enable:this.contextMenuItems});break;case"showColumnChooser":this.toolbarModule&&this.toolbarModule.refreshToolbarItems(),this.notify(ei,{module:"columnChooser",enable:this.showColumnChooser});break;case"columnChooserSettings":this.notify(ii,{module:"columnChooser"});break;case"filterSettings":this.updateStackedFilter(),this.notify(ii,{module:"filter",properties:n.filterSettings});break;case"searchSettings":this.notify(ii,{module:"search",properties:n.searchSettings});break;case"sortSettings":this.notify(ii,{module:"sort"});break;case"selectionSettings":this.notify(ii,{module:"selection",properties:n.selectionSettings});break;case"editSettings":this.notify(ii,{module:"edit",properties:n.editSettings});break;case"allowTextWrap":case"textWrapSettings":this.allowTextWrap?this.applyTextWrap():this.removeTextWrap(),this.notify(Ri,{case:"textwrap",isModeChg:"textWrapSettings"===e}),this.refreshHeader(),"100%"===this.height&&this.scrollModule.refresh();break;case"dataSource":var s=this.getDataModule().getState();if(this.allowPaging&&this.pageSettings.pageSizes&&!this.getDataModule().isRemote()&&(!s||!s.isPending)&&this.pagerModule.pagerObj.isAllPage){var o=this.dataSource instanceof i.DataManager?this.dataSource.dataSource.json.length:"result"in this.dataSource?this.dataSource.count:this.dataSource.length;!!(Array.isArray(this.pageSettings.pageSizes)&&this.pageSettings.pageSizes.indexOf("All")>-1)||this.pageSettings.pageSizes||this.pageSettings.pageSize===o?(this.setProperties({pageSettings:{pageSize:o}},!0),this.pagerModule.pagerObj.setProperties({pageSize:o},!0)):this.pagerModule.pagerObj.isAllPage=!1}if(!this.allowSelection||!this.isPersistSelection||s&&s.isPending||this.clearSelection(),this.partialSelectedRecords=[],this.partialSelectedIndexes=[],this.disableSelectedRecords=[],this.renderModule.selectableDataKey={},this.renderModule.nonselectableDataKey={},!t.isNullOrUndefined(this.dataSource)&&this.dataSource.result&&(this.isVirtualAdaptive=!1),Object.getPrototypeOf(n).deepWatch)for(var a=this.getPrimaryKeyFieldNames()[0],l=0,d=Object.keys(n.dataSource);l<d.length;l++)this.setRowData(t.getValue(a,this.dataSource[d[parseInt(l.toString(),10)]]),this.dataSource[d[parseInt(l.toString(),10)]]);else if(s.isPending){h=t.isNullOrUndefined(this.dataSource)?[]:this.dataSource.result;if((p=s.group||[]).length&&!this.groupSettings.enableLazyLoading&&(!h.length||!h[0].field))for(l=0;l<p.length;l++)h=i.DataUtil.group(h,p[parseInt(l.toString(),10)],s.aggregates||[]);this.dataSource={result:h,count:this.dataSource.count,aggregates:this.dataSource.aggregates},this.getDataModule().setState({}),s.resolver(this.dataSource)}else{if(!t.isNullOrUndefined(this.dataSource)&&this.dataSource.result&&this.dataSource.count&&this.groupSettings.columns.length){var h=this.dataSource.result,p=this.groupSettings.columns;if(p.length&&(!h.length||!h[0].field))for(l=0;l<p.length;l++)h=i.DataUtil.group(h,p[parseInt(l.toString(),10)]);this.dataSource={result:h,count:this.dataSource.count}}if(this.getDataModule().setState({isDataChanged:!1}),this.notify(vi,{}),!r){if(this.isRowSelectable&&!this.isRemote()){var c=this.getDataModule().dataManager.executeLocal(this.getDataModule().generateQuery(!0));this.renderModule.setPartialRecord(c)}this.renderModule.refresh(),this.isCheckBoxSelection&&this.notify("before-refresh-on-data-change",{})}}this.scrollRefresh();break;case"enableHover":(n.enableHover?t.addClass:t.removeClass)([this.element],"e-gridhover");break;case"selectedRowIndex":this.isSelectedRowIndexUpdating||this.selectRow(n.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();break;case"enableStickyHeader":this.scrollModule.addStickyListener(n.enableStickyHeader);break;case"allowPdfExport":case"allowExcelExport":this.toolbarModule&&this.toolbarModule.refreshToolbarItems();break;case"enableRowSpan":case"enableColumnSpan":this.refreshColumns()}},s.prototype.maintainSelection=function(e){var t=this;if(-1!==e){var i=function(){t.selectRow(e),t.off($t,i)};this.on($t,i,this)}},s.prototype.setProperties=function(e,i){var n=this.groupSettings.columns;null!==e.frozenColumns&&0!==e.frozenColumns||!i||this.resetFrozenColumns(),r.prototype.setProperties.call(this,e,i);if(e.filterSettings&&this.filterModule&&i&&this.filterModule.refreshFilter(),e.groupSettings&&e.groupSettings.columns&&this.groupModule&&i){if(!this.groupSettings.showGroupedColumn&&t.isNullOrUndefined(e.columns))for(s=0;s<n.length;s++)(o=this.getColumnByField(n[parseInt(s.toString(),10)])).visible=!0;for(s=0;s<this.sortSettings.columns.length;s++)-1!==n.indexOf(this.sortSettings.columns[parseInt(s.toString(),10)].field)&&this.sortSettings.columns[parseInt(s.toString(),10)].isFromGroup&&(this.sortSettings.columns.splice(s,1),s--);for(var s=0;s<e.groupSettings.columns.length;s++){this.groupModule.groupAddSortingQuery(e.groupSettings.columns[parseInt(s.toString(),10)]);var o=this.getColumnByField(e.groupSettings.columns[parseInt(s.toString(),10)]);o.visible=this.groupSettings.showGroupedColumn}}},s.prototype.getTablesCount=function(){return this.tablesCount},s.prototype.isRemote=function(){return this.getDataModule().isRemote()||!t.isNullOrUndefined(this.dataSource)&&!t.isNullOrUndefined(this.dataSource.result)},s.prototype.updateDefaultCursor=function(){for(var e=[].slice.call(this.getHeaderContent().querySelectorAll(".e-headercell:not(.e-stackedheadercell)")),t=[].slice.call(this.getHeaderContent().getElementsByClassName("e-stackedheadercell")),i=this.getColumns(),n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)],s=i[parseInt(n.toString(),10)];this.allowGrouping&&s.allowGrouping||this.allowReordering&&s.allowReordering||this.allowSorting&&s.allowSorting?r.classList.add("e-mousepointer"):r.classList.add("e-defaultcursor")}for(var o=0;o<t.length;o++)this.allowReordering&&t[parseInt(o.toString(),10)].classList.add("e-mousepointer")},s.prototype.updateColumnModel=function(e,i){for(var n=0,r=t.isNullOrUndefined(e)?0:e.length;n<r;n++)e[parseInt(n.toString(),10)].columns?this.updateColumnModel(e[parseInt(n.toString(),10)].columns,!0):this.columnModel.push(e[parseInt(n.toString(),10)]);!t.isNullOrUndefined(i)&&i||this.updateLockableColumns()},s.prototype.getFrozenLeftCount=function(){return this.getFrozenColumns()||this.getFrozenLeftColumnsCount()},s.prototype.isFrozenGrid=function(){return 0!==this.getFrozenColumns()||0!==this.frozenLeftColumns.length||0!==this.frozenRightColumns.length||0!==this.fixedColumns.length},s.prototype.getFrozenMode=function(){return this.frozenName},s.prototype.updateLockableColumns=function(){for(var e=this.columnModel,t=0,i=0,n=this.getFrozenColumns(),r=0;r<e.length;r++)e[parseInt(r.toString(),10)].lockColumn&&(r<n?(e.splice(t,0,e.splice(r,1)[0]),t++):(e.splice(n+i,0,e.splice(r,1)[0]),i++))},s.prototype.checkLockColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns?this.checkLockColumns(e[parseInt(t.toString(),10)].columns):e[parseInt(t.toString(),10)].lockColumn&&this.lockcolPositionCount++},s.prototype.leftrightColumnWidth=function(e){var t=0;return("left"===e?this.getFrozenLeftColumns():"right"===e?this.getFrozenRightColumns():[]).filter(function(e){e.visible&&(t+=parseInt(e.width.toString(),10))}),t},s.prototype.getColumns=function(e){var i=this,n=this.inViewIndexes.map(function(e){return e-i.groupSettings.columns.length}).filter(function(e){return e>-1}),r=n.length;(!this.enableColumnVirtualization||t.isNullOrUndefined(this.columnModel)||0===this.columnModel.length||e)&&(this.columnModel=[],this.updateColumnModel(this.columns));var s=0===r?this.columnModel:this.getVisibleColumns().slice(n[0],n[r-1]+1),o=[],a=[],l=[],d=this.enableColumnVirtualization&&this.isPreparedFrozenColumns&&0===r;d&&(this.frozenRightColumns=[],this.frozenLeftColumns=[]);for(var h=0;h<s.length;h++)"Left"===s[parseInt(h.toString(),10)].freeze||s[parseInt(h.toString(),10)].isFrozen?(o.push(s[parseInt(h.toString(),10)]),d&&this.frozenLeftColumns.push(s[parseInt(h.toString(),10)])):"Right"===s[parseInt(h.toString(),10)].freeze?(a.push(s[parseInt(h.toString(),10)]),d&&this.frozenRightColumns.push(s[parseInt(h.toString(),10)])):l.push(s[parseInt(h.toString(),10)]);return this.enableColumnVirtualization&&this.isFrozenGrid()&&(this.frozenLeftColumns.length&&(o=this.frozenLeftColumns),this.frozenRightColumns.length&&(a=this.frozenRightColumns)),o.concat(l).concat(a)},s.prototype.getPersistColumns=function(){var e=JSON.parse(this.addOnPersist(["columns"])).columns;return e?JSON.stringify(e):""},s.prototype.setColumns=function(e){!t.isNullOrUndefined(e)&&e instanceof Array&&e.length&&this.setProperties({columns:e},!1)},s.prototype.getStackedHeaderColumnByHeaderText=function(e,t){for(var i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n.field===e||n.headerText===e){this.stackedColumn=n;break}n.columns&&this.getStackedHeaderColumnByHeaderText(e,n.columns)}return this.stackedColumn},s.prototype.getColumnIndexesInView=function(){return this.inViewIndexes},s.prototype.getQuery=function(){return this.query},s.prototype.getLocaleConstants=function(){return this.defaultLocale},s.prototype.setColumnIndexesInView=function(e){this.inViewIndexes=e},s.prototype.getVisibleColumns=function(){return this.getCurrentVisibleColumns()},s.prototype.getHeaderContent=function(){return this.headerModule.getPanel()},s.prototype.setGridHeaderContent=function(e){this.headerModule.setPanel(e)},s.prototype.getContentTable=function(){return this.contentModule.getTable()},s.prototype.setGridContentTable=function(e){this.contentModule.setTable(e)},s.prototype.getContent=function(){return this.contentModule.getPanel()},s.prototype.setGridContent=function(e){this.contentModule.setPanel(e)},s.prototype.getHeaderTable=function(){return this.headerModule.getTable()},s.prototype.setGridHeaderTable=function(e){this.headerModule.setTable(e)},s.prototype.getFooterContent=function(){return this.footerElement=this.element.getElementsByClassName(Qi)[0],this.footerElement},s.prototype.getFooterContentTable=function(){return this.footerElement=this.element.getElementsByClassName(Qi)[0],this.footerElement.firstChild.firstChild},s.prototype.getPager=function(){return this.gridPager},s.prototype.setGridPager=function(e){this.gridPager=e},s.prototype.getRowByIndex=function(e){return this.enableVirtualization&&this.groupSettings.enableLazyLoading?this.lazyLoadRender.getRowByIndex(e):this.contentModule.getRowByIndex(e)},s.prototype.getMovableRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},s.prototype.getFrozenRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},s.prototype.getRows=function(){return this.contentModule.getRowElements()},s.prototype.getFrozenRightRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},s.prototype.getRowInfo=function(e){var i=e,n={target:e};if(!t.isNullOrUndefined(e)&&t.isNullOrUndefined(F(i,"e-detailrowcollapse")&&t.isNullOrUndefined(F(i,"e-recordplusexpand")))){var r=t.closest(i,"."+_i);if(!r){var s=t.closest(i,"."+Zi);if(!t.isNullOrUndefined(s)&&!s.classList.contains("e-addedrow")){var o=this.getRowObjectFromUID(s.getAttribute("data-uid")),a=parseInt(s.getAttribute(an),10)-1;n={row:s,rowData:o.data,rowIndex:a}}return n}var l=parseInt(r.getAttribute(on),10)-1,d=t.closest(r,"."+Zi);if(!t.isNullOrUndefined(r)&&!isNaN(l)&&!t.isNullOrUndefined(d)){var a=parseInt(d.getAttribute(an),10)-1,h=this.contentModule.getRows(),p=l+this.getIndentCount(),c=h.filter(function(e){return e.uid===d.getAttribute("data-uid")});this.pinnedTopRowModels.length&&!t.isNullOrUndefined(e)&&F(i,"e-headercontent")&&(c=this.pinnedTopRowModels.filter(function(e){return e.uid===d.getAttribute("data-uid")}));var u={},g=void 0;Object.keys(c).length&&(u=c[0].data,g=c[0].cells[parseInt(p.toString(),10)].column),n={cell:r,cellIndex:l,row:d,rowIndex:a,rowData:u,column:g,target:e}}}return n},s.prototype.getMovableRows=function(){return this.contentModule.getRowElements()},s.prototype.getFrozenRightRows=function(){return this.contentModule.getRowElements()},s.prototype.getDataRows=function(){return this.getAllDataRows()},s.prototype.getAllDataRows=function(e){if(t.isNullOrUndefined(this.getContentTable().querySelector(ln)))return[];var i=this.getContentTable().querySelector(ln),n=[].slice.call(i.children);if(this.editSettings.showAddNewRow&&(n[0].classList.contains("e-addedrow")?n.shift():n[n.length-1].classList.contains("e-addedrow")&&n.pop()),this.frozenRows||this.pinnedTopRowModels.length){var r=this.getHeaderTable().querySelector(ln),s=[].slice.call(r.children);n=this.addMovableRows(s,n),this.editSettings.showAddNewRow&&s[0].classList.contains("e-addedrow")&&s.shift()}return this.generateDataRows(n,e)},s.prototype.addMovableRows=function(e,t){for(var i=0,n=t.length;i<n;i++)e.push(t[parseInt(i.toString(),10)]);return e},s.prototype.generateDataRows=function(e,t){for(var i=[],n=0,r=e.length;n<r;n++)!e[parseInt(n.toString(),10)].classList.contains(Zi)||e[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")&&!t||(this.isCollapseStateEnabled()?i[parseInt(e[parseInt(n.toString(),10)].getAttribute("aria-rowindex"),10)-1]=e[parseInt(n.toString(),10)]:i.push(e[parseInt(n.toString(),10)]));return i},s.prototype.getMovableDataRows=function(){return this.getAllMovableDataRows()},s.prototype.getAllMovableDataRows=function(e){return this.getAllDataRows(e)},s.prototype.getFrozenDataRows=function(){return this.getAllFrozenDataRows()},s.prototype.getAllFrozenDataRows=function(e){return this.getAllDataRows(e)},s.prototype.getFrozenRightDataRows=function(){return this.getAllFrozenRightDataRows()},s.prototype.getAllFrozenRightDataRows=function(e){return this.getAllDataRows(e)},s.prototype.setCellValue=function(e,i,n){var r=this.getPrimaryKeyFieldNames()[0],s=new Rn(this,this.serviceLocator),o=this.getColumnIndexByField(i),a=this.getColumnByField(i),l=this.contentModule.getRows().filter(function(i){return t.getValue(r,i.data)===e})[0],d=l?this.element.querySelector("[data-uid="+l.uid+"]"):null;if(!t.isNullOrUndefined(d)){"string"==typeof n&&(n=this.sanitize(n)),t.setValue(i,n,l.data);var h=this.enableVirtualization?d.children[parseInt(o.toString(),10)]:this.getCellFromIndex(l.index,o);if(!t.isNullOrUndefined(h)){this.groupSettings.columns.length&&(o+=this.groupSettings.columns.length),(this.childGrid||this.detailTemplate)&&o++,this.isRowDragable()&&o++;var p=l.cells[o-0];s.refreshTD(h,p,l.data,{index:l.index}),this.isReact&&(h=this.enableVirtualization?d.children[parseInt(o.toString(),10)]:this.getCellFromIndex(l.index,o)),this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})),t.isNullOrUndefined(l)||t.isNullOrUndefined(l.changes)||(l.changes[""+i]=n),this.trigger("queryCellInfo",{cell:h,column:a,data:l.data}),this.isReact&&"0"===h.getAttribute("tabindex")&&h.classList.contains("e-focused")&&h.focus()}}},s.prototype.setCellValueAsync=function(e,i,n,r){var s=this;return new Promise(function(o,a){try{s.setCellValue(e,i,n),!t.isNullOrUndefined(r)&&r>0?setTimeout(function(){o()},r):o()}catch(e){a(e)}})},s.prototype.refreshReactColumnTemplateByUid=function(e,t){var i=this;this.isReact&&this.clearTemplate(["columnTemplate"],void 0,function(){var e=!(!i.childGrid||!i.element.querySelectorAll(".e-childgrid").length),n=e?i.getContentTable().querySelectorAll(".e-row"):i.getDataRows();i.refreshReactTemplateTD(n,e),t&&i.renderTemplates()})},s.prototype.refreshReactTemplateTD=function(e,i,n){for(var r=this.getIndentCount(),s=0,o=!1,a=0;a<e.length;a++){var l=this.getRowObjectFromUID(e[parseInt(a.toString(),10)].getAttribute("data-uid"));if(i&&!l&&F(e[parseInt(a.toString(),10)],"e-childgrid")){var d=F(e[parseInt(a.toString(),10)],"e-childgrid").ej2_instances[0];l=d.getRowObjectFromUID(e[parseInt(a.toString(),10)].getAttribute("data-uid")),s=d.getIndentCount(),o=!0}if(l&&l.isDataRow&&!t.isNullOrUndefined(l.index)&&!e[parseInt(a.toString(),10)].classList.contains("e-editedrow"))for(var h=0;h<l.cells.length;h++){var p=l.cells[parseInt(h.toString(),10)];if(p.isTemplate){var c=new Rn(this,this.serviceLocator),u=i?e[parseInt(a.toString(),10)].children[p.index+(o?s:r)]:this.getCellFromIndex(a,n?p.index:h-r);c.refreshTD(u,p,l.data,{index:l.index})}}o=!1}},s.prototype.refreshGroupCaptionFooterTemplate=function(){for(var e=!(!this.childGrid||!this.element.querySelectorAll(".e-childgrid").length),t=this.getContentTable().querySelectorAll(".e-groupcaptionrow, .e-groupfooterrow"),i=0;i<t.length;i++){var n=this,r=this.getRowObjectFromUID(t[parseInt(i.toString(),10)].getAttribute("data-uid"));if(e&&!r&&F(t[parseInt(i.toString(),10)],"e-childgrid")&&(r=(n=F(t[parseInt(i.toString(),10)],"e-childgrid").ej2_instances[0]).getRowObjectFromUID(t[parseInt(i.toString(),10)].getAttribute("data-uid"))),r){var s={cells:r.cells.filter(function(e){return e.isDataCell}),data:r.data,dataUid:r.uid};n.notify("refresh-aggregate-cell",s)}}},s.prototype.refreshReactHeaderTemplateByUid=function(e){if(this.isReact)for(var i=this.headerModule.rows,n=this.getNormalizedColumnIndex(e),r=this,s=0;s<i.length;s++)!function(s){var o=i[parseInt(s.toString(),10)].cells[parseInt(n.toString(),10)];if(o&&o.column.uid===e){var a=new On(r,r.serviceLocator),l=F(r.element.querySelectorAll("[data-mappinguid="+e+"]")[0],"e-templatecell");a.refresh(o,l);var d=r.sortSettings.columns,h=d.findIndex(function(e){return e.field===o.column.field});if(-1!==h){var p=r.getColumnHeaderByField(o.column.field);r.ariaService.setSort(p,d[parseInt(h.toString(),10)].direction.toLowerCase()),d.length>1&&p.querySelector(".e-headercelldiv").insertBefore(r.createElement("span",{className:"e-sortnumber",innerHTML:(h+1).toString()}),p.querySelector(".e-headertext"));var c=p.querySelector(".e-sortfilterdiv");"Ascending"===d[parseInt(h.toString(),10)].direction?t.classList(c,["e-ascending","e-icon-ascending"],[]):t.classList(c,["e-descending","e-icon-descending"],[])}}}(s)},s.prototype.setRowData=function(e,i){var n=this.contentModule.getRows(),r=this.getPrimaryKeyFieldNames()[0];this.groupSettings.columns.length>0&&this.aggregates.length>0&&(n=n.filter(function(e){return e.isDataRow}));var s=n.filter(function(i){return t.getValue(r,i.data)===e})[0],o=s?[].slice.call(this.element.querySelectorAll("[data-uid="+s.uid+"]")):void 0;if(!t.isNullOrUndefined(s)&&o.length){if(s.changes=i,this.frozenRows){var a=this.getRowsObject()[s.index];this.setFrozenRowData(a,i)}else{var l=this.getRowElementByUID(s.uid),d=!(!l||!l.querySelector(".e-lastrowcell"));this.setFrozenRowData(s,i),d&&this.scrollModule.setLastRowCell()}this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{}))}},s.prototype.setRowDataAsync=function(e,i,n){var r=this;return new Promise(function(s,o){try{r.setRowData(e,i),!t.isNullOrUndefined(n)&&n>0?setTimeout(function(){s()},n):s()}catch(e){o(e)}})},s.prototype.setFrozenRowData=function(e,t){var i=new fn(this.serviceLocator,null,this);e.changes=t,de(e,this.getForeignKeyColumns(),e.changes),i.refresh(e,this.getColumns(),!0)},s.prototype.getCellFromIndex=function(e,t){return tt(this,this.getColumnByIndex(t),e,t)},s.prototype.getMovableCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},s.prototype.getFrozenRightCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},s.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable().getElementsByClassName("e-headercell")[parseInt(e.toString(),10)]},s.prototype.getMovableColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},s.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},s.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},s.prototype.getRowObjectFromUID=function(e){var i=this.contentModule.getRows(),n=this.rowObject(i,e);if(t.isNullOrUndefined(n)&&this.pinnedTopRowModels.length){var r=this.pinnedTopRowModels;if(n=this.rowObject(r,e),!t.isNullOrUndefined(n))return n}return t.isNullOrUndefined(n)&&this.enableVirtualization&&this.groupSettings.columns.length>0?n=this.rowObject(this.vRows,e):n},s.prototype.rowObject=function(e,t){if(e)for(var i=0,n=e;i<n.length;i++){var r=n[i];if(r.uid===t)return r}return null},s.prototype.getRowsObject=function(){return this.contentModule.getRows()},s.prototype.getMovableRowsObject=function(){return this.contentModule.getRows()},s.prototype.getFrozenRightRowsObject=function(){return this.contentModule.getRows()},s.prototype.getColumnHeaderByField=function(e){var t=this.getColumnByField(e);return t?this.getColumnHeaderByUid(t.uid):void 0},s.prototype.getColumnHeaderByUid=function(e){var i=this.getHeaderContent().querySelector("[data-mappinguid="+e+"]");return i?t.closest(i,"th"):void 0},s.prototype.getColumnByIndex=function(e){var t;return this.getColumns().some(function(i,n){return t=i,n===e}),t},s.prototype.getColumnByField=function(e){return b(this.getColumns(),function(t){if(t.field===e)return t})[0]},s.prototype.getColumnIndexByField=function(e){for(var t=this.getColumns(),i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].field===e)return i;return-1},s.prototype.getColumnByUid=function(e,t){return b((t?this.columns:this.getColumns()).concat(this.getStackedColumns(this.columns)),function(t){if(t.uid===e)return t})[0]},s.prototype.getStackedColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,n=e;i<n.length;i++){var r=n[i];r.columns&&(t.push(r),this.getStackedColumns(r.columns,t))}return t},s.prototype.getColumnIndexByUid=function(e){var i=b(this.getColumns(),function(t,i){if(t.uid===e)return i})[0];return t.isNullOrUndefined(i)?-1:i},s.prototype.getUidByColumnField=function(e){return b(this.getColumns(),function(t){if(t.field===e)return t.uid})[0]},s.prototype.getNormalizedColumnIndex=function(e){return this.getColumnIndexByUid(e)+this.getIndentCount()},s.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},s.prototype.getColumnFieldNames=function(){for(var e,t=[],i=0,n=this.getColumns().length;i<n;i++)(e=this.getColumns()[parseInt(i.toString(),10)]).visible&&t.push(e.field);return t},s.prototype.getRowTemplate=function(){return this.rowTemplateFn},s.prototype.getEmptyRecordTemplate=function(){return this.emptyRecordTemplateFn},s.prototype.getDetailTemplate=function(){return this.detailTemplateFn},s.prototype.getEditTemplate=function(){return this.editTemplateFn},s.prototype.getEditHeaderTemplate=function(){return this.editHeaderTemplateFn},s.prototype.getEditFooterTemplate=function(){return this.editFooterTemplateFn},s.prototype.getColumnChooserTemplate=function(){return this.columnChooserTemplateFn},s.prototype.getColumnChooserHeaderTemplate=function(){return this.columnChooserHeaderTemplateFn},s.prototype.getColumnChooserFooterTemplate=function(){return this.columnChooserFooterTemplateFn},s.prototype.getPrimaryKeyFieldNames=function(){for(var e=[],t=0;t<this.columnModel.length;t++)this.columnModel[parseInt(t.toString(),10)].isPrimaryKey&&e.push(this.columnModel[parseInt(t.toString(),10)].field);return e},s.prototype.refresh=function(){this.isDestroyed||(this.isManualRefresh=!0,this.allowGrouping&&this.groupModule&&this.groupSettings.showDropArea&&this.groupModule.refreshDropArea(),this.headerModule.refreshUI(),this.updateStackedFilter(),this.renderModule.refresh())},s.prototype.refreshHeader=function(){this.headerModule.refreshUI()},s.prototype.getSelectedRows=function(){return this.selectionModule?this.selectionModule.selectedRecords:[]},s.prototype.getSelectedRowIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowIndexes:[]},s.prototype.getSelectedRowCellIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowCellIndexes:[]},s.prototype.getSelectedRecords=function(){return this.selectionModule?this.selectionModule.getSelectedRecords():[]},s.prototype.getSelectedColumnsUid=function(){var e=this,t=[];return this.selectionModule&&this.selectionModule.selectedColumnsIndexes.filter(function(i){return t.push(e.getColumns()[parseInt(i.toString(),10)].uid)}),t},s.prototype.getDataModule=function(){return this.renderModule.data},s.prototype.showColumns=function(e,t){t=t||"headerText",this.showHider.show(e,t)},s.prototype.hideColumns=function(e,t){t=t||"headerText",this.showHider.hide(e,t)},s.prototype.getFrozenColumns=function(){return this.frozenColumns+this.getFrozenCount(this.columns,0,0)},s.prototype.getFrozenRightColumnsCount=function(){return this.frozenRightCount||this.rightcount},s.prototype.getFrozenLeftColumnsCount=function(){return this.frozenLeftCount||this.leftcount},s.prototype.getMovableColumnsCount=function(){return this.movableCount||this.movablecount},s.prototype.updateFrozenColumnsWidth=function(){if(this.isFrozenGrid()&&!this.enableColumnVirtualization)for(var e=this.getColumns(),i=!0,n=0,r=0,s=0,o=e.some(function(e){return("Left"===e.freeze||"Right"===e.freeze||"Fixed"===e.freeze||e.isFrozen)&&"auto"===e.width}),a=this,l=0;l<e.length;l++)!function(l){var d=e[parseInt(l.toString(),10)];if(t.isNullOrUndefined(d.width)&&("Left"===d.freeze||"Right"===d.freeze||"Fixed"===d.freeze||d.isFrozen)&&(d.width=Math.max(200,d.minWidth?parseFloat(d.minWidth.toString()):0),!t.isNullOrUndefined(d.maxWidth)&&parseFloat(d.maxWidth.toString())<d.width&&(d.width=d.maxWidth)),"auto"===d.width&&o){var h=0;if(i){e.filter(function(e){if(e.visible&&("auto"===e.width&&n++,"auto"!==e.width)){var i=t.isNullOrUndefined(e.width)?Math.max(200,e.minWidth?parseFloat(e.minWidth.toString()):0):parseFloat(e.width.toString());h+=i}});var p=a.isPercentageWidthGrid()||"auto"===a.width?a.element.getBoundingClientRect().width:parseFloat(a.width.toString());(r="auto"===a.height?p-h:p-h-j())<0&&(r=0),s=parseFloat((r/n).toString()),e.filter(function(e){e.visible&&e.minWidth&&parseFloat(e.minWidth.toString())>s&&(r-=parseFloat(e.minWidth.toString()),n--)}),i=!1}d.minWidth&&parseFloat(d.minWidth.toString())>s?d.width=parseFloat(d.minWidth.toString()):d.width=r/n}}(l)},s.prototype.refreshSplitFrozenColumn=function(){this.splitFrozenCount(this.columns),this.updateFrozenColumnsWidth(),this.isAutoGenerateColumns=!0},s.prototype.setFrozenCount=function(){this.frozenLeftCount=this.frozenRightCount=this.movableCount=0,this.visibleFrozenLeft=this.visibleFrozenRight=this.visibleMovable=0,this.frozenLeftColumns=[],this.frozenRightColumns=[],this.movableColumns=[],this.fixedColumns=[],this.splitFrozenCount(this.columns),this.leftcount=this.frozenLeftCount,this.rightcount=this.frozenRightCount,this.movablecount=this.movableCount,this.frozenLeftCount&&!this.frozenRightCount?this.frozenName="Left":this.frozenRightCount&&!this.frozenLeftCount?this.frozenName="Right":this.frozenLeftCount&&this.frozenRightCount?this.frozenName="Left-Right":this.frozenColumns||this.frozenRows?this.frozenName="Left":this.frozenName=void 0},s.prototype.getVisibleFrozenLeftCount=function(){return this.visibleFrozenLeft},s.prototype.getVisibleFrozenRightCount=function(){return this.visibleFrozenRight},s.prototype.getVisibleMovableCount=function(){return this.visibleMovable},s.prototype.getFrozenRightColumns=function(){return this.frozenRightColumns},s.prototype.getFrozenLeftColumns=function(){return this.frozenLeftColumns},s.prototype.getMovableColumns=function(){return this.movableColumns},s.prototype.splitStackedColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns?this.splitStackedColumns(e[parseInt(t.toString(),10)].columns):"Left"===e[parseInt(t.toString(),10)].freeze||e[parseInt(t.toString(),10)].isFrozen?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenLeft++,this.leftcount++):"Right"===e[parseInt(t.toString(),10)].freeze?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenRight++,this.rightcount++):"Fixed"===e[parseInt(t.toString(),10)].freeze?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenFixed++,this.fixedcount++):(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleMovable++,this.movablecount++)},s.prototype.pushStackedColumns=function(e,t,i,n,r){i[parseInt(t.toString(),10)]={headerText:n.headerText},n.textAlign&&(i[parseInt(t.toString(),10)].textAlign=n.textAlign),n.customAttributes&&(i[parseInt(t.toString(),10)].customAttributes=n.customAttributes);for(var s=0;s<e.length;s++)if(e[parseInt(s.toString(),10)].columns)t+=1,this.pushStackedColumns(e[parseInt(s.toString(),10)].columns,t,i,e[parseInt(s.toString(),10)],r),t-=1;else{var o=[];o=i.slice().slice(0,t+1),"Left"===e[parseInt(s.toString(),10)].freeze||e[parseInt(s.toString(),10)].isFrozen?(this.stackedLeft.push(o),this.stackedarrayLeft.push(e[parseInt(s.toString(),10)])):"Right"===e[parseInt(s.toString(),10)].freeze?(this.stackedRight.push(o),this.stackedarrayRight.push(e[parseInt(s.toString(),10)])):"Fixed"===e[parseInt(s.toString(),10)].freeze?(this.stackedFixed.push(o),this.stackedarrayFixed.push(e[parseInt(s.toString(),10)])):(this.stackedMovable.push(o),this.stackedarrayMovable.push(e[parseInt(s.toString(),10)]))}},s.prototype.pushallcol=function(e,t,i,n,r){if(i.headerText===t.headerText)if(r)i.columns.push(n);else{var s={headerText:e.headerText,columns:[]};e.textAlign&&(s.textAlign=e.textAlign),e.customAttributes&&(s.customAttributes=e.customAttributes),i.columns.push(s)}else if(i.columns&&i.columns.length)for(var o=0;o<i.columns.length;o++)this.pushallcol(e,t,i.columns[parseInt(o.toString(),10)],n,r)},s.prototype.resetStackedColumns=function(e,t,i){for(var n={},r=[],s=1;s<=e.length;s++)for(var o=e[s-1],a=0;a<o.length;a++)if(n.columns||1!==s?-1===r.indexOf(o[parseInt(a.toString(),10)])&&(this.pushallcol(o[parseInt(a.toString(),10)],o[a-1],n),r.push(o[parseInt(a.toString(),10)])):(n={headerText:o[parseInt(a.toString(),10)].headerText,textAlign:o[parseInt(a.toString(),10)].textAlign,customAttributes:o[parseInt(a.toString(),10)].customAttributes,columns:[]},r.push(o[parseInt(a.toString(),10)])),a===o.length-1){this.pushallcol(null,o[parseInt(a.toString(),10)],n,t[s-1],!0);for(var l=0;l!==e.length-1&&s!==e.length;)o.map(function(e){return e.headerText}).join(", ")===e[parseInt(s.toString(),10)].map(function(e){return e.headerText}).join(", ")&&(s++,this.pushallcol(null,o[parseInt(a.toString(),10)],n,t[s-1],!0)),l++}"Left"===i?this.frozenLeftColumns.push(n):"Right"===i?this.frozenRightColumns.push(n):this.movableColumns.push(n)},s.prototype.resetFrozenColumns=function(){var e=this.columnModel;if(e&&e.length)for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&"Left"===e[parseInt(t.toString(),10)].freeze&&(e[parseInt(t.toString(),10)].freeze=void 0)},s.prototype.splitFrozenCount=function(e){if(this.frozenColumns||this.changedProperties&&0===this.changedProperties.frozenColumns){r=!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.isPreparedFrozenColumns?this.enableColumnVirtualization&&this.columnModel&&this.columnModel.length?this.columnModel:this.getColumns():this.columns;if(!this.changedProperties||this.changedProperties&&!this.changedProperties.frozenColumns)for(i=0;i<r.length;i++)this.frozenColumns>i?r[parseInt(i.toString(),10)].freeze="Left":"Right"===r[parseInt(i.toString(),10)].freeze||"Fixed"===r[parseInt(i.toString(),10)].freeze?r[parseInt(i.toString(),10)].freeze=r[parseInt(i.toString(),10)].freeze:r[parseInt(i.toString(),10)].freeze=void 0}for(var i=0;i<(t.isNullOrUndefined(e)?0:e.length);i++)if(e[parseInt(i.toString(),10)].columns){this.leftcount=0,this.rightcount=0,this.movablecount=0,this.fixedcount=0;var n=[];this.splitStackedColumns(e[parseInt(i.toString(),10)].columns),!this.leftcount||this.rightcount||this.movablecount||this.fixedcount?!this.rightcount||this.leftcount||this.movablecount||this.fixedcount?!this.movablecount||this.leftcount||this.rightcount||this.fixedcount?!this.fixedcount||this.leftcount||this.rightcount||this.movablecount?(this.frozenLeftCount+=this.leftcount,this.frozenRightCount+=this.rightcount,this.movableCount+=this.movablecount,this.fixedCount+=this.fixedcount,this.leftcount=0,this.rightcount=0,this.movablecount=0,this.fixedcount=0,this.stackedLeft=[],this.stackedRight=[],this.stackedFixed=[],this.stackedMovable=[],this.stackedarrayLeft=[],this.stackedarrayRight=[],this.stackedarrayFixed=[],this.stackedarrayMovable=[],this.pushStackedColumns(e[parseInt(i.toString(),10)].columns,0,n,e[parseInt(i.toString(),10)],{headerText:e[parseInt(i.toString(),10)].headerText,textAlign:e[parseInt(i.toString(),10)].textAlign,customAttributes:e[parseInt(i.toString(),10)].customAttributes,columns:[]}),this.stackedarrayLeft.length&&this.resetStackedColumns(this.stackedLeft,this.stackedarrayLeft,"Left"),this.stackedarrayRight.length&&this.resetStackedColumns(this.stackedRight,this.stackedarrayRight,"Right"),this.stackedarrayFixed.length&&this.resetStackedColumns(this.stackedFixed,this.stackedarrayFixed,"Fixed"),this.stackedarrayMovable.length&&this.resetStackedColumns(this.stackedMovable,this.stackedarrayMovable,"Movable"),this.stackedLeft=[],this.stackedRight=[],this.stackedMovable=[],this.stackedFixed=[],this.stackedarrayLeft=[],this.stackedarrayRight=[],this.stackedarrayMovable=[],this.stackedarrayFixed=[]):(this.fixedCount+=this.fixedcount,this.fixedColumns.push(e[parseInt(i.toString(),10)]),this.movableCount+=this.movablecount,this.movableColumns.push(e[parseInt(i.toString(),10)])):(this.movableCount+=this.movablecount,this.movableColumns.push(e[parseInt(i.toString(),10)])):(this.frozenRightCount+=this.rightcount,this.frozenRightColumns.push(e[parseInt(i.toString(),10)])):(this.frozenLeftCount+=this.leftcount,this.frozenLeftColumns.push(e[parseInt(i.toString(),10)]))}else"Right"===e[parseInt(i.toString(),10)].freeze?(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleFrozenRight++,this.frozenRightColumns.push(e[parseInt(i.toString(),10)]),this.frozenRightCount++):"Left"===e[parseInt(i.toString(),10)].freeze||e[parseInt(i.toString(),10)].isFrozen?(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleFrozenLeft++,this.frozenLeftColumns.push(e[parseInt(i.toString(),10)]),this.frozenLeftCount++):"Fixed"===e[parseInt(i.toString(),10)].freeze?(this.fixedColumns.push(e[parseInt(i.toString(),10)]),this.fixedCount++,this.movableColumns.push(e[parseInt(i.toString(),10)]),this.movableCount++):(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleMovable++,this.movableColumns.push(e[parseInt(i.toString(),10)]),this.movableCount++);if(this.frozenLeftColumns.length){r=this.frozenLeftColumns[this.frozenLeftColumns.length-1];this.removeBorder(this.frozenLeftColumns),this.frozenLeftBorderColumns(r instanceof Pt?this.lastVisibleLeftCol(this.frozenLeftColumns):r)}if(this.frozenRightColumns.length){r=this.frozenRightColumns[0];this.removeBorder(this.frozenRightColumns),this.frozenRightBorderColumns(r instanceof Pt?this.firstVisibleRightCol(this.frozenRightColumns):r)}if((this.frozenLeftColumns.length||this.frozenRightColumns.length)&&this.freezeColumnRefresh){var r=this.frozenLeftColumns.concat(this.movableColumns).concat(this.frozenRightColumns);this.setProperties({columns:r},!0),this.freezeColumnRefresh=!1}},s.prototype.removeBorder=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns&&e[parseInt(t.toString(),10)].columns.length?("Right"!==e[parseInt(t.toString(),10)].border&&"Left"!==e[parseInt(t.toString(),10)].border||(e[parseInt(t.toString(),10)].border=void 0),this.removeBorder(e[parseInt(t.toString(),10)].columns)):"Right"!==e[parseInt(t.toString(),10)].border&&"Left"!==e[parseInt(t.toString(),10)].border||(e[parseInt(t.toString(),10)].border=void 0)},s.prototype.isVisibleColumns=function(e,i){if(e.columns&&e.columns.length)for(var n=0;n<e.columns.length;n++)this.isVisibleColumns(e.columns[parseInt(n.toString(),10)],i),e.columns[parseInt(n.toString(),10)].visible&&t.isNullOrUndefined(e.columns[parseInt(n.toString(),10)].columns)&&(!t.isNullOrUndefined(e.columns[parseInt(n.toString(),10)].freeze)||e.columns[parseInt(n.toString(),10)].isFrozen)&&i.push("true");else!e.visible||t.isNullOrUndefined(e.freeze)&&!e.isFrozen||i.push("true")},s.prototype.lastVisibleLeftCol=function(e){for(var t,i=e.length-1;i>=0;i--){var n=[];if(this.isVisibleColumns(e[parseInt(i.toString(),10)],n),e[parseInt(i.toString(),10)].visible&&-1!==n.indexOf("true")){t=e[parseInt(i.toString(),10)];break}}return t},s.prototype.firstVisibleRightCol=function(e){for(var t,i=0;i<e.length;i++){var n=[];if(this.isVisibleColumns(e[parseInt(i.toString(),10)],n),e[parseInt(i.toString(),10)].visible&&-1!==n.indexOf("true")){t=e[parseInt(i.toString(),10)];break}}return t},s.prototype.frozenLeftBorderColumns=function(e){if(!t.isNullOrUndefined(e))if(e.columns&&e.columns.length){e.border="Left";var i=e.columns[e.columns.length-1];this.frozenLeftBorderColumns(i instanceof Pt&&i.columns?this.lastVisibleLeftCol(e.columns):i)}else e.border="Left"},s.prototype.frozenRightBorderColumns=function(e){if(!t.isNullOrUndefined(e))if(e.columns&&e.columns.length){e.border="Right";var i=e.columns[0];this.frozenRightBorderColumns(i instanceof Pt&&i.columns?this.firstVisibleRightCol(e.columns):i)}else e.border="Right"},s.prototype.getVisibleFrozenColumns=function(){return this.getVisibleFrozenColumnsCount()+this.getVisibleFrozenCount(this.columns,0)},s.prototype.pinRows=function(e){for(var t=this.getPrimaryKeyFieldNames()[0],i=!1,n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)];this.pinnedTopRowKeys[r[""+t]]||(this.pinnedTopRecords.push(r),this.pinnedTopRowKeys[r[""+t]]=!0,i=!0)}i&&this.notify(ni,{requestType:"pin-row"})},s.prototype.unpinRows=function(e){for(var t=this.getPrimaryKeyFieldNames()[0],i=!1,n=this,r=0;r<e.length;r++)!function(r){var s=e[parseInt(r.toString(),10)],o=s[""+t],a=n.pinnedTopRecords.findIndex(function(e){return e[""+t]===o});n.pinnedTopRowKeys[s[""+t]]&&(n.pinnedTopRecords.splice(a,1),n.pinnedTopRowKeys[s[""+t]]=!1,i=!0)}(r);i&&this.notify(ni,{requestType:"unpin-row"})},s.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},s.prototype.getVisibleFrozenColumnsCount=function(){for(var e=0,t=this.columnModel,i=0;i<this.frozenColumns;i++)t[parseInt(i.toString(),10)].visible&&e++;if(this.frozenLeftCount||this.leftcount||this.frozenRightCount||this.rightcount)for(i=0;i<t.length;i++)!t[parseInt(i.toString(),10)].visible||"Left"!==t[parseInt(i.toString(),10)].freeze&&"Right"!==t[parseInt(i.toString(),10)].freeze||e++;return e},s.prototype.getVisibleFrozenCount=function(e,t){if(!(this.frozenLeftCount||this.leftcount||this.frozenRightCount&&this.rightcount))for(var i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?t=this.getVisibleFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&e[parseInt(i.toString(),10)].visible&&t++;return t},s.prototype.getFrozenCount=function(e,i,n){for(var r=0,s=t.isNullOrUndefined(e)?0:e.length;r<s;r++)e[parseInt(r.toString(),10)].columns?i=this.getFrozenCount(e[parseInt(r.toString(),10)].columns,i,n):(e[parseInt(r.toString(),10)].isFrozen&&n>this.frozenColumns-1&&i++,n++);return i},s.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},s.prototype.goToPageAsync=function(e){var t=this;return this.pagerModule?this.executeAsyncOperation("paging",function(){return t.pagerModule.goToPage(e)}):Promise.resolve()},s.prototype.updateExternalMessage=function(e){this.pagerModule&&!this.pagerTemplate&&this.pagerModule.updateExternalMessage(e)},s.prototype.sortColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},s.prototype.executeAsyncOperation=function(e,t){var i=this;return new Promise(function(n,r){var s=function(t){t.requestType===e&&(i.removeEventListener(Ut,s),i.off(Ht,a),i.off(Ti,o),n())},o=function(t){t.requestType===e&&(i.removeEventListener(Ut,s),i.off(Ht,a),i.off(Ti,o),n())},a=function(){i.removeEventListener(Ut,s),i.off(Ht,a),i.off(Ti,o),r()};i.on(Ti,o),i.addEventListener(Ut,s),i.addEventListener(Ht,a),t()})},s.prototype.sortColumnAsync=function(e,t,i){var n=this;return this.sortModule?this.executeAsyncOperation("sorting",function(){return n.sortModule.sortColumn(e,t,i)}):Promise.resolve()},s.prototype.changeDataSource=function(e,i,n){if(this.isChangeDataSourceCall=!0,this.setProperties({sortSettings:{columns:[]}},!0),this.setProperties({filterSettings:{columns:[]}},!0),this.setProperties({searchSettings:{key:""}},!0),this.allowGrouping&&this.setProperties({groupSettings:{columns:[]}},!0),i&&i.length&&this.setProperties({columns:i},!0),e&&(t.isNullOrUndefined(i)&&this.setProperties({columns:[]},!0),this.setProperties({dataSource:e},!0)),n){for(var r=0,s=["dataSource","columns"];r<s.length;r++)delete n[""+s[r]];this.setProperties(n,!0)}this.freezeRefresh(),this.isChangeDataSourceCall=!1},s.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},s.prototype.clearSortingAsync=function(){var e=this;return this.sortModule?this.executeAsyncOperation("sorting",function(){return e.sortModule.clearSorting()}):Promise.resolve()},s.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},s.prototype.clearGridActions=function(){this.setProperties({sortSettings:{columns:[]}},!0),this.setProperties({filterSettings:{columns:[]}},!0),this.setProperties({searchSettings:{key:""}},!0),this.allowGrouping?this.setProperties({groupSettings:{columns:[]}},!1):this.freezeRefresh()},s.prototype.filterByColumn=function(e,t,i,n,r,s,o,a){this.filterModule&&this.filterModule.filterByColumn(e,t,i,n,r,s,o,a)},s.prototype.filterByColumnAsync=function(e,t,i,n,r,s,o,a){var l=this;return this.filterModule?this.executeAsyncOperation("filtering",function(){return l.filterModule.filterByColumn(e,t,i,n,r,s,o,a)}):Promise.resolve()},s.prototype.clearFiltering=function(e){this.filterModule&&this.filterModule.clearFiltering(e)},s.prototype.clearFilteringAsync=function(e){var t=this;return this.filterModule?this.executeAsyncOperation("refresh",function(){return t.filterModule.clearFiltering(e)}):Promise.resolve()},s.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},s.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},s.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},s.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},s.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},s.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},s.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},s.prototype.searchAsync=function(e){var t=this;return this.searchModule?this.executeAsyncOperation("searching",function(){return t.searchModule.search(e)}):Promise.resolve()},s.prototype.print=function(){this.printModule&&this.printModule.print()},s.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},s.prototype.deleteRecordAsync=function(e,i){var n=this;return new Promise(function(r,s){var o=function(e){"delete"===e.requestType&&(n.removeEventListener(Ut,o),n.off(Ti,a),r())},a=function(e){"delete"===e.requestType&&(n.removeEventListener(Ut,o),n.off(Ti,a),r())},l=function(e){"delete"===e.requestType&&(n.removeEventListener(Ut,o),n.off(Ht,l),n.off(Ti,a)),s()};if(n.editModule){n.on(Ti,a),n.addEventListener(Ht,l),n.addEventListener(Ut,o);var d=n.getSelectedRecords();n.editModule.deleteRecord(e,i),(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))&&0===d.length&&(n.removeEventListener(Ut,o),n.off(Ht,l),n.off(Ti,a),r())}else r()})},s.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},s.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},s.prototype.endEditAsync=function(){var e=this;return new Promise(function(t,i){var n=function(i){"save"===i.requestType&&(e.removeEventListener(Ut,n),e.off(Ti,r),e.off(Ht,s),t())},r=function(i){"edit"===i.action&&(e.removeEventListener(Ut,n),e.off(Ti,r),e.off(Ht,s),t())},s=function(){e.removeEventListener(Ut,n),e.off(Ht,s),e.off(Ti,r),i()};e.editModule?(e.on(Ti,r),e.addEventListener(Ht,s),e.addEventListener(Ut,n),e.editModule.endEdit()):t()})},s.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},s.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},s.prototype.addRecordAsync=function(e,t){var i=this;return new Promise(function(n,r){var s=function(e){"add"===e.action&&"save"===e.requestType&&(i.removeEventListener(Ut,s),i.off(Ti,o),n())},o=function(e){"add"===e.action&&(i.removeEventListener(Ut,s),i.off(Ti,o),n())},a=function(){i.removeEventListener(Ut,s),i.off(Ht,a),i.off(Ti,o),r()};i.editModule?(i.on(Ti,o),i.addEventListener(Ht,a),i.addEventListener(Ut,s),i.editModule.addRecord(e,t),e||(i.removeEventListener(Ut,s),i.off(Ht,a),i.off(Ti,o),n())):n()})},s.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},s.prototype.deleteRowAsync=function(e){var t=this;return this.editModule?this.executeAsyncOperation("delete",function(){return t.editModule.deleteRow(e)}):Promise.resolve()},s.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},s.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},s.prototype.updateCell=function(e,t,i){this.editModule&&this.editModule.updateCell(e,t,i)},s.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},s.prototype.updateRowAsync=function(e,t){var i=this;return new Promise(function(n,r){var s=function(e){"save"===e.requestType&&(i.removeEventListener(Ut,s),i.off(Ti,o),i.off(Ht,a),n())},o=function(e){"edit"===e.action&&(i.removeEventListener(Ut,s),i.off(Ti,o),i.off(Ht,a),n())},a=function(){i.removeEventListener(Ut,s),i.off(Ht,a),i.off(Ti,o),r()};i.editModule?(i.on(Ti,o),i.addEventListener(Ht,a),i.addEventListener(Ut,s),i.editModule.updateRow(e,t)):n()})},s.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},s.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},s.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},s.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.e-indentRefreshed")&&this.getContentTable()){var t=this.getHeaderTable().querySelector(".e-emptycell").parentElement.offsetWidth,i=[].slice.call(this.getHeaderTable().querySelector(dn).childNodes),n=[].slice.call(this.getContentTable().querySelector(dn).childNodes),r=t/30,s="Right"===this.getFrozenMode()?this.groupSettings.columns.length+this.getColumns().length:0,o=this.element.offsetWidth,a=function(t,r){if(Ne(e)){var s=(r/o*100).toFixed(1)+"%";i[parseInt(t.toString(),10)].style.width=s,n[parseInt(t.toString(),10)].style.width=s}else i[parseInt(t.toString(),10)].style.width=r+"px",n[parseInt(t.toString(),10)].style.width=r+"px";e.notify("column-width-changed",{index:t,width:r})};for(r>=1&&(t=30/r),t<1&&(t=1),(this.enableColumnVirtualization||this.isAutoGen||this.columns.length===this.groupSettings.columns.length)&&(t=30);s<this.groupSettings.columns.length;)a(s,t),s++;this.isDetail()&&(a(s,t),s++),this.isRowDragable()&&a(s,t),this.isAutoGen=!1,this.getHeaderTable().querySelector(".e-emptycell").classList.add("e-indentRefreshed")}},s.prototype.resetIndentWidth=function(){if(!this.isDestroyed){if(Ne(this)&&(this.getHeaderTable().querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.widthService.setWidthToColumns(),this.recalcIndentWidth(),this.autoFit&&this.preventAdjustColumns()),("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(),!0);this.widthService.setMinwidthBycalculation(e)}this.isFrozenGrid()&&this.enableColumnVirtualization&&this.widthService&&this.widthService.refreshFrozenScrollbar(),this.allowTextWrap&&"Content"!==this.textWrapSettings.wrapMode&&this.notify(Li,{}),(this.frozenRows||this.pinnedTopRowModels.length)&&this.scrollModule&&this.scrollModule.resizeFrozenRowBorder(),this.enableStickyHeader&&this.scrollModule.makeStickyHeader()(),this.enableAutoFill&&"Multiple"===this.selectionSettings.type&&"Cell"===this.selectionSettings.mode&&this.selectionModule.selectedRowCellIndexes.length&&(this.selectionModule.updateAutoFillPosition(),this.selectionModule.drawBorders())}},s.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},s.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},s.prototype.reorderColumnByModel=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByModel(e,t)},s.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},s.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},s.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},s.prototype.refreshDataSource=function(e){this.notify("refreshdataSource",e)},s.prototype.disableRowDD=function(e){var i=this.getHeaderTable(),n=this.getContentTable(),r=i.querySelectorAll("th.e-rowdragheader, th.e-mastercell"),s=this.getRows(),o=e?"none":"";t.setStyleAttribute(i.querySelector(dn).childNodes[0],{display:o}),t.setStyleAttribute(n.querySelector(dn).childNodes[0],{display:o});for(var a=0;a<this.getRows().length;a++){d=s[parseInt(a.toString(),10)].firstElementChild;e?t.addClass([d],"e-hide"):t.removeClass([d],["e-hide"])}for(var l=0;l<i.querySelectorAll("th.e-rowdragheader, th.e-mastercell").length;l++){var d=r[parseInt(l.toString(),10)];e?t.addClass([d],"e-hide"):t.removeClass([d],["e-hide"])}},s.prototype.autoFitColumns=function(e,i,n){var r=this.getInjectedModules().find(function(e){return"function"!=typeof e||t.isNullOrUndefined(e.prototype)?"Resize"===e.name:"resize"===e.prototype.getModuleName()});!this.resizeModule&&r&&(this.autoFitColumnsResize=!0,this.injectModules()),this.resizeModule&&this.resizeModule.autoFitColumns(e,i,n)},s.prototype.preventAdjustColumns=function(){if(!(this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode)){for(var e=this.getColumns(),i=this.getHeaderTable(),n=0,r=0;r<e.length;r++)if(e[parseInt(r.toString(),10)].visible){if(this.groupSettings.columns.length&&this.groupSettings.columns.indexOf(e[parseInt(r.toString(),10)].field)>-1&&"none"===[].slice.call(i.querySelector("colgroup").querySelectorAll(":not(.e-group-intent):not(.e-detail-intent):not(.e-drag-intent)"))[parseInt(r.toString(),10)].style.display)continue;if(!e[parseInt(r.toString(),10)].width){n=0;break}n+=parseFloat(e[parseInt(r.toString(),10)].width.toString())}if(n){var s=this.isPercentageWidthGrid(),o=this.widthUnit(s),a=this.getContentTable();if(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())for(var l=this.defaultIndentWidth(s),d=l.toString()+o,h=[].slice.call(i.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")),p=[].slice.call(a.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")),r=0;r<h.length;r++)h[parseInt(r.toString(),10)].style.setProperty("width",d),p[parseInt(r.toString(),10)].style.setProperty("width",d),n+=l;(s&&n<100||!s&&n<a.parentElement.clientWidth)&&(t.isNullOrUndefined(a.querySelector(".e-emptyrow"))?t.addClass([i,a],["e-tableborder"]):(t.addClass([i],["e-tableborder"]),t.removeClass([a],["e-tableborder"])));var c=n.toString()+o;i.style.setProperty("width",c),a.style.setProperty("width",c)}else this.restoreAdjustColumns()}},s.prototype.restoreAdjustColumns=function(){if(!(this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode)){var e=this.getHeaderTable(),i=this.getContentTable();if(t.removeClass([e,i],["e-tableborder"]),e.style.removeProperty("width"),i.style.removeProperty("width"),this.groupSettings.columns.length||this.isDetail()||this.isRowDragable()){var n=this.isPercentageWidthGrid(),r=this.defaultIndentWidth(n).toString()+this.widthUnit(n);[].slice.call(e.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")).forEach(function(e){e.style.setProperty("width",r)}),e.querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.recalcIndentWidth()}}},s.prototype.widthUnit=function(e){return e?"%":"px"},s.prototype.defaultIndentWidth=function(e){return e?parseFloat((30/this.element.offsetWidth*100).toFixed(1)):30},s.prototype.isPercentageWidthGrid=function(){var e=this.getColumns().find(function(e){return!t.isNullOrUndefined(e.width)});return!!e&&e.width.toString().indexOf("%")>-1},s.prototype.createColumnchooser=function(e,t,i){this.columnChooserModule&&this.columnChooserModule.renderColumnChooser(e,t,i)},s.prototype.initializeServices=function(){this.serviceLocator.register("widthService",this.widthService=new er(this)),this.serviceLocator.register("cellRendererFactory",new Yn),this.serviceLocator.register("rendererFactory",new $n),this.serviceLocator.register("localization",this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale)),this.serviceLocator.register("valueFormatter",this.valueFormatterService=new Ft(this.locale)),this.serviceLocator.register("showHideService",this.showHider=new fr(this)),this.serviceLocator.register("ariaService",this.ariaService=new Dn),this.serviceLocator.register("focus",this.focusModule=new ir(this))},s.prototype.processModel=function(){var e,i,n=this.groupSettings.columns,r=this.sortSettings.columns;if(this.allowGrouping)for(var s=this,o=0,a=n.length;o<a;o++)!function(t,o){e=!1,i=0;for(var a=r.length;i<a;i++)if(r[parseInt(i.toString(),10)].field===n[parseInt(t.toString(),10)]){e=!0;break}if(e?s.allowSorting?s.sortedColumns.push(r[parseInt(i.toString(),10)].field):r[parseInt(i.toString(),10)].direction="Ascending":r.push({field:n[parseInt(t.toString(),10)],direction:"Ascending",isFromGroup:!0}),!s.groupSettings.showGroupedColumn){var l=s.enableColumnVirtualization?s.columns.filter(function(e){return e.field===n[parseInt(t.toString(),10)]})[0]:s.getColumnByField(n[parseInt(t.toString(),10)]);l?l.visible=!1:s.log("initial_action",{moduleName:"group",columnName:n[parseInt(t.toString(),10)]})}}(o);if(!n.length)for(o=0;o<r.length;o++)this.sortedColumns.push(r[parseInt(o.toString(),10)].field);if(this.rowTemplateFn=x(this.rowTemplate),this.emptyRecordTemplateFn=x(this.emptyRecordTemplate),this.detailTemplateFn=x(this.detailTemplate),this.editTemplateFn=x(this.editSettings.template),this.editHeaderTemplateFn=x(this.editSettings.headerTemplate),this.editFooterTemplateFn=x(this.editSettings.footerTemplate),this.columnChooserTemplateFn=x(this.columnChooserSettings.template),this.columnChooserHeaderTemplateFn=x(this.columnChooserSettings.headerTemplate),this.columnChooserFooterTemplateFn=x(this.columnChooserSettings.footerTemplate),!t.isNullOrUndefined(this.parentDetails)){var l=t.isNullOrUndefined(this.parentDetails.parentKeyFieldValue)?"undefined":this.parentDetails.parentKeyFieldValue;this.query.where(this.queryString,"equal",l,!0)}this.initForeignColumn()},s.prototype.initForeignColumn=function(){this.isForeignKeyEnabled(this.getColumns())&&this.notify("initForeignKeyColumn",this.getForeignKeyColumns())},s.prototype.enableVerticalRendering=function(){"Vertical"===this.rowRenderingMode?this.element.classList.add("e-row-responsive"):this.element.classList.remove("e-row-responsive")},s.prototype.gridRender=function(){var i;this.updateRTL(),"Vertical"===this.rowRenderingMode&&this.element.classList.add("e-row-responsive"),this.enableHover&&this.element.classList.add("e-gridhover"),(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||t.Browser.isSafari())&&this.element.classList.add("e-mac-safari"),t.Browser.isDevice&&(this.element.classList.add("e-device"),"Desktop"===this.adaptiveUIMode&&"Vertical"!==this.rowRenderingMode&&(this.enableAdaptiveUI=!1)),"Mobile"!==this.adaptiveUIMode||t.Browser.isDevice||"Vertical"===this.rowRenderingMode||(this.enableAdaptiveUI=!1),this.rowHeight&&this.element.classList.add("e-grid-min-height"),this.cssClass&&(-1!==this.cssClass.indexOf(" ")?(i=this.element.classList).add.apply(i,this.cssClass.split(" ")):this.element.classList.add(this.cssClass)),this.allowRowDragAndDrop&&this.rowDropSettings.targetID&&"mozilla"===t.Browser.info.name&&this.element.classList.add("e-disableuserselect"),this.editSettings.showAddNewRow&&(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.editSettings.newRowPosition="Top"),t.classList(this.element,["e-responsive","e-default"],[]);var n=this.serviceLocator.getService("rendererFactory");this.headerModule=n.getRenderer(e.RenderType.Header),this.contentModule=n.getRenderer(e.RenderType.Content),this.printModule=new Qr(this,this.scrollModule),this.clipboardModule=new wr(this,this.serviceLocator),this.renderModule.render(),this.eventInitializer(),this.createGridPopUpElement(),this.widthService.setWidthToColumns(),this.updateGridLines(),this.applyTextWrap(),this.createTooltip(),this.enableBoxSelection()},s.prototype.dataReady=function(){this.scrollModule.setWidth(),this.scrollModule.setHeight(),"auto"!==this.height&&this.scrollModule.setPadding()},s.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},s.prototype.createGridPopUpElement=function(){var e=this.createElement("div",{className:"e-gridpopup"});e.style.display="none";var i=this.createElement("div",{className:Yi,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)},s.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()},s.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")},s.prototype.applyTextWrap=function(){if(this.allowTextWrap){var e=[].slice.call(this.element.getElementsByClassName("e-columnheader"));switch(this.textWrapSettings.wrapMode){case"Header":Z(this.element,!1),Z(this.getContent(),!1),Z(e,!0);break;case"Content":Z(this.getContent(),!0),Z(this.element,!1),Z(e,!1);break;default:Z(this.element,!0),Z(this.getContent(),!1),Z(e,!1)}"Content"!==this.textWrapSettings.wrapMode&&this.notify(Li,{})}},s.prototype.removeTextWrap=function(){Z(this.element,!1),Z([].slice.call(this.element.getElementsByClassName("e-columnheader")),!1),Z(this.getContent(),!1),"Content"!==this.textWrapSettings.wrapMode&&this.notify(Li,{})},s.prototype.createTooltip=function(){this.toolTipObj=new n.Tooltip({opensOn:"custom",content:"",cssClass:this.cssClass?this.cssClass:null},this.element)},s.prototype.freezeRefresh=function(){(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.pageSettings.currentPage=1),this.componentRefresh()},s.prototype.getTooltipStatus=function(e){var t=this.getHeaderTable(),i=this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode?"e-gridcontent":"e-gridheader",n=this.createTable(t,i,"header"),r=this.createTable(t,i,"content"),s=e.classList.contains("e-headercell")?n:r,o=e.classList.contains("e-headercell")?"th":"tr";s.querySelector(o).className=e.className;var a=s.querySelector(o);a.innerHTML="",Array.from(e.childNodes).forEach(function(e){a.appendChild(e.cloneNode(!0))});var l=s.querySelector(o).getBoundingClientRect().width;return document.body.removeChild(n),document.body.removeChild(r),!!(l>e.getBoundingClientRect().width&&!e.classList.contains("e-editedbatchcell")||this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode&&l>.55*e.getBoundingClientRect().width-("auto"!==this.height?16:0))},s.prototype.mouseMoveHandler=function(e){if(this.isEllipsisTooltip()){var i=F(e.target,"e-ellipsistooltip");"mouseout"!==e.type||this.prevElement===i&&i===F(e.relatedTarget,"e-ellipsistooltip")||(this.toolTipObj.close(),this.toolTipObj.clear(),this.prevElement=null);var n=e.target.tagName,r=["A","BUTTON","INPUT"];if(i&&"mouseout"!==e.type&&(!t.Browser.isDevice||-1===r.indexOf(n))&&this.getTooltipStatus(i)){var s=this.getColumns()[parseInt(i.getAttribute(on),10)-1],o=s&&s.disableHtmlEncode?"innerText":"innerHTML",a=this.createElement("div");if(i.getElementsByClassName("e-headertext").length){var l=i.getElementsByClassName("e-headertext")[0];a[""+o]=this.sanitize(l.innerText),this.toolTipObj.content=a}else a[""+o]=this.sanitize(i.innerText),this.toolTipObj.content=a;this.enableHtmlSanitizer&&(this.toolTipObj.enableHtmlSanitizer=!0),s&&s.disableHtmlEncode&&(this.toolTipObj.enableHtmlParse=!1),i!==this.prevElement&&this.toolTipObj.open(i),this.prevElement=i}}},s.prototype.isEllipsisTooltip=function(){var e=this.getColumns();if("EllipsisWithTooltip"===this.clipMode)return!0;for(var t=0;t<e.length;t++)if("EllipsisWithTooltip"===e[parseInt(t.toString(),10)].clipMode)return!0;return!1},s.prototype.scrollHandler=function(){this.isEllipsisTooltip()&&this.toolTipObj.close()},s.prototype.createTable=function(e,t,i){var n=this.createElement("div");n.className=this.element.className,n.style.cssText="display: inline-block;visibility:hidden;position:absolute";var r=this.createElement("div");r.className=t;var s=this.createElement("table");s.className=e.className,s.style.cssText="table-layout: auto;width: auto";var o="header"===i?"th":"td",a=this.createElement("tr",{attrs:{role:"row"}}),l=this.createElement(o);return a.appendChild(l),s.appendChild(a),r.appendChild(s),n.appendChild(r),document.body.appendChild(n),n},s.prototype.onKeyPressed=function(e){"tab"!==e.action&&"shiftTab"!==e.action||this.toolTipObj.close()},s.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,"mouseover",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)},s.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,"mouseover",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)},s.prototype.addListener=function(){this.isDestroyed||(this.on(Zt,this.dataReady,this),this.on($t,this.recalcIndentWidth,this),this.on(si,this.recalcIndentWidth,this),this.on("refresh-Frozen-Position",this.refreshFrozenPosition,this),this.on("refresh-Split-Frozen-Column",this.refreshSplitFrozenColumn,this),this.dataBoundFunction=this.refreshMediaCol.bind(this),this.addEventListener(jt,this.dataBoundFunction),this.on(di,this.onKeyPressed,this))},s.prototype.removeListener=function(){this.isDestroyed||(this.off(Zt,this.dataReady),this.off($t,this.recalcIndentWidth),this.off(si,this.recalcIndentWidth),this.on("refresh-Frozen-Position",this.refreshFrozenPosition,this),this.on("refresh-Split-Frozen-Column",this.refreshSplitFrozenColumn,this),this.removeEventListener(jt,this.dataBoundFunction),this.off(di,this.onKeyPressed))},s.prototype.getCurrentViewRecords=function(){return ge(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},s.prototype.mouseClickHandler=function(e){if(!(this.isChildGrid(e)||F(e.target,"e-gridpopup")&&e.touches||this.element.getElementsByClassName("e-cloneproperties").length||this.checkEdit(e))&&(!(!this.allowRowDragAndDrop&&(F(e.target,Wi)||"TD"===e.target.tagName)||F(e.target,"e-headercell")&&F(e.target,"e-headercell").querySelector(".e-checkselectall")||!this.allowGrouping&&!this.allowReordering&&F(e.target,"e-gridheader"))||!e.touches)&&(F(e.target,"e-gridheader")&&this.allowRowDragAndDrop&&!F(e.target,"e-filterbarcell")&&e.target&&-1===["A","BUTTON","INPUT"].indexOf(e.target.tagName)&&e.preventDefault(),!this.allowRowDragAndDrop||!F(e.target,"e-rowcell")||F(e.target,"e-rowdragdrop")||!e.touches)){var i=this.getRowInfo(e.target);i.event=e;i.cancel=!1;var n=!1,r=t.closest(e.target,"tr");if(r&&r.getAttribute("data-uid")){var s=this.getRowObjectFromUID(r.getAttribute("data-uid"));n=!!s&&s.isDataRow}n&&this.trigger("recordClick",i),this.notify(hi,e)}},s.prototype.checkEdit=function(e){var t=F(e.target,Zi),i="Batch"!==this.editSettings.mode&&this.isEdit&&t&&(t.classList.contains(en)||t.classList.contains(tn)&&!this.editSettings.showAddNewRow);return!F(e.target,"e-unboundcelldiv")&&(i||F(e.target,_i)&&F(e.target,_i).classList.contains("e-editedbatchcell"))},s.prototype.dblClickHandler=function(e){var i=F(e.target,"e-grid");if(!t.isNullOrUndefined(i)&&i.id===this.element.id&&!t.closest(e.target,".e-unboundcelldiv")){var n=!1,r=t.closest(e.target,"tr");if(r&&r.getAttribute("data-uid")){var s=this.getRowObjectFromUID(r.getAttribute("data-uid"));n=!!s&&s.isDataRow}var o=this.getRowInfo(e.target);o.target=e.target,o.event=e,n&&this.trigger("recordDoubleClick",o),this.notify("dblclick",e)}},s.prototype.focusOutHandler=function(e){if(!this.isChildGrid(e)){F(e.target,"e-grid")||(this.element.querySelector(".e-gridpopup").style.display="None");var i=this.element.querySelector(".e-cancel:not(.e-hide)");i&&!i.parentElement.classList.contains("e-tbar-btn")&&i.classList.add("e-hide");var n=e.relatedTarget,r=n?n.getAttribute("aria-owns"):null;n&&(F(n,"e-grid")||(!t.isNullOrUndefined(r)&&r)===e.target.getAttribute("aria-owns"))||this.keyPress||!this.isEdit||t.Browser.isDevice||("Batch"!==this.editSettings.mode||(F(n,"e-ddl")||F(n,"e-ddt"))&&(F(n,"e-multi-select-list-wrapper")||F(n,"e-input-filter"))&&F(n,"e-input-group")||!F(n,"e-uploader")&&(n&&t.isNullOrUndefined(F(n,"e-input-group"))||F(e.target,"edit-custom-template"))||(this.editModule.saveCell(),this.notify("editNextValCell",{})),"Normal"!==this.editSettings.mode||this.isWidgetsDestroyed||this.editModule.editFormValidate()),this.editSettings.showAddNewRow&&(this.editModule.isShowAddedRowValidate=!1),this.keyPress=!1}},s.prototype.isChildGrid=function(e){var i=F(e.target,"e-grid");return!!(i&&i.id!==this.element.id||F(e.target,"e-unboundcelldiv")&&t.isNullOrUndefined(i))},s.prototype.mergePersistGridData=function(e){var i=this.getLocalData();if(!t.isNullOrUndefined(i)&&""!==i||!t.isNullOrUndefined(e)){var n=t.isNullOrUndefined(e)?JSON.parse(i):e,r=Object.keys(n);this.isProtectedOnChange=!0;for(var s=0,o=r;s<o.length;s++){var a=o[s];"object"!=typeof this[""+a]||t.isNullOrUndefined(this[""+a])?this[""+a]=n[""+a]:Array.isArray(this[""+a])&&"columns"===a?(this.setFrozenCount(),T(this[""+a]),this.mergeColumns(n[""+a],this[""+a]),this.mergedColumns=!0,this[""+a]=n[""+a]):t.extend(this[""+a],n[""+a])}this.isProtectedOnChange=!1}},s.prototype.mergeColumns=function(e,i){for(var n=e,r=this.isFrozenGrid(),s=this,o=0;o<n.length;o++)!function(e){var o=i.filter(function(t){return r?t.index===n[parseInt(e.toString(),10)].initialFrozenColumnIndex:t.index===n[parseInt(e.toString(),10)].index})[0];t.isNullOrUndefined(o)||(r&&((o=t.extend({},o,{},!0)).freeze=n[parseInt(e.toString(),10)].freeze),o.columns&&o.columns.length?(s.mergeColumns(n[parseInt(e.toString(),10)].columns,o.columns),n[parseInt(e.toString(),10)]=t.extend(o,n[parseInt(e.toString(),10)],{},!0)):n[parseInt(e.toString(),10)]=t.extend(o,n[parseInt(e.toString(),10)],{},!0))}(o)},s.prototype.isDetail=function(){return!t.isNullOrUndefined(this.detailTemplate)||!t.isNullOrUndefined(this.childGrid)},s.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},s.prototype.isForeignKeyEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isForeignKeyEnabled(e.columns):!(!e.dataSource||!e.foreignKeyValue)})},s.prototype.keyPressHandler=function(e){var i=t.extend(e,{cancel:!1});this.trigger("keyPressed",i),(!0===i.cancel||this.isEdit&&e&&F(e.target,"e-gridform")&&F(e.target,"e-ddl")&&"open"===e.action&&!0===e.altKey&&"ArrowDown"===e.code)&&e.stopImmediatePropagation()},s.prototype.keyDownHandler=function(e){if(e.altKey){if(74===e.keyCode&&(this.keyA?(this.notify("group-collapse",{target:e.target,collapse:!1}),this.keyA=!1):(this.focusModule&&this.focusModule.currentInfo&&this.focusModule.currentInfo.element&&(t.removeClass([this.focusModule.currentInfo.element,this.focusModule.currentInfo.elementToFocus],["e-focused","e-focus"]),this.focusModule.currentInfo.element.tabIndex=-1),this.element.classList.contains("e-childgrid")||this.element.focus())),87===e.keyCode){var i=this.focusModule;if(i){if(!this.currentViewData.length)return;0!==this.element.getBoundingClientRect().width&&i.focusContent(),i.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)},s.prototype.keyActionHandler=function(e){this.isChildGrid(e)||this.editModule&&(this.editModule.alertDObj&&this.editModule.alertDObj.visible||this.editModule.dialogObj&&this.editModule.dialogObj.visible)||this.isEdit&&(!this.editSettings.showAddNewRow||this.editSettings.showAddNewRow&&this.element.querySelector(en))&&"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(di,e)):"enter"===e.action&&this.editModule&&"Batch"===this.editSettings.mode&&this.isEdit&&F(e.target,"e-editedbatchcell")&&e.preventDefault())},s.prototype.setInjectedModules=function(e){this.injectedModules=e},s.prototype.updateColumnObject=function(){E(this.columns,this.enableColumnVirtualization,this),T(this.columns),this.initForeignColumn(),this.notify(Ci,{})},s.prototype.refreshFrozenPosition=function(e){e&&e.isModeChg?(this.refreshColumns(),this.notify("refresh-Resize-Position",{})):this.refreshColumns()},s.prototype.getForeignKeyColumns=function(){return(this.enableColumnVirtualization?this.columns:this.getColumns()).filter(function(e){return e instanceof Pt&&e.isForeignColumn()})},s.prototype.getRowHeight=function(e){return this.rowHeight?this.rowHeight:V(this.element,e)},s.prototype.refreshColumns=function(){if(this.freezeColumnRefresh=!0,this.setFrozenCount(),this.updateFrozenColumnsWidth(),this.isFrozenGrid()&&(this.isPreventScrollEvent=!0),this.updateColumnObject(),this.checkLockColumns(this.getColumns()),this.refresh(),this.isFrozenGrid()&&this.enableColumnVirtualization){var e=this.getContent().querySelector(".e-movablescrollbar").scrollLeft;this.getHeaderContent().querySelector("."+Xi).scrollLeft=e,this.getContent().querySelector("."+Yi).scrollLeft=e}},s.prototype.excelExport=function(e,t,i,n){if(this.exportGrids&&this.exportGrids.length){var r=this.exportGrids.slice();return this.exportMultipleExcelGrids(r,e,t,i,n)}return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!1,n):null},s.prototype.csvExport=function(e,t,i,n){return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!0,n):null},s.prototype.pdfExport=function(e,t,i,n){if(this.exportGrids&&this.exportGrids.length){var r=this.exportGrids.slice();return this.exportMultiplePdfGrids(r,e,t,i,n)}return this.pdfExportModule?this.pdfExportModule.Map(this,e,t,i,n):null},s.prototype.exportMultiplePdfGrids=function(e,t,i,n,r){var s=this;if(0!==e.length){var o=e.shift(),a=document.getElementById(o).ej2_instances[0];return(a.pdfExportModule?a.pdfExportModule.Map(a,t,i,n,r):Promise.resolve()).then(function(n){return i=1!==e.length,s.exportMultiplePdfGrids(e,t,i,n,r)})}return null},s.prototype.exportMultipleExcelGrids=function(e,t,i,n,r){var s=this;if(0!==e.length){var o=e.shift(),a=document.getElementById(o).ej2_instances[0];return(a.excelExportModule?a.excelExportModule.Map(a,t,i,n,!1,r):null).then(function(n){return i=1!==e.length,s.exportMultipleExcelGrids(e,t,i,n,r)})}return null},s.prototype.groupColumn=function(e){this.groupModule&&this.groupModule.groupColumn(e)},s.prototype.groupColumnAsync=function(e){var t=this;return this.groupModule?this.executeAsyncOperation("grouping",function(){return t.groupModule.groupColumn(e)}):Promise.resolve()},s.prototype.groupExpandAll=function(){this.groupModule&&this.groupModule.expandAll()},s.prototype.groupCollapseAll=function(){this.groupModule&&this.groupModule.collapseAll()},s.prototype.clearGrouping=function(){this.groupModule&&this.groupModule.clearGrouping()},s.prototype.clearGroupingAsync=function(){var e=this;return this.groupModule?this.executeAsyncOperation("ungrouping",function(){return e.groupModule.clearGrouping()}):Promise.resolve()},s.prototype.ungroupColumn=function(e){this.groupModule&&this.groupModule.ungroupColumn(e)},s.prototype.ungroupColumnAsync=function(e){var t=this;return this.groupModule?this.executeAsyncOperation("ungrouping",function(){return t.groupModule.ungroupColumn(e)}):Promise.resolve()},s.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},s.prototype.scrollRefresh=function(){var e=this,t=function(){e.scrollModule.refresh(),e.off($t,t)};this.on($t,t,this)},s.prototype.detailCollapseAll=function(){this.detailRowModule&&this.detailRowModule.collapseAll()},s.prototype.detailExpandAll=function(){this.detailRowModule&&this.detailRowModule.expandAll()},s.prototype.clearCellSelection=function(){this.selectionModule&&this.selectionModule.clearCellSelection()},s.prototype.clearRowSelection=function(){this.selectionModule&&this.selectionModule.clearRowSelection()},s.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},s.prototype.selectRowsByRange=function(e,t){this.selectionModule&&this.selectionModule.selectRowsByRange(e,t)},s.prototype.isContextMenuOpen=function(){return this.contextMenuModule&&this.contextMenuModule.isOpen},s.prototype.ensureModuleInjected=function(e){return this.getInjectedModules().indexOf(e)>=0},s.prototype.destroyTemplate=function(e,t,i){this.clearTemplate(e,t,i)},s.prototype.log=function(e,t){this.getInjectedModules().find(function(e){return"Logger"===e.name})||(o.Inject(Tr),this.enableLogger=!0,this.injectModules()),this.loggerModule&&this.loggerModule.log(e,t)},s.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},s.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},s.prototype.hideScroll=function(){var e=this.getContent().querySelector("."+Yi);e.scrollHeight<=e.clientHeight&&(this.scrollModule.removePadding(),e.style.overflowY="auto")},s.prototype.getRowIndexByPrimaryKey=function(e){var t=this.getPrimaryKeyFieldNames()[0];e="object"==typeof e?e[""+t]:e;for(var i=this.getRowsObject(),n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].isDetailRow&&!i[parseInt(n.toString(),10)].isCaptionRow){var r=i[parseInt(n.toString(),10)].data[""+t];if(t.split(".").length>1&&(r=st(t,i[parseInt(n.toString(),10)].data)),r===e)return i[parseInt(n.toString(),10)].index}return-1},s.prototype.getPinnedRowObjectByKey=function(e){var t=this.getPrimaryKeyFieldNames()[0];e="object"==typeof e?e[""+t]:e;for(var i=this.pinnedTopRowModels,n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].isDetailRow&&!i[parseInt(n.toString(),10)].isCaptionRow){var r=i[parseInt(n.toString(),10)].data[""+t];if(t.split(".").length>1&&(r=st(t,i[parseInt(n.toString(),10)].data)),r===e)return i[parseInt(n.toString(),10)]}return null},s.prototype.grabColumnByFieldFromAllCols=function(e,t){var i;this.columnModel=[],this.updateColumnModel(this.columns);for(var n=this.columnModel,r=0;r<n.length;r++)if(!t&&e===n[parseInt(r.toString(),10)].field||t&&n[parseInt(r.toString(),10)].isForeignColumn()&&e===n[parseInt(r.toString(),10)].foreignKeyValue){i=n[parseInt(r.toString(),10)];break}return i},s.prototype.grabColumnByUidFromAllCols=function(e){var t;this.columnModel=[],this.updateColumnModel(this.columns);for(var i=this.columnModel,n=0;n<i.length;n++)e===i[parseInt(n.toString(),10)].uid&&(t=i[parseInt(n.toString(),10)]);return t},s.prototype.getFilteredRecords=function(){if(this.allowFiltering&&this.filterSettings.columns.length||this.searchSettings.key.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[]},s.prototype.getUserAgent=function(){var e=t.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad|macintosh/.test(e)},s.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))},s.prototype.getRowUid=function(e){return""+e+this.rowUid++},s.prototype.getRowElementByUID=function(e){for(var t,i=[],n=[].slice.call(this.getContent().querySelector(ln).children),r=0,s=i=this.frozenRows||this.pinnedTopRowModels.length?(i=[].slice.call(this.getHeaderContent().querySelector(ln).children)).concat(n):n;r<s.length;r++){var o=s[r];if(o.getAttribute("data-uid")===e){t=o;break}}return t},s.prototype.getHiddenColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var n=i[t];!1===n.visible&&e.push(n)}return e},s.prototype.calculatePageSizeByParentHeight=function(e){if(this.allowPaging&&(this.allowTextWrap&&"Header"===this.textWrapSettings.wrapMode||!this.allowTextWrap)){var t=0;if("string"==typeof e&&-1!==e.indexOf("%")&&(e=parseInt(e,10)/100*this.element.clientHeight),e>this.getNoncontentHeight()+this.getRowHeight()){t=(e-this.getNoncontentHeight())/this.getRowHeight()}if(t>0)return Math.floor(t)}return 0},s.prototype.getNoncontentHeight=function(){var e=0;if(this.getHeaderContent()&&!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.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.getElementsByClassName("e-summaryrow").length;i++)e+=this.element.getElementsByClassName("e-summaryrow")[parseInt(i.toString(),10)].clientHeight;return e},s.prototype.getSummaryValues=function(e,t){return i.DataUtil.aggregates[e.type.toLowerCase()](t,e.field)},s.prototype.serverExcelExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},s.prototype.serverPdfExport=function(e,t){this.isExcel=!1,this.exportGrid(e,t)},s.prototype.serverCsvExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},s.prototype.exportGrid=function(e,t){var n=this,r=this.getDataModule().generateQuery(!0),s=(new i.UrlAdaptor).processQuery(new i.DataManager({url:""}),r),o=JSON.parse(s.data),a=JSON.parse(this.addOnPersist(["allowGrouping","allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","groupSettings","columns","locale","searchSettings"])),l=["field","headerText","type","format","visible","foreignKeyValue","foreignKeyField","template","index","width","textAlign","headerTextAlign","columns"];a.filterSettings.columns=o.where,a.searchSettings.fields=o.search&&o.search[0].fields||[],a.sortSettings.columns=o.sorted,a.columns=this.setHeaderText(a.columns,l);var d=this.createElement("form",{id:"ExportForm"});d.style.display="none";var h=this.createElement("input",{id:"gridInput",attrs:{name:"gridModel"}});h.value=JSON.stringify(a),d.method="POST",d.action=e,d.appendChild(h),t&&t.headers&&Array.isArray(t.headers)&&t.headers.forEach(function(e){Object.keys(e).forEach(function(t){var i="string"==typeof e[""+t]?e[""+t]:JSON.stringify(e[""+t]),r=n.createElement("input",{attrs:{name:t,value:i,type:"hidden"}});d.appendChild(r)})}),document.body.appendChild(d),d.submit(),d.remove()},s.prototype.setHeaderText=function(e,i){for(var n=0;n<e.length;n++){var r=this.getColumnByUid(e[parseInt(n.toString(),10)].uid);e[parseInt(n.toString(),10)].headerText=r.headerText,t.isNullOrUndefined(r.template)||(e[parseInt(n.toString(),10)].template="true"),e[parseInt(n.toString(),10)].format&&(e[parseInt(n.toString(),10)].format=nt(this.getFormat(e[parseInt(n.toString(),10)].format),e[parseInt(n.toString(),10)].type,!1,t.defaultCurrencyCode),"datetime"!==r.type&&"date"!==r.type&&"time"!==r.type||(e[parseInt(n.toString(),10)].format=e[parseInt(n.toString(),10)].format.toString().replace("AM/PM","tt"))),e[parseInt(n.toString(),10)].columns&&this.setHeaderText(e[parseInt(n.toString(),10)].columns,i);for(var s=Object.keys(e[parseInt(n.toString(),10)]),o=0;o<s.length;o++)i.indexOf(s[parseInt(o.toString(),10)])<0&&delete e[parseInt(n.toString(),10)][s[parseInt(o.toString(),10)]]}return e},s.prototype.getFormat=function(e){return"object"==typeof e?t.isNullOrUndefined(e.format)?e.skeleton:e.format:e},s.prototype.isCollapseStateEnabled=function(){return!1===this.isExpanded},s.prototype.updateRowValue=function(e,t){var i={requestType:"save",data:t};this.showSpinner(),this.notify(wi,i),this.refresh()},s.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())},s.prototype.resetFilterDlgPosition=function(e){var t=this.getColumnHeaderByField(e);if(t){var i=t.querySelector(".e-filtermenudiv"),n=this.element.querySelector(".e-filter-popup");if(i){var r=this.element.getBoundingClientRect(),s=i.getBoundingClientRect();n&&(n.offsetWidth+s.right>r.right?n.style.left=(s.right-n.offsetWidth-r.left).toString()+"px":n.style.left=(s.right-r.left).toString()+"px")}}},s.prototype.renderTemplates=function(e){var t=this.parentDetails&&this.parentDetails.parentInstObj&&this.parentDetails.parentInstObj.isReact,i=this.printGridParent&&this.printGridParent.isReact;if((t||i)&&this.portals){var n=i?this.printGridParent:this.parentDetails.parentInstObj;n.portals=n.portals.concat(this.portals),n.renderTemplates(e),this.portals=void 0}else{this.notify("reactTemplateRender",this.portals),this.renderReactTemplates(e)}},s.prototype.batchUpdate=function(e){this.processRowChanges(e)},s.prototype.batchAsyncUpdate=function(e){this.processBulkRowChanges(e)},s.prototype.processBulkRowChanges=function(e){var t=this;if(this.dataToBeUpdated)for(var i=["addedRecords","changedRecords","deletedRecords"],n=this.getPrimaryKeyFieldNames()[0],r=0;r<i.length;r++)e[i[parseInt(r.toString(),10)]]&&Ue(this,e,i[parseInt(r.toString(),10)],n);else this.dataToBeUpdated=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e),setTimeout(function(){t.processRowChanges(t.dataToBeUpdated),t.dataToBeUpdated=null},this.asyncTimeOut)},s.prototype.processRowChanges=function(e){var t=this,i=this.getPrimaryKeyFieldNames()[0];e=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e);var n=this.getDataModule().saveChanges(e,i,{},this.getDataModule().generateQuery().requiresCount());this.getDataModule().isRemote()?n.then(function(){t.setNewData()}):this.setNewData()},s.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)})},s.prototype.deleteRowElement=function(e){var i=this.getRowElementByUID(e.uid);t.remove(i)},s.prototype.bulkRefresh=function(e,t,i){for(var n,r=this,s=this.getRowsObject(),o=this.getPrimaryKeyFieldNames()[0],a=this,l=0;l<s.length;l++)!function(t){e.filter(function(e){return e[""+o]===s[parseInt(t.toString(),10)].data[""+o]}).length||(a.deleteRowElement(s[parseInt(t.toString(),10)]),s.splice(t,1),t--),n=t}(l),l=n;for(var d=this,l=0;l<e.length;l++)!function(i){var n;t.filter(function(t){t[""+o]===e[parseInt(i.toString(),10)][""+o]&&(t!==e[parseInt(i.toString(),10)]&&r.setRowData(e[parseInt(i.toString(),10)][""+o],e[parseInt(i.toString(),10)]),n=!0)}),n||d.renderRowElement(e[parseInt(i.toString(),10)],i)}(l);this.currentViewData=e;var h=[].slice.call(this.getContentTable().getElementsByClassName(Zi));Be(this,this.getRowsObject(),h),He(this),this.allowPaging&&this.notify(ii,{module:"pager",properties:{totalRecordsCount:i}})},s.prototype.renderRowElement=function(e,t){var i=new fn(this.serviceLocator,null,this),n=new mn(this).generateRows([e]),r=i.render(n[0],this.getColumns());this.addRowObject(n[0],t);var s=this.getContentTable().querySelector(ln);if(s.querySelector(".e-emptyrow")){var o=s.querySelector(".e-emptyrow");o.parentNode.removeChild(o),this.frozenRows&&this.element.querySelector(".e-frozenrow-empty")&&this.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty")}s=this.frozenRows&&t<this.frozenRows?this.getHeaderContent().querySelector(ln):this.getContent().querySelector(ln),(s=this.getContent().querySelector(ln)).appendChild(r)},s.prototype.addRowObject=function(e,t){this.getRowsObject().splice(t,1,e)},s.prototype.updateVisibleExpandCollapseRows=function(){for(var e=this.getRowsObject(),t=0,i=e.length;t<i;t++)(e[parseInt(t.toString(),10)].isDataRow||e[parseInt(t.toString(),10)].isAggregateRow)&&this.getRowElementByUID(e[parseInt(t.toString(),10)].uid)&&"none"===this.getRowElementByUID(e[parseInt(t.toString(),10)].uid).style.display?e[parseInt(t.toString(),10)].visible=!1:e[parseInt(t.toString(),10)].visible=!0},s.prototype.sanitize=function(e){return this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e},s.prototype.getHeight=function(e){return e=Number.isInteger(e)||-1===e.indexOf("%")?Number.isInteger(e)||"auto"===this.height?this.height:parseInt(e,10):parseInt(e,10)/100*this.element.clientHeight},s.prototype.getFrozenRightContent=function(){return this.contentModule.getPanel()},s.prototype.getFrozenRightHeader=function(){return this.headerModule.getPanel()},s.prototype.getMovableHeaderTbody=function(){return this.getHeaderContent().querySelector(ln)},s.prototype.getMovableContentTbody=function(){return this.getContent().querySelector(ln)},s.prototype.getFrozenHeaderTbody=function(){return this.getHeaderContent().querySelector(ln)},s.prototype.getFrozenLeftContentTbody=function(){return this.getContent().querySelector(ln)},s.prototype.getFrozenRightHeaderTbody=function(){return this.getHeaderContent().querySelector(ln)},s.prototype.getFrozenRightContentTbody=function(){return this.getContent().querySelector(ln)},s.prototype.showResponsiveCustomFilter=function(e){this.filterModule&&this.filterModule.showCustomFilter(e||"Vertical"===this.rowRenderingMode)},s.prototype.showResponsiveCustomSort=function(e){this.sortModule&&this.sortModule.showCustomSort(e||"Vertical"===this.rowRenderingMode)},s.prototype.showResponsiveCustomColumnChooser=function(e){this.columnChooserModule&&this.columnChooserModule.showCustomColumnChooser(e||"Vertical"===this.rowRenderingMode)},s.prototype.showAdaptiveFilterDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomFilter(!0)},s.prototype.showAdaptiveSortDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomSort(!0)},s.prototype.getCurrentVisibleColumns=function(e){for(var t=[],i=0,n=e?this.getColumns():this.columnModel;i<n.length;i++){var r=n[i];r.visible&&t.push(r)}return t},s.prototype.enableInfiniteAggrgate=function(){this.enableInfiniteScrolling&&this.groupSettings.columns.length&&!this.groupSettings.disablePageWiseAggregates&&!this.groupSettings.enableLazyLoading&&this.setProperties({groupSettings:{disablePageWiseAggregates:!0}},!0)};var o;return Mr([t.Property([])],s.prototype,"currentViewData",void 0),Mr([t.Property()],s.prototype,"parentDetails",void 0),Mr([t.Property()],s.prototype,"showHider",void 0),Mr([t.Property([])],s.prototype,"columns",void 0),Mr([t.Property(!0)],s.prototype,"enableAltRow",void 0),Mr([t.Property(!0)],s.prototype,"enableHover",void 0),Mr([t.Property(!1)],s.prototype,"enableAutoFill",void 0),Mr([t.Property(!0)],s.prototype,"allowKeyboard",void 0),Mr([t.Property(!1)],s.prototype,"enableStickyHeader",void 0),Mr([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),Mr([t.Property(!1)],s.prototype,"allowTextWrap",void 0),Mr([t.Complex({},jr)],s.prototype,"textWrapSettings",void 0),Mr([t.Complex({},Vr)],s.prototype,"resizeSettings",void 0),Mr([t.Property(!1)],s.prototype,"allowPaging",void 0),Mr([t.Complex({},dr)],s.prototype,"pageSettings",void 0),Mr([t.Complex({},Kr)],s.prototype,"loadingIndicator",void 0),Mr([t.Property(!0)],s.prototype,"enableVirtualMaskRow",void 0),Mr([t.Property(!1)],s.prototype,"enableVirtualization",void 0),Mr([t.Property(!1)],s.prototype,"enableColumnVirtualization",void 0),Mr([t.Property(!1)],s.prototype,"enableInfiniteScrolling",void 0),Mr([t.Complex({},Ur)],s.prototype,"searchSettings",void 0),Mr([t.Property(!1)],s.prototype,"allowSorting",void 0),Mr([t.Property("Ellipsis")],s.prototype,"clipMode",void 0),Mr([t.Property(!0)],s.prototype,"allowMultiSorting",void 0),Mr([t.Property(!1)],s.prototype,"allowExcelExport",void 0),Mr([t.Property(!1)],s.prototype,"allowPdfExport",void 0),Mr([t.Complex({},Pr)],s.prototype,"sortSettings",void 0),Mr([t.Complex({},Br)],s.prototype,"infiniteScrollSettings",void 0),Mr([t.Property(!0)],s.prototype,"allowSelection",void 0),Mr([t.Property(-1)],s.prototype,"selectedRowIndex",void 0),Mr([t.Complex({},qr)],s.prototype,"selectionSettings",void 0),Mr([t.Property(!1)],s.prototype,"allowFiltering",void 0),Mr([t.Property("Horizontal")],s.prototype,"rowRenderingMode",void 0),Mr([t.Property(!1)],s.prototype,"enableAdaptiveUI",void 0),Mr([t.Property("Both")],s.prototype,"adaptiveUIMode",void 0),Mr([t.Property(!1)],s.prototype,"allowReordering",void 0),Mr([t.Property(!1)],s.prototype,"enableRowSpan",void 0),Mr([t.Property(!1)],s.prototype,"enableColumnSpan",void 0),Mr([t.Property(!1)],s.prototype,"allowResizing",void 0),Mr([t.Property(!1)],s.prototype,"allowRowDragAndDrop",void 0),Mr([t.Complex({},Hr)],s.prototype,"rowDropSettings",void 0),Mr([t.Complex({},zr)],s.prototype,"filterSettings",void 0),Mr([t.Property(!1)],s.prototype,"allowGrouping",void 0),Mr([t.Property(!1)],s.prototype,"enableImmutableMode",void 0),Mr([t.Property(!1)],s.prototype,"showColumnMenu",void 0),Mr([t.Property(!1)],s.prototype,"autoFit",void 0),Mr([t.Complex({},Gr)],s.prototype,"groupSettings",void 0),Mr([t.Complex({},_r)],s.prototype,"editSettings",void 0),Mr([t.Collection([],Cr)],s.prototype,"aggregates",void 0),Mr([t.Property(!1)],s.prototype,"showColumnChooser",void 0),Mr([t.Complex({},cr)],s.prototype,"columnChooserSettings",void 0),Mr([t.Property(!0)],s.prototype,"enableHeaderFocus",void 0),Mr([t.Property("auto")],s.prototype,"height",void 0),Mr([t.Property("auto")],s.prototype,"width",void 0),Mr([t.Property("Default")],s.prototype,"gridLines",void 0),Mr([t.Property()],s.prototype,"rowTemplate",void 0),Mr([t.Property()],s.prototype,"emptyRecordTemplate",void 0),Mr([t.Property()],s.prototype,"detailTemplate",void 0),Mr([t.Property()],s.prototype,"childGrid",void 0),Mr([t.Property()],s.prototype,"queryString",void 0),Mr([t.Property("AllPages")],s.prototype,"printMode",void 0),Mr([t.Property("Expanded")],s.prototype,"hierarchyPrintMode",void 0),Mr([t.Property([])],s.prototype,"dataSource",void 0),Mr([t.Property(null)],s.prototype,"rowHeight",void 0),Mr([t.Property()],s.prototype,"query",void 0),Mr([t.Property("USD")],s.prototype,"currencyCode",void 0),Mr([t.Property()],s.prototype,"exportGrids",void 0),Mr([t.Property()],s.prototype,"toolbar",void 0),Mr([t.Property()],s.prototype,"contextMenuItems",void 0),Mr([t.Property()],s.prototype,"columnMenuItems",void 0),Mr([t.Property()],s.prototype,"toolbarTemplate",void 0),Mr([t.Property()],s.prototype,"pagerTemplate",void 0),Mr([t.Property(0)],s.prototype,"frozenRows",void 0),Mr([t.Property(0)],s.prototype,"frozenColumns",void 0),Mr([t.Property("")],s.prototype,"cssClass",void 0),Mr([t.Property("All")],s.prototype,"columnQueryMode",void 0),Mr([t.Property({})],s.prototype,"currentAction",void 0),Mr([t.Property("")],s.prototype,"ej2StatePersistenceVersion",void 0),Mr([t.Property(null)],s.prototype,"isRowSelectable",void 0),Mr([t.Event()],s.prototype,"isRowPinned",void 0),Mr([t.Event()],s.prototype,"created",void 0),Mr([t.Event()],s.prototype,"destroyed",void 0),Mr([t.Event()],s.prototype,"load",void 0),Mr([t.Event()],s.prototype,"rowDataBound",void 0),Mr([t.Event()],s.prototype,"queryCellInfo",void 0),Mr([t.Event()],s.prototype,"headerCellInfo",void 0),Mr([t.Event()],s.prototype,"actionBegin",void 0),Mr([t.Event()],s.prototype,"actionComplete",void 0),Mr([t.Event()],s.prototype,"actionFailure",void 0),Mr([t.Event()],s.prototype,"dataBound",void 0),Mr([t.Event()],s.prototype,"recordDoubleClick",void 0),Mr([t.Event()],s.prototype,"recordClick",void 0),Mr([t.Event()],s.prototype,"rowSelecting",void 0),Mr([t.Event()],s.prototype,"rowSelected",void 0),Mr([t.Event()],s.prototype,"rowDeselecting",void 0),Mr([t.Event()],s.prototype,"rowDeselected",void 0),Mr([t.Event()],s.prototype,"cellSelecting",void 0),Mr([t.Event()],s.prototype,"cellSelected",void 0),Mr([t.Event()],s.prototype,"cellDeselecting",void 0),Mr([t.Event()],s.prototype,"cellDeselected",void 0),Mr([t.Event()],s.prototype,"columnSelecting",void 0),Mr([t.Event()],s.prototype,"columnSelected",void 0),Mr([t.Event()],s.prototype,"columnDeselecting",void 0),Mr([t.Event()],s.prototype,"columnDeselected",void 0),Mr([t.Event()],s.prototype,"columnDragStart",void 0),Mr([t.Event()],s.prototype,"columnDrag",void 0),Mr([t.Event()],s.prototype,"columnDrop",void 0),Mr([t.Event()],s.prototype,"printComplete",void 0),Mr([t.Event()],s.prototype,"beforePrint",void 0),Mr([t.Event()],s.prototype,"pdfQueryCellInfo",void 0),Mr([t.Event()],s.prototype,"pdfHeaderQueryCellInfo",void 0),Mr([t.Event()],s.prototype,"pdfAggregateQueryCellInfo",void 0),Mr([t.Event()],s.prototype,"excelAggregateQueryCellInfo",void 0),Mr([t.Event()],s.prototype,"exportDetailDataBound",void 0),Mr([t.Event()],s.prototype,"exportDetailTemplate",void 0),Mr([t.Event()],s.prototype,"excelQueryCellInfo",void 0),Mr([t.Event()],s.prototype,"excelHeaderQueryCellInfo",void 0),Mr([t.Event()],s.prototype,"beforeExcelExport",void 0),Mr([t.Event()],s.prototype,"excelExportComplete",void 0),Mr([t.Event()],s.prototype,"beforePdfExport",void 0),Mr([t.Event()],s.prototype,"pdfExportComplete",void 0),Mr([t.Event()],s.prototype,"rowDragStartHelper",void 0),Mr([t.Event()],s.prototype,"detailDataBound",void 0),Mr([t.Event()],s.prototype,"detailExpand",void 0),Mr([t.Event()],s.prototype,"detailCollapse",void 0),Mr([t.Event()],s.prototype,"rowDragStart",void 0),Mr([t.Event()],s.prototype,"rowDrag",void 0),Mr([t.Event()],s.prototype,"rowDrop",void 0),Mr([t.Event()],s.prototype,"toolbarClick",void 0),Mr([t.Event()],s.prototype,"beforeOpenColumnChooser",void 0),Mr([t.Event()],s.prototype,"beforeOpenAdaptiveDialog",void 0),Mr([t.Event()],s.prototype,"batchAdd",void 0),Mr([t.Event()],s.prototype,"batchDelete",void 0),Mr([t.Event()],s.prototype,"batchCancel",void 0),Mr([t.Event()],s.prototype,"beforeBatchAdd",void 0),Mr([t.Event()],s.prototype,"beforeBatchDelete",void 0),Mr([t.Event()],s.prototype,"beforeBatchSave",void 0),Mr([t.Event()],s.prototype,"beginEdit",void 0),Mr([t.Event()],s.prototype,"commandClick",void 0),Mr([t.Event()],s.prototype,"cellEdit",void 0),Mr([t.Event()],s.prototype,"cellSave",void 0),Mr([t.Event()],s.prototype,"cellSaved",void 0),Mr([t.Event()],s.prototype,"resizeStart",void 0),Mr([t.Event()],s.prototype,"resizing",void 0),Mr([t.Event()],s.prototype,"resizeStop",void 0),Mr([t.Event()],s.prototype,"keyPressed",void 0),Mr([t.Event()],s.prototype,"beforeDataBound",void 0),Mr([t.Event()],s.prototype,"contextMenuOpen",void 0),Mr([t.Event()],s.prototype,"contextMenuClick",void 0),Mr([t.Event()],s.prototype,"contextMenuClose",void 0),Mr([t.Event()],s.prototype,"columnMenuOpen",void 0),Mr([t.Event()],s.prototype,"columnMenuClick",void 0),Mr([t.Event()],s.prototype,"columnMenuClose",void 0),Mr([t.Event()],s.prototype,"checkBoxChange",void 0),Mr([t.Event()],s.prototype,"beforeCopy",void 0),Mr([t.Event()],s.prototype,"beforePaste",void 0),Mr([t.Event()],s.prototype,"beforeAutoFill",void 0),Mr([t.Event()],s.prototype,"columnDataStateChange",void 0),Mr([t.Event()],s.prototype,"dataStateChange",void 0),Mr([t.Event()],s.prototype,"dataSourceChanged",void 0),Mr([t.Event()],s.prototype,"exportGroupCaption",void 0),Mr([t.Event()],s.prototype,"lazyLoadGroupExpand",void 0),Mr([t.Event()],s.prototype,"lazyLoadGroupCollapse",void 0),Mr([t.Event()],s.prototype,"beforeDetailTemplateDetach",void 0),Mr([t.Event()],s.prototype,"beforeCustomFilterOpen",void 0),s=o=Mr([t.NotifyPropertyChanges],s)}(t.Component),Qr=function(){function e(e,t){this.isAsyncPrint=!1,this.defered=new i.Deferred,this.parent=e,this.parent.isDestroyed||(this.parent.on($t,this.isContentReady(),this),this.actionBeginFunction=this.actionBegin.bind(this),this.parent.addEventListener(qt,this.actionBeginFunction),this.parent.on(ti,this.onEmpty.bind(this)),this.parent.on(Ei,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()},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"});i.classList.remove("e-gridhover"),document.body.appendChild(i);for(var n=new Wr(ve(e,e.hierarchyPrintMode)),r=0;r<n.columns.length;r++)n.columns[parseInt(r.toString(),10)]=t.extend({},n.columns[parseInt(r.toString(),10)]),!e.getFrozenColumns()&&e.isFrozenGrid()&&(n.columns[parseInt(r.toString(),10)].freeze=void 0);this.parent.isAngular&&(n.viewContainerRef=this.parent.viewContainerRef),n.load=function(){},n.query=e.getQuery().clone(),window.printGridObj=n,n.isPrinting=!0;var s=n.getInjectedModules(),o=e.getInjectedModules();s&&s.length===o.length||n.setInjectedModules(o),e.notify("printGrid-Init",{element:i,printgrid:n}),this.parent.log("exporting_begin",this.getModuleName()),n.registeredTemplate=this.parent.registeredTemplate,n.isVue=this.parent.isVue,this.parent.isVue&&(n.vueInstance=this.parent.vueInstance),n.printGridParent=e,n.appendTo(i),e.isVue3||(n.trigger=e.trigger)},e.prototype.contentReady=function(){var e=this;if(this.isPrintGrid()){var i=this.parent;if(this.isAsyncPrint)return void this.printGrid();var n={requestType:"print",element:i.element,selectedRows:i.getContentTable().querySelectorAll('tr[aria-selected="true"]'),cancel:!1,hierarchyPrintMode:i.hierarchyPrintMode};if(this.isAsyncPrint||i.trigger("beforePrint",n),n.cancel)return void t.detach(i.element);this.isAsyncPrint||(this.parent.printGridParent&&this.parent.printGridParent.isReact?this.parent.printGridParent.renderTemplates(function(){e.printGrid()}):this.printGrid())}},e.prototype.printGrid=function(){var e=this.parent;if("auto"!==e.height){var i=this.scrollModule.getCssProperties(),n=e.element.querySelector("."+Yi),r=e.element.querySelector("."+Ki);n.style.height="auto",n.style.overflowY="auto",r.style[i.padding]="",r.firstElementChild.style[i.border]=""}e.allowGrouping&&(e.groupSettings.columns.length?this.removeColGroup(e):e.element.querySelector(".e-groupdroparea").style.display="none");for(var s=0,o=[].slice.call(e.element.getElementsByClassName(Yi));s<o.length;s++)(h=o[s]).style.overflowX="hidden";for(var a=[].slice.call(e.element.getElementsByClassName("e-spin-show")),l=0,d=[].slice.call(a);l<d.length;l++){var h=d[l];t.classList(h,["e-spin-hide"],["e-spin-show"])}this.printGridElement(e),e.isPrinting=!1,delete window.printGridObj;var p={element:e.element};e.trigger("printComplete",p),e.destroy(),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=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),t.isNullOrUndefined(this.printWind)||(this.printWind.moveTo(0,0),this.printWind.resizeTo(screen.availWidth,screen.availHeight),this.printWind=t.print(e.element,this.printWind))},e.prototype.removeColGroup=function(e){var i=e.groupSettings.columns.length,n=e.element,r="#"+e.element.id;if(i){for(var s=t.selectAll(".e-groupcaption",n),o=e.groupSettings.enableLazyLoading?(parseInt(s[0].getAttribute("colspan"),10)-(e.groupSettings.columns.length-1)).toString():s[i-1].getAttribute("colspan"),a=0;a<s.length;a++)s[parseInt(a.toString(),10)].setAttribute("colspan",o);var l=t.selectAll("colgroup"+r+"colgroup",n),d=t.selectAll(".e-content colgroup",n),h=t.selectAll(".e-summarycontent colgroup",n);this.hideColGroup(l,i),this.hideColGroup(d,i),this.hideColGroup(h,i)}},e.prototype.hideColGroup=function(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<t;n++)e[parseInt(i.toString(),10)].children[parseInt(n.toString(),10)].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($t,this.contentReady.bind(this)),this.parent.removeEventListener(qt,this.actionBeginFunction),this.parent.off(ti,this.onEmpty.bind(this)),this.parent.off(Ei,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","enableHtmlSanitizer"].concat(["beforePrint","printComplete","load"]),e}(),Xr=0,Yr=0,Jr=null;!function(e){e.timer=null}(e.Global||(e.Global={}));var Zr=!1,$r=function(){function o(e){this.searchInputArgs=null,this.queryFilteredColumn=[],this.existingPredicate={},this.foreignKeyQuery=new i.Query,this.filterState=!0,this.values={},this.renderEmpty=!1,this.isCheckboxFilterTemplate=!1,this.infiniteRenderMod=!1,this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1,this.infinitePermenantLocalData=[],this.infiniteQueryExecutionPending=!1,this.infiniteSkipCnt=0,this.infiniteOdataCount=0,this.infiniteScrollAppendDiff=0,this.prevInfiniteScrollDirection="",this.infiniteLoadedElem=[],this.infiniteDataCount=0,this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!1,this.localInfiniteSelectionInteracted=!1,this.infiniteManualSelectMaintainPred=[],this.parent=e,this.id=this.parent.element.id,this.valueFormatter=new Ft(this.parent.locale),this.cBoxTrue=r.createCheckBox(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=r.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"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?t.addClass([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):t.addClass([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass]))}return o.prototype.destroy=function(){this.closeDialog()},o.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),t.EventHandler.add(e,"input",this.searchHandler,this))},o.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),t.EventHandler.remove(e,"input",this.searchHandler))},o.prototype.foreignKeyFilter=function(e,t,i){var n=this,r={},s=[],o=this.foreignKeyQuery.clone();this.options.column.dataSource.executeQuery(o.where(i)).then(function(i){n.options.column.columnData=i.result,n.parent.notify("generateQuery",{predicate:r,column:n.options.column}),e.ejpredicate=r.predicate.predicates;for(var o=r.predicate.predicates,a=0;a<o.length;a++)s.push({field:o[parseInt(a.toString(),10)].field,predicate:"or",matchCase:o[parseInt(a.toString(),10)].ignoreCase,ignoreAccent:o[parseInt(a.toString(),10)].ignoreAccent,operator:o[parseInt(a.toString(),10)].operator,value:o[parseInt(a.toString(),10)].value,type:n.options.type});e.filterCollection=s.length?s:t.filter(function(e){return e.field=n.options.field}),n.options.handler(e)})},o.prototype.searchBoxClick=function(e){var t=e.target;t.classList.contains("e-searchclear")&&(this.sInput.value=t.classList.contains("e-chkcancel-icon")?"":this.sInput.value,this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):this.refreshCheckboxes(),this.updateSearchIcon(),this.sInput.focus())},o.prototype.searchBoxKeyUp=function(e){t.isNullOrUndefined(this.sInput)||!t.isNullOrUndefined(e)&&("ArrowUp"===e.key||"ArrowDown"===e.key||"Tab"===e.key||"Tab"===e.key&&e.shiftKey)||(t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.parent.showMaskRow(void 0,this.dialogObj.element),this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):this.refreshCheckboxes(),this.updateSearchIcon())},o.prototype.updateSearchIcon=function(){this.sInput.value.length?(t.classList(this.sIcon,["e-chkcancel-icon"],["e-search-icon"]),t.isNullOrUndefined(document.body.querySelector(".e-chkcancel-icon"))||document.body.querySelector(".e-chkcancel-icon").setAttribute("title",this.localeObj.getConstant("Clear"))):(t.classList(this.sIcon,["e-search-icon"],["e-chkcancel-icon"]),t.isNullOrUndefined(document.body.querySelector(".e-searchclear.e-search-icon"))||document.body.querySelector(".e-searchclear.e-search-icon").setAttribute("title",this.localeObj.getConstant("Search")))},o.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},o.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 n={};n[this.options.field]=e[parseInt(t.toString(),10)],e[parseInt(t.toString(),10)]=n}},o.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.options.disableHtmlEncode=e.column.disableHtmlEncode||!1,this.values={},this.localeObj=e.localeObj,this.isFiltered=e.filteredColumns.length,this.infiniteRenderMod=!(!this.parent.filterSettings||!this.parent.filterSettings.enableInfiniteScrolling),this.infiniteUnloadParentExistPred=this.infiniteRenderMod&&this.existingPredicate[this.options.column.field]?this.existingPredicate[this.options.column.field].slice():[]},o.prototype.getAndSetChkElem=function(e){return this.dlg=this.parent.createElement("div",{id:this.id+this.options.type+"_excelDlg",attrs:{"data-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),this.searchInputArgs={element:this.sInput,floatLabelType:"Never",properties:{placeholder:this.getLocalizedLabel("Search"),cssClass:this.parent.cssClass}},s.Input.createInput(this.searchInputArgs,this.parent.createElement),this.searchBox.querySelector(".e-input-group").appendChild(this.sIcon)),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},o.prototype.showDialog=function(e){var i={requestType:"filterBeforeOpen",columnName:this.options.field,columnType:this.options.type,cancel:!1};if(i.filterModel=this,this.parent.notify("cbox-filter-begin",i),i.cancel)return void(e.cancel=i.cancel);this.dialogObj=new n.Dialog({visible:!1,content:this.sBox,close:this.closeDialog.bind(this),enableRtl:this.parent.enableRtl,width:!t.isNullOrUndefined(F(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:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.getLocalizedLabel(this.isExcel?"CancelButton":"ClearButton")}}],created:this.dialogCreated.bind(this),open:this.dialogOpen.bind(this),cssClass:this.parent.cssClass?this.parent.cssClass:""});this.dialogObj.isStringTemplate=!0,this.renderResponsiveFilter(e);var r=this.parent.filterSettings&&"CheckBox"===this.parent.filterSettings.type?this.getLocalizedLabel("CheckBoxFilterDialogARIA"):this.getLocalizedLabel("ExcelFilterDialogARIA");if(this.dlg.setAttribute("aria-label",r),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.parent&&this.parent.filterSettings&&("CheckBox"===this.parent.filterSettings.type||this.options.column&&this.options.column.filter&&"CheckBox"===this.options.column.filter.type)&&this.parent.getContent().firstElementChild.offsetHeight<this.dialogObj.element.offsetHeight&&!F(this.parent.element,"e-gantt-dialog")&&_e(this.parent,this.dialogObj),this.dialogObj.element.querySelector(".e-dlg-content").appendChild(this.sBox),this.wireEvents(),this.parent.enableAdaptiveUI){if(this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator)return void this.getAllData();this.infiniteRenderMod&&(this.cBox.style.marginTop=mt(this.cBox)+"px")}else t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.infiniteRenderMod||this.parent.showMaskRow(void 0,this.dialogObj.element),this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.showMask();this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator||(n.createSpinner({target:this.spinner,cssClass:this.parent.cssClass?this.parent.cssClass:null},this.parent.createElement),n.showSpinner(this.spinner)),this.getAllData()},o.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%")},o.prototype.dialogCreated=function(e){this.options.isResponsiveFilter?this.dialogObj.element.style.left="0px":t.Browser.isDevice?this.dialogObj.position={X:"center",Y:"center"}:ie(this.options.target,this.dialogObj,this.parent),this.options.column.showColumnMenu&&this.parent.notify("filterDialogCreated",e)},o.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},o.prototype.closeDialog=function(){if(this.infiniteRenderMod&&this.infinitePermenantLocalData.length&&!this.options.isRemote&&(this.options.dataSource.dataSource.json=this.infinitePermenantLocalData),this.dialogObj&&!this.dialogObj.isDestroyed){this.isBlanks=!1;var e=this.options.columns.filter(function(e){return e.getFilterItemTemplate()}),i=this.parent.registeredTemplate;if(e.length&&!t.isNullOrUndefined(i)&&i.filterItemTemplate&&this.parent.destroyTemplate(["filterItemTemplate"]),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&ut(this.parent,["filterItemTemplate"]),this.parent.notify(Di,{field:this.options.field}),this.unWireEvents(),this.searchInputArgs&&this.searchInputArgs.element&&this.searchInputArgs.element.parentElement&&(s.Input.destroy(this.searchInputArgs),t.remove(this.searchInputArgs.element)),this.searchInputArgs=null,this.sInput=null,this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate&&("CheckBox"===this.options.column.filter.type||"Excel"===this.options.column.filter.type)&&(this.dialogObj.element.querySelector(".e-dlg-content").innerHTML=""),this.dialogObj.destroy(),"escape"===this.dialogObj.dlgClosedBy&&(this.parent.isColumnMenuFilterClosing=!0),this.dlg&&this.dlg.parentElement&&(t.remove(this.dlg),!this.parent||!this.parent.showColumnChooser)){var n=document.getElementById(this.parent.element.id+"_e-popup");t.isNullOrUndefined(n)||(t.remove(n),n=null)}this.dlg=null,this.parent.notify("filter-dialog-close",{})}},o.prototype.clearFilter=function(e){var t={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(Fi,t),t.cancel||this.options.handler({action:"clear-filter",field:e?e.field:this.options.field})},o.prototype.btnClick=function(e){if(this.filterState){if("input"===e.target.tagName.toLowerCase()&&e.target.classList.contains("e-searchinput")||13===e.keyCode)this.isCheckboxFilterTemplate||this.fltrBtnHandler();else{var i=e.target.firstChild.textContent.toLowerCase();this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton").toLowerCase()===i?this.isCheckboxFilterTemplate||this.fltrBtnHandler():this.getLocalizedLabel("ClearButton").toLowerCase()===i&&this.clearFilter()}this.closeDialog()}else e.target&&e.target.firstChild&&e.target.firstChild.textContent.toLowerCase()===this.getLocalizedLabel("CancelButton").toLowerCase()?this.closeDialog():"input"!==e.target.tagName.toLowerCase()&&(this.clearFilter(),this.closeDialog());this.options.column.showColumnMenu&&this.parent.notify("after-filter-column-menu-close",{}),t.isNullOrUndefined(this.parent.focusModule)||this.parent.focusModule.filterfocus()},o.prototype.fltrBtnHandler=function(){var e=this;this.infiniteRenderMod&&(this.cBox.innerHTML="",q(this.cBox,this.infiniteLoadedElem.slice()));var i=[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)")),n=i,r="equal",s=this.dialogObj.element.querySelector(".e-dropdownlist");s&&(this.options.operator=r=s.ej2_instances[0].value),this.isMenuNotEqual="notequal"===this.options.operator;var o;this.options.hideSearchbox||(o=this.searchBox.querySelector(".e-searchinput"));var a=this.options.allowCaseSensitive,l={field:this.options.field,predicate:this.isMenuNotEqual?"and":"or",uid:this.options.uid,operator:r,type:this.options.type,matchCase:a,ignoreAccent:this.options.ignoreAccent},d=this.itemsCnt!==i.length&&this.itemsCnt-i.length<i.length,h=this.infiniteRenderMod?this.sBox.querySelector(".e-add-current"):this.cBox.querySelector(".e-add-current"),p=this.infiniteRenderMod?this.sBox.querySelector(".e-selectall"):this.cBox.querySelector(".e-selectall"),c=o&&""!==o.value&&h&&p&&h.classList.contains("e-check")&&p.classList.contains("e-stop"),u=this.existingPredicate&&this.existingPredicate[this.options.field];c&&(d=!u||!u.length),d&&o&&(""===o.value||c)&&(r=this.isMenuNotEqual?"equal":"notequal",i=[].slice.call(this.cBox.querySelectorAll(".e-uncheck:not(.e-selectall)")),l.predicate=this.isMenuNotEqual?"or":"and",l.operator=r);var g,f,m=[];if(i.length!==this.itemsCnt||o&&o.value&&""!==o.value||this.infiniteRenderMod){if(this.infiniteRenderMod)this.infiniteRenderMod&&(!this.infiniteSearchPred||this.infiniteSearchPred&&!this.infiniteSearchPred.isComplex)?this.infiniteFltrBtnHandler(m):this.infiniteSearchPred.isComplex&&(m=this.complexQueryPredicate(i,l,d));else{if(m=this.complexQueryPredicate(i,l,d),t.isNullOrUndefined(m))return;m=this.filterPreventColumns?this.filterPreventColumns:m}if("date"!==this.options.type&&"dateonly"!==this.options.type&&"datetime"!==this.options.type||!n.length||(f=n.length-1,g=this.values[F(n[parseInt(f.toString(),10)],"e-ftrchk").getAttribute("data-uid")],t.isNullOrUndefined(g)&&d&&m.push({field:l.field,matchCase:l.matchCase,operator:"equal",predicate:"or",value:null})),h&&h.classList.contains("e-check"))if(u)for(var y=0;y<u.length;y++)!function(e){m.some(function(t){return t.value===u[parseInt(e.toString(),10)].value})||m.push(u[parseInt(e.toString(),10)])}(y);else if(!c)return;this.infiniteRenderMod?m.length?this.initiateFilter(m):this.sBox.querySelector(".e-selectall").classList.contains("e-check")&&!m.length&&(v=this.options.filteredColumns.some(function(t){return e.options.field===t.field}))&&this.clearFilter():this.initiateFilter(m)}else{var v=this.options.filteredColumns.some(function(t){return e.options.field===t.field});v&&this.clearFilter()}},o.prototype.complexQueryPredicate=function(e,i,n){for(var r,s,a=[],l=0;l<e.length;l++)r=this.values[F(e[parseInt(l.toString(),10)],"e-ftrchk").getAttribute("data-uid")],s=t.extend({},{value:r},i),r&&!r.toString().length&&(s.operator=n?"notequal":"equal"),""===r||t.isNullOrUndefined(r)?a=a.concat(o.generateNullValuePredicates(i)):a.push(s);var d=this.filterPreventColumns&&this.filterPreventColumns.length?this.filterPreventColumns[0]:s;return d&&!this.notifyFilterPrevEvent(d)?(this.filterPreventColumns=a,null):a},o.prototype.infiniteFltrBtnHandler=function(e){var i;if(this.infiniteManualSelectMaintainPred.length)for(s=0;s<this.infiniteManualSelectMaintainPred.length;s++){var n=this.infiniteManualSelectMaintainPred[s];if(""===(i=n.value+"")||t.isNullOrUndefined(i)){var r={predicate:n.predicate,field:n.field,type:n.type,uid:n.uid,operator:n.operator,matchCase:n.matchCase,ignoreAccent:n.ignoreAccent};e.push.apply(e,o.generateNullValuePredicates(r))}else e.push(this.infiniteManualSelectMaintainPred[s]);this.notifyFilterPrevEvent(this.infiniteManualSelectMaintainPred[s])}if(!this.localInfiniteSelectAllClicked&&""===this.sInput.value&&(this.options.parentCurrentViewDataCount||!e.length))for(var s=0;s<this.infiniteUnloadParentExistPred.length;s++)e.unshift(this.infiniteUnloadParentExistPred[s]),this.notifyFilterPrevEvent(this.existingPredicate[this.options.field][s]);!this.infiniteSearchPred||""===this.sInput.value||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll||(this.infiniteSearchPred.predicate="or",e.unshift(this.infiniteSearchPred),this.notifyFilterPrevEvent(this.infiniteSearchPred))},o.prototype.notifyFilterPrevEvent=function(e){var t={instance:this,handler:this.fltrBtnHandler,arg1:e.field,arg2:e.predicate,arg3:e.operator,arg4:e.matchCase,arg5:e.ignoreAccent,arg6:e.value,cancel:!1};return this.parent.notify(Fi,t),!t.cancel},o.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},o.prototype.initiateFilter=function(e){var n=e[0];n&&"dateonly"===n.type&&(n.value=n.value instanceof Date?n.value.getFullYear()+"-"+ce(n.value.getMonth()+1)+"-"+ce(n.value.getDate()):n.value);var r;if(!t.isNullOrUndefined(n)){r=n.ejpredicate?n.ejpredicate:new i.Predicate(n.field,n.operator,n.value,!n.matchCase,n.ignoreAccent);for(var s=1;s<e.length;s++)r=void 0!==e[parseInt(s.toString(),10)].ejpredicate?r[e[parseInt(s.toString(),10)].predicate](e[parseInt(s.toString(),10)].ejpredicate):r[e[parseInt(s.toString(),10)].predicate](e[parseInt(s.toString(),10)].field,e[parseInt(s.toString(),10)].operator,e[parseInt(s.toString(),10)].value,!e[parseInt(s.toString(),10)].matchCase,e[parseInt(s.toString(),10)].ignoreAccent);var o={action:"filtering",filterCollection:e,field:this.options.field,ejpredicate:i.Predicate.or(r)};this.options.handler(o)}},o.prototype.isForeignColumn=function(e){return!!e.isForeignColumn&&e.isForeignColumn()},o.prototype.refreshCheckboxes=function(){var e=this,r=this.sInput.value,s=this.options.column,a=this.isForeignColumn(s)?this.foreignKeyQuery.clone():this.options.query.clone(),l=this.options.query.clone(),d=a.queries.filter(function(e){return e&&"onWhere"===e.fn})[0];a.queries=[],l.queries=[];var h="string"!==this.options.type&&parseFloat(r)?parseFloat(r):r,p=this.options.isRemote?"string"===this.options.type?"contains":"equal":this.options.type?"contains":"equal",c=this.options.ignoreAccent,u=this.isForeignColumn(s)?s.foreignKeyValue:s.field;h=""===h||void 0===h?void 0:h;var g,f=[],m={field:u,predicate:"or",uid:this.options.uid,operator:"equal",type:this.options.type,matchCase:!0,ignoreAccent:c},y=this.options.dataManager.adaptor.getModuleName;if("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())&&y?(y(),h=!0):void 0!==h&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(h.toLowerCase())&&y&&(y(),h=!1),p="equal"),("date"===this.options.type||"datetime"===this.options.type||"dateonly"===this.options.type)&&this.options.format){var v=new t.Internationalization,S="string"==typeof this.options.format?this.options.format:this.options.format.format;h=S?v.parseDate(r,{format:S})||new Date(r):new Date(r),"dateonly"===this.options.type&&(h=h.getFullYear()+"-"+ce(h.getMonth()+1)+"-"+ce(h.getDate()))}this.infiniteSearchValChange=!0,this.infiniteLoadedElem=[],this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!1,this.localInfiniteSelectionInteracted=!1,this.infiniteSkipCnt=0,this.infiniteDataCount=0,this.infiniteManualSelectMaintainPred=[],""===this.sInput.value?this.infiniteUnloadParentExistPred=this.infiniteRenderMod&&this.existingPredicate[this.options.column.field]?this.existingPredicate[this.options.column.field].slice():[]:this.infiniteUnloadParentExistPred=[],this.isForeignColumn(s)||this.addDistinct(a);var C={requestType:"filterSearchBegin",filterModel:this,columnName:u,column:s,operator:p,matchCase:!0,ignoreAccent:c,filterChoiceCount:null,query:a,value:h,cancel:!1};this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(C.filterChoiceCount=this.parent.filterSettings.itemsCount),this.parent.trigger(qt,C,function(y){if(!y.cancel){if(y.operator=y.operator,g=new i.Predicate(u,y.operator,C.value,y.matchCase,y.ignoreAccent),"date"===e.options.type||"datetime"===e.options.type||"dateonly"===e.options.type){var v={field:u,operator:p="equal",value:h,matchCase:!0,ignoreAccent:c};t.isNullOrUndefined(h)||(g=ue(v,e.options.type))}if(r&&"string"==typeof r&&e.isBlanks&&e.getLocalizedLabel("Blanks").toLowerCase().indexOf(r.toLowerCase())>=0){f=f.concat(o.generateNullValuePredicates(m));var S=o.generatePredicate(f);S.predicates.push(g),g=S,a.where(S)}else r.length?(g=t.isNullOrUndefined(d)?g:g.and(d.e),a.where(g)):t.isNullOrUndefined(d)||(g=d.e,a.where(d.e));e.infiniteSearchPred=g,y.filterChoiceCount=t.isNullOrUndefined(y.filterChoiceCount)?1e3:y.filterChoiceCount,e.infiniteRenderMod&&e.parent.filterSettings.itemsCount!==y.filterChoiceCount&&(e.parent.filterSettings.itemsCount=C.filterChoiceCount);var w={};n.showSpinner(e.spinner),e.renderEmpty=!1,e.isForeignColumn(s)&&r.length?("result"in s.dataSource?new i.DataManager(s.dataSource.result):s.dataSource).executeQuery(a).then(function(i){var n=e.options.column.columnData;e.options.column.columnData=i.result,e.parent.notify("generateQuery",{predicate:w,column:s}),w.predicate.predicates.length?l.where(w.predicate):e.renderEmpty=!0,e.options.column.columnData=n,e.infiniteRenderMod?(e.infiniteInitialLoad=!!t.isNullOrUndefined(e.fullData),e.makeInfiniteScrollRequest(l),l.requiresCount()):l.take(y.filterChoiceCount),e.search(y,l)}):(e.infiniteRenderMod&&e.parent.filterSettings.itemsCount?(e.infiniteInitialLoad=!!t.isNullOrUndefined(e.fullData),e.makeInfiniteScrollRequest(a),a.requiresCount()):a.take(y.filterChoiceCount),e.search(y,a))}})},o.prototype.search=function(e,t){this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(e,t):this.processSearch(t)},o.prototype.getPredicateFromCols=function(e){for(var t=o.getPredicate(e),n=[],r={},s=void 0!==this.parent.getForeignKeyColumns,a=s?this.parent.getForeignKeyColumns():[],l=0,d=Object.keys(t);l<d.length;l++){var h=d[l],p=void 0;s&&!this.parent.getColumnByField(h)&&(p=pe(h,a)),p?(this.parent.notify("generateQuery",{predicate:r,column:p}),r.predicate.predicates.length&&n.push(i.Predicate.or(r.predicate.predicates))):n.push(t[""+h])}return n.length&&i.Predicate.and(n)},o.prototype.getQuery=function(){return this.parent.getQuery?this.parent.getQuery().clone():new i.Query},o.prototype.getAllData=function(){var e=this;this.customQuery=!1;var i=this.getQuery(),n=this.options.dataManager.adaptor.getModuleName;!t.isNullOrUndefined(this.parent.getDataModule)&&n&&"ODataV4Adaptor"===n()||i.requiresCount(),this.addDistinct(i);var r={requestType:"filterchoicerequest",query:i,filterChoiceCount:null};r.filterModel=this,this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(r.filterChoiceCount=this.parent.filterSettings.itemsCount),this.parent.trigger(qt,r,function(n){n.filterChoiceCount=t.isNullOrUndefined(n.filterChoiceCount)?1e3:n.filterChoiceCount,e.infiniteRenderMod&&e.parent.filterSettings.itemsCount!==n.filterChoiceCount&&(e.parent.filterSettings.itemsCount=n.filterChoiceCount),e.infiniteRenderMod||i.take(n.filterChoiceCount),n.query.distincts.length&&!e.infiniteRenderMod||(e.customQuery=!0,e.queryGenerate(i)),e.infiniteRenderMod&&(e.infiniteInitialLoad=!!t.isNullOrUndefined(e.fullData),e.makeInfiniteScrollRequest(i)),e.parent.dataSource&&"result"in e.parent.dataSource?e.filterEvent(n,i):e.processDataOperation(i,!0)})},o.prototype.addDistinct=function(e){var t=this,n=i.DataUtil.distinct(this.options.filteredColumns,"field");n.indexOf(this.options.column.field)<=-1&&(n=n.concat(this.options.column.field));var r=this.options.dataManager.adaptor.getModuleName;if(r&&"ODataV4Adaptor"===r()&&this.parent&&this.parent.query instanceof i.Query)for(var s=this.parent.query,o=0;o<s.queries.length;o++){var a=s.queries[parseInt(o.toString(),10)];"onWhere"===a.fn&&(this.getPredicateFields(a.e),this.queryFilteredColumn.map(function(e){-1===n.indexOf(e)&&n.push(e)}),this.queryFilteredColumn=[])}if(this.infiniteRenderMod||e.distinct(n),this.infiniteRenderMod&&!this.options.isRemote&&""===this.sInput.value){this.options.dataSource=this.options.dataSource instanceof i.DataManager?this.options.dataSource:new i.DataManager(this.options.dataSource),this.infinitePermenantLocalData=this.options.dataSource.dataSource.json.slice();var l;this.options&&this.options.dataManager&&this.options.dataManager.adaptor&&this.options.dataManager.adaptor.getModuleName&&(l=this.options.dataManager.adaptor.getModuleName);var d=l&&"RemoteSaveAdaptor"===l()&&this.infinitePermenantLocalData?this.infinitePermenantLocalData:this.options.dataSource.dataSource,h=new i.Query;this.queryGenerate(h);var p=new i.DataManager(d).executeLocal(h);this.options.dataSource=new i.DataManager(i.DataUtil.distinct(p,this.options.column.field,!0)),this.isForeignColumn(this.options.column)&&(this.options.column.dataSource=this.options.column.dataSource instanceof i.DataManager?this.options.column.dataSource:new i.DataManager(this.options.column.dataSource),this.options.dataSource.dataSource.json=this.options.dataSource.dataSource.json.map(function(e,i){return Object.assign({},e,t.options.column.dataSource.dataSource.json[i])}))}else if(this.infiniteRenderMod&&this.options.isRemote){e.select(this.options.column.field),e.sortBy(this.options.column.field,"ascending");var c=this.options.dataManager.adaptor.getModuleName;c&&c()&&("ODataV4Adaptor"===c()||"WebApiAdaptor"===c()||"CustomDataAdaptor"===c()||"GraphQLAdaptor"===c()||"ODataAdaptor"===c())&&e.distinct([this.options.column.field])}return e},o.prototype.getPredicateFields=function(e){var t=this;e.isComplex&&e.predicates?e.predicates.forEach(function(e){Array.isArray(e)?e.forEach(function(e){return t.getPredicateFields(e)}):t.getPredicateFields(e)}):e.field&&!e.isComplex&&this.queryFilteredColumn.indexOf(e.field)<=-1&&(this.queryFilteredColumn=this.queryFilteredColumn.concat(i.DataUtil.distinct([e.field],"field")))},o.prototype.filterEvent=function(e,t){var i=this,n=Le(e,t);this.parent.trigger("dataStateChange",n.state),this.addInfiniteScrollEvent(t),n.deffered.promise.then(function(e){i.infiniteDataCount=i.infiniteRenderMod&&!i.infiniteDataCount?e.count:i.infiniteDataCount;var t=i.infiniteRenderMod?e.result:e;i.dataSuccess(t)})},o.prototype.addInfiniteScrollEvent=function(e){this.infiniteRenderMod&&(this.infiniteQuery=e.clone(),this.infiniteInitialLoad?(this.cBox.classList.add("e-checkbox-infinitescroll"),t.EventHandler.add(this.cBox,"scroll",this.infiniteScrollHandler,this),t.EventHandler.add(this.cBox,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),t.EventHandler.add(this.cBox,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.infiniteSearchValChange&&(this.cBox.innerHTML=""))},o.prototype.infiniteScrollMouseKeyDownHandler=function(){t.EventHandler.remove(this.cBox,"scroll",this.infiniteScrollHandler)},o.prototype.infiniteScrollMouseKeyUpHandler=function(i){var n=this;t.EventHandler.add(this.cBox,"scroll",this.infiniteScrollHandler,this);var r=this.cBox;r.children.length>1&&(r.scrollTop>=r.scrollHeight-r.offsetHeight||r.scrollTop<=0)&&this.infiniteScrollHandler(),e.Global.timer=setTimeout(function(){n.clickHandler(i),e.Global.timer=null},0)},o.prototype.getShimmerTemplate=function(){return'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},o.prototype.showMask=function(){var e,t=5,i=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxMaskList",className:"e-checkboxlist e-fields e-infinite-list e-masklist"});i.style.zIndex="10";var n=this.cBox;if(this.removeMask(),n){var r=getComputedStyle(n),s=mt(n),o=n.children.length?parseInt(r.height,10):Math.floor(parseInt(r.height.split("px")[0],10))-5;this.parent.enableAdaptiveUI&&this.infiniteRenderMod&&(i.style.height=o-s+"px",this.dlg.querySelector(".e-dlg-content").style.overflow="hidden");var a=!this.isExcel||n.children.length||this.dlg.classList.contains("e-excelfilter")?getComputedStyle(this.dlg.querySelector(".e-dlg-content")).backgroundColor:"";i.style.cssText="width: "+r.width+"; min-height: "+r.minHeight+"; height: "+o+"px; margin: "+r.margin+"; border-style: "+r.borderStyle+"; border-width: "+r.borderWidth+"; border-color: "+r.borderColor+"; position: absolute; background-color: "+a+";",t=Math.floor(o/s),t=n.children.length>t?n.children.length:t,e=s+"px"}var l='<div class="e-ftrchk e-mask-ftrchk"><div class="e-checkbox-wrapper"><input class="e-chk-hidden">'+this.getShimmerTemplate()+this.getShimmerTemplate()+"</div></div>";i.innerHTML="",n.children.length||(this.spinner.insertAdjacentHTML("beforebegin",l),this.spinner.parentElement.querySelector(".e-ftrchk.e-mask-ftrchk").style.cssText="width: 100%; height: "+e+";",this.spinner.parentElement.querySelector(".e-checkbox-wrapper").style.width="100%",(h=[].slice.call(this.spinner.parentElement.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)")))[0].classList.add("e-mask-checkbox-filter-intent"),h[1].classList.add("e-mask-checkbox-filter-span-intent")),this.spinner.insertBefore(i,this.cBox);for(var d=0;t&&d<t;d++){i.innerHTML+=l,i.lastElementChild.style.cssText="width: 100%; height: "+e+";",i.lastElementChild.querySelector(".e-checkbox-wrapper").style.width="100%";var h=[].slice.call(i.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)"));h[0].classList.add("e-mask-checkbox-filter-intent"),h[1].classList.add("e-mask-checkbox-filter-span-intent")}this.cBox&&(i.scrollTop=this.cBox.scrollTop)},o.prototype.removeMask=function(){var e=this.dialogObj.element.querySelectorAll(".e-mask-ftrchk");if(e.length)for(var i=0;i<e.length;i++)t.remove(e[i]);this.dialogObj.element.querySelector(".e-checkboxlist.e-masklist")&&t.remove(this.dialogObj.element.querySelector(".e-checkboxlist.e-masklist"))},o.prototype.infiniteScrollHandler=function(){var e=this.cBox;e.scrollTop>=e.scrollHeight-e.offsetHeight&&!this.infiniteQueryExecutionPending&&this.infiniteLoadedElem.length<=this.infiniteSkipCnt+this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount&&(!this.infiniteDataCount||this.infiniteDataCount>this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)?(this.makeInfiniteScrollRequest(),this.prevInfiniteScrollDirection="down"):e.scrollTop>=e.scrollHeight-e.offsetHeight&&!this.infiniteQueryExecutionPending&&this.infiniteLoadedElem.length>this.infiniteSkipCnt+this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount?(gt([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt+="down"===this.prevInfiniteScrollDirection?this.parent.filterSettings.itemsCount:3*this.parent.filterSettings.itemsCount,q(this.cBox,this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.parent.filterSettings.itemsCount+this.infiniteSkipCnt)),this.prevInfiniteScrollDirection="down"):0===e.scrollTop&&!this.infiniteInitialLoad&&!this.infiniteSearchValChange&&this.infiniteSkipCnt&&this.infiniteLoadedElem.length&&this.infiniteLoadedElem.length>3*this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount?(gt([].slice.call(this.cBox.children).splice(2*this.parent.filterSettings.itemsCount,this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt-="up"===this.prevInfiniteScrollDirection?this.parent.filterSettings.itemsCount:3*this.parent.filterSettings.itemsCount,ft([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up"):0===e.scrollTop&&!this.infiniteInitialLoad&&!this.infiniteSearchValChange&&this.infiniteSkipCnt&&this.infiniteLoadedElem.length&&this.cBox.children.length<3*this.parent.filterSettings.itemsCount&&(gt([].slice.call(this.cBox.children).splice(2*this.parent.filterSettings.itemsCount,this.infiniteDataCount%this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt=(Math.floor(this.infiniteDataCount/this.parent.filterSettings.itemsCount)-3)*this.parent.filterSettings.itemsCount,ft([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up")},o.prototype.makeInfiniteScrollRequest=function(e){var t=this;!this.infiniteInitialLoad&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator?setTimeout(function(){t.infiniteQueryExecutionPending&&t.showMask()},500):this.infiniteInitialLoad||(n.createSpinner({target:this.spinner,cssClass:this.parent.cssClass?this.parent.cssClass:null},this.parent.createElement),n.showSpinner(this.spinner));if(this.infiniteQuery&&this.infiniteQuery.queries&&this.infiniteQuery.queries.length)for(var i=0;i<this.infiniteQuery.queries.length;i++)"onTake"!==this.infiniteQuery.queries[i].fn&&"onSkip"!==this.infiniteQuery.queries[i].fn||(this.infiniteQuery.queries.splice(i,1),i--);var r=!!e;if(e=e||this.infiniteQuery,this.infiniteInitialLoad||this.infiniteSearchValChange?this.infiniteSkipCnt=0:this.infiniteSkipCnt+=this.parent.filterSettings.itemsCount,e.skip(this.infiniteSkipCnt),this.infiniteInitialLoad||this.infiniteSearchValChange?(e.take(3*this.parent.filterSettings.itemsCount),this.infiniteSkipCnt+=2*this.parent.filterSettings.itemsCount):e.take(this.parent.filterSettings.itemsCount),!r)if(this.parent.dataSource&&"result"in this.parent.dataSource){var s={requestType:"filterchoicerequest",query:e,filterChoiceCount:null,filterModel:this};this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(s.filterChoiceCount=this.parent.filterSettings.itemsCount),this.filterEvent(s,e)}else this.processDataOperation(e),this.infiniteQueryExecutionPending=!0},o.prototype.processDataOperation=function(e,t){var n=this;this.options.dataSource=this.options.dataSource instanceof i.DataManager?this.options.dataSource:new i.DataManager(this.options.dataSource);var r=[],s=[];if(this.isForeignColumn(this.options.column)&&t){var o="result"in this.options.column.dataSource?new i.DataManager(this.options.column.dataSource.result):this.options.column.dataSource;this.foreignKeyQuery.params=e.params,r.push(o.executeQuery(this.foreignKeyQuery)),s.push(function(e){return n.foreignKeyData=e})}if(this.addInfiniteScrollEvent(e),this.infiniteRenderMod&&this.infiniteInitialLoad&&!this.options.isRemote){var a=this.isForeignColumn(this.options.column)?this.options.foreignKeyValue:this.options.column.field;this.options.dataSource.executeQuery((new i.Query).sortBy(a,i.DataUtil.fnAscending)).then(function(t){n.options.dataSource.dataSource.json=t.result,n.executeQueryOperations(e,r,s)})}else this.executeQueryOperations(e,r,s)},o.prototype.executeQueryOperations=function(e,i,n){var r=this,s=this.options.dataManager.adaptor.getModuleName;i.push(this.options.dataSource.executeQuery(e)),n.push(this.dataSuccess.bind(this));var o=0;Promise.all(i).then(function(e){r.infiniteQueryExecutionPending=!r.infiniteRenderMod&&r.infiniteQueryExecutionPending;for(var i=0;i<e.length;i++)r.infiniteDataCount=r.infiniteRenderMod&&!r.infiniteDataCount?e[i].count:r.infiniteDataCount,s&&"ODataV4Adaptor"===s()&&r.searchInputArgs&&""!==r.searchInputArgs.element.value&&!t.isNullOrUndefined(e[parseInt(i.toString(),10)].actual)?n[o++](e[parseInt(i.toString(),10)].actual):n[o++](e[parseInt(i.toString(),10)].result)}).catch(function(){r.infiniteRenderMod&&r.parent.filterSettings&&"Shimmer"===r.parent.filterSettings.loadingIndicator&&r.parent.showMaskRow(void 0,r.dialogObj.element)})},o.prototype.dataSuccess=function(e){if(this.infiniteInitialLoad||!this.infiniteDataCount||!(this.infiniteSkipCnt>=this.infiniteDataCount&&!this.infiniteSearchValChange||0===e.length)){this.fullData=e;var t={dataSource:this.fullData,executeQuery:!0,field:this.options.field};if(this.parent.notify("beforeCheckboxRenderer",t),t.executeQuery){var r=new i.Query;this.customQuery||this.queryGenerate(r);var s=new i.DataManager(t.dataSource).executeLocal(r),a=this.options.column;this.filteredData=o.getDistinct(s,this.options.field,a,this.foreignKeyData,this).records||[]}var l=t.executeQuery?this.filteredData:t.dataSource;this.processDataSource(null,!0,l,t),(this.infiniteRenderMod&&this.infiniteInitialLoad||!this.infiniteRenderMod)&&(this.sInput?this.sInput.focus():this.dlg.querySelector(".e-chk-hidden")&&this.dlg.querySelector(".e-ftrchk")&&(this.dlg.querySelector(".e-chk-hidden").focus(),this.dlg.querySelector(".e-ftrchk").classList.add("e-chkfocus"))),(this.infiniteInitialLoad||this.infiniteSearchValChange)&&(this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1);var d={requestType:"filterAfterOpen",columnName:this.options.field,columnType:this.options.type};d.filterModel=this,this.parent.notify(Ai,d),this.isCheckboxFilterTemplate&&n.hideSpinner(this.spinner)}},o.prototype.queryGenerate=function(e){if(this.parent.searchSettings&&this.parent.searchSettings.key.length){var i=this.options.dataManager.adaptor.getModuleName;if(!t.isNullOrUndefined(this.parent.getForeignKeyColumns())&&this.parent.getForeignKeyColumns().length||!t.isNullOrUndefined(this.parent.getDataModule)&&i&&"ODataV4Adaptor"===i())this.parent.getDataModule().searchQuery(e);else{var n=this.parent.searchSettings,r=n.fields.length?n.fields:this.options.columns.map(function(e){return e.field});e.search(n.key,r,n.operator,n.ignoreCase,n.ignoreAccent)}}if(this.options.filteredColumns.length){for(var s=[],o=0;o<this.options.filteredColumns.length;o++){var a=this.options.filteredColumns[parseInt(o.toString(),10)];this.options.uid?(a.uid=a.uid||this.parent.getColumnByField(a.field).uid,a.uid!==this.options.uid&&s.push(this.options.filteredColumns[parseInt(o.toString(),10)])):a.field!==this.options.field&&s.push(this.options.filteredColumns[parseInt(o.toString(),10)])}var l=this.getPredicateFromCols(s);l&&e.where(l)}},o.prototype.processDataSource=function(e,t,i,r){n.showSpinner(this.spinner),this.updateResult();var s={dataSource:this.fullData,isCheckboxFilterTemplate:!1,column:this.options.column,element:this.cBox,type:this.options.type,format:this.options.type,btnObj:this.options.isResponsiveFilter?null:this.dialogObj.btnObj[0],searchBox:this.searchBox};this.parent.notify("beforeCheckboxfilterRenderer",s),this.isCheckboxFilterTemplate=s.isCheckboxFilterTemplate,this.isCheckboxFilterTemplate?this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask():this.createFilterItems(i,t,r)},o.prototype.processSearch=function(e){this.processDataOperation(e)},o.prototype.updateResult=function(){this.result={};var e=this.infiniteRenderMod&&this.existingPredicate[this.options.field]?this.getPredicateFromCols(this.existingPredicate[this.options.field]):this.getPredicateFromCols(this.options.filteredColumns),t=new i.Query;e&&t.where(e),this.parent.notify("before-checkbox-renderer-query",{query:t});for(var n=0,r=new i.DataManager(this.fullData).executeLocal(t);n<r.length;n++){var s=r[n];this.result[fe(this.options.field,s)]=!0}},o.prototype.clickHandler=function(n){var r;t.isNullOrUndefined(e.Global.timer)||clearTimeout(e.Global.timer);var s=n.target;if(t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||!F(s,"e-mask-ftrchk")){var o=F(s,"e-checkbox-wrapper");if(F(s,"e-searchbox")&&this.searchBoxClick(n),o&&!this.isCheckboxFilterTemplate){var a=o.querySelector(".e-selectall");if(a)this.updateAllCBoxes(!a.classList.contains("e-check"));else if(se(o.parentElement),this.infiniteRenderMod&&!o.parentElement.querySelector(".e-add-current")){this.localInfiniteSelectionInteracted=!0;var l=this.options.allowCaseSensitive,d=o.parentElement.querySelector(".e-frame").previousSibling,h=d.checked?"equal":"notequal",p=d.checked?"or":"and",c={field:this.options.field,predicate:p,uid:this.options.uid,operator:h,type:this.options.type,matchCase:l,ignoreAccent:this.options.ignoreAccent},u=this.values[F(d,"e-ftrchk").getAttribute("data-uid")];if(this.updateInfiniteManualSelectPred(c,u),this.infiniteRenderMod&&!this.options.isRemote&&this.options.parentTotalDataCount&&this.infiniteUnloadParentExistPred.length){var g=this.getPredicateFromCols((r=this.options.filteredColumns).concat.apply(r,this.infiniteManualSelectMaintainPred)),f=new i.Query;g&&f.where(g);var m=new i.DataManager(this.infinitePermenantLocalData).executeLocal(f);this.options.parentTotalDataCount!==m.length&&(this.options.parentTotalDataCount=m.length),!this.options.parentTotalDataCount&&this.infiniteUnloadParentExistPred.length&&(this.infiniteUnloadParentExistPred=[])}!this.infiniteUnloadParentExistPred.length||this.options.parentTotalDataCount!==this.infiniteDataCount&&this.options.parentTotalDataCount||(this.infiniteUnloadParentExistPred=[])}this.updateIndeterminatenBtn(),o.querySelector(".e-chk-hidden").focus()}this.setFocus(F(o,"e-ftrchk"))}},o.prototype.updateInfiniteManualSelectPred=function(e,i){for(var n=0;n<this.infiniteManualSelectMaintainPred.length;n++){var r=this.infiniteManualSelectMaintainPred[n];if(r.value+""==i+""&&("equal"===r.operator||"notequal"===r.operator)){this.infiniteManualSelectMaintainPred.splice(n,1);break}}("or"!==e.predicate||this.localInfiniteSelectAllClicked&&this.infiniteLocalSelectAll)&&("and"!==e.predicate||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll)||(this.infiniteManualSelectMaintainPred.push(t.extend({},{value:i},e)),"or"===e.predicate?this.options.parentTotalDataCount++:this.options.parentTotalDataCount--)},o.prototype.focusNextOrPrev=function(e,t){var i=t[(("ArrowUp"===e.key?t.indexOf(document.activeElement)-1:t.indexOf(document.activeElement)+1)+t.length)%t.length];if(i){i.focus();var n=i.classList.contains("e-chk-hidden")?F(i,"e-ftrchk"):i;this.setFocus(n)}},o.prototype.keyupHandler=function(e){if("Tab"!==e.key&&("ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey)||this.setFocus(F(e.target,"e-ftrchk")),("ArrowUp"===e.key||"ArrowDown"===e.key)&&!e.altKey&&this.parent.filterSettings&&"CheckBox"===this.parent.filterSettings.type){e.preventDefault();var t=Array.from(this.dlg.querySelectorAll('input, button, [tabindex]:not([tabindex="-1"])'));this.focusNextOrPrev(e,t)}},o.prototype.setFocus=function(e){var t=this.dlg.querySelector(".e-chkfocus");t&&t.classList.remove("e-chkfocus"),e&&e!==t&&e.classList.add("e-chkfocus")},o.prototype.updateAllCBoxes=function(e){this.infiniteRenderMod&&(this.localInfiniteSelectAllClicked=!0,this.infiniteLocalSelectAll=e,this.infiniteUnloadParentExistPred=[],this.infiniteManualSelectMaintainPred=[]);for(var t=0,i=this.infiniteRenderMod?this.infiniteLoadedElem.map(function(e){return e.querySelector(".e-frame")}):[].slice.call(this.cBox.querySelectorAll(".e-frame:not(.e-add-current)"));t<i.length;t++){var n=i[t];le(n,e),oe(n.previousSibling,e)}},o.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())},o.prototype.createCheckbox=function(e,i,n){var r=i?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);oe(r.querySelector("input"),i);var s=r.querySelector(".e-label"),o=Se({},n,{column:this.options.column,parent:this.parent}),a=this.parent.getModuleName;s[""+(t.isNullOrUndefined(a)||"spreadsheet"!==a()?this.options.disableHtmlEncode?"textContent":"innerHTML":"textContent")]=!t.isNullOrUndefined(e)&&e.toString().length?this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e:this.getLocalizedLabel("Blanks");var l=z("cbox");if(s.setAttribute("id",l+"cboxLabel"),r.querySelector("input").setAttribute("aria-labelledby",s.id),s.innerHTML===this.getLocalizedLabel("Blanks")&&(this.isBlanks=!0),"boolean"==typeof e&&(s.innerHTML=!0===e?this.getLocalizedLabel("FilterTrue"):this.getLocalizedLabel("FilterFalse")),t.addClass([s],["e-checkboxfiltertext"]),this.options.template&&n[this.options.column.field]!==this.getLocalizedLabel("SelectAll")&&n[this.options.column.field]!==this.getLocalizedLabel("AddCurrentSelection")){s.innerHTML="";var d=this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate&&!(this.options.column.filter.itemTemplate.prototype&&this.options.column.filter.itemTemplate.prototype.CSPTemplate),h=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;d||h?(this.options.template(o,this.parent,"filterItemTemplate",null,null,null,s),this.parent.renderTemplates()):q(s,this.options.template(o,this.parent,"filterItemTemplate",null,null,null,null,this.parent.root))}return r},o.prototype.updateIndeterminatenBtn=function(){var e=this.infiniteRenderMod?this.infiniteLoadedElem.length:this.cBox.children.length-1,i=[],n=!1,r=this.infiniteRenderMod?this.sBox.querySelector(".e-selectall"):this.cBox.querySelector(".e-selectall"),s=this.infiniteRenderMod?this.infiniteLoadedElem.filter(function(e){return e.querySelector(".e-check")}).length:this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)").length;this.cBox.querySelector(".e-add-current")&&(e-=1);var o;this.options.isResponsiveFilter||((o=this.dialogObj.btnObj[0]).disabled=!1);var a=r.previousSibling;oe(a,!1),a.indeterminate=!1,!this.infiniteRenderMod||""!==this.sInput.value||this.options.parentCurrentViewDataCount||this.localInfiniteSelectionInteracted||this.localInfiniteSelectAllClicked&&(this.infiniteLocalSelectAll||s)||e===s&&e!==s?this.infiniteRenderMod&&this.infiniteLoadedElem.length<this.infiniteDataCount&&this.infiniteUnloadParentExistPred.length&&(!s||e===s)&&this.infiniteLocalSelectAll&&(s?e+=this.infiniteUnloadParentExistPred.length:s+=this.infiniteUnloadParentExistPred.length):s=0,e===s?(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),i=["e-check"],oe(a,!0)):s?(i=["e-stop"],a.indeterminate=!0):(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!1,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),i=["e-uncheck"],n=!0,o&&(o.disabled=!0)),o&&(this.filterState=!o.disabled,o.dataBind()),t.removeClass([r],["e-check","e-stop","e-uncheck"]),t.addClass([r],i),this.parent.notify(Pi,{disabled:n})},o.prototype.createFilterItems=function(e,r,s){var o,a,l,d,h=this.options.dataManager.adaptor.getModuleName,p=this.parent.createElement("div"),c=!1;this.options.isResponsiveFilter||(d=this.dialogObj.btnObj[0]);var u=-1,g="ejValue";s.executeQuery||(g=s.field);for(E=0;E<e.length;E++){var f=t.getValue(g,e[parseInt(E.toString(),10)]);if((""===f||t.isNullOrUndefined(f))&&(u+=1),h&&"ODataV4Adaptor"===h()){var m=t.getValue("dataObj.groupCount",e[parseInt(E.toString(),10)]);t.isNullOrUndefined(m)||(this.infiniteOdataCount+=m)}}if(this.infiniteRenderMod||(this.itemsCnt=-1!==u?e.length-u:e.length),this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask(),e.length&&!this.renderEmpty){var y=this.getLocalizedLabel("SelectAll"),v=this.cBox.querySelector(".e-checkfltrnmdiv");v&&v.classList.remove("e-checkfltrnmdiv");var S=this.createCheckbox(y,!1,(o={},o[this.options.field]=y,o));this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?t.addClass([S],this.parent.cssClass.split(" ")):t.addClass([S],[this.parent.cssClass])),this.infiniteInitialLoad||!this.infiniteRenderMod?((P=ae(z("cbox"),S,"e-ftrchk")).querySelector(".e-frame").classList.add("e-selectall"),this.infiniteRenderMod?(P.classList.add("e-infinitescroll"),this.parent.enableAdaptiveUI&&(this.spinner.style.height=this.spinner.offsetHeight-mt(this.cBox)+"px"),this.sBox.insertBefore(P,this.spinner)):p.appendChild(P)):this.sBox.querySelector(".e-ftrchk .e-selectall")&&(this.sBox.querySelector(".e-ftrchk .e-selectall").previousSibling.disabled=!1,this.sBox.querySelector(".e-ftrchk .e-selectall").parentElement.classList.remove("e-checkbox-disabled"));var C=new i.Predicate("field","equal",this.options.field);this.options.foreignKeyValue&&(C=C.or("field","equal",this.options.foreignKeyValue));var w=new i.DataManager(this.options.filteredColumns).executeLocal((new i.Query).where(C)).length;if(this.sInput&&this.sInput.value){var b=this.createCheckbox(this.getLocalizedLabel("AddCurrentSelection"),!1,(a={},a[this.options.field]=this.getLocalizedLabel("AddCurrentSelection"),a));if(this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?t.addClass([b],this.parent.cssClass.split(" ")):t.addClass([b],[this.parent.cssClass])),this.infiniteRenderMod&&!t.isNullOrUndefined(this.sBox.children[2])&&this.sBox.children[2].innerText!==this.getLocalizedLabel("AddCurrentSelection")||!this.infiniteRenderMod){var I=ae(z("cbox"),b,"e-ftrchk");if(I.querySelector(".e-frame").classList.add("e-add-current"),this.infiniteRenderMod){I.classList.add("e-infinitescroll"),this.sBox.insertBefore(I,this.spinner);var x=this.spinner.querySelector(".e-checkboxlist"),R=Math.ceil(I.getBoundingClientRect().height);x.style.height=parseInt(getComputedStyle(x).height.split("px")[0],10)-R+"px",x.style.minHeight=x.style.height}else p.appendChild(I)}else this.sBox.querySelector(".e-ftrchk .e-add-current")&&(this.sBox.querySelector(".e-ftrchk .e-add-current").previousSibling.disabled=!1,this.sBox.querySelector(".e-ftrchk .e-add-current").parentElement.classList.remove("e-checkbox-disabled"))}else if(this.infiniteRenderMod&&!t.isNullOrUndefined(this.sBox.children[2])&&this.sBox.children[2].innerText===this.getLocalizedLabel("AddCurrentSelection")){var x=this.spinner.querySelector(".e-checkboxlist"),D=Math.ceil(this.sBox.children[2].getBoundingClientRect().height);x.style.height=parseInt(getComputedStyle(x).height.split("px")[0],10)+D+"px",x.style.minHeight=x.style.height,t.remove(this.sBox.children[2])}for(var T=void 0,E=0;E<e.length;E++){var O=z("cbox");this.values[""+O]=t.getValue(g,e[parseInt(E.toString(),10)]);var k=t.getValue(this.options.field,e[parseInt(E.toString(),10)]);if(this.options.formatFn){if("dateonly"===this.options.type&&!t.isNullOrUndefined(k)){var A=k.split(/[^0-9.]/);k=new Date(parseInt(A[0],10),parseInt(A[1],10)-1,parseInt(A[2],10))}k=this.valueFormatter.toView(k,this.options.formatFn)}var F={value:k,column:this.options.column,data:e[parseInt(E.toString(),10)]};if(this.parent.notify("filter-cbox-value",F),""===(k=F.value)||t.isNullOrUndefined(k)){if(T)continue;T=!0}this.infiniteRenderMod&&this.updateInfiniteUnLoadedCheckboxExistPred(k,this.infiniteUnloadParentExistPred);var M=this.localInfiniteSelectAllClicked?this.createCheckbox(k,this.infiniteLocalSelectAll,t.getValue("dataObj",e[E])):this.createCheckbox(k,this.getCheckedState(w,this.values[""+O]),t.getValue("dataObj",e[E]));p.appendChild(ae(O,M,"e-ftrchk")),this.infiniteRenderMod&&(p.lastChild.style.height=mt(this.cBox)+"px")}var L=this.cBox.scrollTop;!this.infiniteRenderMod||this.infiniteSearchValChange?this.cBox.innerHTML="":this.infiniteRenderMod&&this.cBox.children.length&>([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteRenderMod&&((l=this.infiniteLoadedElem).push.apply(l,[].slice.call(p.children)),this.itemsCnt=-1!==u?this.infiniteLoadedElem.length-u:this.infiniteLoadedElem.length),this.infiniteUnloadParentExistPred.length&&(this.infiniteLoadedElem.length>=this.infiniteDataCount||!this.options.parentCurrentViewDataCount||this.options.parentTotalDataCount===this.infiniteDataCount&&this.options.parentCurrentViewDataCount)&&(this.infiniteUnloadParentExistPred=[]),q(this.cBox,[].slice.call(p.children)),this.infiniteRenderMod&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=Math.round(L-this.cBox.scrollTop)),this.updateIndeterminatenBtn(),this.infiniteRenderMod?c=!(!d||!d.disabled):(d&&(d.disabled=!1),c=!1)}else{if(p.appendChild(this.parent.createElement("span",{innerHTML:this.getLocalizedLabel("NoResult")})),this.cBox.innerHTML="",this.infiniteRenderMod){var P=this.sBox.querySelector(".e-ftrchk .e-selectall");if(P){var N=P.parentElement.parentElement;P.classList.contains("e-check")?se(N):P.classList.contains("e-stop")&&(se(N),P.classList.remove("e-stop"),se(N)),P.previousSibling.disabled=!0,P.parentElement.classList.add("e-checkbox-disabled")}var B=this.sBox.querySelector(".e-ftrchk .e-add-current");if(B){var U=B.parentElement.parentElement;B.classList.contains("e-check")&&se(U),B.previousSibling.disabled=!0,B.parentElement.classList.add("e-checkbox-disabled")}}this.cBox.appendChild(this.parent.createElement("div",{className:"e-checkfltrnmdiv"})),q(this.cBox.children[0],[].slice.call(p.children)),d&&(d.disabled=!0),c=!0,this.filterState=!c}d&&e.length&&(this.filterState=!d.disabled,d.dataBind());var H={requestType:"filterchoicerequest",dataSource:this.renderEmpty?[]:e};H.filterModel=this,this.parent.notify(Ai,H),this.parent.notify(Pi,{disabled:c}),this.infiniteRenderMod&&this.infiniteInitialLoad&&(this.cBox.style.marginTop="0px"),n.hideSpinner(this.spinner),h&&"ODataV4Adaptor"===h()&&this.infiniteOdataCount===this.options.parentTotalDataCount&&this.infiniteDataCount!==this.options.parentTotalDataCount&&(this.infiniteDataCount=this.infiniteLoadedElem.length)},o.prototype.updateInfiniteUnLoadedCheckboxExistPred=function(e,i){for(var n=0;n<i.length;n++){var r=i[n],s=r.value instanceof Date?this.valueFormatter.toView(r.value,this.options.formatFn):r.value,o=this.options.column;if(o.isForeignColumn()){var a=he(o,{},s,this.foreignKeyData)[0];e=t.getValue(o.foreignKeyField,a)}e!==s||"equal"!==r.operator&&"notequal"!==r.operator||(this.infiniteManualSelectMaintainPred.push(i[n]),i.splice(n,1),n--)}},o.prototype.getCheckedState=function(e,t){if(this.isFiltered&&e){var i=!(!this.sInput||!this.sInput.value)||this.result[""+t];return this.infiniteRenderMod?i:"notequal"===this.options.operator?!i:i}return!0},o.getDistinct=function(e,n,r,s,o){for(var a,l=e.length,d=[],h={},p=!(!r||!r.isForeignColumn)&&r.isForeignColumn();l--;){var c="string"!=typeof(a=fe(n,a=e[parseInt(l.toString(),10)]))||t.isNullOrUndefined(o)||t.isNullOrUndefined(o.parent)||t.isNullOrUndefined(o.parent.filterSettings)||t.isNullOrUndefined(o.parent.filterSettings.enableCaseSensitivity)?a:a.toLowerCase();if(!(c in h)){var u={};if(u.ejValue=a,h[""+c]=!0,p){var g=he(r,{},a,s)[0];t.setValue("foreignKeyData",g,e[parseInt(l.toString(),10)]),a=t.getValue(r.foreignKeyValue,g)}t.setValue(n,t.isNullOrUndefined(a)?null:a,u),t.setValue("dataObj",e[parseInt(l.toString(),10)],u),d.push(u)}}return i.DataUtil.group(i.DataUtil.sort(d,n,i.DataUtil.fnAscending),"ejValue")},o.getPredicate=function(e){for(var t=i.DataUtil.distinct(e,"field",!0)||[],n=[],r={},s=0;s<t.length;s++)0!==(n=new i.DataManager(e).executeLocal((new i.Query).where("field","equal",t[parseInt(s.toString(),10)].field))).length&&(r[t[parseInt(s.toString(),10)].field]=o.generatePredicate(n));return r},o.generatePredicate=function(e){var n,r=e?e.length:0,s=o.updateDateFilter(e[0]);s.ignoreAccent=!t.isNullOrUndefined(s.ignoreAccent)&&s.ignoreAccent,n="date"===s.type||"datetime"===s.type||"dateonly"===s.type?ue(s,s.type):s.ejpredicate?s.ejpredicate:new i.Predicate(s.field,s.operator,s.value,!o.getCaseValue(s),s.ignoreAccent);for(var a=1;a<r;a++)e[parseInt(a.toString(),10)]=o.updateDateFilter(e[parseInt(a.toString(),10)]),r>2&&a>1&&("or"===e[a].predicate&&"or"===e[a-1].predicate||"and"===e[a].predicate&&"and"===e[a-1].predicate)?"date"===e[a].type||"datetime"===e[a].type||"dateonly"===e[a].type?n.predicates.push(ue(e[parseInt(a.toString(),10)],e[a].type)):n.predicates.push(new i.Predicate(e[a].field,e[parseInt(a.toString(),10)].operator,e[parseInt(a.toString(),10)].value,!o.getCaseValue(e[parseInt(a.toString(),10)]),e[parseInt(a.toString(),10)].ignoreAccent)):n="date"===e[a].type||"datetime"===e[a].type||"dateonly"===e[a].type?n[e[parseInt(a.toString(),10)].predicate](ue(e[parseInt(a.toString(),10)],e[parseInt(a.toString(),10)].type),e[parseInt(a.toString(),10)].type,e[parseInt(a.toString(),10)].ignoreAccent):e[parseInt(a.toString(),10)].ejpredicate?n[e[parseInt(a.toString(),10)].predicate](e[parseInt(a.toString(),10)].ejpredicate):n[e[parseInt(a.toString(),10)].predicate](e[parseInt(a.toString(),10)].field,e[parseInt(a.toString(),10)].operator,e[parseInt(a.toString(),10)].value,!o.getCaseValue(e[parseInt(a.toString(),10)]),e[parseInt(a.toString(),10)].ignoreAccent);return n||null},o.getCaseValue=function(e){return t.isNullOrUndefined(e.matchCase)?!("string"===e.type||t.isNullOrUndefined(e.type)&&"string"==typeof e.value):e.matchCase},o.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||"dateonly"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e},o}(),es=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ts=function(e){function d(t,i){var n=e.call(this,t)||this;return n.childRefs=[],n.eventHandlers={},n.isDevice=!1,n.focusedMenuItem=null,n.customFilterOperators=i,n.isExcel=!0,n}return es(d,e),d.prototype.getCMenuDS=function(e,i){var n={number:["Equal","NotEqual","","LessThan","LessThanOrEqual","GreaterThan","GreaterThanOrEqual","Between","","CustomFilter"],string:["Equal","NotEqual","","StartsWith","EndsWith","","Contains","NotContains","","CustomFilter"]};n.date=n.number,n.datetime=n.number,n.dateonly=n.number;var r=[];if(!t.isNullOrUndefined(e))for(var s=0;s<n[""+e].length;s++)n[""+e][parseInt(s.toString(),10)].length?i?r.push({text:this.getLocalizedLabel(n[""+e][parseInt(s.toString(),10)])+"...",iconCss:"e-icons e-icon-check "+(i===n[""+e][parseInt(s.toString(),10)].toLowerCase()?"":"e-emptyicon")}):r.push({text:this.getLocalizedLabel(n[""+e][parseInt(s.toString(),10)])+"..."}):r.push({separator:!0});return r},d.prototype.destroy=function(){if(this.dlg&&(this.unwireExEvents(),e.prototype.closeDialog.call(this)),!this.isDevice&&this.menuObj){var t=this.menuObj.element.querySelector("li.e-focused");t&&F(t,"e-excel-menu")||this.destroyCMenu()}this.dlgObj&&!this.dlgObj.isDestroyed&&this.removeDialog()},d.prototype.createMenu=function(e,i,n,r){var s={string:"TextFilter",date:"DateFilter",dateonly:"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"),this.parent.cssClass&&this.menu.classList.add(this.parent.cssClass);var o=this.parent.createElement("ul"),a=i?"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"),d=this.parent.getColumnByField(r.field).allowSorting,h=d&&"ascending"!==l?"e-excel-ascending":"e-disabled e-excel-ascending",p=d&&"descending"!==l?"e-excel-descending":"e-disabled e-excel-descending",c="string"===e?this.getLocalizedLabel("SortAtoZ"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByOldest"):this.getLocalizedLabel("SortSmallestToLargest"),u="string"===e?this.getLocalizedLabel("SortZtoA"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByNewest"):this.getLocalizedLabel("SortLargestToSmallest");o.appendChild(this.createMenuElem(c,h,"e-sortascending")),o.appendChild(this.createMenuElem(u,p,"e-sortdescending"));var g=this.parent.createElement("li",{className:"e-separator e-menu-item e-excel-separator"});o.appendChild(g)}this.options.isResponsiveFilter||o.appendChild(this.createMenuElem(this.getLocalizedLabel("ClearFilter"),i?"":"e-disabled",a)),"boolean"!==e&&o.appendChild(this.createMenuElem(this.getLocalizedLabel(s[""+e]),"e-submenu",!t.isNullOrUndefined(e)&&n&&this.ensureTextFilter()?"e-icon-check":a+" 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:i})},d.prototype.createMenuElem=function(e,t,i,n){var r=this.parent.createElement("li",{className:t+" e-menu-item"});return r.innerHTML=e,r.tabIndex=r.classList.contains("e-disabled")?-1:0,r.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+i,attrs:{"aria-hidden":"true"}}),r.firstChild),n&&r.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),r},d.prototype.wireExEvents=function(){t.Browser.isDevice||t.EventHandler.add(this.dlg,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.dlg,"click",this.clickExHandler,this),t.EventHandler.add(this.dlg,"keyup",this.keyUp,this),t.EventHandler.add(this.dlg,"keydown",this.keyDown,this)},d.prototype.unwireExEvents=function(){t.Browser.isDevice||t.EventHandler.remove(this.dlg,"mouseover",this.hoverHandler),t.EventHandler.remove(this.dlg,"click",this.clickExHandler),t.EventHandler.remove(this.dlg,"keyup",this.keyUp),t.EventHandler.remove(this.dlg,"keydown",this.keyDown)},d.prototype.clickExHandler=function(e){var i={string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"},n=F(e.target,"e-menu-item");n&&(this.getLocalizedLabel("ClearFilter")===n.innerText.trim()?(this.clearFilter(),this.closeDialog()):(this.options.isResponsiveFilter||t.Browser.isDevice)&&this.getLocalizedLabel(i[this.options.type])===n.innerText.trim()&&this.hoverHandler(e))},d.prototype.focusNextOrPrevElement=function(e,t,i){var n=t[(("ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey?t.indexOf(document.activeElement)-1:t.indexOf(document.activeElement)+1)+t.length)%t.length];if(n){n.focus();var r=n.classList.contains("e-chk-hidden")?"e-chkfocus":i,s=n.classList.contains("e-chk-hidden")?F(n,"e-ftrchk"):F(n,"e-menu-item");this.excelSetFocus(s,r)}},d.prototype.keyUp=function(e){if("Tab"===e.key&&e.shiftKey||"Tab"===e.key){var t=e.target.classList.contains("e-chk-hidden")?"e-chkfocus":"e-menufocus",i=e.target.classList.contains("e-menu-item")?F(e.target,"e-menu-item"):F(e.target,"e-ftrchk");this.excelSetFocus(i,t)}else if("ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey)"Enter"!==e.key&&"ArrowRight"!==e.code||!e.target.classList.contains("e-menu-item")||(e.preventDefault(),e.target.click(),e.target.classList.contains("e-submenu")&&(this.hoverHandler(e),this.menuObj.element.querySelector(".e-menu-item").focus(),this.excelSetFocus(F(this.menuObj.element.querySelector(".e-menu-item"),"e-menu-item"),"e-focused"),this.focusedMenuItem=this.menuObj.element.querySelector(".e-menu-item")));else{e.preventDefault();var n=Array.from(this.dlg.querySelectorAll('input, button, [tabindex]:not([tabindex="-1"]), .e-menu-item:not(.e-disabled):not(.e-separator)'));this.focusNextOrPrevElement(e,n,"e-menufocus")}},d.prototype.keyDown=function(e){"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.preventDefault()},d.prototype.excelSetFocus=function(e,t){var i=this.cmenu.querySelector("."+t),n=this.menu.querySelector("."+t);i&&i.classList.remove(t),n&&n.classList.contains("e-menufocus")&&n.classList.remove(t),e&&e.classList.add(t)},d.prototype.destroyCMenu=function(){this.isCMenuOpen=!1,this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),t.EventHandler.remove(this.menuObj.element,"keydown",this.contextKeyDownHandler),t.remove(this.cmenu),this.parent.notify("render-responsive-cmenu",{target:null,header:"",isOpen:!1,col:this.options.column}))},d.prototype.hoverHandler=function(e){if(!this.options.isResponsiveFilter||"mouseover"!==e.type){var i,n=e.target.querySelector(".e-contextmenu"),r=F(e.target,"e-menu-item"),s=this.menu.querySelector(".e-focused");if(s&&s.classList.remove("e-focused"),r&&(r.classList.add("e-focused"),i=r.classList.contains("e-submenu")),!n){if(!i){var o=this.menu.querySelector(".e-submenu");t.isNullOrUndefined(o)||o.classList.remove("e-selected"),this.destroyCMenu()}var a=this.ensureTextFilter();if(!this.isCMenuOpen&&i){r.classList.add("e-selected"),this.isCMenuOpen=!0;var d={items:this.getCMenuDS(this.options.type,a?a.replace(/\s/g,""):void 0),select:this.selectHandler.bind(this),onClose:this.destroyCMenu.bind(this),enableRtl:this.parent.enableRtl,animationSettings:{effect:t.Browser.isDevice?"ZoomIn":"None"},beforeClose:this.preventClose.bind(this),cssClass:this.options.isResponsiveFilter&&this.parent.cssClass?"e-res-contextmenu-wrapper "+this.parent.cssClass:this.options.isResponsiveFilter?"e-res-contextmenu-wrapper":this.parent.cssClass?this.parent.cssClass:""};this.parent.element.appendChild(this.cmenu),this.menuObj=new l.ContextMenu(d),this.menuObj.isAngular=Ge(this.parent),this.menuObj.appendTo(this.cmenu),t.EventHandler.add(this.menuObj.element,"keydown",this.contextKeyDownHandler,this);var h=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){this.isDevice=!0;var f=this.getContextBounds();p.top=(window.innerHeight-f.height)/2,p.left=(window.innerWidth-f.width)/2,this.closeDialog(),this.isDevice=!1}else p.top=t.Browser.isIE?window.pageYOffset+h.top:window.scrollY+h.top,p.left=this.getCMenuYPosition(this.dlg);this.menuObj.open(p.top,p.left,e.target)}Re(this.parent.element,this.menuObj.element.parentElement)}}}},d.prototype.contextKeyDownHandler=function(e){if("Tab"===e.key&&e.shiftKey||"Tab"===e.key){e.preventDefault();var t=Array.from(this.menuObj.element.querySelectorAll('[tabindex]:not([tabindex="-1"]), .e-menu-item:not(.e-disabled):not(.e-separator)'));this.focusNextOrPrevElement(e,t,"e-focused")}else"ArrowLeft"!==e.key&&"Escape"!==e.key||(e.preventDefault(),this.menuObj.close(),this.focusedMenuItem=null,document.querySelector(".e-submenu.e-menu-item").classList.remove("e-selected"),document.querySelector(".e-submenu.e-menu-item").focus())},d.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},d.prototype.preventClose=function(e){if(this.options&&this.options.isResponsiveFilter&&e.event){var t=e.event.target,i=t.classList&&(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&&e.event.target.classList&&e.event.target.classList.contains("e-submenu")&&(e.cancel=!0)},d.prototype.getContextBounds=function(){return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},d.prototype.getCMenuYPosition=function(e){var t=this.getContextBounds().width,i=e.getBoundingClientRect(),n=this.parent.element.getBoundingClientRect(),r=i.left-t-n.left,s=i.right+t-n.right,o=e.offsetWidth-e.clientWidth;return o=o?o+1:0,(this.parent.enableRtl?r:s)<1?i.right+1-o:i.left-t-1+o},d.prototype.openDialog=function(e){var i=this;if(this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),!e.cancel){this.dialogObj.dataBind();var n=this.existingPredicate[e.field]&&this.existingPredicate[e.field].length||this.options.filteredColumns.filter(function(e){return i.options.field===e.field}).length;this.createMenu(e.type,n>0,1===n||2===n,e),this.dlg.insertBefore(this.menu,this.dlg.firstChild),this.dlg.classList.add("e-excelfilter"),this.parent&&!t.isNullOrUndefined(this.parent.getContent)&&this.parent.getContent()&&this.parent.getContent().firstElementChild.offsetHeight<this.dlg.offsetHeight&&!F(this.parent.element,"e-gantt-dialog")&&_e(this.parent,this.dialogObj),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.dlg.querySelectorAll(".e-menu-item").forEach(function(e){e.scrollWidth>e.clientWidth&&e.setAttribute("title",e.textContent)}),e.column.showColumnMenu&&this.parent.notify("filterDialogCreated",{}),this.wireExEvents()}},d.prototype.closeDialog=function(){this.destroy()},d.prototype.selectHandler=function(e){e.item&&(this.parent.notify("filter-cmenu-select",{}),this.menuItem=e.item,this.closeDialog(),this.renderDialogue(e))},d.prototype.renderDialogue=function(e){var i=this,r=e?e.element:void 0,s=this.options.field,o=!t.isNullOrUndefined(s)&&_(s),a=!t.isNullOrUndefined(s)&&K(s),l=this.parent.createElement("div",{className:"e-xlfl-maindiv",id:o?a+"-xlflmenu":s+"-xlflmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-xlflmenu",id:o?a+"-xlfldlg":s+"-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 n.Dialog({header:this.getLocalizedLabel("CustomFilter"),isModal:!0,overlayClick:this.removeDialog.bind(this),showCloseIcon:!0,locale:this.parent.locale,closeOnEscape:!0,target:document.body,visible:!1,enableRtl:this.parent.enableRtl,open:function(){for(var e=[].slice.call(i.dlgObj.element.querySelectorAll("table.e-xlfl-table tr.e-xlfl-fields")),n=0;n<e.length;n++){var r=e[n].children[1].querySelector(".e-control"),s=e[n].querySelector(".e-dropdownlist.e-control").ej2_instances[0];"isempty"===s.value||"isnotempty"===s.value||"isnull"===s.value||"isnotnull"===s.value?r.ej2_instances[0].enabled=!1:r&&!t.isNullOrUndefined(r.getAttribute("disabled"))&&(r.ej2_instances[0].enabled=!0)}var o=i.dlgObj.element.querySelector("table.e-xlfl-table>tr");if(i.options.column.filterTemplate){var a=_(i.options.column.field)?K(i.options.column.field):i.options.column.field,l=i.parent.isReact&&"string"!=typeof i.options.column.filterTemplate&&!(i.options.column.filterTemplate.prototype&&i.options.column.filterTemplate.prototype.CSPTemplate),d=i.parent.parentDetails&&i.parent.parentDetails.parentInstObj&&i.parent.parentDetails.parentInstObj.isReact;l||d?i.parent.renderTemplates(function(){o.querySelector("#"+a+"-xlfl-frstvalue").focus()}):o.querySelector("#"+a+"-xlfl-frstvalue").focus()}},close:this.removeDialog.bind(this),created:this.createdDialog.bind(this,r,s),buttons:[{click:this.filterBtnClick.bind(this,s),buttonModel:{content:this.getLocalizedLabel("OKButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-xlfl-okbtn "+this.parent.cssClass:"e-xlfl-okbtn"}},{click:this.removeDialog.bind(this),buttonModel:{content:this.getLocalizedLabel("CancelButton"),cssClass:this.parent.cssClass?"e-xlfl-cancelbtn "+this.parent.cssClass:"e-xlfl-cancelbtn"}}],content:l,width:430,animationSettings:{effect:"None"},cssClass:this.parent.cssClass?this.parent.cssClass:""});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),Ve(this.parent,this.dlgObj),this.dlgDiv.setAttribute("aria-label",this.getLocalizedLabel("CustomFilterDialogARIA")),this.childRefs.unshift(this.dlgObj),this.dlgObj.appendTo(this.dlgDiv)},d.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}},d.prototype.removeDialog=function(){this.parent.notify("custom-filter-close",{}),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&ut(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),t.remove(this.dlgDiv),this.parent.notify("filter-dialog-close",{})},d.prototype.createdDialog=function(e,i){if(this.renderCustomFilter(e,i),this.dlgObj.element.style.left="0px",this.options.isResponsiveFilter){var n=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4;this.dlgObj.element.style.top=n+"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("customFilterOpen",{column:i,dialog:this.dialogObj});var r={column:i,dialogInstance:this.dialogObj,cancel:!1,target:e};if(this.parent.trigger("beforeCustomFilterOpen",r),r.cancel)return(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&ut(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),void t.remove(this.dlgDiv);this.dlgObj.show(),Re(this.parent.element,this.dlgObj.element.parentElement)},d.prototype.renderCustomFilter=function(e,t){var i=this.dlgObj.element.querySelector(".e-xlfl-maindiv"),n=this.parent.createElement("div",{innerHTML:this.getLocalizedLabel("ShowRowsWhere"),className:"e-xlfl-dlgfields"});i.appendChild(n);var r=this.parent.createElement("div",{innerHTML:this.options.displayName,className:"e-xlfl-fieldset"});i.appendChild(r),this.renderFilterUI(t,i)},d.prototype.filterBtnClick=function(e){var i,n,r=!t.isNullOrUndefined(e)&&_(e),s=!t.isNullOrUndefined(e)&&K(e),o=r?s:e;"string"===this.options.type&&t.isNullOrUndefined(this.options.template)?(i=this.dlgDiv.querySelector("#"+o+"-xlfl-frstvalue"),n=this.dlgDiv.querySelector("#"+o+"-xlfl-secndvalue")):(i=this.dlgDiv.querySelector("#"+o+"-xlfl-frstvalue").ej2_instances[0],n=this.dlgDiv.querySelector("#"+o+"-xlfl-secndvalue").ej2_instances[0]);var a,l=this.dlgDiv.querySelector("#"+o+"-xlfl-frstoptr").ej2_instances[0],d=this.dlgDiv.querySelector("#"+o+"-xlfl-secndoptr").ej2_instances[0];"string"===this.options.type&&(a=this.dlgDiv.querySelector("#"+o+"-xlflmtcase").ej2_instances[0].checked);var h=this.dlgDiv.querySelector("#"+o+"e-xlfl-frstpredicate").ej2_instances[0].checked?"and":"or";this.filterByColumn(this.options.field,l.value,i.value,h,a,this.options.ignoreAccent,d.value,n.value),this.removeDialog()},d.prototype.filterByColumn=function(e,n,r,s,o,a,l,d){var h,p=this.parent.getColumnByField?this.parent.getColumnByField(e):this.options.column,c=this.isForeignColumn(p)?p.foreignKeyValue:e,u=[],g={instance:this,handler:this.filterByColumn,arg1:e,arg2:n,arg3:r,arg4:s,arg5:o,arg6:a,arg7:l,arg8:d,cancel:!1};if(this.parent.notify(Fi,g),!g.cancel){u.push({field:c,predicate:s,matchCase:o,ignoreAccent:a,operator:n,value:g.arg3,type:this.options.type}),h=new i.Predicate(c,n.toLowerCase(),g.arg3,!o,a),t.isNullOrUndefined(l)||(u.push({field:c,predicate:s,matchCase:o,ignoreAccent:a,operator:l,value:g.arg8,type:this.options.type}),h=h[""+s](c,l.toLowerCase(),d,!o,a));var f={action:"filtering",filterCollection:u,field:this.options.field,ejpredicate:h,actualPredicate:u};this.isForeignColumn(p)?this.foreignKeyFilter(f,u,h):this.options.handler(f)}},d.prototype.renderOperatorUI=function(e,i,n,r,s){var a=this.parent.createElement("tr",{className:"e-xlfl-fields",attrs:{role:"row"}});i.appendChild(a);var l=this.parent.createElement("td",{className:"e-xlfl-optr"});a.appendChild(l);var d=this.parent.createElement("div",{className:"e-xlfl-optrdiv"}),h=!t.isNullOrUndefined(e)&&_(e),p=!t.isNullOrUndefined(e)&&K(e),c=this.parent.createElement("input",{id:h?p+n:e+n});d.appendChild(c),l.appendChild(d);var u=this.options.type+"Operator",g=this.customFilterOperators[""+u];this.optrData=g;var f=this.dropSelectedVal(this.options.column,r,s),m="";this.menuItem&&((m=this.menuItem.text.slice(0,-3))!==this.getLocalizedLabel("CustomFilter")&&(f=s?m:void 0),m===this.getLocalizedLabel("Between")&&(f=this.getLocalizedLabel(s?"GreaterThanOrEqual":"LessThanOrEqual")));var y=this.options.column,v=new o.DropDownList(D({dataSource:g,fields:{text:"text",value:"value"},text:f,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass?this.parent.cssClass:null},y.filter.params));v.isAngular=Ge(this.parent),this.childRefs.unshift(v);var S={open:this.dropDownOpen.bind(this),change:this.dropDownValueChange.bind(this)};return pt(c.id,[hn,"change"],S,this),v.addEventListener(hn,this.eventHandlers[c.id][hn]),v.addEventListener("change",this.eventHandlers[c.id].change),v.appendTo(c),{fieldElement:a,operator:this.getSelectedValue(f)}},d.prototype.removeHandlersFromComponent=function(e){e.element.classList.contains("e-dropdownlist")?ct(e,[hn,"change"],this):e.element.classList.contains("e-autocomplete")&&ct(e,[Ut,"focus"],this)},d.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},d.prototype.dropDownValueChange=function(e){e.element.id.includes("-xlfl-frstoptr")?this.firstOperator=e.value.toString():this.secondOperator=e.value.toString();var i=e.element.closest(".e-xlfl-fields").children[1].querySelector(".e-control"),n=e.element.ej2_instances[0];"isempty"===n.value||"isnotempty"===n.value||"isnull"===n.value||"isnotnull"===n.value?i.ej2_instances[0].enabled=!1:t.isNullOrUndefined(i.getAttribute("disabled"))||(i.ej2_instances[0].enabled=!0)},d.prototype.getFilterUIInfo=function(){return{firstOperator:this.firstOperator,secondOperator:this.secondOperator,field:this.options.field}},d.prototype.getSelectedValue=function(e){var n=new i.DataManager(this.optrData).executeLocal((new i.Query).where("text","equal",e));return t.isNullOrUndefined(n[0])?"":n[0].value},d.prototype.dropSelectedVal=function(e,t,i){var n;return n=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(n)},d.prototype.getSelectedText=function(e){var n=new i.DataManager(this.optrData).executeLocal((new i.Query).where("value","equal",e));return t.isNullOrUndefined(n[0])?"":n[0].text},d.prototype.renderFilterUI=function(e,t){var i=this.existingPredicate[""+e],n=this.parent.createElement("table",{className:"e-xlfl-table",attrs:{role:"grid"}});t.appendChild(n);var r=this.parent.createElement(dn);r.innerHTML='<col style="width: 50%"></col><col style="width: 50%"></col>',n.appendChild(r);var s=this.renderOperatorUI(e,n,"-xlfl-frstoptr",i,!0);this.firstOperator=s.operator,this.renderFlValueUI(e,s,"-xlfl-frstvalue",i,!0);var o=this.parent.createElement("tr",{className:"e-xlfl-predicate",attrs:{role:"row"}});n.appendChild(o),this.renderRadioButton(e,o,i),s=this.renderOperatorUI(e,n,"-xlfl-secndoptr",i,!1),this.secondOperator=s.operator,this.renderFlValueUI(e,s,"-xlfl-secndvalue",i,!1)},d.prototype.renderRadioButton=function(e,i,n){var s=this.parent.createElement("td",{className:"e-xlfl-radio",attrs:{colSpan:"2"}});i.appendChild(s);var o=this.parent.createElement("div",{className:"e-xlfl-radiodiv"});o.style.display="inline-block";var a=!t.isNullOrUndefined(e)&&_(e),l=!t.isNullOrUndefined(e)&&K(e),d=this.parent.createElement("input",{id:a?l+"e-xlfl-frstpredicate":e+"e-xlfl-frstpredicate",attrs:{type:"radio"}}),h=this.parent.createElement("input",{id:a?l+"e-xlfl-secndpredicate":e+"e-xlfl-secndpredicate",attrs:{type:"radio"}});o.appendChild(d),o.appendChild(h),s.appendChild(o),"string"===this.options.type&&this.renderMatchCase(e,i,s,"-xlflmtcase",n);var p=new r.RadioButton({label:this.getLocalizedLabel("AND"),name:"default",checked:!0,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass?this.parent.cssClass:""});this.childRefs.unshift(p);var c=new r.RadioButton({label:this.getLocalizedLabel("OR"),name:"default",enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass?this.parent.cssClass:""});this.childRefs.unshift(c),"and"===(n&&2===n.length?n[1].predicate:"and")?(p.checked=!0,c.checked=!1):(c.checked=!0,p.checked=!1),p.appendTo(d),c.appendTo(h),p.element.nextElementSibling.classList.add("e-xlfl-radio-and"),c.element.nextElementSibling.classList.add("e-xlfl-radio-or")},d.prototype.removeObjects=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];n&&!n.isDestroyed&&(this.removeHandlersFromComponent(n),n.destroy())}},d.prototype.renderFlValueUI=function(e,i,n,r,s){var o=this.parent.createElement("td",{className:"e-xlfl-value"});i.fieldElement.appendChild(o);var a=!t.isNullOrUndefined(e)&&_(e),l=!t.isNullOrUndefined(e)&&K(e),d=this.parent.createElement("div",{className:"e-xlfl-valuediv"}),h=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;h&&n&&(c=this.getExcelFilterData(n,c,u,r,p));var g=this.parent.isReact&&"string"!=typeof this.options.column.filterTemplate&&!(this.options.column.filterTemplate.prototype&&this.options.column.filterTemplate.prototype.CSPTemplate),f=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,m=this.parent.element.id+u.uid+"filterTemplate";if(g||f)this.options.column.getFilterTemplate()(c,this.parent,"filterTemplate",m,null,null,d);else{var y=this.options.column.getFilterTemplate()(c,this.parent,"filterTemplate",m,null,null,null,this.parent.root);q(d,y)}g||f?this.parent.renderTemplates(function(){d.querySelector("input").id=a?l+n:e+n,o.appendChild(d)}):((this.parent.isAngular?d.children[0]:d.querySelector("input")).id=a?l+n:e+n,o.appendChild(d))}else{var v=this.parent.createElement("input",{id:a?l+n:e+n});d.appendChild(v),o.appendChild(d);var S=void 0,C=void 0;r&&r.length>0&&(S=(C=2===r.length?s?r[0]:r[1]:s?r[0]:void 0)&&C.operator===i.operator?C.value:void 0,t.isNullOrUndefined(S)&&(S=void 0)),{string:this.renderAutoComplete.bind(this),number:this.renderNumericTextBox.bind(this),date:this.renderDate.bind(this),dateonly:this.renderDate.bind(this),datetime:this.renderDateTime.bind(this)}[this.options.type](this.options,e,v,S,this.parent.enableRtl)}},d.prototype.getExcelFilterData=function(e,t,i,n,r){var s="-xlfl-frstvalue"===e?0:1;if("-xlfl-frstvalue"===e||r.length>1){t={column:n instanceof Array?n[parseInt(s.toString(),10)]:n};var o=this.options.column.columnData&&r.length>1?1===this.options.column.columnData.length?0:1:s;t[this.options.field]=i.foreignKeyValue?this.options.column.columnData[parseInt(o.toString(),10)][i.foreignKeyValue]:r[parseInt(o.toString(),10)].value,this.options.foreignKeyValue&&(t[this.options.foreignKeyValue]=this.options.column.columnData[parseInt(o.toString(),10)][i.foreignKeyValue])}return t},d.prototype.renderMatchCase=function(e,i,n,s,o){var a=this.parent.createElement("div",{className:"e-xlfl-matchcasediv"});a.style.display="inline-block";var l=!t.isNullOrUndefined(e)&&_(e),d=!t.isNullOrUndefined(e)&&K(e),h=this.parent.createElement("input",{id:l?d+s:e+s,attrs:{type:"checkbox"}});a.appendChild(h),n.appendChild(a);var p=!!(o&&o.length>0)&&(o&&2===o.length?o[1].matchCase:o[0].matchCase),c=new r.CheckBox({label:this.getLocalizedLabel("MatchCase"),enableRtl:this.parent.enableRtl,checked:p,cssClass:this.parent.cssClass?this.parent.cssClass:""});this.childRefs.unshift(c),c.appendTo(h)},d.prototype.renderDate=function(e,t,i,n,r){var s=me(e.format,e.type)||e.format,o=new a.DatePicker(D({format:s,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:r,value:new Date(n),locale:this.parent.locale},e.column.filter.params));this.childRefs.unshift(o),o.appendTo(i)},d.prototype.renderDateTime=function(e,t,i,n,r){var s=me(e.format,e.type),o=new a.DateTimePicker(D({format:s,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:r,value:new Date(n),locale:this.parent.locale},e.column.filter.params));this.childRefs.unshift(o),o.appendTo(i)},d.prototype.completeAction=function(e){e.result=te(e.result)},d.prototype.renderNumericTextBox=function(e,t,i,n,r){var o=new s.NumericTextBox(D({format:e.format,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:r,value:n,locale:this.parent.locale,cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.filter.params));this.childRefs.unshift(o),o.appendTo(i)},d.prototype.renderAutoComplete=function(e,t,n,r,s){var a=this.options.column,l=this.isForeignColumn(a),d=l?a.dataSource:e.dataSource,h={value:l?a.foreignKeyValue:t},p=new o.AutoComplete(D({dataSource:d instanceof i.DataManager?d:new i.DataManager(d),fields:h,query:this.getQuery(),sortOrder:"Ascending",locale:this.parent.locale,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",autofill:!0,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:s,text:r},a.filter.params));if(d&&"result"in d){var c=Le({requestType:"stringfilterrequest"},this.getQuery());this.parent.trigger("dataStateChange",c.state),c.deffered.promise.then(function(e){p.dataSource=new i.DataManager(e)})}this.childRefs.unshift(p);var u={actionComplete:this.acActionComplete(p,t),focus:this.acFocus(p,t,e,n)};pt(n.id,[Ut,"focus"],u,this),p.addEventListener("focus",this.eventHandlers[n.id].focus),p.addEventListener(Ut,this.eventHandlers[n.id][Ut]),p.appendTo(n)},d.prototype.acActionComplete=function(e,i){return function(n){var r=!t.isNullOrUndefined(i)&&_(i);n.result=n.result.filter(function(t,i,n){return n.map(function(t){return r?st(e.fields.value,t):t[e.fields.value]}).indexOf(r?st(e.fields.value,t):t[e.fields.value])===i})}},d.prototype.acFocus=function(e,i,n,r){var s=this;return function(){var o=!t.isNullOrUndefined(i)&&_(i),a=!t.isNullOrUndefined(i)&&K(i),l=o?a:i;e.filterType=s.dlgDiv.querySelector("#"+l+(r.id===l+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr")).ej2_instances[0].value,e.ignoreCase="string"!==n.type||!s.dlgDiv.querySelector("#"+l+"-xlflmtcase").ej2_instances[0].checked,e.filterType=t.isNullOrUndefined(e.filterType)?"equal":e.filterType}},d}($r),is=function(){function i(e,t,i,n){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new Dn,this.currentTarget=null,this.parent=e,this.sortSettings=t,this.sortedColumns=i,this.serviceLocator=n,this.focus=n.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,n=!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 r=[],s=0,o=i.length;s<o;s++)if(e=this.getSortedColsIndexByField(i[parseInt(s.toString(),10)],r),this.columnName===i[parseInt(s.toString(),10)])n=!0,r.push(t);else{var a=this.getSortColumnFromField(i[parseInt(s.toString(),10)]);r.push({field:a.field,direction:a.direction,isFromGroup:a.isFromGroup})}n||r.push(t),this.sortSettings.columns=r}else this.sortSettings.columns=[t];this.parent.dataBind(),this.lastSortedCol=this.columnName},i.prototype.onActionComplete=function(e){var i=this.isRemove?{requestType:"sorting",type:Ut}:{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:Ut};this.isRemove=!1,this.parent.trigger(Ut,t.extend(e,i))},i.prototype.sortColumn=function(e,t,i){var n=this.parent;return!1===this.parent.getColumnByField(e).allowSorting||this.parent.isContextMenuOpen()?void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:e}):(n.allowMultiSorting||(i=n.allowMultiSorting),this.isActionPrevent()?void n.notify(bi,{instance:this,handler:this.sortColumn,arg1:e,arg2:t,arg3:i}):(this.backupSettings(),this.columnName=e,this.direction=t,this.isMultiSort=i,this.removeSortIcons(),this.updateSortedCols(e,i),void this.updateModel()))},i.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,e.ResponsiveDialogAction.isSort)},i.prototype.backupSettings=function(){this.lastSortedCols=I(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,n=this.sortedColumns.length;i<n;i++)this.parent.groupSettings.columns.indexOf(this.sortedColumns[parseInt(i.toString(),10)])<0&&(this.sortedColumns.splice(i,1),n--,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:qt,target:this.currentTarget,cancel:!1}:{requestType:"sorting",type:qt,cancel:!1,target:this.currentTarget};this.parent.notify(ni,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[parseInt(t.toString(),10)].isFromGroup||this.sortedColumns.push(e[parseInt(t.toString(),10)].field)},i.prototype.clearSorting=function(){var e=P(this.sortSettings.columns);if(this.isActionPrevent())return void this.parent.notify(bi,{instance:this,handler:this.clearSorting});for(var t=0,i=e.length;t<i;t++)this.removeSortColumn(e[parseInt(t.toString(),10)].field)},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(bi,{instance:this,handler:this.removeSortColumn,arg1:e});this.backupSettings(),this.removeSortIcons();for(var n={requestType:"sorting",type:qt,target:this.currentTarget},r=0,s=i.length;r<s;r++)if(i[parseInt(r.toString(),10)].field===e){if(t.allowGrouping&&t.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field)>-1)continue;this.sortedColumns.splice(this.sortedColumns.indexOf(i[parseInt(r.toString(),10)].field),1),i.splice(r,1),this.isRemove=!0,this.isModelChanged&&this.parent.notify(ni,n);break}n.cancel||this.addSortIcons()}},i.prototype.getSortedColsIndexByField=function(e,t){for(var i=t||this.sortSettings.columns,n=0,r=i.length;n<r;n++)if(i[parseInt(n.toString(),10)].field===e)return n;return-1},i.prototype.getModuleName=function(){return"sort"},i.prototype.initialEnd=function(){if(this.parent.off($t,this.initialEnd),this.parent.getColumns().length&&this.sortSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.isMultiSort=this.sortSettings.columns.length>1;for(var t=0,i=e.sortSettings.columns.slice();t<i.length;t++){var n=i[t];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.evtHandlers=[{event:"set-fullscreen-dialog",handler:this.setFullScreenDialog},{event:Bi,handler:this.renderResponsiveChangeAction},{event:$t,handler:this.initialEnd},{event:"sorting-complete",handler:this.onActionComplete},{event:ii,handler:this.onPropertyChanged},{event:hi,handler:this.clickHandler},{event:si,handler:this.refreshSortIcons},{event:di,handler:this.keyPressed},{event:Ti,handler:this.cancelBeginEvent},{event:pi,handler:this.destroy}],at(this.parent,this.evtHandlers,!0,this),t.EventHandler.add(document.body,"click",this.excelFilterSortAction,this),t.EventHandler.add(document.body,"touchend",this.excelFilterSortAction,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(at(this.parent,this.evtHandlers,!1),t.EventHandler.remove(document.body,"click",this.excelFilterSortAction),t.EventHandler.remove(document.body,"touchend",this.excelFilterSortAction))},i.prototype.excelFilterSortAction=function(e){var t=F(e.target,"e-grid-popup"),i=this.parent.element.id+"_e-popup";t&&t.id===i&&F(e.target,"e-excelfilter")&&this.excelFilterSortActionHandler(e)},i.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector("."+Ki)||e.querySelector("."+Wi))&&(this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-sortdirect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none"),this.parent.refreshing||!this.parent.isDestroyed&&this.parent.allowSorting||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 n=t.closest(e.target,".e-headercell");if(n&&!e.target.classList.contains("e-grptogglebtn")&&!n.classList.contains("e-resized")&&!e.target.classList.contains("e-rhandler")&&!e.target.classList.contains("e-columnmenu")&&!e.target.classList.contains("e-filtermenudiv")&&!F(e.target,"e-stackedheadercell")&&!(i.allowSelection&&i.selectionSettings.allowColumnSelection&&e.target.classList.contains("e-headercell"))){var r=this.parent.getColumnByUid(n.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));"checkbox"!==r.type&&(this.initiateSort(n,e,r),t.Browser.isDevice&&this.showPopUp(e))}n&&n.classList.remove("e-resized"),this.excelFilterSortActionHandler(e)},i.prototype.excelFilterSortActionHandler=function(e){if(F(e.target,"e-excel-ascending")||F(e.target,"e-excel-descending")){var i=t.closest(e.target,".e-filter-popup").getAttribute("data-uid"),n=t.isNullOrUndefined(F(e.target,"e-excel-descending"))?"Ascending":"Descending";this.sortColumn(this.parent.getColumnByUid(i).field,n,!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 n=this.focus.getFocusedElement();if(t.isNullOrUndefined(n)||!n.classList.contains("e-headercell")||!n.querySelector(".e-headercelldiv"))return;var r=this.parent.getColumnByUid(n.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));this.initiateSort(n,e,r)}},i.prototype.initiateSort=function(e,t,i){var n=this.parent,r=i.field;this.currentTarget=t.target;var s=e.getElementsByClassName("e-ascending").length?"Descending":"Ascending";this.isMultiSort=t.ctrlKey||this.enableSortMultiTouch||-1!==navigator.userAgent.indexOf("Mac OS")&&t.metaKey,t.shiftKey||this.sortSettings.allowUnsort&&e.getElementsByClassName("e-descending").length&&!(n.groupSettings.columns.indexOf(r)>-1)?this.removeSortColumn(r):this.sortColumn(r,s,this.isMultiSort)},i.prototype.showPopUp=function(e){var i=t.closest(e.target,".e-headercell");!this.parent.allowMultiSorting||t.isNullOrUndefined(i)&&!this.parent.isContextMenuOpen()||O(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(_i)||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,n=this.parent,r=this.sortSettings.columns,s=this.parent.getColumns().map(function(e){return e.field}),o=0,a=r.length;o<a;o++)e=n.getColumnHeaderByField(r[parseInt(o.toString(),10)].field),-1===s.indexOf(r[parseInt(o.toString(),10)].field)||t.isNullOrUndefined(e)||(this.aria.setSort(e,r[parseInt(o.toString(),10)].direction.toLowerCase()),r.length>1&&e.querySelector(".e-headercelldiv").insertBefore(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(o+1).toString()}),e.querySelector(".e-headertext")),i=e.querySelector(".e-sortfilterdiv"),"Ascending"===r[parseInt(o.toString(),10)].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,n=this.parent,r=this.parent.getColumns().map(function(e){return e.field}),s=e||0,o=t.isNullOrUndefined(e)?r.length:e+1;s<o;s++)i=n.getColumnHeaderByField(r[parseInt(s.toString(),10)]),t.isNullOrUndefined(i)||n.allowGrouping&&n.groupSettings.columns.indexOf(r[parseInt(s.toString(),10)])>-1&&!i.querySelector(".e-sortfilterdiv")||t.isNullOrUndefined(r[parseInt(s.toString(),10)])||(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[parseInt(t.toString(),10)].field===e)return this.sortSettings.columns[parseInt(t.toString(),10)];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 n=i[t];if(-1!==e.indexOf(n)){var r=this.parent.getColumnHeaderByField(n);this.aria.setSort(r,this.getSortColumnFromField(n).direction)}}},i.prototype.refreshSortIcons=function(){this.removeSortIcons(),this.isMultiSort=!0,this.removeSortIcons(),this.addSortIcons(),this.isMultiSort=!1,this.updateAriaAttr()},i.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},i.prototype.showCustomSort=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()},i}(),ns=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.refreshAriaAttrLabel(),this.updateStyles()},e.prototype.refreshNumericLinks=function(){var e,i=this.pagerModule,n=i.element.querySelector(".e-numericcontainer"),r=document.createDocumentFragment();n.innerHTML="";for(var s=1;s<=i.pageCount;s++)e=t.createElement("a",{className:"e-link e-numericitem e-spacing e-pager-default",attrs:{tabindex:"-1","aria-label":i.getLocalizedLabel("Page")+s+i.getLocalizedLabel("Of")+i.totalPages+i.getLocalizedLabel("Pages"),href:"#"}}),i.currentPage===s&&(t.classList(e,["e-currentitem","e-active"],["e-pager-default"]),e.setAttribute("aria-current","page")),r.appendChild(e);n.appendChild(r),this.links=[].slice.call(n.childNodes)},e.prototype.wireEvents=function(){t.EventHandler.add(this.pagerElement,"click",this.clickHandler,this),t.EventHandler.add(this.pagerElement,"auxclick",this.auxiliaryClickHandler,this)},e.prototype.unwireEvents=function(){t.EventHandler.remove(this.pagerModule.element,"click",this.clickHandler),t.EventHandler.remove(this.pagerModule.element,"auxclick",this.auxiliaryClickHandler)},e.prototype.destroy=function(){this.unwireEvents()},e.prototype.refreshAriaAttrLabel=function(){for(var e=this.pagerModule,t=e.element.querySelector(".e-numericcontainer").querySelectorAll("a"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].hasAttribute("aria-label")&&t[parseInt(i.toString(),10)].hasAttribute("data-index")&&t[parseInt(i.toString(),10)].setAttribute("aria-label",e.getLocalizedLabel("Page")+t[parseInt(i.toString(),10)].getAttribute("data-index")+e.getLocalizedLabel("Of")+e.totalPages+e.getLocalizedLabel("Pages"))},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:this.pagerModule.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}}),this.prev=t.createElement("div",{className:"e-prev e-icons e-icon-prev",attrs:{title:this.pagerModule.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}),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:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip"),tabindex:"-1",href:"#"}}),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:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip"),tabindex:"-1",href:"#"}}),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:this.pagerModule.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}}),this.last=t.createElement("div",{className:"e-last e-icons e-icon-last",attrs:{title:this.pagerModule.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}),t.append([this.next,this.last],e)},e.prototype.clickHandler=function(e){var i=this.pagerModule;return this.target=e.target,this.target.classList.contains("e-numericitem")&&e.preventDefault(),i.previousPageNo=i.currentPage,this.target.classList.contains("e-disable")||t.isNullOrUndefined(this.target.getAttribute("data-index"))||(i.currentPage=parseInt(this.target.getAttribute("data-index"),10),this.pagerModule.isInteracted=!0,i.dataBind()),!1},e.prototype.auxiliaryClickHandler=function(e){this.target=e.target,this.target.classList.contains("e-numericitem")&&1===e.button&&e.preventDefault()},e.prototype.updateLinksHtml=function(){var e,i,n,r=this.pagerModule,s=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');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 o=0;o<r.pageCount;o++){if(r.isPagerResized){var a=this.pagerElement.querySelector(".e-focus"),l=this.target?this.target:a||null,d=!1,h=!1,p=!1,c=!1,u=!1,g=!1,f=!1;if(l){var m=l.classList;if(m.contains("e-icons"))switch(!0){case m.contains("e-prev"):d=!0;break;case m.contains("e-next"):h=!0;break;case m.contains("e-first"):p=!0;break;case m.contains("e-last"):c=!0}else if(m.contains("e-numericitem"))switch(!0){case m.contains("e-np"):g=!0;break;case m.contains("e-pp"):f=!0;break;default:u=m.contains("e-numericitem")}}i=c||"End"===this.pagerModule.keyAction,s=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');var y=Array.from(s).some(function(e){return parseInt(e.getAttribute("data-index"),10)===r.currentPage});n=p||"Home"===this.pagerModule.keyAction?1+o:c||"End"===this.pagerModule.keyAction?e*r.pageCount+1+o:h||"ArrowRight"===this.pagerModule.keyAction||d||"ArrowLeft"===this.pagerModule.keyAction?y?parseInt(s[0].getAttribute("data-index"),10)+o:d||"ArrowLeft"===this.pagerModule.keyAction?parseInt(this.PP.getAttribute("data-index"),10)+o:r.currentPage+o:g||f?r.currentPage+o:u?parseInt(s[0].getAttribute("data-index"),10)+o:e*r.pageCount+1+o}else n=e*r.pageCount+1+o;n<=r.totalPages?(this.links[parseInt(o.toString(),10)].classList.remove("e-hide"),this.links[parseInt(o.toString(),10)].style.display="",this.links[parseInt(o.toString(),10)].setAttribute("data-index",n.toString()),this.links[parseInt(o.toString(),10)].innerHTML=r.customText?r.customText+n:n.toString(),r.currentPage!==n?this.links[parseInt(o.toString(),10)].classList.add("e-pager-default"):this.links[parseInt(o.toString(),10)].classList.remove("e-pager-default")):(this.links[parseInt(o.toString(),10)].innerHTML=r.customText?r.customText+n:n.toString(),this.links[parseInt(o.toString(),10)].style.display="none"),t.classList(this.links[parseInt(o.toString(),10)],[],["e-currentitem","e-active"]),this.links[parseInt(o.toString(),10)].removeAttribute("aria-current")}t.attributes(this.first,{"data-index":"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),t.attributes(this.pagerElement.querySelector(".e-mfirst"),{"data-index":"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),t.attributes(this.last,{"data-index":r.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),t.attributes(this.pagerElement.querySelector(".e-mlast"),{"data-index":r.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),t.attributes(this.prev,{"data-index":(r.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),t.attributes(this.pagerElement.querySelector(".e-mprev"),{"data-index":(r.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),t.attributes(this.next,{"data-index":(r.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")}),t.attributes(this.pagerElement.querySelector(".e-mnext"),{"data-index":(r.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")});var v=this.pagerModule.isPagerResized&&s.length?i?parseInt(s[0].getAttribute("data-index"),10)-r.avgNumItems:parseInt(s[0].getAttribute("data-index"),10)-s.length:parseInt(this.links[0].getAttribute("data-index"),10)-r.pageCount;t.attributes(this.PP,{"data-index":v<1?"1":v.toString(),title:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip")});var S=this.pagerModule.isPagerResized&&s.length?parseInt(s[s.length-1].getAttribute("data-index"),10):parseInt(this.links[this.links.length-1].getAttribute("data-index"),10);t.attributes(this.NP,{"data-index":(S+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip")}),this.target=void 0},e.prototype.updateStyles=function(){var e=this;if(this.updateFirstNPrevStyles(),this.updatePrevPagerSetStyles(),this.updateNextPagerSetStyles(),this.updateNextNLastStyles(),this.links.length){var i=this.links.findIndex(function(t){return t.getAttribute("data-index")===e.pagerModule.currentPage.toString()}),n=this.pagerModule.isPagerResized&&-1!==i?i:(this.pagerModule.currentPage-1)%this.pagerModule.pageCount;this.links[parseInt(n.toString(),10)]&&(t.classList(this.links[parseInt(n.toString(),10)],["e-currentitem","e-active"],[]),this.links[parseInt(n.toString(),10)].setAttribute("aria-current","page"))}},e.prototype.updateFirstNPrevStyles=function(){var e=["e-firstpage","e-pager-default"],i=["e-firstpagedisabled","e-disable"],n=["e-prevpage","e-pager-default"],r=["e-prevpagedisabled","e-disable"];this.pagerModule.totalPages>0&&this.pagerModule.currentPage>1?(t.classList(this.prev,n,r),t.classList(this.first,e,i),t.classList(this.pagerElement.querySelector(".e-mfirst"),e,i),t.classList(this.pagerElement.querySelector(".e-mprev"),n,r)):(t.classList(this.prev,r,n),t.classList(this.first,i,e),t.classList(this.pagerElement.querySelector(".e-mprev"),r,n),t.classList(this.pagerElement.querySelector(".e-mfirst"),i,e))},e.prototype.updatePrevPagerSetStyles=function(){this.pagerModule.currentPage>this.pagerModule.pageCount||this.pagerModule.isPagerResized&&this.links.findIndex(function(e){return 1===parseInt(e.getAttribute("data-index"),10)})?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,""),n=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');!i.length||!this.links.length||parseInt(i,10)+e.pageCount>e.totalPages||e.isPagerResized&&Array.from(n).some(function(t){return parseInt(t.getAttribute("data-index"),10)===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"],n=["e-nextpage","e-pager-default"],r=["e-nextpagedisabled","e-disable"],s=this.pagerModule;s.currentPage===s.totalPages||0===s.totalRecordsCount?(t.classList(this.last,i,e),t.classList(this.next,r,n),t.classList(this.pagerElement.querySelector(".e-mlast"),i,e),t.classList(this.pagerElement.querySelector(".e-mnext"),r,n)):(t.classList(this.last,e,i),t.classList(this.next,n,r),t.classList(this.pagerElement.querySelector(".e-mlast"),e,i),t.classList(this.pagerElement.querySelector(".e-mnext"),n,r))},e}(),rs=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){var e=t.createElement("div",{className:"e-parentmsgbar"});this.pageNoMsgElem=t.createElement("span",{className:"e-pagenomsg"}),this.pageNoMsgElem.style.textAlign="right",this.pageCountMsgElem=t.createElement("span",{className:"e-pagecountmsg"}),this.pageCountMsgElem.style.textAlign="right",t.append([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},e.prototype.refresh=function(){var e=this.pagerModule;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.classList.remove("e-hide")},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,n=RegExp,r=0;r<t.length;r++)i=new n("\\{"+r+"\\}","gm"),e=this.isValidLocale(this.pagerModule.locale)?e.replace(i,t[parseInt(r.toString(),10)].toLocaleString(this.pagerModule.locale)):e.replace(i,t[parseInt(r.toString(),10)].toString());return e},e.prototype.isValidLocale=function(e){try{return new Intl.NumberFormat(e),!0}catch(e){return!1}},e}(),ss=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),os=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},as=function(e){function i(t,i,n){var r=e.call(this,t,i)||this;return r.hasParent=!1,r.checkAll=!0,r.pageRefresh="pager-refresh",r.firstPagerFocus=!1,r.isCancel=!1,r.isInteracted=!1,r.parent=n,r}return ss(i,e),i.prototype.requiredModules=function(){var e=[];return this.enableExternalMessage&&e.push({member:"externalMessage",args:[this],name:"ExternalMessage"}),this.checkpagesizes()&&e.push({member:"pagerdropdown",args:[this],name:"PagerDropDown"}),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 items",previousPagerTooltip:"Go to previous pager items",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 items",PreviousPagerTooltip:"Go to previous pager items",PagerDropDown:"Items per page",PagerAllDropDown:"Items",All:"All",Container:"Pager Container",Information:"Pager Information",ExternalMsg:"Pager external message",Page:"Page ",Of:" of ",Pages:" Pages"},this.containerModule=new ns(this),this.pagerMessageModule=new rs(this)},i.prototype.setCurrentPageValue=function(e){var t=parseInt(e,10);this.hasParent&&this.parent.setProperties({pageSettings:{currentPage:t}},!0),this.currentPage=t},i.prototype.render=function(){if(this.element.setAttribute("data-role","pager"),this.element.setAttribute("tabindex","-1"),this.initLocalization(),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.element.classList.add("e-mac-safari"),this.cssClass&&(-1!==this.cssClass.indexOf(" ")?t.addClass([this.element],this.cssClass.split(" ")):t.addClass([this.element],[this.cssClass])),this.hasParent||this.element.setAttribute("tabindex","0"),this.enableQueryString){var e=new URL(window.location.href).searchParams.get("page");!t.isNullOrUndefined(e)&&window.location.href.indexOf("?page=")>0&&this.setCurrentPageValue(e)}this.template?this.isReactTemplate()?(this.on(this.pageRefresh,this.pagerTemplate,this),this.notify(this.pageRefresh,{})):this.pagerTemplate():(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})),this.wireEvents(),this.addListener()},i.prototype.getPersistData=function(){var e=["currentPage","pageSize"];return this.addOnPersist(e)},i.prototype.destroy=function(){this.isDestroyed||(this.isReactTemplate()&&(this.off(this.pageRefresh,this.pagerTemplate),this.hasParent||this.destroyTemplate(["pagerTemplate"])),this.removeListener(),this.unwireEvents(),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){if(e.pageSize===this.getLocalizedLabel("All")&&t.pageSize===this.totalRecordsCount)return void(this.pageSize=this.totalRecordsCount);e.pageCount!==t.pageCount&&(this.containerModule.refreshNumericLinks(),this.containerModule.refresh());for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[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.isCancel&&this.hasParent&&this.parent.setProperties({pageSettings:{pageSize:t.pageSize}},!0)):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()}this.resizePager()}},i.prototype.wireEvents=function(){this.hasParent||(t.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),t.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)),t.EventHandler.add(this.element,"focusin",this.onFocusIn,this),t.EventHandler.add(this.element,"focusout",this.onFocusOut,this),t.EventHandler.add(window,"resize",this.resizePager,this),t.EventHandler.add(window,"load",this.resizePager,this)},i.prototype.unwireEvents=function(){this.hasParent||(t.EventHandler.remove(this.element,"keydown",this.keyPressHandler),t.EventHandler.remove(document.body,"keydown",this.keyDownHandler)),t.EventHandler.remove(this.element,"focusin",this.onFocusIn),t.EventHandler.remove(this.element,"focusout",this.onFocusOut),t.EventHandler.remove(window,"resize",this.resizePager),t.EventHandler.remove(window,"load",this.resizePager)},i.prototype.onFocusIn=function(e){var i=this.getFocusedTabindexElement();if(t.isNullOrUndefined(i)){var n=e.target,r=this.getDropDownPage();if(this.hasParent||(this.element.tabIndex=-1),n===this.element&&!this.hasParent){var s=this.getFocusablePagerElements(this.element,[]);return void this.addFocus(s[0],!0)}if(n===this.element)return void(this.element.tabIndex=0);n===r||n.classList.contains("e-disable")||this.addFocus(n,!0)}},i.prototype.onFocusOut=function(e){var i=this.getFocusedElement(),n=this.getDropDownPage();t.isNullOrUndefined(i)||this.removeFocus(i,!0),this.pageSizes&&n&&n.classList.contains("e-input-focus")&&this.removeFocus(n,!0),this.setTabIndexForFocusLastElement(),this.hasParent||(this.element.tabIndex=0),this.hasParent&&(this.element.tabIndex=-1)},i.prototype.keyDownHandler=function(e){if(e.altKey&&74===e.keyCode){var t=this.getFocusablePagerElements(this.element,[]);t.length>0&&t[0].focus()}},i.prototype.keyPressHandler=function(e){var i=t.extend(e,{cancel:!1});this.notify(di,i),!0===i.cancel&&e.stopImmediatePropagation()},i.prototype.addListener=function(){this.isDestroyed||this.hasParent||this.on(di,this.onKeyPress,this)},i.prototype.removeListener=function(){this.isDestroyed||this.hasParent||this.off(di,this.onKeyPress)},i.prototype.onKeyPress=function(e){this.hasParent||(this.checkPagerHasFocus()?this.changePagerFocus(e):(e.preventDefault(),this.setPagerFocus()))},i.prototype.checkPagerHasFocus=function(){return!!this.getFocusedTabindexElement()},i.prototype.setPagerContainerFocus=function(){this.element.focus()},i.prototype.setPagerFocus=function(){var e=this.getFocusablePagerElements(this.element,[]);e.length>0&&e[0].focus()},i.prototype.setPagerFocusForActiveElement=function(){var e=this.getActiveElement();e&&e.focus()},i.prototype.setTabIndexForFocusLastElement=function(){var e=this.getFocusablePagerElements(this.element,[]),i=this.getDropDownPage();this.pageSizes&&i&&!t.isNullOrUndefined(i.offsetParent)?i.tabIndex=0:e.length>0&&(e[e.length-1].tabIndex=0)},i.prototype.changePagerFocus=function(e){this.keyAction=e.key,e.shiftKey&&9===e.keyCode?this.changeFocusByShiftTab(e):9===e.keyCode?this.changeFocusByTab(e):13===e.keyCode||32===e.keyCode?this.navigateToPageByEnterOrSpace(e):37!==e.keyCode&&39!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||this.navigateToPageByKey(e),this.keyAction=""},i.prototype.getFocusedTabindexElement=function(){for(var e,t=this.element.querySelectorAll('[tabindex]:not([tabindex="-1"])'),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n&&(n.classList.contains("e-focused")||n.classList.contains("e-input-focus"))){e=n;break}}return e},i.prototype.changeFocusByTab=function(e){var t=this.getFocusedTabindexElement(),i=this.getFocusablePagerElements(this.element,[]),n=this.getDropDownPage();if(i.length>0)if(this.pageSizes&&n&&t===i[i.length-1])n.tabIndex=0;else for(var r=0;r<i.length;r++)if(t===i[parseInt(r.toString(),10)]){var s=r+1;s<i.length&&(e.preventDefault(),i[parseInt(s.toString(),10)].focus());break}},i.prototype.changeFocusByShiftTab=function(e){var t=this.getFocusedTabindexElement(),i=this.getFocusablePagerElements(this.element,[]),n=this.getDropDownPage();if(this.pageSizes&&n&&n.classList.contains("e-input-focus"))n.tabIndex=-1,this.addFocus(i[i.length-1],!0);else if(i.length>0)for(var r=0;r<i.length;r++)if(t===i[parseInt(r.toString(),10)]){var s=r-1;if(s>=0)e.preventDefault(),i[parseInt(s.toString(),10)].focus();else if(this.hasParent){var o=this.parent.getRows(),a=o[o.length-1].lastChild;e.preventDefault(),a.focus(),this.firstPagerFocus=!0}break}},i.prototype.checkFirstPagerFocus=function(){return!!this.firstPagerFocus&&(this.firstPagerFocus=!1,!0)},i.prototype.navigateToPageByEnterOrSpace=function(e){var t=this.getFocusedElement();if(t){this.goToPage(parseInt(t.getAttribute("data-index"),10));var i=this.getActiveElement(),n=this.getClass(t),r=this.getElementByClass(n);"e-first"!==n&&"e-prev"!==n&&"e-next"!==n&&"e-last"!==n&&"e-pp"!==n&&"e-np"!==n||!r||r.classList.contains("e-disable")?this.checkFocusInAdaptiveMode(t)?this.changeFocusInAdaptiveMode(t):i&&i.focus():r.focus()}},i.prototype.navigateToPageByKey=function(e){var i=37===e.keyCode?".e-prev":39===e.keyCode?".e-next":35===e.keyCode?".e-last":36===e.keyCode?".e-first":"",n=this.element.querySelector(i),r=this.getFocusedElement();if(!t.isNullOrUndefined(n)&&n.hasAttribute("data-index")&&!isNaN(parseInt(n.getAttribute("data-index"),10))){this.goToPage(parseInt(n.getAttribute("data-index"),10));var s=this.getActiveElement();this.checkFocusInAdaptiveMode(r)?this.changeFocusInAdaptiveMode(r):s&&s.focus()}},i.prototype.checkFocusInAdaptiveMode=function(e){var t=this.getClass(e);return"e-mfirst"===t||"e-mprev"===t||"e-mnext"===t||"e-mlast"===t},i.prototype.changeFocusInAdaptiveMode=function(e){var t=this.getClass(e),i=this.getElementByClass(t);i&&i.classList.contains("e-disable")&&("e-mnext"===t||"e-mlast"===t?this.element.querySelector(".e-mprev").focus():this.setPagerFocus())},i.prototype.removeTabindexLastElements=function(){var e=this.element.querySelectorAll('[tabindex]:not([tabindex="-1"])');if(e.length>1)for(var t=1;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i&&(i.tabIndex=-1)}},i.prototype.getActiveElement=function(){return this.element.querySelector(".e-active")},i.prototype.getDropDownPage=function(){var e,t=this.element.querySelector(".e-pagerdropdown");return t&&(e=t.children[0]),e},i.prototype.getFocusedElement=function(){return this.element.querySelector(".e-focused")},i.prototype.getClass=function(e){for(var t,i=["e-mfirst","e-mprev","e-first","e-prev","e-pp","e-np","e-next","e-last","e-mnext","e-mlast"],n=0;n<i.length;n++)if(e&&e.classList.contains(i[parseInt(n.toString(),10)]))return t=i[parseInt(n.toString(),10)];return t},i.prototype.getElementByClass=function(e){return this.element.querySelector("."+e)},i.prototype.getFocusablePagerElements=function(e,i){for(var n=e.children,r=i,s=0;s<n.length;s++){var o=n[parseInt(s.toString(),10)];if(o.children.length>0&&!o.classList.contains("e-pagesizes"))r=this.getFocusablePagerElements(o,r);else{var a=n[parseInt(s.toString(),10)];!a.hasAttribute("tabindex")||o.classList.contains("e-disable")||"none"===o.style.display||t.isNullOrUndefined(o.offsetParent)||r.push(a)}}return r},i.prototype.addFocus=function(e,i){t.isNullOrUndefined(e)||(i&&t.addClass([e],["e-focused","e-focus"]),e.tabIndex=0)},i.prototype.removeFocus=function(e,i){i&&t.removeClass([e],["e-focused","e-focus"]),e.tabIndex=-1},i.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},i.prototype.goToPage=function(e){this.checkGoToPage(e)&&(this.currentPage=e,this.isInteracted=!1,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,isInteracted:this.isInteracted};this.trigger("click",i),i.cancel?(this.isCancel=!0,t&&t.pageSize&&(this.setProperties({pageSize:t.pageSize},!0),this.pagerdropdownModule&&(this.pagerdropdownModule.setDropDownValue("value",t.pageSize),this.pagerdropdownModule.dropDownListObject.text=t.pageSize+""))):(this.isCancel=!1,this.refresh())}},i.prototype.pagerTemplate=function(){if(!this.isReactTemplate()||!this.hasParent){var e;this.element.classList.add("e-pagertemplate"),this.compile(this.template);var t={currentPage:this.currentPage,pageSize:this.pageSize,pageCount:this.pageCount,totalRecordsCount:this.totalRecordsCount,totalPages:this.totalPages},i=this.element.parentElement.id+"_template";this.isReactTemplate()&&!this.isVue?(this.getPagerTemplate()(t,this,"pagerTemplate",i,null,null,this.element),this.renderReactTemplates()):(e=this.isVue?this.getPagerTemplate()(t,this,"pagerTemplate",null,null,null,null,this.root):this.getPagerTemplate()(t),q(this.element,e))}},i.prototype.updateTotalPages=function(){this.totalPages=this.isAllPage?1: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{"function"==typeof e?this.templateFn=t.compile(e):document.querySelectorAll(e).length?this.templateFn=t.compile(document.querySelector(e).innerHTML.trim()):this.templateFn=t.compile(e)}catch(i){this.templateFn=t.compile(e)}},i.prototype.refresh=function(){if(this.template)this.isReactTemplate()?(this.updateTotalPages(),this.notify(this.pageRefresh,{})):(this.parent&&this.parent.isAngular?this.parent.destroyTemplate(["pagerTemplate"]):this.element.innerHTML="",this.updateTotalPages(),this.pagerTemplate());else{this.updateRTL();var e=this.getFocusedTabindexElement();this.containerModule.refresh(),this.removeTabindexLastElements(),e&&e.classList.contains("e-disable")&&(this.checkFocusInAdaptiveMode(e)?this.changeFocusInAdaptiveMode(e):this.setPagerFocusForActiveElement()),this.enablePagerMessage&&this.pagerMessageModule.refresh(),this.pagerdropdownModule&&this.pagerdropdownModule.refresh(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.refresh(),this.setTabIndexForFocusLastElement(),this.resizePager()}},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),this.isReact&&window.dispatchEvent(new PopStateEvent("popstate"))},i.prototype.getUpdatedURL=function(e,t,i){var n=new RegExp("([?|&])"+t+"=.*?(&|#|$)","i");if(e.match(n))return e.replace(n,"$1"+t+"="+i+"$2");var r="";return-1!==e.indexOf("#")&&(r=e.replace(/.*#/,"#"),e=e.replace(/#.*/,"")),e+(-1!==e.indexOf("?")?"&":"?")+t+"="+i+r},i.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}})),this.element.appendChild(t.createElement("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}))},i.prototype.renderNextLastDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}})),this.element.appendChild(t.createElement("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}))},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 n=this.element.querySelector(e[parseInt(i.toString(),10)]);n.setAttribute("aria-label",n.getAttribute("title"))}},i.prototype.isReactTemplate=function(){return(this.isReact||this.isVue)&&this.template&&"string"!=typeof this.template&&!(this.template.prototype&&this.template.prototype.CSPTemplate)},i.prototype.calculateActualWidth=function(){for(var e=this.element.querySelectorAll(".e-mfirst, .e-mprev, .e-icon-first, .e-icon-prev, .e-pp:not(.e-disable), .e-numericitem:not(.e-hide), .e-numericitem.e-active.e-hide, .e-np:not(.e-disable), .e-icon-next, .e-icon-last, .e-parentmsgbar, .e-mnext, .e-mlast, .e-pagerdropdown, .e-pagerconstant"),t=0,i=0;i<e.length;i++)"none"!==getComputedStyle(e[parseInt(i.toString(),10)]).display&&(t+=e[parseInt(i.toString(),10)].offsetWidth+parseFloat(getComputedStyle(e[parseInt(i.toString(),10)]).marginLeft)+parseFloat(getComputedStyle(e[parseInt(i.toString(),10)]).marginRight));var n=this.element.querySelector(".e-pagercontainer");return t+=parseFloat(getComputedStyle(n).marginLeft)+parseFloat(getComputedStyle(n).marginRight)},i.prototype.hideDetailItems=function(e,t,i,n){var r=this.calculateActualWidth();if(r>e-t){var s=Math.floor((e-(r-i))/this.averageDetailWidth);s=n.length-s;for(var o=0;o<(s>n.length?n.length:s);o++)n[parseInt(o.toString(),10)].classList.add("e-hide")}},i.prototype.setShowItems=function(e,t,i,n,r){var s=this,o=Math.floor(e/(t+i));o=o>r.length?r.length:o-1;for(var a=Array.from(r).filter(function(e){return parseInt(e.getAttribute("data-index"),10)<s.currentPage}).sort(function(e,t){return parseInt(t.getAttribute("data-index"),10)-parseInt(e.getAttribute("data-index"),10)}),l=Array.from(r).filter(function(e){return parseInt(e.getAttribute("data-index"),10)>s.currentPage}),d=a.length&&a||l.length&&l,h=1;h<=o;h++){var p=d&&d[Math.abs(n-h)];p&&(p.classList.remove("e-hide"),p===d[d.length-1]&&(d=null))}},i.prototype.resizePager=function(){var e=this,i=this.element.classList.contains("e-pager")?getComputedStyle(this.element).getPropertyValue("border-style").includes("solid"):null;if(!this.template&&i){var n=this.element.querySelector(".e-pagercontainer"),r=this.calculateActualWidth(),s=this.element.clientWidth-parseFloat(getComputedStyle(this.element).paddingLeft)-parseFloat(getComputedStyle(this.element).paddingRight)-parseFloat(getComputedStyle(this.element).marginLeft)-parseFloat(getComputedStyle(this.element).marginRight),o=n.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)'),a=n.querySelectorAll('.e-numericitem.e-hide:not([style*="display: none"])'),l=o.length,d=t.isNullOrUndefined(F(this.element,"e-bigger"))?5:10,h=n.querySelector(".e-np"),p=n.querySelector(".e-pp"),c=this.element.querySelectorAll('.e-parentmsgbar:not(.e-hide):not([style*="display: none"]), .e-pagesizes:not(.e-hide):not([style*="display: none"])'),u=0;c.length&&(c.forEach(function(e){u+=e.offsetWidth}),this.averageDetailWidth=u/c.length);for(var g=0,f=0;f<o.length;f++)g+=o[parseInt(f.toString(),10)].offsetWidth+parseFloat(getComputedStyle(o[parseInt(f.toString(),10)]).marginLeft)+parseFloat(getComputedStyle(o[parseInt(f.toString(),10)]).marginRight);var m=g/o.length;if(s>0&&r>=s-(m||0)){this.isPagerResized=!0,this.currentPage!==this.totalPages&&t.classList(h,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]),r=this.calculateActualWidth();var y=Math.abs(r-s),v=Math.ceil(y/m);v=0===v?1:v>o.length?o.length-1:v;for(f=1;f<=v;f++){var S=l-parseInt(f.toString(),10);o=n.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)'),1===this.currentPage||parseInt(o[Math.abs(S)].getAttribute("data-index"),10)!==this.currentPage&&parseInt(o[o.length-1].getAttribute("data-index"),10)!==this.currentPage||(S=0,t.classList(p,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])),o[Math.abs(S)]&&!o[Math.abs(S)].classList.contains("e-currentitem")&&o[Math.abs(S)].classList.add("e-hide")}(o=n.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)')).length<=1&&c.length&&window.innerWidth>=768&&this.hideDetailItems(s,d,u,c)}else if(r<s&&a.length){var y=Math.abs(s-r),C=this.element.querySelectorAll(".e-parentmsgbar.e-hide, .e-pagesizes.e-hide");C.length&&y>this.averageDetailWidth+this.averageDetailWidth/4&&C[C.length-1].classList.remove("e-hide"),y>2*m&&!C.length&&window.innerWidth>=768&&this.setShowItems(y,m,d,1,a)}if((o=n.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)')).length){parseInt(o[o.length-1].getAttribute("data-index"),10)===this.totalPages&&t.classList(h,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]),1===parseInt(o[0].getAttribute("data-index"),10)&&t.classList(p,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]);var w=Array.from(o).some(function(t){return parseInt(t.getAttribute("data-index"),10)===e.totalPages}),b=parseInt(o[0].getAttribute("data-index"),10)-(w&&!t.isNullOrUndefined(this.avgNumItems)?this.avgNumItems:o.length);p.setAttribute("data-index",b<1?"1":b.toString()),h.setAttribute("data-index",(parseInt(o[o.length-1].getAttribute("data-index"),10)+1).toString()),this.avgNumItems=w?this.avgNumItems:o.length}this.element.offsetWidth<769&&"none"!==window.getComputedStyle(this.element.querySelector(".e-mfirst")).getPropertyValue("display")&&this.pageSizes?(this.element.querySelector(".e-pagesizes").classList.remove("e-hide"),this.element.querySelector(".e-parentmsgbar").classList.remove("e-hide"),this.element.classList.add("e-adaptive"),this.element.querySelector(".e-pagenomsg").innerHTML=this.element.offsetWidth<481?this.currentPage+" / "+this.totalPages:this.pagerMessageModule.format(this.getLocalizedLabel("currentPageInfo"),[0===this.totalRecordsCount?0:this.currentPage,this.totalPages||0,this.totalRecordsCount||0])+" "):(this.element.classList.remove("e-adaptive"),this.element.querySelector(".e-pagenomsg").innerHTML=this.pagerMessageModule.format(this.getLocalizedLabel("currentPageInfo"),[0===this.totalRecordsCount?0:this.currentPage,this.totalPages||0,this.totalRecordsCount||0])+" ")}},os([t.Property(!1)],i.prototype,"enableQueryString",void 0),os([t.Property(!1)],i.prototype,"enableExternalMessage",void 0),os([t.Property(!0)],i.prototype,"enablePagerMessage",void 0),os([t.Property(12)],i.prototype,"pageSize",void 0),os([t.Property(10)],i.prototype,"pageCount",void 0),os([t.Property(1)],i.prototype,"currentPage",void 0),os([t.Property()],i.prototype,"totalRecordsCount",void 0),os([t.Property()],i.prototype,"externalMessage",void 0),os([t.Property(!1)],i.prototype,"pageSizes",void 0),os([t.Property()],i.prototype,"template",void 0),os([t.Property("")],i.prototype,"customText",void 0),os([t.Event()],i.prototype,"click",void 0),os([t.Property("")],i.prototype,"cssClass",void 0),os([t.Event()],i.prototype,"dropDownChanged",void 0),os([t.Event()],i.prototype,"created",void 0),i=os([t.NotifyPropertyChanges],i)}(t.Component),ls=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"}),n=t.createElement("div",{className:"e-pagerconstant"}),r=t.createElement("input",{attrs:{type:"text",tabindex:"-1"}});this.pagerCons=t.createElement("span",{className:"e-constant",innerHTML:this.pagerModule.getLocalizedLabel("pagerDropDown")}),i.appendChild(r),n.appendChild(this.pagerCons),this.pagerDropDownDiv.appendChild(i),this.pagerDropDownDiv.appendChild(n),this.pagerModule.element.appendChild(this.pagerDropDownDiv);var s=this.pagerModule.pageSizes,a=s.length?this.convertValue(s):[this.pagerModule.getLocalizedLabel("All"),"5","10","12","20"],l=this.pagerModule.pageSize;this.dropDownListObject=new o.DropDownList({dataSource:a,value:l.toString(),change:this.onChange.bind(this),placeholder:this.pagerModule.getLocalizedLabel("pagerDropDown"),cssClass:this.pagerModule.cssClass?"e-alldrop "+this.pagerModule.cssClass:"e-alldrop"}),this.dropDownListObject.isAngular=Ge(e.parent),this.dropDownListObject.appendTo(r),s.length&&(this.dropDownListObject.element.value=this.pagerModule.pageSize.toString()),e.pageSize=l,e.dataBind(),e.trigger("dropDownChanged",{pageSize:l}),this.addEventListener()},e.prototype.onChange=function(e){this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?(this.pagerModule.pageSize=this.pagerModule.totalRecordsCount,this.pagerModule.isAllPage=!0,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.pagerModule.isAllPage=!1,this.pagerCons.innerHTML!==this.pagerModule.getLocalizedLabel("pagerDropDown")&&this.refresh()),this.pagerModule.dataBind(),this.pagerModule.isCancel||this.pagerModule.trigger("dropDownChanged",{pageSize:this.pagerModule.isAllPage||void 0===this.pagerModule.isAllPage&&this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?this.pagerModule.totalRecordsCount:parseInt(this.dropDownListObject.value,10)})},e.prototype.refresh=function(){this.pagerCons&&(this.isPageSizeAll(this.pagerModule.pageSize)?(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerAllDropDown"),this.pagerCons.parentElement.classList.add("e-page-all")):(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerDropDown"),this.pagerCons.parentElement.classList.remove("e-page-all")),this.pagerDropDownDiv.classList.remove("e-hide"))},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[parseInt(i.toString(),10)]=parseInt(t[parseInt(i.toString(),10)],10)?t[parseInt(i.toString(),10)].toString():""!==this.pagerModule.getLocalizedLabel(t[parseInt(i.toString(),10)])?this.pagerModule.getLocalizedLabel(t[parseInt(i.toString(),10)]):t[parseInt(i.toString(),10)];return t},e.prototype.isPageSizeAll=function(e){return("string"==typeof e&&e!==this.pagerModule.getLocalizedLabel("All")?parseInt(e,10):e)===this.pagerModule.totalRecordsCount||e===this.pagerModule.getLocalizedLabel("All")},e.prototype.setDropDownValue=function(e,t){if(this.dropDownListObject){var i=this.pagerModule.isAllPage;this.pagerModule.isAllPage=this.isPageSizeAll(t),this.pagerModule.isAllPage&&"object"==typeof this.pagerModule.pageSizes&&-1===this.pagerModule.pageSizes.indexOf("All")&&(this.pagerModule.isAllPage=!1),this.pagerModule.checkAll=!(!i||!this.pagerModule.isAllPage),this.dropDownListObject[""+e]=this.pagerModule.isAllPage?this.pagerModule.getLocalizedLabel("All"):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(),this.pagerDropDownDiv&&this.pagerDropDownDiv.parentNode&&t.remove(this.pagerDropDownDiv))},e}(),ds=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":this.pagerModule.getLocalizedLabel("ExternalMsg")}}),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(){this.element&&this.element.parentElement&&t.remove(this.element)},e}(),hs=function(){function e(e,t){this.isInitialRender=!0,this.isCancel=!1,as.Inject(ds,ls),this.parent=e,this.pageSettings=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"pager"},e.prototype.render=function(){var e=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"});var i=D({},t.extend({},A(this.pageSettings)),{click:this.clickHandler.bind(this),dropDownChanged:this.onSelect.bind(this),enableRtl:e.enableRtl,locale:e.locale,created:this.addAriaAttr.bind(this)},["parentObj","propName"]);i.cssClass=this.parent.cssClass?this.parent.cssClass:"",this.pagerObj=new as(i,void 0,this.parent),this.pagerObj.root=e.root?e.root: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){this.parent.getContentTable()&&this.element.setAttribute("aria-controls",this.parent.getContentTable().id);for(var e=this.parent.createElement("div",{className:"e-numericcontainer"}),t=this.element.querySelector(".e-pagercontainer"),i=document.createDocumentFragment(),n=this.element.querySelector(".e-numericcontainer"),r=n.querySelectorAll("a"),s=0;s<r.length;s++){var o=this.parent.createElement("div");o.appendChild(r[parseInt(s.toString(),10)]),i.appendChild(o)}e.appendChild(i),t.replaceChild(e,n)}},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;var t="add"===e.action&&"save"===e.requestType||"batchsave"===e.requestType,i=this.parent.filterModule&&this.parent.filterModule.isFilterCleared,n=""===e.searchString&&"searching"===e.requestType||"filtering"===e.requestType&&("clearFilter"===e.action||"clear-filter"===e.action)||i;i&&(this.parent.filterModule.isFilterCleared=!1),this.pagerObj.isAllPage&&!t&&(!n||n&&this.pagerObj.checkAll)&&(this.parent.pageSettings.pageSize=this.parent.pageSettings.totalRecordsCount),t&&this.pagerObj.isAllPage&&e.count===this.pageSettings.pageSize&&this.pagerObj.setProperties({pageSize:e.count},!0),this.parent.dataBind()},e.prototype.onActionComplete=function(e){this.parent.trigger(Ut,t.extend(e,{currentPage:this.parent.pageSettings.currentPage,requestType:"paging",type:Ut}))},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){for(var t=e.properties,i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.pagerObj[""+r]=t[""+r]}this.pagerObj.dataBind()}},e.prototype.clickHandler=function(e){var i=this.parent;if(this.isForceCancel||J(i)&&!i.prevPageMoving&&!this.isCancel)return this.isForceCancel?this.isForceCancel=!1:(t.isNullOrUndefined(e.newProp)||t.isNullOrUndefined(e.newProp.pageSize)?e.currentPage&&(i.notify(bi,{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(bi,{instance:this,handler:this.setPageSize,arg1:e.newProp.pageSize}),this.pagerObj.setProperties({pageSize:e.oldProp.pageSize},!0),this.parent.setProperties({pageSettings:{pageSize:e.oldProp.pageSize}},!0),this.pagerObj.setProperties({currentPage:i.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:i.pageSettings.currentPage},!0)),this.isForceCancel=!0,this.pagerObj.dataBind()),void(e.cancel=!0);i.pageSettings.pageSize=this.pagerObj.pageSize,i.prevPageMoving=!1;var n=this.pageSettings.currentPage,r={cancel:!1,requestType:"paging",previousPage:n,currentPage:e.currentPage,pageSize:i.pageSettings.pageSize,type:qt};if(e.oldProp&&e.oldProp.pageSize&&(r.previousPageSize=e.oldProp.pageSize),this.isCancel||(this.pageSettings.currentPage=e.currentPage,this.parent.notify(ni,r),i.pageRequireRefresh=!1),r.cancel)return e.cancel=!0,this.parent.setProperties({pageSettings:{currentPage:n}},!0),this.pagerObj.setProperties({currentPage:n},!0),void(this.isCancel=!0);this.isCancel=!1,this.parent.requestTypeAction="paging"},e.prototype.keyPressHandler=function(e){if(e.action in ps){e.preventDefault();var t=this.element.querySelector(ps[e.action]);t.classList.contains("e-nextprevitemdisabled")||t.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(){this.isInitialLoad=!0,this.parent.element.appendChild(this.element),this.parent.setGridPager(this.element),this.pagerObj.isReact=this.parent.isReact,this.pagerObj.isVue=this.parent.isVue||this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isVue,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.isVue)&&this.parent.addEventListener("created",this.handlers.created.bind(this)),this.evtHandlers=[{event:Yt,handler:this.handlers.load},{event:Jt,handler:this.handlers.end},{event:Zt,handler:this.handlers.ready},{event:"paging-complete",handler:this.handlers.complete},{event:ei,handler:this.handlers.updateLayout},{event:ii,handler:this.handlers.inboundChange},{event:di,handler:this.handlers.keyPress},{event:pi,handler:this.destroy}],at(this.parent,this.evtHandlers,!0,this))},e.prototype.created=function(){this.isInitialRender&&this.isReactTemplate()&&(this.isInitialRender=!1,this.renderReactPagerTemplate())},e.prototype.isReactTemplate=function(){return(this.parent.isReact||this.parent.isVue)&&this.pagerObj.template&&"string"!=typeof this.pagerObj.template},e.prototype.renderReactPagerTemplate=function(){if(!this.isInitialRender&&this.isReactTemplate()){var e=void 0;this.parent.destroyTemplate(["pagerTemplate"]),this.element.classList.add("e-pagertemplate"),this.pagerObj.compile(this.pagerObj.template);var t=this.parent.pageSettings,i={currentPage:t.currentPage,pageSize:t.pageSize,pageCount:t.pageCount,totalRecordsCount:t.totalRecordsCount,totalPages:this.pagerObj.totalPages},n=this.parent.id+"_pagertemplate";this.parent.isReact?(this.pagerObj.templateFn(i,this.parent,"pagerTemplate",n,null,null,this.pagerObj.element),this.parent.renderTemplates()):(e=this.pagerObj.templateFn(i,this.parent,"pagerTemplate"),q(this.pagerObj.element,e))}},e.prototype.removeEventListener=function(){this.parent.isDestroyed||((this.parent.isReact||this.parent.isVue)&&this.parent.removeEventListener("created",this.handlers.created),this.parent.off("pager-refresh",this.renderReactPagerTemplate),at(this.parent,this.evtHandlers,!1))},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}(),ps={pageUp:".e-prev",pageDown:".e-next",ctrlAltPageDown:".e-last",ctrlAltPageUp:".e-first",altPageUp:".e-pp",altPageDown:".e-np"},cs=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),us=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-filterbarcell",attrs:{role:"columnheader"}}),t}return cs(i,e),i.prototype.getGui=function(){return this.parent.createElement("div")},i.prototype.render=function(e,i){var n,r=this.parent.element.querySelector(".e-filterbar"),o=this.element.cloneNode(),a=this.getGui(),l=e.column;if(r.appendChild(o),o.setAttribute("data-mappinguid",l.uid),l.filterTemplate){var d={};i&&(d[l.field]=i[l.field]);if(d.column=l,l.visible){"FilterBar"===this.parent.filterSettings.type&&o.classList.add("e-fltrtemp");var h=this.parent.isReact&&"string"!=typeof l.filterTemplate&&!(l.filterTemplate.prototype&&l.filterTemplate.prototype.CSPTemplate),p=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,c=this.parent.element.id+l.uid+"filterTemplate";h||p?(l.getFilterTemplate()(d,this.parent,"filterTemplate",c,null,null,o),this.parent.renderTemplates()):q(o,l.getFilterTemplate()(d,this.parent,"filterTemplate",c,null,null,null,this.parent.root))}else o.classList.add("e-hide")}else if("checkbox"!==l.type){if(!t.isNullOrUndefined(l.allowFiltering)&&!l.allowFiltering||t.isNullOrUndefined(l.filterBarTemplate)){t.attributes(a,{class:"e-filterdiv e-fltrinputdiv"}),n=this.parent.createElement("input",{id:l.field+"_filterBarcell",className:"e-filtertext",attrs:{type:"search",title:l.headerText+e.attributes.title,value:i[e.column.field]?i[e.column.field]:""}}),a.appendChild(n);u={element:n,floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0,cssClass:this.parent.cssClass}};this.parent.filterModule.inputList.push(u),s.Input.createInput(u,this.parent.createElement)}else if(o.classList.add("e-fltrtemp"),t.attributes(a,{class:"e-fltrtempdiv"}),t.isNullOrUndefined(l.filterBarTemplate.create))n=this.parent.createElement("input",{id:l.field+"_filterBarcell",className:"e-filterUi_input e-filtertext e-fltrTemp",attrs:{type:"search",title:l.headerText}}),a.appendChild(n);else{var u={column:l,node:Element},g=l.filterBarTemplate.create;if("string"==typeof g&&(g=t.getValue(g,window)),"string"==typeof(n=g(u))){var f=this.parent.createElement("div");f.innerHTML=n,n=f.firstChild}t.attributes(a,{class:"e-filterUi_input e-filtertext e-fltrTemp",title:l.headerText,id:l.field+"_filterBarcell"}),a.appendChild(n)}(!1===l.allowFiltering||""===l.field||t.isNullOrUndefined(l.field))&&(n.setAttribute("disabled","true"),n.classList.add("e-disable"));var m=a.querySelector(".e-clear-icon");if(m&&m.setAttribute("title",this.parent.localeObj.getConstant("ClearButton")),l.visible||o.classList.add("e-hide"),this.appendHtml(o,a),this.parent.filterSettings.showFilterBarOperator&&"FilterBar"===this.parent.filterSettings.type&&!this.parent.isPrinting&&t.isNullOrUndefined(l.filterTemplate)&&t.isNullOrUndefined(l.filterBarTemplate)&&this.operatorIconRender(a,l,e),(t.isNullOrUndefined(l.allowFiltering)||l.allowFiltering)&&!t.isNullOrUndefined(l.filterBarTemplate)){var y=l.filterBarTemplate.write,u={element:n,column:l};"string"==typeof y&&(y=t.getValue(y,window)),y.call(this,u)}}else l.visible||o.classList.add("e-hide");return this.parent.isFrozenGrid()&&$e(this.parent,l,o),o},i.prototype.appendHtml=function(e,t){return e.appendChild(t),e},i.prototype.operatorIconRender=function(e,i,n){var r,s=this.parent,a=this.parent.createElement("input",{className:" e-filterbaroperator e-icons e-icon-filter",id:n.column.uid});if(e.querySelector("span").appendChild(a),i.filter&&i.filter.operator)r=i.filter.operator;else if(s.filterSettings.columns.length)for(var l=0,d=s.filterSettings.columns;l<d.length;l++){var h=d[parseInt(l.toString(),10)];if(h.field===i.field){r=h.operator;break}r="equal"}else r="equal";t.isNullOrUndefined(s.filterModule.operators[i.field])||(r=s.filterModule.operators[i.field]),this.dropOptr=new o.DropDownList({fields:{text:"text",value:"value"},popupHeight:"auto",value:r,width:"0px",enabled:i.allowFiltering,popupWidth:"auto",enableRtl:this.parent.enableRtl,change:this.internalEvent.bind(this),beforeOpen:function(){var e=s.filterModule.customOperators;this.dataSource=e[s.getColumnByUid(this.element.id).type+"Operator"];for(var n=0;n<this.dataSource.length;n++)i.filter&&i.filter.operator&&t.isNullOrUndefined(s.filterModule.operators[i.field])&&this.dataSource[parseInt(n.toString(),10)].value===i.filter.operator&&(this.value=i.filter.operator)},cssClass:this.parent.cssClass?"e-popup-flbar "+this.parent.cssClass:"e-popup-flbar"}),this.dropOptr.isAngular=Ge(this.parent),this.dropOptr.appendTo(a);var p=t.closest(this.dropOptr.element,"span");p.classList.add("e-filterbardropdown"),p.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;var n=e.value;if(t.filterModule&&t.filterModule.filterSettings.showFilterBarOperator){var r=document.getElementById(i.field+"_filterBarcell");"isempty"===n||"isnotempty"===n||"isnotnull"===n||"isnull"===n?(r.setAttribute("readOnly","true"),t.filterModule.filterByColumn(i.field,n,null,t.filterModule.predicate,t.filterModule.filterSettings.enableCaseSensitivity,t.filterModule.ignoreAccent,i.isForeignColumn())):r&&r.readOnly&&(r.removeAttribute("readOnly"),t.filterModule.removeFilteredColsByField(i.field))}t.notify("get-filterbar-operator",e)},i}(Rn),gs=function(){function e(e,t,i,n){this.ddOpen=this.dropDownOpen.bind(this),this.parent=e,this.serviceLocator=i,this.filterSettings=n,this.customFilterOperators=t,this.parent&&(this.parent.on(Di,this.destroyDropDownList,this),this.parent.on(pi,this.destroyDropDownList,this))}return e.prototype.renderOperatorUI=function(e,i,n,r,s){var a=this;this.dialogObj=r;var l=n.type+"Operator";this.optrData=this.customOptr=t.isNullOrUndefined(s)?t.isNullOrUndefined(this.parent.filterSettings.operators)||t.isNullOrUndefined(this.parent.filterSettings.operators[""+l])?this.customFilterOperators[""+l]:this.parent.filterSettings.operators[""+l]:s;var d=this.customOptr,h=this.dropSelectedVal(n,l),p=this.parent.createElement("div",{className:"e-flm_optrdiv"});e.appendChild(p);var c=this.parent.createElement("input",{id:n.uid+"-floptr"});p.appendChild(c),this.dropOptr=new o.DropDownList({dataSource:d,fields:{text:"text",value:"value"},cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",enableRtl:this.parent.enableRtl,text:h,change:function(){var e=document.querySelector(".e-flmenu-valuediv").querySelector("input");"isempty"===a.dropOptr.value||"isnotempty"===a.dropOptr.value||"isnotnull"===a.dropOptr.value||"isnull"===a.dropOptr.value?t.isNullOrUndefined(e.ej2_instances)?e.setAttribute("disabled","true"):e.ej2_instances[0].enabled=!1:t.isNullOrUndefined(e.getAttribute("disabled"))||(t.isNullOrUndefined(e.ej2_instances)?e.removeAttribute("disabled"):e.ej2_instances[0].enabled=!0),re(a.dropOptr.value,n.uid,n,n.type,r,a.dropOptr.previousValue)}}),this.dropOptr.isAngular=Ge(this.parent),this.dropOptr.addEventListener(hn,this.ddOpen),this.dropOptr.appendTo("#"+n.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,n){for(var r="",s=0,o=this.parent.filterSettings.columns;s<o.length;s++){var a=o[s];if(e.field===a.field||e.isForeignColumn()&&e.foreignKeyValue===a.field){var l=new i.DataManager(this.optrData).executeLocal((new i.Query).where("value","equal",a.operator));r=t.isNullOrUndefined(l[0])?"":l[0].text}}if(""===r&&this.optrData)if(e.filter.operator)for(var d=Object.keys(this.optrData).length,h=0;h<d;h++)this.optrData[parseInt(h.toString(),10)].value===e.filter.operator&&(r=this.optrData[parseInt(h.toString(),10)].text);else r=this.optrData[0].text;return r},e.prototype.getFlOperator=function(){return this.dropOptr.value},e.prototype.destroyDropDownList=function(){this.dropOptr.isDestroyed||(this.dropOptr.removeEventListener(hn,this.ddOpen),this.dropOptr.destroy(),this.parent.off(Di,this.destroyDropDownList),this.parent.off(pi,this.destroyDropDownList))},e}(),fs=function(){function e(e,t,i){o.MultiSelect.Inject(o.CheckBoxSelection),this.parent=e,this.serLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(Di,this.destroy,this),this.parent.on(pi,this.destroy,this))}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.multiSelectCheckBoxInstance=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectstrui-"+e.column.uid}),e.target.appendChild(this.multiSelectCheckBoxInstance),this.dialogObj=e.dialogObj,this.processDataOperation(e),this.createMultiSelectDropDown(e),re(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},e.prototype.processDataOperation=function(e){var t=this;if(e.column.isForeignColumn())return void this.parent.getDataModule().dataManager.executeQuery(this.parent.getDataModule().generateQuery(!0)).then(function(i){t.getAutoCompleteOptions(e,i),re(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)});this.getAutoCompleteOptions(e)},e.prototype.getAutoCompleteOptions=function(e,n){var r,s=e.column.isForeignColumn();if(s){for(var a=$r.getDistinct(n.result,e.column.field).records||[],l=void 0,d=0;d<a.length;d++)l=l?l.or(e.column.field,"contains",a[parseInt(d.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent):new i.Predicate(e.column.field,"contains",a[parseInt(d.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent);(r=(new i.Query).where(l)).params=this.parent.query.params}var h=s?e.column.dataSource:this.parent.dataSource,p={value:s?e.column.foreignKeyValue:e.column.field},c=new o.AutoComplete(t.extend({dataSource:h instanceof i.DataManager?h:new i.DataManager(h),fields:p,locale:this.parent.locale,enableRtl:this.parent.enableRtl,query:s?r:this.parent.getDataModule().generateQuery(!0,!0),sortOrder:"Ascending",cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",autofill:!0,placeholder:e.localizeText.getConstant("EnterValue"),actionBegin:function(){if(this.query.queries.length&&"onWhere"===this.query.queries[0].fn&&this.query.queries[0].e&&this.query.queries[0].e.predicates){for(var e=0;e<this.query.queries[0].e.predicates.length;e++)this.properties.fields.value===this.query.queries[0].e.predicates[""+e].field&&(this.query.queries[0].e.predicates.splice(e,1),e-=1);this.query.queries[0].e.predicates.length||this.query.queries.splice(0,1)}}},e.column.filter.params));if(this.acFocus=this.focus(c,e),this.acComplete=this.actionComplete(c),this.acOpen=this.openPopup.bind(this),c.addEventListener("focus",this.acFocus),c.addEventListener(hn,this.acOpen),c.addEventListener(Ut,this.acComplete),h&&"result"in h){var u=Le({requestType:"stringfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new i.Query);this.parent.trigger("dataStateChange",u.state),u.deffered.promise.then(function(e){c.dataSource=new i.DataManager(e)})}this.actObj=c,this.actObj.appendTo(this.instance),s&&this.parent.filterModule.filterModule.afterRenderFilterUI()},e.prototype.write=function(e){var i=this.parent.filterModule.filterModule.getOperatorDropdown(),n=this.getAutoCompleteInstance(e.column.uid),r=this.getMultiSelectInstance(e.column.uid);"in"===i.value||"notin"===i.value?r.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:""===e.filteredValue||t.isNullOrUndefined(e.filteredValue)||Array.isArray(e.filteredValue)||(n.value=e.filteredValue)},e.prototype.read=function(e,i,n,r){if("in"===n||"notin"===n){o=this.getMultiSelectInstance(i.uid).value;r.filterByColumn(i.field,n,o,"and",this.parent.filterSettings.enableCaseSensitivity)}else{var s=this.getAutoCompleteInstance(i.uid),o=e.value;t.Browser.isDevice&&(s.hidePopup(),s.focusOut()),(t.isNullOrUndefined(o)||""===o)&&(o=null),r.filterByColumn(i.field,n,o,"and",this.parent.filterSettings.enableCaseSensitivity)}},e.prototype.getAutoCompleteInstance=function(e){return document.querySelector("#strui-"+e).ej2_instances[0]},e.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectstrui-"+e).ej2_instances[0]},e.prototype.createMultiSelectDropDown=function(e){var n=e.column.isForeignColumn(),r=n?e.column.dataSource:this.parent.dataSource,s=n?e.column.foreignKeyValue:e.column.field;this.multiSelectObj=new o.MultiSelect(t.extend({dataSource:r instanceof i.DataManager?r:new i.DataManager(r),fields:{text:s,value:s},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new i.Query).select(s),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionCompleteMultiCheckBox(s),this.multiSelectObj.addEventListener(hn,this.dropdownOpen),this.multiSelectObj.addEventListener(Ut,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},e.prototype.openPopup=function(e){ne(e,this.dialogObj)},e.prototype.focus=function(e,t){return function(){e.filterType=t.getOptrInstance.getFlOperator()}},e.prototype.actionComplete=function(e){return function(i){i.result=i.result.filter(function(i,n,r){return r.map(function(i){return t.getValue(e.fields.value,i)}).indexOf(t.getValue(e.fields.value,i))===n})}},e.prototype.actionCompleteMultiCheckBox=function(e){return function(t){t.result=i.DataUtil.distinct(t.result,e,!0)}},e.prototype.destroy=function(){this.parent.off(Di,this.destroy),this.parent.off(pi,this.destroy),this.actObj&&!this.actObj.isDestroyed&&(this.actObj.removeEventListener("focus",this.acFocus),this.actObj.removeEventListener(hn,this.acOpen),this.actObj.removeEventListener(Ut,this.acComplete),this.actObj.destroy()),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(hn,this.dropdownOpen),this.multiSelectObj.removeEventListener(Ut,this.dropdownComplete),this.multiSelectObj.destroy())},e}(),ms=function(){function e(e,t,i){o.MultiSelect.Inject(o.CheckBoxSelection),this.filterSettings=i,this.parent=e,this.serviceLocator=t,this.parent&&(this.parent.on(Di,this.destroy,this),this.parent.on(pi,this.destroy,this))}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.numericInstance=this.parent.createElement("input",{className:"e-flmenu-input",id:"numberui-"+e.column.uid}),this.multiSelectCheckBoxInstance=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectnumberui-"+e.column.uid}),e.target.appendChild(this.numericInstance),e.target.appendChild(this.multiSelectCheckBoxInstance),this.createNumericTextBox(e),this.createMultiSelectDropDown(e),re(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},e.prototype.write=function(e){var t=this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getNumericInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:(i.element.addEventListener("keydown",this.keyEventHandler),Array.isArray(e.filteredValue)||(i.value=e.filteredValue))},e.prototype.read=function(e,t,i,n){if("in"===i||"notin"===i){r=this.getMultiSelectInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",!0)}else{var r=this.getNumericInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",!0)}},e.prototype.createNumericTextBox=function(e){this.numericTxtObj=new s.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:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("EnterValue"),enableRtl:this.parent.enableRtl},e.column.filter.params)),this.numericTxtObj.appendTo(this.numericInstance)},e.prototype.createMultiSelectDropDown=function(e){var n=e.column.isForeignColumn(),r=n?e.column.dataSource:this.parent.dataSource,s=n?e.column.foreignKeyValue:e.column.field;this.multiSelectObj=new o.MultiSelect(t.extend({dataSource:r instanceof i.DataManager?r:new i.DataManager(r),fields:{text:s,value:s},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new i.Query).select(s),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionComplete(s),this.multiSelectObj.addEventListener(hn,this.dropdownOpen),this.multiSelectObj.addEventListener(Ut,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},e.prototype.getNumericInstance=function(e){return document.querySelector("#numberui-"+e).ej2_instances[0]},e.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectnumberui-"+e).ej2_instances[0]},e.prototype.openPopup=function(e){ne(e,this.dialogObj)},e.prototype.actionComplete=function(e){return function(t){t.result=i.DataUtil.distinct(t.result,e,!0)}},e.prototype.destroy=function(){this.parent.off(Di,this.destroy),this.parent.off(pi,this.destroy),this.numericTxtObj&&!this.numericTxtObj.isDestroyed&&this.numericTxtObj.destroy(),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(hn,this.dropdownOpen),this.multiSelectObj.removeEventListener(Ut,this.dropdownComplete),this.multiSelectObj.destroy())},e}(),ys=function(){function e(e,t,i){o.MultiSelect.Inject(o.CheckBoxSelection),this.parent=e,this.serviceLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(Di,this.destroy,this),this.parent.on(pi,this.destroy,this))}return e.prototype.create=function(e){this.elem=this.parent.createElement("input",{className:"e-flmenu-input",id:"bool-ui-"+e.column.uid}),e.target.appendChild(this.elem),this.multiSelectElement=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectbool-ui-"+e.column.uid}),e.target.appendChild(this.multiSelectElement),this.createDropDownList(e),this.createMultiSelectDropDown(e),re(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},e.prototype.write=function(e){var i=this.parent.filterModule.filterModule.getOperatorDropdown(),n=this.getBooleanInstance(e.column.uid),r=this.getMultiSelectInstance(e.column.uid);"in"===i.value||"notin"===i.value?r.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:t.isNullOrUndefined(e.filteredValue)||Array.isArray(e.filteredValue)||(n.value=e.filteredValue)},e.prototype.read=function(e,t,i,n){if("in"===i||"notin"===i){r=this.getMultiSelectInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",!0)}else{var r=this.getBooleanInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",!1)}},e.prototype.createDropDownList=function(e){var n=this,r=e.column.isForeignColumn(),s=r?e.column.dataSource:this.parent.dataSource,a=r?e.column.foreignKeyValue:e.column.field;if(this.dialogObj=e.dialogObj,this.dropInstance=new o.DropDownList(t.extend({dataSource:s instanceof i.DataManager?s:new i.DataManager(s),query:(new i.Query).select(a),fields:{text:a,value:a},placeholder:e.localizeText.getConstant("SelectValue"),cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionComplete(a),this.dropInstance.addEventListener(hn,this.dropdownOpen),this.dropInstance.addEventListener(Ut,this.dropdownComplete),s&&"result"in s){var l=Le({requestType:"booleanfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new i.Query);this.parent.trigger("dataStateChange",l.state),l.deffered.promise.then(function(t){n.dropInstance.dataSource=new i.DataManager(t),n.dropInstance.dataBind();for(var r=0,s=n.parent.filterSettings.columns;r<s.length;r++){var o=s[r];e.column.uid===o.uid&&(n.dropInstance.value=o.value)}})}this.dropInstance.appendTo(this.elem)},e.prototype.createMultiSelectDropDown=function(e){var n=e.column.isForeignColumn(),r=n?e.column.dataSource:this.parent.dataSource,s=n?e.column.foreignKeyValue:e.column.field;this.multiSelectCheckBoxInstance=new o.MultiSelect(t.extend({dataSource:r instanceof i.DataManager?r:new i.DataManager(r),fields:{text:s,value:s},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new i.Query).select(s),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.multiSelectDropdownOpen=this.openPopup.bind(this),this.multiSelectDropdownComplete=this.actionComplete(s),this.multiSelectCheckBoxInstance.addEventListener(hn,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.addEventListener(Ut,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.appendTo(this.multiSelectElement)},e.prototype.getBooleanInstance=function(e){return document.querySelector("#bool-ui-"+e).ej2_instances[0]},e.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectbool-ui-"+e).ej2_instances[0]},e.prototype.openPopup=function(e){ne(e,this.dialogObj)},e.prototype.actionComplete=function(e){return function(t){t.result=i.DataUtil.distinct(t.result,e,!0)}},e.prototype.destroy=function(){this.parent.off(Di,this.destroy),this.parent.off(pi,this.destroy),this.dropInstance&&!this.dropInstance.isDestroyed&&(this.dropInstance.removeEventListener(hn,this.dropdownOpen),this.dropInstance.removeEventListener(Ut,this.dropdownComplete),this.dropInstance.destroy()),this.multiSelectCheckBoxInstance&&!this.multiSelectCheckBoxInstance.isDestroyed&&(this.multiSelectCheckBoxInstance.removeEventListener(hn,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.removeEventListener(Ut,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.destroy())},e}(),vs=function(){function e(e,t,i){this.dpOpen=this.openPopup.bind(this),this.parent=e,this.locator=t,this.fltrSettings=i,this.parent&&(this.parent.on(Di,this.destroy,this),this.parent.on(pi,this.destroy,this))}return e.prototype.create=function(e){var i=me(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||"dateonly"===e.column.type?this.datePickerObj=new a.DatePicker(t.extend({format:i,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)):"datetime"===e.column.type&&(this.datePickerObj=new a.DateTimePicker(t.extend({format:i,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params))),this.datePickerObj.addEventListener(hn,this.dpOpen),this.datePickerObj.appendTo(this.inputElem)},e.prototype.write=function(e){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,n,r){var s=document.querySelector("#dateui-"+i.uid).ej2_instances[0].value;s=t.isNullOrUndefined(s)?null:s,r.filterByColumn(i.field,n,s,"and",!0)},e.prototype.openPopup=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},e.prototype.destroy=function(){this.parent.off(Di,this.destroy),this.parent.off(pi,this.destroy),t.isNullOrUndefined(this.datePickerObj)||this.datePickerObj.isDestroyed||(this.datePickerObj.removeEventListener(hn,this.dpOpen),this.datePickerObj.destroy())},e}(),Ss=function(){function e(e,t,i,n,r){this.isDialogOpen=!1,this.maxHeight="350px",this.isMenuCheck=!1,this.colTypes={string:fs,number:ms,date:vs,dateonly:vs,boolean:ys,datetime:vs},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.customFilterOperators=n,this.filterObj=r,this.flMuiObj=new gs(this.parent,this.customFilterOperators,this.serviceLocator),this.l10n=this.serviceLocator.getService("localization"),this.menuFilterBase=new $r(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){var i=this;if(this.dlgObj){var n=document.getElementById(this.dlgObj.element.id);if(this.dlgObj&&!this.dlgObj.isDestroyed&&n){var r={cancel:!1,column:this.col,target:e,element:n};if(r.cancel)return void(this.parent.isColumnMenuFilterClosing=!1);this.parent.notify(Di,r),this.isDialogOpen=!1,this.isMenuCheck&&(this.menuFilterBase.unWireEvents(),this.parent.off(Ai,this.actionComplete),this.isMenuCheck=!1);var s=this.col;if(!t.isNullOrUndefined(s.filter)&&!t.isNullOrUndefined(s.filter.ui)&&!t.isNullOrUndefined(s.filter.ui.destroy)){var o=s.filter.ui.destroy;"string"==typeof o&&(o=t.getValue(o,window)),o()}if((this.parent.isReact||this.parent.isVue)&&this.col.filterTemplate&&this.col.filterTemplate instanceof Function?this.parent.clearTemplate(["filterTemplate"],void 0,function(){i.dlgObj.destroy()}):(this.dlgObj.destroy(),t.remove(n)),!this.parent.showColumnChooser){var a=document.getElementById(this.parent.element.id+"_e-popup");t.isNullOrUndefined(a)||(t.remove(a),a=null)}t.isNullOrUndefined(this.dlgObj.storeActiveElement)||this.dlgObj.storeActiveElement.focus()}this.parent.notify("filter-dialog-close",{})}},e.prototype.renderDlgContent=function(e,i){var r={requestType:"filterBeforeOpen",columnName:i.field,columnType:i.type};r.filterModel=this,this.parent.trigger(qt,r);var s=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 n.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:this.parent.cssClass?"e-flmenu-okbtn "+this.parent.cssClass:"e-flmenu-okbtn"}},{click:this.clearBtnClick.bind(this,i),buttonModel:{content:this.l10n.getConstant("ClearButton"),cssClass:this.parent.cssClass?"e-flmenu-cancelbtn "+this.parent.cssClass:"e-flmenu-cancelbtn"}}],content:s,width:!t.isNullOrUndefined(F(e,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:250,animationSettings:{effect:"None"},cssClass:this.parent.cssClass?"e-filter-popup "+this.parent.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?ie(e,this.dlgObj,this.parent):this.options.isResponsiveFilter||(this.dlgObj.position={X:"center",Y:"center"}),this.currentDialogCreatedColumn=i,this.renderFilterUI(e,i),i.isForeignColumn()&&(t.isNullOrUndefined(i.filter)||t.isNullOrUndefined(i.filter.ui)||t.isNullOrUndefined(i.filter.ui.create))||t.isNullOrUndefined(i.type)||this.afterRenderFilterUI();var n=this.parent.isReact&&"string"!=typeof i.filterTemplate,r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;t.isNullOrUndefined(i.filterTemplate)||n||r?t.isNullOrUndefined(this.dlgDiv.querySelector(".e-flmenu-input"))||(this.dlgDiv.querySelector(".e-flmenu-input").focus(),this.dlgDiv.querySelector(".e-flmenu-input").parentElement.classList.add("e-input-focus")):(this.dlgDiv.querySelector(".e-flmenu-valuediv").firstElementChild.focus(),this.dlgDiv.querySelector(".e-flmenu-valuediv").firstElementChild.classList.add("e-input-focus"))},e.prototype.afterRenderFilterUI=function(){var e=this.currentDialogCreatedColumn;e.showColumnMenu&&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(),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!F(this.parent.element,"e-gantt-dialog")&&_e(this.parent,this.dlgObj);var i=this.flMuiObj.getFlOperator(),n=this.dlgObj.element.querySelector(".e-flmenu-valuediv").querySelector("input");"isempty"===i||"isnotempty"===i||"isnull"===i||"isnotnull"===i?t.isNullOrUndefined(n.ej2_instances)?n.setAttribute("disabled","true"):n.ej2_instances[0].enabled=!1:t.isNullOrUndefined(n&&n.getAttribute("disabled"))||(t.isNullOrUndefined(n.ej2_instances)?n.removeAttribute("disabled"):n.ej2_instances[0].enabled=!0),e.filterTemplate||this.writeMethod(e,this.dlgObj.element.querySelector("#"+e.uid+"-flmenu"));var r={requestType:"filterAfterOpen",columnName:e.field,columnType:e.type};r.filterModel=this,this.isDialogOpen=!0,this.isMenuCheck||this.parent.trigger(Ut,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,n){var r=this.parent.createElement("div",{className:"e-flmenu-valuediv"}),s=this.filterObj;if(e.appendChild(r),!t.isNullOrUndefined(n.type)){var o=new this.colTypes[n.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(n.filterTemplate){var a={};a[n.field]=a.value=s.values[n.field],n.foreignKeyValue&&(a[n.foreignKeyValue]=s.values[n.field],a[n.field]=void 0);a.column=n;var l=this.parent.isReact&&"string"!=typeof n.filterTemplate&&!(n.filterTemplate.prototype&&n.filterTemplate.prototype.CSPTemplate),d=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,h=this.parent.element.id+n.uid+"filterTemplate";l||d?(n.getFilterTemplate()(a,this.parent,"filterTemplate",h,null,null,r),this.parent.renderTemplates()):q(r,n.getFilterTemplate()(a,this.parent,"filterTemplate",h,null,null,null,this.parent.root)),this.isMenuCheck&&(this.menuFilterBase.cBox=this.dlgObj.element.querySelector(".e-checkboxlist.e-fields"),this.menuFilterBase.wireEvents(),this.parent.on(Ai,this.actionComplete,this),this.menuFilterBase.getAllData())}else if(t.isNullOrUndefined(n.filter)||t.isNullOrUndefined(n.filter.ui)||t.isNullOrUndefined(n.filter.ui.create))o.create({column:n,target:r,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj});else{var p=n.filter.ui.create;"string"==typeof p&&(p=t.getValue(p,window)),p({column:n,target:r,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj})}}},e.prototype.writeMethod=function(e,i){for(var n,r=i.querySelector(".e-flmenu-valinput"),s=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),o=0,a=this.filterSettings.columns;o<a.length;o++){var l=a[o];e.uid===l.uid&&(n=l.value)}if(t.isNullOrUndefined(e.filter)||t.isNullOrUndefined(e.filter.ui)||t.isNullOrUndefined(e.filter.ui.write))s.write({column:e,target:r,parent:this.parent,filteredValue:n});else{var d=e.filter.ui.write;"string"==typeof d&&(d=t.getValue(d,window)),d({column:e,target:r,parent:this.parent,filteredValue:n})}},e.prototype.filterBtnClick=function(e){var i=this.dlgObj.element.querySelector(".e-flmenu-valuediv input"),n=this.flMuiObj.getFlOperator(),r=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(e.filterTemplate){var s=this.dlgDiv.querySelector(".e-flmenu-valuediv"),o=void 0;if(s.children[0].value)o=s.children[0].value;else if(t.isNullOrUndefined(s.children[0].ej2_instances)){var a=s.querySelector(".e-control");t.isNullOrUndefined(a)||(o="boolean"===e.type?a.checked:t.isNullOrUndefined(a.ej2_instances)?a.value:a.ej2_instances[0].value)}else o=(this.parent.isAngular?s.children[0]:s.querySelector("input")).ej2_instances[0].value;this.filterObj.filterByColumn(e.field,n,o)}else if(t.isNullOrUndefined(e.filter)||t.isNullOrUndefined(e.filter.ui)||t.isNullOrUndefined(e.filter.ui.read))r.read(i,e,n,this.filterObj);else{var l=e.filter.ui.read;"string"==typeof l&&(l=t.getValue(l,window)),l({element:i,column:e,operator:n,fltrObj:this.filterObj})}this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify("after-filter-column-menu-close",{})},e.prototype.closeResponsiveDialog=function(){this.closeDialog()},e.prototype.clearBtnClick=function(e){this.filterObj.removeFilteredColsByField(e.field),this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify("after-filter-column-menu-close",{})},e.prototype.destroy=function(){this.closeDialog()},e.prototype.getFilterUIInfo=function(){return{field:this.col.field,operator:this.flMuiObj.getFlOperator()}},e.prototype.getOperatorDropdown=function(){return this.flMuiObj.dropOptr},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(Ut,e)},e}(),Cs=function(){function e(e,t,i){this.parent=e,this.isresetFocus=!0,this.checkBoxBase=new $r(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.destroy(),this.isresetFocus&&this.parent.notify("restore-Focus",{})},e.prototype.closeResponsiveDialog=function(){this.checkBoxBase.closeDialog()},e.prototype.getModuleName=function(){return"checkboxFilter"},e.prototype.actionBegin=function(e){this.parent.trigger(qt,e)},e.prototype.actionComplete=function(e){this.parent.trigger(Ut,e)},e.prototype.actionPrevent=function(e){J(this.parent)&&(this.parent.notify(bi,e),e.cancel=!0)},e.prototype.clearCustomFilter=function(e){this.checkBoxBase.clearFilter(e)},e.prototype.applyCustomFilter=function(){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(Ai,this.actionComplete,this),this.parent.on(Fi,this.actionPrevent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("cbox-filter-begin",this.actionBegin),this.parent.off(Ai,this.actionComplete),this.parent.off(Fi,this.actionPrevent))},e}(),ws=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bs=function(e){function t(t,i,n,r){var s=e.call(this,t,i,n)||this;return s.parent=t,s.isresetFocus=!0,s.excelFilterBase=new ts(t,r),s}return ws(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,n,r,s,o,a){this.excelFilterBase.filterByColumn(e,t,i,n,r,s,o,a)},t.prototype.getFilterUIInfo=function(){return this.excelFilterBase.getFilterUIInfo()},t.prototype.getModuleName=function(){return"excelFilter"},t}(Cs),Is=function(){function n(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:Ss,CheckBox:Cs,Excel:bs},this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith",wildCard:"wildcard",isNull:"isnull",notNull:"notnull",like:"like"},this.fltrDlgDetails={field:"",isOpen:!1},this.skipNumberInput=["="," ","!"],this.skipStringInput=[">","<","="],this.actualPredicate={},this.inputList=[],this.isFilterCleared=!1,this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.addEventListener(),this.setFullScreenDialog()}return n.prototype.render=function(n){if(!i.DataUtil.getObject("args.isFrozen",n)){var r=this.parent;if(this.l10n=this.serviceLocator.getService("localization"),this.getLocalizedCustomOperators(),"FilterBar"===this.parent.filterSettings.type&&r.columns.length){var s=this.parent.element.querySelector(".e-filterbar");s&&t.remove(s);var o=new fn(this.serviceLocator,e.CellType.Filter,r);this.serviceLocator.getService("cellRendererFactory").addCellRenderer(e.CellType.Filter,new us(this.parent,this.serviceLocator)),this.valueFormatter=this.serviceLocator.getService("valueFormatter"),o.element=this.parent.createElement("tr",{className:"e-filterbar",attrs:{role:"row"}});var a=this.generateRow();a.data=this.values,this.parent.getHeaderContent().querySelector("thead:not(.e-masked-thead)").appendChild(o.element);var l=this.parent.element.querySelector(".e-rowdragheader");if(this.element=o.render(a,r.getColumns(),null,null,o.element),this.element.querySelectorAll(".e-leftfreeze").length&&(this.element.querySelectorAll(".e-indentcell").length||this.element.querySelectorAll(".e-grouptopleftcell").length))for(var d=this.element.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),h=0;h<d.length;h++)d[parseInt(h.toString(),10)].classList.add("e-leftfreeze"),Ye(d[parseInt(h.toString(),10)],30*h,this.parent.enableRtl,"Left");Xe(this.element);var p=this.element.querySelector(".e-detailheadercell");p&&(p.className="e-filterbarcell e-mastercell"),l&&(l.classList.contains("e-leftfreeze")?l.className="e-dragheadercell e-mastercell e-leftfreeze":l.className="e-filterbarcell e-mastercell");var c=[].slice.call(this.element.getElementsByClassName("e-grouptopleftcell"));c.length&&c[c.length-1].classList.add("e-lastgrouptopleftcell"),this.wireEvents(),this.parent.notify(Ri,{case:"filter"})}}},n.prototype.showCustomFilter=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog(this.column)},n.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},n.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)},n.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+Ki)||e.querySelector("."+Wi))){if(this.filterModule&&this.filterModule.destroy(),this.parent.refreshing||!this.parent.isDestroyed&&this.parent.allowFiltering||(this.filterSettings.columns=[]),this.updateFilterMsg(),this.removeEventListener(),this.unWireEvents(),"FilterBar"===this.filterSettings.type&&!this.parent.isDestroyed){if(this.filterSettings.showFilterBarOperator)for(var i=[].slice.call(this.element.getElementsByClassName("e-filterbaroperator")),n=0;n<i.length;n++)i[parseInt(n.toString(),10)].ej2_instances[0]&&i[parseInt(n.toString(),10)].ej2_instances[0].destroy();this.parent.getColumns().map(function(e){if(e.filterBarTemplate&&!t.isNullOrUndefined(e.filterBarTemplate.destroy)){var i=e.filterBarTemplate.destroy;"string"==typeof i&&(i=t.getValue(i,window)),i()}})}if(this.element){if(this.element.parentElement){for(n=0;n<this.inputList.length;n++)s.Input.destroy(this.inputList[parseInt(n.toString(),10)],this.inputList[parseInt(n.toString(),10)].element.nextElementSibling),t.remove(this.inputList[parseInt(n.toString(),10)].element);this.inputList=[],t.remove(this.element),this.element=null}var r=this.parent.getHeaderContent().querySelector(".e-filterbar");r&&t.remove(r)}}},n.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,e.ResponsiveDialogAction.isFilter)},n.prototype.generateRow=function(){var e=new ji({});return e.cells=this.generateCells(),e},n.prototype.generateCells=function(){var t=[];if(this.parent.allowGrouping)for(var i=0,n=this.parent.groupSettings.columns.length;i<n;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 r=0,s=this.parent.getColumns();r<s.length;r++){var o=s[r];t.push(this.generateCell(o))}return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&t.push(this.generateCell({},e.CellType.RowDragHIcon)),t},n.prototype.generateCell=function(t,i){var n={visible:t.visible,isDataCell:!1,rowId:"",column:t,cellType:i||e.CellType.Filter,attributes:{title:this.l10n.getConstant("FilterbarTitle")}};return new Vi(n)},n.prototype.updateModel=function(){var e=this.column.isForeignColumn()||this.parent.enableColumnVirtualization?this.parent.getColumnByUid(this.column.uid,!0):this.parent.getColumnByField(this.fieldName);this.filterObjIndex=this.getFilteredColsIndexByField(e),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex];for(var n=Array.isArray(this.value)&&this.value.length?this.value:[this.value],r=this.parent.dataSource.adaptor&&this.parent.dataSource.adaptor.getModuleName?this.parent.dataSource.adaptor.getModuleName():void 0,s=0,o=n.length;s<o;s++){var a=e.isForeignColumn()?e.foreignKeyValue:this.fieldName,l="notequal"===this.operator;"in"===this.operator||"notin"===this.operator?(!this.parent.getDataModule().isRemote()||"date"!==e.type&&"dateonly"!==e.type&&"datetime"!==e.type||(n=i.DataUtil.parse.arrayReplacer(n)),this.currentFilterObject={field:a,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:n,predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}},o=0):this.currentFilterObject={field:a,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:n[parseInt(s.toString(),10)],predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}};var d=this.getFilteredColsIndexByField(e);d>-1&&(!Array.isArray(this.value)||Array.isArray(this.value)&&("in"===this.operator||"notin"===this.operator))?this.filterSettings.columns[parseInt(d.toString(),10)]=this.currentFilterObject:this.filterSettings.columns.push(this.currentFilterObject),this.column.isForeignColumn()||!this.prevFilterObject||!t.isNullOrUndefined(this.prevFilterObject.value)&&""!==this.prevFilterObject.value||"equal"!==this.prevFilterObject.operator&&"notequal"!==this.prevFilterObject.operator||"ODataAdaptor"===r||"ODataV4Adaptor"===r||this.handleExistingFilterCleanup(a),this.column.isForeignColumn()||!t.isNullOrUndefined(this.value)||"equal"!==this.operator&&"notequal"!==this.operator||"ODataAdaptor"===r||"ODataV4Adaptor"===r||(this.handleExistingFilterCleanup(a),"string"===e.type&&this.filterSettings.columns.push({field:a,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:l?"and":"or",value:""}),this.filterSettings.columns.push({field:a,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:l?"and":"or",value:void 0}),this.filterSettings.columns.push({field:a,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:l?"and":"or",value:null}))}this.filterSettings.columns=this.filterSettings.columns,this.parent.dataBind()},n.prototype.handleExistingFilterCleanup=function(e){for(var i=0;i<this.filterSettings.columns.length;i++)this.filterSettings.columns[""+i].field!==e||"equal"!==this.filterSettings.columns[""+i].operator&&"notequal"!==this.filterSettings.columns[""+i].operator||!t.isNullOrUndefined(this.filterSettings.columns[""+i].value)||(this.filterSettings.columns.splice(i,1),i-=1)},n.prototype.getFilteredColsIndexByField=function(e){for(var t=this.filterSettings.columns,i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)].uid===e.uid||e.isForeignColumn()&&this.parent.getColumnByUid(e.uid).field===e.foreignKeyValue)return i;return-1},n.prototype.onActionComplete=function(e){var i=this.isRemove?{requestType:"filtering",type:Ut}:{currentFilterObject:this.currentFilterObject,currentFilteringColumn:t.isNullOrUndefined(this.column)?void 0:this.column.field,columns:this.filterSettings.columns,requestType:"filtering",type:Ut};this.parent.trigger(Ut,t.extend(e,i)),this.isRemove=!1},n.prototype.wireEvents=function(){t.EventHandler.add(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate)},n.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.parent.getHeaderTable().classList.add("e-sortfilter"),this.render())},n.prototype.refreshFilterValue=function(){t.isNullOrUndefined(this.parent.modelObserver.boundedEvents)||this.parent.removeEventListener("beforeDataBound",this.refreshFilterValueFn),"FilterBar"!==this.filterSettings.type&&"Excel"!==this.filterSettings.type||!this.filterSettings.columns.length||this.parent.getCurrentViewRecords().length||this.initialEnd()},n.prototype.initialEnd=function(){if(this.parent.off($t,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 n=i[t];this.filterByColumn(n.field,n.operator,n.value,n.predicate,n.matchCase,n.ignoreAccent,n.actualFilterValue,n.actualOperator,n.isForeignKey)}this.initialLoad=!1,this.updateFilterMsg(),this.contentRefresh=!0}},n.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("set-fullscreen-dialog",this.setFullScreenDialog,this),this.parent.on(ei,this.enableAfterRender,this),this.parent.on("filtering-complete",this.onActionComplete,this),this.parent.on(ii,this.onPropertyChanged,this),this.parent.on(di,this.keyUpHandler,this),this.parent.on(ui,this.columnPositionChanged,this),this.parent.on(si,this.render,this),this.parent.on($t,this.initialEnd,this),this.parent.on(Di,this.filterMenuClose,this),this.parent.on(Bi,this.renderResponsiveChangeAction,this),this.docClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.docClickHandler,this),t.EventHandler.add(this.parent.element,"mousedown",this.refreshClearIcon,this),this.parent.on("filterOpen",this.columnMenuFilter,this),this.parent.on(hi,this.filterIconClickHandler,this),this.parent.on("persist-data-changed",this.initialEnd,this),this.parent.on("close-filter-dialog",this.clickHandler,this),this.parent.on(pi,this.destroy,this),this.refreshFilterValueFn=this.refreshFilterValue.bind(this),this.parent.addEventListener("beforeDataBound",this.refreshFilterValueFn))},n.prototype.removeEventListener=function(){t.EventHandler.remove(document,"click",this.docClickHandler),t.EventHandler.remove(this.parent.element,"mousedown",this.refreshClearIcon),this.parent.isDestroyed||(this.parent.off("set-fullscreen-dialog",this.setFullScreenDialog),this.parent.off(ei,this.enableAfterRender),this.parent.off("filtering-complete",this.onActionComplete),this.parent.off(ii,this.onPropertyChanged),this.parent.off(di,this.keyUpHandler),this.parent.off(ui,this.columnPositionChanged),this.parent.off(si,this.render),this.parent.off("filterOpen",this.columnMenuFilter),this.parent.off(Di,this.filterMenuClose),this.parent.off(Bi,this.renderResponsiveChangeAction),this.parent.off(hi,this.filterIconClickHandler),this.parent.off("close-filter-dialog",this.clickHandler),this.parent.off(pi,this.destroy))},n.prototype.refreshClearIcon=function(e){if(this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type&&e.target.closest("th")&&e.target.closest("th").classList.contains("e-filterbarcell")&&e.target.classList.contains("e-clear-icon")){var t=e.target.previousElementSibling;s.Input.setValue(null,t,"Never",!0),"Immediate"===this.filterSettings.mode&&this.removeFilteredColsByField(t.id.slice(0,-14))}},n.prototype.filterMenuClose=function(){this.fltrDlgDetails.isOpen=!1},n.prototype.filterByColumn=function(e,i,n,r,s,o,a,l,d){var h,p=this,c=this.parent;if("string"==typeof n&&(n=this.parent.sanitize(n)),this.column=c.grabColumnByFieldFromAllCols(e,d),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&t.isNullOrUndefined(this.column.filterBarTemplate)&&t.isNullOrUndefined(this.column.filterTemplate)&&(i=this.getOperatorName(e)),"like"===i&&n&&-1===n.indexOf("%")&&(n="%"+n+"%"),this.column){if("FilterBar"===this.filterSettings.type&&(h=c.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(c))return void c.notify(bi,{instance:this,handler:this.filterByColumn,arg1:e,arg2:i,arg3:n,arg4:r,arg5:s,arg6:o,arg7:a,arg8:l});if(this.predicate=r||(Array.isArray(n)?"or":"and"),this.value=n,this.matchCase=s||!1,this.ignoreAccent=this.ignoreAccent=t.isNullOrUndefined(o)?this.parent.filterSettings.ignoreAccent:o,this.fieldName=e,this.operator=i,""===(n=t.isNullOrUndefined(n)?n:n.toString())&&(n=null),"number"!==this.column.type&&"date"!==this.column.type||(this.matchCase=!0),h&&"FilterBar"===this.filterSettings.type){if(n&&n.length<1||!this.filterByMethod&&this.checkForSkipInput(this.column,n))return this.filterStatusMsg=n&&n.length<1?"":this.l10n.getConstant("InvalidFilterMessage"),void this.updateFilterMsg();h.value!==n&&(h.value=n)}t.isNullOrUndefined(this.column.format)?this.values[this.column.field]=n:(this.applyColumnFormat(n),this.initialLoad&&"FilterBar"===this.filterSettings.type&&(h.value=this.values[this.column.field]));var u={field:this.fieldName,predicate:r,matchCase:s,ignoreAccent:o,operator:this.operator,value:this.value,type:this.column.type};this.parent.filterSettings.columns.filter(function(e){return e.field===p.fieldName}).length>1&&!t.isNullOrUndefined(this.actualPredicate[this.fieldName])?this.actualPredicate[this.fieldName].push(u):this.actualPredicate[this.fieldName]=[u],this.checkAlreadyColFiltered(this.column.field)||this.updateModel()}},n.prototype.applyColumnFormat=function(e){var t=this,i="date"===this.column.type||"datetime"===this.column.type||"dateonly"===this.column.type?new Date(e):parseFloat(e);("date"===this.column.type||"datetime"===this.column.type||"dateonly"===this.column.type)&&e&&Array.isArray(this.value)&&e.split(",").length>1?this.values[this.column.field]=e.split(",").map(function(e){return""===e&&(e=null),t.setFormatForFlColumn(new Date(e),t.column)}):this.values[this.column.field]=this.setFormatForFlColumn(i,this.column)},n.prototype.skipUid=function(e){for(var t=!0,i=Object.keys(e),n=0;n<i.length;n++){var r=Object.keys(e[i[parseInt(n.toString(),10)]]);1===r.length&&"uid"===r[0]&&(t=!1)}return t},n.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var i=0,n=Object.keys(e.properties);i<n.length;i++){var r=n[i];switch(r){case"columns":var s={currentFilterObject:this.currentFilterObject,currentFilteringColumn:this.column?this.column.field:void 0,action:"filter",columns:this.filterSettings.columns,requestType:"filtering",type:qt,cancel:!1};if(this.contentRefresh&&this.skipUid(e.properties.columns)){if(this.parent.notify(ni,s),s.cancel){if("CheckBox"!==this.filterSettings.type&&"Excel"!==this.filterSettings.type||this.column&&this.column.filter&&"Menu"===this.column.filter.type)t.isNullOrUndefined(this.prevFilterObject)?this.filterSettings.columns.splice(this.filterSettings.columns.length-1,1):this.filterSettings.columns[this.filterObjIndex]=this.prevFilterObject;else{this.filterSettings.columns=this.actualData.length<=1?this.checkboxPrevFilterObject:this.checkboxFilterObject,this.actualPredicate[this.column.field]=this.filterSettings.columns;var o=this.parent.getColumnByField(this.column.field),a=this.parent.showColumnMenu&&o.showColumnMenu?".e-columnmenu":".e-icon-filter",l=this.parent.getColumnHeaderByField(this.column.field).querySelector(a);0===this.checkboxPrevFilterObject.length?l.classList.remove("e-filtered"):l.classList.add("e-filtered")}return}this.updateFilterIcon(),this.refreshFilterSettings(),this.updateFilterMsg(),this.updateFilter()}break;case"showFilterBarStatus":e.properties[""+r]?this.updateFilterMsg():this.parent.allowPaging&&this.parent.updateExternalMessage("");break;case"showFilterBarOperator":case"type":this.parent.refreshHeader(),this.refreshFilterSettings(),"100%"===this.parent.height&&this.parent.scrollModule.refresh()}}},n.prototype.refreshFilterSettings=function(){if("FilterBar"===this.filterSettings.type){for(o=0;o<this.filterSettings.columns.length;o++){this.column=this.parent.grabColumnByUidFromAllCols(this.filterSettings.columns[parseInt(o.toString(),10)].uid)||this.parent.getColumnByField(this.filterSettings.columns[parseInt(o.toString(),10)].field);var e=this.filterSettings.columns[parseInt(o.toString(),10)].value;if(e=!t.isNullOrUndefined(e)&&e.toString(),t.isNullOrUndefined(this.column.format)){var i=this.filterSettings.columns[parseInt(o.toString(),10)].field;this.values[""+i]=this.filterSettings.columns[parseInt(o.toString(),10)].value}else this.applyColumnFormat(e);(a=this.getFilterBarElement(this.column.field))&&(""===this.cellText[this.filterSettings.columns[parseInt(o.toString(),10)].field]||t.isNullOrUndefined(this.cellText[this.filterSettings.columns[parseInt(o.toString(),10)].field])?a.value=this.filterSettings.columns[parseInt(o.toString(),10)].value:a.value=this.cellText[this.column.field]);var n={isnull:"IsNull",isnotnull:"NotNull",isnotempty:"IsNotEmpty",isempty:"IsEmpty"},r=["isnull","isnotnull","isempty","isnotempty"];a&&this.filterSettings.showFilterBarOperator&&r.indexOf(this.filterSettings.columns[parseInt(o.toString(),10)].operator)>-1&&(a.value=this.l10n.getConstant(n[this.filterSettings.columns[parseInt(o.toString(),10)].operator]))}if(0===this.filterSettings.columns.length)for(var s=this.parent.getColumns(),o=0;o<s.length;o++){var a=this.getFilterBarElement(s[parseInt(o.toString(),10)].field);a&&""!==a.value&&(a.value="",delete this.values[s[parseInt(o.toString(),10)].field])}}},n.prototype.updateFilterIcon=function(){if(0===this.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var e=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),t=0,i=e.length;t<i;t++)e[parseInt(t.toString(),10)].classList.remove("e-filtered")},n.prototype.getFilterBarElement=function(e){var i,n="[id='"+e+"_filterBarcell']";return n&&!t.isNullOrUndefined(this.element)&&(i=this.element.querySelector(n)),i},n.prototype.refreshFilter=function(){this.refreshFilterSettings(),this.updateFilterMsg()},n.prototype.clearFiltering=function(e){var i=this,n=P(this.filterSettings.columns);if(this.isFilterCleared=!0,!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(bi,{instance:this,handler:this.clearFiltering});for(o=0;o<n.length;o++)n[parseInt(o.toString(),10)].uid=n[parseInt(o.toString(),10)].uid||this.parent.getColumnByField(n[parseInt(o.toString(),10)].field).uid;var r=n.map(function(e){return e.uid}),s=r.filter(function(e,t){return r.indexOf(e)===t});this.refresh=!1;for(var o=0,a=s.length;o<a;o++)this.removeFilteredColsByField(this.parent.getColumnByUid(s[parseInt(o.toString(),10)]).field,!1);if(this.refresh=!0,s.length&&this.parent.renderModule.refresh(),0===this.parent.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var l=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),o=0,a=l.length;o<a;o++)l[0].classList.remove("e-filtered");this.isRemove=!0,this.filterStatusMsg="",this.updateFilterMsg()},n.prototype.checkAlreadyColFiltered=function(e){for(var t=0,i=this.filterSettings.columns;t<i.length;t++){var n=i[t];if(n.field===e&&n.operator===this.operator&&n.predicate===this.predicate&&"Menu"===this.parent.filterSettings.type&&("date"===n.type||"datetime"===n.type))return this.checkDateColumnValue(n.value,this.value);if(n.field===e&&n.value===this.value&&n.operator===this.operator&&n.predicate===this.predicate)return!0}return!1},n.prototype.checkDateColumnValue=function(e,i){return!(!t.isNullOrUndefined(e)||!t.isNullOrUndefined(i))||(e instanceof Date&&i instanceof Date?e.getTime()===i.getTime():"string"==typeof e&&"string"==typeof i&&e===i)},n.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)},n.prototype.filterDialogOpen=function(e,t,i,n){this.filterModule&&(this.filterModule.isresetFocus=!1,this.filterModule.closeDialog()),this.setFilterModel(e),this.filterModule.openDialog(this.createOptions(e,t,i,n))},n.prototype.createOptions=function(e,i,n,r){var s=this.parent,o=e.filter.dataSource||s.dataSource&&"result"in s.dataSource?s.dataSource:s.getDataModule().dataManager,a=e.filter.type||this.parent.filterSettings.type;return{type:e.type,field:e.field,displayName:e.headerText,dataSource:o,format:e.format,height:800,columns:s.getColumns(),filteredColumns:s.filterSettings.columns,target:i,dataManager:s.getDataModule().dataManager,formatFn:e.getFormatter(),ignoreAccent:s.filterSettings.ignoreAccent,parserFn:e.getParser(),query:s.query,template:e.getFilterItemTemplate(),hideSearchbox:!t.isNullOrUndefined(e.filter.hideSearchbox)&&e.filter.hideSearchbox,handler:this.filterHandler.bind(this),localizedStrings:s.getLocaleConstants(),position:{X:n,Y:r},column:e,foreignKeyValue:e.foreignKeyValue,actualPredicate:this.actualPredicate,localeObj:s.localeObj,isRemote:s.getDataModule().isRemote(),allowCaseSensitive:this.filterSettings.enableCaseSensitivity,isResponsiveFilter:this.parent.enableAdaptiveUI,operator:this.actualPredicate[e.field]&&"Menu"===a?this.actualPredicate[e.field][0].operator:"equal",parentTotalDataCount:s.getDataModule().isRemote()&&s.allowPaging?s.pagerModule.pagerObj.totalRecordsCount:s.getDataModule().isRemote()?s.totalDataRecordsCount:s.getFilteredRecords().length,parentCurrentViewDataCount:s.currentViewData.length,parentFilteredLocalRecords:s.getDataModule().isRemote()?[]:s.getFilteredRecords()}},n.prototype.removeFilteredColsByField=function(e,i){var n,r=this.filterSettings.columns;if(J(this.parent)){var s={instance:this,handler:this.removeFilteredColsByField,arg1:e,arg2:i};return void this.parent.notify(bi,s)}var o=r.map(function(e){return e.uid}),a=o.filter(function(e,t){return o.indexOf(e)===t});if(!t.isNullOrUndefined(this.column)){var l=this.column.isForeignColumn()?this.parent.getColumnByUid(this.column.uid):this.parent.getColumnByField(e);this.filterObjIndex=this.getFilteredColsIndexByField(l),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex]}for(var d=this,h=0,p=a.length;h<p&&"break"!==function(t,s){r[parseInt(t.toString(),10)].uid=r[parseInt(t.toString(),10)].uid||d.parent.getColumnByField(r[parseInt(t.toString(),10)].field).uid;var o=r.length,l=d.parent.grabColumnByUidFromAllCols(a[parseInt(t.toString(),10)]);if(l.field===e||l.field===l.foreignKeyValue&&l.isForeignColumn()){var h=d.filterSettings.columns.filter(function(e){return e.uid===l.uid})[0];if("FilterBar"===d.filterSettings.type&&!i){var p="[id='"+l.field+"_filterBarcell']";(n=d.parent.getHeaderContent().querySelector(p))&&(n.value="",delete d.values[""+e])}for(;o--;)r[parseInt(o.toString(),10)].uid===l.uid&&r.splice(o,1);var c=d.parent.getColumnHeaderByField(l.field);if("FilterBar"!==d.filterSettings.type||d.parent.showColumnMenu){var u=d.parent.showColumnMenu&&l.showColumnMenu?".e-columnmenu":".e-icon-filter";c.querySelector(u).classList.remove("e-filtered")}return d.isRemove=!0,d.actualPredicate[""+e]&&delete d.actualPredicate[""+e],d.values[""+e]&&delete d.values[""+e],d.refresh&&d.parent.notify(ni,{requestType:"filtering",type:qt,currentFilterObject:h,currentFilterColumn:l,action:"clearFilter"}),"break"}}(h);h++);this.updateFilterMsg(),this.parent.renderModule.resetPartialRecords()},n.prototype.getModuleName=function(){return"filter"},n.prototype.keyUpHandlerImmediate=function(e){13!==e.keyCode&&this.keyUpHandler(e)},n.prototype.keyUpHandler=function(e){var i=this.parent,n=e.target;if(n&&t.matches(n,".e-filterbar input")){var r=t.closest(n,"th.e-filterbarcell");if(this.column=i.getColumnByUid(r.getAttribute("data-mappinguid")),!this.column)return;if("altDownArrow"===e.action&&this.parent.filterSettings.showFilterBarOperator){var s=t.closest(n,"span").querySelector(".e-filterbaroperator");s.ej2_instances[0].showPopup(),s.focus()}"Immediate"!==this.filterSettings.mode&&(13!==e.keyCode||e.target.classList.contains("e-filterbaroperator"))||9===e.keyCode||this.column.filterTemplate||(this.value=n.value.trim(),this.processFilter(e))}if("altDownArrow"===e.action&&"FilterBar"!==this.filterSettings.type&&!F(e.target,"e-toolbar")&&t.isNullOrUndefined(this.parent.element.querySelector(".e-filter-popup"))&&!this.parent.enableAdaptiveUI){var o=i.focusModule.currentInfo.element;if(o&&o.classList.contains("e-headercell")&&!o.classList.contains("e-stackedheadercell")){var a=i.getColumnByUid(o.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));this.openMenuByField(a.field),this.parent.focusModule.clearIndicator()}}"escape"===e.action&&"Menu"===this.filterSettings.type&&this.filterModule&&(this.parent.showColumnMenu&&this.filterModule.isDialogOpen&&(this.parent.isColumnMenuFilterClosing=!0),this.filterModule.closeDialog(),i.notify("restore-Focus",{}),this.parent.showColumnMenu||i.notify("restore-Focus",{}))},n.prototype.updateCrossIcon=function(e){e.value.length&&e.nextElementSibling.classList.remove("e-hide")},n.prototype.updateFilterMsg=function(){if("FilterBar"===this.filterSettings.type){var e=this.parent,i=void 0,n=this.filterSettings.columns,r=void 0;if(!this.filterSettings.showFilterBarStatus)return;if(n.length>0&&this.filterStatusMsg!==this.l10n.getConstant("InvalidFilterMessage")){this.filterStatusMsg="";for(var s=0;s<n.length;s++)if(r=e.grabColumnByUidFromAllCols(n[parseInt(s.toString(),10)].uid)||e.grabColumnByFieldFromAllCols(n[parseInt(s.toString(),10)].field,n[parseInt(s.toString(),10)].isForeignKey),s&&(this.filterStatusMsg+=" && "),t.isNullOrUndefined(r.format))this.filterStatusMsg+=r.headerText+": "+this.values[r.field];else{var o="date"===r.type||"datetime"===r.type||"dateonly"===r.type?this.valueFormatter.fromView(this.values[r.field],r.getParser(),"dateonly"===r.type?"date":r.type):this.values[r.field];i="date"!==r.type&&"datetime"!==r.type&&"dateonly"!==r.type?this.serviceLocator.getService("valueFormatter").toView(o,r.getParser()).toString():this.setFormatForFlColumn(o,r),this.filterStatusMsg+=r.headerText+": "+i}}e.allowPaging&&(e.updateExternalMessage(this.filterStatusMsg),"100%"===this.parent.height&&this.parent.scrollModule.refresh()),this.filterStatusMsg=""}},n.prototype.setFormatForFlColumn=function(e,i){var n=this.serviceLocator.getService("valueFormatter").toView(e,i.getFormatter());return t.isNullOrUndefined(n)?n:n.toString()},n.prototype.checkForSkipInput=function(e,t){var n;if("number"===e.type)(i.DataUtil.operatorSymbols[""+t]||this.skipNumberInput.indexOf(t)>-1)&&(n=!0);else if("string"===e.type)for(var r=0,s=t;r<s.length;r++){var o=s[r];this.skipStringInput.indexOf(o)>-1&&(n=!0)}return n},n.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},n.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick()},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},n.prototype.stopTimer=function(){window.clearInterval(this.timer)},n.prototype.onTimerTick=function(){var e="[id='"+this.column.field+"_filterBarcell']",i=this.element.querySelector(e);i||(i=this.parent.getHeaderContent().querySelector(e));var n;if(this.cellText[this.column.field]=i.value,this.stopTimer(),t.isNullOrUndefined(this.column.filterBarTemplate))n=JSON.parse(JSON.stringify(i.value));else{var r=this.column.filterBarTemplate.read;"string"==typeof r&&(r=t.getValue(r,window)),t.isNullOrUndefined(r)||(this.value=r.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.column.isForeignColumn()),this.filterByMethod=!0,i.value=n,this.updateFilterMsg()},n.prototype.validateFilterValue=function(e){var i,n;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 r=0;r<e.length;r++)if(i.indexOf(e[parseInt(r.toString(),10)])>-1){n=r;break}this.getOperator(e.substring(n)),0!==n&&(this.value=e.substring(0,n)),""!==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,this.column.filter.operator?this.operator=this.column.filter.operator:-1!==e.indexOf("*")||-1!==e.indexOf("?")||-1!==e.indexOf("%3f")?this.operator=this.filterOperators.wildCard:-1!==e.indexOf("%")?this.operator=this.filterOperators.like: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}},n.prototype.getOperator=function(e){var n=e.charAt(0),r=e.slice(0,2),s=t.extend({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},i.DataUtil.operatorSymbols);(s.hasOwnProperty(n)||s.hasOwnProperty(r))&&(this.operator=s[""+n],this.value=e.substring(1),this.operator||(this.operator=s[""+r],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))},n.prototype.columnPositionChanged=function(){this.parent.filterSettings.type},n.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")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}];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:"isempty",text:this.l10n.getConstant("IsEmpty")},{value:"doesnotstartwith",text:this.l10n.getConstant("NotStartsWith")},{value:"doesnotendwith",text:this.l10n.getConstant("NotEndsWith")},{value:"doesnotcontain",text:this.l10n.getConstant("NotContains")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnotempty",text:this.l10n.getConstant("IsNotEmpty")},{value:"like",text:this.l10n.getConstant("Like")}],numberOperator:e,dateOperator:[{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")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],datetimeOperator:[{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")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],dateonlyOperator:[{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")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],booleanOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}]},"Menu"===this.filterSettings.type&&(this.customOperators.stringOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}),this.customOperators.booleanOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}),this.customOperators.numberOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}))},n.prototype.openMenuByField=function(e){var t=this.parent;if(t.enableAdaptiveUI)return void this.showCustomFilter(!1);var i=t.getColumnByField(e),n=t.getColumnHeaderByField(e).querySelector(".e-filtermenudiv");if(n){var r=t.element.getBoundingClientRect(),s=n.getBoundingClientRect();this.filterDialogOpen(i,n,s.right-r.left,s.bottom-r.top)}},n.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(F(t,"e-headercell").querySelector(".e-headercelldiv").getAttribute("data-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)}},n.prototype.clickHandler=function(e){if("FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator){if(F(e.target,"e-filterbarcell")&&e.target.classList.contains("e-input-group-icon")){var i=t.closest(e.target,"div").querySelector(".e-filterbaroperator");i?i.focus():e.target.focus()}if(e.target.classList.contains("e-list-item")){var n=document.querySelector(".e-popup-open").getAttribute("id").replace("_popup","");-1!==n.indexOf("grid-column")&&t.closest(document.getElementById(n),"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){var r=e.target,s=r.classList.contains("e-day"),o=F(this.parent.element,"e-dialog"),a=!1,l=F(r,"e-popup"),d=document.getElementById(this.parent.element.id+"_e-popup"),h=this.parent.element.classList.contains("e-device")?document.querySelector(".e-filter-popup"):d&&d.querySelector(".e-filter-popup")?d.querySelector(".e-filter-popup"):this.parent.element.querySelector(".e-filter-popup");if(o&&l&&(a=o.id===l.id),this.filterModule&&h&&(F(r,"e-excel-ascending")||F(r,"e-excel-descending"))&&this.filterModule.closeDialog(r),F(r,"e-filter-popup")||r.classList.contains("e-filtermenudiv"))return;!this.filterModule||F(r,"e-date-overflow")||F(r,"e-popup-wrapper")||t.closest(r,".e-filter-item.e-menu-item")||s||F(r,"e-search-wrapper")&&!h||(a&&!F(r,"e-filter-popup")&&!F(r,"e-popup-flmenu")||!l&&h)&&(this.filterModule.isresetFocus=F(r,"e-grid")&&F(r,"e-grid").id===this.parent.element.id&&!(F(r,"e-search-wrapper")&&h),this.filterModule.closeDialog(r))}},n.prototype.filterHandler=function(e){this.actualPredicate[e.field]=e.actualPredicate,this.actualData=Object.keys(this.actualPredicate);var t=new i.DataManager(this.filterSettings.columns),n=(new i.Query).where("field",this.filterOperators.equal,e.field);this.checkboxFilterObject=t.dataSource.json,this.checkboxPrevFilterObject=t.executeLocal(n);for(var r=0;r<this.checkboxPrevFilterObject.length;r++){for(var s=-1,o=0;o<this.filterSettings.columns.length;o++)if(this.checkboxPrevFilterObject[parseInt(r.toString(),10)].field===this.filterSettings.columns[parseInt(o.toString(),10)].field){s=o;break}-1!==s&&this.filterSettings.columns.splice(s,1)}this.values[e.field]&&delete this.values[e.field];var a=this.parent.getColumnByField(e.field),l=this.parent.showColumnMenu&&a.showColumnMenu?".e-columnmenu":".e-icon-filter",d=this.parent.getColumnHeaderByField(e.field).querySelector(l);"filtering"===e.action?(this.filterSettings.columns=this.filterSettings.columns.concat(e.filterCollection),this.filterSettings.columns.length&&d&&d.classList.add("e-filtered")):(d&&d.classList.remove("e-filtered"),this.parent.renderModule.resetPartialRecords(),e.requestType="filtering",this.parent.renderModule.refresh(e)),this.parent.dataBind()},n.prototype.updateFilter=function(){var e=this.filterSettings.columns;this.actualPredicate={};for(var t=0;t<e.length;t++){this.column=this.parent.getColumnByField(e[parseInt(t.toString(),10)].field)||pe(e[parseInt(t.toString(),10)].field,this.parent.getForeignKeyColumns());var i=e[parseInt(t.toString(),10)].field;this.parent.getColumnByField(e[parseInt(t.toString(),10)].field)||(i=pe(e[parseInt(t.toString(),10)].field,this.parent.getForeignKeyColumns()).field),this.refreshFilterIcon(i,e[parseInt(t.toString(),10)].operator,e[parseInt(t.toString(),10)].value,e[parseInt(t.toString(),10)].type,e[parseInt(t.toString(),10)].predicate,e[parseInt(t.toString(),10)].matchCase,e[parseInt(t.toString(),10)].ignoreAccent,e[parseInt(t.toString(),10)].uid)}this.parent.renderModule.resetPartialRecords()},n.prototype.refreshFilterIcon=function(e,t,i,n,r,s,o,a){var l={field:e,predicate:r,matchCase:s,ignoreAccent:o,operator:t,value:i,type:n};this.actualPredicate[""+e]?this.actualPredicate[""+e].push(l):this.actualPredicate[""+e]=[l];var d=a?this.parent.grabColumnByUidFromAllCols(a).field:e;this.addFilteredClass(d)},n.prototype.addFilteredClass=function(e){var t,i=this.parent.getColumnByField(e);this.parent.showColumnMenu&&i.showColumnMenu?t=this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu"):i&&(t=this.parent.getColumnHeaderByField(e).querySelector(".e-icon-filter")),t&&t.classList.add("e-filtered")},n.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},n.prototype.getOperatorName=function(e){return document.getElementById(this.parent.getColumnByField(e).uid).ej2_instances[0].value},n.prototype.renderCheckboxOnFilterMenu=function(){return this.filterModule.renderCheckBoxMenu()},n}(),xs={root:"e-rhandler",suppress:"e-rsuppress",icon:"e-ricon",helper:"e-rhelper",header:"th.e-headercell",cursor:"e-rcursor"},Rs=function(){function i(e){this.tapped=!1,this.isDblClk=!0,this.resizeProcess=!1,this.isCancelAutoFit=!1,this.parent=e,this.parent.isDestroyed||(this.widthService=new er(e),this.addEventListener())}return i.prototype.autoFitColumns=function(e,i,n){var r=this,s=void 0===e||null===e||e.length<=0?this.parent.getColumns().map(function(e){return e.autoFit=!0,e.field}):"string"==typeof e?[e]:e;this.parent.isAutoFitColumns=!0,t.isNullOrUndefined(e)||"object"!=typeof e||0===e.length?"string"==typeof e&&""!==e.trim()&&(this.parent.getColumnByField(e).autoFit=!0):e.forEach(function(e){r.parent.getColumnByField(e)&&(r.parent.getColumnByField(e).autoFit=!0)}),this.parent.enableAdaptiveUI&&this.parent.element.classList.add("e-grid-autofit"),this.findColumn(s,i,n)},i.prototype.autoFit=function(){var e=0,i=this.parent.getColumns().filter(function(i){return t.isNullOrUndefined(i.maxWidth)||e++,!0===i.autoFit}).map(function(e){return e.field||e.headerText});i.length>0&&!this.parent.preventAutoFit&&this.autoFitColumns(i);var n=this.parent.getContentTable();this.parent.allowResizing&&e&&("Auto"===this.parent.resizeSettings.mode||"Normal"===this.parent.resizeSettings.mode&&!this.parent.autoFit&&0===i.length)?this.widthService.setWidthToTable(-1===n.style.width.indexOf("px")):this.parent.autoFit&&"Auto"===this.parent.resizeSettings.mode&&this.widthService.setWidthToTable(),-1!==n.style.width.indexOf("px")&&n.getBoundingClientRect().width<n.parentElement.clientWidth&&t.addClass([this.parent.getHeaderTable(),n],["e-tableborder"])},i.prototype.getCellElementsByColumnIndex=function(e){return this.parent.frozenRows?[].slice.call(this.parent.getHeaderTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)")).concat([].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)"))):[].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)"))},i.prototype.resizeColumn=function(e,i,n,r,s){var o,a,l=this.parent,d=0,h=l.getHeaderTable(),p=l.getContentTable(),c=Wi,u=0,g=n||this.parent.getUidByColumnField(e),f=this.parent.getNormalizedColumnIndex(g),m=t.closest(h.querySelector('[data-mappinguid="'+g+'"]'),"th").cloneNode(!0),y=this.getCellElementsByColumnIndex(f),v=this.parent.getColumnIndexByField(e);t.isNullOrUndefined(l.getFooterContent())||(o=l.getFooterContentTable()),o&&(a=o.querySelectorAll("td:nth-child("+(f+1)+"):not(.e-groupcaption)"));var S=[].slice.call(h.querySelector("tr").getElementsByClassName("e-grouptopleftcell"));if(S.length>0)for(A=0;A<S.length;A++)u+=S[parseInt(A.toString(),10)].offsetWidth;var C=p.querySelector(".e-detailrowcollapse")||p.querySelector(".e-detailrowexpand");(this.parent.detailTemplate||this.parent.childGrid)&&C&&(u+=C.offsetWidth);var w=[m],b=[],I=[];if(o)for(A=0;A<a.length;A++)I[parseInt(A.toString(),10)]=a[parseInt(A.toString(),10)].cloneNode(!0);for(A=0;A<y.length;A++)b[parseInt(A.toString(),10)]=y[parseInt(A.toString(),10)].cloneNode(!0);var x=this.createTable(h,w,"e-gridheader"),R=null,D=null;l.getCurrentViewRecords().length&&(D=this.createTable(p,b,c,r,s)),I.length&&(R=this.createTable(o,I,"e-gridfooter"));var T=l.getColumns()[parseInt(v.toString(),10)],E=T.width=t.formatUnit(Math.max(x,D,R)),O=T.maxWidth&&parseFloat(T.maxWidth.toString());if(parseInt(E,10)>O&&(T.width=O),this.widthService.setColumnWidth(l.getColumns()[parseInt(v.toString(),10)]),!1===l.getColumns().some(function(e){return(e.visible||l.groupSettings.columns.length)&&(null===e.width||void 0===e.width||e.width.length<=0)}))for(var k=l.getColumns(),A=0;A<k.length;A++)k[parseInt(A.toString(),10)].visible&&(d+=parseFloat(k[parseInt(A.toString(),10)].width));var F=d+u;d>0&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new Pt({width:"30px"})),"Auto"===this.parent.resizeSettings.mode&&(F="100%"),h.style.width=t.formatUnit(F),p.style.width=t.formatUnit(F),t.isNullOrUndefined(o)||(o.style.width=t.formatUnit(F))),l.isFrozenGrid()&&l.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar();var M=h.offsetWidth;p.parentElement.scrollWidth>M?(t.isNullOrUndefined(p.querySelector(".e-emptyrow"))?t.addClass([h,p],["e-tableborder"]):(t.addClass([h],["e-tableborder"]),t.removeClass([p],["e-tableborder"])),t.removeClass([l.element],["e-left-shadow","e-right-shadow"])):(t.removeClass([h,p],["e-tableborder"]),l.getVisibleFrozenRightCount()&&t.addClass([l.element],"e-right-shadow")),t.isNullOrUndefined(o)||o.classList.add("e-tableborder")},i.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Ki)||e.querySelector("."+Wi))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},i.prototype.getModuleName=function(){return"resize"},i.prototype.findColumn=function(e,i,n){for(var r=0;r<e.length;r++){var s=e[parseInt(r.toString(),10)],o=this.parent.getColumnIndexByField(s),a=this.parent.getColumns()[parseInt(o.toString(),10)];o>-1&&!t.isNullOrUndefined(a)&&!0===a.visible&&this.resizeColumn(s,o,null,i,n)}(this.parent.detailTemplate||this.parent.childGrid)&&"Auto"===this.parent.resizeSettings.mode&&this.parent.isAutoFitColumns&&(this.parent.getHeaderTable().querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.parent.recalcIndentWidth()),this.parent.allowTextWrap&&this.parent.notify(Ri,{case:"refreshHeight",isModeChg:!0}),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0)},i.prototype.createTable=function(e,i,n,r,s){void 0===r&&(r=1),void 0===s&&(s=i.length),r>s&&(r^=s,r^=s^=r);var o=this.parent.createElement("div"),a=this.parent.enableAdaptiveUI?" e-bigger":"";o.className=this.parent.element.className+a,o.style.cssText="display: inline-block;visibility:hidden;position:absolute";var l=this.parent.createElement("div");l.className=n;var d=this.parent.createElement("table",{attrs:{role:"grid"}});d.className=e.className,d.classList.add("e-resizetable"),d.style.cssText="table-layout: auto;width: auto";var h;"e-gridheader"===n&&(h=this.parent.createElement("thead"),d.appendChild(h));for(var p=this.parent.createElement("tr"),c=r<=0?1:r;c<=(s>i.length?i.length:s);c++){var u=p.cloneNode();u.className=e.querySelector("tr").className,u.appendChild(i[parseInt((c-1).toString(),10)]),t.isNullOrUndefined(h)?d.appendChild(u):h.appendChild(u)}l.appendChild(d),o.appendChild(l),document.body.appendChild(o);var g=d.getBoundingClientRect().width;return document.body.removeChild(o),Math.ceil(g)},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(si,this.refreshHeight,this),this.parent.on("refresh-Resize-Position",this.refreshResizePosition,this),this.parent.on(Jt,this.wireEvents,this),this.parent.on($t,this.autoFit,this),this.parent.on(Li,this.refreshHeight,this),this.parent.on(pi,this.destroy,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(si,this.refreshHeight),this.parent.off("refresh-Resize-Position",this.refreshResizePosition),this.parent.off(Jt,this.wireEvents),this.parent.off(Li,this.refreshHeight),this.parent.off(pi,this.destroy))},i.prototype.render=function(){this.unwireEvents(),this.wireEvents(),this.setHandlerHeight()},i.prototype.refreshHeight=function(){if(this.parent.getHeaderTable()){for(var e=this.getResizeHandlers(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].parentElement.offsetHeight>0&&(e[parseInt(t.toString(),10)].style.height="100%");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[].slice.call(this.parent.getHeaderTable().getElementsByClassName(xs.root))},i.prototype.setHandlerHeight=function(){for(var e=[].slice.call(this.parent.getHeaderTable().getElementsByClassName(xs.suppress)),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.height="100%"},i.prototype.callAutoFit=function(e){if(t.Browser.isDevice&&"function"==typeof e.preventDefault&&this.isDblClk&&e.preventDefault(),e.target.classList.contains("e-rhandler")&&!this.isCancelAutoFit){var i=this.getTargetColumn(e);if(i.columns)return;if(this.resizeColumn(i.field,this.parent.getNormalizedColumnIndex(i.uid),i.uid),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0),this.isDblClk&&"mousedown"===e.type){var n={e:e,column:i};this.parent.trigger("resizeStop",n)}t.closest(e.target,xs.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,n=this.parent.getContentTable().style.width,r=!1;if(-1!==n.indexOf("%")&&parseFloat(n)>100&&(r=!0),e.target.classList.contains("e-rhandler")){this.isCancelAutoFit=!1;var s={e:e,column:this.getTargetColumn(e)};if(this.parent.trigger("resizeStart",s,function(e){if(e.cancel||i.parent.isEdit)return i.cancelResizeAction(),void(i.isCancelAutoFit=!0)}),!this.isCancelAutoFit){if(!this.helper){if(0===this.getScrollBarWidth()||r){this.resizeProcess=!0;for(var o=0,a=this.refreshColumnWidth();o<a.length;o++){var l=a[o];this.widthService.setColumnWidth(l)}if(this.parent.allowGrouping)for(var d=0;d<this.parent.groupSettings.columns.length;d++)this.widthService.setColumnWidth(new Pt({width:"30px"}),d);this.parent.isRowDragable()&&this.widthService.setColumnWidth(new Pt({width:"30px"})),this.widthService.setWidthToTable(),this.resizeProcess=!1}this.refreshStackedColumnWidth(),this.element=e.target,this.parentElementWidth=this.parent.element.getBoundingClientRect().width,this.appendHelper(),this.column=this.getTargetColumn(e),this.pageX=this.getPointX(e),this.column.getFreezeTableName()===rn?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}t.EventHandler.add(document,t.Browser.touchEndEvent,this.resizeEnd,this),t.EventHandler.add(this.parent.element,t.Browser.touchMoveEvent,this.resizing,this),t.Browser.isDevice&&!this.helper.classList.contains(xs.icon)?(this.helper.classList.add(xs.icon),t.EventHandler.add(document,t.Browser.touchStartEvent,this.removeHelper,this),t.EventHandler.add(this.helper,t.Browser.touchStartEvent,this.resizeStart,this)):this.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.isNullOrUndefined(this.helper)&&(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart)),t.isNullOrUndefined(this.helper)||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().getElementsByClassName("e-rhandler")),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].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.refreshResizeFixedCols=function(e){for(var t=this.parent.getColumns(),i=this.parent.enableColumnVirtualization?this.parent.translateX:0,n=[].slice.call(this.parent.getHeaderContent().querySelector("tbody").querySelectorAll(".e-fixedfreeze")).concat([].slice.call(this.parent.getContent().querySelectorAll(".e-fixedfreeze"))),r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)],o=void 0;if(s.classList.contains("e-summarycell")){var a=s.getAttribute("data-mappinguid");o=this.parent.getColumnByUid(a)}else{var l=parseInt(s.getAttribute("aria-colindex"),10)-1;o=t[parseInt(l.toString(),10)]}var d=0;if("Left"===e){this.parent.getVisibleFrozenLeftCount()?d=30*this.parent.getIndentCount():"Right"===this.parent.getFrozenMode()&&(d=30*this.parent.groupSettings.columns.length);for(h=0;h<t.length;h++)if(o.index>t[parseInt(h.toString(),10)].index){if(o.uid===t[parseInt(h.toString(),10)].uid)break;("Left"===t[parseInt(h.toString(),10)].freeze||t[parseInt(h.toString(),10)].isFrozen||"Fixed"===t[parseInt(h.toString(),10)].freeze)&&t[parseInt(h.toString(),10)].visible&&(d+=parseFloat(t[parseInt(h.toString(),10)].width.toString()))}Ye(s,(0===d?d:d-1)-i,this.parent.enableRtl,"Left")}if("Right"===e){d="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0;for(var h=t.length-1;h>=0&&o.uid!==t[parseInt(h.toString(),10)].uid;h--)"Right"!==t[parseInt(h.toString(),10)].freeze&&"Fixed"!==t[parseInt(h.toString(),10)].freeze||t[parseInt(h.toString(),10)].visible&&(d+=parseFloat(t[parseInt(h.toString(),10)].width.toString()));var p=0;s.colSpan>1&&(p=this.calculateColspanWidth(t,s,o.index)),Ye(s,d-p+i,this.parent.enableRtl,"Right")}}},i.prototype.calculateColspanWidth=function(e,t,i){for(var n=0,r=i+1;r<i+t.colSpan;r++)n+=parseInt(e[parseInt(r.toString(),10)].width.toString(),10);return n},i.prototype.refreshResizePosition=function(){this.refreshResizefrzCols(!0)},i.prototype.refreshResizefrzCols=function(e,t){var i=this,n=this.parent.enableColumnVirtualization?this.parent.translateX:0;if(e||"Left"===this.column.freeze||this.column.isFrozen||this.column.columns&&"Left"===Qe(this.column)){var r=30*this.parent.getIndentCount(),s=this.parent.getColumns().filter(function(e){return"Left"===e.freeze||e.isFrozen});e&&!t||this.frzHdrRefresh("Left");for(h=0;h<s.length;h++){if(e||s[parseInt(h.toString(),10)].index>this.column.index){(this.parent.frozenRows?[].slice.call(this.parent.getHeaderContent().querySelectorAll('td[aria-colindex="'+(h+1)+'"]')).concat([].slice.call(this.parent.getContent().querySelectorAll('td[aria-colindex="'+(h+1)+'"]'))):[].slice.call(this.parent.getContent().querySelectorAll('td[aria-colindex="'+(h+1)+'"]'))).filter(function(e){Ye(e,r-n,i.parent.enableRtl,"Left")}),this.parent.enableColumnVirtualization&&(s[parseInt(h.toString(),10)].valueX=r)}s[parseInt(h.toString(),10)].visible&&(r+=parseFloat(s[parseInt(h.toString(),10)].width.toString()))}this.refreshResizeFixedCols("Left")}if(e||"Right"===this.column.freeze||this.column.columns&&"Right"===Qe(this.column)){var o="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,a=this.parent.getColumns();e&&!t||this.frzHdrRefresh("Right");for(var l=a.filter(function(e){return"Right"===e.freeze}),d=this,h=a.length-1;h>=a.length-l.length;h--)!function(e){(d.parent.frozenRows?[].slice.call(d.parent.getHeaderContent().querySelectorAll('td[aria-colindex="'+(e+1)+'"]')).concat([].slice.call(d.parent.getContent().querySelectorAll('td[aria-colindex="'+(e+1)+'"]'))):[].slice.call(d.parent.getContent().querySelectorAll('td[aria-colindex="'+(e+1)+'"]'))).filter(function(t){var r=0;t.colSpan>1&&(r=i.calculateColspanWidth(a,t,a[parseInt(e.toString(),10)].index)),Ye(t,o-r+n,i.parent.enableRtl,"Right")}),d.parent.enableColumnVirtualization&&(a[parseInt(e.toString(),10)].valueX=o),a[parseInt(e.toString(),10)].visible&&(o+=parseFloat(a[parseInt(e.toString(),10)].width.toString()))}(h);this.refreshResizeFixedCols("Right")}this.column&&("Fixed"===this.column.freeze||this.column.columns&&"Fixed"===Qe(this.column))&&(this.refreshResizeFixedCols("Left"),this.refreshResizeFixedCols("Right"),this.frzHdrRefresh("Left"),this.frzHdrRefresh("Right")),this.parent.groupSettings.columns.length&&this.parent.aggregates.length&&this.parent.getContent().querySelector(".e-groupcaptionrow")&&this.refreshGroupCaptionRow()},i.prototype.refreshGroupCaptionRow=function(){for(var e=[].slice.call(this.parent.getContent().querySelectorAll(".e-groupcaptionrow")),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.querySelector(".e-summarycell")&&Ee(i,this.parent)}},i.prototype.frzHdrRefresh=function(e){var t=this,i=this.parent.enableColumnVirtualization?this.parent.translateX:0;if("Left"===e)for(var n=[].slice.call(this.parent.getHeaderContent().querySelector("thead").querySelectorAll("tr")),r=0;r<n.length;r++)for(var s=[].slice.call(n[parseInt(r.toString(),10)].querySelectorAll(".e-leftfreeze,.e-fixedfreeze")),o=this,a=0;a<s.length;a++)!function(e){var n=s[parseInt(e.toString(),10)];if(n.classList.contains("e-rowdragheader")||n.classList.contains("e-dragheadercell")||n.classList.contains("e-grouptopleftcell"))return"continue";var r=o.getParticularCol(n),a=o.parent.getColumns(),l=0,d=[];if(o.parent.aggregates.length&&o.parent.getFooterContent()&&(o.parent.getContent().querySelectorAll(".e-summaryrow").length&&[].slice.call(o.parent.getContent().querySelectorAll(".e-summaryrow")).filter(function(e){d.push(e.querySelector('[data-mappinguid="'+r.uid+'"]'))}),d=d.concat([].slice.call(o.parent.getFooterContent().querySelectorAll('[data-mappinguid="'+r.uid+'"]')))),n.classList.contains("e-fixedfreeze")){o.parent.getVisibleFrozenLeftCount()?l=30*o.parent.getIndentCount():"Right"===o.parent.getFrozenMode()&&(l=30*o.parent.groupSettings.columns.length);for(var h=0;h<a.length;h++)if(r.index>a[parseInt(h.toString(),10)].index){if(r.uid===a[parseInt(h.toString(),10)].uid)break;("Left"===a[parseInt(h.toString(),10)].freeze||a[parseInt(h.toString(),10)].isFrozen||"Fixed"===a[parseInt(h.toString(),10)].freeze)&&a[parseInt(h.toString(),10)].visible&&(l+=parseInt(a[parseInt(h.toString(),10)].width.toString(),10))}d&&d.length&&d.filter(function(e){Ye(e,l-i,t.parent.enableRtl,"Left")}),Ye(n,(0===l?l:l-1)-i,o.parent.enableRtl,"Left")}else{if(l=30*o.parent.getIndentCount(),0===r.index)d&&d.length&&d.filter(function(e){Ye(e,l-i,t.parent.enableRtl,"Left")}),Ye(n,l-i,o.parent.enableRtl,"Left"),o.parent.enableColumnVirtualization&&(r.valueX=l);else{for(var p=0;p<a.length&&!(r.index<a[parseInt(p.toString(),10)].index||r.uid===a[parseInt(p.toString(),10)].uid);p++)a[parseInt(p.toString(),10)].visible&&(l+=parseInt(a[parseInt(p.toString(),10)].width.toString(),10));d&&d.length&&d.filter(function(e){Ye(e,l-i,t.parent.enableRtl,"Left")}),Ye(n,l-i,o.parent.enableRtl,"Left"),o.parent.enableColumnVirtualization&&(r.valueX=l)}$e(o.parent,r,n)}}(a);if("Right"===e)for(var n=[].slice.call(this.parent.getHeaderContent().querySelector("thead").querySelectorAll("tr")),r=0;r<n.length;r++)for(var l=this,a=(s=[].slice.call(n[parseInt(r.toString(),10)].querySelectorAll(".e-rightfreeze, .e-fixedfreeze"))).length-1;a>=0;a--)!function(e){var n=s[parseInt(e.toString(),10)],r=l.getParticularCol(n),o=l.parent.getColumns(),a=0,d=[];if(l.parent.aggregates.length&&l.parent.getFooterContent()&&(l.parent.getContent().querySelectorAll(".e-summaryrow").length&&[].slice.call(l.parent.getContent().querySelectorAll(".e-summaryrow")).filter(function(e){d.push(e.querySelector('[data-mappinguid="'+r.uid+'"]'))}),d=d.concat([].slice.call(l.parent.getFooterContent().querySelectorAll('[data-mappinguid="'+r.uid+'"]')))),n.classList.contains("e-fixedfreeze")){a="Right"===l.parent.getFrozenMode()&&l.parent.isRowDragable()?30:0;for(var h=o.length-1;h>=0;h--)if(r.index<o[parseInt(h.toString(),10)].index){if(r.columns&&Ke(r,o[parseInt(h.toString(),10)].uid)||r.index>o[parseInt(h.toString(),10)].index)break;"Right"!==o[parseInt(h.toString(),10)].freeze&&"Fixed"!==o[parseInt(h.toString(),10)].freeze||o[parseInt(h.toString(),10)].visible&&(a+=parseFloat(o[parseInt(h.toString(),10)].width.toString()))}d.length&&d.filter(function(e){Ye(e,a+i,t.parent.enableRtl,"Right")}),Ye(n,a+i,l.parent.enableRtl,"Right")}else{a="Right"===l.parent.getFrozenMode()&&l.parent.isRowDragable()?30:0;for(var p=o.length-1;p>=0&&!(r.columns&&Ke(r,o[parseInt(p.toString(),10)].uid)||r.index>o[parseInt(p.toString(),10)].index||r.uid===o[parseInt(p.toString(),10)].uid);p--)o[parseInt(p.toString(),10)].visible&&(a+=parseInt(o[parseInt(p.toString(),10)].width.toString(),10));d.length&&d.filter(function(e){Ye(e,a+i,t.parent.enableRtl,"Right")}),Ye(n,a+i,l.parent.enableRtl,"Right"),l.parent.enableColumnVirtualization&&(r.valueX=a)}}(a)},i.prototype.getParticularCol=function(e){var t=e.classList.contains("e-filterbarcell")?e.getAttribute("data-mappinguid"):e.querySelector("[data-mappinguid]").getAttribute("data-mappinguid");return this.parent.getColumnByUid(t)},i.prototype.resizing=function(e){var i=this;if(t.Browser.isDevice&&"function"==typeof e.preventDefault&&e.preventDefault(),!t.isNullOrUndefined(this.column)){var n=0;t.isNullOrUndefined(this.column)&&(n=F(this.element,"th").offsetWidth),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.setHelperHeight());var r=this.getPointX(e),s=this.parent.enableRtl?-(r-this.pageX):r-this.pageX,o=parseFloat(this.column.width.toString()),a=this.getColData(this.column,s);a.width||(a.width=t.closest(this.element,"th").offsetWidth);var l=this.getWidth(a.width,a.minWidth,a.maxWidth);if(this.parent.log("resize_min_max",{column:this.column,width:l}),(!this.parent.enableRtl&&this.minMove>=r||this.parent.enableRtl&&this.minMove<=r)&&(l=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=r=this.minMove),l!==parseFloat(t.isNullOrUndefined(this.column.width)||"auto"===this.column.width?n.toString():this.column.width.toString())){this.pageX=r,this.column.width=t.formatUnit(l);var d={e:e,column:this.column};if(this.parent.trigger("resizing",d),d.cancel)return void this.cancelResizeAction(!0);var h=[this.column],p=[this.column];this.column.columns&&(h=this.getSubColumns(this.column,[]),h=this.calulateColumnsWidth(h,!1,s),p=this.calulateColumnsWidth(h,!0,s));var c=0,u=this.parent.getColumns().filter(function(e){return e.visible&&(c+=parseInt(e.width.toString(),10)),e.visible&&(e.maxWidth||e.minWidth)});if("Auto"===this.parent.resizeSettings.mode&&u.length&&c<this.parentElementWidth){var g=this.parent.getColumns().filter(function(e){return e.visible&&e.uid!==i.column.uid}),f=this.distributeColWidth(g,s,0);Math.round(f.usedWidth)!==Math.abs(s)&&(p[0].width=o+f.usedWidth*Math.sign(s)),p=p.concat(f.columns)}this.resizeProcess=!0;for(var m=0,y=p;m<y.length;m++){var v=y[m];this.widthService.setColumnWidth(v,null,"resize")}this.resizeProcess=!1,this.updateHelper()}this.parent.isFrozenGrid()&&this.refreshResizefrzCols(),this.isDblClk=!1}},i.prototype.distributeColWidth=function(e,t,i){for(var n=t/e.length,r=Math.abs(n),s=[],o=[],a=0,l=0,d=e;l<d.length;l++){var h=d[l],p=parseFloat(h.width.toString())-n;if(h.minWidth&&p<parseInt(h.minWidth.toString(),10))a+=c=parseFloat((parseInt(h.minWidth.toString(),10)-p).toFixed(3)),i+=r-c,h.width=h.minWidth,s.push(h);else if(h.maxWidth&&p>parseInt(h.maxWidth.toString(),10)){var c=parseFloat((p-parseInt(h.maxWidth.toString(),10)).toFixed(3));a+=c,i+=r-c,h.width=h.maxWidth,s.push(h)}else i+=r,h.width=p,o.push(h)}var u=a&&o.length?this.distributeColWidth(o,a*Math.sign(t),i):{columns:o,usedWidth:i};return{columns:s.concat(u.columns),usedWidth:u.usedWidth}},i.prototype.calulateColumnsWidth=function(e,i,n){for(var r=[],s=0,o=e;s<o.length;s++){for(var a=o[s],l=0,d=0;d<e.length;d++)l+=parseFloat(e[parseInt(d.toString(),10)].width.toString());var h=this.getColData(a,parseFloat(a.width)*n/l),p=this.getWidth(h.width,h.minWidth,h.maxWidth);p!==parseFloat(a.width.toString())&&(i&&(a.width=t.formatUnit(p<1?1:p)),r.push(a))}return r},i.prototype.getSubColumns=function(e,t){for(var i=0,n=e.columns;i<n.length;i++){var r=n[i];!1!==r.visible&&r.allowResizing&&(r.columns?this.getSubColumns(r,t):t.push(r))}return t},i.prototype.resizeEnd=function(i){if(this.helper&&!this.parent.isDestroyed){var n=this.parent;n.isFrozenGrid()&&this.refreshResizePosition(),t.EventHandler.remove(this.parent.element,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeEnd),t.Browser.isDevice&&(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart)),this.updateCursor("remove"),t.detach(this.helper);var r={e:i,column:this.column},s=this.parent.getContent().querySelector("."+Yi);s.scrollHeight>s.clientHeight&&(this.parent.scrollModule.setPadding(),s.style.overflowY="scroll"),e.Global.timer&&this.isDblClk||(this.parent.trigger("resizeStop",r),t.closest(this.element,".e-headercell").classList.add("e-resized")),this.isFrozenColResized=!1,this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.parent.notify("textWrapRefresh",{case:"textwrap"}));var o,a=n.getHeaderTable(),l=n.getContentTable();t.isNullOrUndefined(n.getFooterContent())||(o=n.getFooterContentTable());var d=a.offsetWidth,h=n.getContent().scrollWidth;h>d?(t.isNullOrUndefined(l.querySelector(".e-emptyrow"))?h>l.scrollWidth&&t.addClass([a,l],["e-tableborder"]):(t.addClass([a],["e-tableborder"]),t.removeClass([l],["e-tableborder"])),t.removeClass([n.element],["e-left-shadow","e-right-shadow"])):(t.removeClass([a,l],["e-tableborder"]),n.getVisibleFrozenRightCount()&&t.addClass([n.element],"e-right-shadow")),t.isNullOrUndefined(o)||o.classList.add("e-tableborder"),this.refresh(),this.doubleTapEvent(i),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:not(.e-hide):not([style*="display: none"])'));t<i.length;t++)for(var n=i[t],r=0,s=e;r<s.length;r++){var o=s[r];if(n.querySelector("[data-mappinguid]")&&n.querySelector("[data-mappinguid]").getAttribute("data-mappinguid")===o.uid&&o.visible){o.width=n.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,n=e.columns;i<n.length;i++){var r=n[i];!1!==r.visible&&(r.columns?t=this.getStackedWidth(r,t):t+=parseFloat(r.width.toString()))}return t},i.prototype.getTargetColumn=function(e){var i=t.closest(e.target,xs.header),n=(i=i.querySelector(".e-headercelldiv")||i.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid");return this.parent.getColumnByUid(n)},i.prototype.updateCursor=function(e){var t=[].slice.call(this.parent.getHeaderContent().querySelectorAll("th"));t.push(this.parent.element);for(var i=0,n=t;i<n.length;i++)n[i].classList[""+e](xs.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:xs.helper}),this.parent.element.appendChild(this.helper),this.setHelperHeight()},i.prototype.resizeHelperHeight=function(e){for(var t=this.parent.getContent().offsetHeight-this.getScrollBarWidth(),i=[].slice.call(this.parent.getHeaderContent().querySelectorAll("tr")),n=i.indexOf(e.parentElement);n<i.length&&n>-1;n++)t+=i[parseInt(n.toString(),10)].offsetHeight;return t},i.prototype.setHelperHeight=function(){var e=t.closest(this.element,xs.header),i=this.resizeHelperHeight(e),n=this.calcPos(e),r=e.getBoundingClientRect();n.left=(n.left<=1?0:n.left)+(this.parent.enableRtl?0:Number(r.width.toFixed(1)))-1,this.helper.style.cssText="height: "+i+"px; top: "+n.top+"px; left:"+Math.floor(n.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(xs.root)||i.contains(xs.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,xs.header),n=this.calcPos(i),r=i.getBoundingClientRect();(e=Math.floor(Number((n.left<=1?0:n.left).toFixed(1))+(this.parent.enableRtl?0:Number(r.width.toFixed(1)))-1))>this.parentElementWidth&&(e=this.parentElementWidth-2),this.helper.style.height=this.resizeHelperHeight(i)+"px",this.helper.style.left=e+"px"},i.prototype.calcPos=function(e){for(var t={top:0,left:0},i=e.getBoundingClientRect(),n=e.ownerDocument,r=F(e,"e-grid")||n.documentElement;r&&(r===n.body||r===n.documentElement)&&"static"===r.style.position;)r=r.parentNode;return r&&r!==e&&1===r.nodeType&&(t=r.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}(),Ds=function(){function e(e){this.idx=0,this.parent=e,this.parent.isDestroyed||(this.parent.on(yi,this.headerDrop,this),this.parent.on(ei,this.enableAfterRender,this),this.parent.on(oi,this.onActionComplete,this),this.parent.on(Gt,this.drag,this),this.parent.on(Vt,this.dragStart,this),this.parent.on(mi,this.dragStop,this),this.parent.on(yi,this.headerDrop,this),this.parent.on(si,this.createReorderElement,this),this.parent.on(di,this.keyPressHandler,this),this.parent.on(pi,this.destroy,this))}return e.prototype.chkDropPosition=function(e,i){var n=i.querySelector(".e-headercelldiv")||i.querySelector(".e-stackedheadercelldiv"),r=n||i.firstElementChild,s=this.parent.getColumnByUid(r.getAttribute("data-mappinguid")),o=!s||!s.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&&o},e.prototype.chkDropAllCols=function(e,t){for(var i,n=this.getHeaderCells();!i&&n.length>0;)i=e!==n.pop()&&this.targetParentContainerIndex(e,t)>-1;return i},e.prototype.findColParent=function(e,t,i){i=i;for(var n=0,r=t.length;n<r;n++){if(e===t[parseInt(n.toString(),10)])return!0;if(t[parseInt(n.toString(),10)].columns){var s=i.length;if(i.push(t[parseInt(n.toString(),10)]),this.findColParent(e,t[parseInt(n.toString(),10)].columns,i))return!0;i.splice(s,i.length-s)}}return!1},e.prototype.getColumnsModel=function(e,i){for(var n=[],r=[],s=0,o=e.length;s<o;s++)t.isNullOrUndefined(e[parseInt(s.toString(),10)])||(e[parseInt(s.toString(),10)].visible?n.push(e[parseInt(s.toString(),10)]):i&&n.push(e[parseInt(s.toString(),10)]),e[parseInt(s.toString(),10)].columns&&(r=r.concat(e[parseInt(s.toString(),10)].columns)));return r.length&&(n=n.concat(this.getColumnsModel(r))),n},e.prototype.headerDrop=function(e){var i=this.parent,n=(this.element.querySelector(".e-headercelldiv")||this.element.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid"),r=i.getColumnByUid(n);if(!t.closest(e.target,"th")||!t.isNullOrUndefined(r)&&(!r.allowReordering||r.lockColumn))return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:r});var s=t.closest(e.target,".e-headercell"),o=(s.querySelector(".e-headercelldiv")||s.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid");if(!t.isNullOrUndefined(o)){var a=i.getColumnByUid(o);if(t.isNullOrUndefined(a)||!a.allowReordering||a.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:r,destColumn:a})}if(s&&this.chkDropPosition(this.element,s)&&this.chkDropAllCols(this.element,s))if(this.parent.enableColumnVirtualization){var l=this.parent.columns,d=this.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"),h=null,p=this.parent.columns.filter(function(e){return e.uid===d})[0],c=s.querySelector(".e-headercelldiv").getAttribute("data-mappinguid");l.some(function(e,t){return e.uid===c&&(h=t,e.uid===c)}),t.isNullOrUndefined(h)||this.moveColumns(h,p)}else{var u=this.targetParentContainerIndex(this.element,s),g=this.element.querySelector(".e-stackedheadercelldiv"),f=g?g.getAttribute("data-mappinguid"):this.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid");if(this.destElement=s,this.parent.notify("set-reorder-destination-element",{ele:s}),f)this.moveColumns(u,this.parent.getColumnByUid(f));else{var m=this.getHeaderCells(),y=M(this.element,m),l=this.getColumnsModel(this.parent.columns);this.moveColumns(u,l[parseInt(y.toString(),10)])}}},e.prototype.isActionPrevent=function(e){return J(e)},e.prototype.moveColumns=function(e,t,i,n){var r=this.parent;if(this.isActionPrevent(r))return void r.notify(bi,{instance:this,handler:this.moveColumns,arg1:e,arg2:t});var s=this.getColParent(t,this.parent.columns),o=s?s.columns:this.parent.columns,a=L(t,o);if((s||this.parent.lockcolPositionCount)&&!i&&!this.parent.enableColumnVirtualization){for(h=0;h<o.length;h++)if(o[parseInt(h.toString(),10)].field===t.field){a=h;break}var l=this.parent.getColumnByUid(this.destElement.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));if(l){for(h=0;h<o.length;h++)if(o[parseInt(h.toString(),10)].field===l.field){e=h;break}}else for(h=0;h<o.length;h++)o[parseInt(h.toString(),10)].headerText===this.destElement.innerText.trim()&&(e=h)}if(r.allowReordering&&a!==e&&-1!==a&&-1!==e){o.splice(e,0,o.splice(a,1)[0]);var d={column:t,destIndex:e,columns:o,parent:s,cancel:!1};if(r.notify("refresh-frozen-columns",d),!d.cancel){if(this.parent.isFrozenGrid())if(this.parent.frozenColumns)for(var h=0;h<o.length;h++)"Left"===o[parseInt(h.toString(),10)].freeze&&(o[parseInt(h.toString(),10)].freeze=void 0);else s&&s.columns||(this.parent.getFrozenLeftCount()>e?t.freeze="Left":o.length-this.parent.getFrozenRightColumnsCount()<=e?t.freeze="Right":t.freeze="Fixed"===t.freeze?"Fixed":void 0);if(!1!==n){var p={type:qt,requestType:"reorder",fromIndex:e,toIndex:a,toColumnUid:t.uid,cancel:!1};if(r.notify(ni,p),p.cancel)return void o.splice(a,0,o.splice(e,1)[0])}if(r.getColumns(!0),r.preventAutoFit=!0,r.notify(ui,{fromIndex:e,toIndex:a}),this.parent.isFrozenGrid()){var c=this.parent.columns;this.idx=0,this.refreshColumnIndex(c),this.parent.notify("refresh-Frozen-Position",{})}}}},e.prototype.refreshColumnIndex=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].index=this.idx,this.idx++,e[parseInt(t.toString(),10)].columns&&e[parseInt(t.toString(),10)].columns.length&&this.refreshColumnIndex(e[parseInt(t.toString(),10)].columns)},e.prototype.targetParentContainerIndex=function(e,t){var i=this.parent.columns,n=this.getHeaderCells(),r=this.parent.getStackedColumns(i),s=[];r.length&&(s=this.getAllStackedheaderParentColumns(n));var o=r.length&&s.length?this.getColumnsModel(s):this.getColumnsModel(i,!0),a=this.getColParent(o[M(e,n)],i);return i=a?a.columns:i,L(o[M(t,n)],i)},e.prototype.getAllStackedheaderParentColumns=function(e){for(var t=[],i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].classList.contains("e-hide"))e.splice(i,1),i--;else if(e[parseInt(i.toString(),10)].closest("thead").firstChild===e[parseInt(i.toString(),10)].parentElement){var n=e[parseInt(i.toString(),10)];n.querySelector(".e-stackedheadercelldiv")?t.push(this.parent.getColumnByUid(n.querySelector(".e-stackedheadercelldiv").getAttribute("data-mappinguid"))):t.push(this.parent.getColumnByUid(n.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")))}return t},e.prototype.getHeaderCells=function(){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 n=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:this.parent.getColumnByField(e),r=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===i})[0]:this.parent.getColumnByField(i);if(!t.isNullOrUndefined(n)&&(!n.allowReordering||n.lockColumn)||!t.isNullOrUndefined(r)&&(!r.allowReordering||r.lockColumn))return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n,destColumn:r});var s=r,o=this.getColParent(s,this.parent.columns),a=L(s,o?o.columns:this.parent.columns);a>-1&&this.moveColumns(a,n,!0)},e.prototype.reorderMultipleColumns=function(e,i){var n=this.parent.getColumnIndexByField(i),r=this.parent.getColumnByField(i);if(!(n<0)&&(t.isNullOrUndefined(r)||r.allowReordering&&!r.lockColumn)){for(s=0;s<e.length;s++){o=this.parent.getColumnByField(e[parseInt(s.toString(),10)]);if(!t.isNullOrUndefined(o)&&(!o.allowReordering||o.lockColumn))return}for(var s=0;s<e.length;s++){var o=this.parent.getColumnByIndex(n),a=this.getColParent(o,this.parent.columns),l=L(o,a?a.columns:this.parent.columns);l>-1&&this.moveColumns(l,this.parent.getColumnByField(e[parseInt(s.toString(),10)]),!0,!0),this.parent.getColumnIndexByField(e[s+1])>=l&&n++}}},e.prototype.moveTargetColumn=function(e,t){t>-1&&this.moveColumns(t,e,!0)},e.prototype.reorderSingleColumnByTarget=function(e,t){this.moveTargetColumn(this.parent.getColumnByField(e),t)},e.prototype.reorderMultipleColumnByTarget=function(e,t){for(var i=0;i<e.length;i++)this.reorderSingleColumnByTarget(e[parseInt(i.toString(),10)],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.reorderColumnByModel=function(e,i){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&e instanceof Pt&&i instanceof Pt){if(!e.allowReordering||e.lockColumn||!i.allowReordering||i.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:e,destColumn:i});var n=this.targetParentContainerIndex(this.parent.getColumnHeaderByUid(e.uid),this.parent.getColumnHeaderByUid(i.uid));this.moveTargetColumn(e,n)}},e.prototype.reorderColumnByIndex=function(e,t){this.moveTargetColumn(this.parent.getColumnByIndex(e),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&&e.args.isXaxis&&this.setDisplay("none");var t=this.parent.element.querySelector("."+Xi),i=this.parent.createElement("div",{className:"e-icons e-icon-reorderuparrow e-reorderuparrow"});i.style.display="none",this.upArrow=i,t.appendChild(this.upArrow);var n=this.parent.createElement("div",{className:"e-icons e-icon-reorderdownarrow e-reorderdownarrow"});n.style.display="none",this.downArrow=n,t.appendChild(this.downArrow)},e.prototype.onActionComplete=function(e){this.parent.preventAutoFit=!1,this.parent.trigger(Ut,t.extend(e,{type:Ut}));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("."+Ki)||e.querySelector("."+Wi))&&(this.upArrow.parentNode&&t.remove(this.upArrow),this.downArrow.parentNode&&t.remove(this.downArrow),this.parent.off(yi,this.headerDrop),this.parent.off(ei,this.enableAfterRender),this.parent.off(oi,this.onActionComplete),this.parent.off(Gt,this.drag),this.parent.off(Vt,this.dragStart),this.parent.off(mi,this.dragStop),this.parent.off(si,this.createReorderElement),this.parent.off(di,this.keyPressHandler),this.parent.off(pi,this.destroy))},e.prototype.keyPressHandler=function(e){var t=this.parent;switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("leftArrow"===e.action?e.action="ctrlLeftArrow":"rightArrow"===e.action&&(e.action="ctrlRightArrow")),e.action){case"ctrlLeftArrow":case"ctrlRightArrow":var i=t.focusModule.currentInfo.element;if(i&&i.classList.contains("e-headercell")){var n=t.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")),r=t.getVisibleColumns(),s=r.indexOf(n),o="ctrlLeftArrow"===e.action?r[s-1]:r[s+1];o&&o.field&&n.field&&this.reorderColumns(n.field,o.field)}}},e.prototype.drag=function(e){var i=this.parent,n=e.target,r=t.closest(n,".e-headercell:not(.e-stackedHeaderCell)"),s=i.element.querySelector(".e-cloneproperties"),o=i.getContent().firstElementChild,a=this.x>B(e.event).x+o.scrollLeft;if(t.removeClass([].slice.call(i.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),t.classList(s,["e-defaultcur"],["e-notallowedcur"]),this.updateScrollPostion(e.event),r&&!r.isEqualNode(this.element)){var l=(n=r).querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("data-mappinguid");this.chkDropPosition(this.element,n)&&this.chkDropAllCols(this.element,n)&&i.getColumnByUid(l).allowReordering&&e.column.allowReordering?(this.updateArrowPosition(n,a),t.classList(n,["e-allowDrop","e-reorderindicate"],[])):i.allowGrouping&&F(e.target,"e-groupdroparea")||t.classList(s,["e-notallowedcur"],["e-defaultcur"])}else r&&r.isEqualNode(this.element)&&!(i.allowGrouping&&e.column.allowGrouping||e.column.allowReordering)?t.classList(s,["e-notallowedcur"],["e-defaultcur"]):r||i.allowGrouping&&F(e.target,"e-groupdroparea")||t.classList(s,["e-notallowedcur"],["e-defaultcur"]);e.column.allowReordering&&!e.column.lockColumn&&i.trigger(Gt,{target:n,draggableType:"headercell",column:e.column})},e.prototype.updateScrollPostion=function(e){var t=this,i=B(e).x,n=this.parent.element.getBoundingClientRect(),r=n.right,s=n.left,o=this.parent.getContent().firstElementChild;i>s&&i<s+35?this.timer=window.setInterval(function(){t.setScrollLeft(o,!0)},50):i<r&&i>r-35&&(this.timer=window.setInterval(function(){t.setScrollLeft(o,!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(),n=this.parent.element.getBoundingClientRect();if(!(t&&i.left<n.left||!t&&i.right>n.right)){var r=this.parent.getHeaderContent().classList.contains("e-sticky");this.upArrow.style.top=r?i.top+i.height+"px":i.top+i.height-n.top+"px",this.downArrow.style.top=r?i.top-7+"px":i.top-n.top-7+"px",this.upArrow.style.left=this.downArrow.style.left=r?(t?i.left:i.right)-4+"px":(t?i.left:i.right)-n.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:F(i,"e-headercell"),e.column.allowReordering&&!e.column.lockColumn){var n=t.getContent().firstElementChild;this.x=B(e.event).x+n.scrollLeft,t.trigger(Vt,{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(_t,{target:e.target,draggableType:"headercell",column:e.column}),t.removeClass([].slice.call(i.getHeaderTable().getElementsByClassName("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}(),Ts=function(){function e(e){var i=this;this.selectedRows=[],this.isOverflowBorder=!0,this.selectedRowColls=[],this.isRefresh=!0,this.isReplaceDragEle=!0,this.istargetGrid=!1,this.helper=function(e){var n=i.parent,r=i.draggable.currentStateTarget;t.isNullOrUndefined(r)||!n.rowDropSettings.targetID||t.isNullOrUndefined(r.classList)||r.classList.contains("e-rowcell")||(r=F(r,"e-rowcell"));var s=i.parent.createElement("div",{className:"e-cloneproperties e-draganddrop e-grid e-dragclone"});s.style.height="auto";var o=i.parent.createElement("table",{attrs:{role:"grid"}}),a=i.parent.createElement(ln,{attrs:{role:"rowgroup"}});if(document.getElementsByClassName("e-griddragarea").length||n.rowDropSettings.targetID&&(!t.isNullOrUndefined(r)&&!r.classList.contains("e-selectionbackground")&&"Single"!==n.selectionSettings.type||!F(r,"e-rowcell"))||!n.rowDropSettings.targetID&&!F(r,"e-rowdragdrop"))return!1;if(n.rowDropSettings.targetID&&"Row"===n.selectionSettings.mode&&"Single"===n.selectionSettings.type&&n.selectRow(parseInt(i.draggable.currentStateTarget.parentElement.getAttribute(an),10)-1),i.startedRow=t.closest(r,"tr").cloneNode(!0),i.parent.isFrozenGrid())for(var l=[].slice.call(i.startedRow.querySelectorAll(".e-rowcell")),d=0;d<l.length;d++)t.removeClass([l[parseInt(d.toString(),10)]],["e-leftfreeze","e-freezeleftborder","e-fixedfreeze","e-freezerightborder","e-rightfreeze","e-unfreeze"]),l[parseInt(d.toString(),10)].removeAttribute("style");i.processArgs(r);var h={selectedRow:i.rows,dragelement:r,cloneElement:s,cancel:!1,data:i.rowData},p=n.getSelectedRows();n.trigger(Kt,h);if(h.cancel)return!1;if(N(i.startedRow,".e-indentcell"),N(i.startedRow,".e-detailrowcollapse"),N(i.startedRow,".e-detailrowexpand"),n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache||i.removeCell(i.startedRow,$i),i.startedRow.querySelectorAll(".e-active").forEach(function(e){return e.classList.remove("e-active")}),a.appendChild(i.startedRow),n.getSelectedRowIndexes().length>1&&i.startedRow.hasAttribute("aria-selected")){var c=i.parent.createElement("span",{className:"e-dropitemscount",innerHTML:""+p.length});s.appendChild(c)}var u=t.closest(r,"tr").querySelector(".e-icon-rowdragicon");return u&&u.classList.add("e-dragstartrow"),o.appendChild(a),s.appendChild(o),n.element.appendChild(s),s},this.dragStart=function(e){var n=i.parent;if((n.enableVirtualization||n.infiniteScrollSettings.enableCache)&&n.allowGrouping&&n.groupSettings.columns.length&&!t.isNullOrUndefined(e.target.closest("tr")))for(var r=e.dragElement.querySelectorAll("tr"),s=e.target.closest("tr").querySelectorAll(".e-indentcell"),o=0;o<r.length;o++)for(var a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)].cloneNode(!0);r[parseInt(o.toString(),10)].insertBefore(l,r[parseInt(o.toString(),10)].firstElementChild)}if(n.element.classList.contains("e-childgrid")&&(i.getParentGrid(n.element).appendChild(e.dragElement),n.element.appendChild(n.createElement("div",{className:"e-drag-ref"}))),document.body.classList.add("e-prevent-select"),!document.getElementsByClassName("e-griddragarea").length){var d=e.target,h=i.parent.element.querySelector(".e-dropitemscount");i.parent.getSelectedRecords().length>1&&h&&(h.style.left=i.parent.element.querySelector(".e-cloneproperties table").offsetWidth-5+"px"),i.processArgs(d),n.trigger(Wt,{rows:i.rows,target:e.target,draggableType:"rows",fromIndex:parseInt(i.rows[0].getAttribute(an),10)-1,data:i.rowData[0]&&Object.keys(i.rowData[0]).length>0?i.rowData:i.currentViewData()}),i.dragStartData=i.rowData;var p=document.getElementById(n.rowDropSettings.targetID);n.rowDropSettings.targetID&&p&&p.ej2_instances&&"grid"===p.ej2_instances[0].getModuleName()&&p.ej2_instances[0].getContent().classList.add("e-allowRowDrop")}},this.drag=function(e){var n=i.parent;if(i.isDropGrid=i.parent,i.istargetGrid=!1,i.parent.rowDropSettings.targetID){var r=document.getElementById(n.rowDropSettings.targetID);i.isDropGrid=r.ej2_instances[0],F(e.target,"e-grid")&&(i.istargetGrid=i.parent.rowDropSettings.targetID===F(e.target,"e-grid").id)}var s=i.parent.element.querySelector(".e-cloneproperties");n.element.classList.contains("e-childgrid")&&(s=i.getParentGrid(n.element).querySelector(".e-cloneproperties"));var o=i.getElementFromPosition(s,e.event);t.classList(s,["e-defaultcur"],["e-notallowedcur","e-movecur","e-grabcur"]),i.isOverflowBorder=!0,i.hoverState=n.enableHover;var a=F(o,"e-grid")?t.closest(e.target,"tr"):null;if(e.target){i.processArgs(o),n.enableVirtualization&&t.isNullOrUndefined(i.rows[0])&&t.classList(s,["e-notallowedcur"],["e-movecur"]);var l={rows:i.rows,target:o,draggableType:"rows",data:i.rowData,originalEvent:e,cancel:!1};if(n.trigger(Qt,l),i.stopTimer(),!l.cancel){if(n.element.classList.add("e-rowdrag"),a&&(F(o,"e-grid").id===s.parentElement.id||F(o,"e-grid").id)?i.isDropGrid.element.querySelector(".e-emptyrow")?i.dragTarget=0:i.dragTarget=parseInt(a.getAttribute("aria-rowindex"),10)-1:i.dragTarget=parseInt(i.startedRow.getAttribute("aria-rowindex"),10)-1,n.rowDropSettings.targetID){var d=document.querySelector(".e-drag-ref");!F(o,"e-grid")||d&&F(d.parentElement,"e-grid").id===F(o,"e-grid").id||F(s.parentElement,"e-grid").id===F(o,"e-grid").id?t.classList(s,["e-notallowedcur"],["e-defaultcur"]):t.classList(s,["e-grabcur"],["e-notallowedcur"])}else{var h=F(o,"e-grid");h&&h.id===s.parentElement.id&&F(o,"e-row")&&!F(o,"e-addedrow")?t.classList(s,["e-movecur"],["e-defaultcur"]):t.classList(s,["e-notallowedcur"],["e-movecur"])}if(F(i.isDropGrid.element,"e-grid")){if((!i.isDropGrid.groupSettings.columns.length||i.isDropGrid.groupSettings.columns.length)&&!i.isDropGrid.element.querySelector(".e-emptyrow"))if(F(o,"e-grid")&&F(o,"e-grid").id===i.isDropGrid.element.id&&i.updateScrollPostion(e.event),(i.isOverflowBorder||i.parent.frozenRows>i.dragTarget)&&(parseInt(i.startedRow.getAttribute(an),10)-1!==i.dragTarget||i.istargetGrid)||i.istargetGrid&&a&&i.isDropGrid.getRowByIndex(i.isDropGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")===a.getAttribute("data-uid"))i.moveDragRows(e,i.startedRow,a);else{var p=void 0;if(i.parent.enableVirtualization)p=a&&parseInt(a.getAttribute(an),10)-1==i.parent.renderModule.data.dataManager.dataSource.json.length-1;else{var c=i.parent.enableInfiniteScrolling&&i.parent.infiniteScrollSettings.enableCache&&!i.parent.groupSettings.enableLazyLoading?i.parent.pageSettings.currentPage*i.parent.pageSettings.pageSize-1:i.parent.getCurrentViewRecords().length-1,u=i.parent.getRowByIndex(c);p=a&&u&&u.getAttribute("data-uid")===a.getAttribute("data-uid")&&u.getAttribute("data-uid")!==i.startedRow.getAttribute("data-uid"),i.isNewRowAdded()&&"Bottom"===i.parent.editSettings.newRowPosition&&(p=!1)}if(p&&!i.parent.rowDropSettings.targetID){var g=i.parent.createElement("div",{className:"e-lastrow-dragborder"}),f=i.parent.getContent();g.style.width=i.parent.element.offsetWidth-i.getScrollWidth()+"px",i.parent.enableVirtualization&&(g.style.zIndex="1"),f.getElementsByClassName("e-lastrow-dragborder").length||n.allowGrouping&&n.groupSettings.columns.length&&!t.isNullOrUndefined(a.nextSibling)||(f.classList.add("e-grid-relative"),f.appendChild(g),g.style.bottom=i.getScrollWidth()+"px")}i.removeBorder(a)}if(o&&o.classList.contains(Yi)&&!i.isDropGrid.element.querySelector(".e-emptyrow")&&i.istargetGrid){i.removeBorder(a);var c=i.isDropGrid.getCurrentViewRecords().length-1,m=[];(m=i.parent.allowGrouping&&i.parent.groupSettings.columns&&i.parent.groupSettings.columns.length?[].slice.call(i.isDropGrid.getRowByIndex(c).querySelectorAll(".e-rowcell:not(.e-hide),.e-rowdragdrop:not(.e-hide),.e-detailrowcollapse:not(.e-hide)")):[].slice.call(i.isDropGrid.getRowByIndex(c).querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))).length>0&&(i.parent.allowGrouping&&i.parent.groupSettings.columns&&i.parent.groupSettings.columns.length?i.groupRowDDIndicator(m,!0):ee(m,!0,"e-dragborder"))}}}}},this.dragStop=function(e){i.parent.isCheckBoxSelection&&i.parent.enableInfiniteScrolling&&window.getSelection().removeAllRanges(),document.body.classList.remove("e-prevent-select"),J(i.parent)?i.parent.notify(bi,{instance:i,handler:i.processDragStop,arg1:e}):i.processDragStop(e)},this.processDragStop=function(e){var n=i.parent;if(!i.parent.isDestroyed){var r=i.getElementFromPosition(e.helper,e.event),s=r&&!r.classList.contains("e-dlg-overlay")?r:e.target;n.element.classList.remove("e-rowdrag");var o=document.getElementById(n.rowDropSettings.targetID);if(n.rowDropSettings.targetID&&o&&o.ej2_instances&&"grid"===o.ej2_instances[0].getModuleName()&&o.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),F(i.isDropGrid.element,"e-grid")){i.stopTimer(),i.isDropGrid.enableHover=i.hoverState,i.isDropGrid.getContent().classList.remove("e-grid-relative"),i.removeBorder(r);var a=i.isDropGrid.element.querySelector(".e-dragstartrow");a&&a.classList.remove("e-dragstartrow")}if(i.processArgs(s),!n.enableVirtualization||!t.isNullOrUndefined(i.rows[0])){var l={target:s,draggableType:"rows",cancel:!1,fromIndex:parseInt(i.rows[0].getAttribute(an),10)-1,dropIndex:i.dragTarget,rows:i.rows,data:Object.keys(i.dragStartData[0]).length>0?i.dragStartData:i.currentViewData()};n.trigger(Xt,l,function(){if(!(F(s,Zi)||F(s,"e-emptyrow")||F(s,Wi))||l.cancel||i.parent.pinnedTopRowModels.length&&F(s,Xi))return i.dragTarget=null,void t.remove(e.helper);i.isRefresh=!1;var r=i.parent.getSelectedRowIndexes();n.isRowDragable()&&(!i.parent.rowDropSettings.targetID&&i.startedRow.querySelector("td.e-selectionbackground")&&r.length>1&&r.length!==i.parent.getCurrentViewRecords().length?i.reorderRows(r,l.dropIndex):i.reorderRows([parseInt(i.startedRow.getAttribute(an),10)-1],i.dragTarget),i.dragTarget=null,n.rowDropSettings.targetID||(e.helper.classList.contains("e-cloneproperties")&&document.querySelector("."+e.helper.classList[0])&&t.remove(e.helper),!n.enableVirtualization||n.sortSettings.columns.length||n.filterSettings.columns.length||i.parent.allowGrouping&&n.groupSettings.columns.length?i.rowOrder(l):(n.refresh(),n.contentModule.vgenerator.startIndex=null)),i.parent.getContentTable().scrollHeight<i.parent.getContent().clientHeight&&i.parent.scrollModule.setLastRowCell()),i.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(Jt,this.initializeDrag,this),this.parent.on(_t,this.columnDrop,this),this.parent.on(ai,this.onActionComplete,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(jt,this.onDataBoundFn),this.parent.on(ei,this.enableAfterRender,this),this.parent.on(pi,this.destroy,this))}return e.prototype.getParentGrid=function(e){for(var t=e,i=!1;!i;)t.ej2_instances[0].parentDetails&&(t=document.getElementById(t.ej2_instances[0].parentDetails.parentID)),t.classList.contains("e-childgrid")||(i=!0);return t},e.prototype.isNewRowAdded=function(){return this.parent.editSettings&&this.parent.editSettings.showAddNewRow&&!(this.parent.enableInfiniteScrolling||this.parent.enableVirtualization)},e.prototype.groupRowDDIndicator=function(e,t){ee([e[0]],t,"e-dragleft"),ee(e,t,"e-dragtop","e-dragbottom"),ee([e[e.length-1]],t,"e-dragright")},e.prototype.refreshRow=function(e,i,n){for(var r=this.parent,s=r.getContentTable().querySelector(ln),o=r.getHeaderTable().querySelector(ln),a=0,l=e.rows.length;a<l;a++){var d=e.rows[parseInt(a.toString(),10)];if((r.enableVirtualization&&r.allowGrouping&&r.groupSettings.columns.length||r.enableInfiniteScrolling&&r.infiniteScrollSettings.enableCache)&&1===e.rows.length){var h=r.getRowElementByUID(d.getAttribute("data-uid"));t.isNullOrUndefined(h)||t.remove(h)}var p=d.querySelector(".e-dragstartrow");if(p&&p.classList.remove("e-dragstartrow"),i.insertBefore(d,n),r.allowGrouping&&r.groupSettings.columns.length){var c=d.getAttribute("data-uid"),u=e.target.parentElement.getAttribute("data-uid"),g=r.getRowObjectFromUID(c),f=r.getRowObjectFromUID(u);g.parentUid!==f.parentUid&&r.groupModule.groupReorderHandler(g,f)}}var m=[].slice.call(r.editSettings.showAddNewRow?i.querySelectorAll(".e-row:not(.e-addedrow)"):i.getElementsByClassName(Zi));if(r.allowGrouping&&r.groupSettings.columns.length?r.groupSettings.enableLazyLoading||r.enableInfiniteScrolling&&r.infiniteScrollSettings.enableCache&&m.length>3*r.pageSettings.pageSize?r.refresh():(qe(this.parent,e,m),r.enableVirtualization||r.enableInfiniteScrolling&&r.infiniteScrollSettings.enableCache?ze(r):Be(this.parent,r.getRowsObject().filter(function(e){return e.isDataRow}),m),this.parent.notify("refresh-Expand-and-Collapse",{rows:r.enableVirtualization?this.parent.vRows:this.parent.getRowsObject()})):r.enableInfiniteScrolling&&r.infiniteScrollSettings.enableCache&&!r.groupSettings.columns.length?m.length>3*r.pageSettings.pageSize?r.refresh():(qe(this.parent,e,m),ze(r)):this.refreshData(m),this.parent.frozenRows)for(var a=0,l=m.length;a<l;a++)a<this.parent.frozenRows?o.appendChild(m[parseInt(a.toString(),10)]):s.appendChild(m[parseInt(a.toString(),10)])},e.prototype.updateFrozenRowreOrder=function(e){var t=this.parent,i=t.getContentTable().querySelector(ln),n=t.getHeaderTable().querySelector(ln),r=[].slice.call(n.getElementsByClassName(Zi)).concat([].slice.call(i.getElementsByClassName(Zi))),s=t.createElement(ln,{attrs:{role:"rowgroup"}});t.selectionSettings.persistSelection||0!==Object.keys(t.selectionModule.selectedRowState).length?this.parent.clearRowSelection():this.parent.clearSelection();for(var o=this.refreshRowTarget(e),a=0,l=r.length;a<l;a++)s.appendChild(r[parseInt(a.toString(),10)]);this.refreshRow(e,s,o)},e.prototype.refreshRowTarget=function(e){var t=this.parent,i=parseInt(e.target.parentElement.getAttribute(an),10)-1;t.enableVirtualization&&t.allowGrouping&&t.groupSettings.columns.length&&(i=this.parent.getDataRows().indexOf(e.target.parentElement)),!(e.fromIndex<e.dropIndex||e.fromIndex===e.dropIndex)||t.allowGrouping&&t.groupSettings.columns.length||(i+=1);var n=t.getRowByIndex(i);return i===t.getRows().length&&this.isNewRowAdded()&&"Bottom"===this.parent.editSettings.newRowPosition&&(n=this.parent.element.querySelector(".e-row.e-addedrow")),t.allowGrouping&&t.groupSettings.columns.length&&-1!==i&&e.fromIndex<e.dropIndex&&n?n.nextSibling:n},e.prototype.updateFrozenColumnreOrder=function(e){var t=this.parent,i=t.getContentTable().querySelector(ln);t.selectionSettings.persistSelection||0!==Object.keys(t.selectionModule.selectedRowState).length?this.parent.clearRowSelection():this.parent.clearSelection();var n=this.refreshRowTarget(e);this.refreshRow(e,i,n)},e.prototype.refreshData=function(e){for(var t={},i={},n=this.parent.getRowsObject(),r=this.parent.getCurrentViewRecords(),s=this.parent.isRemote(),o=0,a=e.length;o<a;o++){var l=parseInt(e[parseInt(o.toString(),10)].getAttribute(an),10)-1-this.parent.pinnedTopRowModels.length;t[parseInt(o.toString(),10)]=n[parseInt(l.toString(),10)],s||(i[parseInt(o.toString(),10)]=r[parseInt(l.toString(),10)])}for(var d=this.parent.getRows(),o=0,a=e.length;o<a;o++)d[parseInt(o.toString(),10)]=e[parseInt(o.toString(),10)],n[parseInt(o.toString(),10)]=t[parseInt(o.toString(),10)],s||(r[parseInt(o.toString(),10)]=i[parseInt(o.toString(),10)]);Be(this.parent,n,e,this.parent.pinnedTopRowModels.length),this.parent.selectionModule.setPinnedSelectionIndexes()},e.prototype.rowOrder=function(e){if(e.dropIndex!==e.fromIndex&&!isNaN(e.dropIndex)&&!F(e.target,"e-groupcaption")){if(this.parent.isDetail()){this.parent.detailCollapseAll();var t=[].slice.call(this.parent.getContentTable().querySelector(ln).children),i=this.parent.getRowsObject();t.filter(function(e){e.classList.contains("e-detailrow")&&e.remove()});for(var n=0,r=i.length;n<r&&i[parseInt(n.toString(),10)];n++)i[parseInt(n.toString(),10)].isDetailRow&&(this.parent.getRowsObject().splice(n,1),n--)}if((e.target.classList.contains("e-rowcelldrag")||e.target.classList.contains("e-dtdiagonalright")||e.target.classList.contains("e-dtdiagonaldown"))&&(e.target=e.target.parentElement),!e.target.classList.contains("e-rowcell")&&F(e.target,"e-rowcell")&&(e.target=F(e.target,"e-rowcell")),this.parent.frozenRows?this.updateFrozenRowreOrder(e):this.updateFrozenColumnreOrder(e),this.parent.allowGrouping&&this.parent.groupSettings.columns.length||!(this.selectedRowColls.length>0))this.selectedRowColls=[];else{this.parent.selectRows(this.selectedRowColls);var s=[];if(this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length){for(var n=0,r=e.rows.length;n<r;n++)s.push(parseInt(e.rows[parseInt(n.toString(),10)].getAttribute(an),10)-1);this.selectedRowColls=s}this.selectedRowColls=[]}}},e.prototype.currentViewData=function(){for(var e=this.parent.getSelectedRowIndexes(),t=[],i=parseInt(this.startedRow.getAttribute(an),10)-1,n=0,r=e.length;n<r;n++){t[parseInt(n.toString(),10)]=this.parent.currentViewData[e[parseInt(n.toString(),10)]]}return this.parent.rowDropSettings.targetID||0!==e.length||(t[0]=this.parent.currentViewData[parseInt(i.toString(),10)]),t},e.prototype.reorderRows=function(e,t){for(var i=this.parent.isRemote(),n=this.parent.getSelectedRowIndexes(),r=[],s=[],o=i?this.parent.getCurrentViewRecords():this.parent.renderModule.data.dataManager.dataSource.json,a=this.parent.allowPaging&&!i?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-this.parent.pageSettings.pageSize:0,l=t+a,d=e[0]+a,h=0,p=e.length;h<p;h++)s[parseInt(h.toString(),10)]=o[e[parseInt(h.toString(),10)]+a];for(var h=0,p=n.length;h<p;h++)r[parseInt(h.toString(),10)]=o[n[parseInt(h.toString(),10)]+a];for(var h=0,p=s.length;h<p;h++){if(0!==h){for(var c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(s[parseInt(h.toString(),10)])){d=c;break}for(var c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(s[h-1])){d>c&&(l=c+1);break}}this.reorderRow(d-a,l-a)}this.isRefresh&&this.parent.notify(ni,{type:qt,requestType:"rowdraganddrop"});for(var h=0,p=r.length;h<p;h++)for(var c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(r[parseInt(h.toString(),10)])){n[parseInt(h.toString(),10)]=c-a;break}this.selectedRowColls=n},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.onActionComplete=function(e){this.parent.trigger(Ut,t.extend(e,{type:Ut,requestType:"rowdraganddrop"}))},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,isPreventSelect:!1,isPreventScroll:!0})},e.prototype.updateScrollPostion=function(e){var t=this,i=B(e).y,n=this.isDropGrid.getContent().getBoundingClientRect(),r=this.isDropGrid.getRowHeight()-15,s=this.isDropGrid.getContent().firstElementChild,o=this.parent.enableVirtualization?20:0;if(n.top>=i){var a=-this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){t.setScrollDown(s,a)},200)}else if(n.top+this.isDropGrid.getContent().clientHeight-r-33-o<=i){var l=this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){t.setScrollDown(s,l)},200)}},e.prototype.setScrollDown=function(e,t){e.scrollTop=e.scrollTop+t},e.prototype.moveDragRows=function(e,i,n){var r=this.parent.element.querySelector(".e-cloneproperties");this.parent.element.classList.contains("e-childgrid")&&(r=this.getParentGrid(this.parent.element).querySelector(".e-cloneproperties"));var s=t.closest(e.target,"tr");if(F(s,"e-grid")&&(!this.parent.rowDropSettings.targetID&&F(r.parentElement,"e-grid").id===F(s,"e-grid").id||this.istargetGrid)){var o=s;s||(o=i),this.setBorder(o,e.event,i,n)}},e.prototype.setBorder=function(e,i,n,r){var s=this.parent.element;this.istargetGrid&&(s=this.isDropGrid.element);var o=this.parent.element.querySelector(".e-cloneproperties");if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.removeBorder(e):(this.removeFirstRowBorder(e),this.removeLastRowBorder(e)),F(e,"e-grid")&&e.classList.contains(Zi)&&(!this.parent.rowDropSettings.targetID&&F(o.parentElement,"e-grid").id===F(e,"e-grid").id||this.istargetGrid)){this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?t.removeClass(s.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragtop","e-dragright","e-dragbottom","e-dragleft"]):t.removeClass(s.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragborder"]);var a=[],l=parseInt(r.getAttribute(an),10)-1;if(!r||0!==l||this.isNewRowAdded()&&"Top"===this.parent.editSettings.newRowPosition)this.parent.rowDropSettings.targetID&&r?(e=this.isDropGrid.getRowByIndex(l-1),a=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):r&&parseInt(n.getAttribute(an),10)-1>l?(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(l=this.parent.getDataRows().indexOf(r)),this.parent.allowGrouping&&this.parent.groupSettings.columns.length?(e=r,a=[].slice.call(e.querySelectorAll(".e-groupcaption,.e-summarycell,.e-rowcell:not(.e-hide),.e-rowdragdrop:not(.e-hide),\n .e-detailrowcollapse:not(.e-hide)"))):(e=0===l&&this.isNewRowAdded()&&"Top"===this.parent.editSettings.newRowPosition?this.parent.element.querySelector(".e-row.e-addedrow tr"):this.parent.getRowByIndex(l-1),a=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")))):a=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"));else if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length)e=r,a=[].slice.call(e.querySelectorAll(".e-groupcaption,.e-summarycell,.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"));else{var d=this.parent.createElement("div",{className:"e-firstrow-dragborder"}),h=this.isDropGrid.getHeaderContent();h.classList.add("e-grid-relative"),d.style.width=s.offsetWidth-this.getScrollWidth()+"px",h.getElementsByClassName("e-firstrow-dragborder").length||(this.parent.frozenRows?(this.parent.isFrozenGrid()&&(d.style.width=this.parent.getContent().firstElementChild.scrollWidth+"px"),h.querySelector("thead").appendChild(d),d.style.position="relative"):h.appendChild(d))}a.length>0&&(this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?this.groupRowDDIndicator(a,!0):ee(a,!0,"e-dragborder"))}},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?mr.getScrollBarWidth():0},e.prototype.removeFirstRowBorder=function(e){if(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder").length>0&&e&&(0!==e.rowIndex||e.classList.contains("e-columnheader")))t.remove(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder")[0]);else{var i=this.parent.element.querySelector(".e-row.e-addedrow tr");i&&i.querySelector(".e-dragborder")&&ee([].slice.call(i.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")),!1,"e-dragborder")}},e.prototype.removeLastRowBorder=function(e){var i;if(this.parent.enableVirtualization)i=e&&parseInt(e.getAttribute(an),10)-1!=this.parent.renderModule.data.dataManager.dataSource.json.length-1;else{var n=this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&!this.parent.groupSettings.enableLazyLoading?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-1:this.parent.getCurrentViewRecords().length-1,r=this.parent.getRowByIndex(n);i=e&&r&&r.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.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call(this.isDropGrid.getContentTable().querySelectorAll("tr")).filter(function(e){return e.querySelector("td.e-dragtop.e-dragbottom")})[0]:this.isDropGrid.getRows().filter(function(e){return e.querySelector("td.e-dragborder")})[0]){var t=this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call(e.querySelectorAll(".e-dragtop.e-dragbottom")):[].slice.call(e.getElementsByClassName("e-dragborder"));this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?this.groupRowDDIndicator(t,!1):ee(t,!1,"e-dragborder")}},e.prototype.getElementFromPosition=function(e,t){var i=B(t);e.style.display="none";var n=document.elementFromPoint(i.x,i.y);return e.style.display="",n},e.prototype.onDataBound=function(){this.selectedRowColls.length>0&&(this.parent.enableVirtualization||this.parent.allowRowDragAndDrop)&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute(an),10)-1:0},e.prototype.singleRowDrop=function(e){var i=t.closest(e.target,"tr"),n=e.droppedElement.parentElement.ej2_instances[0],r=i?i.rowIndex:n.currentViewData.length-1;this.reorderRow(this.startedRowIndex,r)},e.prototype.columnDrop=function(e){var n=this.parent;if("grouping"!==e.droppedElement.getAttribute("action")&&(F(e.target,Zi)||F(e.target,"e-emptyrow")||F(e.target,Wi))){var r=t.closest(e.target,"tr"),s=void 0,o=void 0,a=document.querySelector(".e-drag-ref");if("true"!==e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&(e.droppedElement.parentElement.id===n.element.id||a&&a.parentElement.id===n.element.id)||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id!==n.element.id)return;if(e.droppedElement.parentElement.id!==n.element.id)a?(s=a.parentElement.ej2_instances[0],t.remove(a)):s=e.droppedElement.parentElement.ej2_instances[0];else if(this.isSingleRowDragDrop||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow"))return void this.singleRowDrop(e);if(s.element.id!==n.element.id&&s.rowDropSettings.targetID!==n.element.id)return;var l=s.getSelectedRecords(),d=o=this.getTargetIdx(r);if(e.target&&e.target.classList.contains("e-content")&&n.getCurrentViewRecords().length){var h=n.getContentTable().querySelector("tr:last-child");h&&(d=o=parseInt(h.getAttribute(an),10))}isNaN(d)&&(d=o=0),n.allowPaging&&(d=d+n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize),n.notify(gi,{toIndex:d,records:l}),n.notify(ni,{type:qt,requestType:"rowdraganddrop"});var p=s.getSelectedRowIndexes(),c=s.allowPaging?s.pageSettings.currentPage*s.pageSettings.pageSize-s.pageSettings.pageSize:0;this.selectedRows=[];for(var u=0,g=l.length;u<g;u++)this.selectedRows.push(c+p[parseInt(u.toString(),10)]);s.notify(fi,{indexes:this.selectedRows,records:l}),s.dataSource instanceof i.DataManager&&s.dataSource.dataSource.offline&&s.notify(ni,{type:qt,requestType:"rowdraganddrop"})}},e.prototype.reorderRow=function(e,t){var i=this.parent;if(!i.groupSettings.columns.length){var n=i.allowPaging&&!this.parent.isRemote()?i.pageSettings.currentPage*i.pageSettings.pageSize-i.pageSettings.pageSize:0;t+=n,this.selectedRows=i.getSelectedRowIndexes(),i.notify(Oi,{fromIndex:e+n,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("."+Ki)||e.querySelector("."+Wi))&&(this.draggable.destroy(),this.parent.off(Jt,this.initializeDrag),this.parent.off(_t,this.columnDrop),this.parent.off(ai,this.onActionComplete),this.parent.removeEventListener(jt,this.onDataBoundFn),this.parent.off(ei,this.enableAfterRender),this.parent.off(pi,this.destroy))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e.prototype.processArgs=function(e){var t=this.parent,i=parseInt(this.startedRow.getAttribute(an),10)-1;t.getSelectedRecords().length>0&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length?(t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache?this.rows=[this.startedRow]:this.rows=[t.getRowByIndex(i)],this.rowData=[t.getRowInfo(this.startedRow.querySelector("."+_i)).rowData],(t.enableVirtualization||t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache)&&t.allowGrouping&&t.groupSettings.columns.length&&t.getSelectedRows().length&&(this.rows=t.getSelectedRows(),this.rowData=Array.from(this.rows,function(e){return t.getRowObjectFromUID(e.getAttribute("data-uid")).data}))):(this.rows=t.getSelectedRows(),this.rowData=Array.from(this.rows,function(e){return t.getRowObjectFromUID(e.getAttribute("data-uid")).data}))},e}(),Es=function(){function e(e,i,n,r){var s=this;this.sortRequired=!0,this.groupSortFocus=!1,this.groupTextFocus=!1,this.groupCancelFocus=!1,this.preventFocusOnGroup=!1,this.isAppliedGroup=!1,this.isAppliedUnGroup=!1,this.isAppliedCaptionRowBorder=!1,this.reorderingColumns=[],this.visualElement=t.createElement("div",{className:"e-cloneproperties e-dragclone e-gdclone",attrs:{action:"grouping"}}),this.helper=function(e){var i=s.parent,n=e.sender.target,r=n.classList.contains("e-groupheadercell")?n:F(n,"e-groupheadercell");return!(!r||!n.classList.contains("e-drag")&&s.groupSettings.allowReordering)&&(s.column=i.getColumnByField(r.firstElementChild.getAttribute("data-mappingname")),s.visualElement.textContent=r.textContent,t.updateCSSText(s.visualElement,"width: "+(r.offsetWidth+2)+"px;\n height: "+(r.offsetHeight+2)+"px; line-height: 23px;"),s.visualElement.setAttribute("data-mappinguid",s.column.uid),i.element.appendChild(s.visualElement),s.visualElement)},this.dragStart=function(e){s.parent.element.classList.add("e-ungroupdrag")},this.drag=function(e){s.groupSettings.allowReordering&&s.animateDropper(e);var i=e.target,n=s.parent.element.querySelector(".e-cloneproperties");s.parent.trigger(Gt,{target:i,draggableType:"headercell",column:s.column}),s.groupSettings.allowReordering||(t.classList(n,["e-defaultcur"],["e-notallowedcur"]),F(i,Wi)||F(i,"e-headercell")||t.classList(n,["e-notallowedcur"],["e-defaultcur"]))},this.dragStop=function(e){s.parent.element.classList.remove("e-ungroupdrag");var i=!(F(e.target,Wi)||F(e.target,"e-gridheader"));if(s.groupSettings.allowReordering&&i){if(t.remove(e.helper),F(e.target,"e-groupdroparea"))s.rearrangeGroup();else if(!F(e.target,"e-grid")){var n=s.parent.getColumnByUid(e.helper.getAttribute("data-mappinguid")).field;-1!==s.groupSettings.columns.indexOf(n)&&s.ungroupColumn(n)}}else if(i)return void t.remove(e.helper)},this.animateDropper=function(e){var t=s.parent.element.querySelector(".e-cloneproperties").getAttribute("data-mappinguid"),i=s.parent.getColumnByUid(t).field,n=F(e.target,"e-groupdroparea"),r=F(e.target,"e-group-animator"),o=[].slice.call(s.element.getElementsByClassName("e-groupheadercell")).map(function(e){return e.querySelector("div").getAttribute("data-mappingname")}),a=JSON.parse(JSON.stringify(o));if(r||n){if(r){var l=r.querySelector("div[data-mappingname]").getAttribute("data-mappingname"),d=+r.getAttribute("data-index");if(l!==i){var h=a.indexOf(i);-1!==h&&a.splice(h,1);var p=-1!==d&&h===d;a.splice(d+(p?1:0),0,i)}}else n&&-1===a.indexOf(i)&&a.push(i);s.element.innerHTML="",a.length&&!s.element.classList.contains("e-grouped")&&s.element.classList.add("e-grouped"),s.reorderingColumns=a;for(var c=0;c<a.length;c++)s.addColToGroupDrop(a[parseInt(c.toString(),10)])}else s.addLabel(),s.removeColFromGroupDrop(i)},this.drop=function(e){var i=s.parent,n=i.getColumnByUid(e.droppedElement.getAttribute("data-mappinguid"));if(s.element.classList.remove("e-hover"),t.remove(e.droppedElement),s.aria.setDropTarget(s.parent.element.querySelector(".e-groupdroparea"),!1),s.aria.setGrabbed(s.parent.getHeaderTable().querySelector("[aria-grabbed=true]"),!1),t.isNullOrUndefined(n)||!1===n.allowGrouping||F(i.getColumnHeaderByUid(n.uid),"e-grid").getAttribute("id")!==i.element.getAttribute("id"))return void s.parent.log("action_disabled_column",{moduleName:s.getModuleName(),columnName:n?n.headerText:void 0});s.groupColumn(n.field)},this.contentRefresh=!0,this.aria=new Dn,this.parent=e,this.groupSettings=i,this.serviceLocator=r,this.sortedColumns=n,this.focus=r.getService("focus"),this.addEventListener(),this.groupGenerator=new bn(this.parent)}return e.prototype.addLabel=function(){if(!this.element.getElementsByClassName("e-group-animator").length){var e=this.l10n.getConstant("GroupDropArea");this.element.innerHTML=e,this.element.classList.remove("e-grouped")}},e.prototype.rearrangeGroup=function(){this.sortRequired=!1,this.updateModel()},e.prototype.columnDrag=function(e){this.groupSettings.allowReordering&&e.column.allowGrouping&&this.animateDropper(e);var i=this.parent.element.querySelector(".e-cloneproperties");this.parent.allowReordering||t.classList(i,["e-defaultcur"],["e-notallowedcur"]),e.column.allowGrouping&&(F(e.target,"e-groupdroparea")||F(e.target,"e-headercell")&&F(e.target,"e-headercell").isEqualNode(this.parent.getColumnHeaderByField(e.column.field)))||this.parent.allowReordering&&F(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")){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:F(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 n=i.getColumnByUid(e.droppedElement.getAttribute("data-mappinguid"));if(t.isNullOrUndefined(n)||!1===n.allowGrouping||F(i.getColumnHeaderByUid(n.uid),"e-grid").getAttribute("id")!==i.element.getAttribute("id"))return;this.ungroupColumn(n.field)}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ei,this.enableAfterRender,this),this.parent.on("grouping-complete",this.onActionComplete,this),this.parent.on("ungrouping-complete",this.onActionComplete,this),this.parent.on(ii,this.onPropertyChanged,this),this.parent.on(hi,this.clickHandler,this),this.parent.on(Gt,this.columnDrag,this),this.parent.on(Vt,this.columnDragStart,this),this.parent.on(yi,this.columnDrop,this),this.parent.on(_t,this.columnDrop,this),this.parent.on(si,this.refreshSortIcons,this),this.parent.on("sorting-complete",this.refreshSortIcons,this),this.parent.on(di,this.keyPressHandler,this),this.parent.on($t,this.initialEnd,this),this.parent.on(ti,this.initialEnd,this),this.parent.on(Jt,this.render,this),this.parent.on("group-aggregates",this.onGroupAggregates,this),this.parent.on(pi,this.destroy,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(Jt,this.render),this.parent.off(ei,this.enableAfterRender),this.parent.off("grouping-complete",this.onActionComplete),this.parent.off("ungrouping-complete",this.onActionComplete),this.parent.off(ii,this.onPropertyChanged),this.parent.off(hi,this.clickHandler),this.parent.off(Gt,this.columnDrag),this.parent.off(Vt,this.columnDragStart),this.parent.off(_t,this.columnDrop),this.parent.off(yi,this.columnDrop),this.parent.off(si,this.refreshSortIcons),this.parent.off("sorting-complete",this.refreshSortIcons),this.parent.off(di,this.keyPressHandler),this.parent.off("group-aggregates",this.onGroupAggregates),this.parent.off(pi,this.destroy),this.parent.off("group-expand-collapse",this.updateExpand))},e.prototype.initialEnd=function(){var e=this.parent;if(this.parent.off($t,this.initialEnd),this.parent.off(ti,this.initialEnd),this.parent.getColumns().length&&this.groupSettings.columns.length){this.contentRefresh=!1;for(var t=0,i=e.groupSettings.columns;t<i.length;t++){var n=i[t];this.preventFocusOnGroup=!0,this.groupColumn(n),this.preventFocusOnGroup=!1}this.contentRefresh=!0}},e.prototype.keyPressHandler=function(e){var i=this.parent;if(e.target&&F(e.target,"e-groupheadercell")&&("tab"===e.action||"shiftTab"===e.action)){var n=this.getFocusableGroupedItems();if("tab"===e.action&&e.target===n[n.length-1]||"shiftTab"===e.action&&e.target===n[0])return;for(l=0;l<n.length;l++)if(e.target===n[parseInt(l.toString(),10)]){e.preventDefault();var r="tab"===e.action?l+1:l-1;return void n[parseInt(r.toString(),10)].focus()}}if(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("downArrow"===e.action?e.action="ctrlDownArrow":"upArrow"===e.action&&(e.action="ctrlUpArrow")),("ctrlSpace"===e.action||this.groupSettings.columns.length&&-1!==["altDownArrow","altUpArrow","ctrlDownArrow","ctrlUpArrow","enter"].indexOf(e.action))&&(!this.parent.groupSettings.enableLazyLoading||!this.groupSettings.columns.length||"ctrlUpArrow"!==e.action&&"ctrlDownArrow"!==e.action))switch(e.action){case"altDownArrow":case"altUpArrow":var s=i.allowSelection?i.getSelectedRowIndexes():[];if(s.length){e.preventDefault();for(var o=i.getContentTable().querySelector(ln).children,a=void 0,l=i.getDataRows()[s[s.length-1]].rowIndex;l>=0;l--)if(!o[parseInt(l.toString(),10)].classList.contains(Zi)&&!o[parseInt(l.toString(),10)].classList.contains("e-detailrow")){a=o[parseInt(l.toString(),10)];break}this.expandCollapseRows(a.querySelector("altUpArrow"===e.action?".e-recordplusexpand":".e-recordpluscollapse"))}break;case"ctrlDownArrow":e.preventDefault(),this.expandAll();break;case"ctrlUpArrow":e.preventDefault(),this.collapseAll();break;case"enter":if(e.target.classList.contains("e-groupsort")){this.groupSortFocus=!0,e.preventDefault(),this.applySortFromTarget(e.target);break}if(e.target.classList.contains("e-ungroupbutton")){this.groupCancelFocus=!0,e.preventDefault(),this.unGroupFromTarget(e.target);break}if(this.parent.isEdit||null!==t.closest(e.target,"#"+this.parent.element.id+"_searchbar")||F(e.target,"e-pager")||F(e.target,"e-toolbar"))return;var d=this.focus.getFocusedElement();d&&(d.classList.contains("e-icon-grightarrow")||d.classList.contains("e-icon-gdownarrow"))&&(d=d.parentElement);var h=d&&d.parentElement?d.parentElement.querySelector('[class^="e-record"]'):null;if(!h)break;d.children.length&&(d.children[0].classList.contains("e-icon-grightarrow")||d.children[0].classList.contains("e-icon-gdownarrow"))&&(e.preventDefault(),this.expandCollapseRows(h));break;case"ctrlSpace":var p=i.focusModule.currentInfo.element;if(p&&p.classList.contains("e-headercell")){e.preventDefault();var c=i.getColumnByUid(p.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));c.field&&i.groupSettings.columns.indexOf(c.field)<0?this.groupColumn(c.field):this.ungroupColumn(c.field)}}},e.prototype.getFocusableGroupedItems=function(){var e=[];if(this.groupSettings.columns.length)for(var t=this.element.querySelectorAll(".e-groupheadercell"),i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)].querySelector(".e-grouptext")),e.push(t[parseInt(i.toString(),10)].querySelector(".e-groupsort")),e.push(t[parseInt(i.toString(),10)].querySelector(".e-ungroupbutton"));return e},e.prototype.wireEvent=function(){t.EventHandler.add(this.element,"focusin",this.onFocusIn,this),t.EventHandler.add(this.element,"focusout",this.onFocusOut,this),t.EventHandler.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this)},e.prototype.unWireEvent=function(){t.EventHandler.remove(this.element,"focusin",this.onFocusIn),t.EventHandler.remove(this.element,"focusout",this.onFocusOut),t.EventHandler.remove(this.parent.element,"auxclick",this.auxilaryclickHandler)},e.prototype.onFocusIn=function(e){this.parent.focusModule.currentInfo&&this.parent.focusModule.currentInfo.element&&(t.removeClass([this.parent.focusModule.currentInfo.element,this.parent.focusModule.currentInfo.elementToFocus],["e-focused","e-focus"]),this.parent.focusModule.currentInfo.element.tabIndex=-1),this.addOrRemoveFocus(e)},e.prototype.onFocusOut=function(e){this.addOrRemoveFocus(e)},e.prototype.addOrRemoveFocus=function(e){if(e.target.classList.contains("e-groupdroparea")||e.target.classList.contains("e-grouptext")||e.target.classList.contains("e-groupsort")||e.target.classList.contains("e-ungroupbutton")){var i=e.target.classList.contains("e-grouptext")?e.target.parentElement.parentElement:e.target;"focusin"===e.type?(this.parent.focusModule.currentInfo.element=e.target,this.parent.focusModule.currentInfo.elementToFocus=e.target,t.addClass([i],["e-focused","e-focus"]),e.target.tabIndex=0):(t.removeClass([i],["e-focused","e-focus"]),e.target.tabIndex=-1)}},e.prototype.clickHandler=function(e){e.target.classList.contains("e-grouptext")&&(this.groupTextFocus=!0),e.target.classList.contains("e-groupsort")&&(this.groupSortFocus=!0),e.target.classList.contains("e-ungroupbutton")&&(this.groupCancelFocus=!0),(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow"))&&e.preventDefault();var t=F(e.target,"e-recordplusexpand")||F(e.target,"e-recordpluscollapse");t&&(t.children[0].classList.contains("e-icon-gdownarrow")||t.children[0].classList.contains("e-icon-grightarrow"))&&this.expandCollapseRows(e.target),this.applySortFromTarget(e.target),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},e.prototype.auxilaryclickHandler=function(e){(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow")&&1===e.button)&&e.preventDefault()},e.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("data-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("data-mappinguid")).field):this.groupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("data-mappinguid")).field):e.classList.contains("e-toggleungroup")&&this.ungroupColumn(e.parentElement.getAttribute("data-mappingname")))},e.prototype.applySortFromTarget=function(e){var i=this.parent,n=t.closest(e,".e-groupheadercell");if(i.allowSorting&&n&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")){var r=n.firstElementChild.getAttribute("data-mappingname");i.getColumnHeaderByField(r).getElementsByClassName("e-ascending").length?i.sortColumn(r,"Descending",!0):i.sortColumn(r,"Ascending",!0)}},e.prototype.expandCollapseRows=function(e){var i=F(e,"e-recordplusexpand")||F(e,"e-recordpluscollapse");if(i){var n=[].slice.call(this.parent.getContentTable().querySelector(ln).children);this.parent.editSettings.showAddNewRow&&(n[0].classList.contains("e-addedrow")?n.shift():n[n.length-1].classList.contains("e-addedrow")&&n.pop());var r=void 0,s=this.parent,o=i.parentElement.getElementsByClassName("e-indentcell").length,a=i.parentElement.getAttribute("data-uid"),l=s.getRowObjectFromUID(a),d=!1;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",i.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded")),d=!0,l.isExpand=!0,ge(s)&&this.updateVirtualRows(s,e,d,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&((this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length||this.parent.searchSettings.key.length)&&0===this.parent.getContent().firstElementChild.scrollTop&&(this.parent.contentModule.isTop=!0),(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).captionExpand(i.parentElement))):(r=!0,l.isExpand=!1,t.removeClass([i],"e-recordplusexpand"),t.addClass([i],"e-recordpluscollapse"),i.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",i.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")),ge(s)&&this.updateVirtualRows(s,e,!r,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).captionCollapse(i.parentElement)),this.aria.setExpand(i,d),!ge(s)&&!this.parent.groupSettings.enableLazyLoading){for(var h=s.getRowsObject(),p=h.indexOf(l),c={},u=s.enableInfiniteScrolling&&s.infiniteScrollSettings&&s.infiniteScrollSettings.enableCache&&h.length!==n.length?Array.from(n).indexOf(i.parentElement):void 0,g=p;g<h.length&&!(g>p&&h[parseInt(g.toString(),10)].indent===o);g++){if(h[parseInt(g.toString(),10)].isDetailRow){var f=h[g-1].isExpand&&h[g-1].visible;u&&u>0&&u<n.length?n[parseInt(u.toString(),10)].style.display=f?"":"none":t.isNullOrUndefined(u)&&(n[parseInt(g.toString(),10)].style.display=f?"":"none")}else if(!1===c[h[parseInt(g.toString(),10)].parentUid])h[parseInt(g.toString(),10)].visible=!1,u&&u>0&&u<n.length?n[parseInt(u.toString(),10)].style.display="none":t.isNullOrUndefined(u)&&(n[parseInt(g.toString(),10)].style.display="none");else{if(!(h[parseInt(g.toString(),10)].isDataRow||h[parseInt(g.toString(),10)].isCaptionRow||h[parseInt(g.toString(),10)].isDetailRow||h[parseInt(g.toString(),10)].isAggregateRow)&&(f=h[parseInt(g.toString(),10)].cells.some(function(e){return e.isDataCell&&e.visible}))===h[parseInt(g.toString(),10)].visible)continue;h[parseInt(g.toString(),10)].visible=!0,u&&u>0&&u<n.length?(n[parseInt(u.toString(),10)].style.display="",n[parseInt(u.toString(),10)].classList.remove("e-hide")):t.isNullOrUndefined(u)&&(n[parseInt(g.toString(),10)].style.display="",n[parseInt(g.toString(),10)].classList.remove("e-hide"))}h[parseInt(g.toString(),10)].isCaptionRow&&(c[h[parseInt(g.toString(),10)].uid]=h[parseInt(g.toString(),10)].isExpand&&h[parseInt(g.toString(),10)].visible),t.isNullOrUndefined(u)||u++}this.lastCaptionRowBorder(),this.parent.notify("refresh-Expand-and-Collapse",{rows:this.parent.getRowsObject()})}this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading||this.parent.notify("infinite-group-collapse",{isCollapse:r,parentUid:a})}},e.prototype.lastCaptionRowBorder=function(){var e=this.parent.getContentTable(),i=this.parent.getContent().clientHeight;if((!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.groupSettings.enableLazyLoading)&&(e.scrollHeight<i||this.isAppliedCaptionRowBorder)){if(this.isAppliedCaptionRowBorder||e.querySelector(".e-lastrowcell")){for(var n=e.querySelectorAll(".e-lastrowcell"),r=0,s=n.length;r<s;r++)t.removeClass([n[parseInt(r.toString(),10)]],"e-lastrowcell");this.isAppliedCaptionRowBorder=!1}var o=this.parent.getContentTable().querySelector(ln).children,a=o[o.length-1];if("none"===a.style.display||a.classList.contains("e-groupcaptionrow")){for(var r=o.length-1,s=0;r>s;r--)if("none"!==o[parseInt(r.toString(),10)].style.display&&o[parseInt(r.toString(),10)].classList.contains("e-groupcaptionrow")&&o[parseInt(r.toString(),10)].querySelector(".e-recordpluscollapse")){t.addClass(o[parseInt(r.toString(),10)].childNodes,"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0;break}}else e.scrollHeight<i&&(t.addClass(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0)}},e.prototype.updateVirtualRows=function(e,t,i,n,r){var s=e.getRowObjectFromUID(t.closest("tr").getAttribute("data-uid"));s.isExpand=i,S(e),this.parent.notify("refresh-virtual-max-page",{}),n=e.getDataModule().generateQuery(!1);var o={requestType:"virtualscroll",rowObject:s};e.contentModule&&(o.virtualInfo=e.contentModule.prevInfo),e.getDataModule().getData(o,n.requiresCount()).then(function(t){return e.renderModule.dataManagerSuccess(t,o)})},e.prototype.expandCollapse=function(e){var t=this.parent.getRowsObject();if(this.parent.groupSettings.columns.length&&t.length){e||this.parent.notify("initial-collapse",e);for(var i,n=this.parent.getContentTable().querySelector(ln).children,r=0,s=n.length;r<s;r++)n[parseInt(r.toString(),10)].querySelectorAll(".e-recordplusexpand, .e-recordpluscollapse").length?((i=n[parseInt(r.toString(),10)].querySelector(e?".e-recordpluscollapse":".e-recordplusexpand"))&&(e?(i.className="e-recordplusexpand",i.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",i.setAttribute("aria-expanded","true"),i.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded"))):(i.className="e-recordpluscollapse",i.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",i.setAttribute("aria-expanded","false"),i.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")))),n[parseInt(r.toString(),10)].firstElementChild.classList.contains("e-recordplusexpand")||n[parseInt(r.toString(),10)].firstElementChild.classList.contains("e-recordpluscollapse")||(n[parseInt(r.toString(),10)].style.display=e?"":"none")):n[parseInt(r.toString(),10)].style.display=e?"":"none",t[parseInt(r.toString(),10)].isCaptionRow&&(t[parseInt(r.toString(),10)].isExpand=!!e);this.parent.updateVisibleExpandCollapseRows(),this.lastCaptionRowBorder(),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(),this.wireEvent()},e.prototype.refreshDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");if(!t.isNullOrUndefined(e)){this.updateGroupDropArea(!0);for(var i=0;i<this.groupSettings.columns.length;i++)this.addColToGroupDrop(this.groupSettings.columns[parseInt(i.toString(),10)])}},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&&"Vertical"!==this.parent.rowRenderingMode||(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(){new t.Droppable(this.element,{accept:".e-dragclone",drop:this.drop})},e.prototype.groupColumn=function(e){var i=this.parent,n=i.getColumnByField(e);return t.isNullOrUndefined(n)||!1===n.allowGrouping||this.contentRefresh&&this.groupSettings.columns.indexOf(e)>-1?void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:n.headerText}):J(i)?void i.notify(bi,{instance:this,handler:this.groupColumn,arg1:e}):(n.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,n=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:i.getColumnByField(e);if(!(t.isNullOrUndefined(n)||!1===n.allowGrouping||this.groupSettings.columns.indexOf(e)<0)){if(J(i))return void i.notify(bi,{instance:this,handler:this.ungroupColumn,arg1:e});n.visible=!0,this.colName=n.field;var r=JSON.parse(JSON.stringify(this.groupSettings.columns));if(r.splice(r.indexOf(this.colName),1),this.sortedColumns.indexOf(e)<0)for(var s=0,o=i.sortSettings.columns.length;s<o;s++)if(e===i.sortSettings.columns[parseInt(s.toString(),10)].field){i.sortSettings.columns.splice(s,1);break}this.groupSettings.allowReordering&&(this.reorderingColumns=r),this.groupSettings.columns=r,i.allowGrouping&&(this.isAppliedUnGroup=!0,this.parent.dataBind())}},e.prototype.updateModel=function(){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){"grouping"===e.requestType?this.addColToGroupDrop(this.colName):this.removeColFromGroupDrop(this.colName),this.groupSettings.showDropArea&&"100%"===this.parent.height&&this.parent.scrollModule.refresh();var i=this.groupSettings.columns.indexOf(this.colName)>-1?{columnName:this.colName,requestType:"grouping",type:Ut}:{requestType:"ungrouping",type:Ut};this.parent.trigger(Ut,t.extend(e,i)),this.colName=null},e.prototype.groupAddSortingQuery=function(e){for(var t=0;t<this.parent.sortSettings.columns.length&&this.parent.sortSettings.columns[parseInt(t.toString(),10)].field!==e;)t++;this.parent.sortSettings.columns.length===t?this.parent.sortSettings.columns.push({field:e,direction:"Ascending",isFromGroup:!0}):this.parent.allowSorting||(this.parent.sortSettings.columns[parseInt(t.toString(),10)].direction="Ascending")},e.prototype.createElement=function(e){var i=this.parent,n="Ascending",r=this.parent.createElement("div",{className:"e-grid-icon e-group-animator"}),s=this.parent.createElement("div",{className:"e-grid-icon e-groupheadercell"}),o=this.parent.createElement("div",{attrs:{"data-mappingname":e}});_(e)&&o.setAttribute("ej-complexname",K(e));var a=this.parent.getColumnByField(e),l=i.getColumnHeaderByUid(a.uid);this.groupSettings.allowReordering&&o.appendChild(this.parent.createElement("span",{className:"e-drag e-icons e-icon-drag",innerHTML:" ",attrs:{title:"Drag",tabindex:"-1","aria-label":this.l10n.getConstant("GroupedDrag"),role:"button"}})),o.appendChild(this.parent.createElement("span",{className:"e-grouptext",innerHTML:a.headerText,attrs:{tabindex:"-1"}})),this.groupSettings.showToggleButton&&o.appendChild(this.parent.createElement("span",{className:"e-togglegroupbutton e-icons e-icon-ungroup e-toggleungroup",innerHTML:" ",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("UnGroupAria")}})),l.querySelectorAll(".e-ascending,.e-descending").length&&(n=l.querySelector(".e-ascending")?"Ascending":"Descending"),o.appendChild(this.parent.createElement("span",{className:"e-groupsort e-icons e-"+n.toLowerCase()+" e-icon-"+n.toLowerCase(),innerHTML:" ",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("GroupedSortIcon")+a.headerText,role:"button"}}));var d=this.parent.createElement("span",{className:"e-ungroupbutton e-icons e-icon-hide",innerHTML:" ",attrs:{title:this.l10n.getConstant("UnGroup"),tabindex:"-1","aria-label":this.l10n.getConstant("UnGroupIcon")+a.headerText,role:"button"}});return t.updateCSSText(d,this.groupSettings.showUngroupButton?"":"display: none;"),o.appendChild(d),s.appendChild(o),this.groupSettings.allowReordering&&(r.appendChild(s),r.appendChild(this.createSeparator()),s=r),s},e.prototype.addColToGroupDrop=function(e){var i=_(e)?this.parent.element.querySelector(".e-groupdroparea div[ej-complexname="+W(K(e))+"]"):this.parent.element.querySelector(".e-groupdroparea div[data-mappingname="+W(e)+"]");if(!i||!this.groupSettings.allowReordering&&i.getAttribute("data-mappingname")!==e){var n=this.parent.getColumnByField(e);if(!t.isNullOrUndefined(n)){var r=this.createElement(e);if(this.groupSettings.allowReordering){var s=this.element.getElementsByClassName("e-group-animator").length;r.setAttribute("data-index",s.toString())}this.element.appendChild(r);var o=this.parent.focusModule;o.setActive(!0);var a=[0,0];0===o.active.matrix.matrix[a[0]][a[1]]&&(a=bt(o.active.matrix.matrix,a,!0)),o.active.matrix.current=a,this.parent.editSettings.showAddNewRow?this.parent.notify(zi,{}):this.parent.isInitialLoad&&!this.preventFocusOnGroup&&o.focus()}}},e.prototype.createSeparator=function(){var e=this.parent.createElement("span",{className:"e-nextgroup e-icons e-icon-next",innerHTML:" ",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("GroupSeperator"),role:"button"}});return t.updateCSSText(e,this.groupSettings.showUngroupButton?"":"display: none;"),e},e.prototype.refreshToggleBtn=function(e){if(this.groupSettings.showToggleButton)for(var i=[].slice.call(this.parent.getHeaderTable().getElementsByClassName("e-headercelldiv")),n=0,r=i.length;n<r;n++)if(!i[parseInt(n.toString(),10)].classList.contains("e-emptycell")&&!i[parseInt(n.toString(),10)].classList.contains("e-headerchkcelldiv")){var s=this.parent.getColumnByUid(i[parseInt(n.toString(),10)].getAttribute("data-mappinguid"));(!this.parent.showColumnMenu||this.parent.showColumnMenu&&!s.showColumnMenu)&&(i[parseInt(n.toString(),10)].getElementsByClassName("e-grptogglebtn").length&&t.remove(i[parseInt(n.toString(),10)].querySelectorAll(".e-grptogglebtn")[0]),e||i[parseInt(n.toString(),10)].appendChild(this.parent.createElement("span",{className:"e-grptogglebtn e-icons "+(this.groupSettings.columns.indexOf(s.field)>-1?"e-toggleungroup e-icon-ungroup":"e-togglegroup e-icon-group"),attrs:{tabindex:"-1","aria-label":t.isNullOrUndefined(this.l10n)?this.parent.localeObj.getConstant("GroupButton"):this.l10n.getConstant("GroupButton")}})))}},e.prototype.removeColFromGroupDrop=function(e){if(!t.isNullOrUndefined(this.getGHeaderCell(e))){var i=this.getGHeaderCell(e);if(this.groupSettings.allowReordering){var n=F(i,"e-group-animator");t.remove(n)}else t.remove(i);this.updateGroupDropArea(),this.parent.editSettings.showAddNewRow&&this.parent.notify(zi,{})}this.isAppliedUnGroup=!1},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=0,i=Object.keys(e.properties);t<i.length;t++){var n=i[t];switch(n){case"columns":var r=void 0;if(this.contentRefresh){if(this.isAppliedUnGroup)r={columnName:this.colName,requestType:"ungrouping",type:qt};else{if(!this.isAppliedGroup){this.updateGroupDropArea(!0);for(var s=0;s<this.parent.sortSettings.columns.length;s++)this.parent.sortSettings.columns[parseInt(s.toString(),10)].isFromGroup&&(this.parent.sortSettings.columns.splice(s,1),s--);for(a=0;a<this.groupSettings.columns.length;a++)this.colName=this.groupSettings.columns[parseInt(a.toString(),10)],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[parseInt(a.toString(),10)])}r={columnName:this.colName,requestType:e.properties[""+n].length?"grouping":"ungrouping",type:qt,preventFocusOnGroup:!1}}if(!this.groupSettings.showGroupedColumn)for(var o=e.oldProperties[""+n],a=0;a<o.length;a++)-1===e.properties[""+n].indexOf(o[parseInt(a.toString(),10)])&&(this.parent.getColumnByField(o[parseInt(a.toString(),10)]).visible=!0);this.parent.notify(ni,r)}break;case"showDropArea":this.updateGroupDropArea(),this.groupSettings.showDropArea?(this.element.style.display="",this.parent.headerModule.refreshUI()):this.element.style.display="none","100%"===this.parent.height&&this.parent.scrollModule.refresh();break;case"showGroupedColumn":this.updateGroupedColumn(this.groupSettings.showGroupedColumn),this.parent.notify(ni,{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[parseInt(t.toString(),10)]).visible=e},e.prototype.updateButtonVisibility=function(e,t){for(var i=[].slice.call(this.element.getElementsByClassName(t)),n=0;n<i.length;n++)i[parseInt(n.toString(),10)].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("."+Ki)||e.querySelector("."+Wi))&&(!this.parent.isDestroyed&&this.parent.allowGrouping||this.parent.refreshing||this.clearGrouping(),this.unWireEvent(),this.removeEventListener(),this.refreshToggleBtn(!0),this.element.parentNode&&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[parseInt(t.toString(),10)]);this.contentRefresh=!0},e.prototype.getModuleName=function(){return"group"},e.prototype.refreshSortIcons=function(){var e,i=this.parent,n=i.sortSettings.columns,r=this.parent.getColumns().map(function(e){return e.field});this.refreshToggleBtn();for(var s=0,o=n.length;s<o;s++)-1!==r.indexOf(n[parseInt(s.toString(),10)].field)&&(e=i.getColumnHeaderByField(n[parseInt(s.toString(),10)].field),!i.allowSorting&&(this.sortedColumns.indexOf(n[parseInt(s.toString(),10)].field)>-1||this.groupSettings.columns.indexOf(n[parseInt(s.toString(),10)].field)>-1)?(t.classList(e.querySelector(".e-sortfilterdiv"),["e-ascending","e-icon-ascending"],[]),n.length>1&&e.querySelector(".e-headercelldiv").appendChild(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(s+1).toString()}))):this.getGHeaderCell(n[parseInt(s.toString(),10)].field)&&this.getGHeaderCell(n[parseInt(s.toString(),10)].field).getElementsByClassName("e-groupsort").length&&("Ascending"===n[parseInt(s.toString(),10)].direction?t.classList(this.getGHeaderCell(n[parseInt(s.toString(),10)].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):t.classList(this.getGHeaderCell(n[parseInt(s.toString(),10)].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])))},e.prototype.getGHeaderCell=function(e){return this.element&&this.element.querySelector('[data-mappingname="'+e+'"]')?this.element.querySelector('[data-mappingname="'+e+'"]').parentElement:null},e.prototype.onGroupAggregates=function(e){if(this.parent.groupSettings.enableLazyLoading)return void("Batch"!==this.parent.editSettings.mode&&this.updateLazyLoadGroupAggregates(e));var t=this.iterateGroupAggregates(e),i=this.groupGenerator.generateRows(t,{}),n=this.parent.getRowsObject().filter(function(e){return!e.isDataRow}),r=i.filter(function(e){return!e.isDataRow});(this.parent.isReact||this.parent.isVue)&&this.parent.destroyTemplate(["groupFooterTemplate","groupCaptionTemplate","footerTemplate"]);for(var s=0;s<r.length;s++){var o=r[parseInt(s.toString(),10)],a={cells:o.cells.filter(function(e){return e.isDataCell}),data:o.data,dataUid:n[parseInt(s.toString(),10)]?n[parseInt(s.toString(),10)].uid:""};this.parent.notify("refresh-aggregate-cell",a)}},e.prototype.updateLazyLoadGroupAggregates=function(e,t){var i=this,n=this.getGroupAggregateTemplates(!0),r=this.getGroupAggregateTemplates(!1);if(n.length||r.length)for(var s=this.parent,o=s.getDataModule().isRemote(),a=e[0],l=e.row,d=s.groupSettings.columns,h=s.contentModule,p=h.getGroupCache()[s.pageSettings.currentPage],c=t||[],u=this,g=0;g<d.length&&"break"!==function(t){var g=d[parseInt(t.toString(),10)],f=a[""+g],m=u.getGroupCaptionRowObject(l,d.length-t);if(o&&c.length){if(0!==t){var y=d[t-1],v=a[""+y];c=c.find(function(e){return e.key===v}).items}u.updateLazyLoadGroupAggregatesRow(c,f,m,p,n,r)}else{var S=s.renderModule.data.generateQuery();if(0!==t){var C=p.filter(function(e){return e.isCaptionRow&&e.parentUid===m.parentUid}).indexOf(m),w=s.groupSettings.columns.slice(0,t).reverse(),b=Ct(St(w,w.map(function(e){return a[""+e]}),h)),I={level:t,skip:C,take:1,where:b};S.lazyLoad.push({key:"onDemandGroupInfo",value:I})}if(s.renderModule.data.getData({},S).then(function(s){o?i.updateLazyLoadGroupAggregates(e,s.result):i.updateLazyLoadGroupAggregatesRow(s.result,f,m,p,n,r),(t===d.length-1||o)&&i.destroyRefreshGroupCaptionFooterTemplate()}).catch(function(e){return s.renderModule.dataManagerFailure(e,{requestType:"grouping"})}),o)return"break"}}(g);g++);},e.prototype.destroyRefreshGroupCaptionFooterTemplate=function(){var e=this.parent;(e.isAngular||e.isReact||e.isVue)&&e.destroyTemplate(["groupCaptionTemplate","groupFooterTemplate"]),e.refreshGroupCaptionFooterTemplate(),e.removeMaskRow(),e.hideSpinner()},e.prototype.updateLazyLoadGroupAggregatesRow=function(e,t,i,n,r,s){var o=e.find(function(e){return e.key===t});if(r.length&&this.updateLazyLoadGroupAggregatesCell(o,i,r),s.length){var a=n.find(function(e){return e.isAggregateRow&&e.parentUid===i.uid});this.updateLazyLoadGroupAggregatesCell(o,a,s)}},e.prototype.updateLazyLoadGroupAggregatesCell=function(e,t,i){var n=t.data,r=e.aggregates;t.isCaptionRow&&(n.aggregates=r);for(var s=0;s<i.length;s++){var o=i[parseInt(s.toString(),10)],a=o.field+" - "+o.type,l=n[o.field];l[""+a]=r[""+a],l[It(o.type)]=r[""+a],l[o.type]&&(l[o.type]=r[""+a])}},e.prototype.getGroupCaptionRowObject=function(e,t){for(var i=this.parent,n=e.getAttribute("data-uid"),r=i.getRowObjectFromUID(n),s=0;s<t;s++)r=i.getRowObjectFromUID(r.parentUid);return r},e.prototype.getGroupAggregateTemplates=function(e){for(var t=[],i=this.parent.aggregates,n=0;n<i.length;n++)for(var r=i[parseInt(n.toString(),10)],s=0;s<r.columns.length;s++)if(e&&r.columns[parseInt(s.toString(),10)].groupCaptionTemplate||!e&&r.columns[parseInt(s.toString(),10)].groupFooterTemplate){var o={};o={type:r.columns[parseInt(s.toString(),10)].type.toString().toLowerCase(),field:r.columns[parseInt(s.toString(),10)].field},t.push(o)}return t},e.prototype.groupedRowReorder=function(e,i){var n=this.parent.getRowElementByUID(e.uid),r=this.parent.getRowElementByUID(i.uid),s={rows:[n],target:r,fromIndex:e.index,dropIndex:i.index};if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&e.parentUid!==i.parentUid){r?("none"===r.style.display&&(n.style.display="none"),s.fromIndex>s.dropIndex?this.parent.getContentTable().querySelector(ln).insertBefore(n,r):this.parent.getContentTable().querySelector(ln).insertBefore(n,r.nextSibling)):t.remove(n),this.groupReorderHandler(e,i);var o=[].slice.call(this.parent.getContentTable().getElementsByClassName(Zi));qe(this.parent,s,o,i),this.parent.enableVirtualization?ze(this.parent):Be(this.parent,this.parent.getRowsObject().filter(function(e){return e.isDataRow}),o),this.parent.notify("refresh-Expand-and-Collapse",{rows:this.parent.getRowsObject()})}},e.prototype.groupReorderHandler=function(e,i){for(var n=this.parent,r=e.data,s=i.data,o=n.groupModule.getGroupAggregateTemplates(!1),a=[n.getRowObjectFromUID(i.parentUid)],l=[n.getRowObjectFromUID(e.parentUid)],d=n.groupSettings.columns,h=0;h<d.length;h++)r[d[parseInt(h.toString(),10)]]=s[d[parseInt(h.toString(),10)]],h>0&&(a.push(n.getRowObjectFromUID(a[h-1].parentUid)),l.push(n.getRowObjectFromUID(l[h-1].parentUid)));e.parentUid=i.parentUid,e.visible=i.visible,e.parentGid=i.parentGid,e.changes!==r&&(e.changes=r);var p=this.iterateGroupAggregates([{dragRowObjects:l,dropRowObjects:a}]),c=p.filter(function(e){return e.key===l[l.length-1].data.key||e.key instanceof Date&&e.key.toString()===l[l.length-1].data.key.toString()}),u=p.filter(function(e){return e.key===a[a.length-1].data.key||e.key instanceof Date&&e.key.toString()===a[a.length-1].data.key.toString()});p=[],t.isNullOrUndefined(c[0])||p.push(c[0]),t.isNullOrUndefined(u[0])||p.push(u[0]);for(var g=n.currentViewData,f=0;f<g.length;f++)t.isNullOrUndefined(c[0])&&g[parseInt(f.toString(),10)].key===l[l.length-1].data.key?(g.splice(f,1),f--):t.isNullOrUndefined(u[0])&&g[parseInt(f.toString(),10)].key===a[a.length-1].data.key?(g.splice(f,1),f--):t.isNullOrUndefined(c[0])||g[parseInt(f.toString(),10)].key!==c[0].key?t.isNullOrUndefined(u[0])||g[parseInt(f.toString(),10)].key!==u[0].key||(g[parseInt(f.toString(),10)]=u[0]):g[parseInt(f.toString(),10)]=c[0];for(var m=this.groupGenerator.generateRows(p,{}),y=[],v=[],f=0;f<l.length;f++)y.push.apply(y,this.getGroupParentFooterAggregateRowObject(l[parseInt(f.toString(),10)].uid));for(f=0;f<a.length;f++)v.push.apply(v,this.getGroupParentFooterAggregateRowObject(a[parseInt(f.toString(),10)].uid));l.push.apply(l,y),a.push.apply(a,v),this.updatedRowObjChange(l,m,o,!0),this.updatedRowObjChange(a,m,o),this.groupReorderRefreshHandler(l),this.groupReorderRefreshHandler(a)},e.prototype.updatedRowObjChange=function(e,i,n,r){var s=this.parent,o=s.getRowsObject(),a={},l=[];s.enableVirtualization&&(a=s.contentModule.vgenerator.cache,l=s.vcRows);for(var d=0;d<e.length;d++){for(var h=!1,p=e[parseInt(d.toString(),10)],c=0;c<i.length;c++){var u=i[parseInt(c.toString(),10)];if(!(t.isNullOrUndefined(u)||t.isNullOrUndefined(p.data.key)||t.isNullOrUndefined(u.data.key))&&(p.data.key===u.data.key||p.data.key instanceof Date&&p.data.key.toString()===u.data.key.toString())){var g=!0,f=e[parseInt((d+1).toString(),10)];if(r&&f&&!f.isAggregateRow){var m=f.data.key.toString(),y=f.data.field,v=u.data.items.records?u.data.items.records:u.data.items;v&&v.length&&v[0][""+y]&&v[0][""+y].toString()!==m&&(g=!1)}if(!g&&r)continue;-1!==(C=o.indexOf(p))&&(o[parseInt(C.toString(),10)].data=u.data,o[parseInt(C.toString(),10)].gSummary=u.gSummary),s.enableVirtualization&&-1!==(w=l.indexOf(p))&&(l[parseInt(w.toString(),10)].data=u.data,l[parseInt(w.toString(),10)].gSummary=u.gSummary),p.data=u.data,p.gSummary=["gSummary"],i.splice(c,1),c--,h=!0;break}if(p.isAggregateRow&&u.isAggregateRow){for(var S=0;S<n.length;S++)if(this.evaluateGroupAggregateValueChange(p,u,n[parseInt(S.toString(),10)])){var C=o.indexOf(p);if(-1!==C&&(o[parseInt(C.toString(),10)].data=u.data,o[parseInt(C.toString(),10)].gSummary=u.gSummary),s.enableVirtualization){var w=l.indexOf(p);-1!==w&&(l[parseInt(w.toString(),10)].data=u.data,l[parseInt(w.toString(),10)].gSummary=u.gSummary)}p.data=u.data,p.gSummary=u.gSummary,h=!0;break}if(h)break}}if(!h){var b=s.getRowElementByUID(p.uid);if(t.isNullOrUndefined(b)||t.remove(b),o.splice(o.indexOf(p),1),s.enableVirtualization){l.splice(l.indexOf(p),1);for(var I=1;I<=Object.keys(a).length;I++){var x=a[parseInt(I.toString(),10)].indexOf(p);-1!==x&&a[parseInt(I.toString(),10)].splice([parseInt(x.toString(),10)],1)}}s.enableInfiniteScrolling&&s.infiniteScrollSettings.enableCache&&s.infiniteScrollModule.resetInfiniteCache(o)}}},e.prototype.groupReorderRefreshHandler=function(e){for(var i=this.parent,n=new fn(i.serviceLocator,null,i),r=i.getColumns(),s=0;s<e.length;s++){var o=e[parseInt(s.toString(),10)];t.isNullOrUndefined(o.uid)||t.isNullOrUndefined(i.getRowElementByUID(o.uid))||n.refresh(o,r,!1)}},e.prototype.getGroupParentFooterAggregateRowObject=function(e){for(var t=this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&this.parent.groupSettings.columns.length?this.parent.contentModule.rows:this.parent.getRowsObject(),i=[],n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)];r.parentUid===e&&r.isAggregateRow&&i.push(r)}return i},e.prototype.evaluateGroupAggregateValueChange=function(e,t,i){var n=!1;return e.data[i.field].field===t.data[i.field].field&&e.data[i.field].key===t.data[i.field].key&&e.data[i.field].hasOwnProperty(i.field+" - "+i.type)&&t.data[i.field].hasOwnProperty(i.field+" - "+i.type)&&(n=!0),n},e.prototype.gettingVirtualData=function(e,i,n){for(var r=[],s=this,o=0;o<e.length;o++)!function(o){if(-1===i.indexOf(e[parseInt(o.toString(),10)].data)&&r.push(e[parseInt(o.toString(),10)].data),e[parseInt(o.toString(),10)].data.field===s.parent.groupSettings.columns[0]){var a=e[parseInt(o.toString(),10)].data.items;t.isNullOrUndefined(a.records)||(a=a.records);for(var l=0;l<a.length;l++)!function(e){n&&-1===i.findIndex(function(t){return t[n.toString()]===a[parseInt(e.toString(),10)][n.toString()]})&&r.push(a[parseInt(e.toString(),10)])}(l)}}(o);return r},e.prototype.iterateGroupAggregates=function(e){var n=this,r=e instanceof Array?e:[],s=this.parent.getRowsObject(),o=this.parent.getCurrentViewRecords().slice(),a=this.parent.getPrimaryKeyFieldNames()[0],l=e&&e.length?e[0]&&e[0].dragRowObjects:null,d=e&&e.length?e[0]&&e[0].dropRowObjects:null,h=null,p=null;!(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length)||t.isNullOrUndefined(l)&&t.isNullOrUndefined(d)||(l&&o.push.apply(o,this.gettingVirtualData(l,o,a)),d&&o.push.apply(o,this.gettingVirtualData(d,o,a)));var c=this.parent.enableInfiniteScrolling&&this.parent.allowGrouping&&e.length&&this.parent.groupSettings.columns.length&&!t.isNullOrUndefined(l)&&!t.isNullOrUndefined(d);c&&(o=[],h=d[d.length-1].data.key,p=l[l.length-1].data.key,this.parent.getRowsObject().map(function(e){var t=e.data[n.parent.groupSettings.columns[0]];e.isDataRow&&(t===h||t===p||t instanceof Date&&(t.toString()===h.toString()||t.toString()===p.toString()))&&o.push(e.data)}));var u=[],g=s.map(function(e){return"delete"===e.edit&&u.push(e.data),e.changes instanceof Object?e.changes:e.data});g=0===r.length?g:r;var f=o.map(function(e){var t,n=i.DataUtil.getObject(a,e);return g.some(function(e){return t=e,n===i.DataUtil.getObject(a,e)})?t:e}),m=e;if((!m.type||"cancel"!==m.type)&&u.length>0)for(F=0;F<u.length;F++){var y=f.indexOf(u[parseInt(F.toString(),10)]);f.splice(y,1)}for(var v=[],S=this.parent.aggregates,C=0;C<S.length;C++)for(var w=S[parseInt(C.toString(),10)],b=0;b<w.columns.length;b++)for(var I={},x=0,R=w.columns[parseInt(b.toString(),10)].type.toString().split(",").map(function(e){return e.trim()});x<R.length;x++)I={type:R[x].toLowerCase(),field:w.columns[parseInt(b.toString(),10)].field},v.push(I);for(var D,T,E=this.parent.groupSettings.columns,O=0;O<E.length;O++)T=D||f,D=i.DataUtil.group(T,E[parseInt(O.toString(),10)],v,null,null);if(c){var k=this.parent.currentViewData[this.parent.currentViewData.length-1].key;if(k instanceof Date&&(k.toString()===h.toString()||k.toString()===p.toString())||k===h||k===p){for(var A=[],F=0;F<D.length;F++)A.push(D[parseInt(F.toString(),10)]);var M=[],L=this.parent.getDataModule().generateQuery(!0);!function(e){for(var t=0;t<A.length;t++)M.push(new i.Predicate("field","==",A[parseInt(t.toString(),10)].field).and(n.parent.renderModule.getPredicate("key","equal",A[parseInt(t.toString(),10)].key)));e.where(i.Predicate.or(M))}(L);var P=this.parent.getDataModule().dataManager.executeLocal(L);this.parent.renderModule.updateGroupInfo(D,P)}}return D},e.prototype.updateExpand=function(e){for(var i=e.uid,n=e.isExpand,r=this.parent.getRowsObject(),s=0;s<r.length;s++){var o=r[parseInt(s.toString(),10)];if(o.uid===i||t.isNullOrUndefined(i)){o.isExpand=n;for(var a=s+1;a<r.length&&"break"!==function(e){var n=r[parseInt(e.toString(),10)],s=void 0;if(n.parentUid!==o.uid&&(s=r.filter(function(e){return e.uid===n.parentUid})[0]),n.parentUid===o.uid?n.visible=o.isExpand:t.isNullOrUndefined(s)||n.parentUid!==s.uid||(s.isExpand&&!0===s.visible?n.visible=!0:s.isExpand&&!1===s.visible&&(n.visible=!1)),t.isNullOrUndefined(i))return"break"}(a);a++);}}this.parent.notify($t,{rows:r,args:{isFrozen:!1,rows:r}})},e}(),Os=function(){function i(e,t){this.aria=new Dn,this.childRefs=[],this.parent=e,this.serviceLocator=t,this.focus=t.getService("focus"),this.addEventListener()}return i.prototype.addEventListener=function(){this.parent.isDestroyed||(t.EventHandler.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this),this.parent.on(hi,this.clickHandler,this),this.parent.on(pi,this.destroy,this),this.parent.on(di,this.keyPressHandler,this),this.parent.on("expandchildgrid",this.expand,this),this.parent.on(ci,this.refreshColSpan,this),this.parent.on(pi,this.destroyChildGrids,this),this.parent.on("destroy-child-grid",this.destroyChildGrids,this),this.parent.on(pi,this.detachDetailTemplate,this),this.parent.on("detach-detail-template",this.detachDetailTemplate,this))},i.prototype.clickHandler=function(e){!e.target.classList.contains("e-icon-grightarrow")&&!e.target.classList.contains("e-icon-gdownarrow")||this.parent.allowGrouping||e.preventDefault(),this.toogleExpandcollapse(t.closest(e.target,"td"),e)},i.prototype.auxilaryclickHandler=function(e){!e.target.classList.contains("e-icon-grightarrow")&&!e.target.classList.contains("e-icon-gdownarrow")||this.parent.allowGrouping||1!==e.button||e.preventDefault()},i.prototype.toogleExpandcollapse=function(i,n){this.l10n=this.serviceLocator.getService("localization");var r,s=this.parent,o=this.parent.getContentTable(),a=this.parent.getCurrentViewRecords().length-1,l=i&&i.classList.contains("e-detailrowcollapse");if(!(!i||!i.classList.contains("e-detailrowcollapse")&&!i.classList.contains("e-detailrowexpand")||i&&i.classList.contains("e-masked-cell"))){var d=i.parentElement,h=d.getAttribute("data-uid"),p=s.getRowObjectFromUID(h);if(!t.isNullOrUndefined(p)){var c=!1,u=this.parent.getContentTable().querySelector(ln).children[d.rowIndex+1];if(i.classList.contains("e-detailrowcollapse")){var g=p.data,f={rowData:g,parentRow:i.closest("tr"),cancel:!1,detailRow:this.isDetailRow(u)?u:null};if(t.isNullOrUndefined(n)||(f.event=n),!t.isNullOrUndefined(s.childGrid)&&(f.childGrid=s.childGrid,this.isDetailRow(u))){B=u.querySelector(".e-grid");f.childGridInstance=B?B.ej2_instances[0]:null}if(s.trigger("detailExpand",f),f.cancel)return;if(this.isDetailRow(u))u.style.display="",s.notify("detail-state-change",{data:g,childGrid:s.childGrid,detailElement:i,isExpanded:l}),c=!0;else if(s.getDetailTemplate()||s.childGrid){var m=z("grid-row"),y=this.parent.createElement("tr",{className:"e-detailrow",attrs:{"data-uid":m,role:"row"}}),v=this.parent.createElement("th",{className:"e-detailcell",attrs:{scope:"col",role:"columnheader"}}),S=this.parent.getVisibleColumns().length;this.parent.allowRowDragAndDrop&&S++,v.setAttribute("colspan",S.toString());var C=new ji({isDataRow:!0,isExpand:!0,uid:m,isDetailRow:!0,cells:[new Vi({cellType:e.CellType.Indent}),new Vi({isDataCell:!0,visible:!0})]});C.parentUid=p.uid;for(var w=0,b=s.groupSettings.columns.length;w<b;w++)y.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),C.cells.unshift(new Vi({cellType:e.CellType.Indent}));y.appendChild(this.parent.createElement("th",{className:"e-detailindentcell",attrs:{scope:"col"}})),y.appendChild(v),d.parentNode.insertBefore(y,d.nextSibling);var I=void 0,x=void 0;if(s.detailTemplate){I=this.parent.isReact&&"string"!=typeof s.detailTemplate&&!(s.detailTemplate.prototype&&s.detailTemplate.prototype.CSPTemplate),x=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;var R=this.parent.printGridParent&&this.parent.printGridParent.isReact,D=s.element.id+"detailTemplate";I||x||R?(s.getDetailTemplate()(g,s,"detailTemplate",D,null,null,v),this.parent.renderTemplates(function(){s.trigger("detailDataBound",{detailElement:v,data:g,childGrid:r})})):q(v,s.getDetailTemplate()(g,s,"detailTemplate",D,void 0,void 0,void 0,this.parent.root))}else{(r=new Wr(this.getGridModel(s,p,s.printMode))).height=s.enableInfiniteScrolling&&"auto"===r.height?300:r.height,r.root=s.root?s.root:s,this.childRefs.push(r),r.query&&(r.query=r.query.clone()),r.parentDetails={parentID:s.element.id,parentPrimaryKeys:s.getPrimaryKeyFieldNames(),parentKeyField:s.childGrid.queryString,parentKeyFieldValue:s.childGrid.queryString&&_(s.childGrid.queryString)?fe(s.childGrid.queryString,g):g[s.childGrid.queryString],parentRowData:g},s.isReact||s.isVue?r.parentDetails.parentInstObj=s:s.parentDetails&&s.parentDetails.parentInstObj&&(s.parentDetails.parentInstObj.isReact||s.parentDetails.parentInstObj.isVue)&&(r.parentDetails.parentInstObj=s.parentDetails.parentInstObj),s.printGridParent&&s.printGridParent.isReact&&(r.printGridParent=s.printGridParent),r.isLegacyTemplate=s.isReact||s.isLegacyTemplate,s.isPrinting&&(r.isPrinting=!0,r.on($t,this.promiseResolve(r),this),r.on(ti,this.promiseResolve(r),this)),p.childGrid=r;var T=r.getInjectedModules(),E=s.getInjectedModules();T&&T.length===E.length||r.setInjectedModules(E);var O=this.parent.createElement("div",{id:"child"+U(d,"e-grid").length+"_grid"+d.rowIndex+z(""),className:"e-childgrid"});v.appendChild(O),r.appendTo(O)}y.appendChild(v),d.nextSibling?d.parentNode.insertBefore(y,d.nextSibling):d.parentNode.appendChild(y);var k=s.getRows(),A=s.getRowsObject();if(k.splice(k.indexOf(d)+1,0,y),s.enableInfiniteScrolling&&s.infiniteScrollSettings.enableCache)for(var F=s.contentModule.infiniteCache,M=Object.keys(F),w=0;w<M.length;w++){var L=F[parseInt(M[parseInt(w.toString(),10)],10)].indexOf(p);if(-1!==L){F[parseInt(M[parseInt(w.toString(),10)],10)].splice(L+1,0,C);break}}else A.splice(A.indexOf(p)+1,0,C);I&&x||s.trigger("detailDataBound",{detailElement:v,data:g,childGrid:r}),s.notify("detailDataBound",{rows:A})}if(t.classList(i,["e-detailrowexpand"],["e-detailrowcollapse"]),t.classList(i.firstElementChild,["e-dtdiagonaldown","e-icon-gdownarrow"],["e-dtdiagonalright","e-icon-grightarrow"]),p.isExpand=!0,i.classList.contains("e-lastrowcell")&&this.parent.getContent().clientHeight>o.scrollHeight){t.removeClass(i.parentElement.querySelectorAll("td"),"e-lastrowcell");var P=o.querySelector(ln).getElementsByClassName("e-detailrow").length-1;t.addClass(o.querySelector(ln).getElementsByClassName("e-detailrow")[parseInt(P.toString(),10)].childNodes,["e-lastrowcell"]),this.lastrowcell=!0}this.aria.setExpand(i,!0),i.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded"))}else{if(this.isDetailRow(u)){var N={rowData:p.data,parentRow:i.closest("tr"),cancel:!1,detailRow:this.isDetailRow(u)?u:null};if(t.isNullOrUndefined(n)||(N.event=n),!t.isNullOrUndefined(s.childGrid)&&(N.childGrid=s.childGrid,this.isDetailRow(u))){var B=u.querySelector(".e-grid");N.childGridInstance=B?B.ej2_instances[0]:null}if(s.trigger("detailCollapse",N),N.cancel)return;u.style.display="none",s.notify("detail-state-change",{data:p.data,childGrid:s.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(d.getAttribute(an),10)-1===a&&this.lastrowcell&&(t.addClass(i.parentElement.querySelectorAll("td"),"e-lastrowcell"),this.lastrowcell=!1),p.isExpand=!1,c=!0,this.aria.setExpand(i,!1),i.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed"))}(!t.isNullOrUndefined(s.detailTemplate)||s.childGrid&&c)&&(s.updateVisibleExpandCollapseRows(),s.notify("refresh-Expand-and-Collapse",{rows:s.getRowsObject()})),this.parent.allowTextWrap&&"auto"===this.parent.height&&(this.parent.getContentTable().scrollHeight>this.parent.getContent().clientHeight?this.parent.scrollModule.setPadding():this.parent.scrollModule.removePadding())}}},i.prototype.getGridModel=function(e,i,n){var r;return e.isPrinting&&i.isExpand&&e.expandedRows&&e.expandedRows[i.index]&&e.expandedRows[i.index].gridModel?(e.expandedRows[i.index].gridModel.hierarchyPrintMode=e.childGrid.hierarchyPrintMode,r=t.extend({},e.expandedRows[i.index].gridModel,e.childGrid,!0)):r=t.extend({},{},e.childGrid,!0),e.isPrinting&&e.childGrid.allowPaging&&(r.allowPaging="CurrentPage"===n),r},i.prototype.promiseResolve=function(e){var t=this;return function(){e.off($t,t.promiseResolve),e.off(ti,t.promiseResolve),e.notify(Ei,{})}},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("."+Ki)||e.querySelector("."+Wi))&&(t.EventHandler.remove(this.parent.element,"auxclick",this.auxilaryclickHandler),this.parent.off(hi,this.clickHandler),this.parent.off(pi,this.destroy),this.parent.off(di,this.keyPressHandler),this.parent.off("expandchildgrid",this.expand),this.parent.off(ci,this.refreshColSpan),this.parent.off(pi,this.destroyChildGrids),this.parent.off("destroy-child-grid",this.destroyChildGrids),this.parent.off(pi,this.detachDetailTemplate),this.parent.off("detach-detail-template",this.detachDetailTemplate))},i.prototype.getTDfromIndex=function(e,i){var n=t.isNullOrUndefined(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)];return n&&n.querySelector(i)?n.querySelector(i):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(Ut,{requestType:"expandAllComplete",type:Ut,moduleObj:this})},i.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(Ut,{requestType:"collapseAllComplete",type:Ut,moduleObj:this})},i.prototype.expandCollapse=function(e){for(var t,i=this.parent.getDataRows(),n=0,r=i.length;n<r;n++)t=i[parseInt(n.toString(),10)].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),e?this.expand(t):this.collapse(t)},i.prototype.keyPressHandler=function(e){var t=this.parent;switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("downArrow"===e.action?e.action="ctrlDownArrow":"upArrow"===e.action&&(e.action="ctrlUpArrow")),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 n=t.getDataRows()[i[i.length-1]].querySelector(".e-detailrowcollapse, .e-detailrowexpand");"altDownArrow"===e.action?this.expand(n):this.collapse(n)}break;case"enter":if(this.parent.isEdit)return;var r=this.focus.getFocusedElement();if(r&&(r.classList.contains("e-icon-grightarrow")||r.classList.contains("e-icon-gdownarrow"))&&(r=r.parentElement),r&&!r.classList.contains("e-detailrowcollapse")&&!r.classList.contains("e-detailrowexpand"))break;this.toogleExpandcollapse(r,e)}},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[parseInt(i.toString(),10)].querySelector(".e-detailcell").setAttribute("colspan",t+"")},i.prototype.destroyChildGrids=function(e){var t=this.parent;if(t.enableInfiniteScrolling&&(t.childGrid||t.detailTemplate)&&"infiniteScroll"===e.requestType&&t.infiniteScrollSettings.enableCache){var i="down"===e.direction?e.currentPage-t.infiniteScrollSettings.initialBlocks:e.currentPage+t.infiniteScrollSettings.initialBlocks,n=t.contentModule.infiniteCache[parseInt(i.toString(),10)],r=n.filter(function(e){return e.isDetailRow&&e.parentUid});if(t.childGrid)for(var s=this,o=0;o<r.length;o++)!function(e){var i=t.getContentTable().querySelector('[data-uid="'+r[parseInt(e.toString(),10)].uid+'"]'),o=i.querySelector(".e-childgrid"),a=s.childRefs.findIndex(function(e){return e.element.id===o.id});s.childRefs[parseInt(a.toString(),10)].isDestroyed||(s.childRefs[parseInt(a.toString(),10)].destroy(),s.childRefs.splice(a,1));var l=n.indexOf(r[parseInt(e.toString(),10)]);n.splice(l,1),n[l-1].childGrid=null,n[l-1].isExpand=!1,i.remove()}(o);if(t.detailTemplate&&r.length){for(var a=[],o=0;o<r.length;o++)!function(e){a.push({detailRow:t.getContentTable().querySelector('[data-uid="'+r[parseInt(e.toString(),10)].uid+'"]'),detailRowObject:r[parseInt(e.toString(),10)],parentRowObject:n.find(function(t){return r[parseInt(e.toString(),10)].parentUid===t.uid})})}(o);this.parent.trigger("beforeDetailTemplateDetach",a,function(){for(var e=0;e<r.length;e++){var i=t.getContentTable().querySelector('[data-uid="'+r[parseInt(e.toString(),10)].uid+'"]'),s=n.indexOf(r[parseInt(e.toString(),10)]);n.splice(s,1),n[s-1].isExpand=!1,i.remove()}})}}else{for(var l=this.parent.getRowsObject(),o=0;o<l.length;o++)l[parseInt(o.toString(),10)].childGrid=null;for(o=0;o<this.childRefs.length;o++)this.childRefs[parseInt(o.toString(),10)].isDestroyed||this.childRefs[parseInt(o.toString(),10)].destroy();this.childRefs=[]}},i.prototype.detachDetailTemplate=function(){var e=this.parent;if(e.detailTemplate){var t=e.getRowsObject(),i=t.filter(function(e){return e.isDetailRow&&e.parentUid});if(i.length){var n=[];i.map(function(i){n.push({detailRow:e.getContentTable().querySelector('[data-uid="'+i.uid+'"]'),detailRowObject:i,parentRowObject:t.find(function(e){return i.parentUid===e.uid})})}),e.trigger("beforeDetailTemplateDetach",n,function(){i.map(function(t){e.getContentTable().querySelector('[data-uid="'+t.uid+'"]').remove()})})}}},i.prototype.getModuleName=function(){return"detailRow"},i}(),ks=function(){function i(e,t){this.predefinedItems={},this.isSearched=!1,this.items=["Add","Edit","Update","Delete","Cancel","Print","Search","ColumnChooser","PdfExport","ExcelExport","CsvExport","WordExport"],this.isRightToolbarMenu=!1,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=["Add","Edit","Update","Delete","Cancel","Print","PdfExport","ExcelExport","WordExport","CsvExport"],i=this.parent.enableAdaptiveUI,n=["Edit","Delete","Update","Cancel"],r=0,s=e;r<s.length;r++){var o=s[r],a=o.toLowerCase(),l=a[0].toUpperCase()+a.slice(1);this.predefinedItems[""+o]={id:this.gridID+"_"+a,prefixIcon:"e-"+a,text:this.l10n.getConstant(l),tooltipText:this.l10n.getConstant(l)},i&&(this.predefinedItems[""+o].text="",this.predefinedItems[""+o].visible=-1===n.indexOf(o))}this.predefinedItems.Search={id:this.gridID+"_search",tooltipText:this.l10n.getConstant("Search"),align:"Right",cssClass:"e-search-wrapper",type:"Input"},this.isRightToolbarMenu=!1,this.parent.enableAdaptiveUI&&this.isResponsiveToolbarMenuItems(!0)&&("Horizontal"===this.parent.rowRenderingMode||"Vertical"===this.parent.rowRenderingMode&&!this.parent.allowFiltering&&!this.parent.allowSorting)&&(this.isRightToolbarMenu=!0),i&&this.isResponsiveToolbarMenuItems(!1)?this.predefinedItems.responsiveToolbarItems={id:this.gridID+"_responsivetoolbaritems",cssClass:"e-responsive-toolbar-items e-menu-toolbar",suffixIcon:"e-responsivetoolbaritems-btn",align:this.isRightToolbarMenu?"Left":"Right"}:this.predefinedItems.ColumnChooser={id:this.gridID+"_columnchooser",cssClass:"e-cc e-ccdiv e-cc-toolbar",suffixIcon:"e-columnchooser-btn",text:i?"":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("FilterIcon")}),this.parent.allowSorting&&(this.predefinedItems.responsiveSort={id:this.gridID+"_responsivesort",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-ressort-icon",tooltipText:this.l10n.getConstant("SortIcon")})),this.parent.enableAdaptiveUI&&this.parent.toolbar&&this.parent.toolbar.some(function(e){return"object"==typeof e&&"Search"===e.text||"Search"===e})&&(this.predefinedItems.responsiveBack={id:this.gridID+"_responsiveback",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resback-icon",visible:!1}),this.createToolbar(),this.parent.enableAdaptiveUI&&(t.isNullOrUndefined(this.responsiveToolbarMenu)&&this.renderResponsiveToolbarpopup(),this.toolbar.element&&this.toolbar.refreshOverflow())},i.prototype.isResponsiveToolbarMenuItems=function(e){for(var t=e?["Add","Edit","Delete","Search"]:["Print","ColumnChooser","PdfExport","ExcelExport","CsvExport"],i=this.parent.toolbar||[],n=0;n<t.length;n++)if(i.indexOf(t[parseInt(n.toString(),10)])>=0)return!e;return!!e},i.prototype.getToolbar=function(){return this.toolbar.element},i.prototype.destroy=function(){if(this.toolbar&&!this.toolbar.isDestroyed){if(this.responsiveToolbarMenu&&this.responsiveToolbarMenu.destroy(),this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.unWireEvent(),this.removeEventListener(),this.toolbar.created=null,this.toolbar.clicked=null,this.toolbar.element?this.toolbar.destroy():(this.parent.destroyTemplate(["toolbarTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),this.parent.isAngular){this.toolbar.viewContainerRef=null,this.toolbar.registeredTemplate=null}this.element.parentNode&&(t.remove(this.element),this.toolbar=null)}},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){if(this.element.querySelector(".e-search-wrapper")){if(!this.parent.enableAdaptiveUI||e){var t=this.parent.cssClass?"e-input-group e-search "+this.parent.cssClass:"e-input-group e-search";this.element.querySelector(".e-search-wrapper").innerHTML='<div class="'+t+'" role="search"> <input id="'+this.gridID+'_searchbar" class="e-input e-search" name="input" type="search" placeholder= "'+this.l10n.getConstant("Search")+'"/> <span id="'+this.gridID+'_clearbutton" class="e-input-group-icon e-icons e-sicon" tabindex="-1" aria-label= "clear" role= "button" ></span> <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" title="'+this.l10n.getConstant("Search")+'" role= "search"></span> </div>'}else this.element.querySelector(".e-search-wrapper").innerHTML='<span id="'+this.gridID+'_clearbutton" class="e-input-group-icon e-icons e-sicon" tabindex="-1" role= "button" aria-label= "clear" ></span> <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" role= "button" title="'+this.l10n.getConstant("Search")+'"></span> </div>';this.element.querySelector("#"+this.gridID+"_clearbutton").style.cursor="default"}this.element.querySelector(".e-responsive-toolbar-items")&&(this.element.querySelector(".e-responsive-toolbar-items").innerHTML='<button id="'+this.gridID+'_responsivetoolbaritems" class="e-tbar-btn e-control e-btn e-lib e-icon-btn" type="button" data-ripple="true" tabindex="-1" data-tabindex="-1" aria-label="responsivetoolbaritems" aria-disabled="false" ><span class="e-btn-icon e-responsivetoolbaritems-btn e-icons"></span>',this.element.querySelector("#"+this.gridID+"_responsivetoolbaritems").style.width="auto"),this.bindSearchEvents()},i.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new l.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,created:this.toolbarCreated.bind(this),cssClass:this.parent.cssClass?this.parent.cssClass:""}),this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this);this.toolbar.isStringTemplate=!0;var t="viewContainerRef";if(this.parent[""+t]&&(this.toolbar.registeredTemplate={},this.toolbar[""+t]=this.parent[""+t]),this.element=this.parent.createElement("div",{id:this.gridID+"_toolbarItems"}),this.parent.enableAdaptiveUI&&this.element.classList.add("e-res-toolbar"),this.parent.toolbarTemplate){var i=this.parent.isVue||this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isVue;if("string"!=typeof this.parent.toolbarTemplate||i&&!document.querySelectorAll(this.parent.toolbarTemplate).length||!document.querySelector(this.parent.toolbarTemplate)||"script"===document.querySelector(this.parent.toolbarTemplate).tagName.toLowerCase()){var n=this.parent.isReact&&"string"!=typeof this.parent.toolbarTemplate&&!(this.parent.toolbarTemplate.prototype&&this.parent.toolbarTemplate.prototype.CSPTemplate),r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,s=this.parent.element.id+"toolbarTemplate";n||r?(x(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",s,null,null,this.element),this.parent.renderTemplates()):q(this.element,x(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",null,null,null,null,this.parent.root))}else this.toolbar.appendTo(this.parent.toolbarTemplate),this.element=this.toolbar.element;this.element.classList.add("e-temp-toolbar")}else this.toolbar.appendTo(this.element);this.parent.element.insertBefore(this.element,this.parent.getHeaderContent());var o=this.element.querySelector(".e-toolbar-left"),a=this.element.querySelector(".e-toolbar-center"),d=this.element.querySelector(".e-toolbar-right"),h=this.element.querySelector(".e-toolbar-items"),p=this.element,c=o?o.clientWidth:0,u=a?a.clientWidth:0,g=d?d.clientWidth:0,f=h?h.clientWidth:0,m=p?p.clientWidth:0;(c>m||u>m||g>m||f>m)&&this.toolbar.refreshOverflow()},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);var n=F(this.searchElement,"e-toolbar-right");n&&n.classList.add("e-responsive-right"),this.parent.searchSettings&&this.updateSearchBox()}else this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isInitial);this.toolbar.element&&this.toolbar.element.querySelector(".e-hscroll")&&this.toolbar.refreshOverflow(),i&&(this.searchBoxObj.searchFocus({target:this.searchElement}),this.searchElement.focus())},i.prototype.refreshResponsiveToolbarItems=function(t){if(t===e.ResponsiveToolbarAction.isInitial){for(var i=this.parent.element.id,n=[i+"_edit",i+"_delete"],r=this.parent.getSelectedRowIndexes(),s=[i+"_responsiveback",i+"_update",i+"_cancel"],o=0,a=this.toolbar.items;o<a.length;o++)(c=(p=a[o]).template&&p.template.length?F(this.toolbar.element.querySelector("#"+p.id),"e-template").children[0]:this.toolbar.element.querySelector("#"+p.id))&&(n.indexOf(p.id)>-1?r.length?c.parentElement.classList.remove("e-hidden"):c.parentElement.classList.add("e-hidden"):-1===s.indexOf(p.id)||s.indexOf(p.id)>0&&this.parent.isEdit?c.parentElement.classList.remove("e-hidden"):c.parentElement.classList.add("e-hidden"));if(this.searchElement){var l=F(this.searchElement,"e-toolbar-right");l&&l.classList.remove("e-responsive-right"),this.toolbarCreated(!1),this.unWireEvent(),this.searchElement=void 0}}if(t===e.ResponsiveToolbarAction.isSearch)for(var n=[this.parent.element.id+"_responsiveback",this.parent.element.id+"_search"],d=0,h=this.toolbar.items;d<h.length;d++){var p=h[d],c=this.toolbar.element.querySelector("#"+p.id);c&&(n.indexOf(p.id)>-1?c.parentElement.classList.remove("e-hidden"):c.parentElement.classList.add("e-hidden"))}},i.prototype.refreshToolbarItems=function(e){var i=this.parent,n=[],r=[],s=i.editSettings,o=i.currentViewData&&i.currentViewData.length||"Batch"===i.editSettings.mode&&!t.isNullOrUndefined(i.editModule)&&i.editModule.getBatchChanges().addedRecords.length,a=s.showAddNewRow&&!i.element.querySelector(".e-editedrow");s.allowAdding?n.push(this.gridID+"_add"):r.push(this.gridID+"_add"),s.allowEditing&&o?n.push(this.gridID+"_edit"):r.push(this.gridID+"_edit"),s.allowDeleting&&o?n.push(this.gridID+"_delete"):r.push(this.gridID+"_delete"),i.allowPdfExport&&o?n.push(this.gridID+"_pdfexport"):r.push(this.gridID+"_pdfexport"),i.allowExcelExport&&o?(n.push(this.gridID+"_excelexport"),n.push(this.gridID+"_csvexport")):(r.push(this.gridID+"_excelexport"),r.push(this.gridID+"_csvexport")),i.showColumnChooser?n.push(this.gridID+"_columnchooser"):r.push(this.gridID+"_columnchooser"),"Batch"===i.editSettings.mode?i.element.getElementsByClassName("e-updatedtd").length&&(s.allowAdding||s.allowEditing)?(n.push(this.gridID+"_update"),n.push(this.gridID+"_cancel")):(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")):(i.isEdit||s.showAddNewRow)&&(s.allowAdding||s.allowEditing)?(n=a?[this.gridID+"_update",this.gridID+"_cancel",this.gridID+"_edit",this.gridID+"_delete"]:[this.gridID+"_update",this.gridID+"_cancel"],r=a?[this.gridID+"_add"]:[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")),this.enableItems(n,!0),this.enableItems(r,!1)},i.prototype.getItems=function(){var e=[],t=this.parent.toolbar||[];if("string"==typeof this.parent.toolbar)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")));for(var i=0,n=t;i<n.length;i++){var r=n[i];if(!this.parent.enableAdaptiveUI||-1===["Print","ColumnChooser","PdfExport","ExcelExport","CsvExport"].indexOf(r))switch(this.parent.enableAdaptiveUI&&("object"==typeof r&&"Search"===r.text||"Search"===r)&&e.push(this.getItemObject("responsiveBack")),typeof r){case"number":e.push(this.getItemObject(this.items[r]));break;case"string":e.push(this.getItemObject(r));break;default:e.push(this.getItem(r))}}return this.parent.enableAdaptiveUI&&this.isResponsiveToolbarMenuItems(!1)&&e.push(this.getItemObject("responsiveToolbarItems")),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 n=0,r=e;n<r.length;n++){var s=r[n],o=t.select("#"+s,this.element);o&&this.toolbar.enableItems(o.closest(".e-toolbar-item"),i)}},i.prototype.toolbarClickHandler=function(e){var i=this,n=this.parent,r=this.gridID,s=e.originalEvent;if(this.parent.enableAdaptiveUI&&e.item.id===r+"_responsivetoolbaritems")this.openResponsiveToolbarMenuPopup(s,e.item.id);else{t.extend(e,{cancel:!1});var o=e;n.trigger("toolbarClick",o,function(e){if(e.originalEvent=e.originalEvent?e.originalEvent:s,!e.cancel)switch(!t.isNullOrUndefined(e.item)&&e.item.id){case r+"_print":n.print();break;case r+"_edit":n.startEdit();break;case r+"_update":n.endEdit();break;case r+"_cancel":n.closeEdit();break;case r+"_add":n.addRecord();break;case r+"_delete":n.deleteRecord();break;case r+"_search":e.originalEvent.target.id===r+"_searchbutton"&&i.searchElement?i.search():!n.enableAdaptiveUI||i.searchElement||!e.originalEvent.target.classList.contains("e-search-wrapper")&&e.originalEvent.target.id!==r+"_searchbutton"?e.originalEvent.target.classList.contains("e-clear-icon")&&e.originalEvent.target.id===r+"_clearbutton"&&i.searchElement&&(i.searchElement.value="",i.searchElement&&(i.sIcon=i.searchElement.parentElement.querySelector(".e-sicon"),i.sIcon.classList.remove("e-clear-icon"),i.sIcon.removeAttribute("title"),i.sIcon.style.cursor="default"),(i.isSearched||i.parent.searchSettings.key.length)&&(i.parent.search(i.searchElement.value),i.isSearched=!1)):i.renderResponsiveSearch(!0);break;case r+"_columnchooser":if(i.parent.enableAdaptiveUI)n.showResponsiveCustomColumnChooser();else{var o=i.parent.element.querySelector(".e-ccdiv"),a=o.getBoundingClientRect().top,l=o.getBoundingClientRect().left,d=e.originalEvent.target;a=o.getBoundingClientRect().top+o.offsetTop,n.createColumnchooser(l,a,d)}break;case r+"_responsivefilter":n.notify(Bi,{action:3}),n.showResponsiveCustomFilter();break;case r+"_responsivesort":n.notify(Bi,{action:2}),n.showResponsiveCustomSort();break;case r+"_responsiveback":i.renderResponsiveSearch(!1),i.toolbar.refreshOverflow()}})}},i.prototype.openResponsiveToolbarMenuPopup=function(e,i){var r={top:0,left:0};this.toolbarMenuElement.style.cssText="display:block;visibility:hidden";var s=this.toolbarMenuElement.getBoundingClientRect(),o=this.parent.element.getBoundingClientRect();this.toolbarMenuElement.style.cssText="display:none;visibility:visible";var a;a=t.isNullOrUndefined(e)?this.parent.element.querySelector("#"+i):e.target,this.parent.enableRtl?(r=n.calculatePosition(a,"left","bottom"),this.isRightToolbarMenu&&(r.left-=s.width)):(r=n.calculatePosition(a,"right","bottom"),this.isRightToolbarMenu||(r.left-=s.width),r.left+s.width+1>=o.right&&(r.left-=35)),this.responsiveToolbarMenu.open(r.top,r.left),e&&e.preventDefault&&e.preventDefault(),Re(this.parent.element,this.responsiveToolbarMenu.element.parentElement)},i.prototype.getMenuItems=function(){for(var e=[],t=0,i=this.parent.toolbar||[];t<i.length;t++){var n=i[t];"string"!=typeof n||"ColumnChooser"!==n&&"PdfExport"!==n&&"ExcelExport"!==n&&"CsvExport"!==n&&"Print"!==n||e.push({text:this.getLocaleText(n),id:this.gridID+"_"+n.toLowerCase(),iconCss:"e-btn-icon e-"+n.toLowerCase()+" e-icons"})}return e},i.prototype.getLocaleText=function(e){var t;return"ColumnChooser"===e?t=this.l10n.getConstant("Columnchooser"):"PdfExport"===e?t=this.l10n.getConstant("Pdfexport"):"ExcelExport"===e?t=this.l10n.getConstant("Excelexport"):"CsvExport"===e?t=this.l10n.getConstant("Csvexport"):"Print"===e&&(t=this.l10n.getConstant("Print")),t},i.prototype.renderResponsiveToolbarpopup=function(){this.l10n=this.serviceLocator.getService("localization"),this.toolbarMenuElement=this.parent.createElement("ul",{id:this.gridID+"__toolbaritemsmenu",className:"e-responsivetoolbar-menu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ToolbarMenuDialogARIA")),this.parent.element.appendChild(this.toolbarMenuElement),this.responsiveToolbarMenu=new l.ContextMenu({cssClass:this.parent.cssClass?"e-grid-toolbarmenu e-bigger "+this.parent.cssClass:"e-grid-toolbarmenu e-bigger",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,beforeOpen:this.beforeOpenResponsiveToolbarMenuItem.bind(this),items:this.getMenuItems(),select:this.ResponsiveToolbarMenuItemClick.bind(this)}),this.responsiveToolbarMenu.isAngular=Ge(this.parent),this.responsiveToolbarMenu.appendTo(this.toolbarMenuElement)},i.prototype.ResponsiveToolbarMenuItemClick=function(e){var i=this,n=this.parent,r=e.element;e.item.id=r.id;var s={cancel:!1,name:"clicked",item:e.item,originalEvent:e.event};n.trigger("toolbarClick",s,function(e){if(!e.cancel)switch(!t.isNullOrUndefined(e.item)&&e.item.id){case i.gridID+"_columnchooser":n.notify(Bi,{action:5}),n.showResponsiveCustomColumnChooser();break;case i.gridID+"_print":n.print()}})},i.prototype.beforeOpenResponsiveToolbarMenuItem=function(){var e=this,t=this.parent.toolbar||[],i=[],n=[];[{key:"PdfExport",enabled:this.parent.allowPdfExport},{key:"ExcelExport",enabled:this.parent.allowExcelExport},{key:"CsvExport",enabled:this.parent.allowExcelExport},{key:"ColumnChooser",enabled:this.parent.showColumnChooser}].forEach(function(r){if(-1!==t.indexOf(r.key)){var s=e.getLocaleText(r.key);r.enabled?i.push(s):n.push(s)}}),this.responsiveToolbarMenu.enableItems(i,!0),this.responsiveToolbarMenu.enableItems(n,!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.parent.searchModule.refreshSearch=!1,this.search()),this.searchElement&&(this.sIcon=this.searchElement.parentElement.querySelector(".e-sicon"),this.searchElement.value.length&&!t.isNullOrUndefined(this.sIcon)?(this.sIcon.classList.add("e-clear-icon"),this.sIcon.setAttribute("title",this.l10n.getConstant("Clear")),this.sIcon.style.cursor="pointer"):(this.sIcon.classList.remove("e-clear-icon"),this.sIcon.removeAttribute("title"),this.sIcon.style.cursor="default"))},i.prototype.search=function(){this.isSearched=!0,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 or(this.searchElement,this.serviceLocator),t.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent()),t.EventHandler.add(this.element,"focusin",this.onFocusIn,this),t.EventHandler.add(this.element,"focusout",this.onFocusOut,this)},i.prototype.unWireEvent=function(){this.searchElement&&(t.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),this.searchBoxObj.unWireEvent()),t.EventHandler.remove(this.element,"focusin",this.onFocusIn),t.EventHandler.remove(this.element,"focusout",this.onFocusOut)},i.prototype.onFocusIn=function(e){var i=this.parent.focusModule.currentInfo;i&&i.element&&(t.removeClass([i.element,i.elementToFocus],["e-focused","e-focus"]),i.element.tabIndex=-1),e.target.tabIndex=0},i.prototype.onFocusOut=function(e){e.target.tabIndex=-1,e.target&&e.target.id===this.parent.element.id+"_searchbar"&&(!e.relatedTarget||e.relatedTarget.id!==this.parent.element.id+"_clearbutton"&&e.relatedTarget.id!==this.parent.element.id+"_searchbutton")&&(this.parent.searchModule.refreshSearch=!1,this.search())},i.prototype.setFocusToolbarItem=function(e){var t=e.querySelector(".e-btn,.e-input,.e-toolbar-item-focus");!t&&this.parent.enableAdaptiveUI&&!this.searchElement&&e.classList.contains("e-search-wrapper")&&(t=e.querySelector("#"+this.gridID+"_searchbutton")),t.focus()},i.prototype.getFocusableToolbarItems=function(){for(var e=[].slice.call(this.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)")),i=[],n=0;n<e.length;n++)t.isNullOrUndefined(e[parseInt(n.toString(),10)].querySelector(".e-btn,.e-input,.e-toolbar-item-focus"))||i.push(e[parseInt(n.toString(),10)]);return i},i.prototype.keyPressedHandler=function(e){if(e.target&&F(e.target,"e-toolbar-item")){var t=F(e.target,"e-toolbar-item"),i=this.getFocusableToolbarItems();if("tab"===e.action||"shiftTab"===e.action){if("tab"===e.action&&t===i[i.length-1]||"shiftTab"===e.action&&t===i[0])return;for(var n=0;n<i.length;n++)if(t===i[parseInt(n.toString(),10)]){e.preventDefault();var r="tab"===e.action?n+1:n-1;return void this.setFocusToolbarItem(i[parseInt(r.toString(),10)])}}"enter"===e.action&&this.parent.enableAdaptiveUI&&!this.searchElement&&e.target.id===this.gridID+"_searchbutton"&&this.renderResponsiveSearch(!0)}},i.prototype.reRenderToolbar=function(){this.element&&t.remove(this.element),this.render()},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:"set-fullscreen-dialog",handler:this.reRenderToolbar},{event:Jt,handler:this.render},{event:ei,handler:this.onPropertyChanged},{event:ii,handler:this.updateSearchBox.bind(this)},{event:ni,handler:this.refreshToolbarItems},{event:"toolbar-refresh",handler:this.refreshToolbarItems},{event:ii,handler:this.modelChanged},{event:jt,handler:this.refreshToolbarItems},{event:hi,handler:this.removeResponsiveSearch},{event:"row-mode-change",handler:this.reRenderToolbar},{event:pi,handler:this.destroy},{event:di,handler:this.keyPressedHandler}],at(this.parent,this.evtHandlers,!0,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||(at(this.parent,this.evtHandlers,!1),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&&!F(e.target,"e-res-toolbar")&&this.renderResponsiveSearch(!1)},i.prototype.rowSelected=function(){this.parent.enableAdaptiveUI&&this.toolbar.element&&(this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isInitial),this.toolbar.refreshOverflow())},i.prototype.getModuleName=function(){return"toolbar"},i}(),As=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fs=function(e){function n(t,i){var n=e.call(this,t,i)||this;return n.aggregates={},n.parent=t,n.locator=i,n.modelGenerator=new vn(n.parent),n.addEventListener(),n}return As(n,e),n.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:Qi}),t=this.parent.createElement("div",{className:"e-summarycontent"});e.appendChild(t),this.setPanel(e),this.parent.allowPaging&&null!=this.parent.getPager()?this.parent.element.insertBefore(e,this.parent.getPager()):this.parent.element.appendChild(e)},n.prototype.renderTable=function(){var e=this.createContentTable("_footer_table").querySelector("."+Ji),t=this.parent.createElement("tfoot");e.appendChild(t),this.setTable(e)},n.prototype.renderSummaryContent=function(e,i,n,r){var s=this.parent.dataSource instanceof Array?!this.parent.getDataModule().isRemote()&&this.parent.parentDetails?this.getData():this.parent.dataSource:this.parent.currentViewData,o=this.modelGenerator.getData(),a=t.isNullOrUndefined(n)?this.modelGenerator.getColumns():this.modelGenerator.getColumns(n),l=t.isNullOrUndefined(n)?this.modelGenerator.generateRows(s,e||this.aggregates):this.modelGenerator.generateRows(s,e||this.aggregates,n,r),d=document.createDocumentFragment(),h=new fn(this.locator,null,this.parent);h.element=this.parent.createElement("TR",{className:"e-summaryrow",attrs:{role:"row"}});for(var p=0,c=o.length;p<c;p++){var u=l[parseInt(p.toString(),10)];if(u){var g=h.render(u,a);if(g.querySelectorAll(".e-leftfreeze").length&&g.querySelectorAll(".e-indentcell").length)for(var f=g.querySelectorAll(".e-indentcell"),m=0;m<f.length;m++)f[parseInt(m.toString(),10)].classList.add("e-leftfreeze"),Ye(f[parseInt(m.toString(),10)],30*m,this.parent.enableRtl,"Left");this.parent.isFrozenGrid()&&g.querySelectorAll(".e-summarycell").length&&t.removeClass([].slice.call(g.querySelectorAll(".e-summarycell")),["e-freezeleftborder","e-freezerightborder"]),d.appendChild(g)}}var y=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(this.parent.isReact||y)&&o.length&&this.parent.isInitialLoad?this.parent.renderTemplates(function(){i.tFoot.innerHTML="",i.tFoot.appendChild(d)}):i.tFoot.appendChild(d),this.aggregates=t.isNullOrUndefined(e)?this.aggregates:e},n.prototype.refresh=function(e){var i=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(this.parent.isReact||i)&&this.parent.isInitialLoad||(this.getTable().tFoot.innerHTML=""),this.renderSummaryContent(e,this.getTable(),void 0,void 0),t.isNullOrUndefined(e)&&this.parent.isAutoFitColumns&&this.parent.autoFitColumns(),this.onScroll()},n.prototype.refreshCol=function(){var e=this.parent.enableColumnVirtualization?this.parent.headerModule.getColGroup():this.parent.element.querySelector("."+Ki).querySelector(dn).cloneNode(!0);this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},n.prototype.onWidthChange=function(e){this.getColFromIndex(e.index).style.width=t.formatUnit(e.width),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},n.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},n.prototype.getColFromIndex=function(e){return this.getColGroup().children[parseInt(e.toString(),10)]},n.prototype.columnVisibilityChanged=function(){this.refresh()},n.prototype.addEventListener=function(){this.evtHandlers=[{event:ri,handler:this.refreshCol},{event:"column-width-changed",handler:this.onWidthChange},{event:"scroll",handler:this.onScroll},{event:ci,handler:this.columnVisibilityChanged},{event:"refresh-footer-rendered",handler:this.refreshFooterRenderer}],at(this.parent,this.evtHandlers,!0,this)},n.prototype.removeEventListener=function(){at(this.parent,this.evtHandlers,!1)},n.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},n.prototype.refreshFooterRenderer=function(e){var t=this.onAggregates(e);this.refresh(t)},n.prototype.getIndexByKey=function(e,t){for(var i=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)][""+i]===e[""+i])return n;return-1},n.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},n.prototype.onAggregates=function(e){e=e instanceof Array?e:[];var n=this.parent.getPrimaryKeyFieldNames()[0],r=[],s=!1,o={},a=!1;this.parent.renderModule.data.isRemote()||!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||!(this.parent.allowFiltering&&this.parent.filterSettings.columns.length||this.parent.searchSettings.key.length)||(a=!0);var l;if(l=!t.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result?this.parent.getCurrentViewRecords():this.parent.dataSource instanceof Array?a?this.parent.getFilteredRecords():this.parent.dataSource:this.parent.dataSource.dataSource.json.length?a?this.parent.getFilteredRecords():this.parent.dataSource.dataSource.json:this.parent.getCurrentViewRecords(),this.parent.parentDetails&&!this.parent.getDataModule().isRemote()&&(l=this.getData()),this.parent.editModule&&(o=this.parent.editModule.getBatchChanges()),Object.keys(o).length){for(u=0;u<l.length;u++)s=!1,o.changedRecords.length&&this.getIndexByKey(l[parseInt(u.toString(),10)],o.changedRecords)>-1&&(s=!0,r.push(o.changedRecords[this.getIndexByKey(l[parseInt(u.toString(),10)],o.changedRecords)])),o.deletedRecords.length&&this.getIndexByKey(l[parseInt(u.toString(),10)],o.deletedRecords)>-1?s=!0:s||r.push(l[parseInt(u.toString(),10)]);if(o.addedRecords.length)for(u=0;u<o.addedRecords.length;u++)r.push(o.addedRecords[parseInt(u.toString(),10)])}else r=e.length?(f=I(l)).map(function(t){var r,s=i.DataUtil.getObject(n,t);return e.some(function(e){return r=e,s===i.DataUtil.getObject(n,e)})?r:t}):l;var d=e;d.type&&"cancel"===d.type&&(r=l);for(var h,p={},c=this.parent.aggregates,u=0;u<c.length;u++)for(var g=0;g<c[parseInt(u.toString(),10)].columns.length;g++){var f=[];f=r;for(var m=0,y=c[parseInt(u.toString(),10)].columns[parseInt(g.toString(),10)].type.toString().split(",").map(function(e){return e.trim()});m<y.length;m++){var v=y[m];h=H(v,f,c[parseInt(u.toString(),10)].columns[parseInt(g.toString(),10)],this.parent),p[c[parseInt(u.toString(),10)].columns[parseInt(g.toString(),10)].field+" - "+v.toLowerCase()]=h}}return{result:r,count:r.length,aggregates:p}},n}(In),Ms=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ls=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-summarycell",attrs:{tabindex:"-1",role:"gridcell"}}),t}return Ms(i,e),i.prototype.getValue=function(e,i,n){var r=t.isNullOrUndefined(n.type)?n.columnName:n.field+" - "+("string"==typeof n.type?n.type.toLowerCase():"");return i[n.columnName]?i[n.columnName][""+r]:""},i.prototype.evaluate=function(e,i,n,r){var s=i.column;if(this.parent.on("refresh-aggregate-cell",this.refreshWithAggregate(e,i),this),!(s.footerTemplate||s.groupFooterTemplate||s.groupCaptionTemplate))return"Vertical"===this.parent.rowRenderingMode&&(e.style.display="none"),!0;"Vertical"===this.parent.rowRenderingMode&&e.classList.add("e-lastsummarycell");var o=s.getTemplate(i.cellType),a=this.parent.getColumnByField(n[s.columnName].field);if(!t.isNullOrUndefined(a)&&(n[s.columnName].headerText=a.headerText,a.isForeignColumn())){var l=a.columnData.filter(function(e){return e[a.foreignKeyField]===n[s.columnName].key})[0];l&&(n[s.columnName].foreignKey=l[a.foreignKeyValue])}var d=s.footerTemplate?"string"!=typeof s.footerTemplate&&!(s.footerTemplate.prototype&&s.footerTemplate.prototype.CSPTemplate):s.groupFooterTemplate?"string"!=typeof s.groupFooterTemplate&&!(s.groupFooterTemplate.prototype&&s.groupFooterTemplate.prototype.CSPTemplate):!!s.groupCaptionTemplate&&("string"!=typeof s.groupCaptionTemplate&&!(s.groupCaptionTemplate.prototype&&s.groupCaptionTemplate.prototype.CSPTemplate)),h=this.parent.isReact&&d,p=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact&&d,c=this.parent.printGridParent&&this.parent.printGridParent.isReact;if(h||p||c){var u=n[s.columnName];if("groupCaptionTemplate"===o.property||"groupFooterTemplate"===o.property){u.groupKey=u.key}o.fn(u,this.parent,o.property,"",null,null,e),this.parent.isInitialLoad||this.parent.renderTemplates()}else q(e,o.fn(n[s.columnName],this.parent,o.property,"",null,null,null,this.parent.root));return!1},i.prototype.refreshWithAggregate=function(e,i){var n=this,r=i;return function(i){var s=r,o=s.column.columnName?s.column.columnName:null,a=t.isNullOrUndefined(o)?null:i.cells.filter(function(e){return e.column.columnName===o})[0];e.parentElement&&e.parentElement.getAttribute("data-uid")===i.dataUid&&o&&a&&o===a.column.columnName&&n.refreshTD(e,a,i.data)}},i}(Rn),Ps=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,n=this.locator.getService("cellRendererFactory"),r=new Ls(this.parent,this.locator),s=[e.CellType.Summary,e.CellType.CaptionSummary,e.CellType.GroupSummary],o=0;o<s.length;o++)n.addCellRenderer(s[parseInt(o.toString(),10)],r);this.footerRenderer=new Fs(this.parent,this.locator),this.footerRenderer.renderPanel(),this.footerRenderer.renderTable();var a=this.footerRenderer.getPanel();this.parent.element.scrollHeight>=this.parent.getHeight(this.parent.height)&&a&&t.addClass([a],["e-footerpadding"]),this.locator.register("footerRenderer",this.footerRenderer);var l=function(){i.prepareSummaryInfo(),i.parent.off(Zt,l)};this.parent.on(Zt,l,this),this.parent.on(Zt,this.footerRenderer.refresh,this.footerRenderer)},i.prototype.prepareSummaryInfo=function(){var e=this;Ot(this.parent.aggregates,function(i){var n=t.getValue("customFormat",i);if(t.isNullOrUndefined(n)||i.setPropertiesSilent({format:n}),"object"==typeof i.format){var r=new Ft;i.setFormatter(r.getFormatFunction(t.extend({},i.format)))}else if("string"==typeof i.format){var s=e.locator.getService("valueFormatter");i.setFormatter(s.getFormatFunction({format:i.format}))}i.setPropertiesSilent({columnName:i.columnName||i.field})})},i.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){t.isNullOrUndefined(this.footerRenderer)&&this.initiateRender(),this.prepareSummaryInfo(),this.footerRenderer.refresh();var i=new Cn(this.parent);0===new Sn(this.parent).getData().length&&i.isEmpty()||this.parent.notify(ni,{})}},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Jt,this.initiateRender,this),this.parent.on(ei,this.onPropertyChanged,this),this.parent.on("refresh-aggregates",this.refresh,this),this.parent.on(pi,this.destroy,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.footerRenderer.removeEventListener(),this.parent.off(Jt,this.initiateRender),this.parent.off(Zt,this.footerRenderer.refresh),this.parent.off(ei,this.onPropertyChanged),this.parent.off("refresh-aggregates",this.refresh),this.parent.off(pi,this.destroy),this.parent.element.querySelector("."+Qi)&&t.remove(this.parent.element.querySelector("."+Qi)))},i.prototype.destroy=function(){this.removeEventListener()},i.prototype.refresh=function(e,t){var i=e instanceof Array?e:[e];this.parent.notify("refresh-footer-rendered",i),t&&(i.row=t),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",i)},i}(),Ns=function(){function e(e,t,i){var n=this;this.fromWheel=!1,this.touchMove=!1,this.options={},this.sentinelInfo={up:{check:function(e,t){var i=e.top-n.containerRect.top,r=n.containerRect.bottom>e.bottom?n.containerRect.bottom-e.bottom:0;return t.entered=i>=0,i+n.options.pageHeight/2>=0||r>0&&e.bottom>0},axis:"Y"},down:{check:function(e,t){var i=e.bottom;return t.entered=e.bottom<=n.containerRect.bottom,i-n.containerRect.top-n.options.pageHeight/2<=n.options.pageHeight/2},axis:"Y"},right:{check:function(e,t){var i=e.right;return t.entered=i<n.containerRect.right,i-n.containerRect.width<=n.containerRect.right},axis:"X"},left:{check:function(e,t){var i=e.left;return t.entered=i>0,i+n.containerRect.width>=n.containerRect.left},axis:"X"}},this.element=e,this.options=t,this.movableEle=i}return e.prototype.observe=function(e,i){var n=this;this.containerRect=this.options.container.getBoundingClientRect(),t.EventHandler.add(this.options.container,"wheel",function(){return n.fromWheel=!0},this),t.isNullOrUndefined(this.options.horizontalScrollbar)||(t.EventHandler.add(this.options.horizontalScrollbar,"wheel",function(){return n.fromWheel=!0},this),t.EventHandler.add(this.options.horizontalScrollbar,"scroll",this.onVirtualContentScroll(),this)),t.isNullOrUndefined(this.options.verticalScrollbar)||(t.EventHandler.add(this.options.verticalScrollbar,"wheel",function(){return n.fromWheel=!0},this),t.EventHandler.add(this.options.verticalScrollbar,"scroll",this.onVirtualContentScroll(),this)),t.EventHandler.add(this.options.container,"scroll",this.virtualScrollHandler(e,i),this)},e.prototype.check=function(e){var t=this.sentinelInfo[""+e];return t.check(this.element.getBoundingClientRect(),t)},e.prototype.onVirtualContentScroll=function(){var e=this;return function(t){t.target.classList.contains("e-virtual-vertical-scrollbar")&&(e.options.container.scrollTop=t.target.scrollTop),t.target.classList.contains("e-virtual-horizontal-scrollbar")&&(e.options.container.scrollLeft=t.target.scrollLeft)}},e.prototype.virtualScrollHandler=function(e,i){var n=this,r="chrome"===t.Browser.info.name?200:100,s=t.debounce(e,r),o=t.debounce(e,50);return this.options.prevTop=this.options.prevLeft=0,function(e){var r=e.target.scrollTop,a=e.target.scrollLeft,l=n.options.prevTop<r?"down":"up";l=n.options.prevLeft===a?l:n.options.prevLeft<a?"right":"left",n.options.prevTop=r,n.options.prevLeft=a,t.isNullOrUndefined(n.options.verticalScrollbar)||(n.options.verticalScrollbar.scrollTop=n.options.container.scrollTop),t.isNullOrUndefined(n.options.horizontalScrollbar)||(n.options.horizontalScrollbar.scrollLeft=n.options.container.scrollLeft);var d=n.sentinelInfo[""+l];if(-1!==n.options.axes.indexOf(d.axis)){n.containerRect=n.options.container.getBoundingClientRect();var h=n.check(l);if(d.entered&&i(n.element,d,l,{top:r,left:a},n.fromWheel,h),h){var p=s;"X"===d.axis&&(p=o),p({direction:l,sentinel:d,offset:{top:r,left:a},focusElement:document.activeElement})}n.fromWheel=!1}}},e.prototype.setPageHeight=function(e){this.options.pageHeight=e},e}(),Bs=function(){function e(e){this.cOffsets={},this.cache={},this.rowCache={},this.data={},this.groups={},this.currentInfo={},this.prevInfo={},this.parent=e,this.model=this.parent.pageSettings,this.rowModelGenerator=this.parent.allowGrouping?new bn(this.parent):new mn(this.parent)}return e.prototype.columnInfiniteRows=function(e,t){var i=[];if("virtualscroll"===t.requestType){var n=this.parent.getRowsObject();if(i.push.apply(i,this.rowModelGenerator.refreshRows(n)),this.parent.infiniteScrollSettings.enableCache){var r=this.parent.frozenRows&&1===this.parent.pageSettings.currentPage?0:yt(this.parent.getContentTable().querySelector(".e-row:not(.e-addedrow)")),s=i.slice(r,r+3*this.parent.pageSettings.pageSize);this.parent.frozenRows&&1!==this.parent.pageSettings.currentPage&&(s=i.slice(0,this.parent.frozenRows).concat(s)),i=s}}else i.push.apply(i,this.rowModelGenerator.generateRows(e,t));return i},e.prototype.generateRows=function(e,i){var n=this;if(this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling)return this.columnInfiniteRows(e,i);var r=!1,s=i.virtualInfo=i.virtualInfo||("sorting"===i.requestType||"delete"===i.requestType)&&xt(this.parent)&&this.prevInfo||this.getData();this.prevInfo=s;var o=s.sentinelInfo&&"X"===s.sentinelInfo.axis,a=o||!s.loadNext||s.loadSelf?s.page:s.nextInfo.page,l=[],d=this.getBlockIndexes(a),h=[];if(this.currentInfo.blockIndexes&&(d=s.blockIndexes=i.virtualInfo.blockIndexes=this.includePrevPage?this.currentInfo.blockIndexes.slice(1):this.currentInfo.blockIndexes.slice(0,this.currentInfo.blockIndexes.length-1),r=!0),this.checkAndResetCache(i.requestType),"pin-row"!==i.requestType&&"unpin-row"!==i.requestType||(this.startIndex=null),ge(this.parent)&&this.parent.vcRows.length){var p=this.parent.vcRows.filter(function(e){return e.isDataRow});if(this.parent.isManualRefresh&&p.length===e.records.length||!this.parent.isManualRefresh)return l=this.parent.vcRows}if(this.parent.enableColumnVirtualization)for(g=0;g<s.blockIndexes.length;g++)this.isBlockAvailable(s.blockIndexes[parseInt(g.toString(),10)])&&(this.cache[s.blockIndexes[parseInt(g.toString(),10)]]=this.rowModelGenerator.refreshRows(this.cache[s.blockIndexes[parseInt(g.toString(),10)]]));for(var c=s.blockIndexes,u=this,g=0;g<c.length;g++)!function(n){if(!u.isBlockAvailable(c[parseInt(n.toString(),10)])){var a=t.isNullOrUndefined(u.startIndex)||isNaN(u.startIndex)?u.getStartIndex(c[parseInt(n.toString(),10)],e):u.startIndex;a=!ge(u.parent)||u.parent.vcRows.length||"sorting"!==i.requestType&&"delete"!==i.requestType&&"refresh-aggregate-on-save"!==i.requestType?a:0;var p=u.rowModelGenerator.generateRows(e,{virtualInfo:s,startIndex:a});ge(u.parent)&&!u.parent.vcRows.length&&(u.recordsCount=e.records.length,u.parent.vRows=p,u.parent.vcRows=p,u.parent.notify("refresh-virtual-max-page",{}));var g=void 0;if(ge(u.parent))u.getGroupVirtualRecordsByIndex(p);else if(r)u.setBlockForManualRefresh(u.cache,d,p);else if(("sorting"===i.requestType||"delete"===i.requestType||u.parent.isTreeGrid&&u.parent.getDataModule().isRemote()&&"refresh"===i.requestType)&&xt(u.parent))for(var f=Rt(s.blockIndexes),m=0,y=0;y<f.length;y++){var v=u.getBlockIndexes(f[parseInt(y.toString(),10)]),S=u.model.pageSize*y,C=S+u.model.pageSize;if(u.parent.allowGrouping&&u.parent.groupSettings.columns.length){var w=p.filter(function(e){return e.isDataRow}).slice(S,C);S=m,C=p.indexOf(w[w.length-1])+1}var b=p.slice(S,C),I=~~Math.max(b.length,u.model.pageSize)/2;u.isBlockAvailable(v[0])||(u.cache[v[0]]=b.slice(0,I)),u.isBlockAvailable(v[1])||(u.cache[v[1]]=b.slice(I)),m=C}else g=~~Math.max(p.length,u.model.pageSize)/2,u.isBlockAvailable(d[0])||(u.cache[d[0]]=p.slice(0,g)),u.isBlockAvailable(d[1])||(u.cache[d[1]]=p.slice(g))}if(u.parent.groupSettings.columns.length&&!o&&u.cache[c[parseInt(n.toString(),10)]]&&!u.parent.groupSettings.enableLazyLoading&&(u.cache[c[parseInt(n.toString(),10)]]=u.updateGroupRow(u.cache[c[parseInt(n.toString(),10)]],c[parseInt(n.toString(),10)])),!i.renderMovableContent&&!i.renderFrozenRightContent&&u.cache[c[parseInt(n.toString(),10)]]){l.push.apply(l,u.cache[c[parseInt(n.toString(),10)]]);var x=[];u.parent.enableVirtualization&&u.parent.groupSettings.columns.length&&l.forEach(function(e){x.includes(e)||x.push(e)}),l=x.length?x:l}u.isBlockAvailable(c[parseInt(n.toString(),10)])&&h.push(c[parseInt(n.toString(),10)])}(g);if(ge(this.parent)&&this.parent.vcRows.length&&"sorting"===i.requestType&&0!==i.scrollTop.top)return l=this.parent.vcRows;s.blockIndexes=h;return this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.parent.groupSettings.enableLazyLoading?l.filter(function(e){e.isDataRow&&(n.parent.currentViewData[e.index]=e.data)}):this.parent.currentViewData.records=l.map(function(e){return e.data}):this.parent.currentViewData=l.map(function(e){return e.data}),"grouping"===i.requestType&&(this.parent.currentViewData.records=this.parent.currentViewData.records.filter(function(e,t){return n.parent.currentViewData.records.indexOf(e)===t})),ge(this.parent)&&this.parent.vcRows.length&&["save","delete","refresh-aggregate-on-save"].some(function(e){return i.requestType===e})?l=this.parent.vcRows:l},e.prototype.generatePinnedTopRows=function(e){return this.rowModelGenerator.generatePinnedTopRows(e)},e.prototype.setBlockForManualRefresh=function(e,t,i){var n=this.model.pageSize/2;this.includePrevPage?(e[t[0]-1]=i.slice(0,n),e[t[0]]=i.slice(n,2*n),e[t[1]]=i.slice(2*n,3*n),e[t[2]]=i.slice(3*n,4*n)):(e[t[0]]=i.slice(0,n),e[t[1]]=i.slice(n,2*n),e[t[2]]=i.slice(2*n,3*n),e[t[2]+1]=i.slice(3*n,4*n))},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.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 n=e%2==0,r=(this.getPage(e)-1)*this.model.pageSize+this.parent.pinnedTopRowModels.length;return i||!n?r:r+~~(this.model.pageSize/2)},e.prototype.getColumnIndexes=function(e){var i=this;void 0===e&&(e=this.parent.getHeaderContent().querySelector("."+Xi));var n=[],r=0|e.scrollLeft,s=Object.keys(this.cOffsets),o=e.getBoundingClientRect().width;r=Math.min(this.cOffsets[s.length-1]-o,r);var a=t.Browser.isDevice?2*o:o/2,l=r+o+(0===r?a:0),d=0,h=r-a;if(this.parent.isFrozenGrid()){if(d=this.parent.leftrightColumnWidth("left"),h>0)for(var p=this.parent.getVisibleFrozenLeftCount()-1;p>=0;p--)if(h<=this.cOffsets[parseInt(p.toString(),10)]){d-=this.cOffsets[parseInt(p.toString(),10)];break}if(this.parent.getFrozenMode()===nn){var c=this.parent.getVisibleFrozenRightCount();s.splice(s.length-1-c,c)}}var u=this.parent.getVisibleFrozenLeftCount();return s.some(function(e){var t=Number(e),r=i.cOffsets[""+e];return(h<0&&t<u||h+d<=r&&l+a>=r)&&n.push(t),l+a<r}),n},e.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","grouping","ungrouping","reorder","save","delete","refresh-aggregate-on-save","pin-row","unpin-row"].some(function(t){return e===t});return t&&(this.cache={},this.data={},this.groups={}),t},e.prototype.refreshColOffsets=function(){var e=this,t=0;this.cOffsets={};for(var i=this.parent.groupSettings.columns.length,n=this.parent.getVisibleColumns(),r=n.length,s=this.parent.groupSettings.columns,o=0;o<s.length;o++)this.cOffsets[parseInt(o.toString(),10)]=30+(0|this.cOffsets[o-1]);for(var a=Array.apply(null,Array(r)).map(function(){return t++}),l=0;l<a.length;l++)a[parseInt(l.toString(),10)]=a[parseInt(l.toString(),10)]+i,this.cOffsets[a[parseInt(l.toString(),10)]]=(0|this.cOffsets[a[parseInt(l.toString(),10)]-1])+(function(t){return t.visible&&(e.parent.groupSettings.showGroupedColumn?t.visible:e.parent.groupSettings.columns.indexOf(t.field)<0)}(n[parseInt(l.toString(),10)])?parseInt(n[parseInt(l.toString(),10)].width,10):0)},e.prototype.updateGroupRow=function(e,t){for(var i=e[0],n=[],r=Object.keys(this.cache),s=0;s<r.length;s++)Number(r[parseInt(s.toString(),10)])<t&&(n=n.concat(this.cache[r[parseInt(s.toString(),10)]]));return i&&i.isDataRow||t%2==0?e:this.iterateGroup(e,n)},e.prototype.iterateGroup=function(e,t){var i=e[0],n=0;return i&&i.isDataRow?e:(e.some(function(e){return t.some(function(t,i){var r=t&&void 0!==t.data.field&&t.data.field===e.data.field&&t.data.key===e.data.key;return r&&(n=i),r})})&&(e.shift(),e=this.iterateGroup(e,t.slice(n))),e)},e.prototype.getRows=function(){for(var e=[],t=Object.keys(this.cache),i=0;i<t.length;i++)e=e.concat(this.cache[t[parseInt(i.toString(),10)]]);return e},e.prototype.generateCells=function(e){for(var t=[],i=this.parent.columnModel,n=0;n<i.length;n++)t.push(this.rowModelGenerator.generateCell(i[parseInt(n.toString(),10)],null,null,null,null,e));return t},e.prototype.getGroupVirtualRecordsByIndex=function(e){var t=this.parent.contentModule.getGroupedTotalBlocks(),i=this.parent.contentModule.getBlockSize();if(0===Object.keys(this.cache).length)for(var n=0,r=1;r<=t;r++){var s=0;this.cache[parseInt(r.toString(),10)]=[];for(var o=(r-1)*i+n;o<e.length&&s!==i;o++)this.cache[parseInt(r.toString(),10)].push(e[parseInt(o.toString(),10)]),e[parseInt(o.toString(),10)].isDataRow&&s++,n++;n-=s}},e}(),zs=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qs=function(n){function r(e,t){var i=n.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 Hs,i.offsetKeys=[],i.isFocused=!1,i.isSelection=!1,i.isBottom=!1,i.isBottomNotify=!1,i.diff=0,i.heightChange=!1,i.isTop=!1,i.empty=void 0,i.isCancel=!1,i.requestTypes=["beginEdit","cancel","delete","add","save","sorting","columnstate"],i.isNormaledit="Normal"===i.parent.editSettings.mode,i.virtualData={},i.virtualInfiniteData={},i.emptyRowData={},i.isContextMenuOpen=!1,i.isSelectionScroll=!1,i.validationCheck=!1,i.firstCellFocus=!1,i.prevPage=0,i.prevCurrentInfo={},i.locator=t,i.eventListener("on"),i.widthServices=t.getService("widthService"),i.parent.on(ci,i.setVisible,i),i.vgenerator=i.generator,i}return zs(r,n),r.prototype.renderTable=function(){this.header=this.locator.getService("rendererFactory").getRenderer(e.RenderType.Header),n.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.gridContent=this.parent.element.querySelector("."+Wi),this.virtualEle.content=this.content=this.getPanel().querySelector("."+Yi),this.virtualEle.renderWrapper(this.parent.height),this.virtualEle.renderPlaceHolder(),this.parent.enableSeamlessScrolling&&(this.parent.enableVirtualization&&this.virtualEle.renderVerticalScrollbar(),this.parent.enableColumnVirtualization&&Number(this.widthServices.getTableWidth(this.parent.getColumns()))>this.content.clientWidth&&this.virtualEle.renderHorizontalScrollbar()),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(this.virtualEle.wrapper.style.position="absolute");var t=this.parent.dataSource instanceof i.DataManager&&!this.parent.dataSource.dataSource.offline,r={container:this.content,pageHeight:2*this.getBlockHeight(),debounceEvent:t,axes:this.parent.enableColumnVirtualization?["X","Y"]:["Y"],verticalScrollbar:this.virtualEle.verticalScrollbar,horizontalScrollbar:this.virtualEle.horizontalScrollbar};this.observer=new Ns(this.virtualEle.wrapper,r)},r.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(ln).innerHTML=""),this.virtualEle.adjustTable(0,0)},r.prototype.getReorderedFrozenRows=function(e){var t=e.virtualInfo.blockIndexes,i=e.virtualInfo.columnIndexes,n=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.virtualInfo.columnIndexes=[];var r=this.parent.getCurrentViewRecords().length,s=this.parent.renderModule.data.dataManager.dataSource.json.slice(0,r),o=this.vgenerator.generateRows(s,e);return e.virtualInfo.blockIndexes=t,e.virtualInfo.columnIndexes=i,e.virtualInfo.page=n,o.splice(0,this.parent.frozenRows)},r.prototype.scrollListener=function(e){if((this.parent.enableVirtualization||!this.parent.enableColumnVirtualization||"up"!==e.direction&&"down"!==e.direction)&&!this.isBottomNotify){if(this.scrollAfterEdit(),this.parent.enablePersistence&&(this.parent.scrollPosition=e.offset),this.preventEvent||this.parent.isDestroyed)return void(this.preventEvent=!1);if(t.isNullOrUndefined(document.activeElement)?this.isFocused=!1:this.isFocused=this.content===t.closest(document.activeElement,"."+Yi)||this.content===document.activeElement,this.parent.islazyloadRequest&&"down"===e.direction)return this.parent.removeMaskRow(),void(this.parent.islazyloadRequest=!1);var i=e.sentinel,n=this.currentInfo=this.getInfoFromView(e.direction,i,e.offset);if(ge(this.parent))return n.blockIndexes&&this.prevInfo.blockIndexes.toString()===n.blockIndexes.toString()?void this.parent.removeMaskRow():(n.event="refresh-virtual-block",t.isNullOrUndefined(n.offsets)||(n.offsets.top=this.content.scrollTop),this.parent.pageSettings.currentPage=n.page,this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(i.axis),this.parent.addShimmerEffect()),this.parent.editSettings.showAddNewRow&&this.parent.closeEdit(),void this.parent.notify(n.event,{requestType:"virtualscroll",virtualInfo:n,focusElement:e.focusElement}));if(this.prevInfo&&("Y"===i.axis&&this.prevInfo.blockIndexes.toString()===n.blockIndexes.toString()||"X"===i.axis&&this.prevInfo.columnIndexes.toString()===n.columnIndexes.toString()||this.parent.isFrozenGrid()&&"X"===i.axis&&this.parent.getVisibleFrozenLeftCount()>=n.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(n.columnIndexes.toString())))return this.parent.removeMaskRow(),t.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,"Y"===i.axis&&this.restoreEdit(),void(this.parent.groupSettings.enableLazyLoading&&1===this.prevInfo.blockIndexes[0]&&1===n.blockIndexes[0]&&"up"===e.direction&&this.virtualEle.adjustTable(0,n.offsets.top<this.offsets[1]?0:this.getBlockHeight()));if(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?n.columnIndexes:[]),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(this.parent.pageSettings.currentPage=n.loadNext&&!n.loadSelf?n.nextInfo.page:n.page),this.requestType="virtualscroll",this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(i.axis),this.parent.addShimmerEffect()),this.parent.islazyloadRequest=!1,this.parent.editSettings.showAddNewRow&&this.parent.closeEdit(),this.parent.notify("render-Responsive-Column-Chooser-Div",{action:"clear"}),this.parent.isInitialLoad||!this.parent.enablePersistence){if(this.prevPage===this.parent.pageSettings.currentPage&&n.event===ni)return void(this.currentInfo=this.prevCurrentInfo);n.event===ni&&(this.prevPage=this.parent.pageSettings.currentPage,this.prevCurrentInfo=this.currentInfo),this.isBottomNotify=this.isBottom&&n.event===ni,this.parent.notify(n.event,{requestType:"virtualscroll",virtualInfo:n,focusElement:e.focusElement})}this.parent.enableColumnVirtualization&&!this.parent.getContentTable().querySelector("tr.e-row")&&(this.parent.removeMaskRow(),this.appendContent(void 0,void 0,{requestType:"virtualscroll",virtualInfo:n,focusElement:e.focusElement}),this.prevInfo=n)}},r.prototype.block=function(e){return this.vgenerator.isBlockAvailable(e)},r.prototype.getInfoFromView=function(e,t,i){var n=!1,r=[],s={direction:e,sentinelInfo:t,offsets:i,startIndex:this.preStartIndex,endIndex:this.preEndIndex};s.page=this.getPageFromTop(i.top,s),s.blockIndexes=r=this.vgenerator.getBlockIndexes(s.page),s.loadSelf=!this.vgenerator.isBlockAvailable(r[s.block]);var o=this.ensureBlocks(s);if("upArrow"===this.activeKey&&s.blockIndexes.toString()!==o.toString()){var a=o[o.length-1];-1===s.blockIndexes.indexOf(a)&&(n=!0)}if(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(s.blockIndexes=o),s.loadNext=!o.filter(function(e){return-1===r.indexOf(e)}).every(this.block.bind(this)),s.event=s.loadNext||s.loadSelf?ni:Si,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&&!isNaN(this.rowIndex)){var l=Math.ceil(this.rowIndex/this.getBlockSize());if(1!==l&&(s.blockIndexes[1]!==l||s.blockIndexes.length<3)&&(s.blockIndexes=[l-1,l,l+1],s.loadNext)){for(var d=this.vgenerator.getBlockIndexes(s.nextInfo.page),h=!1,p=0;p<s.blockIndexes.length;p++){for(var c=0;c<d.length;c++)if(s.blockIndexes[parseInt(p.toString(),10)]===d[parseInt(c.toString(),10)]){h=!0;break}if(h)break}h||(s.loadNext=!1,s.nextInfo={},s.event=Si)}}return s.columnIndexes="X"===t.axis?this.vgenerator.getColumnIndexes():this.parent.getColumnIndexesInView(),this.parent.enableColumnVirtualization&&"X"===t.axis&&(s.event=Si),s},r.prototype.ensureBlocks=function(e){var t,i=this,n=e.blockIndexes[e.block],r=n,s=Math.max,o="down"===e.direction?[s(n,1),++n,++n]:[s(n-1,1),n,n+1];this.prevInfo=this.prevInfo||this.vgenerator.getData(),o=o.filter(function(e,t){return o.indexOf(e)===t});var a=!1;return xt(this.parent)&&"up"===e.direction&&((e.page+1===this.prevInfo.page||e.page===this.prevInfo.page)&&(1===e.block||0===e.block&&1===e.page)||e.page===this.prevInfo.page&&2===o.length)&&this.vgenerator.isBlockAvailable(e.blockIndexes[1]+1)&&(a=e.page+1===this.prevInfo.page&&1===e.block,o=[s((n+=1)-1,1),n,n+1]),this.prevInfo.blockIndexes.toString()===o.toString()?o:((e.loadSelf&&!a||"down"===e.direction&&this.isEndBlock(r))&&(o=this.vgenerator.getBlockIndexes(e.page)),o.some(function(e,n){var r=e===(ge(i.parent)?i.getGroupedTotalBlocks():i.getTotalBlocks());return r&&(t=n),r}),void 0!==t&&(o=o.slice(0,t+1),0===e.block&&1===o.length&&this.vgenerator.isBlockAvailable(o[0]-1)&&(o=[o[0]-1,o[0]])),o)},r.prototype.appendContent=function(e,i,n){var r=this,s=n.virtualInfo.sentinelInfo&&"Y"===n.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==n.virtualInfo.page?this.currentInfo:n.virtualInfo;this.prevInfo=this.prevInfo||n.virtualInfo;var o,a=s.columnIndexes[0]-1,l=this.getColumnOffset(a),d=s.blockIndexes;this.parent.groupSettings.columns.length&&this.refreshOffsets(),"100%"===this.parent.height&&(this.parent.element.style.height="100%");var h=this.parent.height.toString().indexOf("%")<0?this.content.getBoundingClientRect().height:this.parent.element.getBoundingClientRect().height;!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(h=0);var p=0;if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()){var c=0;this.parent.getColumns().filter(function(e){e.visible&&(p+=parseInt(e.width.toString(),10),"Left"===e.freeze&&(c+=parseInt(e.width.toString(),10)))});g=s.columnIndexes;o=this.getColumnOffset(g[g.length-1])-this.getColumnOffset(g[0]-1)+"",a>this.parent.getVisibleFrozenLeftCount()&&(l-=c),this.resetStickyLeftPos(l,i)}if(!this.requestTypes.some(function(e){return e===r.requestType})){var u=this.getTranslateY(this.content.scrollTop,h,s);this.parent.groupSettings.enableLazyLoading&&s&&this.prevInfo&&1===this.prevInfo.blockIndexes[0]&&1===s.blockIndexes[0]&&"up"===s.direction?this.virtualEle.adjustTable(0,this.content.scrollTop<this.offsets[1]?0:this.getBlockHeight()):this.virtualEle.adjustTable(l,u)}if(this.parent.enableColumnVirtualization&&this.header.virtualEle.adjustTable(l,0),this.parent.enableColumnVirtualization){var g=s.columnIndexes;o=this.getColumnOffset(g[g.length-1])-this.getColumnOffset(g[0]-1)+"",this.parent.isFrozenGrid()&&(o=p.toString(),this.parent.allowResizing&&(this.parent.getHeaderTable().style.width=p+"px",this.parent.getContentTable().style.width=p+"Px")),this.header.virtualEle.setWrapperWidth(o)}if(this.virtualEle.setWrapperWidth(o,t.Browser.isIE||"edge"===t.Browser.info.name),!(this.parent.enableColumnVirtualization&&t.isNullOrUndefined(e)&&t.isNullOrUndefined(i))){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.parentNode)||t.remove(e);var f=this.parent.element.querySelector("."+Yi).querySelector(ln);if(f&&(t.remove(f),e=null),this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?e=i:(e=this.parent.createElement(ln,{attrs:{role:"rowgroup"}})).appendChild(i),this.parent.frozenRows&&"virtualscroll"===n.requestType&&(1===this.parent.pageSettings.currentPage||this.isInfiniteColumnvirtualization()))for(var m=0;m<this.parent.frozenRows;m++)e.children[0].remove();if(this.getTable().appendChild(e),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,this.parent.enableVirtualization||!this.parent.enableColumnVirtualization||"right"!==s.direction&&"left"!==s.direction||(this.content.scrollTop=this.currentInfo.offsets.top,this.content.scrollLeft=this.currentInfo.offsets.left),this.parent.groupSettings.columns.length){if(!ge(this.parent)&&"up"===s.direction){var y=this.offsets[this.getTotalBlocks()]-this.prevHeight,v=this.content.scrollTop;this.content.scrollTop=v+y}this.setVirtualHeight(),this.parent.groupSettings.enableLazyLoading||this.observer.setPageHeight(this.getOffset(d[d.length-1])-this.getOffset(d[0]-1))}this.parent.groupSettings.enableLazyLoading||0!==this.parent.groupSettings.columns.length||"ungrouping"!==n.requestType||this.observer.setPageHeight(2*this.getBlockHeight()),this.prevInfo=s,this.isFocused&&"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey&&this.content.focus();var S=Math.ceil(this.getTotalBlocks()/2);if(this.isBottom&&(this.isBottom=!1,this.isBottomNotify=!1,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),this.parent.pageSettings.currentPage+1!==S&&this.parent.pageSettings.currentPage!==S||2!==d.length||"delete"!==n.requestType||(this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),1!==S&&this.parent.pageSettings.currentPage===S&&1===d.length&&(this.isBottom=!0,setTimeout(function(){var e=r.parent.getContent().firstElementChild;e.scrollTop=r.offsets[r.offsetKeys.length-2];var t={direction:"up",sentinel:r.observer.sentinelInfo.up,offset:{top:e.scrollTop,left:e.scrollLeft},focusElement:r.parent.element};r.scrollListener(t)},0)),this.isTop&&(this.parent.getContent().firstElementChild.scrollTop=0,this.isTop=!1),"virtualscroll"===n.requestType&&"X"===n.virtualInfo.sentinelInfo.axis&&this.parent.notify(Ci,{}),this.focusCell(n),this.firstCellFocus){this.firstCellFocus=!1;var C=this.parent.focusModule,w=C.active.matrix.current,b=this.parent.getContentTable().rows[w[0]].cells[w[1]];C.currentInfo.element=b,C.currentInfo.elementToFocus=b,b.classList.add("e-focus"),b.classList.add("e-focused"),b.tabIndex=0,b.focus()}if(this.restoreEdit(n),this.restoreAdd(),this.ensureSelectedRowPosition(),this.validationScrollLeft(),this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.widthServices.refreshFrozenScrollbar(),!this.initialRowTop){var I=this.parent.element.getBoundingClientRect().top;this.parent.getRowByIndex(0)&&(this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top-I)}}},r.prototype.validationScrollLeft=function(){if(this.validationCheck)if(this.validationCol){var e=this.vgenerator.cOffsets[this.validationCol.index-this.parent.getVisibleFrozenColumns()-1];this.validationCol=null,this.content.scrollLeft=e}else this.validationCheck=!1,this.parent.editModule.editFormValidate()},r.prototype.ensureSelectedRowPosition=function(){if(!this.isSelection&&this.isSelectionScroll&&!t.isNullOrUndefined(this.selectRowIndex)){this.isSelectionScroll=!1;var e=this.parent.getRowByIndex(this.selectRowIndex);e&&!this.isRowInView(e)&&this.rowSelected({rowIndex:this.selectRowIndex,row:e},!0)}},r.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.selectionSettings.checkboxOnly||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||this.parent.selectRow(parseInt(t.getAttribute(an),10)-1),this.activeKey=this.empty}},r.prototype.restoreEdit=function(e){if(this.isNormaledit){if(this.parent.editSettings.allowEditing&&this.parent.editModule&&!t.isNullOrUndefined(this.editedRowIndex)){var i=this.getRowByIndex(this.editedRowIndex),n=this.content,r=Object.keys(this.virtualData),s=e&&e.virtualInfo&&"X"===e.virtualInfo.sentinelInfo.axis;if(r.length&&i&&!n.querySelector("."+en)&&-1===["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].indexOf(e.requestType)){var o=i.getBoundingClientRect().top-this.parent.element.getBoundingClientRect().top;(s||o<this.content.offsetHeight&&o>this.parent.getRowHeight())&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(i))}if(i&&this.content.querySelector("."+en)&&!r.length){var a=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.enableCacheOnInfiniteColumnVirtual()?this.virtualInfiniteData:t.extend({},this.parent.getCurrentViewRecords()[this.editedRowIndex]):t.extend({},this.getRowObjectByIndex(this.editedRowIndex));this.virtualData=this.getVirtualEditedData(a)}}this.restoreAdd()}},r.prototype.getVirtualEditedData=function(e){var t=[].slice.call(this.parent.element.getElementsByClassName("e-gridform"));if(!(this.parent.editModule&&this.parent.editModule.formObj&&this.parent.editModule.formObj.isDestroyed))for(var i=0;i<t.length;i++)e=this.parent.editModule.getCurrentEditedData(t[parseInt(i.toString(),10)],e);return e},r.prototype.restoreAdd=function(){var e=!this.parent.element.querySelector("."+tn);if(this.isNormaledit&&this.isAdd&&e){var t="Top"===this.parent.editSettings.newRowPosition&&this.content.scrollTop<this.parent.getRowHeight(),i="Bottom"===this.parent.editSettings.newRowPosition&&this.parent.pageSettings.currentPage===this.maxPage;(t||i)&&(this.parent.isEdit=!1,this.parent.addRecord())}},r.prototype.onDataReady=function(e){t.isNullOrUndefined(e.count)||(this.count=e.count,this.maxPage=Math.ceil((this.parent.groupSettings.columns.length&&this.parent.vcRows.length?this.parent.vcRows.length: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)},r.prototype.updateScrollbarOnResize=function(){!this.parent.enableVirtualization||t.isNullOrUndefined(this.virtualEle.verticalScrollbar)||t.isNullOrUndefined(this.content)||(this.virtualEle.verticalScrollbar.style.width=j(!0)+1+"px"),!this.parent.enableColumnVirtualization||t.isNullOrUndefined(this.virtualEle.horizontalScrollbar)||t.isNullOrUndefined(this.content)||(this.virtualEle.horizontalScrollbar.style.height=j(!0)+1+"px")},r.prototype.updateVirtualScrollbar=function(e,i){!this.parent.enableVirtualization||t.isNullOrUndefined(this.virtualEle.verticalScrollbar)||t.isNullOrUndefined(this.virtualEle.verticalScrollerContainer)||t.isNullOrUndefined(this.content)||(this.virtualEle.verticalScrollbar.style.overflowX=this.parent.enableVirtualization&&parseInt(i,10)>this.virtualEle.wrapper.clientWidth?"scroll":"hidden",this.virtualEle.gridContent.style.position="relative",this.virtualEle.verticalScrollerContainer.style.height=t.isNullOrUndefined(e)?"0px":e+"px",this.virtualEle.verticalScrollbar.style.width=j()+1+"px"),!this.parent.enableColumnVirtualization||t.isNullOrUndefined(this.virtualEle.horizontalScrollbar)||t.isNullOrUndefined(this.virtualEle.horizontalScrollerContainer)||t.isNullOrUndefined(this.content)||(this.virtualEle.horizontalScrollbar.style.overflowY=this.parent.enableColumnVirtualization&&e>this.virtualEle.wrapper.clientHeight?"scroll":"hidden",!i||-1!==i.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(i,10)||(i="100%"),this.virtualEle.horizontalScrollerContainer.style.width=i,this.virtualEle.horizontalScrollbar.style.height=j()+1+"px")},r.prototype.setVirtualHeight=function(e){var i=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.getVisibleColumns().length+this.parent.groupSettings.columns.length-1)+"px":"100%",n=this.offsets[ge(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks()];!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(n=0);var r=ge(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks(),s=Math.ceil(r/2),o=Math.round(this.virtualEle.placeholder.getBoundingClientRect().bottom),a=Math.round(this.virtualEle.wrapper.getBoundingClientRect().bottom);(this.currentInfo.page===s||this.currentInfo.page+1===s)&&"down"===this.currentInfo.direction&&o>a&&!this.diff&&(this.diff=o-a),this.diff&&this.currentInfo.page===s&&o>a&&(!this.isAdd||"Bottom"!==this.parent.editSettings.newRowPosition)?(n-=this.diff,this.heightChange=!0):"virtualscroll"===this.requestType&&this.diff&&this.heightChange&&(n-=this.diff,this.heightChange=!1),this.virtualEle.setVirtualHeight(n,i),this.virtualEle&&this.virtualEle.wrapper&&(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.virtualEle.wrapper.style.minHeight="":this.virtualEle.wrapper.style.minHeight=t.isNullOrUndefined(n)?"0px":t.formatUnit(this.parent.height)),this.parent.enableColumnVirtualization&&this.header.virtualEle&&this.header.virtualEle.setVirtualHeight(1,i),this.parent.enableSeamlessScrolling&&this.updateVirtualScrollbar(n,i)},r.prototype.getPageFromTop=function(e,t){var i=this,n=ge(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),r=0;return this.offsetKeys.some(function(s){var o=Number(s),a=e<=i.offsets[""+s]||o===n&&e>i.offsets[""+s];return a&&(i.offsetKeys.length%2!=0&&o.toString()===i.offsetKeys[i.offsetKeys.length-2]&&e<=i.offsets[i.offsetKeys.length-1]&&(o+=1),t.block=o%2==0?1:0,r=Math.max(1,Math.min(i.vgenerator.getPage(o),i.maxPage))),a}),r},r.prototype.getTranslateY=function(e,t,i,n){void 0===i&&((i={page:this.getPageFromTop(e,{})}).blockIndexes=this.vgenerator.getBlockIndexes(i.page));var r=(i.blockIndexes[0]||1)-1,s=this.getOffset(r),o=this.getOffset(i.blockIndexes[i.blockIndexes.length-1]);n&&(i=this.prevInfo);var a=s>e?this.getOffset(r-1):o<e+t?this.getOffset(r+1):s,l=this.offsets[i.blockIndexes[i.blockIndexes.length-1]]-this.tmpOffsets[i.blockIndexes[0]],d=ge(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return a+l>this.offsets[parseInt(d.toString(),10)]&&(a-=a+l-this.offsets[parseInt(d.toString(),10)]),1===i.page&&0===i.block&&"up"===i.direction&&(a=0),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(a=0),a},r.prototype.getOffset=function(e){return Math.min(0|this.offsets[parseInt(e.toString(),10)],0|this.offsets[this.maxBlock])},r.prototype.onEntered=function(){var e=this;return function(i,n,r,s,o,a){if("down"!==r&&"up"!==r||e.parent.enableVirtualization||!e.parent.enableColumnVirtualization){!t.Browser.isIE||o||!a||e.preventEvent||e.parent.enableVirtualMaskRow||e.parent.showSpinner(),e.prevInfo=e.prevInfo||e.vgenerator.getData();var l=e.getInfoFromView(r,n,s);if(!(e.parent.isFrozenGrid()&&"X"===n.axis&&e.parent.getVisibleFrozenLeftCount()>=l.columnIndexes[0]&&e.prevInfo&&e.prevInfo.columnIndexes.toString().includes(l.columnIndexes.toString()))){if(e.parent.enableVirtualMaskRow&&!e.preventEvent){var d=parseInt(e.offsetKeys[0],10),h=parseInt(e.offsetKeys[e.offsetKeys.length-1],10),p=e.currentInfo.blockIndexes,c=e.prevInfo&&"X"===n.axis&&e.prevInfo.columnIndexes.toString()===l.columnIndexes.toString()||"down"===r&&e.parent.allowGrouping&&e.parent.groupSettings.columns.length&&(e.parent.allowFiltering&&e.parent.filterSettings.columns.length||e.parent.searchSettings.key.length)&&e.offsetKeys.length<=2;p&&p[0]===d&&"up"===r||p&&p[p.length-1]===h&&"down"===r||c||setTimeout(function(){e.parent.showMaskRow(n.axis)},0)}var u="X"===n.axis,g=e.prevInfo.offsets?e.prevInfo.offsets.top:null,f=e.content.getBoundingClientRect().height,m=e.getColumnOffset(u?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(e.parent.isFrozenGrid()&&e.parent.enableColumnVirtualization&&e.currentInfo&&e.currentInfo.columnIndexes){var y=e.currentInfo.columnIndexes[0]-1,v=0;e.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(v+=parseInt(e.width.toString(),10))}),y>e.parent.getVisibleFrozenLeftCount()&&(m-=v)}if(u){var S=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,C=e.vgenerator.cOffsets[S-1];m=m>C?C:m}if(!e.parent.enableVirtualization&&e.parent.enableColumnVirtualization)e.virtualEle.adjustTable(m,0);else{var w=e.prevInfo&&1===e.prevInfo.page&&(r!==e.prevInfo.direction||r!==e.prevInfo.direction),b=e.getTranslateY(s.top,f,u&&g===s.top?e.prevInfo:void 0,!w);e.virtualEle.adjustTable(m,Math.min(b,e.offsets[e.maxBlock]));var I=e.virtualEle.wrapper.getBoundingClientRect().bottom,x=e.virtualEle.content.getBoundingClientRect().bottom;if("up"===r&&e.prevInfo.page===Math.ceil(e.getTotalBlocks()/2)&&Math.round(I)<Math.round(x)){var R=Math.round(x)-Math.round(I),D=Math.min(b+R,e.offsets[e.maxBlock]);D!==b&&e.virtualEle.adjustTable(m,D)}}e.parent.enableColumnVirtualization&&(e.header.virtualEle.adjustTable(m,0),e.parent.isFrozenGrid()&&e.resetStickyLeftPos(m))}}}},r.prototype.dataBound=function(){this.parent.notify("refresh-virtual-frozen-height",{}),this.isSelection&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey?this.parent.selectRow(this.selectedRowIndex):(this.activeKey=this.empty,this.requestType=this.empty)},r.prototype.resetStickyLeftPos=function(e,i){var n=[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze")).concat([].slice.call((i||this.parent.getContent()).querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze"))),r=0,s=0;if(this.parent.getHeaderContent().querySelectorAll(".e-fixedfreeze").length&&(r=this.parent.leftrightColumnWidth("left"),s=this.parent.leftrightColumnWidth("right")),n.length)for(var o=0;o<n.length;o++){var a=n[parseInt(o.toString(),10)],l=void 0;if(a.classList.contains("e-rowcell"))if(t.isNullOrUndefined(a.getAttribute("aria-colindex"))&&a.querySelector("[data-mappinguid]")){h=a.querySelector("[data-mappinguid]").getAttribute("data-mappinguid");l=this.parent.getColumnByUid(h)}else{var d=parseInt(a.getAttribute("aria-colindex"),10)-1;l=this.parent.getColumnByIndex(parseInt(d.toString(),10))}else if(a.classList.contains("e-headercell")||a.classList.contains("e-filterbarcell")){var h=a.classList.contains("e-filterbarcell")?a.getAttribute("data-mappinguid"):a.querySelector("[data-mappinguid]").getAttribute("data-mappinguid");l=this.parent.getColumnByUid(h)}t.isNullOrUndefined(l)||("Left"===l.freeze?a.style.left=l.valueX-e+"px":"Right"===l.freeze?a.style.right=l.valueX+e+"px":"Fixed"===l.freeze&&(a.style.left=r-e+"px",a.style.right=s+e+"px"))}this.parent.translateX=e},r.prototype.rowSelected=function(e,t){if((this.isSelection||t)&&!this.isLastBlockRow(e.rowIndex)){var i=xe(this.content.firstElementChild),n=this.parent.element.getBoundingClientRect().top,r=e.row.getBoundingClientRect().top-n,s=this.content.getBoundingClientRect().height,o=s<r,a=o?r-s:this.initialRowTop-r,l=o?i.height-a:i.height+a;this.virtualEle.adjustTable(i.width,l);var d=this.virtualEle.wrapper.getBoundingClientRect(),h=this.content.getBoundingClientRect();d.top>h.top&&this.virtualEle.adjustTable(i.width,l-(d.top-h.top)),this.content.querySelector("tbody").lastElementChild.getBoundingClientRect().top-n<s?(l+=s-(e.row.getBoundingClientRect().top-n),this.virtualEle.adjustTable(i.width,l-this.parent.getRowHeight()/2)):h.bottom>d.bottom&&this.virtualEle.adjustTable(i.width,l+(h.bottom-d.bottom)),this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.resetStickyLeftPos(i.width)}this.isSelection=!1},r.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},r.prototype.refreshMaxPage=function(){this.parent.groupSettings.columns.length&&this.parent.vcRows.length&&(this.maxPage=Math.ceil(this.parent.vcRows.length/this.parent.pageSettings.pageSize))},r.prototype.setVirtualPageQuery=function(e){var i=[];if(this.prevInfo&&this.prevInfo.blockIndexes&&(i=Rt(this.prevInfo.blockIndexes)),("sorting"===this.requestType||"delete"===this.requestType)&&i.length&&xt(this.parent))return e.query.skip(this.parent.pageSettings.pageSize*(i[0]-1)),e.query.take(this.parent.pageSettings.pageSize*i.length),void(e.skipPage=!0);var n=this.parent.getContent().querySelector(".e-row");if("virtualscroll"===this.requestType&&this.vgenerator.currentInfo.blockIndexes&&(this.vgenerator.currentInfo={}),n&&(this.parent.isManualRefresh||"pin-row"===this.requestType||"unpin-row"===this.requestType)&&this.currentInfo.blockIndexes&&(3===this.currentInfo.blockIndexes.length||i.length>1)){this.vgenerator.startIndex=parseInt(n.getAttribute("aria-rowindex"),10)-1,this.vgenerator.currentInfo=t.extend({},this.currentInfo),this.vgenerator.currentInfo.blockIndexes=this.currentInfo.blockIndexes.slice(),(this.vgenerator.includePrevPage=this.currentInfo.blockIndexes[0]%2==0)?(this.vgenerator.startIndex=this.vgenerator.startIndex-this.getBlockSize(),this.vgenerator.currentInfo.blockIndexes.unshift(this.currentInfo.blockIndexes[0]-1)):this.vgenerator.currentInfo.blockIndexes.push(this.currentInfo.blockIndexes[this.currentInfo.blockIndexes.length-1]+1);var r=(this.vgenerator.currentInfo.blockIndexes[0]-1)*this.getBlockSize(),s=this.vgenerator.currentInfo.blockIndexes.length*this.getBlockSize();e.query.skip(r),e.query.take(s),e.skipPage=!0}},r.prototype.eventListener=function(e){var t=this;if(!this.parent.isDestroyed){this.parent[""+e](Zt,this.onDataReady,this),this.parent.addEventListener(jt,this.dataBound.bind(this)),this.parent.addEventListener(qt,this.actionBegin.bind(this)),this.parent.addEventListener(Ut,this.actionComplete.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelected.bind(this)),this.parent[""+e](Si,this.refreshContentRows,this),this.parent[""+e]("refresh-Virtual-LazyLoad-Cache",this.refreshVirtualLazyLoadCache,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]("get-virtual-data",this.getVirtualData,this),this.parent[""+e]("virtual-scroll-edit-cancel",this.editCancel,this),this.parent[""+e]("refresh-virtual-max-page",this.refreshMaxPage,this),this.parent[""+e]("set-virtual-page-query",this.setVirtualPageQuery,this),this.parent[""+e]("select-row-on-context-open",this.selectRowOnContextOpen,this),this.parent[""+e]("reset-virtual-focus",this.resetVirtualFocus,this),this.parent[""+e]("refresh-virtual-editform-cells",this.refreshCells,this),this.parent[""+e]("scroll-to-edit",this.scrollToEdit,this),this.parent.on(pi,this.destroy,this);for(var i=this.actions,n=0;n<i.length;n++)this.parent[""+e](i[parseInt(n.toString(),10)]+"-begin",this.onActionBegin,this);var r=function(){window.addEventListener("resize",t.updateScrollbarOnResize.bind(t)),t.observer.observe(function(e){return t.scrollListener(e)},t.onEntered());var e=t.parent;if(e.enablePersistence&&e.scrollPosition){if(e.scrollPosition.top>0){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($t,r)};this.parent.on($t,r,this)}},r.prototype.destroy=function(){this.removeEventListener()},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(window.removeEventListener("resize",this.updateScrollbarOnResize),this.parent.off(pi,this.destroy))},r.prototype.refreshVirtualLazyLoadCache=function(e){var i=this.currentInfo.blockIndexes;t.isNullOrUndefined(this.currentInfo.blockIndexes)&&(i=[1,2]);for(var n,r,s,o=0;o<i.length;o++)for(var a=this.vgenerator.cache[i[parseInt(o.toString(),10)]],l=0;l<a.length;l++)if(a[parseInt(l.toString(),10)].uid===e.uid){n=i[parseInt(o.toString(),10)],r=l,s=a;break}e.count?this.vgenerator.cache[parseInt(n.toString(),10)].splice(r+1,e.count):e.rows&&e.rows.length&&(this.vgenerator.cache[parseInt(n.toString(),10)]=[].slice.call(s.slice(0,r+1)).concat([].slice.call(e.rows)).concat([].slice.call(s.slice(r+1,s.length)))),this.refreshOffsets()},r.prototype.scrollToEdit=function(e){var i=!0;if(this.validationCheck=!0,this.isAdd&&this.content.scrollTop>0){i=!1;var n=Object.keys(this.offsets);this.content.scrollTop="Top"===this.parent.editSettings.newRowPosition?0:this.offsets[n.length-1]}var r=this.parent.getRowByIndex(this.editedRowIndex);if(!(r||t.isNullOrUndefined(this.editedRowIndex)||r&&this.isRowInView(r))){var s=this.parent.getRowHeight(),o=this.editedRowIndex*s;t.isNullOrUndefined(o)||(i=!1,this.content.scrollTop=o)}if(e&&i){var a=this.vgenerator.cOffsets[e.index-this.parent.getVisibleFrozenColumns()-1];this.parent.enableColumnVirtualization||(a=this.parent.getHeaderContent().querySelector('.e-headercelldiv[data-mappinguid="'+e.uid+'"]').parentElement.offsetLeft),this.parent.enableColumnVirtualization&&this.parent.getVisibleFrozenLeftCount()&&(a-=this.parent.leftrightColumnWidth("left")),this.content.scrollLeft=this.parent.enableRtl?-Math.abs(a):a}e&&!i&&(this.validationCol=e)},r.prototype.refreshCells=function(e){e.cells=this.vgenerator.generateCells(e.foreignKeyData)},r.prototype.resetVirtualFocus=function(e){this.isCancel=e.isCancel},r.prototype.getVirtualData=function(e){if(this.isNormaledit){var t=this.parent.element.querySelector('.e-griderror:not([style*="display: none"])'),i=Object.keys(this.virtualData);if(e.isScroll=0!==i.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis,t)return;this.virtualData=i.length?this.virtualData:e.virtualData,this.getVirtualEditedData(this.virtualData),e.virtualData=this.virtualData,e.isAdd=this.isAdd||this.parent.editSettings.showAddNewRow,e.isCancel=this.isCancel}},r.prototype.selectRowOnContextOpen=function(e){this.isContextMenuOpen=e.isOpen},r.prototype.editCancel=function(e){var i=Me(this.parent,e.data);t.isNullOrUndefined(i)||(e.data=this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)])},r.prototype.editSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewData(e.data),this.isAdd=!1)},r.prototype.updateCurrentViewData=function(e){var i=Me(this.parent,e);t.isNullOrUndefined(i)||(this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)]=e)},r.prototype.actionBegin=function(e){"virtualscroll"!==e.requestType&&(this.requestType=e.requestType),e.cancel?"beginEdit"===e.requestType&&(this.virtualData={}):this.parent.notify("refresh-virtual-frozenrows",e)},r.prototype.virtualCellFocus=function(e){var i=document.activeElement;if(i.classList.contains(_i)||!(i instanceof HTMLInputElement)&&t.isNullOrUndefined(i.closest(".e-templatecell"))||(i=i.closest(".e-rowcell")),!(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&i)||!i.classList.contains(_i)&&t.isNullOrUndefined(F(i,"e-groupcaptionrow"))||!e||"shiftEnter"!==e.action&&"upArrow"!==e.action&&"downArrow"!==e.action){if(i&&i.classList.contains(_i)&&e&&("upArrow"===e.action||"downArrow"===e.action||"shiftEnter"===e.action)){var n=parseInt(i.parentElement.getAttribute(an),10)-1;if(e&&("upArrow"===e.action||"shiftEnter"===e.action||"downArrow"===e.action)){var r=this.parent.getContent().firstElementChild;"downArrow"===e.action?n+=1:n-=1,this.rowIndex=n,this.cellIndex=parseInt(i.getAttribute(on),10)-1;var s=this.parent.getRowByIndex(n),o=this.parent.pageSettings.currentPage,a=Math.floor(r.offsetHeight/this.parent.getRowHeight())-1,l=!1;t.isNullOrUndefined(s)&&(l=!0,("downArrow"===e.action&&o===this.maxPage-1||("upArrow"===e.action||"shiftEnter"===e.action)&&1===o)&&(l=!1)),l||ke(s,this.parent)&&"downArrow"===e.action||Ae(s,2*this.parent.getRowHeight())&&("upArrow"===e.action||"shiftEnter"===e.action)?(this.activeKey=e.action,r.scrollTop="downArrow"===e.action?(n-a)*this.parent.getRowHeight():n*this.parent.getRowHeight()):this.activeKey=this.empty,this.parent.selectionSettings.checkboxOnly||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||this.parent.selectRow(n)}}}else{var d=(r=this.parent.getContent().firstElementChild).getBoundingClientRect(),s=t.closest(i,"tr"),h="downArrow"===e.action?s.nextElementSibling:s.previousElementSibling,p=t.isNullOrUndefined(h)?void 0:h.getBoundingClientRect();if(t.isNullOrUndefined(h)||"downArrow"===e.action&&p.bottom>d.bottom||("upArrow"===e.action||"shiftEnter"===e.action)&&p.top<d.top){this.activeKey=e.action,this.parent.focusModule.virtualSelectionInfo={isPending:t.isNullOrUndefined(h),direction:e.action,event:e};var c=t.isNullOrUndefined(h)?this.parent.getRowHeight():"downArrow"===e.action?p.bottom-d.bottom:d.top-p.top;r.scrollTop="downArrow"===e.action?r.scrollTop+c:r.scrollTop-c}else this.activeKey=this.empty}},r.prototype.editActionBegin=function(e){this.editedRowIndex=e.index;var i=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?t.extend({},this.parent.getCurrentViewRecords()[e.index]):t.extend({},this.getRowObjectByIndex(e.index)),n=Object.keys(this.virtualData);e.data=n.length&&!this.parent.editSettings.showAddNewRow?this.virtualData:this.isInfiniteColumnvirtualization()?e.data:i,this.enableCacheOnInfiniteColumnVirtual()&&(this.virtualInfiniteData=e.data),e.isScroll=0!==n.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis},r.prototype.getEditedRowObject=function(){for(var e,t=this.parent.vcRows,i=0;i<t.length;i++)t[parseInt(i.toString(),10)].index===this.editedRowIndex&&(e=t[parseInt(i.toString(),10)]);return e},r.prototype.refreshCache=function(e){if(!this.isInfiniteColumnvirtualization()){var t=Math.ceil((this.editedRowIndex+1)/this.getBlockSize());this.parent.allowPaging&&this.parent.enableColumnVirtualization&&(t=Math.ceil((this.editedRowIndex+1+(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize)/this.getBlockSize()));var i=this.parent.allowPaging&&this.parent.enableColumnVirtualization?this.editedRowIndex%this.getBlockSize():this.editedRowIndex-(t-1)*this.getBlockSize();if(!(this.parent.pinnedTopRowModels.length&&this.parent.pinnedTopRowModels.length>i))if(this.parent.groupSettings.columns.length){var n=this.getEditedRowObject();n&&(n.data=e.data)}else this.vgenerator.cache[parseInt(t.toString(),10)][parseInt(i.toString(),10)].data=e.data}},r.prototype.actionComplete=function(e){if(this.parent.enableVirtualization||this.parent.enableColumnVirtualization){var t=["delete","save","cancel"],i=["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"];t.some(function(t){return t===e.requestType})&&(this.refreshOffsets(),this.refreshVirtualElement()),this.isNormaledit&&(i.some(function(t){return t===e.requestType})||t.some(function(t){return t===e.requestType}))&&(this.isCancel=!0,this.isAdd&&this.parent.editSettings&&"Bottom"===this.parent.editSettings.newRowPosition&&(this.virtualEle.placeholder.style.height=parseInt(this.virtualEle.placeholder.style.height.toString(),10)-this.diff+"px"),this.isAdd=this.parent.editSettings.showAddNewRow,this.editedRowIndex=this.empty,this.virtualData={},this.virtualInfiniteData={},this.parent.editModule&&(this.parent.editModule.editModule.previousData=void 0)),this.parent.enableColumnVirtualization&&"filterAfterOpen"===e.requestType&&this.currentInfo.columnIndexes&&this.currentInfo.columnIndexes[0]>0&&this.parent.resetFilterDlgPosition(e.columnName)}},r.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)},r.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("."+en),i=this.parent.element.querySelector("."+tn);if(e||i){var n=e?t.extend({},this.getRowObjectByIndex(this.editedRowIndex)):t.extend({},this.emptyRowData),r=Object.keys(this.virtualData);this.virtualData=r.length?this.getVirtualEditedData(this.virtualData):this.getVirtualEditedData(n)}}},r.prototype.createEmptyRowdata=function(){var e=this;this.parent.columnModel.filter(function(t){e.emptyRowData[t.field]=e.empty})},r.prototype.addActionBegin=function(e){if(this.isNormaledit){Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.isAdd=!0;var t=this.parent.pageSettings.currentPage;!this.parent.frozenRows&&this.content.scrollTop>0&&"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])}},r.prototype.getRowObjectByIndex=function(e){return this.getRowCollection(e,!0)},r.prototype.getBlockSize=function(){return this.parent.pageSettings.pageSize>>1},r.prototype.getBlockHeight=function(){return this.getBlockSize()*this.parent.getRowHeight()},r.prototype.isEndBlock=function(e){var t=ge(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return e>=t||e===t-1},r.prototype.isOddPageSize=function(){return this.parent.pageSettings.pageSize%2!=0},r.prototype.getOddBlockSize=function(){return this.isOddPageSize()?this.parent.pageSettings.pageSize/2:this.getBlockSize()},r.prototype.getGroupedTotalBlocks=function(){var e=this.parent.vcRows;return Math.floor(e.length/this.getOddBlockSize()<1?1:e.length/this.getOddBlockSize())},r.prototype.getTotalBlocks=function(){return Math.ceil(this.count/this.getOddBlockSize())},r.prototype.getColumnOffset=function(e){return 0|this.vgenerator.cOffsets[parseInt(e.toString(),10)]},r.prototype.getModelGenerator=function(){return new Bs(this.parent)},r.prototype.resetScrollPosition=function(e){if(this.actions.some(function(t){return t===e})&&(this.preventEvent=0!==this.content.scrollTop,this.content.scrollTop=0,Object.keys(this.currentInfo).length)){var i=this.currentInfo.offsets&&!t.isNullOrUndefined(this.currentInfo.offsets.left)?this.currentInfo.offsets.left:0;this.currentInfo=this.getInfoFromView(this.currentInfo.direction,this.currentInfo.sentinelInfo,{top:0,left:i})}"virtualscroll"!==e&&(this.isAdd=!1)},r.prototype.onActionBegin=function(e){this.parent.setProperties({pageSettings:{currentPage:1}},!0)},r.prototype.getRows=function(){return this.isInfiniteColumnvirtualization()?this.getInfiniteRows():this.vgenerator.getRows()},r.prototype.getRowByIndex=function(e){var i;if(ge(this.parent))if(!t.isNullOrUndefined(e)&&this.parent.enableVirtualization&&this.parent.groupSettings.columns.length)for(var n=0;n<this.parent.getDataRows().length;n++)parseInt(this.parent.getDataRows()[parseInt(n.toString(),10)].getAttribute(an),10)-1===e&&(i=this.parent.getDataRows()[parseInt(n.toString(),10)]);else i=t.isNullOrUndefined(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)];else!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?i=t.isNullOrUndefined(e)?void 0:this.enableCacheOnInfiniteColumnVirtual()?this.parent.getDataRows().find(function(t){return parseInt(t.getAttribute(an),10)-1===e}):this.parent.getDataRows()[parseInt(e.toString(),10)]:this.prevInfo&&(i=this.getRowCollection(e,!1));return i},r.prototype.getMovableVirtualRowByIndex=function(e){return this.getRowCollection(e,!1)},r.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1)},r.prototype.getRowCollection=function(e,i){var n=(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize();this.parent.pageSettings.pageSize%2!=0&&(n+=Math.floor(n/this.getBlockSize()/2));var r=this.parent.getDataRows(),s=this.parent.pinnedTopRowModels,o=i?this.parent.getCurrentViewRecords():r;i&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(n=parseInt(this.parent.getRows()[0].getAttribute(an),10)-1,o=o.filter(function(e){return t.isNullOrUndefined(e.items)})),!i&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&r.length&&(n=parseInt(r[0].getAttribute(an),10)-1);var a=o[e-n];if(s.length)return e<s.length?a=i?s[parseInt(e.toString(),10)].data:r[parseInt(e.toString(),10)]:(a=i?o[e-n-s.length]:a,this.parent.groupSettings.columns.length&&(a=i?o[e-n]:a)),a;if(i&&!this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&this.parent.aggregates){var l=r[e-n],d=this.parent.getRowObjectFromUID(l.getAttribute("data-uid"));d&&(a=d.data)}return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(a=i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:a:e<=this.parent.frozenRows?r[parseInt(e.toString(),10)]:r[e-n+this.parent.frozenRows]),a},r.prototype.getVirtualRowIndex=function(e){if(t.isNullOrUndefined(this.prevInfo))return e;var i=this.prevInfo.blockIndexes,n=(i[0]-1)*this.getBlockSize();if(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length)for(var r=this.vgenerator.cache[i[0]],s=0;s<r.length;s++)if(r[""+s].isDataRow){n=r[""+s].index;break}return n+e},r.prototype.refreshOffsets=function(){var e=this.parent,t=0,i=this.getBlockSize(),n=this.getOddBlockSize(),r=ge(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();this.prevHeight=this.offsets[parseInt(r.toString(),10)],this.maxBlock=r%2==0?r-2:r-1,this.offsets={};for(var s=Array.apply(null,Array(r)).map(function(){return++t}),o=0;o<s.length;o++){var a=(this.vgenerator.cache[s[parseInt(o.toString(),10)]]||[]).length,l=ge(this.parent)?this.isOddPageSize()?Math.ceil(e.vcRows.length%n):e.vcRows.length%i:this.isOddPageSize()?Math.ceil(this.count%n):this.count%i,d=!ge(this.parent)&&s[parseInt(o.toString(),10)]in this.vgenerator.cache?a*this.parent.getRowHeight():l&&s[parseInt(o.toString(),10)]===r?l*this.parent.getRowHeight():this.getBlockHeight();!this.isOddPageSize()||s[parseInt(o.toString(),10)]in this.vgenerator.cache||l&&s[parseInt(o.toString(),10)]===r||(d=(s[parseInt(o.toString(),10)]%2!=0?Math.floor(n):Math.ceil(n))*this.parent.getRowHeight()),this.offsets[s[parseInt(o.toString(),10)]]=(0|this.offsets[s[parseInt(o.toString(),10)]-1])+d,this.tmpOffsets[s[parseInt(o.toString(),10)]]=0|this.offsets[s[parseInt(o.toString(),10)]-1]}this.offsetKeys=Object.keys(this.offsets),ge(this.parent)&&(this.parent.vGroupOffsets=this.offsets),this.parent.enableColumnVirtualization&&this.vgenerator.refreshColOffsets()},r.prototype.refreshVirtualElement=function(){this.vgenerator.refreshColOffsets(),this.setVirtualHeight()},r.prototype.setVisible=function(e){var i,n=this.parent,r=[];(r=this.getRows()).some(function(e){return e.isDataRow&&(i=e),e.isDataRow});var s=!0;!n.groupSettings.columns.length&&i&&(s=!1);for(var o=n.getDataRows(),a=0,l=e.length;a<l;a++){var d=e[parseInt(a.toString(),10)],h=n.getNormalizedColumnIndex(d.uid),p=!0===d.visible?"":"none",c=this.getColGroup().children;if(-1!==h&&i&&h<i.cells.length&&t.setStyleAttribute(c[parseInt(h.toString(),10)],{display:p}),!s){var u=void 0;d.width&&(u=d.visible?this.virtualEle.wrapper.offsetWidth+parseInt(d.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(d.width.toString(),10)),u>n.width?(this.setDisplayNone(o,h,p,r),this.parent.enableColumnVirtualization&&this.virtualEle.setWrapperWidth(u+""),this.refreshVirtualElement()):s=!0}!this.parent.invokedFromMedia&&d.hideAtMedia&&this.parent.updateMediaColumns(d),this.parent.invokedFromMedia=!1}!s||this.parent.enableVirtualization&&this.parent.groupSettings&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?this.parent.notify("partial-refresh",{rows:r,args:{isFrozen:!1,rows:r}}):this.refreshContentRows({requestType:"refresh"})},r.prototype.selectVirtualRow=function(e){var i=this,n=ge(this.parent)?this.vgenerator.recordsCount:this.count;if(e.isAvailable=e.selectedIndex<n,e.isAvailable&&!this.isContextMenuOpen&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey&&!this.isSelection&&!this.requestTypes.some(function(e){return e===i.requestType})&&!this.parent.selectionModule.isInteracted){var r=this.parent.getRowByIndex(e.selectedIndex),s=this.parent.getRowHeight();if(!r||!this.isRowInView(r)){this.isSelection=!0,this.selectedRowIndex=e.selectedIndex;var o=e.selectedIndex*s;if(ge(this.parent)){var a=this.parent.vcRows.findIndex(function(t){return t.index===e.selectedIndex});o=-1!==a?a*s:void 0,this.isSelection=-1!==a&&this.isSelection}else if(this.parent.groupSettings.columns.length&&this.parent.getDataModule().isRemote()){var l=Math.ceil((e.selectedIndex+1)/this.parent.pageSettings.pageSize),d=this.vgenerator.getBlockIndexes(l);o=this.offsets[d[0]]}if(!t.isNullOrUndefined(o)){var h=this.content.scrollTop<o?"down":"up";this.selectRowIndex=e.selectedIndex,this.content.scrollTop=o+1,this.isSelectionScroll=this.observer.check(h)}}}this.requestType=this.empty},r.prototype.isRowInView=function(e){var t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t>=this.content.getBoundingClientRect().top&&i<=this.content.getBoundingClientRect().bottom},r}(In),Us=function(e){function i(t,i){var n=e.call(this,t,i)||this;return n.virtualEle=new Hs,n.isMovable=!1,n.gen=new Bs(n.parent),n.parent.on(ci,n.setVisible,n),n.parent.on(Si,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?n.refreshUI():null},n),n}return zs(i,e),i.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+Xi))),e.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().querySelector("."+Xi),this.virtualEle.content.style.position="relative",this.virtualEle.renderWrapper(),this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||!this.parent.enableColumnVirtualization?this.virtualEle.renderPlaceHolder("absolute"):this.virtualEle.renderPlaceHolder()},i.prototype.appendContent=function(e){this.virtualEle.wrapper.appendChild(e)},i.prototype.refreshUI=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+Xi))),e.prototype.refreshUI.call(this)},i.prototype.setVisible=function(e){for(var i,n,r,s=this.parent,o=0,a=e.length;o<a;o++){var l=e[parseInt(o.toString(),10)];n=s.getNormalizedColumnIndex(l.uid),i=l.visible?"":"none";var d=this.getColGroup().children;if(s.getColumnByField(l.field)&&t.setStyleAttribute(d[parseInt(n.toString(),10)],{display:i}),s.enableColumnVirtualization&&!s.groupSettings.columns.length){var h=void 0;(h=l.visible?this.virtualEle.wrapper.offsetWidth+parseInt(l.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(l.width.toString(),10))>s.width?(this.setDisplayNone(l,i),this.virtualEle.setWrapperWidth(h+""),this.gen.refreshColOffsets()):r=!0}else r=!0;r&&this.refreshUI()}},i.prototype.setDisplayNone=function(e,i){for(var n=this.getTable(),r=0,s=[].slice.apply(n.querySelectorAll("th.e-headercell"));r<s.length;r++){var o=s[r];if(o.querySelector("[data-mappinguid]")&&o.querySelector("[data-mappinguid]").getAttribute("data-mappinguid")===e.uid){t.setStyleAttribute(o,{display:i}),""===i&&t.removeClass([o],"e-hide");break}}},i}(xn),Hs=function(){function e(){}return e.prototype.renderWrapper=function(e){this.wrapper=t.createElement("div",{className:"e-virtualtable"}),this.wrapper.style.minHeight=t.formatUnit(e),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},e.prototype.renderPlaceHolder=function(e){void 0===e&&(e="relative"),this.placeholder=t.createElement("div",{className:"e-virtualtrack"}),this.placeholder.style.position=e,this.content.appendChild(this.placeholder)},e.prototype.renderVerticalScrollbar=function(){this.verticalScrollbar=t.createElement("div",{className:"e-virtual-vertical-scrollbar"}),this.gridContent.appendChild(this.verticalScrollbar),this.verticalScrollerContainer=t.createElement("div",{className:"e-virtual-vertical-track"}),this.verticalScrollbar.appendChild(this.verticalScrollerContainer)},e.prototype.renderHorizontalScrollbar=function(){this.horizontalScrollbar=t.createElement("div",{className:"e-virtual-horizontal-scrollbar"}),this.gridContent.appendChild(this.horizontalScrollbar),this.horizontalScrollerContainer=t.createElement("div",{className:"e-virtual-horizontal-track"}),this.horizontalScrollbar.appendChild(this.horizontalScrollerContainer)},e.prototype.renderFrozenWrapper=function(e){this.wrapper=t.createElement("div",{className:"e-virtualtable"}),this.wrapper.style.cssText="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.adjustTable=function(e,t){Tt()?this.wrapper.style.transform="translate3d("+e+"px, "+t+"px, 0px) translateZ(0)":this.wrapper.style.transform="translate("+e+"px, "+t+"px)"},e.prototype.setWrapperWidth=function(e,t){!e||-1!==e.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(e,10)||(e=void 0,t=!0),this.wrapper.style.width=e?e+"px":t?"100%":""},e.prototype.setVirtualHeight=function(e,i){this.placeholder.style.height=t.isNullOrUndefined(e)?"0px":e+"px",!i||-1!==i.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(i,10)||(i="100%"),this.placeholder.style.width=i},e.prototype.setFreezeWrapperWidth=function(e,t,i){e.style.width=t?t+"px":i?"100%":""},e}(),js=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.enableColumnVirtualization&&t.addRenderer(e.RenderType.Header,new Us(this.parent,this.locator)),t.addRenderer(e.RenderType.Content,new qs(this.parent,this.locator)),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||this.ensurePageSize()},i.prototype.ensurePageSize=function(){var e=this.parent.getRowHeight(),t=this.parent.height.toString().indexOf("%")<0?this.parent.height:this.parent.element.getBoundingClientRect().height;this.blockSize=~~(parseFloat(t.toString())/e);var i=2*this.blockSize,n=this.parent.pageSettings.pageSize;this.parent.setProperties({pageSettings:{pageSize:n<i?i:n}},!0)},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Yt,this.instantiateRenderer,this),this.parent.on("column-width-changed",this.refreshVirtualElement,this),this.parent.on("create-virtual-validation-form",this.createVirtualValidationForm,this),this.parent.on("validate-virtual-form",this.virtualEditFormValidation,this),this.parent.on(pi,this.destroy,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Yt,this.instantiateRenderer),this.parent.off("column-width-changed",this.refreshVirtualElement),this.parent.off("create-virtual-validation-form",this.createVirtualValidationForm),this.parent.off("validate-virtual-form",this.virtualEditFormValidation),this.parent.off(pi,this.destroy))},i.prototype.getCurrentEditedData=function(e,i){var n={virtualData:t.extend({},{},e,!0),isAdd:!1,isScroll:!1,endEdit:!0};return this.parent.notify("get-virtual-data",n),i?n:n.virtualData},i.prototype.createVirtualValidationForm=function(e){var i=this.parent;if(i.enableVirtualization&&"Normal"===i.editSettings.mode){var n=i.columns,r=new fn(this.locator,null,this.parent),s=t.extend({},{},i.getRowObjectFromUID(e.uid),!0);i.notify("refresh-virtual-editform-cells",s);var o=e.argsCreator(this.getCurrentEditedData(e.prevData),{},!1);o.isCustomFormValidation=!0,o.row=r.render(s,n),e.renderer.update(o);for(var a={},l=0;l<n.length;l++)n[parseInt(l.toString(),10)].visible&&n[parseInt(l.toString(),10)].validationRules&&it(n[parseInt(l.toString(),10)],0,a,{},{},n.length,!0);o.form.classList.add("e-virtual-validation"),i.editModule.virtualFormObj=i.editModule.createFormObj(o.form,a)}},i.prototype.virtualEditFormValidation=function(e){var i=this.parent,n=i.element.querySelector('.e-griderror:not([style*="display: none"])');if(i.editModule.virtualFormObj)if(n&&"none"!==n.style.display){var r=n.getBoundingClientRect(),s=i.element.querySelectorAll(".e-gridform"),o=s[0],a=i.getContent().getBoundingClientRect().left;if(s.length>1&&(o=s[1]),r.left<a||r.right>i.element.offsetWidth){p=o.querySelector('.e-tooltip-wrap:not([style*="display: none"])');this.scrollToEdit(p,{editIdx:e.editIdx,addIdx:e.addIdx},!0)}}else if(i.editModule.virtualFormObj&&(!n||"none"===n.style.display)){for(var l=i.editModule.virtualFormObj.element.querySelectorAll('.e-tooltip-wrap:not([style*="display: none"])'),d=0;d<l.length;d++)t.remove(l[parseInt(d.toString(),10)]);var h=this.getCurrentEditedData(e.prevData,!0);if(this.setEditedDataToValidationForm(i.editModule.virtualFormObj.element,h.virtualData),e.isValid=i.editModule.virtualFormObj.validate(),e.isValid&&(this.parent.editModule.editModule.virtualEditValidationArgs=h),!e.isValid){var p=i.editModule.virtualFormObj.element.querySelector('.e-tooltip-wrap:not([style*="display: none"])');this.scrollToEdit(p,{editIdx:e.editIdx,addIdx:e.addIdx})}}},i.prototype.scrollToEdit=function(e,i,n){var r=this.parent;if(e){var s=r.columnModel,o=Q(e.id).split("_")[0],a=r.getColumnByField(o),l=this.parent.getContent().firstElementChild.scrollTop,d=r.getRowByIndex(i.editIdx);if(!t.isNullOrUndefined(i.addIdx)&&l>0||!t.isNullOrUndefined(i.editIdx)&&!d||n||!a){for(var h=void 0,p=0;p<s.length&&!a;p++)if(s[parseInt(p.toString(),10)].field===o){h=s[parseInt(p.toString(),10)];break}n&&(h=a),this.parent.notify("scroll-to-edit",h)}}},i.prototype.setEditedDataToTemplate=function(e,i){if(this.parent.isAngular&&"Normal"===this.parent.editSettings.mode)for(var n=this.parent.columnModel.filter(function(e){return e.editTemplate}),r=0,s=n.length;r<s;r++){var o=K(n[parseInt(r.toString(),10)].field);if(!t.isNullOrUndefined(o)){var a=e[o],l=t.getValue(n[parseInt(r.toString(),10)].field,i);if(l=t.isNullOrUndefined(l)?"":l,a&&"combobox"===a.getAttribute("aria-label")&&a.closest(".e-combobox")){var d=a.closest(".e-combobox").ej2_instances[0];d.value=l,d.dataBind()}}}},i.prototype.setEditedDataToValidationForm=function(e,i){for(var n=[].slice.call(e.getElementsByClassName("e-field")),r=0,s=n.length;r<s;r++){var o=dt(this.parent,n[parseInt(r.toString(),10)].getAttribute("data-mappinguid"));if(o.field){var a=t.getValue(o.field,i);a=t.isNullOrUndefined(a)?"":a,n[parseInt(r.toString(),10)].value=a}}this.setEditedDataToTemplate(e,i)},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}(),Vs=function(){function e(e){this.parent=e}return e.prototype.addNew=function(e,t){this.isEdit=!1;var i;if(i=(this.parent.frozenRows||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&"Top"===this.parent.editSettings.newRowPosition?this.parent.getHeaderTable().querySelector(ln):this.parent.getContentTable().querySelector(ln),t.row=this.parent.createElement("tr",{className:"e-row e-addedrow"}),this.parent.getContentTable().querySelector(".e-emptyrow")&&!this.parent.editSettings.showAddNewRow){var n=this.parent.getContentTable().querySelector(".e-emptyrow");n.parentNode.removeChild(n),this.parent.frozenRows&&this.parent.element.querySelector(".e-frozenrow-empty")&&this.parent.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty")}"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)},e.prototype.update=function(e,t){this.isEdit=!0;var i=[].slice.call(t.row.querySelectorAll("td.e-rowcell"));t.row.innerHTML="",t.row.appendChild(this.getEditElement(e,!0,i,t,!0)),t.row.classList.add(en),this.parent.editModule.checkLastRow(t.row,t)},e.prototype.getEditElement=function(e,i,n,r,s){var o=this.parent,a=0,l=t.isNullOrUndefined(o.detailTemplate)&&t.isNullOrUndefined(o.childGrid)?0:1;o.allowGrouping&&(a=o.groupSettings.columns.length);var d=this.parent.createElement("td",{className:"e-editcell e-normaledit",attrs:{colspan:(o.getCurrentVisibleColumns(this.parent.enableColumnVirtualization).length+this.parent.getIndentCount()).toString()}}),h=r.form=this.parent.createElement("form",{id:o.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)return this.appendChildren(h,r.rowData,s),d.appendChild(h),d;var p=this.parent.createElement("table",{className:"e-table e-inline-edit",attrs:{cellspacing:"0.25",role:"grid"}});p.appendChild(o.getContentTable().querySelector(dn).cloneNode(!0));var c=this.parent.createElement(ln,{attrs:{role:"rowgroup"}}),u=this.parent.createElement("tr");this.parent.rowHeight&&(u.style.height=this.parent.rowHeight+"px");var g=0;for(l&&u.insertBefore(this.parent.createElement("td",{className:"e-detailrowcollapse"}),u.firstChild),o.isRowDragable()&&u.appendChild(this.parent.createElement("td",{className:"e-dragindentcell"}));g<a;)u.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),g++;var f=0;g=0;for(var m,y=!0,v=r.isCustomFormValidation?this.parent.columnModel:o.getColumns();i&&f<n.length&&g<v.length||g<v.length;){var S=i&&n[parseInt(f.toString(),10)]?n[parseInt(f.toString(),10)].getAttribute("colspan"):null,C=v[parseInt(g.toString(),10)];m=e[C.uid].value,m=t.isNullOrUndefined(m)?"":m;var w=this.parent.createElement("td",{className:_i,attrs:{colspan:S||""}});if(w.style.cssText=C.textAlign?"text-align: "+C.textAlign+";":"",C.visible?(w.appendChild(e[C.uid]),"Vertical"===this.parent.rowRenderingMode&&(R(w,{"data-cell":C.headerText}),0===g&&w.classList.add("e-responsive-editcell")),"booleanedit"===C.editType?w.classList.add("e-boolcell"):(C.commands||C.commandsTemplate)&&t.addClass([w],"e-unboundcell"),this.parent.enableRtl||"Vertical"!==o.gridLines&&"Both"!==o.gridLines||!y||(a?w.classList.add("e-grid-group-first-cell"):this.parent.renderModule&&this.parent.renderModule.isFirstColumnHidden&&!(this.parent.allowRowDragAndDrop||this.parent.childGrid||this.parent.detailTemplate)&&w.classList.add("e-first-visible-cell"),y=!1)):w.classList.add("e-hide"),this.parent.isFrozenGrid()){if($e(this.parent,C,w),this.parent.isSpan){var b=w.getAttribute("colspan")?parseInt(w.getAttribute("colspan"),10):1;Je(this.parent,C,w,b)}this.parent.enableColumnVirtualization&&("Left"!==C.freeze||t.isNullOrUndefined(C.valueX)?"Right"!==C.freeze||t.isNullOrUndefined(C.valueX)?"Fixed"===C.freeze&&(w.style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",w.style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px"):w.style.right=C.valueX+this.parent.translateX+"px":w.style.left=C.valueX-this.parent.translateX+"px")}w.setAttribute("aria-label",m+this.parent.localeObj.getConstant("ColumnHeader")+C.headerText),u.appendChild(w),g=S?g+parseInt(S,10):g+1,f++}return Xe(u),c.appendChild(u),p.appendChild(c),h.appendChild(p),d.appendChild(h),d},e.prototype.removeEventListener=function(){},e.prototype.appendChildren=function(e,i,n){var r=t.extend({},i,{isAdd:!this.isEdit,isFrozen:n},!0),s=this.parent.element.id+"editSettingsTemplate";!this.parent.isReact||"string"==typeof this.parent.editSettings.template||this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate?q(e,this.parent.getEditTemplate()(r,this.parent,"editSettingsTemplate",s,null,null,null,this.parent.root)):(this.parent.getEditTemplate()(r,this.parent,"editSettingsTemplate",s,null,null,e),this.parent.renderTemplates())},e}(),Gs=function(){function e(e){this.parent=e}return e.prototype.update=function(e,i){if(this.parent.isReact&&i.columnObject&&i.columnObject.template){var n=i.cell.parentElement,r=i.cell.cloneNode(!0);n.insertBefore(r,i.cell),r.focus(),i.cell.remove(),i.cell=r}i.cell.setAttribute("aria-label",i.cell.innerHTML+this.parent.localeObj.getConstant("ColumnHeader")+i.columnObject.field),i.cell.innerHTML="",i.cell.appendChild(this.getEditElement(e,i)),i.cell.classList.add("e-editedbatchcell"),t.classList(i.row,[en,"e-batchrow"],[])},e.prototype.getEditElement=function(e,t){var i=this.parent,n=this.parent.createElement("form",{id:i.element.id+"EditForm",className:"e-gridform"});return n.appendChild(e[t.columnObject.uid]),"booleanedit"===t.columnObject.editType&&t.cell.classList.add("e-boolcell"),t.columnObject.editType||t.cell.classList.add("e-inputbox"),n},e}(),_s=function(){function i(e,t){this.parent=e,this.serviceLocator=t,this.parent.isDestroyed||(this.parent.on(Ii,this.destroy,this),this.parent.on(pi,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(i){var n=this,r=this.parent;if(this.parent.enableAdaptiveUI){var s=new Jn(this.parent,this.serviceLocator);return s.action=this.isEdit?e.ResponsiveDialogAction.isEdit:e.ResponsiveDialogAction.isAdd,s.renderResponsiveHeader(void 0,i)}return r.editSettings.headerTemplate?t.initializeCSPTemplate(function(){return n.getDialogEditTemplateElement("HeaderTemplate",i).outerHTML}):this.isEdit?this.l10n.getConstant("EditFormTitle")+i.primaryKeyValue[0]:this.l10n.getConstant("AddFormTitle")},i.prototype.createDialog=function(e,i){var r=this,s=this.parent;this.dialog=this.parent.createElement("div",{id:s.element.id+"_dialogEdit_wrapper"}),this.dialog.style.width="auto",s.enableAdaptiveUI&&this.dialog.classList.add("e-responsive-dialog"),s.element.appendChild(this.dialog),this.setLocaleObj(),this.dialog.setAttribute("aria-label",this.l10n.getConstant("DialogEdit")),this.dialogObj=new n.Dialog(t.extend({header:this.createDialogHeader(i),isModal:!0,visible:!0,cssClass:this.parent.cssClass?"e-edit-dialog "+this.parent.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:s.editSettings.template?"auto":"330px",target:i.target?i.target:document.body,animationSettings:{effect:"None"},footerTemplate:s.editSettings.footerTemplate?t.initializeCSPTemplate(function(){return r.getDialogEditTemplateElement("FooterTemplate",i).outerHTML}):null,buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.l10n.getConstant("SaveButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}]},s.editSettings.dialog?s.editSettings.dialog.params||{}:{})),i.dialog=this.dialogObj;this.dialogObj.isStringTemplate=!0,this.renderResponsiveDialog(),Ve(this.parent,this.dialogObj),this.dialogObj.appendTo(this.dialog),Re(this.parent.element,this.dialogObj.element.parentElement),s.enableAdaptiveUI&&this.dialogObj.show(!0)},i.prototype.dialogCreated=function(){rt(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"],n=0;n<i.length;n++)if(this.parent.editSettings[i[parseInt(n.toString(),10)]]){var r=i[parseInt(n.toString(),10)].charAt(0).toUpperCase()+i[parseInt(n.toString(),10)].slice(1),s=this.parent.element.id+"editSettings"+r;t.updateBlazorTemplate(s,r,this.parent.editSettings)}this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.parent.notify("toolbar-refresh",{}),this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),t.remove(this.dialog))},i.prototype.getDialogEditTemplateElement=function(e,i){var n=this.parent.createElement("div",{className:"e-dialog"+e}),r=t.extend({},i.rowData,{isAdd:!this.isEdit},!0),s=this.parent.element.id+"editSettings"+e;return q(n,("HeaderTemplate"===e?this.parent.getEditHeaderTemplate():this.parent.getEditFooterTemplate())(r,this.parent,"editSettings"+e,s)),t.updateBlazorTemplate(s,e,this.parent.editSettings),n},i.prototype.getEditElement=function(e,i){var n=this,r=this.parent,s=this.parent.createElement("div",{className:this.isEdit?en:"e-insertedrow"}),o=i.form=this.parent.createElement("form",{id:r.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template){var a=this.parent.element.id+"editSettingsTemplate",l=t.extend({},i.rowData,{isAdd:!this.isEdit},!0),d=this.parent.isReact&&"string"!=typeof this.parent.editSettings.template&&!(this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate),h=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;d||h?(this.parent.getEditTemplate()(l,this.parent,"editSettingsTemplate",a,null,null,o),this.parent.renderTemplates()):q(o,this.parent.getEditTemplate()(l,this.parent,"editSettingsTemplate",a,null,null,null,r.root));var p=function(){for(var e=n.parent.getColumns(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].validationRules&&(n.parent.editModule.formObj.rules[e[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].validationRules)};return t.updateBlazorTemplate(a,"Template",this.parent.editSettings,!0,p),s.appendChild(o),s}for(var c=this.parent.createElement("table",{className:Ji,attrs:{cellspacing:"6px",role:"grid"}}),u=this.parent.createElement(ln,{attrs:{role:"rowgroup"}}),g=r.getColumns(),f=0;f<g.length;f++)if(!(this.parent.editModule.checkColumnIsGrouped(g[parseInt(f.toString(),10)])||g[parseInt(f.toString(),10)].commands||g[parseInt(f.toString(),10)].commandsTemplate||"checkbox"===g[parseInt(f.toString(),10)].type)){var m=this.parent.createElement("tr",{attrs:{role:"row"}}),y=this.parent.createElement("td",{className:_i});y.style.cssText="text-align: "+(this.parent.enableRtl?"right":"left")+"; width: 190px;",e[g[parseInt(f.toString(),10)].uid].classList.remove("e-input"),y.appendChild(e[g[parseInt(f.toString(),10)].uid]),m.appendChild(y),u.appendChild(m)}return c.appendChild(u),o.appendChild(c),s.appendChild(o),s},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ii,this.destroy),this.parent.off(pi,this.destroy))},i}(),Ks=function(){function i(e,t){this.editType={Inline:Vs,Normal:Vs,Batch:Gs,Dialog:_s},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),e.isCustomFormValidation||(this.parent.notify("edit-form",e),this.convertWidget(e))},i.prototype.convertWidget=function(e){for(var i,n,r=this.parent,s="Dialog"===r.editSettings.mode?t.select("#"+r.element.id+"_dialogEdit_wrapper .e-gridform",document):r.editSettings.showAddNewRow&&r.element.querySelector(".e-editedrow")?r.element.querySelector(".e-editedrow").getElementsByClassName("e-gridform")[0]:r.element.getElementsByClassName("e-gridform")[0],o=0,a="Batch"!==r.editSettings.mode?r.getColumns():[r.getColumnByField(e.columnName)];o<a.length;o++){var l=a[o];if(!this.parent.editSettings.template||t.isNullOrUndefined(l.field)){if(!this.parent.editModule.checkColumnIsGrouped(l)&&!l.commands){l.valueAccessor(l.field,e.rowData,l),n=s.querySelector("[data-mappinguid="+l.uid+"]");var d=l.edit.write;if(!t.isNullOrUndefined(n)&&("string"==typeof d?(d=fe(d,window))({rowData:e.rowData,element:n,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&fe(l.field,e.foreignKeyData)}):l.edit.write({rowData:e.rowData,element:n,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&fe(l.field,e.foreignKeyData)}),!i&&t.isNullOrUndefined(n.getAttribute("disabled"))&&!F(n,"e-checkbox-disabled"))){var h=!t.isNullOrUndefined(l.edit)&&!t.isNullOrUndefined(l.edit.params)&&l.edit.params.multiline;if("hidden"===n.getAttribute("type")&&h&&n.parentElement&&n.parentElement.classList.contains("e-multi-line-input")){var p=n.parentElement.querySelector("textarea");p&&this.focusElement(p,e.type)}else this.focusElement(n,e.type);i=!0}}}else{var c=t.extend({},e);c.element=s.querySelector("[name="+K(l.field)+"]"),"string"==typeof l.edit.write?fe(l.edit.write,window)(c):l.edit.write(c)}}},i.prototype.focusElement=function(e,i){var n=this.parent.element.querySelector(".e-edit-checkselect");if(!t.isNullOrUndefined(n)&&n.nextElementSibling&&n.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode)this.focus.onClick({target:t.closest(e,"td")},!0);else{var r=!this.parent.enableVirtualization&&!this.parent.enableColumnVirtualization||"Normal"!==this.parent.editSettings.mode,s=e.classList.contains("e-dropdownlist")?e.parentElement:e;(r||(this.parent.enableVirtualization||this.parent.enableColumnVirtualization)&&"Bottom"===this.parent.editSettings.newRowPosition&&F(e,tn))&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!F(e,tn)||this.parent.addNewRowFocus)?(s.focus(),this.parent.enableVirtualization&&"Normal"===this.parent.editSettings.mode&&this.parent.contentModule&&this.parent.contentModule.content&&(this.parent.contentModule.content.scrollTop+=this.parent.getRowHeight())):s.focus({preventScroll:!0})}e.classList.contains("e-defaultcell")&&e.setSelectionRange(e.value.length,e.value.length)},i.prototype.getEditElements=function(i){var n=this.parent,r={},s="Batch"!==n.editSettings.mode?n.getColumns():[n.getColumnByField(i.columnName)];if(i.isCustomFormValidation&&(s=this.parent.columnModel),this.parent.editSettings.template)return{};for(var o=0,a=s.length;o<a;o++){var l=s[parseInt(o.toString(),10)];if(l.commands||l.commandsTemplate){var d=this.serviceLocator.getService("cellRendererFactory"),h=new mn(this.parent),p=d.getCellRenderer(e.CellType.CommandColumn),c=h.generateRows(i.rowData)[0].cells.filter(function(e){return e.rowID}),u=p.render(c[parseInt(o.toString(),10)],i.rowData,{"data-index":i.row?(parseInt(i.row.getAttribute(an),10)-1).toString():0},this.parent.enableVirtualization);(b=u.firstElementChild).setAttribute("textAlign",u.getAttribute("textAlign")),r[l.uid]=b}else{if("dateonly"===l.type&&i.rowData[l.field]instanceof Date){var g=i.rowData[l.field];i.rowData[l.field]=g.getFullYear()+"-"+ce(g.getMonth()+1)+"-"+ce(g.getDate())}var f={column:l,value:l.valueAccessor(l.field,i.rowData,l),type:i.requestType,data:i.rowData},m=l.edit.create,y=void 0;if(l.editTemplate){y=this.parent.createElement("span",{attrs:{"data-mappinguid":l.uid}});var v=this.parent.element.id+l.uid+"editTemplate",S=Se({},i.rowData,{column:l}),C=this.parent.isReact&&"string"!=typeof l.editTemplate&&!(l.editTemplate.prototype&&l.editTemplate.prototype.CSPTemplate),w=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;C||w?(l.getEditTemplate()(t.extend({index:i.rowIndex},S),this.parent,"editTemplate",v,null,null,y),this.parent.renderTemplates()):q(y,l.getEditTemplate()(t.extend({index:i.rowIndex},S),this.parent,"editTemplate",v,null,null,null,n.root))}else{if("string"==typeof(y="string"==typeof m?(m=fe(m,window))(f):l.edit.create(f))){var b=this.parent.createElement("div");b.innerHTML=y,y=b.firstChild}var I="input"!==y.tagName&&y.querySelectorAll("input").length,x=K(l.field);t.attributes(I?y.querySelector("input"):y,{name:x,"data-mappinguid":l.uid,id:n.element.id+x}),t.classList(y,["e-input","e-field"],[]),"Right"===l.textAlign&&y.classList.add("e-ralign"),((l.isPrimaryKey||l.isIdentity)&&"beginEdit"===i.requestType||l.isIdentity&&"add"===i.requestType)&&y.setAttribute("disabled","")}r[l.uid]=y}}return r},i.prototype.destroy=function(){this.renderer.removeEventListener()},i}(),Ws=function(){function e(e){this.parent=e}return e.prototype.create=function(e){return lt(this.parent,e.column,"e-field",{type:"text"})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.removeEventHandler&&this.removeEventHandler(),this.obj.destroy(),this.obj.element.remove())},e}(),Qs=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Xs=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.activeClasses=["e-selectionbackground","e-active"],t}return Qs(i,e),i.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),this.removeEventHandler=this.removeEventListener,lt(this.parent,e.column,t,{type:"checkbox",value:e.value})},i.prototype.read=function(e){return e.checked},i.prototype.write=function(e){var i,n;if(t.isNullOrUndefined(e.row)||(i=e.row.querySelector(".e-edit-checkselect")),fe(e.column.field,e.rowData)&&(n=JSON.parse(fe(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 s=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));n=!!s&&s.isSelected}ee.apply(void 0,[[].slice.call(e.row.getElementsByClassName(_i)),n].concat(this.activeClasses))}this.obj=new r.CheckBox(t.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:n,disabled:!X(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass?this.parent.cssClass:""},e.column.edit.params)),this.addEventListener(),this.obj.appendTo(e.element)},i.prototype.addEventListener=function(){this.cbChange=this.checkBoxChange.bind(this),this.obj.addEventListener("change",this.cbChange)},i.prototype.removeEventListener=function(){this.obj.isDestroyed||this.obj.removeEventListener("change",this.cbChange)},i.prototype.checkBoxChange=function(e){if(this.editRow&&"Dialog"!==this.editType&&this.editRow.getAttribute("aria-rowindex")){var t=parseInt(this.editRow.getAttribute("aria-rowindex"),10)-1;this.parent.selectionModule.addRowsToSelection([t])}},i}(Ws),Ys=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Js=function(e){function n(t){var i=e.call(this)||this;return i.parent=t,i.flag=!1,i.removeEventHandler=i.removeEventListener,i}return Ys(n,e),n.prototype.write=function(e){var n="Dialog"!==this.parent.editSettings.mode;this.column=e.column;var r=new i.Predicate(e.column.field,"notequal",null,!0,!1),s={};if(e.column.edit.params)for(var a=Object.keys(e.column.edit.params),l=0;l<a.length;l++)s[a[parseInt(l.toString(),10)]]="query"===a[parseInt(l.toString(),10)]?e.column.edit.params[a[parseInt(l.toString(),10)]].clone():e.column.edit.params[a[parseInt(l.toString(),10)]];this.obj=new o.DropDownList(t.extend({dataSource:this.parent.dataSource instanceof i.DataManager?this.parent.dataSource:new i.DataManager(this.parent.dataSource),query:(new i.Query).where(r).select(e.column.field),enabled:X(e.column,e.requestType,e.element)&&Y(F(e.element,"e-rowcell"),this.parent),fields:{value:e.column.field},value:fe(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:n?"":e.column.headerText,popupHeight:"200px",floatLabelType:n?"Never":"Always",sortOrder:"Ascending",cssClass:this.parent.cssClass?this.parent.cssClass:null,close:this.dropDownClose.bind(this)},s)),this.obj.isAngular=Ge(this.parent),this.parent.enableVirtualization&&(s.dataSource?this.obj.dataSource=s.dataSource:this.obj.dataSource=e.column.isForeignColumn()?[e.foreignKeyData[0]]:[e.rowData]),this.addEventListener(),this.obj.query.params=this.parent.query.params,this.obj.appendTo(e.element),e.element.setAttribute("name",K(e.column.field))},n.prototype.dropDownClose=function(e){e.event&&("escape"===e.event.action?this.parent.editModule.editCellDialogClose=!0:this.parent.isEdit&&"Batch"===this.parent.editSettings.mode&&"enter"===e.event.action&&e.event.stopPropagation())},n.prototype.addEventListener=function(){this.ddCreated=this.dropdownCreated.bind(this),this.ddOpen=this.dropDownOpen.bind(this),this.ddBeforeOpen=this.dropdownBeforeOpen.bind(this),this.ddComplete=this.ddActionComplete.bind(this),this.obj.addEventListener("created",this.ddCreated),this.obj.addEventListener(hn,this.ddOpen),this.obj.addEventListener("beforeOpen",this.ddBeforeOpen),this.obj.addEventListener(Ut,this.ddComplete)},n.prototype.removeEventListener=function(){this.obj.isDestroyed||(this.obj.removeEventListener("created",this.ddCreated),this.obj.removeEventListener(hn,this.ddOpen),this.obj.removeEventListener("beforeOpen",this.ddBeforeOpen),this.obj.removeEventListener(Ut,this.ddComplete))},n.prototype.dropdownCreated=function(e){this.flag=!0},n.prototype.dropdownBeforeOpen=function(){this.parent.enableVirtualization&&(this.column.edit.params&&this.column.edit.params.dataSource?this.obj.dataSource=this.column.edit.params.dataSource:this.obj.dataSource=this.column.isForeignColumn()?this.column.dataSource instanceof i.DataManager?this.column.dataSource:new i.DataManager(this.column.dataSource):this.parent.dataSource instanceof i.DataManager?this.parent.dataSource:new i.DataManager(this.parent.dataSource))},n.prototype.ddActionComplete=function(e){e.result=i.DataUtil.distinct(e.result,this.obj.fields.value,!0),!this.flag||!this.column.dataSource||this.column.edit.params&&this.column.edit.params.ddEditedData||("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},n.prototype.dropDownOpen=function(e){var i=F(this.obj.element,"e-dialog");if("Dialog"===this.parent.editSettings.mode&&!t.isNullOrUndefined(i)){var n=t.select("#"+i.id,document).ej2_instances[0];e.popup.element.style.zIndex=(n.zIndex+1).toString()}},n}(Ws),Zs=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){return this.instances=new t.Internationalization(this.parent.locale),lt(this.parent,e.column,"e-field",{})},e.prototype.read=function(e){return this.obj.value},e.prototype.write=function(e){var i=e.column,n="Dialog"!==this.parent.editSettings.mode;this.obj=new s.NumericTextBox(t.extend({value:parseFloat(fe(e.column.field,e.rowData)),enableRtl:this.parent.enableRtl,placeholder:n?"":e.column.headerText,enabled:X(e.column,e.requestType,e.element)&&Y(F(e.element,"e-rowcell"),this.parent),floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",locale:this.parent.locale,cssClass:this.parent.cssClass?this.parent.cssClass:null},i.edit.params)),e.element.setAttribute("name",K(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(),this.obj.element.remove())},e}(),$s=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),eo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $s(i,e),i.prototype.create=function(e){var i={type:"text",value:t.isNullOrUndefined(e.value)?"":e.value},n=lt(this.parent,e.column,"e-field e-input e-defaultcell",i);return e.column.textAlign&&(n.style.textAlign=e.column.textAlign),n},i.prototype.read=function(e){return"hidden"!==e.type||t.isNullOrUndefined(e.ej2_instances[0])||t.isNullOrUndefined(e.ej2_instances[0].textarea)?e.value:e.ej2_instances[0].value},i.prototype.write=function(e){var i,n=e.column,r="Dialog"!==this.parent.editSettings.mode,o={element:e.element,floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",enableRtl:this.parent.enableRtl,enabled:X(e.column,e.requestType,e.element)&&Y(F(e.element,"e-rowcell"),this.parent),placeholder:r?"":e.column.headerText,cssClass:this.parent.cssClass?this.parent.cssClass:""};if(!t.isNullOrUndefined(n.edit)&&!t.isNullOrUndefined(n.edit.params)&&n.edit.params.multiline){var a=n.valueAccessor(n.field,e.rowData,n);o.value=a,i=o.element.getAttribute("data-mappinguid"),o.element.removeAttribute("data-mappinguid"),o.element.setAttribute("e-mappinguid",i)}this.obj=new s.TextBox(t.extend(o,n.edit.params)),this.obj.appendTo(e.element),t.isNullOrUndefined(i)||(this.obj.element.removeAttribute("e-mappinguid"),this.obj.element.setAttribute("data-mappinguid",i)),"Batch"===this.parent.editSettings.mode&&this.obj.element.addEventListener("keydown",this.keyEventHandler)},i.prototype.keyEventHandler=function(e){if("Enter"===e.key||"Tab"===e.key){var t=new Event("change",{bubbles:!1,cancelable:!0});this.dispatchEvent(t)}},i.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())},i}(Ws),to=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 i=e.target,n=this.parent;n.editSettings.showAddNewRow&&t.isNullOrUndefined(n.element.querySelector("."+en))||(F(i,Wi)&&F(F(i,Wi),"e-grid").id===n.element.id||(n.frozenRows||n.pinnedTopRecords.length)&&F(i,Xi)&&!F(i,"e-columnheader"))&&!F(i,"e-unboundcelldiv")&&(this.rowIndex=F(i,_i)?parseInt(F(i,_i).parentElement.getAttribute(an),10)-1:-1,n.isEdit&&n.editModule.endEdit())},e.prototype.dblClickHandler=function(e){!F(e.target,_i)||!this.parent.editSettings.allowEditOnDblClick||this.parent.editSettings.showAddNewRow&&(!this.parent.editSettings.showAddNewRow||F(e.target,"e-addedrow"))||e.target&&(e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand"))||this.parent.editModule.startEdit(F(e.target,Zi))},e.prototype.editComplete=function(e){this.parent.isEdit=!!this.parent.editSettings.showAddNewRow;switch(e.requestType){case"save":(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&this.parent.isPersistSelection||"edit"===e.action||this.parent.editSettings.showAddNewRow&&(!this.parent.editSettings.showAddNewRow||"add"===e.action)||(this.parent.allowPaging&&e.index>0&&(e.index=this.parent.pageSettings.currentPage===Math.floor(e.index/this.parent.pageSettings.pageSize)+1?e.index%this.parent.pageSettings.pageSize:-1),this.parent.enableVirtualization&&e.index>0&&(this.parent.selectVirtualRowOnAdd=!0),this.parent.isTreeGrid&&this.parent.enableVirtualization&&(this.parent.sortSettings&&this.parent.sortSettings.columns.length||this.parent.filterSettings&&this.parent.filterSettings.columns.length||this.parent.searchSettings&&this.parent.searchSettings.key.length)||this.parent.selectRow(e.index)),this.parent.trigger(Ut,t.extend(e,{requestType:"save",type:Ut})),this.parent.notify("close-edit",{requestType:"save",action:e.action});break;case"delete":this.parent.trigger(Ut,t.extend(e,{requestType:"delete",type:Ut})),this.parent.isCheckBoxSelection||this.parent.enableInfiniteScrolling&&(this.parent.childGrid||this.parent.detailTemplate)||this.parent.selectRow(this.editRowIndex),this.parent.notify("close-edit",{requestType:"delete",action:e.action});break;case"refresh-aggregate-on-save":this.parent.trigger(Ut,t.extend(e,{requestType:"refresh-aggregate-on-save",type:Ut})),this.parent.selectRow(this.rowIndex),this.parent.notify("close-edit",{requestType:"refresh-aggregate-on-save",action:e.action})}},e.prototype.getEditArgs=function(e,t,i){for(var n=this.parent.getPrimaryKeyFieldNames(),r=[],s=0;s<n.length;s++)r.push(fe(n[parseInt(s.toString(),10)],e));return{primaryKey:n,primaryKeyValue:r,requestType:"beginEdit",rowData:e,rowIndex:this.rowIndex,type:"edit",cancel:!1,foreignKeyData:t&&t.foreignKeyData,target:void 0,isScroll:i}},e.prototype.startEdit=function(e){var i=this,n=this.parent;if(this.rowIndex=this.editRowIndex=parseInt(e.getAttribute(an),10)-1,n.enableVirtualization||n.enableColumnVirtualization||n.enableInfiniteScrolling){var r='.e-row[aria-rowindex="'+(this.rowIndex+1)+'"]';if(!this.parent.element.querySelector(r))return}var s={data:void 0,index:this.rowIndex,isScroll:!1};if(this.parent.notify("virtual-scroll-edit-action-begin",s),ge(n)){var o=n.getRowObjectFromUID(e.getAttribute("data-uid"));this.previousData=o.data}else this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.enableInfiniteScrolling&&(!this.previousData||this.parent.infiniteScrollSettings.enableCache)?this.previousData=s.data:this.parent.enableVirtualization||(this.previousData=t.extend({},{},this.parent.getForeignKeyColumns().length||this.parent.allowGrouping&&this.parent.groupSettings.columns.length||this.parent.pinnedTopRowModels.length?this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data:n.getCurrentViewRecords()[this.rowIndex],!0));var a=t.extend({},{},s.data||this.previousData,!0);this.uid=e.getAttribute("data-uid");var l=n.getRowObjectFromUID(this.uid),d=this.getEditArgs(a,l,s.isScroll);d.row=e,d.isScroll?this.inlineEditHandler(d,e):(this.parent.notify("create-virtual-validation-form",{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),n.trigger("beginEdit",d,function(t){t.type="actionBegin",n.trigger(qt,t,function(t){t.cancel||i.inlineEditHandler(t,e)})}))},e.prototype.disabledShowAddRow=function(e,i){var n=this.parent.element.querySelector(".e-addedrow"),r=[].slice.call(n?n.querySelectorAll(".e-input"):[]);if(n&&n.querySelector(".e-unboundcell"))for(var s=[].slice.call(n.querySelector(".e-unboundcell").querySelectorAll(".e-btn")),o=0;o<s.length;o++)e?(s[parseInt(o.toString(),10)].classList.remove("e-disabled"),s[parseInt(o.toString(),10)].removeAttribute("disabled")):(s[parseInt(o.toString(),10)].classList.add("e-disabled"),s[parseInt(o.toString(),10)].setAttribute("disabled","disabled"));if(r.length)for(o=0;o<r.length;o++){var a=r[parseInt(o.toString(),10)],l=a.getAttribute("data-mappinguid"),d=this.parent.getColumnByUid(l),h=F(a,"e-rowcell").querySelector(".e-error");h&&h.classList.remove("e-error"),a.ej2_instances?(i&&t.isNullOrUndefined(d.defaultValue)&&("checkbox"===a.type?(a.ej2_instances[0].checked=!1,a.checked=!1):(a.ej2_instances[0].value=null,a.value=null)),"checkbox"!==a.type||t.isNullOrUndefined(e)?t.isNullOrUndefined(e)||(a.ej2_instances[0].enabled=!(!e||!d.allowEditing)):a.ej2_instances[0].disabled=!e||!d.allowEditing):(i&&a.value&&a.value.length&&t.isNullOrUndefined(d.defaultValue)&&(a.value=null),t.isNullOrUndefined(e)||(e?d.allowEditing&&(a.classList.remove("e-disabled"),a.removeAttribute("disabled")):(a.classList.add("e-disabled"),a.setAttribute("disabled","disabled"))))}},e.prototype.inlineEditHandler=function(e,t){var i=this.parent;i.isEdit=!0,e.row=e.row?e.row:t,"Dialog"!==i.editSettings.mode&&i.clearSelection(),"Dialog"===i.editSettings.mode&&i.selectionModule&&(i.selectionModule.preventFocus=!0,e.row.classList.add("e-dlgeditrow")),this.renderer.update(e),this.uid=t.getAttribute("data-uid"),i.editModule.applyFormValidation(),i.editSettings.showAddNewRow&&!t.classList.contains("e-addedrow")&&this.disabledShowAddRow(!1,!0),e.type="actionComplete",i.trigger(Ut,e),i.editSettings.template&&i.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e,this.parent.allowTextWrap&&this.parent.notify(Ri,{case:"textwrap"})},e.prototype.updateRow=function(e,t){var i=this,n=this.parent;this.editRowIndex=e;var r=n.getRowByIndex(e);if(r){var s={requestType:"save",action:"edit",type:qt,data:t,cancel:!1,previousData:n.getCurrentViewRecords()[parseInt(e.toString(),10)],row:r};if(n.showSpinner(),n.enableInfiniteScrolling){this.uid=s.row.getAttribute("data-uid");var o=parseInt(s.row.getAttribute("aria-rowindex"),10)-1;this.parent.notify("refresh-infinite-editrowindex",{index:o})}n.notify(wi,s),s.promise?s.promise.then(function(){return n.refresh()}).catch(function(e){return i.edFail(e)}):n.enableInfiniteScrolling||(n.refresh(),n.enableVirtualization&&(n.contentModule.vgenerator.startIndex=null))}},e.prototype.editFormValidate=function(){var e=this.parent,t=e.editModule.editFormValidate(),i={prevData:this.previousData,isValid:!0,editIdx:this.editRowIndex,addIdx:this.addedRowIndex};return e.notify("validate-virtual-form",i),t&&i.isValid},e.prototype.endEdit=function(){var e=this,i=this.parent;if(this.parent.isEdit&&this.editFormValidate()){var n=t.extend({},{},this.previousData,!0),r=t.extend(this.args,{requestType:"save",type:qt,data:n,cancel:!1,previousData:this.previousData,selectedRow:i.selectedRowIndex,foreignKeyData:{}}),s="Dialog"===i.editSettings.mode,o=t.select("#"+i.element.id+"_dialogEdit_wrapper",document),a=s?o.querySelector(".e-gridform"):i.editSettings.showAddNewRow&&i.element.querySelector("."+en)?i.element.querySelector("."+en).getElementsByClassName("e-gridform")[0]:i.element.getElementsByClassName("e-gridform")[0],l={virtualData:t.extend({},{},this.previousData,!0),isAdd:!1,isScroll:!1,endEdit:!0};this.parent.enableVirtualization&&this.parent.editSettings&&"Normal"===this.parent.editSettings.mode?(l.virtualData=this.virtualEditValidationArgs.virtualData,l.isAdd=this.virtualEditValidationArgs.isAdd,l.isCancel=this.virtualEditValidationArgs.isCancel):this.parent.notify("get-virtual-data",l),(this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.enableInfiniteScrolling)&&"Normal"===this.parent.editSettings.mode&&Object.keys(l.virtualData).length?this.parent.isEdit&&(this.currentVirtualData=n=r.data=l.virtualData):n=i.editModule.getCurrentEditedData(a,n);var d=[].slice.call(i.element.getElementsByClassName(en)).length;if(l.isAdd||!Object.keys(this.currentVirtualData).length||d||(d=1),s?o.getElementsByClassName(en).length:d)r.action="edit",i.trigger(qt,r,function(t){t.cancel||("Spinner"===e.parent.loadingIndicator.indicatorType&&i.showSpinner(),"Shimmer"===e.parent.loadingIndicator.indicatorType&&e.parent.showMaskRow(),i.editSettings.showAddNewRow&&e.disabledShowAddRow(!0),i.notify(wi,t))});else{if(r.action="add",r.selectedRow=0,r.index=this.addedRowIndex,i.notify("virtual-scroll-edit-success",{}),i.notify(ni,r),this.addedRowIndex=null,r.cancel)return;this.parent.editSettings.showAddNewRow&&(this.parent.notify(zi,{}),(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.disabledShowAddRow(!0,!0),"Dialog"!==i.editSettings.mode&&t.isNullOrUndefined(i.editSettings.template)&&(i.editModule.destroyWidgets(),i.editModule.destroyForm()))}}},e.prototype.destroyElements=function(){var e=this.parent;(!e.editSettings.showAddNewRow||e.editSettings.showAddNewRow&&e.element.querySelector(".e-editedrow"))&&(e.editModule.destroyWidgets(),e.editModule.destroyForm(),"Dialog"!==e.editSettings.mode&&t.isNullOrUndefined(e.editSettings.template)&&(e.editModule.formObj=null)),this.parent.notify(Ii,{})},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),this.parent.editSettings.showAddNewRow&&this.parent.editModule.applyFormValidation()},e.prototype.edSucc=function(e,t){this.editSuccess(e,t)},e.prototype.edFail=function(e){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)}if(this.requestSuccess(i),this.parent.trigger("beforeDataBound",i),i.type=Ut,this.parent.isEdit=!!this.parent.editSettings.showAddNewRow,this.parent.renderModule.resetPartialRecords(),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(),this.editRowIndex=null,this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.showGroupedColumn){for(var n=i.row,r=this.parent.getRowsObject(),s=n.getAttribute("data-uid"),o=this.parent.getRowObjectFromUID(s),a=this,l=0;l<this.parent.groupSettings.columns.length;l++)!function(e){var n=a;r=r.filter(function(r){var s=r.isDataRow&&r!==o&&!t.isNullOrUndefined(r.data);if(s){for(var a=n.parent.groupSettings.columns[parseInt(e.toString(),10)].split("."),l=r.data[a[0]],d=i.data[a[0]],h=1;h<a.length;h++)l=l[a[h]],d=d[a[h]];return s&&l===d}return s})}(l);var d=r[0];t.isNullOrUndefined(o)||t.isNullOrUndefined(d)||o.parentUid===d.parentUid?!this.parent.groupSettings.enableLazyLoading&&this.parent.aggregates.length&&(this.parent.enableVirtualization||this.parent.allowPaging&&this.parent.groupSettings.disablePageWiseAggregates)?this.parent.notify(ni,{requestType:"refresh-aggregate-on-save",action:"update"}):this.parent.aggregates.length&&this.parent.aggregateModule.refresh(i.data,this.parent.groupSettings.enableLazyLoading?i.row:void 0):this.parent.groupModule.groupedRowReorder(o,d)}else!this.parent.groupSettings.enableLazyLoading&&this.parent.aggregates.length&&(this.parent.enableVirtualization||this.parent.allowPaging&&this.parent.groupSettings.disablePageWiseAggregates)?this.parent.notify(ni,{requestType:"refresh-aggregate-on-save",action:"update"}):this.parent.aggregates.length&&this.parent.aggregateModule.refresh(i.data,this.parent.groupSettings.enableLazyLoading?i.row:void 0);this.parent.trigger(Ut,i),(!this.parent.isCheckBoxSelection&&"Multiple"!==this.parent.selectionSettings.type||!this.parent.isPersistSelection&&!this.parent.selectionSettings.checkboxOnly)&&"Dialog"!==this.parent.editSettings.mode&&this.parent.selectRow(this.rowIndex>-1?this.rowIndex:this.editRowIndex),this.parent.notify("close-edit",{requestType:i.requestType,action:i.action}),this.parent.aggregates.length&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&(this.parent.groupModule.getGroupAggregateTemplates(!0).length||this.parent.groupModule.getGroupAggregateTemplates(!1).length)||(this.parent.removeMaskRow(),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"))},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 n=e[parseInt(i.toString(),10)];n.template&&t.updateBlazorTemplate(this.parent.element.id+n.uid,"Template",n,!1),n.editTemplate&&t.updateBlazorTemplate(this.parent.element.id+n.uid+"editTemplate","EditTemplate",n)}},e.prototype.editFailure=function(e){e.cancel||(this.parent.removeMaskRow(),this.parent.trigger(Ht,{error:e}),this.parent.hideSpinner(),this.parent.log("actionfailure",{error:e}))},e.prototype.needRefresh=function(){var e=!0,t=this.parent.element.querySelector(".e-normaledit");return!this.parent.enableVirtualization&&!this.parent.infiniteScrollSettings.enableCache||"Normal"!==this.parent.editSettings.mode||t||(e=!1),e},e.prototype.refreshRow=function(e){var t=new fn(this.serviceLocator,null,this.parent),i=this.parent.getRowObjectFromUID(this.uid);if(i){if(i.changes=e,this.parent.notify("refresh-virtual-cache",{data:e}),de(i,this.parent.getForeignKeyColumns(),i.changes),this.needRefresh()){var n=this.parent.getPrimaryKeyFieldNames()[0],r=void 0;if(i.index<this.parent.pinnedTopRowModels.length){var s=this.parent.getRowIndexByPrimaryKey(e),o=this.parent.getRowByIndex(s);o&&(r=this.parent.getRowObjectFromUID(o.getAttribute("data-uid")))}else r=this.parent.getPinnedRowObjectByKey(e[""+n]);r&&(r.changes=e,de(r,this.parent.getForeignKeyColumns(),r.changes),t.refresh(r,this.parent.getColumns(),!0)),t.refresh(i,this.parent.getColumns(),!0)}for(var a=[].slice.call(this.parent.element.querySelectorAll('[aria-rowindex="'+(i.index+1)+'"]')),l=0;l<a.length;l++)if(Xe(a[parseInt(l.toString(),10)]),this.parent.enableColumnVirtualization&&a[parseInt(l.toString(),10)].querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze").length)for(var d=this.parent.getColumns(),h=[].slice.call(a[parseInt(l.toString(),10)].querySelectorAll(".e-leftfreeze,.e-rightfreeze.e-fixedfreeze")),p=0;p<h.length;p++)if(h[parseInt(p.toString(),10)].classList.contains("e-leftfreeze"))h[parseInt(p.toString(),10)].style.left=d[parseInt(p.toString(),10)].valueX-this.parent.translateX+"px";else if(h[parseInt(p.toString(),10)].classList.contains("e-rightfreeze")){var c=parseInt(h[parseInt(p.toString(),10)].getAttribute("aria-colindex"),10)-1;h[parseInt(p.toString(),10)].style.right=d[parseInt(c.toString(),10)].valueX+this.parent.translateX+"px"}else h[parseInt(p.toString(),10)].style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",h[parseInt(p.toString(),10)].style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px"}},e.prototype.closeEdit=function(){var e=this;if(!this.parent.isEdit||this.parent.editSettings.showAddNewRow&&this.parent.element.querySelector(".e-addedrow")&&t.isNullOrUndefined(this.parent.element.querySelector("."+en)))return void(this.parent.editSettings.showAddNewRow&&(this.disabledShowAddRow(!0,!0),this.parent.notify(zi,{})));var i=this.parent,n=t.extend(this.args,{requestType:"cancel",type:qt,cancel:!1,data:this.previousData,selectedRow:i.selectedRowIndex});i.notify("virtual-scroll-edit-cancel",n),this.blazorTemplate(),i.trigger(qt,n,function(t){if(!t.cancel){e.parent.notify("destroy-edit-form",n),"Dialog"===e.parent.editSettings.mode&&e.parent.notify(Ii,{}),t.type=Ut,e.parent.editSettings.showAddNewRow||(i.isEdit=!1),"Dialog"!==i.editSettings.mode&&e.refreshRow(t.data),e.stopEditStatus(),i.isEdit=!1,i.editSettings.showAddNewRow&&(e.disabledShowAddRow(!0),i.editModule.applyFormValidation(),i.isEdit=!0);var r=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")||r||i.renderModule.emptyRow(),"Dialog"!==i.editSettings.mode&&i.selectRow(e.rowIndex),i.trigger(Ut,t)}})},e.prototype.addRecord=function(e,n){var r=this,s=this.parent;if(this.addedRowIndex=n=t.isNullOrUndefined(n)?0:n,e)return void s.notify(ni,{requestType:"save",type:qt,data:e,selectedRow:0,action:"add",index:n});if(!s.isEdit){this.previousData={},this.uid="";var o=s.getColumns(),a={virtualData:{},isScroll:!1};s.editSettings.showAddNewRow||this.parent.notify("get-virtual-data",a);for(var l=0;l<o.length;l++)a.isScroll||o[parseInt(l.toString(),10)].field&&("string"===o[parseInt(l.toString(),10)].type&&(o[parseInt(l.toString(),10)].defaultValue=this.parent.sanitize(o[parseInt(l.toString(),10)].defaultValue)),i.DataUtil.setValue(o[parseInt(l.toString(),10)].field,o[parseInt(l.toString(),10)].defaultValue,this.previousData));var d={cancel:!1,foreignKeyData:{},requestType:"add",data:this.previousData,type:qt,index:n,rowData:this.previousData,target:void 0,isScroll:a.isScroll};(this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.infiniteScrollSettings.enableCache)&&Object.keys(a.virtualData).length&&(d.data=d.rowData=a.virtualData),d.isScroll?this.inlineAddHandler(d):(this.parent.notify("create-virtual-validation-form",{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),s.editSettings.showAddNewRow?this.inlineAddHandler(d):s.trigger(qt,d,function(e){e.cancel||r.inlineAddHandler(e)}))}},e.prototype.inlineAddHandler=function(e){var t=this.parent;if(t.isEdit=!0,"Dialog"!==t.editSettings.mode&&t.clearSelection(),this.renderer.addNew(e),this.parent.isEdit&&!this.parent.isPersistSelection){var i=this.parent.getHeaderContent().querySelector(".e-checkselectall");i&&i.parentElement.classList.add("e-checkbox-disabled")}t.editModule.applyFormValidation(),e.type=Ut,e.row=t.element.querySelector("."+tn),t.editSettings.showAddNewRow||t.trigger(Ut,e),t.editSettings.template&&t.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e},e.prototype.deleteRecord=function(e,i){this.editRowIndex=this.parent.selectedRowIndex;var n=this.parent;if(i){i=i instanceof Array?i:[i];var r=Object.keys(i).length;e=e||this.parent.getPrimaryKeyFieldNames()[0];for(var s=0;s<r;s++)!function(t){var r,s,o=n.currentViewData.some(function(n){return s=n,i[parseInt(t.toString(),10)]===fe(e,n)||i[parseInt(t.toString(),10)]===n});i[parseInt(t.toString(),10)]=o?s:i[parseInt(t.toString(),10)][""+e]?i[parseInt(t.toString(),10)]:(r={},r[e]=i[parseInt(t.toString(),10)],r)}(s)}var o={requestType:"delete",type:qt,foreignKeyData:{},data:i||this.parent.getSelectedRecords(),tr:this.parent.getSelectedRows(),cancel:!1};t.isNullOrUndefined(this.parent.commandDelIndex)||(o.data[0]=this.parent.getRowObjectFromUID(this.parent.getRowByIndex(this.parent.commandDelIndex).getAttribute("data-uid")).data);var a=o.data;if(this.parent.pinnedTopRecords.length&&a.length)for(var l=this.parent.getPrimaryKeyFieldNames()[0],d=this,h=0,p=a;h<p.length;h++)!function(e){var t=d.parent.pinnedTopRecords.findIndex(function(t){return t[""+l]===e[""+l]});-1!==t&&d.parent.pinnedTopRowKeys[e[""+l]]&&(d.parent.pinnedTopRecords.splice(t,1),d.parent.pinnedTopRowKeys[e[""+l]]=!1)}(p[h]);this.parent.notify(ni,o)},e.prototype.stopEditStatus=function(){for(var e=this.parent,i=[].slice.call(e.editSettings.showAddNewRow?[]:e.element.getElementsByClassName(tn)),n=[].slice.call(e.element.getElementsByClassName(en)),r=0;r<i.length;r++)t.remove(i[parseInt(r.toString(),10)]);for(r=0;r<n.length;r++)n[parseInt(r.toString(),10)].classList.remove(en)},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:"crud-Action",handler:this.editHandler},{event:"double-tap",handler:this.dblClickHandler},{event:hi,handler:this.clickHandler},{event:"recordAdded",handler:this.requestSuccess},{event:"dblclick",handler:this.dblClickHandler},{event:"delete-complete",handler:this.editComplete},{event:"save-complete",handler:this.editComplete},{event:"row-mode-change",handler:this.closeEdit},{event:"closeinline",handler:this.closeForm},{event:"refresh-aggregate-on-save-complete",handler:this.editComplete}],at(this.parent,this.evtHandlers,!0,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||at(this.parent,this.evtHandlers,!1)},e.prototype.destroy=function(){this.removeEventListener(),this.renderer.destroy()},e}(),io=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),no=function(e){function t(t,i,n){var r=e.call(this,t,i)||this;return r.parent=t,r.serviceLocator=i,r.renderer=n,r}return io(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}(to),ro=function(){function n(e,t,i){this.cellDetails={},this.originalCell={},this.cloneCell={},this.editNext=!1,this.preventSaveCell=!1,this.initialRender=!0,this.validationColObj=[],this.addBatchRow=!1,this.prevEditedBatchCell=!1,this.parent=e,this.serviceLocator=t,this.renderer=i,this.focus=t.getService("focus"),this.addEventListener()}return n.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:hi,handler:this.clickHandler},{event:"dblclick",handler:this.dblClickHandler},{event:li,handler:this.onBeforeCellFocused},{event:"cellfocused",handler:this.onCellFocused},{event:"double-tap",handler:this.dblClickHandler},{event:di,handler:this.keyDownHandler},{event:"editNextValCell",handler:this.editNextValCell},{event:pi,handler:this.destroy}],at(this.parent,this.evtHandlers,!0,this),t.EventHandler.add(this.parent.element,"mousedown",this.mouseDownHandler,this),this.dataBoundFunction=this.dataBound.bind(this),this.batchCancelFunction=this.batchCancel.bind(this),this.parent.addEventListener(jt,this.dataBoundFunction),this.parent.addEventListener("batchCancel",this.batchCancelFunction))},n.prototype.removeEventListener=function(){this.parent.isDestroyed||(at(this.parent,this.evtHandlers,!1),t.EventHandler.remove(this.parent.element,"mousedown",this.mouseDownHandler),this.parent.removeEventListener(jt,this.dataBoundFunction),this.parent.removeEventListener("batchCancel",this.batchCancelFunction))},n.prototype.batchCancel=function(){this.parent.focusModule.restoreFocus({requestType:"batchCancel"})},n.prototype.dataBound=function(){this.parent.notify("toolbar-refresh",{})},n.prototype.destroy=function(){this.removeEventListener()},n.prototype.mouseDownHandler=function(e){t.isNullOrUndefined(this.parent.element.querySelector(".e-gridform"))?this.mouseDownElement=void 0:this.mouseDownElement=e.target},n.prototype.clickHandler=function(e){F(e.target,this.parent.element.id+"_add",!0)||((this.parent.isEdit&&t.closest(this.form,"td")!==t.closest(e.target,"td")&&t.isNullOrUndefined(this.mouseDownElement)||this.mouseDownElement===e.target)&&(this.saveCell(),this.editNextValCell()),F(e.target,_i)&&!this.parent.isEdit&&this.setCellIdx(e.target))},n.prototype.dblClickHandler=function(e){var i=F(e.target,_i),n=F(e.target,Zi),r=n&&parseInt(n.getAttribute(an),10)-1,s=i&&parseInt(i.getAttribute(on),10)-1;t.isNullOrUndefined(i)||t.isNullOrUndefined(r)||isNaN(s)||i.parentElement.classList.contains(en)||!this.parent.getColumns()[parseInt(s.toString(),10)].allowEditing||this.editCell(r,this.parent.getColumns()[parseInt(s.toString(),10)].field,this.isAddRow(r))},n.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())},n.prototype.onCellFocused=function(e){var i=!(e.container.isContent&&e.container.isDataCell||(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&e.container.isHeader);if(this.parent.focusModule.active&&(this.prevEditedBatchCell=this.parent.focusModule.active.matrix.current.toString()===this.prevEditedBatchCellMatrix().toString(),this.crtRowIndex=[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf(t.closest(e.element,"tr"))),!e.byKey||i)return void(this.parent.isEdit&&i&&this.saveCell());var n=e.container.indexes,r=n[0],s=n[1],o=e.element.getAttribute("aria-colindex")?parseInt(e.element.getAttribute("aria-colindex"),10)-1:s;o!==s&&(s=o),this.parent.frozenRows&&e.container.isContent&&(r+=(this.parent.getContent().querySelector(".e-hiddenrow")?0:this.parent.frozenRows)+this.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length);var a=this.parent.isEdit;if(!this.parent.element.getElementsByClassName("e-popup-open").length)switch(a=a&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":var l=this.parent.isRowDragable()&&this.parent.isDetail()?2:this.parent.isRowDragable()||this.parent.isDetail()?1:0,d=this.parent.getColumns()[s-l];d&&!this.parent.isEdit&&this.editCell(r,d.field),(a||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(r,s);break;case"enter":case"shiftEnter":e.keyArgs.preventDefault();var h={cancel:!1,keyArgs:e.keyArgs};this.parent.notify("beforeFocusCellEdit",h),!h.cancel&&a&&this.editCell(r,this.cellDetails.column.field);break;case"f2":this.editCellFromIndex(r,s),this.focus.focus()}},n.prototype.isAddRow=function(e){return this.parent.getDataRows()[parseInt(e.toString(),10)].classList.contains("e-insertedrow")},n.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[parseInt(t.toString(),10)].field,this.isAddRow(e))},n.prototype.closeEdit=function(){var e=this.parent,t=this.parent.getRowsObject();this.parent.pinnedTopRowModels.length&&(t=t.concat(this.parent.pinnedTopRowModels));var i={cancel:!1,batchChanges:this.getBatchChanges()};if(e.notify("before-batch-cancel",i),!i.cancel){e.isEdit&&this.saveCell(!0),this.isAdded=!1;var n=[];e.selectionModule&&(n=e.selectionModule.selectedRowIndexes),e.clearSelection();for(var r=0;r<t.length;r++){var s=!1,o=t[parseInt(r.toString(),10)].isDirty;(s=this.removeBatchElementChanges(t[parseInt(r.toString(),10)],o))&&t.splice(r,1),s&&r--}e.getContentTable().querySelector("tr.e-row")||e.renderModule.renderEmptyRow();var a={requestType:"batchCancel",rows:this.parent.getRowsObject()};e.notify("batchCancel",{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new ji({isDataRow:!0,cells:[new Vi({isDataCell:!0,visible:!0})]})]}),e.isCheckBoxSelection&&(e.selectionSettings.checkboxOnly||e.selectionSettings.persistSelection)?e.selectRows(n):e.selectRow(this.cellDetails.rowIndex),this.refreshRowIdx(),e.notify("toolbar-refresh",{}),this.parent.notify("tooltip-destroy",{}),a={requestType:"batchCancel",rows:this.parent.getRowsObject()},e.trigger("batchCancel",a)}},n.prototype.removeBatchElementChanges=function(e,i){var n=this.parent,r=new fn(this.serviceLocator,null,this.parent),s=!1;if(i){e.isDirty=i;var o=n.getRowElementByUID(e.uid);if(o&&(o.classList.contains("e-insertedrow")?(t.remove(o),s=!0):(de(e,this.parent.getForeignKeyColumns(),e.data),delete e.changes,delete e.edit,e.isDirty=!1,t.classList(o,[],["e-hiddenrow","e-updatedtd"]),r.refresh(e,n.getColumns(),!1)),this.parent.aggregates.length>0)){var a=[];a.type="cancel",this.parent.notify("refresh-footer-rendered",a),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",a)}}return s},n.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.isReact||this.parent.isVue||this.parent.notify("refresh-footer-rendered",{}),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",{}),(this.parent.isReact||this.parent.isVue)&&this.parent.notify("refresh-footer-rendered",{}))},n.prototype.addRecord=function(e){this.bulkAddRow(e)},n.prototype.endEdit=function(){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},n.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},n.prototype.batchSave=function(){var e=this.parent;if(e.isCheckBoxSelection){var i=e.element.querySelector(".e-checkselectall").parentElement;i.classList.contains("e-checkbox-disabled")&&e.pageSettings.totalRecordsCount>e.currentViewData.length&&t.removeClass([i],["e-checkbox-disabled"])}if(this.saveCell(),!(e.isEdit||this.editNextValCell()||e.isEdit)){var n=this.getBatchChanges();"Multiple"===this.parent.selectionSettings.type&&n.deletedRecords.length&&this.parent.selectionSettings.persistSelection&&(n.deletedRecords=this.removeSelectedData,this.removeSelectedData=[]);var r={changedRecords:this.parent.getRowsObject().filter(function(e){return e.isDirty&&-1===["add","delete"].indexOf(e.edit)}).map(function(e){return e.data})},s={batchChanges:n,cancel:!1};e.trigger("beforeBatchSave",s,function(t){t.cancel||(e.showSpinner(),e.notify("bulk-save",{changes:n,original:r}))})}},n.prototype.getBatchChanges=function(){var e={addedRecords:[],deletedRecords:[],changedRecords:[]},t=this.parent.getRowsObject();this.parent.pinnedTopRowModels.length&&(t=t.concat(this.parent.pinnedTopRowModels));for(var i=0,n=t;i<n.length;i++){var r=n[i];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},n.prototype.removeRowObjectFromUID=function(e){for(var t=this.parent.getRowsObject(),i=0,n=t.length;i<n&&t[parseInt(i.toString(),10)].uid!==e;i++);t.splice(i,1)},n.prototype.addRowObject=function(e){var t=this.parent,i="Top"===t.editSettings.newRowPosition,n=e.clone();i?t.getRowsObject().unshift(n):t.getRowsObject().push(n)},n.prototype.bulkDelete=function(e,i){var n=this;this.removeSelectedData=[];var r=this.parent,s=r.selectedRowIndex,o=r.getSelectedRows(),a={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:s,rowData:i||r.getSelectedRecords(),cancel:!1};a.row=i?r.editModule.deleteRowUid?r.getRowElementByUID(r.editModule.deleteRowUid):r.getRows()[r.getCurrentViewRecords().indexOf(i)]:o,a.row&&r.trigger("beforeBatchDelete",a,function(e){if(!e.cancel){if(n.removeSelectedData=r.getSelectedRecords(),r.clearSelection(),e.row=e.row?e.row:i?r.getRows()[parseInt(s.toString(),10)]:o,1===o.length||i){Array.isArray(e.row)&&(e.row=e.row[0]);var a=e.row.getAttribute("data-uid");if(a=i&&n.parent.editModule.deleteRowUid?a=n.parent.editModule.deleteRowUid:a,e.row.classList.contains("e-insertedrow"))n.removeRowObjectFromUID(a),t.remove(e.row);else{var l=r.getRowObjectFromUID(a);l.isDirty=!0,l.edit="delete",t.classList(e.row,["e-hiddenrow","e-updatedtd"],[]),r.frozenRows&&s<r.frozenRows&&r.getDataRows().length>=r.frozenRows&&r.getHeaderTable().querySelector(ln).appendChild(r.getRowByIndex(r.frozenRows-1))}delete e.row}else{i&&(s=parseInt(e.row.getAttribute(an),10)-1);for(var d=0;d<o.length;d++){var h=o[parseInt(d.toString(),10)].getAttribute("data-uid");if(o[parseInt(d.toString(),10)].classList.contains("e-insertedrow"))n.removeRowObjectFromUID(h),t.remove(o[parseInt(d.toString(),10)]);else{t.classList(o[parseInt(d.toString(),10)],["e-hiddenrow","e-updatedtd"],[]);var p=r.getRowObjectFromUID(h);p.isDirty=!0,p.edit="delete",r.frozenRows&&s<r.frozenRows&&r.getDataRows().length>=r.frozenRows&&r.getHeaderTable().querySelector(ln).appendChild(r.getRowByIndex(r.frozenRows-1))}}delete e.row}n.refreshRowIdx(),i&&(r.editModule.deleteRowUid=void 0),r.isCheckBoxSelection||r.selectRow(s),r.trigger("batchDelete",e),r.notify("batchDelete",{rows:n.parent.getRowsObject()}),r.focusModule.restoreFocus({requestType:"batchDelete"}),r.notify("toolbar-refresh",{}),r.getContentTable().querySelector("tr.e-row")||r.renderModule.renderEmptyRow()}})},n.prototype.refreshRowIdx=function(){for(var e=this.parent,t=e.getAllDataRows(!0),i=e.getRowsObject().filter(function(e){return!e.isDetailRow}),n=0,r=0,s=t.length;n<s;n++)t[parseInt(n.toString(),10)].classList.contains(Zi)&&!t[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")?(t[parseInt(n.toString(),10)].setAttribute(an,(r+1).toString()),i[parseInt(n.toString(),10)].index=r,r++):(t[parseInt(n.toString(),10)].removeAttribute(an),i[parseInt(n.toString(),10)].index=-1)},n.prototype.bulkAddRow=function(i){var n=this,r=this.parent;if(!r.editSettings.allowAdding)return void(r.isEdit&&this.saveCell());if(r.isEdit&&(this.saveCell(),this.parent.notify("editNextValCell",{})),!this.validateFormObj()){if(this.initialRender){for(var s=r.getVisibleColumns(),o=0;o<s.length;o++)if(s[parseInt(o.toString(),10)].validationRules&&s[parseInt(o.toString(),10)].validationRules.required){var a={field:s[parseInt(o.toString(),10)].field.slice(),cellIdx:o};this.validationColObj.push(a)}this.initialRender=!1}this.parent.element.classList.add("e-editing");var l={defaultData:i||this.getDefaultData(),primaryKey:r.getPrimaryKeyFieldNames(),cancel:!1};r.trigger("beforeBatchAdd",l,function(s){if(!s.cancel){n.isAdded=!0,r.clearSelection();var o=new fn(n.serviceLocator,null,n.parent),a=new mn(n.parent).generateRows([s.defaultData]),l=o.render(a[0],r.getColumns());Xe(l);for(var d,h,p=0;p<n.parent.groupSettings.columns.length;p++)l.insertBefore(n.parent.createElement("td",{className:"e-indentcell"}),l.firstChild),a[0].cells.unshift(new Vi({cellType:e.CellType.Indent}));var c=r.getContentTable().querySelector(ln);if(l.classList.add("e-insertedrow"),c.querySelector(".e-emptyrow")){var u=c.querySelector(".e-emptyrow");u.parentNode.removeChild(u),r.frozenRows&&r.element.querySelector(".e-frozenrow-empty")&&r.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty")}c=r.frozenRows&&"Top"===r.editSettings.newRowPosition?r.getHeaderTable().querySelector(ln):r.getContentTable().querySelector(ln),"Top"===n.parent.editSettings.newRowPosition?c.insertBefore(l,c.firstChild):c.appendChild(l),t.addClass([].slice.call(l.getElementsByClassName(_i)),["e-updatedtd"]),a[0].isDirty=!0,a[0].changes=t.extend({},{},a[0].data,!0),a[0].edit="add",n.addRowObject(a[0]),n.refreshRowIdx(),n.focus.forgetPrevious(),r.notify("batchAdd",{rows:n.parent.getRowsObject()});var g=n.getBatchChanges(),f=n.getBottomIndex();"Top"===n.parent.editSettings.newRowPosition?r.selectRow(0):r.selectRow(f),i||(h=n.findNextEditableCell(0,!0),d=r.getColumns()[parseInt(h.toString(),10)],"Top"===n.parent.editSettings.newRowPosition?n.editCell(0,d.field,!0):n.editCell(f,d.field,!0)),n.parent.aggregates.length>0&&(i||g.addedRecords.length)&&n.parent.notify("refresh-footer-rendered",{});var m={defaultData:s.defaultData,row:l,columnObject:d,columnIndex:h,primaryKey:s.primaryKey,cell:t.isNullOrUndefined(h)?void 0:l.cells[parseInt(h.toString(),10)]};r.trigger("batchAdd",m)}})}},n.prototype.findNextEditableCell=function(e,i,n){for(var r,s=this.parent.getColumns(),o=s.length,a=e;a<o;a++)if(r=!!n&&t.isNullOrUndefined(s[parseInt(a.toString(),10)].validationRules),i&&(!s[parseInt(a.toString(),10)].template||s[parseInt(a.toString(),10)].field)&&s[parseInt(a.toString(),10)].allowEditing&&s[parseInt(a.toString(),10)].visible&&(!s[parseInt(a.toString(),10)].isIdentity||!s[parseInt(a.toString(),10)].isPrimaryKey)&&!r)return a;return-1},n.prototype.getDefaultData=function(){for(var e={},i={number:0,string:null,boolean:!1,date:null,datetime:null,dateonly:null},n=0,r=this.parent.columnModel;n<r.length;n++){var s=r[n];s.field&&t.setValue(s.field,Object.keys(s).indexOf("defaultValue")>=0?s.defaultValue:i[s.type],e)}return e},n.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("data-index"),10)},n.prototype.editCell=function(e,t,i){var n=this.parent,r=n.getColumnByField(t);this.index=e,this.field=t,this.isAdd=i;var s=n.getDataRows();s=s.filter(function(e){return"none"!==e.style.display&&!e.classList.contains("e-childrow-hidden")});var o=parseInt(s[s.length-1].getAttribute("aria-rowindex"),10)-1,a=n.isEdit&&!(this.cellDetails.column.field===t&&this.cellDetails.rowIndex===e&&o!==e&&this.prevEditedBatchCell);n.editSettings.allowEditing&&(!a&&(r.allowEditing||!r.allowEditing&&n.focusModule.active&&n.focusModule.active.getTable().rows[this.crtRowIndex]&&n.focusModule.active.getTable().rows[this.crtRowIndex].classList.contains("e-insertedrow"))?this.editCellExtend(e,t,i):a&&(this.editNext=!0,this.saveCell()))},n.prototype.editCellExtend=function(e,i,n){var r=this,s=this.parent,o=s.getColumnByField(i),a=s.getPrimaryKeyFieldNames();if(!s.isEdit){var l=t.extend({},{},this.getDataByIndex(e),!0),d=s.getDataRows()[parseInt(e.toString(),10)];if(l=t.extend({},{},this.getDataByIndex(e),!0),a[0]===o.field&&!d.classList.contains("e-insertedrow")||o.columns||o.isPrimaryKey&&o.isIdentity||o.commands)return void(this.parent.isLastCellPrimaryKey=!0);this.parent.isLastCellPrimaryKey=!1,this.parent.element.classList.add("e-editing");var h=s.getRowObjectFromUID(d.getAttribute("data-uid")),p=[].slice.apply(d.cells),c={columnName:o.field,isForeignKey:!t.isNullOrUndefined(o.foreignKeyValue),primaryKey:a,rowData:l,validationRules:t.extend({},o.validationRules?o.validationRules:{}),value:fe(o.field,l),type:n?"add":"edit",cancel:!1,foreignKeyData:h&&h.foreignKeyData};c.cell=p[this.getColIndex(p,this.getCellIdx(o.uid))],c.row=d,c.columnObject=o,c.cell&&s.trigger("cellEdit",c,function(i){if(!i.cancel){i.cell=i.cell?i.cell:p[r.getColIndex(p,r.getCellIdx(o.uid))],i.row=i.row?i.row:d,i.columnObject=i.columnObject?i.columnObject:o,r.cellDetails={rowData:l,column:o,value:i.value,isForeignKey:i.isForeignKey,rowIndex:e,cellIndex:parseInt(i.cell.getAttribute(on),10)-1,foreignKeyData:i.foreignKeyData},i.cell.classList.contains("e-updatedtd")&&(r.isColored=!0,i.cell.classList.remove("e-updatedtd")),s.isEdit=!0;var n=!t.isNullOrUndefined(i.row.querySelector(".e-selectionbackground"));s.clearSelection(),s.isCheckBoxSelection&&s.isPersistSelection||!n&&s.selectionSettings.checkboxOnly||s.selectRow(r.cellDetails.rowIndex,!0),r.renderer.update(i),r.parent.notify("batcheditform-rendered",i),r.form=t.select("#"+s.element.id+"EditForm",s.element),s.editModule.applyFormValidation([o]),r.parent.element.querySelector(".e-gridpopup").style.display="none"}})}},n.prototype.updateCell=function(e,t,i){var n=this.parent,r=n.getColumnByField(t),s=n.getColumnIndexByField(t),o=n.getRowByIndex(e).classList.contains("e-insertedrow")&&n.getRowByIndex(e).classList.contains("e-batchrow");if(r&&(!r.isPrimaryKey||o)&&r.allowEditing){var a=this.parent.isSpan?Ze(n,e,s):tt(this.parent,r,e,s);if(this.parent.isSpan&&!a)return;var l=n.getRowObjectFromUID(a.parentElement.getAttribute("data-uid"));if(n.isEdit||!l.changes&&(!(i instanceof Date)&&l.data[""+t]!==i||i instanceof Date&&new Date(l.data[""+t]).toString()!==new Date(i).toString())||l.changes&&(!(i instanceof Date)&&l.changes[""+t]!==i||i instanceof Date&&new Date(l.changes[""+t]).toString()!==new Date(i).toString())){this.refreshTD(a,r,l,i);var d=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;if((this.parent.isReact&&this.parent.requireTemplateRef||d&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&r.template){var h=this,p=this.newReactTd;h.parent.renderTemplates(function(){h.parent.trigger("queryCellInfo",{cell:p||a,column:r,data:l.changes})})}else(this.parent.isReact||d)&&r.template?(this.parent.renderTemplates(),this.parent.trigger("queryCellInfo",{cell:this.newReactTd||a,column:r,data:l.changes})):this.parent.trigger("queryCellInfo",{cell:this.newReactTd||a,column:r,data:l.changes})}}},n.prototype.setChanges=function(e,n,r){if(e.changes||(e.changes=t.extend({},{},e.data,!0)),t.isNullOrUndefined(n)||("string"==typeof r&&(r=this.parent.sanitize(r)),i.DataUtil.setValue(n,r,e.changes)),e.data[""+n]!==r){var s=this.parent.getColumnByField(n).type;"date"===s||"datetime"===s?new Date(e.data[""+n]).toString()!==new Date(r).toString()&&(e.isDirty=!0):e.isDirty=!0}},n.prototype.updateRow=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.updateCell(e,r,t[""+r])}},n.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},n.prototype.refreshTD=function(e,i,n,r){var s=new Rn(this.parent,this.serviceLocator);r="number"!==i.type||t.isNullOrUndefined(r)?r:parseFloat(r),n&&(this.setChanges(n,i.field,r),de(n,this.parent.getForeignKeyColumns(),n.changes));var o,a,l=n?n.cells:void 0;this.parent.isReact&&(o=e.parentElement,a=e.cellIndex);n&&s.refreshTD(e,l[this.getCellIdx(i.uid)-0],n.changes,{index:this.getCellIdx(i.uid)}),this.parent.isReact?(this.newReactTd=o.cells[parseInt(a.toString(),10)],o.cells[parseInt(a.toString(),10)].classList.add("e-updatedtd")):e.classList.add("e-updatedtd"),e.classList.add("e-updatedtd"),this.parent.notify("toolbar-refresh",{})},n.prototype.getColIndex=function(e,i){var n=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(n=this.parent.groupSettings.columns.length),t.isNullOrUndefined(this.parent.detailTemplate)&&t.isNullOrUndefined(this.parent.childGrid)||n++,this.parent.isRowDragable()&&n++;for(var r=0;r<e.length;r++)if(parseInt(e[parseInt(r.toString(),10)].getAttribute(on),10)-1===i-n)return r;return-1},n.prototype.editNextValCell=function(){var e=this.parent,t=e.element.querySelectorAll(".e-insertedrow"),i=1===t.length;if(i&&this.isAdded&&!e.isEdit){for(var n=this.getBottomIndex(),r=this.cellDetails.cellIndex;r<e.getColumns().length;r++){if(e.isEdit)return;var s=this.findNextEditableCell(this.cellDetails.cellIndex+1,!0,!0),o=e.getColumns()[parseInt(s.toString(),10)];if(o){if("Bottom"===this.parent.editSettings.newRowPosition)this.editCell(n,o.field,!0);else{var a={index:0,column:o};this.parent.notify("next-cell-index",a),this.editCell(a.index,o.field,!0)}this.saveCell()}}e.isEdit||(this.isAdded=!1)}else if(!i&&this.isAdded&&!e.isEdit){for(r=0;r<t.length&&!e.isEdit;r++)for(var l=0;l<this.validationColObj.length&&!e.isEdit;l++)""===t[parseInt(r.toString(),10)].querySelectorAll("td:not(.e-hide, .e-rowdragdrop, .e-detailrowcollapse, .e-detailrowexpand, .e-indentcell)")[this.validationColObj[parseInt(l.toString(),10)].cellIdx].innerHTML&&(this.editCell(parseInt(t[parseInt(r.toString(),10)].getAttribute("aria-rowindex"),10)-1,this.validationColObj[parseInt(l.toString(),10)].field),this.validateFormObj()&&this.saveCell());e.isEdit||(this.isAdded=!1)}},n.prototype.escapeCellEdit=function(){var e=this.generateCellArgs();e.value=e.previousValue,!e.value&&this.cellDetails.column.validationRules||this.successCallBack(e,e.cell.parentElement,e.column,!0)(e)},n.prototype.generateCellArgs=function(){var e=this.parent;this.parent.element.classList.remove("e-editing");var i=this.cellDetails.column,n={};n[i.field]=fe(i.field,this.cellDetails.rowData);var r=e.editModule.getCurrentEditedData(this.form,n),s=t.extend({},r);r=t.extend({},r,this.cellDetails.rowData);var o=fe(i.field,s);t.isNullOrUndefined(i.field)||t.isUndefined(o)||t.setValue(i.field,o,r);var a={columnName:i.field,value:fe(i.field,r),rowData:this.cellDetails.rowData,column:i,previousValue:this.cellDetails.value,isForeignKey:this.cellDetails.isForeignKey,cancel:!1};return a.cell=this.form.parentElement,a.columnObject=i,a},n.prototype.saveCell=function(e){if(!this.preventSaveCell&&this.form){var t=this.parent;if(e||t.isEdit&&!this.validateFormObj()){this.preventSaveCell=!0;var i=this.generateCellArgs();if(!i.cell)return void(this.preventSaveCell=!1);var n=i.cell.parentElement,r=i.column;i.cell.removeAttribute("aria-label"),e?this.successCallBack(i,n,r)(i):(t.trigger("cellSave",i,this.successCallBack(i,n,r)),t.notify("batchedit-form",{formObj:this.form}))}}},n.prototype.successCallBack=function(e,i,n,r){var s=this;return function(e){var o=s.parent;if(e.cell=e.cell?e.cell:s.form.parentElement,e.columnObject=e.columnObject?e.columnObject:n,e.cancel){if(s.preventSaveCell=!1,s.editNext){if(s.editNext=!1,s.cellDetails.rowIndex===s.index&&s.cellDetails.column.field===s.field)return;s.editCellExtend(s.index,s.field,s.isAdd)}}else{o.editModule.destroyWidgets([n]),o.isEdit=!1,o.editModule.destroyForm(),s.parent.notify("tooltip-destroy",{});var a=o.getRowObjectFromUID(i.getAttribute("data-uid"));if(s.refreshTD(e.cell,n,a,e.value),s.parent.isReact&&(e.cell=s.newReactTd),t.removeClass([i],[en,"e-batchrow"]),t.removeClass([e.cell],["e-editedbatchcell","e-boolcell"]),(!t.isNullOrUndefined(e.value)&&e.value.toString()===(t.isNullOrUndefined(s.cellDetails.value)?"":s.cellDetails.value).toString()&&!s.isColored||t.isNullOrUndefined(e.value)&&t.isNullOrUndefined(a.data[n.field])&&t.isNullOrUndefined(s.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&e.cell.classList.remove("e-updatedtd"),t.isNullOrUndefined(r)){var l=o.isReact&&n.template&&"string"!=typeof n.template,d=o.parentDetails&&o.parentDetails.parentInstObj&&o.parentDetails.parentInstObj.isReact;l||d?o.requireTemplateRef?o.renderTemplates(function(){o.trigger("cellSaved",e)}):(o.renderTemplates(),o.trigger("cellSaved",e)):o.trigger("cellSaved",e)}if(o.notify("toolbar-refresh",{}),s.isColored=!1,s.parent.aggregates.length>0&&(s.parent.isReact||s.parent.isVue||s.parent.notify("refresh-footer-rendered",{}),s.parent.groupSettings.columns.length>0&&!s.isAddRow(s.cellDetails.rowIndex)&&s.parent.notify("group-aggregates",{}),(s.parent.isReact||s.parent.isVue)&&s.parent.notify("refresh-footer-rendered",{})),s.preventSaveCell=!1,s.editNext){if(s.editNext=!1,s.cellDetails.rowIndex===s.index&&s.cellDetails.column.field===s.field&&s.prevEditedBatchCell)return;var h=o.getColumnByField(s.field);h&&(h.allowEditing||!h.allowEditing&&o.focusModule.active&&o.focusModule.active.getTable().rows[s.crtRowIndex]&&o.focusModule.active.getTable().rows[s.crtRowIndex].classList.contains("e-insertedrow"))&&s.editCellExtend(s.index,s.field,s.isAdd)}r&&o.notify("restore-Focus",{})}}},n.prototype.prevEditedBatchCellMatrix=function(){var e=[],t=this.parent.focusModule.active.getTable().querySelector(".e-editedbatchcell");if(t){var i=t.parentElement;e=[[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf(i),[].slice.call(i.cells).indexOf(t)]}return e},n.prototype.getDataByIndex=function(e){var t=this.parent.getRowObjectFromUID(this.parent.getDataRows()[parseInt(e.toString(),10)].getAttribute("data-uid"));return t.changes?t.changes:t.data},n.prototype.keyDownHandler=function(e){if(this.addBatchRow||("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit){var t=this.parent,i=this.getBottomIndex(),n=F(e.target,_i);if(this.addBatchRow||n&&!this.parent.isReact){var r=void 0;if(n&&(r=n.querySelector(".e-field")),this.addBatchRow||r){var s=this.parent.getVisibleColumns(),o="tab"===e.action?s.length-1:0;(this.addBatchRow||s[parseInt(o.toString(),10)].field===r.getAttribute("id").slice(this.parent.element.id.length))&&(this.cellDetails.rowIndex===i&&"tab"===e.action?("Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord(),this.addBatchRow=!1):this.saveCell())}}}},n.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.editNext=!1,this.mouseDownElement=void 0,this.isColored=!1)},n.prototype.getBottomIndex=function(){var e=this.getBatchChanges();return this.parent.getCurrentViewRecords().length+e.addedRecords.length-e.deletedRecords.length-1},n}(),so=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),oo=function(e){function t(t,i,n){var r=e.call(this,t,i)||this;return r.parent=t,r.serviceLocator=i,r.renderer=n,r}return so(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}(to),ao=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lo=function(e){function i(t){var i=e.call(this,t)||this;return i.isMaskModuleInjected=!0,i}return ao(i,e),i.prototype.write=function(e){this.edit=this.parent.editModule,"datepickeredit"===e.column.editType&&(this.obj=new a.DatePicker(t.extend(kt(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params)),this.isMaskModuleInjected&&(a.DatePicker.Inject(a.MaskedDateTime),this.isMaskModuleInjected=!1)),"datetimepickeredit"===e.column.editType&&(this.obj=new a.DateTimePicker(t.extend(kt(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params))),this.obj.isAngular=Ge(this.parent),this.obj.appendTo(e.element)},i}(Ws),ho=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}(),po=function(){function e(e,t){this.isShowAddedRowValidate=!1,this.editType={Inline:no,Normal:no,Batch:ro,Dialog:oo},this.fieldname="",this.data={},this.editCellDialogClose=!1,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,n=0;n<i.length;n++)if(this.parent.editSettings.template||i[parseInt(n.toString(),10)].editTemplate){i[parseInt(n.toString(),10)].edit=t.extend(new e.editCellType.templateedit(this.parent),i[parseInt(n.toString(),10)].edit||{})}else i[parseInt(n.toString(),10)].edit=t.extend(new(e.editCellType[i[parseInt(n.toString(),10)].editType&&e.editCellType[i[parseInt(n.toString(),10)].editType]?i[parseInt(n.toString(),10)].editType:"defaultedit"])(this.parent,this.serviceLocator),i[parseInt(n.toString(),10)].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=0,n=Object.keys(e.properties);i<n.length;i++)switch(n[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=!!t.editSettings.showAddNewRow,t.refresh()}},e.prototype.updateEditObj=function(){this.editModule&&this.editModule.destroy(),this.renderer=new Ks(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||i.editSettings.showAddNewRow&&(!i.editSettings.showAddNewRow||t.isNullOrUndefined(i.element.querySelector("."+en))))&&"Batch"!==i.editSettings.mode){if(this.parent.element.classList.add("e-editing"),!i.getSelectedRows().length||t.isNullOrUndefined(this.parent.getRowByIndex(parseInt(this.parent.getSelectedRows()[0].getAttribute("aria-rowindex"),10)-1))){if(!e)return void this.showDialog("EditOperationAlert",this.alertDObj)}else if(!e)if(this.parent.isTreeGrid&&this.parent.allowPaging&&i.selectionModule.selectedRowIndexes.length){var n=i.selectionModule.selectedRowIndexes[0];e=i.getRowByIndex(n)}else e=i.getSelectedRows()[0];if(this.parent.enableVirtualization&&"Normal"===this.parent.editSettings.mode){var r=parseInt(e.getAttribute("aria-rowindex"),10)-1;e=this.parent.getRowByIndex(r)}var s=i.getContent().querySelector("tr:last-child"),o=i.getHeaderContent().querySelector("tbody");if(i.frozenRows&&t.isNullOrUndefined(s)&&o&&o.querySelector("tr:last-child")?this.isLastRow=e.rowIndex===parseInt(i.getHeaderContent().querySelector("tbody").querySelector("tr:last-child").getAttribute("aria-rowindex"),10)-1:s&&(this.isLastRow=e.rowIndex===s.rowIndex),"none"!==e.style.display){if(this.editModule.startEdit(e),this.parent.isEdit&&!this.parent.isPersistSelection){var a=this.parent.getHeaderContent().querySelector(".e-checkselectall");a&&a.parentElement.classList.add("e-checkbox-disabled")}this.refreshToolbar(),i.element.querySelector(".e-gridpopup").style.display="none",this.parent.notify("start-edit",{}),i.editSettings.showAddNewRow&&this.destroyToolTip()}}},e.prototype.checkLastRow=function(e,i){var n=this.isLastRow;"auto"!==this.parent.height&&"Bottom"===this.parent.editSettings.newRowPosition&&i&&"add"===i.requestType&&this.parent.getContent().firstElementChild.offsetHeight>this.parent.getContentTable().scrollHeight?t.addClass([].slice.call(e.getElementsByClassName(_i)),"e-lastrowadded"):n&&e&&e.classList&&t.addClass([].slice.call(e.getElementsByClassName(_i)),"e-lastrowcell")},e.prototype.closeEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&this.parent.element.getElementsByClassName("e-updatedtd").length)return void this.showDialog("CancelEdit",this.dialogObj);this.parent.element.classList.remove("e-editing"),this.editModule.closeEdit(),this.refreshToolbar(),this.parent.notify("close-edit",{requestType:"cancel"}),this.parent.editSettings.showAddNewRow&&this.destroyToolTip()},e.prototype.refreshToolbar=function(){this.parent.notify("toolbar-refresh",{})},e.prototype.addRecord=function(e,t){if(this.parent.editSettings.allowAdding){var i={startEdit:!0};e||this.parent.notify("virtual-scroll-add-action-begin",i),i.startEdit&&(this.parent.element.classList.add("e-editing"),this.editModule.addRecord(e,t),this.refreshToolbar(),this.parent.notify("start-add",{}))}},e.prototype.deleteRecord=function(e,i){var n=this.parent;if(n.editSettings.allowDeleting)return i||n.getSelectedRecords().length||!t.isNullOrUndefined(n.commandDelIndex)?n.editSettings.showDeleteConfirmDialog?(this.fieldname=e,this.data=i,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);if(this.endEditing(),!this.parent.isEdit&&!this.parent.isPersistSelection){var e=this.parent.getHeaderContent().querySelector(".e-checkselectall");e&&e.parentElement.classList.remove("e-checkbox-disabled")}},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.editSettings.showAddNewRow||this.parent.element.classList.remove("e-editing"),this.editModule.endEdit(),this.isShowAddedRowValidate=!1,this.refreshToolbar()},e.prototype.showDialog=function(e,t){t.content="<div>"+this.l10n.getConstant(e)+"</div>",t.dataBind(),t.show(),this.parent.enableRtl&&t.refresh()},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);break;case"dateonly":i=t&&(t=new Date(t))?t.getFullYear()+"-"+ce(t.getMonth()+1)+"-"+ce(t.getDate()):null}return i},e.prototype.destroyToolTip=function(){for(var e=0,i=[].slice.call(this.parent.element.getElementsByClassName("e-griderror"));e<i.length;e++){var n=i[e];t.remove(n)}this.parent.getContent().firstElementChild.style.position="relative",this.parent.isFrozenGrid()&&(this.parent.element.querySelector(".e-gridheader")&&(this.parent.element.querySelector(".e-gridheader").style.position=""),this.parent.element.querySelector(".e-gridcontent").style.position="")},e.prototype.createConfirmDlg=function(){this.dialogObj=this.dlgWidget([{click:this.dlgOk.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.dlgCancel.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.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:this.parent.cssClass?"e-flat "+this.parent.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 r={showCloseIcon:!1,isModal:!0,visible:!1,closeOnEscape:!0,target:this.parent.element,width:"320px",animationSettings:{effect:"None"},cssClass:this.parent.cssClass?this.parent.cssClass:""};r.buttons=e;var s=new n.Dialog(r);return s.isStringTemplate=!0,s.appendTo(i),s},e.prototype.dlgCancel=function(){this.parent.pagerModule&&(this.parent.pagerModule.isForceCancel=!1),this.parent.focusModule.clearIndicator(),this.dialogObj.hide(),this.parent.focusModule.restoreFocus({requestType:"cancel"}),this.parent.notify("cancelcnfrmDlg",{})},e.prototype.dlgOk=function(){switch(this.dialogObj.element.querySelector(".e-dlg-content").firstElementChild.innerText){case this.l10n.getConstant("ConfirmDelete"):this.editModule.deleteRecord(this.fieldname,this.data),this.parent.editSettings.showDeleteConfirmDialog&&!this.parent.allowSelection&&(this.parent.commandDelIndex=void 0);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(),this.parent.pagerModule&&(this.parent.pagerModule.isForceCancel=!1),this.executeAction()}this.dlgCancel()},e.prototype.destroyEditComponents=function(){if(this.parent.isEdit){if(this.editModule&&!t.isNullOrUndefined(this.editModule.editRowIndex)&&t.isNullOrUndefined(this.parent.editSettings.template)){var e=this.parent.columnModel.filter(function(e){return!e.edit.obj});(t.isNullOrUndefined(e)||0===e.length)&&this.closeEdit()}this.destroyWidgets(),this.destroyForm()}this.formObj=null,this.destroy()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.eventDetails=[{event:ii,handler:this.onPropertyChanged},{event:Jt,handler:this.initialEnd},{event:di,handler:this.keyPressHandler},{event:Ci,handler:this.updateColTypeObj},{event:"tooltip-destroy",handler:this.destroyToolTip},{event:bi,handler:this.preventBatch},{event:"destroy-form",handler:this.destroyForm},{event:pi,handler:this.destroyEditComponents}],at(this.parent,this.eventDetails,!0,this),this.actionBeginFunction=this.onActionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.on("destroy-edit-form",this.actionBeginFunction),this.parent.addEventListener(Ut,this.actionCompleteFunction))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(at(this.parent,this.eventDetails,!1),this.parent.removeEventListener(Ut,this.actionCompleteFunction),this.parent.off("destroy-edit-form",this.actionBeginFunction))},e.prototype.actionComplete=function(e){["add","beginEdit","save","delete","cancel","filterAfterOpen","filterchoicerequest"].indexOf(e.requestType)<0&&(this.parent.isEdit=!!this.parent.editSettings.showAddNewRow),"batchsave"===e.requestType&&this.parent.focusModule.restoreFocus({requestType:"save"}),this.refreshToolbar()},e.prototype.getCurrentEditedData=function(e,n){var r=this.parent;if(r.editSettings.template){for(var s=[].slice.call(e.elements),o=0;o<s.length;o++)if((s[parseInt(o.toString(),10)].hasAttribute("name")&&"e-multi-hidden"!==s[parseInt(o.toString(),10)].className||s[parseInt(o.toString(),10)].classList.contains("e-multiselect"))&&("hidden"!==s[parseInt(o.toString(),10)].type||!F(s[parseInt(o.toString(),10)],"e-switch-wrapper")&&!F(s[parseInt(o.toString(),10)],"e-checkbox-wrapper"))){var a=Q(s[parseInt(o.toString(),10)].hasAttribute("name")?s[parseInt(o.toString(),10)].getAttribute("name"):s[parseInt(o.toString(),10)].getAttribute("id")),l=r.getColumnByField(a)||{field:a,type:s[parseInt(o.toString(),10)].getAttribute("type")},d=void 0;"checkbox"===l.type||"boolean"===l.type?d=s[parseInt(o.toString(),10)].checked:s[parseInt(o.toString(),10)].value?(d=s[parseInt(o.toString(),10)].value,s[parseInt(o.toString(),10)].ej2_instances&&s[parseInt(o.toString(),10)].ej2_instances.length&&!t.isNullOrUndefined(s[parseInt(o.toString(),10)].ej2_instances[0].value)&&(s[parseInt(o.toString(),10)].blur(),d=s[parseInt(o.toString(),10)].ej2_instances[0].value)):s[parseInt(o.toString(),10)].ej2_instances&&(d=s[parseInt(o.toString(),10)].ej2_instances[0].value),l.edit&&"string"==typeof l.edit.read?d=t.getValue(l.edit.read,window)(s[parseInt(o.toString(),10)],d):l.edit&&l.edit.read&&(d=l.edit.read(s[parseInt(o.toString(),10)],d)),d=r.editModule.getValueFromType(l,d),"radio"===s[parseInt(o.toString(),10)].type?s[parseInt(o.toString(),10)].checked&&i.DataUtil.setValue(l.field,d,n):("string"==typeof d&&this.parent.sanitize(d),i.DataUtil.setValue(l.field,d,n))}return n}for(var h=r.columnModel.filter(function(e){return e.editTemplate}),p=0;p<h.length;p++)if(e[K(h[parseInt(p.toString(),10)].field)]){var c=[].slice.call(e[K(h[parseInt(p.toString(),10)].field)]).filter(function(e){return"input"===e.tagName.toLowerCase()});if(0===c.length){var u=[e[K(h[parseInt(p.toString(),10)].field)]];this.parent.isAngular&&h[parseInt(p.toString(),10)].editTemplate&&u&&u.length&&"datepicker"===u[0].getAttribute("aria-label")&&u[0].closest(".e-datepicker")&&(u=[u[0].closest(".e-datepicker")]),c=u}var g=c.filter(function(e){return!t.isNullOrUndefined(e.ej2_instances)});0===g.length&&(g=c.filter(function(e){return e.hasAttribute("name")}));for(o=0;o<g.length;o++){d=this.getValue(h[parseInt(p.toString(),10)],g[parseInt(o.toString(),10)],n);"string"===h[parseInt(p.toString(),10)].type&&(d=this.parent.sanitize(d)),i.DataUtil.setValue(h[parseInt(p.toString(),10)].field,d,n)}}for(var f=[].slice.call(e.getElementsByClassName("e-field")),m=0,y=f.length;m<y;m++){var v=r.getColumnByUid(f[parseInt(m.toString(),10)].getAttribute("data-mappinguid"));if(v&&v.field){d=this.getValue(v,f[parseInt(m.toString(),10)],n);"string"!==v.type||v.isForeignColumn()&&"string"!=typeof d||(d=this.parent.sanitize(d)),i.DataUtil.setValue(v.field,d,n)}}return n},e.prototype.getValue=function(e,i,n){var r=i.ej2_instances?i.ej2_instances[0].value:i.value,s=this.parent,o=e.edit.read;return"checkbox"!==e.type&&"boolean"!==e.type||(r=i.checked),"string"==typeof o?(o=t.getValue(o,window),r=s.editModule.getValueFromType(e,o(i,r))):r=s.editModule.getValueFromType(e,e.edit.read(i,r)),t.isNullOrUndefined(n[e.field])&&""===r&&(r=n[e.field]),r},e.prototype.onActionBegin=function(e){if(("columnstate"===e.requestType||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&"sorting"===e.requestType)&&this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode)this.closeEdit();else{var i=this.parent.element.querySelector("."+en),n=this.parent.element.querySelector("."+tn);if(i&&this.parent.frozenRows&&"virtualscroll"===e.requestType&&parseInt(F(i,Zi).getAttribute(an),10)-1<this.parent.frozenRows)return;var r=-1===["filterAfterOpen","filterBeforeOpen","filterchoicerequest","filterSearchBegin","save","infiniteScroll","virtualscroll"].indexOf(e.requestType),s=!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!t.isNullOrUndefined(this.parent.element.querySelector(".e-editedrow")),o=(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.formObj&&s&&!this.formObj.isDestroyed&&(i||n||"cancel"===e.requestType)&&r;(!this.parent.enableVirtualization&&s&&"Batch"!==this.parent.editSettings.mode&&this.formObj&&!this.formObj.isDestroyed&&r&&!e.cancel||o)&&(this.destroyWidgets(),this.destroyForm())}},e.prototype.destroyWidgets=function(e){var i=this.parent;if(i.isWidgetsDestroyed=!0,i.editSettings.template){var n=vt(this.parent);(n=n.isReact?n:this.parent).destroyTemplate(["editSettingsTemplate"]),this.parent.isReact&&this.parent.renderTemplates()}if("Dialog"===this.parent.editSettings.mode&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length){e=[];for(var r=this.parent.getColumns(),s=0;s<r.length;s++){var o=r[parseInt(s.toString(),10)];(o.visible||this.parent.groupSettings.columns.indexOf(o.field)>-1)&&e.push(o)}}else e=e||this.parent.getCurrentVisibleColumns(this.parent.enableColumnVirtualization);e.some(function(e){return!t.isNullOrUndefined(e.editTemplate)})&&(this.parent.destroyTemplate(["editTemplate"]),this.parent.isReact&&this.parent.renderTemplates());for(var a=0,l=e;a<l.length;a++){var d=l[a],h=d.edit.destroy;d.edit.destroy&&("string"==typeof h?(h=t.getValue(h,window))():d.edit.destroy())}if(this.formObj&&this.formObj.element)for(var p=[].slice.call(this.formObj.element.elements),s=0;s<p.length;s++){var c=p[parseInt(s.toString(),10)];if(c.hasAttribute("name")||c.classList.contains("e-field")){var u=t.isNullOrUndefined(c.parentElement)?null:c.parentElement.classList.contains("e-ddl")?c.parentElement.querySelector("input"):c;u&&u.ej2_instances&&u.ej2_instances.length&&!u.ej2_instances[0].isDestroyed&&(u.ej2_instances[0].destroy(),u.remove())}}},e.prototype.destroyForm=function(){this.destroyToolTip();for(var e=[this.formObj,this.virtualFormObj],i=this.parent.columnModel.filter(function(e){return e.editTemplate}),n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)];r&&r.element&&!r.isDestroyed&&(r.destroy(),!vt(this.parent).isReact||"Dialog"!==this.parent.editSettings.mode||t.isNullOrUndefined(this.parent.editSettings.template)&&!i.length||r.element.remove(),r&&r.element&&t.isNullOrUndefined(this.parent.editSettings.template)&&(r.element.innerHTML="",this.parent.editSettings.showAddNewRow&&r.element.closest(".e-addedrow")&&(r.element.closest(".e-addedrow").innerHTML="")))}this.destroyToolTip()},e.prototype.destroy=function(){var e=this.parent.element;if(e){var i=!(!e.querySelector("."+Ki)||!e.querySelector("."+Wi));i&&this.destroyForm(),this.removeEventListener();var n=this.dialogObj.element;n.childElementCount>0&&(this.dialogObj.destroy(),t.remove(n)),(n=this.alertDObj.element).childElementCount>0&&(this.alertDObj.destroy(),t.remove(n)),i&&this.editModule&&this.editModule.destroy()}},e.prototype.keyPressHandler=function(e){switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&"ctrlEnter"===e.action&&(e.action="insert"),e.action){case"insert":this.addRecord();break;case"delete":"INPUT"===e.target.tagName&&!e.target.classList.contains("e-checkselect")&&!e.target.classList.contains("e-checkselectall")||document.querySelector(".e-popup-open.e-edit-dialog")||this.deleteRecord();break;case"f2":this.startEdit();break;case"enter":F(e.target,"e-unboundcelldiv")||"Batch"===this.parent.editSettings.mode||!(F(e.target,Wi)||(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&F(e.target,Xi))||document.getElementsByClassName("e-popup-open").length&&(!document.querySelectorAll(".e-popup-open .e-editcell").length||document.querySelectorAll(".e-popup-open:not(.e-dialog)").length)||(e.preventDefault(),this.parent.isEdit&&(this.parent.isFocusFirstCell=!0),this.endEdit());break;case"escape":this.parent.isEdit&&!this.editCellDialogClose&&("Batch"===this.parent.editSettings.mode?this.editModule.escapeCellEdit():this.curretRowFocus(e)),this.editCellDialogClose&&(this.editCellDialogClose=!1);break;case"tab":case"shiftTab":this.curretRowFocus(e)}},e.prototype.curretRowFocus=function(e){if(this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode){this.parent.isWidgetsDestroyed=!1;var i=F(e.target,"e-editedrow")||F(e.target,"e-addedrow");if(i){var n=[].slice.call(i.querySelectorAll(".e-input:not(.e-disabled)")),r=[].slice.call(i.querySelectorAll(".e-unboundcell"));if(r&&r.length)for(c=0;c<r.length;c++)n=n.concat([].slice.call(r[parseInt(c.toString(),10)].querySelectorAll(".e-btn:not(.e-hide)")));var s=F(e.target,"e-rowcell");s=s&&s.classList.contains("e-unboundcell")?e.target:s;var o=F(n[n.length-1],"e-rowcell");if(o=o&&o.classList.contains("e-unboundcell")?n[n.length-1]:o,s===o&&"tab"===e.action||"escape"===e.action||s===F(n[0],"e-rowcell")&&"shiftTab"===e.action&&!this.parent.editSettings.showAddNewRow){var a=i.getAttribute("data-uid"),l=(this.parent.allowGrouping?t.isNullOrUndefined(this.parent.getContent())?[]:[].slice.call(this.parent.getContent().querySelectorAll("tr")):this.parent.getRows()).map(function(e){return e.getAttribute("data-uid")}).indexOf(a);if((this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(F(i,"e-gridheader")?l=i.rowIndex:F(i,"e-gridcontent")&&(l-=this.parent.frozenRows)),i.classList.contains("e-addedrow")&&(l=0),"escape"===e.action?(this.parent.isFocusFirstCell=!0,this.closeEdit()):(this.isShowAddedRowValidate=!0,this.parent.selectionModule.preventFocus=!1,this.parent.isFocusFirstCell=!0,this.endEdit(),this.isShowAddedRowValidate=!1),this.parent.focusModule.active&&(!this.parent.editSettings.showAddNewRow||i.classList.contains("e-editedrow")||this.parent.editSettings.showAddNewRow&&i.classList.contains("e-addedrow")&&t.isNullOrUndefined(this.parent.element.querySelector('.e-griderror:not([style*="display: none"])')))){var d=0,h=this.parent.focusModule.active.matrix;if(h&&h.matrix.length&&h.matrix[parseInt(l.toString(),10)])for(var p=h.matrix[parseInt(l.toString(),10)],c=0;c<p.length;c++)if(p[parseInt(c.toString(),10)]>0){d=c;break}var u=t.getValue(l+".cells."+d,this.parent.focusModule.active.matrix.getRowsFromIndex(l,this.parent.focusModule.active));u&&0===u.getBoundingClientRect().width&&(d=this.parent.focusModule.active.matrix.nextVisibleCellFocus(l,d,e.action,this.parent.focusModule.active.keyActions[e.action],this.parent.focusModule.active,this.parent.focusModule.active.matrix.current[1])[1]),this.parent.focusModule.active.matrix.current=[l,d]}}this.parent.editSettings.showAddNewRow&&"tab"===e.action&&F(e.target,"e-addedrow")&&(this.isShowAddedRowValidate=!0)}}},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,i){var n=this.parent,r="Dialog"!==this.parent.editSettings.mode?n.editSettings.showAddNewRow&&n.element.querySelector("."+en)?n.element.querySelector("."+en).getElementsByClassName("e-gridform")[parseInt((0).toString(),10)]:n.element.getElementsByClassName("e-gridform")[parseInt((0).toString(),10)]:t.select("#"+n.element.id+"_dialogEdit_wrapper .e-gridform",document),s={},o={},a={};e=e||n.getColumns();for(var l=0;l<e.length;l++)(e[parseInt(l.toString(),10)].visible||"Dialog"===n.editSettings.mode&&(-1!==n.groupSettings.columns.indexOf(e[parseInt(l.toString(),10)].field)||"Dialog"!==n.editSettings.mode))&&e[parseInt(l.toString(),10)].validationRules&&t.isNullOrUndefined(i)&&it(e[parseInt(l.toString(),10)],1,s,o,a,e.length);s=t.extend(s,o,a),this.parent.editModule.formObj=this.createFormObj(r,i||s)},e.prototype.createFormObj=function(e,i){var n=this;return new s.FormValidator(e,{rules:i,locale:this.parent.locale,validationComplete:function(e){n.validationComplete(e)},customPlacement:function(e,i){var r=e.getAttribute("data-mappinguid"),s={column:n.parent.getColumnByUid(r),error:i,inputElement:e,value:e.value};(!(event&&event.relatedTarget&&event.relatedTarget.classList.contains("e-cancelbutton"))&&!n.parent.editSettings.showAddNewRow||n.parent.editSettings.showAddNewRow&&event&&event.target&&(F(event.target,n.parent.element.id+"_update",!0)||F(event.target,"e-grid-menu")&&(event.target.classList.contains("e-save")||event.target.querySelector(".e-save"))||n.isShowAddedRowValidate||F(event.target,"e-unboundcell")&&F(event.target,"e-update")||"enter"===event.action&&(F(event.target,"e-content")||F(event.target,"e-addedrow")))||n.parent.editSettings.showAddNewRow&&!t.isNullOrUndefined(n.parent.element.querySelector("."+en)))&&n.valErrorPlacement(e,i),n.isShowAddedRowValidate=!1,n.parent.notify("validation-custom-placement",s)}})},e.prototype.valErrorPlacement=function(e,t){if(this.parent.isEdit){var i=t.getAttribute("for"),n=this.getElemTable(e).querySelector("#"+W(i)+"_Error");n?n.querySelector(".e-tip-content").innerHTML=t.outerHTML:this.createTooltip(e,t,i,"")}},e.prototype.getElemTable=function(e){var i,n,r=this.parent;return"Dialog"!==r.editSettings.mode?(i=r.frozenRows&&t.closest(e,"."+Zi)&&r.frozenRows>(parseInt(t.closest(e,"."+Zi).getAttribute(an),10)-1||0),n=this.parent.isFrozenGrid()?r.element:i||r.editSettings.showAddNewRow&&(r.enableVirtualization||r.enableInfiniteScrolling)?r.getHeaderTable():r.getContentTable()):n=t.select("#"+r.element.id+"_dialogEdit_wrapper",document),n},e.prototype.resetElemPosition=function(e,t){var i=F(t.element,_i);if(i){var n=i.getBoundingClientRect().right,r=e.getBoundingClientRect().right;if(r>n){var s=r-n;e.style.left=e.offsetLeft-s+"px"}}},e.prototype.validationComplete=function(e){if(this.parent.isEdit){var t=this.getElemTable(e.element).querySelector("#"+W(e.inputName)+"_Error");if(this.parent.editSettings.showAddNewRow&&!t&&e.element){var i=F(e.element,"e-rowcell").querySelector(".e-error");i&&i.classList.remove("e-error")}t&&("failure"===e.status?(t.style.display="",this.resetElemPosition(t,e)):t.style.display="none")}},e.prototype.setScrollTop=function(e,t,i){var n=this.parent.getContent().querySelector(".e-content");0===this.parent.currentViewData.length&&0===n.scrollTop?n.scrollTop=e.offsetHeight+t.scrollHeight:i.scrollTop=i.scrollTop+e.offsetHeight+t.scrollHeight},e.prototype.setBottomStyles=function(e,t,i){var n=t.scrollWidth>t.offsetWidth?j():0,r=-1===this.parent.height.toString().indexOf("%")?parseInt(this.parent.height,10):t.offsetHeight;e.style.bottom=r-t.querySelector("table").offsetHeight-n+i.height+9+"px",this.parent.pinnedTopRowModels.length&&(e.style.bottom=i.height+9+"px")},e.prototype.setPositionStyles=function(e,t,i){var n=(this.parent.frozenRows?(e?this.parent.frozenRows+1:this.parent.frozenRows)+(t.length-1):t.length-1)*this.parent.getRowHeight(),r=this.parent.getContent().clientHeight-n;i.style.bottom=r+9+"px"},e.prototype.createTooltip=function(e,i,r,s){var o=this.formObj.element,a=F(e,"e-virtual-validation");a&&(o=this.virtualFormObj.element);var l,d,h=this.parent.getContent().firstElementChild,p=h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth,c="Dialog"!==this.parent.editSettings.mode,u=t.closest(e,"."+_i),g=t.closest(e,"."+Zi),f=!1,m=!1,y=this.parent.editSettings.showAddNewRow&&!t.isNullOrUndefined(F(e,tn))&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling),v=Math.round(this.parent.getContent().clientHeight/this.parent.getRowHeight())-1,S=[].slice.call(this.parent.getContent().getElementsByClassName(Zi));if("Batch"===this.parent.editSettings.mode&&(S=[].slice.call(this.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)")),v>1&&S.length>v&&parseInt(S[S.length-1].getAttribute(an),10)-1==parseInt(g.getAttribute(an),10)-1&&(m=!0)),c){if(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||y){var C=this.parent.editSettings.showAddNewRow?".e-row:not(.e-hiddenrow.e-addedrow)":".e-row:not(.e-hiddenrow)",w=[].slice.call(this.parent.getHeaderTable().querySelector(ln).querySelectorAll(C));f=(l=w.length>(parseInt(g.getAttribute(an),10)-1||0))&&parseInt(g.getAttribute(an),10)-1==w.length-1;var b=[].slice.call(this.parent.getHeaderTable().querySelector(ln).querySelectorAll(".e-row:not(.e-hiddenrow)"));1===b.length&&(b[0].classList.contains("e-addedrow")||b[0].classList.contains("e-insertedrow"))&&(f=!0)}(f||v>1&&S.length>v&&("Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType||u.classList.contains("e-lastrowcell")&&!g.classList.contains(tn))||m)&&(d=!0)}var I=c?l?this.parent.getHeaderTable():this.parent.getContentTable():t.select("#"+this.parent.element.id+"_dialogEdit_wrapper .e-dlg-content",document),x=I.getBoundingClientRect(),R=c?this.parent.element.getBoundingClientRect().left:x.left,D=t.closest(e,"td"),T=D?D.getBoundingClientRect():e.parentElement.getBoundingClientRect(),E=this.parent.createElement("div",{className:"e-tooltip-wrap e-lib e-control e-popup e-griderror",id:r+"_Error"}),O="display:"+s+";top:"+((l?T.top+T.height:T.bottom-x.top)+I.scrollTop+9)+"px;left:"+(T.left-R+I.scrollLeft+T.width/2)+"px;max-width:"+T.width+"px;text-align:center;";t.updateCSSText(E,O),this.parent.cssClass&&E.classList.add(this.parent.cssClass),c&&x.left<R&&(E.style.left=parseInt(E.style.left,10)-x.left+R+"px");var k=this.parent.createElement("div",{className:"e-tip-content"});k.appendChild(i);var A;if(d?((A=this.parent.createElement("div",{className:"e-arrow-tip e-tip-bottom"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-bottom"})),A.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-bottom"}))):((A=this.parent.createElement("div",{className:"e-arrow-tip e-tip-top"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),A.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-top"}))),E.appendChild(k),E.appendChild(A),!a&&(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||y)&&"Dialog"!==this.parent.editSettings.mode)("Normal"===this.parent.editSettings.mode?t.closest(e,".e-editcell"):t.closest(e,"."+Ji)).style.position="relative",E.style.position="absolute",("Batch"===this.parent.editSettings.mode||t.closest(e,".e-frozencontent")||t.closest(e,".e-frozenheader")||this.parent.frozenRows||this.parent.pinnedTopRowModels.length||y)&&(this.parent.isFrozenGrid()?u.classList.contains("e-unfreeze")?(t.addClass([E],"e-unfreeze"),o.appendChild(E)):((M=t.closest(u,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===S.length?this.parent.element.querySelector(".e-gridcontent").querySelector(".e-content"):this.parent.element.querySelector(".e-gridcontent")).appendChild(E),M.style.position="relative"):o.appendChild(E));else if(a)this.virtualFormObj.element.appendChild(E);else if("Dialog"!==this.parent.editSettings.mode&&this.parent.isFrozenGrid())if(u.classList.contains("e-unfreeze"))t.addClass([E],"e-unfreeze"),this.formObj.element.appendChild(E);else{var M=t.closest(u,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===S.length?this.parent.element.querySelector(".e-gridcontent").querySelector(".e-content"):this.parent.element.querySelector(".e-gridcontent");M.appendChild(E),M.style.position="relative"}else this.formObj.element.appendChild(E);t.isNullOrUndefined(u)||(u.classList.contains("e-fixedfreeze")?E.classList.add("e-fixederror"):(u.classList.contains("e-leftfreeze")||u.classList.contains("e-rightfreeze"))&&E.classList.add("e-freezeerror")),!d&&c&&h.getBoundingClientRect().bottom<T.bottom+T.height&&this.setScrollTop(E,A,h);var L=parseInt(document.defaultView.getComputedStyle(E,null).getPropertyValue("font-size"),10);if((this.parent.frozenRows||this.parent.pinnedTopRowModels.length||y)&&"Dialog"!==this.parent.editSettings.mode?E.style.left=D.offsetLeft+(D.offsetWidth/2-E.offsetWidth/2)+"px":E.style.left=parseInt(E.style.left,10)-E.offsetWidth/2+"px",E.getBoundingClientRect().width<T.width&&E.querySelector("label").getBoundingClientRect().height/(1.2*L)>=2&&(E.style.width=E.style.maxWidth),c&&!p&&!this.parent.allowPaging||this.parent.frozenRows||this.parent.pinnedTopRowModels.length||y){var P=n.calculateRelativeBasedPosition(D,E);E.style.top=P.top+T.height+9+"px"}d&&(!p||"auto"===this.parent.height||this.parent.frozenRows&&this.parent.pinnedTopRowModels.length&&y||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||E.classList.contains("e-freezeerror")&&E.classList.contains("e-fixederror")?E.style.bottom=T.height+9+"px":this.setBottomStyles(E,h,T),S.length<v&&"Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType&&this.setPositionStyles(y,S,E),E.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:Js,numericedit:Zs,datepickeredit:lo,datetimepickeredit:lo,booleanedit:Xs,defaultedit:eo,templateedit:ho},e}(),co=function(){return(co=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},uo=function(){function s(e,i){this.filterColumns=[],this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.unchangedColumns=[],this.infiniteLoadedElement=[],this.isDlgOpen=!1,this.isColumnChooserOpen=!1,this.initialOpenDlg=!0,this.stateChangeColumns=[],this.changedStateColumns=[],this.isInitialOpen=!1,this.isCustomizeOpenCC=!1,this.searchOperator="startswith",this.sortDirection="None",this.selectedColumnModels=[],this.selectedColumns=[],this.itemsCount=50,this.infiniteSkipCount=0,this.infiniteColumns=[],this.infiniteInitialLoad=!1,this.prevInfiniteScrollDirection="",this.prevShowedCols=[],this.hideDialogFunction=this.hideDialog.bind(this),this.infiniteRenderMode=!1,this.parent=e,this.serviceLocator=i,this.infiniteRenderMode=!!this.parent.enableColumnVirtualization,this.addEventListener(),this.cBoxTrue=r.createCheckBox(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=r.createCheckBox(this.parent.createElement,!1,{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"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?t.addClass([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):t.addClass([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass])),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}return s.prototype.destroy=function(){var i=this,n=this.parent.element;if((n.querySelector("."+Wi)||n.querySelector("."+Ki))&&n&&(this.removeEventListener(),this.unWireEvents(),this.infiniteLoadedElement=null,this.infiniteDiv=null,!t.isNullOrUndefined(this.dlgObj)&&this.dlgObj.element&&!this.dlgObj.isDestroyed)){this.parent.isReact&&this.parent.columnChooserSettings.template?e.Global.timer?(clearTimeout(e.Global.timer),e.Global.timer=null):e.Global.timer=setTimeout(function(){t.isNullOrUndefined(i.dlgObj)||!i.dlgObj.element||i.dlgObj.isDestroyed||i.dlgObj.destroy()},0):this.dlgObj.destroy();var r=document.getElementById(this.parent.element.id+"_e-popup");t.isNullOrUndefined(r)||(t.remove(r),r=null)}},s.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,e.ResponsiveDialogAction.isColumnChooser),this.parent.enableAdaptiveUI&&(this.parent.on("render-Responsive-Column-Chooser-Div",this.renderResponsiveColumnChooserDiv,this),this.parent.on(Bi,this.renderResponsiveChangeAction,this))},s.prototype.rtlUpdate=function(){t.isNullOrUndefined(this.innerDiv)||(this.parent.enableRtl?t.addClass([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]):t.removeClass([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]))},s.prototype.addEventListener=function(){this.parent.isDestroyed||(t.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on(ei,this.enableAfterRenderEle,this),this.parent.on(Jt,this.render,this),this.parent.addEventListener(jt,this.hideDialogFunction),this.parent.on(pi,this.destroy,this),this.parent.on("rtl-updated",this.rtlUpdate,this),this.parent.on("reset-columns",this.onResetColumns,this),this.parent.on("set-fullscreen-dialog",this.setFullScreenDialog,this),this.parent.on(ii,this.onPropertyChanged,this),this.parent.enableAdaptiveUI&&this.parent.on(Bi,this.renderResponsiveChangeAction,this),(this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.on("render-Responsive-Column-Chooser-Div",this.renderResponsiveColumnChooserDiv,this))},s.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.EventHandler.remove(document,"click",this.clickHandler),this.parent.off(Jt,this.render),this.parent.off(pi,this.destroy),this.parent.off(ei,this.enableAfterRenderEle),this.parent.off("rtl-updated",this.rtlUpdate),this.parent.off("reset-columns",this.onResetColumns),this.parent.removeEventListener(jt,this.hideDialogFunction),this.parent.off("set-fullscreen-dialog",this.setFullScreenDialog),this.infiniteDiv&&(t.EventHandler.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler),t.EventHandler.remove(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler),t.EventHandler.remove(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler)),this.parent.enableAdaptiveUI&&(this.parent.off("set-fullscreen-dialog",this.setFullScreenDialog),this.parent.off(Bi,this.renderResponsiveChangeAction)),(this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.off("render-Responsive-Column-Chooser-Div",this.renderResponsiveColumnChooserDiv))},s.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.enableAdaptiveUI||this.renderDlgContent(),this.getShowHideService=this.serviceLocator.getService("showHideService")},s.prototype.clickHandler=function(e){var i=e.target;if(!this.isCustomizeOpenCC){if(t.isNullOrUndefined(t.closest(i,".e-cc-toolbar"))&&t.isNullOrUndefined(t.closest(i,".e-cc")))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("",!1),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.parent.enableAdaptiveUI?this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"]):this.rtlUpdate()},s.prototype.hideDialog=function(){!t.isNullOrUndefined(this.dlgObj)&&this.dlgObj.visible&&(this.parent.enableAdaptiveUI?this.responsiveDialogRenderer.hideResponsiveColumnChooser():(this.dlgObj.hide(),this.isDlgOpen=!1))},s.prototype.renderColumnChooser=function(e,i,r){if(this.dlgObj.visible||!this.parent.detailTemplate&&!this.parent.childGrid||this.hideOpenedDialog(),this.dlgObj.visible)this.hideDialog(),this.addcancelIcon(),this.clearActions(),this.refreshCheckboxState();else{var s=this.beforeOpenColumnChooserEvent();if(s.cancel)return;this.infiniteRenderMode||!this.selectedColumns.length||"None"!==this.sortDirection||this.parent.columnChooserSettings.template||this.setOrderedColumns(),s.columns=null,r&&(this.targetdlg=r),this.infiniteRenderMode&&this.dlgObj.show(),this.refreshCheckboxState(),this.dlgObj.dataBind(),this.dlgObj.element.style.maxHeight="430px";var o=this.dlgObj.element.style.display;this.parent.columnChooserSettings.enableSearching||(this.dlgObj.element.querySelector(".e-dlg-content").style.margin="0px"),this.dlgObj.element.style.display="block";var a=this.parent.getHeaderContent().classList.contains("e-sticky"),l=t.closest(r,".e-toolbar-item"),d=void 0;document.getElementById(this.parent.element.id+"_e-popup")&&document.getElementById(this.parent.element.id+"_e-popup").querySelector(".e-ccdlg")&&this.parent.element.appendChild(this.dlgObj.element),a?(d=l.getBoundingClientRect(),this.dlgObj.element.classList.add("e-sticky")):(this.dlgObj.element.classList.remove("e-sticky"),d=n.calculateRelativeBasedPosition(l,this.dlgObj.element)),this.dlgObj.element.style.display=o,this.dlgObj.element.style.top=d.top+t.closest(r,".e-cc-toolbar").getBoundingClientRect().height+"px";t.isNullOrUndefined(t.closest(r,".e-bigger"))||(this.dlgObj.width=258),t.Browser.isDevice?(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=r.offsetLeft+"px":this.dlgObj.element.style.left=d.left-250+t.closest(r,".e-cc-toolbar").clientWidth+2+"px",this.removeCancelIcon(),this.infiniteRenderMode||this.dlgObj.show();var h=this.dlgObj.element.getBoundingClientRect();window.innerHeight<h.bottom&&(this.dlgObj.element.style.top=window.innerHeight-h.bottom+parseInt(this.dlgObj.element.style.top,10)-5+"px"),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!this.parent.element.classList.contains("e-drillthrough-grid")&&(t.isNullOrUndefined(t.closest(r,".e-bigger"))?_e(this.parent,this.dlgObj):_e(this.parent,this.dlgObj,258),this.dlgObj.element.querySelector(".e-ccsearch")&&this.dlgObj.element.querySelector(".e-ccsearch").select()),this.parent.notify("columnChooserOpened",{dialog:this.dlgObj})}this.rtlUpdate()},s.prototype.openColumnChooser=function(e,i){if(this.isCustomizeOpenCC=!0,this.parent.enableAdaptiveUI){if(!this.isColumnChooserOpen)return void this.parent.showResponsiveCustomColumnChooser();this.isColumnChooserOpen=!1,this.renderDlgContent()}if(this.dlgObj.visible)return void this.hideDialog();var n=this.beforeOpenColumnChooserEvent();n.cancel||(this.infiniteRenderMode||!this.selectedColumns.length||"None"!==this.sortDirection||this.parent.columnChooserSettings.template||this.setOrderedColumns(),n.columns=null,this.infiniteRenderMode&&this.dlgObj.show(),this.isInitialOpen?this.refreshCheckboxState():(this.dlgObj.content=this.renderChooserList(),this.parent.columnChooserSettings.template||this.updateIntermediateBtn()),this.dlgObj.dataBind(),this.infiniteRenderMode&&this.refreshCheckboxState(),this.dlgObj.position={X:"center",Y:"center"},t.isNullOrUndefined(e)?(this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""}),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.parent.columnChooserSettings.enableSearching||(this.dlgObj.element.querySelector(".e-dlg-content").style.margin="0px"),this.dlgObj.beforeOpen=this.customDialogOpen.bind(this),this.infiniteRenderMode||this.dlgObj.show(),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!this.parent.element.classList.contains("e-drillthrough-grid")&&_e(this.parent,this.dlgObj),this.isInitialOpen=!0,this.dlgObj.beforeClose=this.customDialogClose.bind(this))},s.prototype.enableAfterRenderEle=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},s.prototype.keyUpHandler=function(e){"Escape"===e.key&&this.resetColumnState(),e&&e.target&&!t.isNullOrUndefined(t.closest(e.target,".e-grid-popup"))&&this.parent.trigger("keyPressed",e),this.setFocus(F(e.target,"e-cclist"))},s.prototype.setFocus=function(e){var t=this.dlgDiv.querySelector(".e-colfocus");t&&t.classList.remove("e-colfocus"),e&&e.classList.add("e-colfocus")},s.prototype.customDialogOpen=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.add(e,"keyup",this.columnChooserManualSearch,this)},s.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.remove(e,"keyup",this.columnChooserManualSearch)},s.prototype.getColumns=function(){return(this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns()).filter(function(e){return"checkbox"!==e.type&&!0===e.showInColumnChooser||"checkbox"===e.type&&void 0!==e.field})},s.prototype.setOrderedColumns=function(){var e=this;this.selectedColumnModels=[];for(var t=this,i=0;i<this.selectedColumns.length;i++)!function(i){var n=t.parent.getColumnByField(t.selectedColumns[parseInt(i.toString(),10)])||t.parent.columnModel.find(function(t){return t.headerText===e.selectedColumns[parseInt(i.toString(),10)]&&"checkbox"!==t.type});n&&n.showInColumnChooser&&t.selectedColumnModels.push(n)}(i)},s.prototype.renderDlgContent=function(){var e=this.parent.enableAdaptiveUI;this.dlgDiv=this.parent.createElement("div",{className:"e-ccdlg e-cc",id:this.parent.element.id+"_ccdlg"}),e||this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new n.Dialog({header:this.parent.enableAdaptiveUI?null:this.renderHeader(),showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,target:document.getElementById(this.parent.element.id),content:this.renderChooserList(),width:250,cssClass:this.parent.cssClass?"e-cc "+this.parent.cssClass:"e-cc",animationSettings:{effect:"None"},footerTemplate:this.parent.enableAdaptiveUI?null:this.renderFooter()}),e||!this.infiniteRenderMode&&this.parent.columnChooserSettings.footerTemplate||(this.dlgObj.buttons=[{click:this.confirmDlgBtnClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-cc e-cc_okbtn "+this.parent.cssClass:"e-cc e-cc_okbtn"}},{click:this.clearBtnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat e-cc e-cc-cnbtn "+this.parent.cssClass:"e-flat e-cc e-cc-cnbtn",content:this.l10n.getConstant("CancelButton")}}]);if(this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),e){var t=document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv");t&&t.appendChild(this.dlgDiv),this.dlgObj.open=this.mOpenDlg.bind(this),this.dlgObj.target=document.querySelector(".e-rescolumnchooser > .e-dlg-content > .e-mainfilterdiv")}this.wireEvents()},s.prototype.renderHeader=function(){if(this.parent.columnChooserSettings.headerTemplate&&!this.infiniteRenderMode){var e=this.parent.createElement("div",{className:"e-columnChooserHeaderTemplate"}),t=this.parent.element.id+"columnChooserHeaderTemplate";return this.parent.isReact?(this.parent.getColumnChooserHeaderTemplate()(null,this.parent,"columnChooserHeaderTemplate",t,null,null,e),this.parent.renderTemplates()):q(e,this.parent.getColumnChooserHeaderTemplate()(null,this.parent,"columnChooserHeaderTemplate",t)),e}return this.l10n.getConstant("ChooseColumns")},s.prototype.renderFooter=function(){if(this.parent.columnChooserSettings.footerTemplate&&!this.infiniteRenderMode){var e=this.parent.createElement("div",{className:"e-columnChooserFooterTemplate"}),t=this.parent.element.id+"columnChooserFooterTemplate";return this.parent.isReact?(this.parent.getColumnChooserFooterTemplate()(null,this.parent,"columnChooserFooterTemplate",t,null,null,e),this.parent.renderTemplates()):q(e,this.parent.getColumnChooserFooterTemplate()(null,this.parent,"columnChooserFooterTemplate",t)),e}return null},s.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"),cssClass:this.parent.cssClass}}),i=this.parent.createElement("span",{className:"e-ccsearch-icon e-icons e-cc e-input-group-icon",attrs:{title:this.l10n.getConstant("Search")}}),n=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 or(t,this.serviceLocator);var r=this.getColumns(),s=[],o=[];if(r.forEach(function(e){e.visible?s.push(e.headerText):o.push(e.headerText)}),this.infiniteRenderMode&&!this.isInitialOpen){r=this.parent.columns;for(var a=0;a<r.length;a++)r[parseInt(a.toString(),10)].showInColumnChooser&&this.infiniteColumns.push(r[parseInt(a.toString(),10)])}if(this.parent.columnChooserSettings.template&&!this.infiniteRenderMode){var l=this.parent.createElement("div",{className:"e-columnChooserTemplate"});l.style.cssText=this.parent.enableAdaptiveUI?"height: 90%; min-height: 160px; overflow-y: auto;":"height: 196px; overflow-y: auto;";var d=this.parent.element.id+"columnChooserTemplate",h={columns:r,hideColumns:o,showColumns:s};this.parent.isReact?(this.parent.getColumnChooserTemplate()(h,this.parent,"columnChooserTemplate",d,null,null,l),this.parent.renderTemplates()):q(l,this.parent.getColumnChooserTemplate()(h,this.parent,"columnChooserTemplate",d,null,null,null,this.parent.root)),this.parent.columnChooserSettings.renderCustomColumnChooser&&("function"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser?this.parent.columnChooserSettings.renderCustomColumnChooser(l,r):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=fe(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(l,r))),this.mainDiv.appendChild(e),this.mainDiv.appendChild(l)}else{var p=this.refreshCheckboxList(r);if(this.innerDiv.appendChild(p),n.appendChild(this.innerDiv),this.parent.enableAdaptiveUI){var c=this.parent.createElement("div",{className:"e-cc-searchBox"});c.appendChild(e),this.mainDiv.appendChild(c)}else this.mainDiv.appendChild(e);this.mainDiv.appendChild(n)}return this.parent.columnChooserSettings.enableSearching||(e.style.display="none"),this.mainDiv},s.prototype.confirmDlgBtnClick=function(e){var i={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1};if(this.parent.trigger(qt,i),!i.cancel){this.stateChangeColumns=[],this.changedStateColumns=[];var n=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns();this.changedColumns=this.changedColumns.length>0?this.changedColumns:this.unchangedColumns,this.changedColumnState(this.changedColumns);var r=this.infiniteRenderMode?this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}).length:this.ulElement&&this.ulElement.querySelector(".e-uncheck")&&this.ulElement.querySelectorAll(".e-uncheck:not(.e-selectall)").length;t.isNullOrUndefined(e)||(r<n.length&&(this.changeColumnVisibility({visibleColumns:this.showColumn,hiddenColumns:this.hideColumn},"uid"),0===this.parent.getCurrentViewRecords().length&&this.parent.element.querySelector(".e-emptyrow").querySelector("td").setAttribute("colSpan",this.parent.getVisibleColumns().length.toString())),this.parent.enableAdaptiveUI&&this.parent.scrollModule&&this.parent.scrollModule.refresh(),this.parent.editSettings.showAddNewRow&&this.parent.notify(zi,{}));var s={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1};this.parent.trigger(Ut,s)}},s.prototype.changeColumnVisibility=function(e,t){if("uid"!==(t=t||"headerText")&&(e.visibleColumns||e.hiddenColumns)){this.stateChangeColumns=[],this.changedStateColumns=[];var i=this.getColumns();e.hiddenColumns=i.filter(function(i){return-1!==e.hiddenColumns.indexOf(i[t])}).map(function(e){return e.uid}),e.visibleColumns=i.filter(function(i){return-1!==e.visibleColumns.indexOf(i[t])}).map(function(e){return e.uid})}e.hiddenColumns.length&&this.columnStateChange(e.hiddenColumns,!1),e.visibleColumns.length&&this.columnStateChange(e.visibleColumns,!0),this.getShowHideService.setVisible(this.stateChangeColumns,this.changedStateColumns),this.clearActions(),this.parent.notify("tooltip-destroy",{module:"edit"})},s.prototype.onResetColumns=function(e){if("columnstate"===e.requestType)return void this.resetColumnState()},s.prototype.renderResponsiveColumnChooserDiv=function(e){"open"===e.action?(this.isColumnChooserOpen=!0,this.openColumnChooser()):"clear"===e.action?this.clearBtnClick():"confirm"===e.action&&this.confirmDlgBtnClick(!0)},s.prototype.resetColumnState=function(){if(this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.filterColumns=[],this.searchValue="",this.selectedColumnModels=[],this.selectedColumns=[],this.sortDirection="",this.infiniteRenderMode&&this.dlgDiv){var e=this.dlgDiv.querySelector(".e-cclist.e-cc-selectall.e-colfocus");e&&e.classList.remove("e-colfocus")}this.hideDialog()},s.prototype.changedColumnState=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],n=this.parent.getColumnByUid(i,this.infiniteRenderMode);this.changedStateColumns.push(n)}},s.prototype.columnStateChange=function(e,t){for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],r=this.parent.getColumnByUid(n,this.infiniteRenderMode);r&&("checkbox"!==r.type&&(r.visible=t),this.stateChangeColumns.push(r))}},s.prototype.clearActions=function(){this.resetColumnState(),this.addcancelIcon()},s.prototype.clearBtnClick=function(){var e={requestType:"columnChooserClose",cancel:!1};if(this.parent.trigger(qt,e),!e.cancel){this.clearActions(),this.parent.notify("columnChooserCancelBtnClick",{dialog:this.dlgObj});var t={requestType:"columnChooserClose",cancel:!1};this.parent.trigger(Ut,t)}},s.prototype.checkstatecolumn=function(e,t,i){void 0===i&&(i=!1);var n=this.parent.getColumnByUid(t,this.infiniteRenderMode);e?(-1!==this.hideColumn.indexOf(t)&&this.hideColumn.splice(this.hideColumn.indexOf(t),1),-1!==this.showColumn.indexOf(t)||n&&n.visible||this.showColumn.push(t)):(-1!==this.showColumn.indexOf(t)&&this.showColumn.splice(this.showColumn.indexOf(t),1),-1===this.hideColumn.indexOf(t)&&n&&n.visible&&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)},s.prototype.columnChooserSearch=function(e,n){if(n){var r={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1};if(this.parent.trigger(qt,r),r.cancel)return}var s,o=!1,a=this.dlgDiv.querySelector(".e-footer-content"),l=this.ulElement&&this.ulElement.querySelector(".e-check")&&this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;if(this.infiniteRenderMode&&(l=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}).length),this.isInitialOpen=!0,a&&a.querySelector(".e-btn")&&(s=a.querySelector(".e-btn").ej2_instances[0]),""===e)this.removeCancelIcon(),this.filterColumns=this.selectedColumnModels.length?this.selectedColumnModels:this.getColumns(),o=!0;else{var d=this.selectedColumnModels.length?this.selectedColumnModels:this.getColumns();this.filterColumns=new i.DataManager(d).executeLocal((new i.Query).where("headerText",this.searchOperator,e,!0,this.parent.columnChooserSettings.ignoreAccent))}if(0!==this.selectedColumnModels.length||"None"===this.sortDirection||this.parent.columnChooserSettings.template||(this.filterColumns=this.sortColumnChooser(this.filterColumns,this.sortDirection)),this.infiniteRenderMode&&this.updateIfiniteSelectAll(),this.parent.columnChooserSettings.template&&!this.infiniteRenderMode){var h=void 0,p=this.parent.isReact;p?(ut(this.parent,["columnChooserTemplate"]),h=this.mainDiv.querySelector(".e-columnChooserTemplate")):(this.mainDiv.querySelector(".e-columnChooserTemplate").remove(),(h=this.parent.createElement("div",{className:"e-columnChooserTemplate"})).style.cssText=this.parent.enableAdaptiveUI?"height: 90%; min-height: 160px; overflow-y: auto;":"height: 196px; overflow-y: auto;");var c=this.parent.element.id+"columnChooserTemplate",u=this.filterColumns,g=e,f=[],m=[];u.forEach(function(e){e.visible?f.push(e.headerText):m.push(e.headerText)});var y={columns:u,hideColumns:m,showColumns:f,searchValue:g};p?(this.parent.getColumnChooserTemplate()(y,this.parent,"columnChooserTemplate",c,null,null,h),this.parent.renderTemplates()):q(h,this.parent.getColumnChooserTemplate()(y,this.parent,"columnChooserTemplate",c,null,null,null,this.parent.root)),this.parent.columnChooserSettings.renderCustomColumnChooser&&("function"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser?this.parent.columnChooserSettings.renderCustomColumnChooser(h,this.filterColumns):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=fe(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(h,this.filterColumns))),this.mainDiv.appendChild(h)}else if(this.filterColumns.length)this.innerDiv.innerHTML=" ",this.innerDiv.classList.remove("e-ccnmdiv"),this.infiniteInitialLoad=!0,this.infiniteLoadedElement=[],this.innerDiv.appendChild(this.refreshCheckboxList(this.filterColumns)),this.infiniteRenderMode&&(this.mainDiv.querySelector(".e-ccheck .e-selectall").parentElement.classList.remove("e-checkbox-disabled"),this.updateIntermediateBtn()),o?(s&&l&&(s.disabled=!1),l&&this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(Pi,{disabled:!1})):(this.addcancelIcon(),this.refreshCheckboxButton());else{var v=this.parent.createElement("span",{className:"e-cc e-nmatch"});v.innerHTML=this.l10n.getConstant("Matchs"),this.innerDiv.innerHTML=" ",this.infiniteRenderMode&&(t.removeClass([this.mainDiv.querySelector(".e-frame.e-selectall")],["e-check","e-stop","e-uncheck"]),this.mainDiv.querySelector(".e-ccheck .e-selectall").parentElement.classList.add("e-checkbox-disabled")),this.innerDiv.appendChild(v),this.innerDiv.classList.add("e-ccnmdiv"),s&&(s.disabled=!0),this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(Pi,{disabled:!0})}if(this.flag=!0,this.stopTimer(),n){var S={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1};this.parent.trigger(Ut,S)}},s.prototype.sortColumnChooser=function(e,t){return"Ascending"===t?e.slice().sort(function(e,t){return e.field.toLowerCase()<t.field.toLowerCase()?-1:1}):"Descending"===t?e.slice().sort(function(e,t){return e.field.toLowerCase()>t.field.toLowerCase()?-1:1}):e},s.prototype.updateIfiniteSelectAll=function(){this.changedColumns=[],this.hideColumn=[],this.showColumn=[];for(var e=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}),t=0;t<e.length;t++)this.checkState(e[parseInt(t.toString(),10)].querySelector(".e-frame"),!0)},s.prototype.wireEvents=function(){t.EventHandler.add(this.dlgObj.element,"click",this.checkBoxClickHandler,this),t.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),t.EventHandler.add(this.dlgObj.element,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent()},s.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.dlgObj&&this.dlgObj.element&&(t.EventHandler.remove(this.dlgObj.element,"click",this.checkBoxClickHandler),t.EventHandler.remove(this.dlgObj.element,"keyup",this.keyUpHandler)),this.searchBoxObj&&(t.EventHandler.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent()))},s.prototype.checkBoxClickHandler=function(e){if(!this.parent.columnChooserSettings.template||this.infiniteRenderMode){var t,i=F(e.target,"e-checkbox-wrapper"),n=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns();if(i){i.querySelector(".e-selectall")?this.updateSelectAll(!i.querySelector(".e-check")):se(i.parentElement),i.querySelector(".e-chk-hidden").focus(),i.querySelector(".e-check")?t=!0:i.querySelector(".e-uncheck")&&(t=!1),this.infiniteRenderMode||this.updateIntermediateBtn();var r=F(i,"e-ccheck").getAttribute("data-uid"),s=this.searchValue&&this.searchValue.length||this.selectedColumnModels.length?this.filterColumns:n;if(r===this.parent.element.id+"-selectAll"){this.changedColumns=[],this.unchangedColumns=[];for(var o=0;o<s.length;o++)s[parseInt(o.toString(),10)].showInColumnChooser&&this.checkstatecolumn(t,s[parseInt(o.toString(),10)].uid,!0)}else this.checkstatecolumn(t,r);var a=!!(this.infiniteRenderMode&&i.querySelector(".e-selectall")&&i.querySelector(".e-uncheck"));this.parent.columnChooserSettings.footerTemplate||this.refreshCheckboxButton(a),this.setFocus(F(e.target,"e-cclist")),this.infiniteRenderMode&&this.updateIntermediateBtn()}}},s.prototype.updateIntermediateBtn=function(){var e=this.infiniteRenderMode?this.infiniteLoadedElement.length:this.ulElement.children.length-1,i=[],n=0,r=0;(this.searchValue&&this.searchValue.length||"None"!==this.sortDirection?this.filterColumns:this.infiniteColumns).filter(function(e){!1===e.visible?n++:r++});var s,o=(this.infiniteRenderMode&&this.mainDiv.querySelector(".e-cc-selectall")?this.mainDiv.querySelector(".e-cc-selectall"):this.ulElement.children[0]).querySelector(".e-frame"),a=this.infiniteRenderMode?this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}).length:this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;this.parent.enableAdaptiveUI||this.parent.columnChooserSettings.footerTemplate?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(Pi,{disabled:!1}):(s=this.dlgObj.btnObj[0]).disabled=!1;var l=o.parentElement.querySelector("input");e===a&&(!this.infiniteRenderMode||this.infiniteRenderMode&&n===this.showColumn.length)?(i=["e-check"],oe(l,!0)):a||this.infiniteRenderMode&&!a&&r!==this.hideColumn.length?(i=["e-stop"],l.indeterminate=!0):(i=["e-uncheck"],oe(l,!1),s&&!this.parent.enableAdaptiveUI?s.disabled=!0:this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(Pi,{disabled:!0})),s&&!this.parent.enableAdaptiveUI&&s.dataBind(),t.removeClass([o],["e-check","e-stop","e-uncheck"]),t.addClass([o],i)},s.prototype.updateSelectAll=function(e){var t=[].slice.call(this.ulElement.getElementsByClassName("e-frame"));this.infiniteRenderMode&&(t=[],this.infiniteLoadedElement.map(function(e){return t.push(e.querySelector(".e-frame"))}),t.unshift(this.mainDiv.querySelector(".e-cc-selectall").querySelector(".e-frame")));for(var i=0,n=t;i<n.length;i++){var r=n[i];le(r,e);var s=r.parentElement.querySelector("input");r.classList.contains("e-check")?oe(s,!0):r.classList.contains("e-uncheck")&&oe(s,!1)}},s.prototype.refreshCheckboxButton=function(e){for(var t=this.parent.getVisibleColumns(),i=0;i<t.length;i++){h=t[parseInt(i.toString(),10)].uid;-1===this.prevShowedCols.indexOf(h)&&"checkbox"!==t[parseInt(i.toString(),10)].type&&this.prevShowedCols.push(h)}for(i=0;i<this.hideColumn.length;i++){var n=this.prevShowedCols.indexOf(this.hideColumn[parseInt(i.toString(),10)]);-1!==n&&this.prevShowedCols.splice(n,1)}var r=0!==this.showColumn.length?1:this.prevShowedCols.length;this.infiniteRenderMode&&(r=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}).length);var s;this.parent.enableAdaptiveUI?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(Pi,{disabled:!1}):(s=this.dlgDiv.querySelector(".e-footer-content").querySelector(".e-btn").ej2_instances[0]).disabled=!1;for(var o=[],a=[].slice.call(document.getElementsByClassName("e-cc-chbox")),i=0,l=a.length;i<l;i++){var d=a[parseInt(i.toString(),10)];if(!this.infiniteRenderMode||!d.classList.contains("e-selectall")){var h=F(d,"e-ccheck").getAttribute("data-uid");o.push(h)}}var p=this.showColumn.filter(function(e){return-1!==o.indexOf(e)});(this.infiniteRenderMode&&(e||o.length===r)||!this.infiniteRenderMode&&0===r&&0===p.length)&&(this.parent.enableAdaptiveUI?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(Pi,{disabled:!0}):s.disabled=!0),this.parent.enableAdaptiveUI||s.dataBind()},s.prototype.refreshCheckboxList=function(e){this.ulElement=this.parent.createElement("ul",{className:"e-ccul-ele e-cc"});var i=this.l10n.getConstant("SelectAll"),n=this.parent.createElement("li",{className:"e-cclist e-cc e-cc-selectall"});t.updateCSSText(n,this.infiniteRenderMode?"list-style: None;":"");var r=this.createCheckBox(i,!1,this.parent.element.id+"-selectAll");return e.length&&(r.querySelector(".e-checkbox-wrapper").firstElementChild.classList.add("e-selectall"),r.querySelector(".e-frame").classList.add("e-selectall"),this.checkState(r.querySelector(".e-icons"),!0),n.appendChild(r),this.infiniteRenderMode?this.mainDiv.querySelector(".e-cc-contentdiv")&&!this.mainDiv.querySelector(".e-cc-selectall")&&(this.infiniteDiv=this.mainDiv.querySelector(".e-cc-contentdiv"),this.mainDiv.insertBefore(n,this.infiniteDiv),this.infiniteDiv.classList.add("e-checkbox-infinitescroll"),t.EventHandler.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this),t.EventHandler.add(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),t.EventHandler.add(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.ulElement.appendChild(n)),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?t.addClass([r],this.parent.cssClass.split(" ")):t.addClass([r],[this.parent.cssClass])),this.infiniteRenderMode&&e.length>3*this.itemsCount&&(this.infiniteSkipCount=2*this.itemsCount),this.renderCheckbox(e.slice(0,this.infiniteRenderMode?3*this.itemsCount:e.length)),this.ulElement},s.prototype.infiniteScrollMouseKeyDownHandler=function(){t.EventHandler.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler)},s.prototype.infiniteScrollMouseKeyUpHandler=function(i){var n=this;t.EventHandler.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this);var r=this.infiniteDiv;this.ulElement.children.length>1&&(r.scrollTop>=r.scrollHeight-r.offsetHeight||r.scrollTop<=0)&&this.infiniteScrollHandler(),e.Global.timer=setTimeout(function(){n.clickHandler(i),e.Global.timer=null},0)},s.prototype.infiniteScrollHandler=function(){var e=this.infiniteDiv,t=this.searchValue&&this.searchValue.length||"None"!==this.sortDirection?this.filterColumns:this.infiniteColumns;if(e.scrollTop>=e.scrollHeight-e.offsetHeight&&this.infiniteLoadedElement.length<=this.infiniteSkipCount+this.itemsCount&&this.ulElement.children.length===3*this.itemsCount&&(!t.length||t.length>this.infiniteSkipCount+this.itemsCount)){var i=t.length-(this.infiniteSkipCount+this.itemsCount),n=0;i<this.itemsCount&&(n=i),gt([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteInitialLoad=!0,this.infiniteSkipCount+=this.itemsCount,this.renderCheckbox(t.slice(this.infiniteSkipCount,this.infiniteSkipCount+(n+this.itemsCount))),this.prevInfiniteScrollDirection="down"}else e.scrollTop>=e.scrollHeight-e.offsetHeight&&this.infiniteLoadedElement.length>this.infiniteSkipCount+this.itemsCount&&this.ulElement.children.length===3*this.itemsCount?(gt([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteSkipCount+="down"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,q(this.ulElement,this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.itemsCount+this.infiniteSkipCount)),this.prevInfiniteScrollDirection="down"):0===e.scrollTop&&!this.infiniteInitialLoad&&this.infiniteSkipCount&&this.infiniteLoadedElement.length&&this.infiniteLoadedElement.length>3*this.itemsCount&&this.ulElement.children.length===3*this.itemsCount?(gt([].slice.call(this.ulElement.children).splice(2*this.itemsCount,this.itemsCount)),this.infiniteSkipCount-="up"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,ft([].slice.call(this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.infiniteSkipCount+this.itemsCount)),this.ulElement),this.prevInfiniteScrollDirection="up",this.infiniteDiv.scrollTop=this.infiniteScrollAppendDiff):0===e.scrollTop&&!this.infiniteInitialLoad&&this.infiniteSkipCount&&this.infiniteSkipCount>2*this.itemsCount&&this.infiniteLoadedElement.length&&this.ulElement.children.length<3*this.itemsCount&&(gt([].slice.call(this.ulElement.children).splice(2*this.itemsCount,t.length%this.itemsCount)),this.infiniteSkipCount=(Math.floor(t.length/this.itemsCount)-3)*this.itemsCount,ft([].slice.call(this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.infiniteSkipCount+this.itemsCount)),this.ulElement),this.infiniteDiv.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up")},s.prototype.refreshCheckboxState=function(){if(this.parent.columnChooserSettings.enableSearching||this.selectedColumnModels.length||"None"!==this.sortDirection){this.dlgObj.element.querySelector(".e-cc.e-input").value="",this.columnChooserSearch("",!1);for(var e=this.parent,t=this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)"),i=0,n=t.length;i<n;i++){var r=t[parseInt(i.toString(),10)],s=void 0;s=this.parent.childGrid||this.parent.detailTemplate?F(this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)")[parseInt(i.toString(),10)],"e-ccheck").getAttribute("data-uid"):F(r,"e-ccheck").getAttribute("data-uid");var o=e.getColumnByUid(s,this.infiniteRenderMode),a=[].slice.call(r.parentElement.getElementsByClassName("e-uncheck"));o.visible&&!a.length?(r.checked=!0,this.checkState(r.parentElement.querySelector(".e-icons"),!0)):(r.checked=!1,this.checkState(r.parentElement.querySelector(".e-icons"),!1))}}},s.prototype.checkState=function(e,i){i?t.classList(e,["e-check"],["e-uncheck"]):t.classList(e,["e-uncheck"],["e-check"])},s.prototype.createCheckBox=function(e,t,i){var n=t?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);this.parent.enableAdaptiveUI||!this.parent.enableRtl||n.classList.contains("e-rtl")||n.classList.add("e-rtl");var r=n.querySelector(".e-label"),s=n.querySelector("input");return oe(s,t),r.setAttribute("id",i+"label"),r.innerHTML=e,s.setAttribute("aria-labelledby",r.id),ae(i,n,"e-ccheck")},s.prototype.renderCheckbox=function(e){for(var i,n=this.parent.createElement("div"),r=this.ulElement.offsetHeight,s=0;s<e.length;s++){var o=e[parseInt(s.toString(),10)];if(o.showInColumnChooser){var a=this.parent.createElement("li",{className:"e-cclist e-cc",id:"e-ccli_"+o.uid});a.style.listStyle="none";var l=-1!==this.hideColumn.indexOf(o.uid),d=-1!==this.showColumn.indexOf(o.uid),h=this.createCheckBox(o.headerText,o.visible&&!l||d,o.uid);a.appendChild(h),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?t.addClass([h],this.parent.cssClass.split(" ")):t.addClass([h],[this.parent.cssClass])),this.infiniteRenderMode&&this.infiniteDiv&&(a.style.height=mt(this.infiniteDiv,!0)+"px"),n.appendChild(a)}}this.infiniteRenderMode&&this.infiniteInitialLoad&&((i=this.infiniteLoadedElement).push.apply(i,[].slice.call(n.children)),this.infiniteInitialLoad=!1),q(this.ulElement,[].slice.call(n.children)),this.infiniteRenderMode&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=this.ulElement.offsetHeight-r),this.isInitialOpen&&this.updateIntermediateBtn()},s.prototype.columnChooserManualSearch=function(e){this.addcancelIcon(),this.searchValue=e.target.value,this.stopTimer(),this.startTimer(e)},s.prototype.startTimer=function(e){var t=this,i=t.flag||13===e.keyCode?0:500;this.timer=window.setInterval(function(){t.columnChooserSearch(t.searchValue,!0)},i)},s.prototype.stopTimer=function(){window.clearInterval(this.timer)},s.prototype.addcancelIcon=function(){this.dlgDiv&&this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon")&&(this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.add("e-cc-cancel"),this.dlgDiv.querySelector(".e-cc-cancel").setAttribute("title",this.l10n.getConstant("Clear")))},s.prototype.removeCancelIcon=function(){this.dlgDiv&&this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon")&&(this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.remove("e-cc-cancel"),this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").setAttribute("title",this.l10n.getConstant("Search")))},s.prototype.mOpenDlg=function(){t.Browser.isDevice&&(this.dlgObj.element.querySelector(".e-cc-searchdiv")&&this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.remove("e-input-focus"),this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0]&&this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0].focus()),this.parent.enableAdaptiveUI&&this.dlgObj.element.querySelector(".e-cc-searchdiv")&&this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.add("e-input-focus")},s.prototype.getModuleName=function(){return"columnChooser"},s.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++)(this.parent.element.id+"_ccdlg"!==e[parseInt(t.toString(),10)].id||e[parseInt(t.toString(),10)].classList.contains("e-dialog"))&&e[parseInt(t.toString(),10)].ej2_instances[0].hide()},s.prototype.beforeOpenColumnChooserEvent=function(){var e=co({requestType:"beforeOpenColumnChooser",element:this.parent.element,columns:this.getColumns(),cancel:!1,searchOperator:this.parent.columnChooserSettings.operator,sortDirection:"None"},this.parent.enableColumnVirtualization?{}:{selectedColumns:[]});return this.parent.trigger("beforeOpenColumnChooser",e),this.searchOperator=e.searchOperator,this.sortDirection=e.sortDirection,this.parent.enableColumnVirtualization||(this.selectedColumns=e.selectedColumns),e},s.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},s.prototype.showCustomColumnChooser=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()},s.prototype.onPropertyChanged=function(e){if(!e||e.module===this.getModuleName()){var t=this.parent.columnChooserSettings.enableSearching;if(this.dlgObj&&this.dlgObj.element){var i=this.dlgObj.element.querySelector(".e-cc-searchdiv"),n=this.dlgObj.element.querySelector(".e-dlg-content");i.style.display=t?"":"none",n.style.margin=t?"":"0px"}}},s}(),go=function(){function n(e,t){this.hideColumnInclude=!1,this.foreignKeyData={},this.parent=e,!e.parentDetails&&t&&(this.foreignKeyData=t)}return n.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},n.prototype.getFData=function(e,t){return he(t,{},e,this.foreignKeyData[t.field])[0]},n.prototype.getGridRowModel=function(e,t,i,n){void 0===n&&(n=0);var r=[],s=t.length;if(s){for(var o=0;o<s;o++,n++){var a={isExpand:!1};a.data=t[parseInt(o.toString(),10)],a.index=n,(i.childGrid||i.detailTemplate)&&("All"===i.hierarchyPrintMode?a.isExpand=!0:"Expanded"===i.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(n.toString(),10)]&&(a.isExpand=i.expandedRows[parseInt(n.toString(),10)].isExpand));var l=new ji(a);l.cells=this.generateCells(e,i),r.push(l)}this.processColumns(r)}return r},n.prototype.generateCells=function(t,i){var n=[];if(i.childGridLevel)for(var r=i.childGridLevel,s=0;r>s;s++)n.push(this.generateCell({},e.CellType.Indent));for(var o=0,a=t;o<a.length;o++){var l=a[o];n.push(this.generateCell(l,e.CellType.Data))}return n},n.prototype.getColumnData=function(e){var t,n=this,r=[],s=e.getForeignKeyColumns();if(s.length){for(var o=0;o<s.length;o++){var a="result"in s[parseInt(o.toString(),10)].dataSource?new i.DataManager(s[parseInt(o.toString(),10)].dataSource.result):s[parseInt(o.toString(),10)].dataSource;r.push(a.executeQuery(new i.Query))}t=Promise.all(r).then(function(e){for(var t=0;t<s.length;t++)n.foreignKeyData[s[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].result})}return t},n.prototype.getHeaders=function(e,t){this.hideColumnInclude=!!t,this.colDepth=we(e);for(var i=[],n=0;n<this.colDepth;n++)i[parseInt(n.toString(),10)]=new ji({}),i[parseInt(n.toString(),10)].cells=[];return i=this.processColumns(i),i=this.processHeaderCells(i,e),{rows:i,columns:this.generateActualColumns(e)}},n.prototype.getConvertedWidth=function(e){var t=parseFloat(e);return-1!==e.indexOf("%")?this.parent.element.getBoundingClientRect().width*t/100:t},n.prototype.generateActualColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,n=e;i<n.length;i++){var r=n[i];r.commands||(r.columns?(r.visible||this.hideColumnInclude)&&0!==this.getCellCount(r,0)&&this.generateActualColumns(r.columns,t):(r.visible||this.hideColumnInclude)&&t.push(r))}return t},n.prototype.processHeaderCells=function(e,t){for(var i=t,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].commands||(e=this.appendGridCells(i[parseInt(n.toString(),10)],e,0));return e},n.prototype.appendGridCells=function(t,i,n){if(t.columns||!1===t.visible&&!this.hideColumnInclude||t.commands){if(t.columns){var r=this.getCellCount(t,0);r&&i[parseInt(n.toString(),10)].cells.push(new Vi({cellType:e.CellType.StackedHeader,column:t,colSpan:r}));for(var s=void 0,o=0,a=t.columns.length;o<a;o++)t.columns[parseInt(o.toString(),10)].visible&&!s&&(s=!0),i=this.appendGridCells(t.columns[parseInt(o.toString(),10)],i,n+1)}}else i[parseInt(n.toString(),10)].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-n,n));return i},n.prototype.generateCell=function(t,i,n,r){var s={visible:t.visible,isDataCell:i===e.CellType.Data,column:t,cellType:i,rowSpan:n,index:r};return(!s.rowSpan||s.rowSpan<2)&&delete s.rowSpan,new Vi(s)},n.prototype.processColumns=function(t){var i=this.parent,n=[];i.enableColumnVirtualization&&(n=i.getColumnIndexesInView());for(var r=0,s=t.length;r<s;r++)if(i.allowGrouping)for(var o=0,a=i.groupSettings.columns.length-1;o<a;o++)i.enableColumnVirtualization&&-1===n.indexOf(o)||t[parseInt(r.toString(),10)].cells.splice(0,0,this.generateCell({},e.CellType.HeaderIndent));return t},n.prototype.getCellCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getCellCount(e.columns[parseInt(i.toString(),10)],t);else(e.visible||this.hideColumnInclude)&&t++;return t},n.prototype.checkAndExport=function(e,t){Object.keys(e).some(function(t){return!e[""+t]})||t()},n.prototype.failureHandler=function(e,t,i){var n=this;return function(){e[t.id]=!0,n.checkAndExport(e,i)}},n.prototype.createChildGrid=function(e,i,n,r){var s=new Wr(this.parent.detailRowModule.getGridModel(e,i,n));e.isPrinting=!1;s.parentDetails={parentID:e.element.id,parentPrimaryKeys:e.getPrimaryKeyFieldNames(),parentKeyField:e.childGrid.queryString,parentKeyFieldValue:t.getValue(s.queryString,i.data),parentRowData:i.data};var o=z("child-grid"),a=t.createElement("div",{id:o});return a.style.display="none",document.body.appendChild(a),s.id=o,r[""+o]=!1,s.isExportGrid=!0,{childGrid:s,element:a}},n.prototype.getGridExportColumns=function(e){for(var t=[],i=0,n=e;i<n.length;i++)"checkbox"!==n[parseInt(i.toString(),10)].type&&t.push(n[parseInt(i.toString(),10)]);return t},n.prototype.getForeignKeyData=function(){return this.foreignKeyData},n}(),fo=function(){function e(e){this.valueFormatter=new Ft(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){if(e.isForeignKey&&(e.value=t.getValue(e.column.foreignKeyValue,he(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format)return"string"==typeof e.column.format&&(e.column.format={format:e.column.format}),e.value||0===e.value?this.internationalization.getNumberFormat(e.column.format)(e.value):"";if("boolean"===e.column.type&&""!==e.value)return e.value?"true":"false";if("date"!==e.column.type&&"dateonly"!==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 i=void 0,n=e.column.format;return i="date"===e.column.type||"dateonly"===e.column.type?{type:"date",skeleton:n}:"time"===e.column.type?{type:"time",skeleton:n}:{type:"dateTime",skeleton:n},this.returnFormattedValue(e,i)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var r=void 0;return r="date"===e.column.type||"dateonly"===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,r)},e}(),mo=function(){function n(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.isChild=!1,this.isElementIdChanged=!1,this.gridPool={},this.sheet={},this.grpFooterTemplates=[],this.footerTemplates=[],this.aggIndex=0,this.totalAggregates=0,this.parent=e,this.helper=new go(e),this.locator=t,this.l10n=this.locator.getService("localization")}return n.prototype.getModuleName=function(){return"ExcelExport"},n.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 fo(e.locale),e.id=z("main-grid"),this.gridPool[e.id]=!1)},n.prototype.Map=function(e,i,n,r,s,o){var a=e;this.gridPool={},!e.childGrid&&!e.detailTemplate||!t.isNullOrUndefined(i)&&"None"===i.hierarchyExportMode||(e.expandedRows=ve(e).expandedRows);var l={requestType:"beforeExcelExport",gridObject:a,cancel:!1,isMultipleExport:n,workbook:r,isCsv:s,isBlob:o,isChild:this.isChild,grpFooterTemplates:this.grpFooterTemplates};return a.trigger("beforeExcelExport",l),l.cancel?new Promise(function(e){return e()}):(this.parent.log("exporting_begin",this.getModuleName()),this.data=new Hi(a),this.isExporting=!0,this.isBlob=l.isBlob,this.isChild=l.isChild,this.grpFooterTemplates=l.grpFooterTemplates,this.isCsvExport=!!l.isCsv&&l.isCsv,y(i)&&v(i,a),this.processRecords(a,i,l.isMultipleExport,l.workbook))},n.prototype.exportingSuccess=function(e){this.isExporting=!1,this.parent.trigger("excelExportComplete",this.isBlob?{promise:this.blobPromise}:{gridInstance:this.parent}),this.parent.log("exporting_complete",this.getModuleName()),e(this.book)},n.prototype.processRecords=function(e,n,r,s){var o=this;if(t.isNullOrUndefined(n)||t.isNullOrUndefined(n.dataSource)){if(t.isNullOrUndefined(n)||"CurrentPage"!==n.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()){var a=[],l=go.getQuery(e,this.data);return this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&(t.isNullOrUndefined(n)&&(n={hierarchyExportMode:"All"}),n.hierarchyExportMode="None"===n.hierarchyExportMode?"None":"All","All"===n.hierarchyExportMode&&(l.lazyLoad=[])),a.push(this.data.getData({},l)),a.push(this.helper.getColumnData(e)),new Promise(function(t,i){Promise.all(a).then(function(i){o.init(e),o.processInnerRecords(e,n,r,s,i[0]).then(function(){o.exportingSuccess(t)})}).catch(function(e){i(o.book),o.parent.trigger(Ht,e)})})}return new Promise(function(t){o.init(e),o.processInnerRecords(e,n,r,s,o.parent.getCurrentViewRecords()),o.exportingSuccess(t)})}n.dataSource=n.dataSource instanceof i.DataManager?n.dataSource:new i.DataManager(n.dataSource);var d=n.query?n.query:new i.Query;return(t.isNullOrUndefined(d.isCountRequired)||e.aggregates)&&(d.isCountRequired=!0),new Promise(function(t){n.dataSource.executeQuery(d).then(function(i){o.init(e),o.processInnerRecords(e,n,r,s,i).then(function(){o.exportingSuccess(t)})})})},n.prototype.processInnerRecords=function(e,i,n,r,s){var o=this;this.groupedColLength=e.groupSettings.columns.length;var a,l=5,h=[],p=we(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)||(l=i.multipleExport.blankRows)),t.isNullOrUndefined(r)?(this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.sheet.images=[]):"NewSheet"===this.expType?(this.workSheet=r.worksheets,this.rows=[],this.columns=[],this.sheet.images=[],this.styles=r.styles):(this.workSheet=[],this.rows=r.worksheets[0].rows,this.columns=r.worksheets[0].columns,this.styles=r.styles,this.sheet.images=r.worksheets[0].images,this.rowLength=this.rows[this.rows.length-1].index+l,this.rowLength++),c&&(t.isNullOrUndefined(n)?(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)||!n&&"NewSheet"!==this.expType||this.processExcelHeader(JSON.parse(JSON.stringify(i.header))),t.isNullOrUndefined(i.footer)||("AppendToSheet"===this.expType?n||(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,n){e.childGridLevel=0,h=o.processGridExport(e,i,s),o.globalResolve=t,o.gridPool[e.id]=!0,o.helper.checkAndExport(o.gridPool,o.globalResolve)}).then(function(){var s=[];if(o.organiseRows(h,h[0].index,s),o.rows=o.rows.concat(s),t.isNullOrUndefined(o.footer)||("AppendToSheet"===o.expType&&!n||"NewSheet"===o.expType)&&o.processExcelFooter(o.footer),o.columns.length>0&&(o.sheet.columns=o.columns),o.sheet.rows=o.rows,o.sheet.enableRtl=o.parent.enableRtl,o.parent.allowFiltering&&e.getVisibleColumns().length&&c&&i.enableFilter){var l=i.header?i.header.headerRows||i.header.rows.length:0,u={row:p+l,column:o.groupedColLength?o.groupedColLength+1:o.sheet.columns[0].index,lastRow:o.sheet.rows.length,lastColumn:o.sheet.columns.length};o.sheet.autoFilters=u}if(o.workSheet.push(o.sheet),o.book.worksheets=o.workSheet,o.book.styles=o.styles,e.notify("finalPageSetup",o.book),!n){if(o.isCsvExport){c&&!t.isNullOrUndefined(i.separator)&&","!==i.separator&&(a=i.separator);g=new d.Workbook(o.book,"csv",e.locale,t.defaultCurrencyCode,a);o.isBlob?o.blobPromise=g.saveAsBlob("text/csv"):c&&i.fileName?g.save(i.fileName):g.save("Export.csv")}else{var g=new d.Workbook(o.book,"xlsx",e.locale,t.defaultCurrencyCode);o.isBlob?o.blobPromise=g.saveAsBlob("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):c&&i.fileName?g.save(i.fileName):g.save("Export.xlsx")}o.isElementIdChanged&&(e.element.id=""),delete e.expandedRows}return r})},n.prototype.organiseRows=function(e,t,i){if(!e.length)return t;for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)],s=r.childRows;s?(r.index=t++,delete r.childRows,i.push(r),t=this.organiseRows(s,t,i)):(r.index=t++,i.push(r))}return t},n.prototype.processGridExport=function(e,i,n){var r=[];t.isNullOrUndefined(i)||t.isNullOrUndefined(i.theme)||(this.theme=i.theme),!e.childGrid&&!e.detailTemplate||t.isNullOrUndefined(i)||(e.hierarchyPrintMode=i.hierarchyExportMode||"Expanded");var s=new go(e,this.helper.getForeignKeyData()),o=y(i)?E(i.columns,e.enableColumnVirtualization):s.getGridExportColumns(e.columns),a=s.getHeaders(o,this.includeHiddenColumn),l=e.groupSettings.columns.length?e.groupSettings.columns.length-1:0;return r=this.processHeaderContent(e,a,l,r),r=!t.isNullOrUndefined(i)&&Object.keys(i).length&&t.isNullOrUndefined(i.dataSource)?"CurrentPage"!==i.exportType||e.groupSettings.enableLazyLoading&&!e.getDataModule().isRemote()?this.processRecordContent(e,n,a,i,void 0,r,s):this.processRecordContent(e,n,a,i,e.currentViewData,r,s):this.processRecordContent(e,n,a,i,void 0,r,s),e.notify("export-DataBound",{excelRows:r,type:"excel"}),this.capTemplate=void 0,this.footerTemplates=[],this.grpFooterTemplates=[],this.aggIndex=0,this.totalAggregates=0,r},n.prototype.processRecordContent=function(e,i,n,r,s,o,a){var l;if(l=!t.isNullOrUndefined(s)&&s.length?s:i.result,t.isNullOrUndefined(l.level)?this.processRecordRows(e,l,n,0,0,r,o,a):this.processGroupedRows(e,l,n,l.level,0,r,o,a),!t.isNullOrUndefined(i.aggregates))if(t.isNullOrUndefined(s)||this.parent.groupSettings.enableLazyLoading){var d=i.result.GroupGuid?i.result.records:i.result;this.processAggregates(e,d,o)}else this.processAggregates(e,i.result,o,s);return o},n.prototype.processGroupedRows=function(e,i,n,r,s,o,a,l){for(var d=0,h=i;d<h.length;d++){var p=h[d],c=[],u={};u.index=1+r-1;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",data:p};this.parent.trigger("exportGroupCaption",y),u.value=y.captionText,u.style=this.getCaptionThemeStyle(this.theme),t.isNullOrUndefined(y.style)||(u.style=this.mergeOptions(u.style,y.style));var v=new Cn(e).generateRows(p);if(this.fillAggregates(e,v,i.level+i.childLevels-1,a,this.rowLength),c.push(u),a[a.length-1].cells.length>0){for(var S=i.level+i.childLevels+v[0].cells.length,C=0,w=0,b=a[a.length-1].cells;w<b.length;w++){var I=b[w];I.index<S&&(S=I.index),I.index>C&&(C=I.index),c[c.length-1].index!==I.index&&c.push(I)}S-u.index>1&&(u.colSpan=S-u.index);for(var x=Object.keys(v[0].data),R=x?x.length:0;C<n.columns.length-R+r+i.childLevels;){var D={};D.index=C+1,D.style=this.getCaptionThemeStyle(this.theme);var T={type:this.isCsvExport?"CSV":"Excel",data:p};this.parent.trigger("exportGroupCaption",T),t.isNullOrUndefined(T.style)||(D.style=this.mergeOptions(D.style,T.style)),c.push(D),C++}}else{for(var E=0,O=0,k=n.columns;O<k.length;O++)k[O].visible&&E++;u.colSpan=i.childLevels+E}if(a[a.length-1].cells=c,this.rowLength++,this.groupedColLength<8&&r>1){var A={outlineLevel:r-1,isCollapsed:!0};a[a.length-1].grouping=A}!t.isNullOrUndefined(i.childLevels)&&i.childLevels>0?(this.processGroupedRows(e,p.items,n,p.items.level,s,o,a,l),this.processAggregates(e,p,a,void 0,r-1+i.childLevels,!0)):(s=this.processRecordRows(e,p.items,n,r-1,s,o,a,l),this.processAggregates(e,p,a,void 0,r-1,!0))}},n.prototype.processRecordRows=function(i,n,r,s,o,a,l,d){for(var h=1,p=[],c=r.columns,u=0,g=d.getGridRowModel(c,n,i,o);u<g.length;u++){var f=g[u];p=[],o++,h=1;for(var m=void 0,y=0,v=f.cells.length;y<v;y++){var S=f.cells[parseInt(y.toString(),10)];if(S.cellType===e.CellType.Data){var C=S.column,w=C.field,b=t.isNullOrUndefined(w)?"":C.valueAccessor(w,f.data,C),I=t.isNullOrUndefined(b)?"":b;if("dateonly"===C.type&&"string"==typeof I&&I){var x=I.split(/[^0-9.]/);I=new Date(parseInt(x[0],10),parseInt(x[1],10)-1,parseInt(x[2],10))}var R=void 0;if(C.isForeignColumn&&C.isForeignColumn()&&(R=d.getFData(I,C),I=t.getValue(C.foreignKeyValue,R)),!t.isNullOrUndefined(I)){var D={},T=h+s+i.childGridLevel,E={data:f.data,column:C,foreignKeyData:R,value:I,style:void 0,colSpan:1,cell:D};if(i.trigger("excelQueryCellInfo",E),t.isNullOrUndefined(E.image)||t.isNullOrUndefined(E.image.base64)||(m=this.setImage(E,T),E.image.height&&""!==E.value&&(m+=30)),t.isNullOrUndefined(E.hyperLink)||(E.cell.hyperlink={target:E.hyperLink.target},E.value=E.hyperLink.displayText||E.value),D=E.cell,D.index=T,D.value=E.value,""===E.data&&i.childGridLevel&&1===h){var O={};O.hAlign="left",E={style:O},D.colSpan=i.getVisibleColumns().length,D.value=this.l10n.getConstant("EmptyRecord")}if(E.colSpan>1&&(D.colSpan=E.colSpan),t.isNullOrUndefined(E.style))D.style={name:i.element.id+"column"+(h+s)};else{var k=this.getColumnStyle(i,h+s);D.style=this.mergeOptions(this.styles[parseInt(k.toString(),10)],E.style)}p.push(D)}h++}}var A={index:this.rowLength++,cells:p};if(t.isNullOrUndefined(m)||(A.height=m),this.groupedColLength&&this.groupedColLength<8&&s+1>0?(A.grouping={outlineLevel:s+1,isCollapsed:!0},l.push(A)):l.push(A),(f.isExpand||this.isChild)&&(!t.isNullOrUndefined(i.childGrid)||!t.isNullOrUndefined(i.detailTemplate)))if(t.isNullOrUndefined(i.childGrid)){B={parentRow:f,row:A,value:{},action:"excelexport",gridInstance:i};this.parent.trigger("exportDetailTemplate",B),A.childRows=this.processDetailTemplate(B)}else{i.isPrinting=!0;var F=!t.isNullOrUndefined(a)&&a.exportType?a.exportType:"AllPages",M=this.helper.createChildGrid(i,f,F,this.gridPool),L=M.childGrid,P=M.element;L.actionFailure=d.failureHandler(this.gridPool,L,this.globalResolve),L.childGridLevel=i.childGridLevel+1;var N=t.extend(a,{columns:null,dataSource:null,query:null}),B={childGrid:L,row:f,exportProperties:N};this.parent.trigger("exportDetailDataBound",B),L.beforeDataBound=this.childGridCell(A,L,N,f),L.appendTo(P)}i.notify("export-RowDataBound",{rowObj:f,type:"excel",excelRows:l})}return o},n.prototype.processDetailTemplate=function(e){var i,n,r=this,s=[];if(e.value.columnHeader||e.value.rows){var o=function(e,s){var o={};if(t.isNullOrUndefined(e.index)&&(e.index=n,n++),o.index=e.index+2,t.isNullOrUndefined(e.value)||(o.value=e.value),t.isNullOrUndefined(e.colSpan)||(o.colSpan=e.colSpan),t.isNullOrUndefined(e.rowSpan)||(o.rowSpan=e.rowSpan),o.style=s?r.getHeaderThemeStyle(r.theme):r.getRecordThemeStyle(r.theme),!t.isNullOrUndefined(e.style)){var a={fontColor:e.style.fontColor,fontName:e.style.fontName,fontSize:e.style.fontSize,hAlign:e.style.excelHAlign,vAlign:e.style.excelVAlign,rotation:e.style.excelRotation,bold:e.style.bold,indent:e.style.indent,italic:e.style.italic,underline:e.style.underline,backColor:e.style.backColor,wrapText:e.style.wrapText,borders:e.style.excelBorders,numberFormat:e.style.excelNumberFormat,type:e.style.excelType,strikeThrough:e.style.strikeThrough};o.style=r.mergeOptions(a,o.style)}return t.isNullOrUndefined(e.image)||t.isNullOrUndefined(e.image.base64)||(e.rowSpan>1?r.setImage(e,o.index):(i=r.setImage(e,o.index),e.image.height&&""!==e.value&&(i+=30))),t.isNullOrUndefined(e.hyperLink)||(o.hyperlink={target:e.hyperLink.target},o.value=e.hyperLink.displayText),o},a=function(e,a){var l=[];n=0;for(var d=0;d<e.cells.length;d++){var h=e.cells[parseInt(d.toString(),10)],p=o(h,a);l.push(p)}var c={index:r.rowLength++,cells:l};t.isNullOrUndefined(i)||(c.height=i,i=null),s.push(c)};if(e.value.columnHeader)for(d=0;d<e.value.columnHeader.length;d++)a(e.value.columnHeader[parseInt(d.toString(),10)],!0);if(e.value.rows)for(d=0;d<e.value.rows.length;d++)a(e.value.rows[parseInt(d.toString(),10)])}else if(e.value.image){i=this.setImage(e.value,2);l={index:this.rowLength++,cells:[{index:2,style:this.getRecordThemeStyle(this.theme)}]};t.isNullOrUndefined(i)||(l.height=i,i=null),s.push(l)}else if(e.value.text){l={index:this.rowLength++,cells:[{index:2,value:e.value.text,style:this.getRecordThemeStyle(this.theme)}]};s.push(l)}else if(e.value.hyperLink){var l={index:this.rowLength++,cells:[{index:2,hyperlink:{target:e.value.hyperLink.target},value:e.value.hyperLink.displayText,style:this.getRecordThemeStyle(this.theme)}]};s.push(l)}for(var d=0;d<s.length;d++)s[parseInt(d.toString(),10)].grouping={outlineLevel:1,isCollapsed:!e.parentRow.isExpand,isHidden:!e.parentRow.isExpand};return s},n.prototype.setImage=function(e,i){t.isNullOrUndefined(this.sheet.images)&&(this.sheet.images=[]);var n={image:e.image.base64,row:this.rowLength,column:i,lastRow:this.rowLength,lastColumn:i};return e.image.width&&e.image.height&&(n.width=e.image.width,n.height=e.image.height),this.sheet.images.push(n),this.columns[i-1].width=e.image.width||this.columns[i-1].width,e.image.height||50},n.prototype.childGridCell=function(e,i,n,r){var s=this;return function(o){i.beforeDataBound=null,o.cancel=!0,0===o.result.length&&(o.result=[""]),e.childRows=s.processGridExport(i,n,o);for(var a=s.parent.groupSettings.columns.length,l=e.childRows,d=0;d<l.length;d++)l[parseInt(d.toString(),10)].grouping={outlineLevel:a+i.childGridLevel,isCollapsed:!r.isExpand,isHidden:!r.isExpand};return i.destroy(),t.detach(i.element),s.gridPool[i.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve),e}},n.prototype.processAggregates=function(e,i,n,r,s,o){var a=new vn(e),l=a.getColumns();l=l.filter(function(e){return t.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo();var d=void 0;if(d=t.isNullOrUndefined(r)?i:r,void 0===s&&(s=0),e.groupSettings.columns.length>0&&o){var h=new Sn(e).generateRows(d,{level:d.level});h.length>0&&(n=this.fillAggregates(e,h,s,n))}else{s=e.groupSettings.columns.length>0&&!o?e.groupSettings.columns.length:s;var p=a.generateRows(d,i.aggregates,null,null,l);p.length>0&&!o&&(s=e.groupSettings.columns.length?s-1:s,n=this.fillAggregates(e,p,s,n))}return n},n.prototype.fillAggregates=function(i,n,r,s,o){for(var a=0,l=n;a<l.length;a++){for(var d=l[a],h=[],p=!0,c=0,u=0,g=d.cells;u<g.length;u++){var f=g[u],m={},y={};if(t.isNullOrUndefined(f.attributes["data-index"])||(y=this.parent.getColumnByIndex(f.attributes["data-index"])),f.cellType!==e.CellType.DetailFooterIntent&&"checkbox"!==y.type&&!y.commands&&(f.visible||this.includeHiddenColumn))if(c++,f.isDataCell){p=!1;var v=!t.isNullOrUndefined(f.column.footerTemplate),S=!t.isNullOrUndefined(f.column.groupFooterTemplate),C=!t.isNullOrUndefined(f.column.groupCaptionTemplate);if(m.index=c+r+i.childGridLevel,v)m.value=this.getAggreateValue(i,e.CellType.Summary,f.column.footerTemplate,f,d);else if(S)m.value=this.getAggreateValue(i,e.CellType.GroupSummary,f.column.groupFooterTemplate,f,d);else if(C)m.value=this.getAggreateValue(i,e.CellType.CaptionSummary,f.column.groupCaptionTemplate,f,d);else for(var w=0,b=Object.keys(d.data[f.column.field]);w<b.length;w++)b[w]===f.column.type&&(t.isNullOrUndefined(d.data[f.column.field].Sum)?t.isNullOrUndefined(d.data[f.column.field].Average)?t.isNullOrUndefined(d.data[f.column.field].Max)?t.isNullOrUndefined(d.data[f.column.field].Min)?t.isNullOrUndefined(d.data[f.column.field].Count)?t.isNullOrUndefined(d.data[f.column.field].TrueCount)?t.isNullOrUndefined(d.data[f.column.field].FalseCount)?t.isNullOrUndefined(d.data[f.column.field].Custom)||(m.value=d.data[f.column.field].Custom):m.value=d.data[f.column.field][f.column.field+" - falsecount"]:m.value=d.data[f.column.field][f.column.field+" - truecount"]:m.value=d.data[f.column.field][f.column.field+" - count"]:m.value=d.data[f.column.field][f.column.field+" - min"]:m.value=d.data[f.column.field][f.column.field+" - max"]:m.value=d.data[f.column.field][f.column.field+" - average"]:m.value=d.data[f.column.field][f.column.field+" - sum"]);m.style=this.getCaptionThemeStyle(this.theme),this.aggregateStyle(f.column,m.style,f.column.field);var I=null!=f.attributes.class?f.attributes.class.toString():"";I&&(m.style.hAlign=I.indexOf("e-rightalign")>-1?"right":I.indexOf("e-centeralign")>-1?"center":"left");x={row:d,type:v?"Footer":S?"GroupFooter":"GroupCaption",style:m,cell:f};this.parent.trigger("excelAggregateQueryCellInfo",x),h.push(m)}else if(void 0===o){m.index=c+r+i.childGridLevel,m.style=this.getCaptionThemeStyle(this.theme);var x={row:d,type:t.isNullOrUndefined(f.column.footerTemplate)?t.isNullOrUndefined(f.column.groupFooterTemplate)?"GroupCaption":"GroupFooter":"Footer",style:m,cell:f};this.parent.trigger("excelAggregateQueryCellInfo",x),h.push(m)}}if(t.isNullOrUndefined(o)){var R={};if(!(this.groupedColLength<8&&this.groupedColLength>0)||i.groupSettings.enableLazyLoading&&t.isNullOrUndefined(s[s.length-1].grouping))R={index:this.rowLength++,cells:h};else{var D={outlineLevel:s[s.length-1].grouping.outlineLevel,isCollapsed:!0};R={index:this.rowLength++,cells:h,grouping:D}}p||s.push(R)}else s.push({index:o,cells:h})}return s},n.prototype.aggregateStyle=function(e,i,n){var r=this.parent.getColumnByField(n);if("object"==typeof e.format){var s=e.format;i.numberFormat=t.isNullOrUndefined(s.format)?s.skeleton:s.format,t.isNullOrUndefined(s.type)||(i.type=s.type.toLowerCase())}else i.numberFormat=e.format;!t.isNullOrUndefined(r)&&t.isNullOrUndefined(i.type)&&(i.type=r.type.toLowerCase())},n.prototype.getAggreateValue=function(i,n,r,s,o){var a={};a[t.getEnumValue(e.CellType,s.cellType)]=t.compile(r);var l,d=o.data[s.column.field?s.column.field:s.column.columnName];return(this.parent.isReact||this.parent.isVue||this.parent.isVue3||this.parent.isAngular)&&"string"!=typeof s.column.footerTemplate&&"string"!=typeof s.column.groupFooterTemplate&&"string"!=typeof s.column.groupCaptionTemplate?(l=d[s.column.type],t.isNullOrUndefined(l)?"":l):(l=a[t.getEnumValue(e.CellType,s.cellType)](d,this.parent),this.parent.isVue3&&!t.isNullOrUndefined(l[1])?l[1].textContent:t.isNullOrUndefined(l[0])?"":l[0].textContent)},n.prototype.mergeOptions=function(e,t){for(var i={},n=Object.keys(e),r=0;r<n.length;r++)"name"!==n[parseInt(r.toString(),10)]&&(i[n[parseInt(r.toString(),10)]]=e[n[parseInt(r.toString(),10)]]);n=Object.keys(t);for(r=0;r<n.length;r++)"name"!==n[parseInt(r.toString(),10)]&&(i[n[parseInt(r.toString(),10)]]=t[n[parseInt(r.toString(),10)]]);return i},n.prototype.getColumnStyle=function(e,t){for(var i=0,n=0,r=this.styles;n<r.length;n++){if(r[n].name===e.element.id+"column"+t)return i;i++}},n.prototype.headerRotation=function(e){var t=e.style.rotation;t<=90&&t>=0?e.style.hAlign="Left":t>90&&t<=180?e.style.hAlign="Right":(t=180,e.style.hAlign="Right"),e.style.rotation=t},n.prototype.processHeaderContent=function(i,n,r,s){var o=n.rows,a=n.columns,l=[];if(r>0)for(var d=0;d!==r;)this.columns.push({index:d+1,width:30}),d++;for(var h=0;h<a.length;h++)this.parseStyles(i,a[parseInt(h.toString(),10)],this.getRecordThemeStyle(this.theme),r+h+1);for(var p,c=0;c<o.length;c++){for(var u=1+r,g=[],f=0;f<o[parseInt(c.toString(),10)].cells.length;f++){var m={},y={},v=o[parseInt(c.toString(),10)].cells[parseInt(f.toString(),10)];if(!v.isSpanned&&v.cellType!==e.CellType.HeaderIndent&&v.cellType!==e.CellType.DetailHeader){for(var S={contains:!0,index:1};S.contains;)if(S=this.getIndex(l,1,u),u=S.index,!S.contains){y.index=S.index+i.childGridLevel;break}if(!t.isNullOrUndefined(v.rowSpan)&&1!==v.rowSpan){y.rowSpan=v.rowSpan;for(x=1;x<v.rowSpan+1;x++){var C={rowIndex:0,columnIndex:0,colSpan:0};C.rowIndex=x,C.columnIndex=u,C.colSpan=v.colSpan||1,l.push(C)}}t.isNullOrUndefined(v.colSpan)||1===v.colSpan||(y.colSpan=v.colSpan,u=u+y.colSpan-1),y.value=v.column.headerText,m=this.getHeaderThemeStyle(this.theme),t.isNullOrUndefined(v.column.textAlign)||(m.hAlign=v.column.textAlign.toLowerCase()),t.isNullOrUndefined(v.column.headerTextAlign)||(m.hAlign=v.column.headerTextAlign.toLowerCase());var w={cell:y,gridCell:v,style:m};if(i.trigger("excelHeaderQueryCellInfo",w),v.cellType===e.CellType.Header&&y.colSpan>1){u=u+y.colSpan-1;for(var b=1;b<y.colSpan;b++){var I=f+b;I<o[parseInt(c.toString(),10)].cells.length&&(o[parseInt(c.toString(),10)].cells[parseInt(I.toString(),10)].isSpanned=!0)}for(var x=0;x<l.length;x++)l[parseInt(x.toString(),10)].columnIndex===y.index&&(l[parseInt(x.toString(),10)].colSpan=y.colSpan)}w.style.rotation&&this.headerRotation(w),t.isNullOrUndefined(w.image)||t.isNullOrUndefined(w.image.base64)||(p=this.setImage(w,u)),t.isNullOrUndefined(w.hyperLink)||(w.cell.hyperlink={target:w.hyperLink.target},y.value=w.hyperLink.displayText||y.value),y.style=w.style,g.push(y),u++}}var R={index:this.rowLength++,cells:g};t.isNullOrUndefined(p)||(R.height=p),s.push(R)}return s},n.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},n.prototype.updateThemeStyle=function(e,i){return t.extend(i,e)},n.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},n.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},n.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 n=0;n<i;n++){var r=e.rows[parseInt(n.toString(),10)];(null===r.index||t.isNullOrUndefined(r.index))&&(r.index=n+1),this.updatedCellIndex(r)}}},n.prototype.updatedCellIndex=function(e){for(var i=e.cells.length,n=0;n<i;n++){var r=e.cells[parseInt(n.toString(),10)];(null===r.index||t.isNullOrUndefined(r.index))&&(r.index=n+1)}this.rows.push(e)},n.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 n=0;n<i;n++){var r=e.rows[parseInt(n.toString(),10)];null===r.index||void 0===r.index?r.index=this.rowLength++:r.index+=this.rowLength,this.updatedCellIndex(r)}}},n.prototype.getIndex=function(e,t,i){for(var n=0,r=e;n<r.length;n++){var s=r[n];if(s.rowIndex===t&&s.columnIndex===i)return i+=s.colSpan||1,{contains:!0,index:i}}return{contains:!1,index:i}},n.prototype.parseStyles=function(e,i,n,r){if(!t.isNullOrUndefined(i.format))if("object"==typeof i.format){var s=i.format;n.numberFormat=t.isNullOrUndefined(s.format)?s.skeleton:s.format,t.isNullOrUndefined(s.type)||(n.type="dateonly"===s.type?"date":s.type.toLowerCase())}else n.numberFormat=i.format,n.type="dateonly"===i.type?"date":i.type;t.isNullOrUndefined(i.textAlign)||(n.hAlign=i.textAlign.toLowerCase()),Object.keys(n).length>0&&(n.name=e.element.id+"column"+r,this.styles.push(n)),e.childGridLevel||(t.isNullOrUndefined(i.width)||"auto"===i.width?this.columns.push({index:r+e.childGridLevel,width:null}):this.columns.push({index:r+e.childGridLevel,width:"number"==typeof i.width?i.width:this.helper.getConvertedWidth(i.width)}))},n.prototype.destroy=function(){},n}(),yo=function(){function n(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 go(e),this.gridPool={}}return n.prototype.getModuleName=function(){return"PdfExport"},n.prototype.init=function(e){this.exportValueFormatter=new fo(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=z("main-grid"),this.gridPool[e.id]=!1,this.pdfPageSettings=new h.PdfPageSettings},n.prototype.exportWithData=function(e,i,n,r,s,o,a){var l=this;this.init(e),t.isNullOrUndefined(i)?this.pdfDocument=new h.PdfDocument:this.pdfDocument=i,this.processExport(e,r,s,o).then(function(){l.isExporting=!1,e.trigger("pdfExportComplete",l.isBlob?{promise:l.blobPromise}:{gridInstance:l.parent}),l.parent.log("exporting_complete",l.getModuleName()),n(l.pdfDocument)}).catch(function(e){a(l.pdfDocument),l.parent.trigger(Ht,e)})},n.prototype.Map=function(e,n,r,s,o){var a=this;this.data=new Hi(this.parent),this.isBlob=o,this.gridPool={};var l=n&&n.query?n.query:new i.Query;!e.childGrid&&!e.detailTemplate||!t.isNullOrUndefined(n)&&"None"===n.hierarchyExportMode||(e.expandedRows=ve(e).expandedRows);var d={requestType:"beforePdfExport",cancel:!1,headerPageNumbers:[],gridDrawPosition:{xPosition:0,yPosition:0},generateQuery:!1};d.gridObject=e;if(e.trigger("beforePdfExport",d),!0===d.cancel)return new Promise(function(e,t){return e()});if(y(n)&&v(n,e),d.generateQuery&&(l=go.getQuery(e,this.data)),this.headerOnPages=d.headerPageNumbers,this.drawPosition=d.gridDrawPosition,this.parent.log("exporting_begin",this.getModuleName()),t.isNullOrUndefined(n)||t.isNullOrUndefined(n.dataSource)){if(t.isNullOrUndefined(n)||"CurrentPage"!==n.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()){var p=[],c=go.getQuery(e,this.data);return this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&(t.isNullOrUndefined(n)&&(n={hierarchyExportMode:"All"}),n.hierarchyExportMode="None"===n.hierarchyExportMode?"None":"All","All"===n.hierarchyExportMode&&(c.lazyLoad=[])),p.push(this.data.getData({},c)),p.push(this.helper.getColumnData(e)),new Promise(function(i,o){Promise.all(p).then(function(l){a.init(e),t.isNullOrUndefined(s)?a.pdfDocument=new h.PdfDocument:a.pdfDocument=s.document,a.processExport(e,l[0],n,r,s).then(function(t){a.isExporting=!1,e.trigger("pdfExportComplete",a.isBlob?{promise:a.blobPromise}:{gridInstance:a.parent}),a.parent.log("exporting_complete",a.getModuleName()),i(n&&n.multipleExport&&"AppendToPage"===n.multipleExport.type?t:a.pdfDocument)}).catch(function(e){o(a.pdfDocument),a.parent.trigger(Ht,e)})})})}return new Promise(function(t,i){a.exportWithData(e,s,t,a.parent.getCurrentViewRecords(),n,r,i)})}return n.dataSource=n.dataSource instanceof i.DataManager?n.dataSource:new i.DataManager(n.dataSource),(t.isNullOrUndefined(l.isCountRequired)||e.aggregates)&&(l.isCountRequired=!0),new Promise(function(t,i){n.dataSource.executeQuery(l).then(function(o){a.exportWithData(e,s,t,o,n,r,i)})})},n.prototype.processExport=function(e,i,n,r,s){var o,a=this,l=s&&n&&n.multipleExport&&"AppendToPage"===n.multipleExport.type?null:this.pdfDocument.sections.add();this.processSectionExportProperties(l,n);var d=s&&n&&n.multipleExport&&"AppendToPage"===n.multipleExport.type?s.result.page:l.pages.add();return new Promise(function(t,r){o=a.processGridExport(e,i,n),a.globalResolve=t,a.gridPool[e.id]=!0,a.helper.checkAndExport(a.gridPool,a.globalResolve)}).then(function(){var i,l=a.drawPosition.xPosition;s&&n&&n.multipleExport&&"AppendToPage"===n.multipleExport.type?(i=s.result.bounds.y+s.result.bounds.height,n.multipleExport.blankSpace&&(i=s.result.bounds.y+s.result.bounds.height+n.multipleExport.blankSpace)):i=a.drawPosition.yPosition;var p;if(r){var c=new h.PdfGridLayoutFormat;c.layout=h.PdfLayoutType.Paginate,c.break=h.PdfLayoutBreakType.FitPage,c.paginateBounds=new h.RectangleF(0,0,d.getClientSize().width,d.getClientSize().height),p=o.draw(d,l,i,c)}else p=o.draw(d,l,i);return a.drawHeader(n),r||(a.isBlob?a.blobPromise=a.pdfDocument.save():!t.isNullOrUndefined(n)&&n.fileName?a.pdfDocument.save(n.fileName):a.pdfDocument.save("Export.pdf"),a.pdfDocument.destroy(),delete e.expandedRows),n&&n.multipleExport&&"AppendToPage"===n.multipleExport.type?{document:a.pdfDocument,result:p}:a.pdfDocument})},n.prototype.processSectionExportProperties=function(e,i){return t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||t.isNullOrUndefined(i.pageOrientation)&&t.isNullOrUndefined(i.pageSize)||(this.pdfPageSettings.orientation="Landscape"===i.pageOrientation?h.PdfPageOrientation.Landscape:h.PdfPageOrientation.Portrait,this.pdfPageSettings.size=this.getPageSize(i.pageSize),e.setPageSettings(this.pdfPageSettings)),e},n.prototype.processGridExport=function(e,i,n){var r=!0;t.isNullOrUndefined(n)||(this.gridTheme=n.theme,r=!!t.isNullOrUndefined(n.allowHorizontalOverflow)||n.allowHorizontalOverflow);var s=new go(e,this.helper.getForeignKeyData()),o=this.processExportProperties(n,i.result),a=y(n)?E(n.columns,e.enableColumnVirtualization):s.getGridExportColumns(e.columns);a=a.filter(function(e){return t.isNullOrUndefined(e.commands)});var l=!1;e.groupSettings.columns.length&&(l=!0),!e.childGrid&&!e.detailTemplate||t.isNullOrUndefined(n)||(e.hierarchyPrintMode=n.hierarchyExportMode||"Expanded");var d=new h.PdfGrid,p=this.getHeaderThemeStyle(),c=p.border,u=p.font,g=p.brush,f=s.getHeaders(a,this.hideColumnInclude),m=f.columns;d=this.processGridHeaders(e.groupSettings.columns.length,d,f.rows,m,c,u,g,e,r,a),this.setColumnProperties(m,d,s,e,r);var v=this.getSummaryCaptionThemeStyle();if(!t.isNullOrUndefined(o)&&o.length){if(l?(t.isNullOrUndefined(v.border)||(c=v.border),this.processGroupedRecords(d,o,m,e,c,0,v.font,v.brush,v.backgroundBrush,i,n,s,0)):this.processRecord(c,m,e,o,d,0,n,s,0),!t.isNullOrUndefined(i.aggregates)){var S=new vn(e),C=void 0,w=S.getColumns();w=w.filter(function(e){return t.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),C=this.customDataSource?S.generateRows(o,i.aggregates,null,null,w):this.currentViewData?S.generateRows(this.parent.getCurrentViewRecords(),i.aggregates):l?S.generateRows(o.records,i.aggregates):S.generateRows(i.result,i.aggregates,null,null,w),this.processAggregates(C,d,c,v.font,v.brush,v.backgroundBrush,!1,null,null,null,!l)}}else d.rows.addRow().style.setBorder(c);return d},n.prototype.getSummaryCaptionThemeStyle=function(){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.caption))return{font:new h.PdfStandardFont(h.PdfFontFamily.Helvetica,9.75),brush:new h.PdfSolidBrush(new h.PdfColor(0,0,0)),backgroundBrush:new h.PdfSolidBrush(new h.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)?h.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),n=this.getFontStyle(this.gridTheme.caption),r=new h.PdfColor(0,0,0);if(!t.isNullOrUndefined(this.gridTheme.caption.fontColor)){var s=this.hexToRgb(this.gridTheme.caption.fontColor);r=new h.PdfColor(s.r,s.g,s.b)}var o=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,a=new h.PdfStandardFont(i,e,n);return t.isNullOrUndefined(this.gridTheme.caption.font)||(a=this.gridTheme.caption.font),{font:a,brush:new h.PdfSolidBrush(r),backgroundBrush:new h.PdfSolidBrush(new h.PdfColor(246,246,246)),border:o}},n.prototype.getGridPdfFont=function(e){var i=0;if(e.header&&e.header.font){var n=e.header.font.fontFamily,r=e.header.font.fontSize,s=e.header.font.fontStyle;if(i=t.isNullOrUndefined(h.PdfFontStyle[""+s])?0:h.PdfFontStyle[""+s],e.header.font.isTrueType)e.header.font=new h.PdfTrueTypeFont(n,r,i);else{var o=t.isNullOrUndefined(n)?h.PdfFontFamily.Helvetica:this.getFontFamily(n);e.header.font=new h.PdfStandardFont(o,r,i)}}if(e.caption&&e.caption.font){var a=e.caption.font.fontFamily,l=e.caption.font.fontSize,d=e.caption.font.fontStyle;if(i=t.isNullOrUndefined(h.PdfFontStyle[""+d])?0:h.PdfFontStyle[""+d],e.caption.font.isTrueType)e.caption.font=new h.PdfTrueTypeFont(a,l,i);else{var p=t.isNullOrUndefined(a)?h.PdfFontFamily.Helvetica:this.getFontFamily(a);e.caption.font=new h.PdfStandardFont(p,l,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(h.PdfFontStyle[""+g])?0:h.PdfFontStyle[""+g],e.record.font.isTrueType)e.record.font=new h.PdfTrueTypeFont(c,u,i);else{var f=t.isNullOrUndefined(c)?h.PdfFontFamily.Helvetica:this.getFontFamily(c);e.record.font=new h.PdfStandardFont(f,u,i)}}},n.prototype.getHeaderThemeStyle=function(){var e=new h.PdfBorders;if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.header))return e.all=new h.PdfPen(new h.PdfColor(234,234,234)),{border:e,font:new h.PdfStandardFont(h.PdfFontFamily.Helvetica,10.5),brush:new h.PdfSolidBrush(new h.PdfColor(102,102,102))};var i=t.isNullOrUndefined(this.gridTheme.header.fontName)?h.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),n=this.getFontStyle(this.gridTheme.header),r=t.isNullOrUndefined(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,s=new h.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.header.fontColor)){var o=this.hexToRgb(this.gridTheme.header.fontColor);s=new h.PdfColor(o.r,o.g,o.b)}var a=new h.PdfStandardFont(i,r,n);return t.isNullOrUndefined(this.gridTheme.header.font)||(a=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:a,brush:new h.PdfSolidBrush(s)}},n.prototype.processGroupedRecords=function(e,i,n,r,s,o,a,l,d,p,c,u,g){for(var f=this,m=o,y=this,v=0,S=i;v<S.length;v++)!function(o){var v=e.rows.addRow(),S=r.getColumnByField(o.field),C={value:o.key,column:S,style:void 0,isForeignKey:S.isForeignColumn()},w={captionText:r.getColumnByField(o.field).headerText+": "+(S.enableGroupByFormat?o.key:y.exportValueFormatter.formatCellValue(C))+" - "+o.count+(i.count>1?" items":" item"),type:"PDF",data:o,style:void 0};y.parent.trigger("exportGroupCaption",w,function(y){v.cells.getCell(m).value=y.captionText,v.cells.getCell(m).style.stringFormat=new h.PdfStringFormat(h.PdfTextAlignment.Left),v.style.setBorder(s),v.style.setFont(a),v.style.setTextBrush(l),v.style.setBackgroundBrush(d),t.isNullOrUndefined(y.style)||f.processCellStyle(v.cells.getCell(m),y);var S,C=new Cn(r);if(S=t.isNullOrUndefined(o.items.records)?C.generateRows(o.items,o):C.generateRows(o.items.records,o),t.isNullOrUndefined(S)||0!==S.length||(v.cells.getCell(m+1).columnSpan=e.columns.count-(m+1)),!t.isNullOrUndefined(i.childLevels)&&i.childLevels>0)f.processAggregates(S,e,s,a,l,d,!0,v,m,null,null,r),f.processGroupedRecords(e,o.items,n,r,s,m+1,a,l,d,p,c,u,g),g=f.rowIndex,S=(w=new Sn(r)).generateRows(o.items.records,o),f.processAggregates(S,e,s,a,l,d,!1);else{f.processAggregates(S,e,s,a,l,d,!0,v,m,null,null,r),g=f.processRecord(s,n,r,o.items,e,m+1,c,u,g);var w=new Sn(r);S=w.generateRows(o.items,o);f.processAggregates(S,e,s,a,l,d,!1,null,null,!0,null,r)}})}(S[v])},n.prototype.processGridHeaders=function(i,n,r,s,o,a,l,d,p,c){for(var u=this,g=s.length+i,f=we(c),m=c,y=0,v=[],S=0;S<r.length;S++)v[parseInt(S.toString(),10)]=0;d.groupSettings.columns.length&&(y=d.groupSettings.columns.length-1,g-=1),n.columns.add(g),n.style.cellPadding=new h.PdfPaddings(5.76,5.76,.5,.5),n.headers.add(r.length);var C=function(i,s,p,c,g){var f=n.headers.getHeader(i),m=f.cells.getCell(s),y=r[parseInt(i.toString(),10)].cells[d.groupSettings.columns.length?s:v[parseInt(i.toString(),10)]];v[parseInt(i.toString(),10)]=v[parseInt(i.toString(),10)]+1,t.isNullOrUndefined(p.headerTextAlign)||(m.style.stringFormat=u.getHorizontalAlignment(p.headerTextAlign)),c>0&&(m.rowSpan=c,m.style.stringFormat=u.getVerticalAlignment("Bottom",m.style.stringFormat,p.textAlign)),g>0&&(m.columnSpan=g),f.style.setBorder(o),f.style.setFont(a),f.style.setTextBrush(l),m.value=p.headerText,t.isNullOrUndefined(y)||y.cellType!==e.CellType.HeaderIndent&&y.cellType!==e.CellType.DetailHeader||(m.value="",m.width=20);var S={cell:m,gridCell:y,style:m.style};u.parent.trigger("pdfHeaderQueryCellInfo",S);var C=S,w=S.style.borders,b=S.style.font,I=S.style.textBrush;t.isNullOrUndefined(w)||f.style.setBorder(w),t.isNullOrUndefined(b)||f.style.setFont(b),t.isNullOrUndefined(I)||f.style.setTextBrush(I),t.isNullOrUndefined(C.style.verticalAlignment)||(m.style.stringFormat=u.getVerticalAlignment(C.style.verticalAlignment,m.style.stringFormat)),t.isNullOrUndefined(C.image)||(m.value=new h.PdfBitmap(C.image.base64)),t.isNullOrUndefined(C.hyperLink)||(m.value=u.setHyperLink(C))},w=function(e,t,i,n,r,s){for(var o=0,a=0;a<e.length;a++)if(s&&(n=o=o+i+(0===a?0:-1),i=0),s||e[parseInt(a.toString(),10)].visible||(n-=1),e[parseInt(a.toString(),10)].columns&&e[parseInt(a.toString(),10)].columns.length){var l=w(e[parseInt(a.toString(),10)].columns,t-1,0,a+n,r+1,!1);l>0&&C(r,a+n+y,e[parseInt(a.toString(),10)],0,l),i+=l,n=n+l-1}else(e[parseInt(a.toString(),10)].visible||u.hideColumnInclude)&&(i++,C(r,a+n+y,e[parseInt(a.toString(),10)],t,0));return i};return w(m,f,0,0,0,!0),n.columns.count>=6&&p&&(n.style.allowHorizontalOverflow=!0),n},n.prototype.processExportProperties=function(e,i){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 r=e.footer,s=new h.PointF(0,n.width-80-.75*r.fromBottom),o=new h.SizeF(n.width-80,.75*r.height),a=new h.RectangleF(s,o);this.pdfDocument.template.bottom=this.drawPageTemplate(new h.PdfPageTemplateElement(a),r)}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?(i=this.parent.groupSettings&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?i:this.parent.currentViewData,this.currentViewData=!0,this.customDataSource=!1):(this.currentViewData=!1,this.customDataSource=!1):(this.customDataSource=!0,this.currentViewData=!1)}return i},n.prototype.drawHeader=function(e){var i=this,n=this.pdfPageSettings.size;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.header)){var r=e.header,s=new h.PointF(0,r.fromTop),o=new h.SizeF(n.width-80,.75*r.height),a=new h.RectangleF(s,o);if(this.headerOnPages.length){var l=this.drawPageTemplate(new h.PdfPageTemplateElement(a),r);this.headerOnPages.filter(function(e){e-1>=0&&e-1<=i.pdfDocument.pages.count-1&&i.pdfDocument.pages.getPageByIndex(e-1).graphics.drawPdfTemplate(l.template,new h.PointF(0,0))})}else this.pdfDocument.template.top=this.drawPageTemplate(new h.PdfPageTemplateElement(a),r)}},n.prototype.drawPageTemplate=function(e,t){for(var i=0,n=t.contents;i<n.length;i++){var r=n[i];switch(this.processContentValidation(r),r.type){case"Text":if(""===r.value||void 0===r.value||null===r.value||"string"!=typeof r.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,r);break;case"PageNumber":this.drawPageNumber(e,r);break;case"Image":if(void 0===r.src||null===r.src||""===r.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,r);break;case"Line":this.drawLine(e,r);break;default:throw new Error("Please set valid content type...")}}return e},n.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...")}},n.prototype.drawText=function(e,i){var n=this.getFont(i),r=this.getBrushFromContent(i),s=null;if(!t.isNullOrUndefined(i.style.textPenColor)){var o=this.hexToRgb(i.style.textPenColor);s=new h.PdfPen(new h.PdfColor(o.r,o.g,o.b))}null==r&&null==s&&(r=new h.PdfSolidBrush(new h.PdfColor(0,0,0)));var a=i.value.toString(),l=.75*i.position.x,d=.75*i.position.y,p=new h.PdfStringFormat;t.isNullOrUndefined(i.style.stringFormat)||(p.alignment=i.style.stringFormat.alignment);var c=this.setContentFormat(i,p);null===c||t.isNullOrUndefined(c.format)||t.isNullOrUndefined(c.size)?e.graphics.drawString(a,n,s,r,l,d,p):e.graphics.drawString(a,n,s,r,l,d,c.size.width,c.size.height,c.format)},n.prototype.drawPageNumber=function(e,i){var n=this.getFont(i),r=null;if(t.isNullOrUndefined(i.style.textBrushColor))r=new h.PdfSolidBrush(new h.PdfColor(0,0,0));else{var s=this.hexToRgb(i.style.textBrushColor);r=new h.PdfSolidBrush(new h.PdfColor(s.r,s.g,s.b))}var o=new h.PdfPageNumberField(n,r);o.numberStyle=this.getPageNumberStyle(i.pageNumberType);var a,l;if(t.isNullOrUndefined(i.format))l="{0}",a=new h.PdfCompositeField(n,r,l,o);else{var d="$total";if(-1!==i.format.indexOf(d)&&-1!==i.format.indexOf("$current"))(p=new h.PdfPageCountField(n)).numberStyle=this.getPageNumberStyle(i.pageNumberType),l=i.format.indexOf(d)>i.format.indexOf("$current")?(l=i.format.replace("$current","0")).replace(d,"1"):(l=i.format.replace("$current","1")).replace(d,"0"),a=new h.PdfCompositeField(n,r,l,o,p);else if(-1!==i.format.indexOf("$current")&&-1===i.format.indexOf(d))l=i.format.replace("$current","0"),a=new h.PdfCompositeField(n,r,l,o);else{var p=new h.PdfPageCountField(n);l=i.format.replace(d,"0"),a=new h.PdfCompositeField(n,r,l,p)}}var c=.75*i.position.x,u=.75*i.position.y,g=this.setContentFormat(i,a.stringFormat);null===g||t.isNullOrUndefined(g.format)||t.isNullOrUndefined(g.size)||(a.stringFormat=g.format,a.bounds=new h.RectangleF(c,u,g.size.width,g.size.height)),a.draw(e.graphics,c,u)},n.prototype.drawImage=function(e,i){var n=.75*i.position.x,r=.75*i.position.y,s=t.isNullOrUndefined(i.size)?void 0:.75*i.size.width,o=t.isNullOrUndefined(i.size)?void 0:.75*i.size.height,a=new h.PdfBitmap(i.src);t.isNullOrUndefined(s)?e.graphics.drawImage(a,n,r):e.graphics.drawImage(a,n,r,s,o)},n.prototype.drawLine=function(e,i){var n=.75*i.points.x1,r=.75*i.points.y1,s=.75*i.points.x2,o=.75*i.points.y2,a=this.getPenFromContent(i);t.isNullOrUndefined(i.style)||null===i.style||(t.isNullOrUndefined(i.style.penSize)||null===i.style.penSize||"number"!=typeof i.style.penSize||(a.width=.75*i.style.penSize),a.dashStyle=this.getDashStyle(i.style.dashStyle)),e.graphics.drawLine(a,n,r,s,o)},n.prototype.processAggregates=function(i,n,r,s,o,a,l,d,h,p,c,u){for(var g=0,f=i;g<f.length;g++){var m=f[g],y=-1,v=0,S=!0,C=[],w=c?0:1,b=void 0;t.isNullOrUndefined(d)&&((b=n.rows.addRow()).style.setBorder(r),b.style.setFont(s),b.style.setTextBrush(o),b.style.setBackgroundBrush(a));for(var I=this.parent.allowRowDragAndDrop&&t.isNullOrUndefined(this.parent.rowDropSettings.targetID),x=0;x<n.columns.count+w;x++){var R=m.cells[parseInt(v.toString(),10)];if(R.cellType!==e.CellType.DetailFooterIntent)if(I&&R.cellType===e.CellType.Indent)I=!1,x--,v++;else{if(!this.hideColumnInclude){for(;void 0===R.visible;)R.cellType!==e.CellType.DetailFooterIntent&&(t.isNullOrUndefined(d)?C.push(""):t.isNullOrUndefined(d.cells.getCell(x).value)?C.push(""):(C.push(d.cells.getCell(x).value),S=!1,l||(x+=1)),x+=1,v+=1,R=m.cells[parseInt(v.toString(),10)]);for(;!t.isNullOrUndefined(R.visible)&&!R.visible;)v+=1,R=m.cells[parseInt(v.toString(),10)]}if(R.isDataCell){var D={},T=!t.isNullOrUndefined(R.column.footerTemplate),E=!t.isNullOrUndefined(R.column.groupFooterTemplate),O=!t.isNullOrUndefined(R.column.groupCaptionTemplate);if(T||O||E){D=(M=this.getTemplateFunction(D,x,y,R)).templateFunction,y=M.leastCaptionSummaryIndex;var k=void 0,A=m.data[R.column.field?R.column.field:R.column.columnName];(this.parent.isReact||this.parent.isVue||this.parent.isVue3||this.parent.isAngular)&&"string"!=typeof R.column.footerTemplate&&"string"!=typeof R.column.groupFooterTemplate&&"string"!=typeof R.column.groupCaptionTemplate?(k=A[R.column.type],k=t.isNullOrUndefined(k)?"":k):(k=D[t.getEnumValue(e.CellType,R.cellType)](A,this.parent),k=this.parent.isVue3&&!t.isNullOrUndefined(k[1])?k[1].textContent:t.isNullOrUndefined(k[0])?"":k[0].textContent),S=!1;var F={row:m,type:T?"Footer":E?"GroupFooter":"GroupCaption",style:t.isNullOrUndefined(d)?b.cells:d.cells,cell:R,value:k};this.parent.trigger("pdfAggregateQueryCellInfo",F),C.push(F.value)}else{var M=this.getSummaryWithoutTemplate(m.data[R.column.field]);t.isNullOrUndefined(M)||C.push(M)}}else C.push("");S&&""!==C[parseInt(x.toString(),10)]&&!t.isNullOrUndefined(C[parseInt(x.toString(),10)])&&null!==C[parseInt(x.toString(),10)]&&(S=!1),v+=1}else x--,v++}if(!c)if(l)for(x=u.groupSettings.columns.length;x<C.length-1;x++)C[parseInt(x.toString(),10)]=C[x+1],C[x+1]=C[x+2]?C[x+2]:"";else C.splice(0,1);if(!S)if(l)for(x=0;x<n.columns.count;x++)d.cells.getCell(x).value=C[parseInt(x.toString(),10)].toString(),x===h&&-1!==y&&1!==y?d.cells.getCell(x).columnSpan=y-1-h:x===h&&-1===y&&(d.cells.getCell(x).columnSpan=n.columns.count-h);else for(x=0;x<n.columns.count;x++)b.cells.getCell(x).value=C[parseInt(x.toString(),10)].toString()}},n.prototype.getTemplateFunction=function(i,n,r,s){return t.isNullOrUndefined(s.column.footerTemplate)||s.cellType!==e.CellType.Summary?t.isNullOrUndefined(s.column.groupCaptionTemplate)?i[t.getEnumValue(e.CellType,e.CellType.GroupSummary)]=t.compile(s.column.groupFooterTemplate):(-1===r&&(r=n),i[t.getEnumValue(e.CellType,e.CellType.CaptionSummary)]=t.compile(s.column.groupCaptionTemplate)):i[t.getEnumValue(e.CellType,e.CellType.Summary)]=t.compile(s.column.footerTemplate),{templateFunction:i,leastCaptionSummaryIndex:r}},n.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},n.prototype.setColumnProperties=function(e,i,n,r,s){for(var o=r.groupSettings.columns.length?r.groupSettings.columns.length-1:0,a=0;a<o;a++)i.columns.getColumn(a).width=20;for(a=0;a<e.length;a++)t.isNullOrUndefined(e[parseInt(a.toString(),10)].textAlign)||(i.columns.getColumn(a+o).format=this.getHorizontalAlignment(e[parseInt(a.toString(),10)].textAlign)),i.style.allowHorizontalOverflow&&!t.isNullOrUndefined(e[parseInt(a.toString(),10)].width)&&s&&(i.columns.getColumn(a+o).width="number"==typeof e[parseInt(a.toString(),10)].width?.75*e[parseInt(a.toString(),10)].width:.75*n.getConvertedWidth(e[parseInt(a.toString(),10)].width))},n.prototype.setRecordThemeStyle=function(e,i){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.record))e.style.setTextBrush(new h.PdfSolidBrush(new h.PdfColor(0,0,0)));else{var n=t.isNullOrUndefined(this.gridTheme.record.fontName)?h.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.record.fontName),r=t.isNullOrUndefined(this.gridTheme.record.fontSize)?9.75:this.gridTheme.record.fontSize,s=this.getFontStyle(this.gridTheme.record),o=new h.PdfStandardFont(n,r,s);t.isNullOrUndefined(this.gridTheme.record.font)||(o=this.gridTheme.record.font),e.style.setFont(o);var a=new h.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.record.fontColor)){var l=this.hexToRgb(this.gridTheme.record.fontColor);a=new h.PdfColor(l.r,l.g,l.b)}e.style.setTextBrush(new h.PdfSolidBrush(a))}var d=this.gridTheme&&this.gridTheme.record&&this.gridTheme.record.border?this.getBorderStyle(this.gridTheme.record.border):i;return e.style.setBorder(d),e},n.prototype.processRecord=function(i,n,r,s,o,a,l,d,p){for(var c=0,u=d.getGridRowModel(n,s,r,p);c<u.length;c++){var g=u[c];p++,this.rowIndex=p;for(var f=this.setRecordThemeStyle(o.rows.addRow(),i),m=g.cells.length,y=0;y<m;y++){var v=g.cells[parseInt(y.toString(),10)];if(v.cellType===e.CellType.Data){var S=v.column,C=S.field,w=t.isNullOrUndefined(C)?"":S.valueAccessor(C,g.data,S),b=t.isNullOrUndefined(w)?"":w,I=void 0;if(S.isForeignColumn&&S.isForeignColumn()&&(I=d.getFData(b,S),b=t.getValue(S.foreignKeyValue,I)),(M={data:g.data,value:b,column:S,style:void 0,colSpan:1,cell:T=f.cells.getCell(y)}).value="boolean"===M.column.type&&"string"==typeof M.value?M.value:this.exportValueFormatter.formatCellValue(M),this.parent.trigger("pdfQueryCellInfo",M),t.isNullOrUndefined(M.image)||(M.value=new h.PdfBitmap(M.image.base64),M.value.height=M.image.height||M.value.height,M.value.width=M.image.width||M.value.width),T.value=M.value,t.isNullOrUndefined(M.hyperLink)||(T.value=this.setHyperLink(M)),t.isNullOrUndefined(M.style)||this.processCellStyle(T,M),M.colSpan>1){y+1+M.colSpan>f.cells.count&&(M.colSpan=f.cells.count-(y+1)),T.columnSpan=M.colSpan;for(var x=1;x<T.columnSpan;x++)f.cells.getCell(y+x).value="";y+=M.colSpan-1}}}if(g.isExpand){var R=this.setRecordThemeStyle(o.rows.addRow(),i),D=this.parent.childGrid||this.parent.detailTemplate?0:a,T=R.cells.getCell(D);if(T.columnSpan=R.cells.count-D,T.style.cellPadding=new h.PdfPaddings(10,10,10,10),this.parent.childGrid){r.isPrinting=!0;var E=!t.isNullOrUndefined(l)&&l.exportType?l.exportType:"AllPages",O=this.helper.createChildGrid(r,g,E,this.gridPool),k=O.childGrid,A=O.element;k.actionFailure=d.failureHandler(this.gridPool,k,this.globalResolve);var F=t.extend(l,{columns:null,dataSource:null,query:null}),M={childGrid:k,row:g,cell:T,exportProperties:F};this.parent.trigger("exportDetailDataBound",M),k.beforeDataBound=this.childGridCell(T,k,F),k.appendTo(A)}else if(this.parent.detailTemplate){M={parentRow:g,row:R,value:{},action:"pdfexport",gridInstance:r};this.parent.trigger("exportDetailTemplate",M),T.value=this.processDetailTemplate(M)}}this.parent.notify("export-RowDataBound",{type:"pdf",rowObj:g})}return p},n.prototype.processDetailTemplate=function(e){var i=this;if(e.value.columnHeader||e.value.rows){var n=new h.PdfGrid,r=this.getHeaderThemeStyle(),s=r.border,o=r.font,a=r.brush,l=function(e,n,r){r&&(n.style.setBorder(s),n.style.setFont(o),n.style.setTextBrush(a));for(var l=0;l<e.cells.length;l++){var d=e.cells[parseInt(l.toString(),10)],p=n.cells.getCell(d.index?d.index:l);if(d.rowSpan>0&&(p.rowSpan=d.rowSpan),d.colSpan>0&&(p.columnSpan=d.colSpan),p.value=d.value,t.isNullOrUndefined(d.image)||(p.value=new h.PdfBitmap(d.image.base64),p.value.height=d.image.height,p.value.width=d.image.width),t.isNullOrUndefined(d.hyperLink)||(p.value=i.setHyperLink(d)),!t.isNullOrUndefined(d.style)){var c={style:{backgroundColor:d.style.backColor,textAlignment:d.style.pdfTextAlignment,verticalAlignment:d.style.pdfVerticalAlignment,textBrushColor:d.style.fontColor,textPenColor:d.style.pdfTextPenColor,fontFamily:d.style.pdfFontFamily,fontSize:d.style.fontSize,bold:d.style.bold,italic:d.style.italic,underline:d.style.underline,strikeout:d.style.strikeThrough,border:d.style.pdfBorder,paragraphIndent:d.style.pdfParagraphIndent,cellPadding:d.style.pdfCellPadding}};i.processCellStyle(p,c)}}};if(e.value.columnCount?n.columns.add(e.value.columnCount):e.value.columnHeader&&e.value.columnHeader.length?n.columns.add(e.value.columnHeader[0].cells.length):e.value.rows&&e.value.rows.length&&n.columns.add(e.value.rows[0].cells.length),e.value.columnHeader){n.headers.add(e.value.columnHeader.length);for(var d=0;d<e.value.columnHeader.length;d++){var p=n.headers.getHeader(parseInt(d.toString(),10));l(e.value.columnHeader[parseInt(d.toString(),10)],p,!0)}}if(e.value.rows)for(var c=0,u=e.value.rows;c<u.length;c++)l(u[c],this.setRecordThemeStyle(n.rows.addRow(),s),!1);return n}return e.value.image?new h.PdfBitmap(e.value.image.base64):e.value.text?e.value.text:e.value.hyperLink?this.setHyperLink(e.value):""},n.prototype.setHyperLink=function(e){var t=new h.PdfTextWebLink;return t.url=e.hyperLink.target,t.text=e.hyperLink.displayText||e.hyperLink.target,t.font=new h.PdfStandardFont(h.PdfFontFamily.Helvetica,9.75),t.brush=new h.PdfSolidBrush(new h.PdfColor(51,102,187)),t},n.prototype.childGridCell=function(e,i,n){var r=this;return function(s){return i.beforeDataBound=null,s.cancel=!0,e.value=r.processGridExport(i,s,n),i.destroy(),t.detach(i.element),r.gridPool[i.id]=!0,r.helper.checkAndExport(r.gridPool,r.globalResolve),e}},n.prototype.processCellStyle=function(e,i){if(!t.isNullOrUndefined(i.style.backgroundColor)){var n=this.hexToRgb(i.style.backgroundColor);e.style.backgroundBrush=new h.PdfSolidBrush(new h.PdfColor(n.r,n.g,n.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 r=this.hexToRgb(i.style.textBrushColor);e.style.textBrush=new h.PdfSolidBrush(new h.PdfColor(r.r,r.g,r.b))}if(!t.isNullOrUndefined(i.style.textPenColor)){var s=this.hexToRgb(i.style.textPenColor);e.style.textPen=new h.PdfPen(new h.PdfColor(s.r,s.g,s.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 o=new h.PdfBorders,a=i.style.border.width,l=t.isNullOrUndefined(a)||"number"!=typeof a?void 0:.75*a,d=new h.PdfColor(196,196,196);if(!t.isNullOrUndefined(i.style.border.color)){var p=this.hexToRgb(i.style.border.color);d=new h.PdfColor(p.r,p.g,p.b)}var c=new h.PdfPen(d,l);t.isNullOrUndefined(i.style.border.dashStyle)||(c.dashStyle=this.getDashStyle(i.style.border.dashStyle)),o.all=c,e.style.borders=o}t.isNullOrUndefined(i.style.paragraphIndent)||(e.style.stringFormat=new h.PdfStringFormat,e.style.stringFormat.paragraphIndent=i.style.paragraphIndent)},n.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new h.PdfStringFormat),e){case"Right":t.alignment=h.PdfTextAlignment.Right;break;case"Center":t.alignment=h.PdfTextAlignment.Center;break;case"Justify":t.alignment=h.PdfTextAlignment.Justify;break;case"Left":t.alignment=h.PdfTextAlignment.Left}return t},n.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new h.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=h.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=h.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=h.PdfVerticalAlignment.Top}return t},n.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}},n.prototype.getFont=function(e){if(e.font)return e.font;var i=t.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,n=t.isNullOrUndefined(e.style.fontFamily)?h.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),r=h.PdfFontStyle.Regular;return!t.isNullOrUndefined(e.style.bold)&&e.style.bold&&(r|=h.PdfFontStyle.Bold),!t.isNullOrUndefined(e.style.italic)&&e.style.italic&&(r|=h.PdfFontStyle.Italic),!t.isNullOrUndefined(e.style.underline)&&e.style.underline&&(r|=h.PdfFontStyle.Underline),!t.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(r|=h.PdfFontStyle.Strikeout),new h.PdfStandardFont(n,i,r)},n.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}},n.prototype.setContentFormat=function(e,i){if(!t.isNullOrUndefined(e.size)){var n=.75*e.size.width,r=.75*e.size.height;if(i=new h.PdfStringFormat(h.PdfTextAlignment.Left,h.PdfVerticalAlignment.Middle),!t.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":i.alignment=h.PdfTextAlignment.Right;break;case"Center":i.alignment=h.PdfTextAlignment.Center;break;case"Justify":i.alignment=h.PdfTextAlignment.Justify;break;default:i.alignment=h.PdfTextAlignment.Left}return t.isNullOrUndefined(e.style.vAlign)||(i=this.getVerticalAlignment(e.style.vAlign,i)),{format:i,size:new h.SizeF(n,r)}}return null},n.prototype.getPageSize=function(e){switch(e){case"Letter":return new h.SizeF(612,792);case"Note":return new h.SizeF(540,720);case"Legal":return new h.SizeF(612,1008);case"A0":return new h.SizeF(2380,3368);case"A1":return new h.SizeF(1684,2380);case"A2":return new h.SizeF(1190,1684);case"A3":return new h.SizeF(842,1190);case"A5":return new h.SizeF(421,595);case"A6":return new h.SizeF(297,421);case"A7":return new h.SizeF(210,297);case"A8":return new h.SizeF(148,210);case"A9":return new h.SizeF(105,148);case"B0":return new h.SizeF(2836,4008);case"B1":return new h.SizeF(2004,2836);case"B2":return new h.SizeF(1418,2004);case"B3":return new h.SizeF(1002,1418);case"B4":return new h.SizeF(709,1002);case"B5":return new h.SizeF(501,709);case"Archa":return new h.SizeF(648,864);case"Archb":return new h.SizeF(864,1296);case"Archc":return new h.SizeF(1296,1728);case"Archd":return new h.SizeF(1728,2592);case"Arche":return new h.SizeF(2592,3456);case"Flsa":return new h.SizeF(612,936);case"HalfLetter":return new h.SizeF(396,612);case"Letter11x17":return new h.SizeF(792,1224);case"Ledger":return new h.SizeF(1224,792);default:return new h.SizeF(595,842)}},n.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}},n.prototype.getPenFromContent=function(e){var i=new h.PdfPen(new h.PdfColor(0,0,0));if(!t.isNullOrUndefined(e.style)&&null!==e.style&&!t.isNullOrUndefined(e.style.penColor)){var n=this.hexToRgb(e.style.penColor);i=new h.PdfPen(new h.PdfColor(n.r,n.g,n.b))}return i},n.prototype.getBrushFromContent=function(e){var i=null;if(!t.isNullOrUndefined(e.style.textBrushColor)){var n=this.hexToRgb(e.style.textBrushColor);i=new h.PdfSolidBrush(new h.PdfColor(n.r,n.g,n.b))}return i},n.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}},n.prototype.getFontStyle=function(e){var i=h.PdfFontStyle.Regular;return!t.isNullOrUndefined(e)&&e.bold&&(i|=h.PdfFontStyle.Bold),!t.isNullOrUndefined(e)&&e.italic&&(i|=h.PdfFontStyle.Italic),!t.isNullOrUndefined(e)&&e.underline&&(i|=h.PdfFontStyle.Underline),!t.isNullOrUndefined(e)&&e.strikeout&&(i|=h.PdfFontStyle.Strikeout),i},n.prototype.getBorderStyle=function(e){var i=new h.PdfBorders;if(t.isNullOrUndefined(e))i.all=new h.PdfPen(new h.PdfColor(234,234,234));else{var n=e.width,r=t.isNullOrUndefined(n)||"number"!=typeof n?void 0:.75*n,s=new h.PdfColor(196,196,196);if(!t.isNullOrUndefined(e.color)){var o=this.hexToRgb(e.color);s=new h.PdfColor(o.r,o.g,o.b)}var a=new h.PdfPen(s,r);t.isNullOrUndefined(e.dashStyle)||(a.dashStyle=this.getDashStyle(e.dashStyle)),i.all=a}return i},n.prototype.destroy=function(){},n}(),vo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),So=function(e){function i(t,i){var n=e.call(this,t,i)||this;return n.buttonElement=n.parent.createElement("button",{}),n.unbounDiv=n.parent.createElement("div",{className:"e-unboundcelldiv"}),n.childRefs=[],n.element=n.parent.createElement("TD",{className:"e-rowcell e-unboundcell",attrs:{tabindex:"-1",role:"gridcell"}}),n.parent.on(pi,n.destroyButtons,n),n.parent.on(Ni,n.destroyButtons,n),n}return vo(i,e),i.prototype.destroyButtons=function(e){for(i=0;i<this.childRefs.length;i++)!this.childRefs[parseInt(i.toString(),10)]||this.childRefs[parseInt(i.toString(),10)].isDestroyed||this.parent.editSettings.showAddNewRow&&this.parent.enableVirtualization&&F(this.childRefs[parseInt(i.toString(),10)].element,"e-addedrow")||(this.childRefs[parseInt(i.toString(),10)].destroy(),this.childRefs[parseInt(i.toString(),10)].element&&(this.childRefs[parseInt(i.toString(),10)].element.innerHTML=""));if(this.childRefs=[],"refreshCommandColumn"===e.type){var t=this.parent.element.querySelectorAll(".e-gridcontent .e-unboundcell");if(t.length){for(var i=0;i<t.length;i++)!t[parseInt(i.toString(),10)]||this.parent.editSettings.showAddNewRow&&this.parent.enableVirtualization&&F(t[parseInt(i.toString(),10)],"e-addedrow")||(t[parseInt(i.toString(),10)].querySelector(".e-unboundcelldiv")&&(t[parseInt(i.toString(),10)].querySelector(".e-unboundcelldiv").innerHTML=""),t[parseInt(i.toString(),10)].innerHTML="");t=null}}else this.parent.off(pi,this.destroyButtons),this.parent.off(Ni,this.destroyButtons)},i.prototype.render=function(e,i,n,r){var s=this.element.cloneNode();if(s.appendChild(this.unbounDiv.cloneNode()),s.setAttribute("aria-label",this.localizer.getConstant("CommandColumnAria")+e.column.headerText),e.column.commandsTemplate)if(!this.parent.isReact||"string"==typeof e.column.commandsTemplate||e.column.commandsTemplate.prototype&&e.column.commandsTemplate.prototype.CSPTemplate)q(s.firstElementChild,e.column.getColumnTemplate()(i,this.parent,"commandsTemplate",null,null,null,null,this.parent.root));else{var o=this.parent+"commandsTemplate";e.column.getColumnTemplate()(i,this.parent,"commandsTemplate",o,null,null,s.firstElementChild),this.parent.renderTemplates()}else for(var a=0,l=e.commands;a<l.length;a++){var d=l[a];s=this.renderButton(s,d,n["data-index"],d.uid)}return this.setAttributes(s,e,n),!this.parent.enableVirtualization&&this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!this.parent.element.querySelector(".e-editedrow"))||r&&this.parent.enableVirtualization?(t.addClass([].slice.call(s.getElementsByClassName("e-edit-delete")),"e-hide"),t.removeClass([].slice.call(s.getElementsByClassName("e-save-cancel")),"e-hide")):(t.addClass([].slice.call(s.getElementsByClassName("e-save-cancel")),"e-hide"),t.removeClass([].slice.call(s.getElementsByClassName("e-edit-delete")),"e-hide")),this.parent.isFrozenGrid()&&$e(this.parent,e.column,s),s},i.prototype.renderButton=function(e,i,n,s){var o=this.buttonElement.cloneNode();t.attributes(o,{id:this.parent.element.id+(i.type||"")+"_"+n+"_"+s,type:"button",title:t.isNullOrUndefined(i.title)?i.buttonOption.content||this.localizer.getConstant(i.type)||i.type:i.title,"data-uid":s}),o.onclick=i.buttonOption.click,i.buttonOption.cssClass=this.parent.cssClass?i.buttonOption.cssClass+" "+this.parent.cssClass:i.buttonOption.cssClass;var a=new r.Button(i.buttonOption,o);switch(this.childRefs.push(a),a.commandType=i.type,e.firstElementChild.appendChild(a.element),i.type){case"Edit":case"Delete":t.addClass([o],["e-edit-delete","e-"+i.type.toLowerCase()+"button"]);break;case"Cancel":case"Save":t.addClass([o],["e-save-cancel","e-"+i.type.toLowerCase()+"button"])}return e},i}(Rn),Co=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 So(this.parent,this.locator))},i.prototype.commandClickHandler=function(e){var i=this.parent,n=t.closest(e.target,"button");if(n&&t.closest(e.target,".e-unboundcell")){for(var r,s=n.ej2_instances[0],o=s.commandType,a=n.getAttribute("data-uid"),l=i.getRowObjectFromUID(t.closest(n,"."+Zi).getAttribute("data-uid")),d=this.parent.columnModel,h=0;h<d.length;h++)if(d[parseInt(h.toString(),10)].commands)for(var p=d[parseInt(h.toString(),10)].commands,c=0;c<p.length;c++){if(p[parseInt(c.toString(),10)].uid===a&&p[parseInt(c.toString(),10)].type===o)r=p[parseInt(c.toString(),10)];else{var u=[].slice.call(t.closest(n,".e-unboundcell").querySelectorAll("button")).findIndex(function(e){return e===n});u<p.length&&p[parseInt(u.toString(),10)].type===o&&String(p[parseInt(c.toString(),10)].uid)===a&&(r=p[parseInt(u.toString(),10)])}}var g={cancel:!1,target:n,commandColumn:r,rowData:t.isNullOrUndefined(l)?void 0:l.data};this.parent.trigger("commandClick",g,function(e){if(!s.disabled&&i.editModule&&!e.cancel)switch(o){case"Edit":i.editModule.endEdit(),i.editModule.startEdit(t.closest(n,"tr"));break;case"Cancel":i.isFocusFirstCell=!0,i.editModule.closeEdit();break;case"Save":i.isFocusFirstCell=!0,i.editModule.endEdit();break;case"Delete":"Batch"!==i.editSettings.mode&&i.editModule.endEdit(),i.commandDelIndex=parseInt(t.closest(n,"tr").getAttribute(an),10)-1,i.clearSelection(),i.selectRow(i.commandDelIndex,!1),i.isFocusFirstCell=!0,i.editModule.deleteRecord(),i.editSettings.showDeleteConfirmDialog&&!i.allowSelection||(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(hi,this.commandClickHandler),this.parent.off(di,this.keyPressHandler),this.parent.off(Jt,this.load),this.parent.off(pi,this.destroy))},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(hi,this.commandClickHandler,this),this.parent.on(di,this.keyPressHandler,this),this.parent.on(Jt,this.load,this),this.parent.on(pi,this.destroy,this))},i.prototype.keyPressHandler=function(e){"enter"!==e.action&&"space"!==e.action||!t.closest(e.target,".e-unboundcelldiv")||(this.commandClickHandler(e),e.preventDefault())},i.prototype.load=function(){for(var e=this.parent.columnModel,t=0;t<e.length;t++)if(e[parseInt(t.toString(),10)].commands)for(var i=e[parseInt(t.toString(),10)].commands,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].uid=z("gridcommand")},i}(),wo={header:"."+Ki,content:"."+Wi,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",autofit:"e-icon-autofit",autofitall:"e-icon-autofitall",chart:"e-grid-chart-icon",barChart:"e-grid-bar-chart-icon",bar:"e-grid-bar-icon",stackingBar:"e-grid-stacking-bar-icon",stackingBar100:"e-grid-stacking-bar-100-icon",pie:"e-grid-pie-icon",columnChart:"e-grid-column-chart-icon",column:"e-grid-column-icon",stackingColumn:"e-grid-stacking-column-icon",stackingColumn100:"e-grid-stacking-column-100-icon",lineChart:"e-grid-line-chart-icon",line:"e-grid-line-icon",stackingLine:"e-grid-stacking-line-icon",stackingLine100:"e-grid-stacking-line-100-icon",areaChart:"e-grid-area-chart-icon",area:"e-grid-area-icon",stackingArea:"e-grid-stacking-area-icon",stackingArea100:"e-grid-stacking-area-100-icon",scatter:"e-grid-scatter-icon",pin:"e-grid-icon-pin",unpin:"e-grid-icon-unpin"},bo=function(){function e(e,t){this.defaultItems={},this.disableItems=[],this.hiddenItems=[],this.barChartList=["Bar","StackingBar","StackingBar100"],this.pieChartList=["Pie"],this.columnChartList=["Column","StackingColumn","StackingColumn100"],this.lineChartList=["Line","StackingLine","StackingLine100"],this.areaChartList=["Area","StackingArea","StackingArea100"],this.scatterChartList=["Scatter"],this.chartList=this.barChartList.concat(this.pieChartList,this.columnChartList,this.lineChartList,this.areaChartList,this.scatterChartList),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(ei,this.enableAfterRenderMenu,this),this.parent.on(Yt,this.render,this),this.parent.on(pi,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Yt,this.render),this.parent.off(ei,this.enableAfterRenderMenu),this.parent.off(pi,this.destroy),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 l.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),beforeClose:this.contextMenuBeforeClose.bind(this),cssClass:this.parent.cssClass?"e-grid-menu "+this.parent.cssClass:"e-grid-menu"}),this.contextMenu.isAngular=Ge(this.parent),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=[],n=[],r=[],s=[],o=[],a=[],l=[],d=0,h=this.parent.contextMenuItems;d<h.length;d++){var p=h[d];"string"==typeof p&&-1!==this.getDefaultItems().indexOf(p)?-1!==this.barChartList.indexOf(p)?s.push(this.buildDefaultItems(p)):-1!==this.pieChartList.indexOf(p)?e=this.buildDefaultItems(p):-1!==this.columnChartList.indexOf(p)?o.push(this.buildDefaultItems(p)):-1!==this.lineChartList.indexOf(p)?a.push(this.buildDefaultItems(p)):-1!==this.areaChartList.indexOf(p)?l.push(this.buildDefaultItems(p)):-1!==this.scatterChartList.indexOf(p)?t=this.buildDefaultItems(p):-1!==p.toLocaleLowerCase().indexOf("export")?n.push(this.buildDefaultItems(p)):i.push(this.buildDefaultItems(p)):"string"!=typeof p&&i.push(p)}if(a.length>0){var c=this.buildDefaultItems("LineChart");c.items=a,r.push(c)}if(l.length>0){var u=this.buildDefaultItems("AreaChart");u.items=l,r.push(u)}if(o.length>0){var g=this.buildDefaultItems("ColumnChart");g.items=o,r.push(g)}if(s.length>0){var f=this.buildDefaultItems("BarChart");f.items=s,r.push(f)}if(t&&r.push(t),e&&r.push(e),r.length>0){var m=this.buildDefaultItems("Chart");m.items=r,i.push(m)}if(n.length>0){var y=this.buildDefaultItems("export");y.items=n,i.push(y)}return i},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){var t=this.getKeyFromId(e.item.id);switch(t){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(on),10)-1)&&this.parent.editModule.editCell(parseInt(this.row.getAttribute(an),10)-1,this.parent.getColumns()[parseInt(this.cell.getAttribute(on),10)-1].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.isCheckBoxSelection||(this.parent.isFocusFirstCell=!0),this.parent.editModule.deleteRow(this.row)):this.parent.deleteRecord());break;case"Save":this.parent.editModule&&(this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode&&(this.parent.isFocusFirstCell=!0),this.parent.editModule.endEdit());break;case"Cancel":this.parent.editModule&&(this.parent.isEdit&&(this.parent.isFocusFirstCell=!0),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);break;case"Bar":case"StackingBar":case"StackingBar100":case"Pie":case"Column":case"StackingColumn":case"StackingColumn100":case"Line":case"StackingLine":case"StackingLine100":case"Area":case"StackingArea":case"StackingArea100":case"Scatter":e.records=this.parent.getSelectedRecords(),e.gridInstance=this.parent,e.chartType=t;break;case"PinRow":this.parent.pinRows([this.targetRowdata.rowData]);break;case"UnpinRow":this.parent.unpinRows([this.targetRowdata.rowData])}e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger("contextMenuClick",e)},e.prototype.contextMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof l.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,"."+wo.groupHeader)||t.closest(e.event.target,"."+wo.touchPop)||t.closest(e.event.target,".e-summarycell")||t.closest(e.event.target,".e-groupcaption")||t.closest(e.event.target,".e-filterbarcell"))||this.parent.editSettings.showAddNewRow&&t.closest(e.event.target,".e-addedrow")&&this.parent.element.querySelector(".e-editedrow"))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),F(e.event.target,"e-grid")&&(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 n=[],r=[],s=0,o=e.items;s<o.length;s++){var a=o[s],l=this.getKeyFromId(a.id),d=this.defaultItems[""+l];if(-1!==this.getDefaultItems().indexOf(l))if(this.ensureDisabledStatus(l)&&this.disableItems.push(a.text),e.event&&(this.ensureTarget(e.event.target,wo.edit)||this.ensureTarget(e.event.target,wo.batchEdit)))"Save"!==l&&"Cancel"!==l&&this.hiddenItems.push(a.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"===l||"Cancel"===l))continue;t.isNullOrUndefined(e.parentItem)&&e.event&&!t.isNullOrUndefined(d)&&!this.ensureTarget(e.event.target,d.target)&&this.hiddenItems.push(a.text)}else a.target&&e.event&&!this.ensureTarget(e.event.target,a.target)?a.separator?n.push(a.id):this.hiddenItems.push(a.text):this.ensureTarget(e.event.target,a.target)&&a.separator&&r.push(a.id);"PinRow"===l&&!t.isNullOrUndefined(this.targetRowdata.row)&&this.targetRowdata.row.classList.contains("e-grid-pin-row")?this.hiddenItems.push(a.text):"UnpinRow"!==l||t.isNullOrUndefined(this.targetRowdata.row)||this.targetRowdata.row.classList.contains("e-grid-pin-row")||this.hiddenItems.push(a.text)}r.length>0&&this.contextMenu.showItems(r,!0),this.contextMenu.enableItems(this.disableItems,!1),this.contextMenu.hideItems(this.hiddenItems),n.length>0&&this.contextMenu.hideItems(n,!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)}Re(this.parent.element,this.contextMenu.element.parentElement)},e.prototype.contextMenuBeforeClose=function(e){e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger("contextMenuClose",e)},e.prototype.ensureTarget=function(e,i){var n=e;return(n=!this.ensureFrozenHeader(e)||i!==wo.header&&i!==wo.content?i===wo.content||i===wo.header?F(t.closest(e,"."+Ji),i.substr(1,i.length)):t.closest(e,i):t.closest(e,i===wo.header?"thead":ln))&&F(n,"e-grid")===this.parent.element},e.prototype.ensureFrozenHeader=function(e){return!(!this.parent.frozenRows&&!this.parent.pinnedTopRecords.length||!t.closest(e,wo.header))},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"AutoFitAll":case"AutoFit":t=!(this.parent.ensureModuleInjected(Rs)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(Es)&&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(Es)||this.parent.ensureModuleInjected(Es)&&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.getSelectedRowCellIndexes().length||0===this.parent.getCurrentViewRecords().length)&&(t=!0);break;case"export":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(mo)||this.parent.allowPdfExport&&this.parent.ensureModuleInjected(yo)||(t=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected(yo)||(t=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(mo)||(t=!0);break;case"SortAscending":case"SortDescending":if(!this.parent.allowSorting||!this.parent.ensureModuleInjected(is)||this.targetColumn&&!this.targetColumn.field)t=!0;else if(this.parent.ensureModuleInjected(is)&&this.parent.sortSettings.columns.length>0&&this.targetColumn)for(var i=this.parent.sortSettings.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].field===this.targetColumn.field&&i[parseInt(n.toString(),10)].direction.toLowerCase()===e.toLowerCase().replace("sort","").toLocaleLowerCase()&&(t=!0);break;case"FirstPage":case"PrevPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected(hs)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected(hs)&&1===this.parent.pageSettings.currentPage)&&(t=!0);break;case"LastPage":case"NextPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected(hs)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected(hs)&&this.parent.pageSettings.currentPage===this.getLastPage())&&(t=!0);break;case"Chart":t=!this.parent.getSelectedRecords().length}return t},e.prototype.getContextMenu=function(){return this.element},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Ki)||e.querySelector("."+Wi))&&(this.contextMenu&&(this.contextMenu.select=null,this.contextMenu.beforeOpen=null,this.contextMenu.onOpen=null,this.contextMenu.onClose=null),this.removeEventListener(),this.contextMenu.destroy(),this.element.parentNode&&t.remove(this.element),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":t={target:wo.header,iconCss:wo.autofitall};break;case"AutoFit":t={target:wo.header,iconCss:wo.autofit};break;case"Group":t={target:wo.header,iconCss:wo.group};break;case"Ungroup":t={target:wo.header,iconCss:wo.ungroup};break;case"Edit":t={target:wo.content,iconCss:wo.editIcon};break;case"Delete":t={target:wo.content,iconCss:wo.delete};break;case"Save":t={target:wo.edit,iconCss:wo.save};break;case"Cancel":t={target:wo.edit,iconCss:wo.cancel};break;case"Copy":t={target:wo.content,iconCss:wo.copy};break;case"export":t={target:wo.content};break;case"PdfExport":t={target:wo.content,iconCss:wo.pdf};break;case"ExcelExport":t={target:wo.content,iconCss:wo.excel};break;case"CsvExport":t={target:wo.content,iconCss:wo.csv};break;case"SortAscending":t={target:wo.header,iconCss:wo.ascending};break;case"SortDescending":t={target:wo.header,iconCss:wo.descending};break;case"FirstPage":t={target:wo.pager,iconCss:wo.fPage};break;case"PrevPage":t={target:wo.pager,iconCss:wo.pPage};break;case"LastPage":t={target:wo.pager,iconCss:wo.lPage};break;case"NextPage":t={target:wo.pager,iconCss:wo.nPage};break;case"Chart":t={target:wo.content,iconCss:wo.chart};break;case"BarChart":t={target:wo.content,iconCss:wo.barChart};break;case"Bar":t={target:wo.content,iconCss:wo.bar};break;case"StackingBar":t={target:wo.content,iconCss:wo.stackingBar};break;case"StackingBar100":t={target:wo.content,iconCss:wo.stackingBar100};break;case"Pie":t={target:wo.content,iconCss:wo.pie};break;case"ColumnChart":t={target:wo.content,iconCss:wo.columnChart};break;case"Column":t={target:wo.content,iconCss:wo.column};break;case"StackingColumn":t={target:wo.content,iconCss:wo.stackingColumn};break;case"StackingColumn100":t={target:wo.content,iconCss:wo.stackingColumn100};break;case"LineChart":t={target:wo.content,iconCss:wo.lineChart};break;case"Line":t={target:wo.content,iconCss:wo.line};break;case"StackingLine":t={target:wo.content,iconCss:wo.stackingLine};break;case"StackingLine100":t={target:wo.content,iconCss:wo.stackingLine100};break;case"AreaChart":t={target:wo.content,iconCss:wo.areaChart};break;case"Area":t={target:wo.content,iconCss:wo.area};break;case"StackingArea":t={target:wo.content,iconCss:wo.stackingArea};break;case"StackingArea100":t={target:wo.content,iconCss:wo.stackingArea100};break;case"Scatter":t={target:wo.content,iconCss:wo.scatter};break;case"PinRow":t={target:".e-rowcell",iconCss:wo.pin};break;case"UnpinRow":t={target:".e-rowcell",iconCss:wo.unpin}}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","Chart","BarChart","ColumnChart","LineChart","AreaChart","PinRow","UnpinRow"].concat(this.chartList)},e.prototype.setLocaleKey=function(){return{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",Chart:"Chart",BarChart:"BarChart",Bar:"Bar",StackingBar:"StackingBar",StackingBar100:"StackingBar100",Pie:"Pie",ColumnChart:"ColumnChart",Column:"Column",StackingColumn:"StackingColumn",StackingColumn100:"StackingColumn100",LineChart:"LineChart",Line:"Line",StackingLine:"StackingLine",StackingLine100:"StackingLine100",AreaChart:"AreaChart",Area:"Area",StackingArea:"StackingArea",StackingArea100:"StackingArea100",Scatter:"Scatter",PinRow:"PinRow",UnpinRow:"UnpinRow"}},e.prototype.getColumn=function(e){var i=t.closest(e.target,"th.e-headercell");if(i){var n=i.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("data-mappinguid");return this.parent.getColumnByUid(n)}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&&!F(e.target,"e-gridpager")&&this.parent.selectRow(parseInt(this.row.getAttribute(an),10)-1)},e}(),Io=function(){function e(e,t){this.parent=e,this.locator=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"freeze"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Yt,this.instantiateRenderer,this),this.parent.on(pi,this.destroy,this))},e.prototype.instantiateRenderer=function(){this.parent.log("limitation",this.getModuleName())},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Yt,this.instantiateRenderer),this.parent.off(pi,this.destroy))},e.prototype.destroy=function(){this.removeEventListener()},e}(),xo=function(){function i(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.COL_POP="e-colmenu-popup",this.CHOOSER="_chooser_",this.AUTOFIT="e-icon-autofit",this.AUTOFITALL="e-icon-autofitall",this.COLUMNCHOOSER="e-icon-columnchooser",this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener(),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}return i.prototype.wireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),i=0;i<e.length;i++)t.EventHandler.add(e[parseInt(i.toString(),10)],"mousedown",this.columnMenuHandlerDown,this)},i.prototype.unwireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),i=0;i<e.length;i++)t.EventHandler.remove(e[parseInt(i.toString(),10)],"mousedown",this.columnMenuHandlerDown)},i.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,e.ResponsiveDialogAction.isColMenu)},i.prototype.destroy=function(){var e=this.parent.element;(e.querySelector("."+Wi)||e.querySelector("."+Ki))&&e&&(this.columnMenu&&this.columnMenu.destroy(),this.removeEventListener(),this.unwireFilterEvents(),this.unwireEvents(),!this.parent.enableAdaptiveUI&&this.element.parentNode&&t.remove(this.element))},i.prototype.columnMenuHandlerClick=function(e){if(e.target.classList.contains("e-columnmenu"))if(this.parent.enableAdaptiveUI){this.headerCell=this.getHeaderCell(e);var t=this.getColumn();this.responsiveDialogRenderer.isCustomDialog=!0,this.parent.notify(Bi,{action:4}),this.parent.notify("filterOpen",{col:t,target:e.target,isClose:null,id:null}),this.responsiveDialogRenderer.showResponsiveDialog(null,t)}else 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)},i.prototype.openColumnMenuByField=function(e){this.openColumnMenu({target:this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu")})},i.prototype.afterFilterColumnMenuClose=function(){this.columnMenu&&(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.columnMenu.close())},i.prototype.openColumnMenu=function(e){var t=this.parent.getContent().getClientRects()[0],i=this.parent.getHeaderContent(),r=i.getBoundingClientRect(),s={top:0,left:0};this.element.style.cssText="display:block;visibility:hidden";var o=this.element.getBoundingClientRect(),a=this.parent.element.getBoundingClientRect();this.element.style.cssText="display:none;visibility:visible",this.headerCell=this.getHeaderCell(e),this.parent.enableRtl?s=this.parent.enableStickyHeader?n.calculatePosition(this.headerCell,"left","bottom",!0):n.calculatePosition(this.headerCell,"left","bottom"):((s=this.parent.enableStickyHeader?n.calculatePosition(this.headerCell,"right","bottom",!0):n.calculatePosition(this.headerCell,"right","bottom")).left-=o.width,i.classList.contains("e-sticky")?(s.top=this.parent.element.offsetTop+r.top+r.height,r.top+r.height>t.top&&(s.top+=r.top+r.height-t.top)):this.parent.enableStickyHeader&&(s.top=this.parent.element.offsetTop+i.offsetTop+r.height),s.left+o.width+1>=a.right&&(s.left-=35)),this.columnMenu.open(s.top,s.left),e.preventDefault&&e.preventDefault(),Re(this.parent.element,this.columnMenu.element.parentElement)},i.prototype.columnMenuHandlerDown=function(){this.isOpen=!("none"===this.element.style.display||""===this.element.style.display)},i.prototype.getColumnMenuHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(this.ROOT))},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(si,this.wireEvents,this),this.parent.on(ei,this.enableAfterRenderMenu,this),this.parent.on(Jt,this.render,this),this.isFilterItemAdded()&&this.parent.on("filterDialogCreated",this.filterPosition,this),this.parent.on("set-fullscreen-dialog",this.setFullScreenDialog,this),this.parent.on(Bi,this.renderResponsiveChangeAction,this),this.parent.on(hi,this.columnMenuHandlerClick,this),this.parent.on("after-filter-column-menu-close",this.afterFilterColumnMenuClose,this),this.parent.on(di,this.keyPressHandler,this),this.parent.on(pi,this.destroy,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(si,this.unwireEvents),this.parent.off(ei,this.enableAfterRenderMenu),this.parent.off(Jt,this.render),this.isFilterItemAdded()&&this.parent.off("filterDialogCreated",this.filterPosition),this.parent.off("set-fullscreen-dialog",this.setFullScreenDialog),this.parent.off(Bi,this.renderResponsiveChangeAction),this.parent.off(hi,this.columnMenuHandlerClick),this.parent.on("after-filter-column-menu-close",this.afterFilterColumnMenuClose),this.parent.off(di,this.keyPressHandler),this.parent.off(pi,this.destroy))},i.prototype.keyPressHandler=function(e){var t=this.parent;if("altDownArrow"===e.action&&!this.parent.enableAdaptiveUI){var i=t.focusModule.currentInfo.element;if(i&&i.classList.contains("e-headercell")){var n=t.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));this.openColumnMenuByField(n.field)}}},i.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.columnMenu&&(this.columnMenu.destroy(),t.remove(this.element)),this.parent.enableAdaptiveUI||this.render())},i.prototype.render=function(){this.parent.enableAdaptiveUI||(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 l.ContextMenu({cssClass:this.parent.cssClass?"e-grid-menu e-grid-column-menu "+this.parent.cssClass:"e-grid-menu e-grid-column-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.isAngular=Ge(this.parent),this.element&&F(this.element,"e-popup")&&this.element.classList.add(this.COL_POP),this.columnMenu.appendTo(this.element),this.wireFilterEvents())},i.prototype.wireFilterEvents=function(){!t.Browser.isDevice&&this.isFilterItemAdded()&&t.EventHandler.add(this.element,"mouseover",this.appendFilter,this)},i.prototype.unwireFilterEvents=function(){t.Browser.isDevice||!this.isFilterItemAdded()||this.parent.enableAdaptiveUI||t.EventHandler.remove(this.element,"mouseover",this.appendFilter)},i.prototype.beforeMenuItemRender=function(e){var t;if(this.isChooserItem(e.item)){var i=this.getKeyFromId(e.item.id,this.CHOOSER),n=this.parent.columnModel.filter(function(e){return e.field===i}),s=r.createCheckBox(this.parent.createElement,!1,{label:e.item.text,checked:n[0].visible});this.parent.enableRtl&&s.classList.add("e-rtl"),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(t=s.classList).add.apply(t,this.parent.cssClass.split(" ")):s.classList.add(this.parent.cssClass)),e.element.innerHTML="",e.element.appendChild(s)}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")},i.prototype.columnMenuBeforeClose=function(e){if(e.column=this.targetColumn,this.parent.trigger("columnMenuClose",e),e.event&&e.event.target instanceof Document&&"scroll"===e.event.type)return void(this.parent.enableStickyHeader||(e.cancel=!0));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=!e.event||"Escape"!==e.event.code:e.event&&(t.closest(e.event.target,"."+this.POP)||e.event.currentTarget&&e.event.currentTarget.activeElement&&F(e.event.currentTarget.activeElement,"e-filter-popup")||F(e.event.target,"e-popup")&&F(e.event.target,"e-colmenu-popup")||F(e.event.target,"e-multiselect-flmenu")||F(e.event.target,"e-popup-wrapper"))&&!t.Browser.isDevice?e.cancel=!0:e.event&&e.event.target&&e.event.target.classList.contains("e-filter-item")&&"Enter"===e.event.key?e.cancel=!0:this.parent.isColumnMenuFilterClosing&&(this.parent.isColumnMenuFilterClosing=!1,e.cancel=!0)},i.prototype.isChooserItem=function(e){return e.id&&e.id.indexOf("_colmenu_")>=0&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},i.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 n=i[t],r=this.getKeyFromId(n.id),s=this.defaultItems[""+r];-1!==this.getDefaultItems().indexOf(r)&&this.ensureDisabledStatus(r)&&!s.hide&&this.disableItems.push(n.text),n.hide&&this.hiddenItems.push(n.text)}this.columnMenu.enableItems(this.disableItems,!1),this.columnMenu.hideItems(this.hiddenItems)},i.prototype.columnMenuOnOpen=function(e){"e-menu-parent e-ul "===e.element.className&&(e.element.offsetHeight>window.innerHeight||this.parent.element.offsetHeight>window.innerHeight)&&(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto",this.parent.enableStickyHeader&&(e.element.style.position="fixed"))},i.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(Es)&&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(Rs);break;case"Ungroup":(!this.parent.ensureModuleInjected(Es)||this.parent.ensureModuleInjected(Es)&&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(is)&&this.parent.sortSettings.columns.length>0&&this.targetColumn&&this.targetColumn.allowSorting)for(var i=this.parent.sortSettings.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].field===this.targetColumn.field&&i[parseInt(n.toString(),10)].direction.toLocaleLowerCase()===e.toLocaleLowerCase().replace("sort","")&&(t=!0);else(!this.parent.allowSorting||!this.parent.ensureModuleInjected(is)||this.parent.allowSorting&&this.targetColumn&&!this.targetColumn.allowSorting)&&(t=!0);break;case"Filter":this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(Is)&&this.targetColumn&&this.targetColumn.allowFiltering?t=!1:!this.parent.ensureModuleInjected(Is)||!this.targetColumn||this.targetColumn.allowFiltering&&this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type||(t=!0)}return t},i.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)},i.prototype.columnMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof l.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)),t.isNullOrUndefined(e.parentItem)||"ColumnChooser"!==this.getKeyFromId(e.parentItem.id)?this.parent.notify("restore-Focus",{}):this.columnMenu.element.querySelector(".e-selected")&&this.columnMenu.element.querySelector(".e-selected").focus()},i.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},i.prototype.getItems=function(){for(var e=[],t=0,i=this.parent.columnMenuItems?this.parent.columnMenuItems:this.getDefault();t<i.length;t++){var n=i[t];if("string"==typeof n)if("ColumnChooser"===n){var r=this.getDefaultItem(n);r.items=this.createChooserItems(),e.push(r)}else e.push(this.getDefaultItem(n));else e.push(n)}return e},i.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};break;case"ColumnChooser":t={iconCss:this.COLUMNCHOOSER};break;case"AutoFit":t={iconCss:this.AUTOFIT};break;case"AutoFitAll":t={iconCss:this.AUTOFITALL}}return this.defaultItems[""+e]={text:this.getLocaleText(e),id:this.generateID(e),iconCss:t.iconCss?"e-icons "+t.iconCss:null},this.defaultItems[""+e]},i.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},i.prototype.generateID=function(e,t){return this.gridID+"_colmenu_"+(t?t+e:e)},i.prototype.getKeyFromId=function(e,t){return e.indexOf("_colmenu_")>0&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},i.prototype.getColumnMenu=function(){return this.element},i.prototype.getModuleName=function(){return"columnMenu"},i.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"}},i.prototype.getHeaderCell=function(e){return t.closest(e.target,"th.e-headercell")},i.prototype.getColumn=function(){if(this.headerCell){var e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("data-mappinguid");return this.parent.getColumnByUid(e)}return null},i.prototype.createChooserItems=function(){for(var e=[],t=0,i=this.parent.columnModel;t<i.length;t++){var n=i[t];n.showInColumnChooser&&n.field&&e.push({id:this.generateID(n.field,this.CHOOSER),text:n.headerText?n.headerText:n.field})}return e},i.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)}},i.prototype.getFilter=function(e,i,n){var r=this.getFilterPop();if(r){if(r.style.display=!t.Browser.isDevice&&n?"none":"block","none"!==r.style.display)if("Menu"===this.parent.filterSettings.type){if(r.querySelector(".e-flmenu-input"))r.querySelector(".e-flmenu-input").focus();else if(r.querySelector(".e-flmenu-valuediv")){var s=r.querySelector(".e-flmenu-valuediv").firstElementChild;t.isNullOrUndefined(s)||s.focus()}}else"CheckBox"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||r.querySelector(".e-searchinput")&&r.querySelector(".e-searchinput").focus()}else this.parent.notify("filterOpen",{col:this.targetColumn,target:e,isClose:n,id:i})},i.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),n=e.getBoundingClientRect(),r=n.left-i.left,s=n.top-i.top;i.height<s?s=s-t.offsetHeight+n.height:i.height<s+t.offsetHeight&&(s=i.height-t.offsetHeight),window.innerHeight<t.offsetHeight+s+i.top&&(s=window.innerHeight-t.offsetHeight-i.top),s+i.top<0&&(s=0),this.parent.enableStickyHeader&&i.top<=0&&(s=n.top-i.top),r+=this.parent.enableRtl?-t.offsetWidth:n.width,i.width<=r+t.offsetWidth?(r-=n.width+t.offsetWidth,n.left<t.offsetWidth&&(r=n.left+t.offsetWidth/2)):r<0&&(r+=t.offsetWidth+n.width),t.style.top=s+"px",t.style.left=r+"px"},i.prototype.filterPosition=function(){var e=this.getFilterPop();if(!this.parent.enableAdaptiveUI&&(e.classList.add(this.WRAP),!t.Browser.isDevice)){var i=e.style.display;e.style.cssText+="display:block;visibility:hidden";var n=this.element.querySelector("."+this.FILTER);n&&(this.setPosition(n.parentElement,e),e.style.cssText+="display:"+i+";visibility:visible")}},i.prototype.getDefault=function(){var e=[];return this.parent.ensureModuleInjected(Rs)&&(e.push("AutoFitAll"),e.push("AutoFit")),this.parent.allowGrouping&&this.parent.ensureModuleInjected(Es)&&(e.push("Group"),e.push("Ungroup")),this.parent.allowSorting&&this.parent.ensureModuleInjected(is)&&(e.push("SortAscending"),e.push("SortDescending")),e.push("ColumnChooser"),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(Is)&&e.push("Filter"),e},i.prototype.isFilterPopupOpen=function(){var e=this.getFilterPop();return e&&"none"!==e.style.display},i.prototype.getFilterPop=function(){if(!t.isNullOrUndefined(this.targetColumn)&&"Menu"===this.parent.filterSettings.type&&t.Browser.isDevice)return document.getElementById(this.targetColumn.uid+"-flmdlg");var e=this.parent.element.querySelector("."+this.POP);if(!e){var i=document.getElementById(this.parent.element.id+"_e-popup");e=i?i.querySelector("."+this.POP):null}if(!e&&this.parent.element.classList.contains("e-treelistgrid")){var n=t.closest(this.parent.element,".e-gantt");e=n?n.querySelector("."+this.POP):null}return e},i.prototype.isFilterItemAdded=function(){return this.parent.columnMenuItems&&this.parent.columnMenuItems.indexOf("Filter")>=0||!this.parent.columnMenuItems},i.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},i}(),Ro=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Do=function(e){function n(t,i){var n=e.call(this,t,i)||this;return n.parent=t,n.serviceLocator=i,n.initEvent(),n}return Ro(n,e),n.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))},n.prototype.initForeignKeyColumns=function(e){for(var n=0;n<e.length;n++)e[parseInt(n.toString(),10)].dataSource=e[parseInt(n.toString(),10)].dataSource instanceof i.DataManager?e[parseInt(n.toString(),10)].dataSource:t.isNullOrUndefined(e[parseInt(n.toString(),10)].dataSource)?new i.DataManager:"result"in e[parseInt(n.toString(),10)].dataSource?e[parseInt(n.toString(),10)].dataSource:new i.DataManager(e[parseInt(n.toString(),10)].dataSource)},n.prototype.eventfPromise=function(e,n,r,s){var o=this.getStateEventArgument(n),a=new i.Deferred,l=new i.Deferred;o.action=e.action;var d=this.parent.getDataModule();return!t.isNullOrUndefined(e.action)&&e.action.requestType&&!1!==d.foreignKeyDataState.isDataChanged?(d.setForeignKeyDataState({isPending:!0,resolver:l.resolve}),l.promise.then(function(){a.resolve(s.dataSource)}),o.setColumnData=this.parent.setForeignKeyData.bind(this.parent),this.parent.trigger("columnDataStateChange",o)):(d.setForeignKeyDataState({}),a.resolve(r)),a},n.prototype.getForeignKeyData=function(e){var n=this,r=e.column?[e.column]:this.parent.getForeignKeyColumns();"ExcludeHidden"===this.parent.columnQueryMode&&(r=r.filter(function(e){return!1!==e.visible}));for(var s=[],o=this,a=0;a<r.length;a++)!function(t){var i=void 0,n=e.isComplex?o.genarateColumnQuery(r[parseInt(t.toString(),10)]):o.genarateQuery(r[parseInt(t.toString(),10)],e.result.result,!1,!0);n.params=o.parent.query.params;var a=r[parseInt(t.toString(),10)].dataSource;i=a&&"result"in a?o.eventfPromise(e,n,a,r[parseInt(t.toString(),10)]).promise:!a.ready||a.dataSource.offline?a.executeQuery(n):a.ready.then(function(){return a.executeQuery(n)}),s.push(i)}(a);Promise.all(s).then(function(n){for(var s=0;s<n.length;s++)r[parseInt(s.toString(),10)].columnData=n[parseInt(s.toString(),10)].result,"dropdownedit"===r[parseInt(s.toString(),10)].editType&&"result"in r[parseInt(s.toString(),10)].dataSource&&(r[parseInt(s.toString(),10)].edit.params=t.extend(r[parseInt(s.toString(),10)].edit.params,{dataSource:n[parseInt(s.toString(),10)].result,query:new i.Query,fields:{value:r[parseInt(s.toString(),10)].foreignKeyField||r[parseInt(s.toString(),10)].field,text:r[parseInt(s.toString(),10)].foreignKeyValue}}));e.promise.resolve(e.result)}).catch(function(t){var i=t;return i.error||(i={error:i}),n.parent.log(["actionfailure","foreign_key_failure"],i),e.promise&&e.promise.reject&&e.promise.reject(t),t})},n.prototype.generateQueryFormData=function(e){e.predicate.predicate=this.genarateQuery(e.column,e.column.columnData,!0)},n.prototype.genarateQuery=function(e,t,n,r){var s=this.parent,o=[],a=new i.Query,l=n?e.foreignKeyField:e.field;if(this.parent.searchSettings&&this.parent.searchSettings.key.length){var d=(new i.Query).where(e.foreignKeyValue,"contains",this.parent.searchSettings.key,!0);t=new i.DataManager(t).executeLocal(d)}if(s.allowPaging||s.enableVirtualization||n){t=new i.DataManager(s.allowGrouping&&s.groupSettings.columns.length&&!n?t.records:t).executeLocal((new i.Query).select(l));var h=i.DataUtil.distinct(t,l,!1);l=n?e.field:e.foreignKeyField;for(var p=0;p<h.length;p++)h[parseInt(p.toString(),10)]&&h[parseInt(p.toString(),10)].getDay?o.push(ue({field:l,operator:"equal",value:h[parseInt(p.toString(),10)],matchCase:!1})):o.push(new i.Predicate(l,"equal",h[parseInt(p.toString(),10)],!1))}return r?o.length?a.where(i.Predicate.or(o)):a:o.length?i.Predicate.or(o):{predicates:[]}},n.prototype.genarateColumnQuery=function(e){var t=this.parent,n=new i.Query,r=this.isFiltered(e);if(r.isTrue&&(n=this.filterQuery(n,r.column,!0)),t.searchSettings.key.length){var s=t.searchSettings;e.dataSource instanceof i.DataManager&&e.dataSource.adaptor.getModuleName&&"ODataV4Adaptor"===e.dataSource.adaptor.getModuleName()?n=this.searchQuery(n,e,!0):n.search(s.key,e.foreignKeyValue,s.operator,s.ignoreCase)}return n},n.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}},n.prototype.getModuleName=function(){return"foreignKey"},n.prototype.destroy=function(){this.destroyEvent()},n.prototype.destroyEvent=function(){this.parent.isDestroyed||(this.parent.off("initForeignKeyColumn",this.initForeignKeyColumns),this.parent.off("getForeignKeyData",this.getForeignKeyData),this.parent.off("generateQuery",this.generateQueryFormData))},n}(Hi),To=function(){function e(e,t){this.infiniteCache={},this.infiniteCurrentViewData={},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","refresh"],this.keys=[pn,cn,un,gn],this.rowTop=0,this.virtualInfiniteData={},this.isCancel=!1,this.emptyRowData={},this.isNormaledit=!1,this.isInfiniteScroll=!1,this.isLastPage=!1,this.isInitialRender=!0,this.isFocusScroll=!1,this.isGroupCollapse=!1,this.infiniteDetailDestroy=!1,this.parent=e,this.serviceLocator=t,this.isNormaledit="Normal"===this.parent.editSettings.mode,this.addEventListener(),this.widthService=t.getService("widthService"),this.rowModelGenerator=new mn(this.parent)}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(Zt,this.onDataReady,this),this.parent.on(vi,this.dataSourceModified,this),this.parent.on("infinite-page-query",this.infinitePageQuery,this),this.parent.on("infinite-scroll-handler",this.infiniteScrollHandler,this),this.parent.on(li,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(di,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("get-virtual-data",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("refresh-infinite-editrowindex",this.refreshInfiniteEditrowindex,this),this.parent.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.on("virtual-scroll-add-action-begin",this.infiniteAddActionBegin,this),this.parent.on(ni,this.modelChanged,this),this.parent.on("refresh-infinite-current-view-data",this.refreshInfiniteCurrentViewData,this),this.parent.on(pi,this.destroy,this),this.parent.on($t,this.selectNewRow,this),this.parent.on("infinite-group-collapse",this.captionActionComplete,this),this.parent.on("set-virtual-page-query",this.setGroupCollapsePageQuery,this),this.parent.on("infinitescroll-complete",this.onActionComplete,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.dataBoundFunction=this.dataBound.bind(this),this.parent.addEventListener(qt,this.actionBeginFunction),this.parent.addEventListener(Ut,this.actionCompleteFunction),this.parent.addEventListener(jt,this.dataBoundFunction)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Zt,this.onDataReady),this.parent.off(vi,this.dataSourceModified),this.parent.off("infinite-page-query",this.infinitePageQuery),this.parent.off("infinite-scroll-handler",this.infiniteScrollHandler),this.parent.off(li,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(di,this.infiniteCellFocus),this.parent.off("infinite-show-hide",this.setDisplayNone),this.parent.off("virtual-scroll-edit-action-begin",this.editActionBegin),this.parent.off("get-virtual-data",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.on("refresh-infinite-editrowindex",this.refreshInfiniteEditrowindex),this.parent.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off("virtual-scroll-add-action-begin",this.infiniteAddActionBegin),this.parent.off(ni,this.modelChanged),this.parent.off("refresh-infinite-current-view-data",this.refreshInfiniteCurrentViewData),this.parent.off(pi,this.destroy),this.parent.off($t,this.selectNewRow),this.parent.off("infinite-group-collapse",this.captionActionComplete),this.parent.off("set-virtual-page-query",this.setGroupCollapsePageQuery),this.parent.off("infinitescroll-complete",this.onActionComplete),this.parent.removeEventListener(qt,this.actionBeginFunction),this.parent.removeEventListener(Ut,this.actionCompleteFunction),this.parent.removeEventListener(jt,this.dataBoundFunction))},e.prototype.dataBound=function(){"collapse"===this.groupCaptionAction?(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest()):"refresh"===this.groupCaptionAction&&(this.parent.hideSpinner(),this.groupCaptionAction=this.empty)},e.prototype.setGroupCollapsePageQuery=function(e){var t=this.parent;if(!t.infiniteScrollSettings.enableCache&&this.isGroupCollapse)if(e.skipPage=!0,this.isGroupCollapse=!1,"collapse"===this.groupCaptionAction){for(var i=t.getRowObjectFromUID(this.parentCapUid),n=t.getRowsObject(),r=0,s=n.length-1;s>=0&&n[parseInt(s.toString(),10)].indent!==i.indent;s--)n[parseInt(s.toString(),10)].isDataRow&&r++;var o=wt(n.indexOf(i),n),a=St(o.fields,o.keys,this),l=Ct(a);a=l[l.length-1];for(s=l.length-2;s>=0;s--)a=a.and(l[parseInt(s.toString(),10)]);e.query.where(a),e.query.skip(r),this.parentCapUid=this.empty}else{var d=t.getRows(),h=t.pageSettings.pageSize,p=yt(d[d.length-1])+1,c=p-p%h+h-p;p%h==0&&(c=0),e.query.skip(p),e.query.take(t.infiniteScrollSettings.initialBlocks*t.pageSettings.pageSize+c)}},e.prototype.captionActionComplete=function(e){var t=this.parent;if(!t.infiniteScrollSettings.enableCache&&e.isCollapse){var i=t.getContent().firstElementChild.getBoundingClientRect(),n=t.contentModule.getTable().getBoundingClientRect();if(Math.round(n.bottom-t.getRowHeight())<=Math.round(i.bottom)){this.parentCapUid=e.parentUid,this.groupCaptionAction="collapse",t.showSpinner();var r=t.getRowObjectFromUID(e.parentUid);this.getCaptionChildCount(r)?this.makeGroupCollapseRequest(e.parentUid):(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest())}}},e.prototype.makeGroupCollapseRequest=function(e){var t=this.parent,i=[].slice.call(t.getContentTable().querySelectorAll("tr")),n=t.groupSettings.enableLazyLoading?i:t.getRows(),r=t.groupSettings.enableLazyLoading?t.contentModule.visibleRows.length-1:yt(n[n.length-1]),s=this.parent.pageSettings.currentPage,o=Math.ceil(r/this.parent.pageSettings.pageSize)+1;if(s>=this.maxPage||o>this.maxPage)return void t.hideSpinner();this.parent.pageSettings.currentPage=o;var a={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:s,startIndex:r+1,direction:"down",isCaptionCollapse:!0,parentUid:e};this.isGroupCollapse=!0,this.parent.notify("model-changed",a)},e.prototype.getCaptionChildCount=function(e){for(var t=this.parent.getRowsObject(),i=!1,n=t.indexOf(e);n<t.length&&(!(t[parseInt(n.toString(),10)].indent===e.indent||t[parseInt(n.toString(),10)].indent<e.indent)||t[parseInt(n.toString(),10)].data.key===e.data.key);n++)if(t[parseInt(n.toString(),10)].isCaptionRow&&!this.childCheck(t,t[parseInt(n.toString(),10)],n)){i=!0;break}return i},e.prototype.childCheck=function(e,t,i){for(var n=0,r=i+1;r<e.length&&e[parseInt(r.toString(),10)].indent!==t.indent;r++)e[parseInt(r.toString(),10)].indent===t.indent+1&&e[parseInt(r.toString(),10)].parentUid===t.uid&&n++;return t.data.count===n},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,n=e.infiniteScrollSettings.enableCache,r=e.infiniteScrollSettings.maxBlocks,s=n&&(i>r||this.isUpScroll&&i>1),o=s?this.isUpScroll?i:i-r+1:1,a=s?o+r-1:n?r:t.length,l=o;l<=a;l++)this.infiniteCurrentViewData[parseInt(l.toString(),10)]&&(e.currentViewData=e.currentViewData.concat(this.infiniteCurrentViewData[parseInt(l.toString(),10)]))}},e.prototype.refreshInfiniteCurrentViewData=function(e){var t=this.parent,i=t.enableInfiniteScrolling&&(t.childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType);"add"!==e.args.action||"save"!==e.args.requestType||i||(this.parent.pageSettings.currentPage=Math.ceil(e.args.index/this.parent.pageSettings.pageSize)?Math.ceil(e.args.index/this.parent.pageSettings.pageSize):1);var n=this.parent.pageSettings.currentPage,r=this.parent.pageSettings.pageSize,s=this.parent.infiniteScrollSettings.initialBlocks,o=Object.keys(this.infiniteCurrentViewData),a=this.parent.infiniteScrollSettings.enableCache;if(!this.parent.groupSettings.columns.length){var l="save"===e.args.requestType&&!(this.parent.sortSettings.columns.length||this.parent.filterSettings.columns.length||this.parent.groupSettings.columns.length||this.parent.searchSettings.key),d="delete"===e.args.requestType;if(a||!l&&!d||i)s>1&&e.data.length===s*r?(i&&(this.infiniteCurrentViewData={},this.firstBlock=1),this.setInitialCache(e.data.slice(),{},a&&"delete"===e.args.requestType,!0)):this.infiniteCurrentViewData[parseInt(n.toString(),10)]=e.data.slice();else if(l){for(var h=0,p=1;p<=o.length;p++)if(h+=this.infiniteCurrentViewData[parseInt(p.toString(),10)].length-1,e.args.index<=h){this.resetCurrentViewData(p),this.infiniteCurrentViewData[parseInt(p.toString(),10)].splice(e.args.index,0,e.args.data);break}}else this.infiniteCurrentViewData[o[o.length-1]].push(e.data[0])}},e.prototype.resetCurrentViewData=function(e){for(var t=Object.keys(this.infiniteCurrentViewData),i=e;i<=t.length;i++){var n=this.infiniteCurrentViewData[parseInt(i.toString(),10)][this.infiniteCurrentViewData[parseInt(i.toString(),10)].length-1];this.infiniteCurrentViewData[i+1]&&this.infiniteCurrentViewData[i+1].splice(0,0,n),this.infiniteCurrentViewData[parseInt(i.toString(),10)].pop()}},e.prototype.modelChanged=function(e){var t=this.parent.getRows();if("save"===e.requestType&&e.index&&e.data&&(this.addRowIndex=e.index),t&&t.length&&"infiniteScroll"!==e.requestType&&("delete"===e.requestType||"add"===this.requestType)){if(this.firstIndex=yt(t[0]),this.firstBlock=Math.ceil((this.firstIndex+1)/this.parent.pageSettings.pageSize),this.lastIndex=yt(t[t.length-1]),"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.getRows(),n=this.parent.getRowsObject();this.ensureRowAvailability(n,e.result[0])&&(!i.length||this.addRowIndex&&this.addRowIndex>=i.length||this.resetRowIndex(n,e.e,i,"add"===this.requestType,!0),this.isLastPage?(this.isLastPage=!1,this.parent.pageSettings.currentPage=this.maxPage,this.parent.selectionModule.index<this.parent.frozenRows&&(t.remove(i[this.parent.frozenRows-1]),this.createRow([n[this.parent.frozenRows-1]],e,!1,!0),He(this.parent))):this.createRow(n,e)),this.parent.hideSpinner(),this.parent.notify("refresh-infinite-persist-selection",{}),"delete"===this.requestType?this.parent.notify("delete-complete",e.e):this.parent.notify("save-complete",e.e)}this.parent.notify(Ri,{case:"refreshHeight"})},e.prototype.createRow=function(e,i,n,r,s){var o=r?e:this.generateRows(i.result,i.e),a=new fn(this.serviceLocator,null,this.parent);if(this.parent.removeMaskRow(),!("save"===i.e.requestType&&i.e.index&&i.e.data&&(o[0].index=this.addRowIndex,this.addRowIndex=null,o[0].index>=e.length))){var l;l=this.parent.getContent().querySelector(ln),this.parent.frozenRows&&(l=r&&"add"!==this.requestType||!r&&"add"===this.requestType?this.parent.getHeaderContent().querySelector(ln):l);var d={rows:e,cancel:!1,args:i,isMovable:n,isFrozenRows:r,isFrozenRight:r,row:o};if(this.parent.notify("infinite-crud-cancel",d),!d.cancel)for(var h=o.length-1;h>=0;h--)"delete"===this.requestType?l.appendChild(a.render(o[parseInt(h.toString(),10)],this.parent.getColumns())):l.insertBefore(a.render(o[parseInt(h.toString(),10)],this.parent.getColumns()),l.rows[i.e.index]);if(!r&&this.parent.frozenRows&&(this.parent.selectionModule.index<this.parent.frozenRows||"add"===this.requestType)){var p=this.parent.getRows(),c=(n||s)&&"add"===this.requestType?this.parent.frozenRows:this.parent.frozenRows-1;t.remove(p[parseInt(c.toString(),10)]),this.createRow([e[this.parent.frozenRows-1]],i,!1,!0,!1)}this.parent.infiniteScrollSettings.enableCache||r||(He(this.parent),this.parent.contentModule.visibleRows="add"===this.requestType?o.concat(e):e.concat(o))}},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 n=this.parent.getPrimaryKeyFieldNames()[0],r=0;r<e.length;r++)if(e[parseInt(r.toString(),10)].data[""+n]===t[""+n]){i=!1;break}return i},e.prototype.generateRows=function(e,t){return this.rowModelGenerator.generateRows(e,t)},e.prototype.resetRowIndex=function(e,i,n,r,s){var o=this,a=this.parent.getPrimaryKeyFieldNames()[0],l=!(n.length%this.parent.pageSettings.pageSize);r?l&&(s&&!this.parent.groupSettings.columns.length&&this.swapCurrentViewData(1,!0),t.remove(n[e.length-1]),n.splice(e.length-1,1),e.splice(e.length-1,1)):e.filter(function(r,l){if(r.data[""+a]===i.data[0][""+a]){if(s&&!o.parent.groupSettings.columns.length){var d=Math.ceil((l+1)/o.parent.pageSettings.pageSize);o.resetInfiniteCurrentViewData(d,l)}e.splice(l,1);var h=o.parent.getRowElementByUID(r.uid);if(h){var p=n.indexOf(h);t.remove(h),n.splice(p,1)}}});var d=r?this.addRowIndex?this.addRowIndex+1:1:0;Be(this.parent,e,n,d,this.addRowIndex?this.addRowIndex:0)},e.prototype.resetInfiniteCurrentViewData=function(e,t){t-=(e-1)*this.parent.pageSettings.pageSize,this.infiniteCurrentViewData[parseInt(e.toString(),10)].splice(t,1),this.swapCurrentViewData(e,!1)},e.prototype.swapCurrentViewData=function(e,t){for(var i=Object.keys(this.infiniteCurrentViewData),n=t?i.length+1:i.length,r=e;r<n;r++)if(this.infiniteCurrentViewData[r+1]){var s=t?r:r+1,o=t?this.infiniteCurrentViewData[parseInt(r.toString(),10)].length-1:0,a=this.infiniteCurrentViewData[parseInt(s.toString(),10)].splice(o,1);t?(this.infiniteCurrentViewData[r+1]=a.concat(this.infiniteCurrentViewData[r+1]),r+1===n-1&&this.infiniteCurrentViewData[r+1].splice(this.infiniteCurrentViewData[r+1].length-1,1)):this.infiniteCurrentViewData[parseInt(r.toString(),10)].push(a[0])}this.updateCurrentViewData()},e.prototype.setDisplayNone=function(e){if(this.parent.infiniteScrollSettings.enableCache){for(var t=Object.keys(this.infiniteCache),i=1;i<=t.length;i++)this.infiniteCache[parseInt(i.toString(),10)].filter(function(t){t.cells[e.index].visible=""===e.visible});this.resetContentModuleCache(this.infiniteCache)}},e.prototype.refreshInfiniteCache=function(e){this.getEditedRowObject().data=e.data},e.prototype.refreshInfiniteCacheRowVisibleLength=function(e,i){var n=e[parseInt(i.toString(),10)];if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache){for(var r=0,s=0,o=0,a=0;a<n.length;a++)n[parseInt(a.toString(),10)].visible||t.isNullOrUndefined(n[parseInt(a.toString(),10)].visible)?s++:o++;return o>s?(r=o-s)>s&&(r=s):(r=s-o)>o&&(r=o),0===r&&(r=1),r}return n.length},e.prototype.refreshInfiniteEditrowindex=function(e){this.editRowIndex=e.index},e.prototype.getEditedRowObject=function(){var e,t=this.parent.getRowsObject();if(this.parent.pinnedTopRowModels.length&&this.editRowIndex<this.parent.pinnedTopRowModels.length){t=this.parent.pinnedTopRowModels;for(i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].index===this.editRowIndex)return e=t[parseInt(i.toString(),10)]}for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].index===this.editRowIndex&&(e=t[parseInt(i.toString(),10)]);return e},e.prototype.infiniteEditSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewRecords(e.data),this.isAdd=this.parent.editSettings.showAddNewRow)},e.prototype.updateCurrentViewRecords=function(e){var i=Me(this.parent,e);t.isNullOrUndefined(i)||(this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)]=e)},e.prototype.actionBegin=function(e){"add"===e.requestType||"delete"===e.requestType?this.requestType=e.requestType:"add"===e.action&&"save"===e.requestType&&(this.requestType=e.action),(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=this.parent.editSettings.showAddNewRow,this.isNormaledit&&(this.editRowIndex=this.empty,this.virtualInfiniteData={},this.parent.editModule.previousVirtualData={}))},e.prototype.onActionComplete=function(e){var i={type:Ut};this.parent.trigger(Ut,t.extend(e,i))},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){this.getVirtualInfiniteEditedData(),e.virtualData=this.parent.enableColumnVirtualization&&!this.parent.infiniteScrollSettings.enableCache?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)||"infiniteScroll"===e.requestType||(this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize))},e.prototype.ensureIntialCollapse=function(e){this.isInitialCollapse=!e},e.prototype.infiniteScrollHandler=function(e){if(!this.infiniteDetailDestroy){this.restoreInfiniteEdit(),this.restoreInfiniteAdd();var i=e.target,n=i.classList.contains(Yi),r=!(!this.parent.childGrid&&!this.parent.detailTemplate);if(n&&this.parent.enableInfiniteScrolling&&!e.isLeft){var s=this.parent.getContent().firstElementChild,o=[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.prevScrollTop=s.scrollTop;var a=r?this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}):this.parent.groupSettings.enableLazyLoading?o:this.parent.getRows();if(!a.length)return;var l=yt(a[a.length-1])+1,d=this.parent.pageSettings.currentPage,h=void 0,p=i.scrollHeight-i.scrollTop,c=Math.round(i.scrollHeight-i.scrollTop),u=p<i.clientHeight?Math.ceil(p):Math.floor(p),g=i.clientHeight;u>g?u-=1:g>u&&(g-=1);var f=u===g||c===g;if(!t.isNullOrUndefined(this.groupCaptionAction))return;if(this.isScroll&&f&&(this.parent.pageSettings.currentPage<=this.maxPage-1||this.enableContinuousScroll)){this.parent.infiniteScrollSettings.enableCache&&(this.isUpScroll=!1,this.isDownScroll=!0);var m=r?this.getGridRows().filter(function(e){return e.classList.contains("e-row")&&!e.classList.contains("e-addedrow")}):[].slice.call(s.querySelectorAll(".e-row:not(.e-addedrow)")),y=m[m.length-1],v=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length?this.parent.contentModule.visibleRows.length-1:yt(y);this.parent.pageSettings.currentPage=Math.ceil(v/this.parent.pageSettings.pageSize)+1,h={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:d,startIndex:l,direction:"down"},this.makeRequest(h)}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 v=yt((y=r?this.getGridRows().filter(function(e){return e.classList.contains(Zi)}):[].slice.call(s.getElementsByClassName(Zi)))[this.parent.pageSettings.pageSize-1]),S=yt(y[0])-this.parent.pageSettings.pageSize;this.parent.pageSettings.currentPage=Math.ceil(v/this.parent.pageSettings.pageSize)-1,this.parent.pageSettings.currentPage&&(h={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:d,startIndex:S,direction:"up"},this.makeRequest(h))}this.parent.infiniteScrollSettings.enableCache&&!this.isScroll&&t.isNullOrUndefined(h)&&(this.isDownScroll||this.isUpScroll)&&(s.scrollTop=this.top)}}},e.prototype.makeRequest=function(e){var i=this;if(this.parent.pageSettings.currentPage!==e.prevPage){var n=this.parent.infiniteScrollSettings.initialBlocks;n<this.maxPage&&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(Mi,e)},100)):this.parent.pageSettings.currentPage=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&n>=this.maxPage?1:this.maxPage}},e.prototype.infinitePageQuery=function(e){this.initialRender||("add"===this.requestType||"delete"===this.requestType)&&(this.parent.childGrid||this.parent.detailTemplate)?(this.initialRender=!1,this.intialPageQuery(e)):"delete"===this.requestType||"add"===this.requestType?this.isInfiniteScroll||this.parent.groupSettings.enableLazyLoading?this.parent.groupSettings.enableLazyLoading&&!this.parent.infiniteScrollSettings.enableCache?this.parent.infiniteScrollSettings.initialBlocks<this.parent.pageSettings.currentPage?e.page(1,this.parent.pageSettings.pageSize*this.parent.pageSettings.currentPage):e.page(1,this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks):e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize):this.editPageQuery(e):e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize)},e.prototype.editPageQuery=function(e){var i=this.parent.infiniteScrollSettings.initialBlocks;if(this.parent.infiniteScrollSettings.enableCache)this.infiniteCache={},this.infiniteCurrentViewData={},e.skip(this.firstIndex),e.take(i*this.parent.pageSettings.pageSize);else{"Dialog"===this.parent.editSettings.mode&&this.parent.clearSelection();var n="delete"===this.requestType?this.lastIndex:this.addRowIndex?this.addRowIndex:this.firstIndex;e.skip(n),t.isNullOrUndefined(this.parent.getDataModule().dataManager.dataSource.url)||""===this.parent.getDataModule().dataManager.dataSource.url||"delete"!==this.requestType&&"add"!==this.requestType?e.take(1):e.take(i*this.parent.pageSettings.pageSize)}},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.scrollToLastFocusedCell=function(e){var i=this.parent,n=this.lastFocusInfo.rowIdx+(e.keyArgs.action===cn?-1:1),r=this.lastFocusInfo.cellIdx,s=i.getRowByIndex(n);if(!s){var o=new fn(this.serviceLocator,null,this.parent),a=Math.floor(n/this.parent.pageSettings.pageSize)+1;i.pageSettings.currentPage=a;var l=i.getColumns();t.remove(i.getContent().querySelector("tbody")),i.getContent().querySelector("table").appendChild(i.createElement("tbody",{attrs:{role:"rowgroup"}}));for(var d=[],h=1===a||this.maxPage===a?0:-1,p=0;p<i.infiniteScrollSettings.maxBlocks;this.maxPage===a?h--:h++,p++){var c=this.infiniteCache[a+h];if(c){d=d.concat(c);for(var u=0;u<c.length;u++)i.getContent().querySelector("tbody").appendChild(o.render(c[parseInt(u.toString(),10)],l))}}i.notify($t,{rows:d,args:{}}),He(i)}var g=(s=i.getRowByIndex(n)).cells[parseInt(r.toString(),10)];i.focusModule.isInfiniteScroll=!0,i.focusModule.onClick({target:g},!0),i.selectRow(n),g.focus(),this.isFocusScroll=!1,e.cancel=!0},e.prototype.setLastCellFocusInfo=function(e){var t=e.byClick&&e.clickArgs.target||e.byKey&&e.keyArgs.target||(!this.isFocusScroll&&e).target;if(t&&t.classList.contains("e-rowcell")){var i=parseInt(t.getAttribute("aria-colindex"),10)-1,n=parseInt(t.parentElement.getAttribute("aria-rowindex"),10)-1;this.lastFocusInfo={rowIdx:n,cellIdx:i}}},e.prototype.infiniteCellFocus=function(e){var t=this.parent,i=t.infiniteScrollSettings.enableCache;if(e.byKey){if(i&&this.isFocusScroll)return void this.scrollToLastFocusedCell(e);var n=document.activeElement,r=yt(n.parentElement);this.cellIndex=parseInt(n.getAttribute(on),10)-1;var s=t.getContent().firstElementChild,o=this.maxPage*t.pageSettings.pageSize-1,a=Math.floor(s.offsetHeight/this.parent.getRowHeight()),l=s.getBoundingClientRect();if(!isNaN(r))if(e.keyArgs.action===pn||e.keyArgs.action===un){this.rowIndex=r+=1;h=(d=t.getRowByIndex(r))&&d.getBoundingClientRect();i&&(r=n.parentElement.rowIndex+1),this.isFocusScroll||!d&&r<o||h&&h.bottom>=l.bottom?(this.isFocusScroll||(this.pressedKey=e.keyArgs.action),this.isFocusScroll=!1,s.scrollTop=(r-a+1)*this.parent.getRowHeight()):!i&&d&&h&&(h.bottom>=l.bottom||h.top<l.top)&&d.cells[this.cellIndex].scrollIntoView()}else if(e.keyArgs.action===cn||e.keyArgs.action===gn){this.rowIndex=r-=1;var d=t.getRowByIndex(r),h=d&&d.getBoundingClientRect();i&&(r=n.parentElement.rowIndex-1),(!d||h.top<=l.top)&&(this.pressedKey=e.keyArgs.action,s.scrollTop=r*this.parent.getRowHeight())}}else"PageDown"!==e.key&&"PageUp"!==e.key||(this.pressedKey=e.key);this.setLastCellFocusInfo(e)},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("."+en),i=this.parent.element.querySelector("."+tn),n=this.parent.element.querySelector(".e-gridform");if(this.parent.infiniteScrollSettings.enableCache&&(e||i)){var r=e?t.extend({},this.getEditedRowObject().data):t.extend({},this.emptyRowData);this.virtualInfiniteData=this.parent.editModule.getCurrentEditedData(n,r);for(var s=this.parent.getHiddenColumns(),o=0;o<s.length;o++)s[parseInt(o.toString(),10)].defaultValue&&(this.virtualInfiniteData[s[parseInt(o.toString(),10)].field]=s[parseInt(o.toString(),10)].defaultValue)}},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 n=this.parent.getRowByIndex(this.editRowIndex);if(Object.keys(this.virtualInfiniteData).length&&n&&!this.parent.getContent().querySelector("."+en)){var r=n.getBoundingClientRect().top;r<e.offsetHeight&&r>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(n))}}},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("."+tn)&&e.scrollTop<this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.addRecord())},e.prototype.appendInfiniteRows=function(e){var t=this.parent,i=this.parent.getContent().firstElementChild,n=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;if(t.enableInfiniteScrolling&&(t.childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType)&&(i.scrollTop=0,t.pageSettings.currentPage=1),(this.parent.isAngular||this.parent.isReact||this.parent.isVue||this.parent.isVue3)&&n&&!e.args.isFrozen&&this.parent.infiniteScrollSettings.enableCache){var r=!(!this.parent.childGrid||!this.parent.element.querySelectorAll(".e-childgrid").length),s=this.parent.getDataRows();this.parent.refreshReactTemplateTD(s,r)}(n&&!e.args.isFrozen||!n)&&(n&&"up"===e.args.direction?e.tbody.insertBefore(e.frag,e.tbody.firstElementChild):e.tbody.appendChild(e.frag)),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,n&&(this.parent.infiniteScrollSettings.enableCache&&this.isRemove&&(i.scrollTop=this.top),He(this.parent)),this.restoreInfiniteAdd(),this.isScroll=!0),this.isInfiniteScroll=!1,this.infiniteDetailDestroy=!1},e.prototype.selectNewRow=function(e){var t=this,i=this.parent,n=i.getRowByIndex(this.rowIndex),r=i.infiniteScrollSettings.enableCache;if(n&&this.keys.some(function(e){return e===t.pressedKey})){var s=i.getContent().firstElementChild,o=i.getRowHeight(),a=n.cells[this.cellIndex];(this.pressedKey===pn||this.pressedKey===un||r&&(this.pressedKey===cn||this.pressedKey===gn))&&(r||this.pressedKey===cn||this.pressedKey===gn||(s.scrollTop=s.scrollTop+o),i.focusModule.isInfiniteScroll=!0,i.focusModule.onClick({target:a},!0),i.selectRow(this.rowIndex))}else if(this.lastFocusInfo&&("PageDown"===this.pressedKey||"PageUp"===this.pressedKey)){var l=r?0:this.lastFocusInfo.rowIdx;i.getRowByIndex(l)&&(a=i.getCellFromIndex(l,this.lastFocusInfo.cellIdx))&&(this.isFocusScroll=!0,r?a.focus({preventScroll:!0}):(i.focusModule.isInfiniteScroll=!0,i.focusModule.onClick({target:a},!0)))}this.pressedKey=void 0},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=!(!this.parent.childGrid&&!this.parent.detailTemplate),n=i?this.getGridRows().filter(function(e){return e.classList.contains(Zi)}):[].slice.call(this.parent.getContentTable().getElementsByClassName(Zi));if("down"===e.args.direction){if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length){s=i?this.getGridRows().filter(function(e){return!e.classList.contains("e-detailrow")}):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.removeCaptionRows(s,e.args)}var r=this.parent.element.querySelector("."+tn)?0:1;this.removeTopRows(n,this.parent.pageSettings.pageSize-r)}if("up"===e.args.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length){var s=i?this.getGridRows().filter(function(e){return!e.classList.contains("e-detailrow")}):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.removeCaptionRows(s,e.args)}else this.removeBottomRows(n,n.length-1,e.args);this.isScroll=!1,this.top=this.calculateScrollTop(e.args)}},e.prototype.calculateScrollTop=function(e){var i=0,n=this.parent.getContent().firstElementChild;if("down"===e.direction){this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse&&(i=this.captionRowHeight());var r=[].slice.call(this.parent.getContent().firstElementChild.querySelectorAll("tr:not(.e-row)")),s=0;this.isInitialCollapse&&!t.isNullOrUndefined(r)&&(s=Math.round((r.length-1)/this.parent.groupSettings.columns.length));for(var o=s||this.parent.pageSettings.pageSize*(this.parent.infiniteScrollSettings.maxBlocks-1),a=0,l=0;a<n.clientHeight;)a=++l*this.parent.getRowHeight();i+=(o-(l-=1))*this.parent.getRowHeight()}if("up"===e.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse)i=this.refreshInfiniteCacheRowVisibleLength(this.infiniteCache,this.parent.pageSettings.currentPage)*this.parent.getRowHeight();else if(this.isInitialCollapse){for(var d=this.infiniteCache[this.parent.pageSettings.currentPage],h=0,l=0;l<d.length;l++)d[parseInt(l.toString(),10)].isCaptionRow&&h++;i+=Math.round(h/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 n=0;n<=i;n++)this.parent.frozenRows&&this.parent.pageSettings.currentPage===this.parent.infiniteScrollSettings.maxBlocks+1&&n>i-this.parent.frozenRows||t.remove(e[parseInt(n.toString(),10)])},e.prototype.removeBottomRows=function(e,i,n){var r=0,s=this.parent.pageSettings.pageSize;this.infiniteCache[n.prevPage].length<s&&(r=this.parent.pageSettings.pageSize-this.infiniteCache[n.prevPage].length);for(var o=i;r<s;o--)r++,t.remove(e[parseInt(o.toString(),10)])},e.prototype.removeCaptionRows=function(e,i){var n=!(!this.parent.childGrid&&!this.parent.detailTemplate),r=n?this.getGridRows().filter(function(e){return e.classList.contains(Zi)}):[].slice.call(this.parent.getContent().getElementsByClassName(Zi));if("down"===i.direction)for(var s=yt(r[this.parent.pageSettings.pageSize-1])-1,o=0,a=0;o<s;a++)e[parseInt(a.toString(),10)].classList.contains(Zi)?o=yt(e[parseInt(a.toString(),10)]):t.remove(e[parseInt(a.toString(),10)]);if("up"===i.direction){for(var l=yt(r[r.length-1]),d=Math.ceil(l/this.parent.pageSettings.pageSize),h=0,a=this.parent.pageSettings.currentPage+1;a<d;a++)h+=n?this.infiniteCache[parseInt(a.toString(),10)].filter(function(e){return!e.isDetailRow}).length:this.infiniteCache[parseInt(a.toString(),10)].length;for(a=h;a<e.length;a++)t.remove(e[parseInt(a.toString(),10)])}},e.prototype.getGridRows=function(){return[].slice.call(this.parent.getContentTable().rows)},e.prototype.resetInfiniteBlocks=function(e,i){var n=this.parent.enableInfiniteScrolling&&"infiniteScroll"!==e.requestType;if(!this.initialRender&&!t.isNullOrUndefined(this.parent.infiniteScrollModule)&&n&&(this.actions.some(function(t){return t===e.requestType})||i||"save"===e.requestType&&(this.parent.sortSettings.columns.length||this.parent.filterSettings.columns.length||this.parent.groupSettings.columns.length||this.parent.searchSettings.key))){var r=this.parent.getContent().firstElementChild;this.parent.notify("detach-detail-template",{}),this.initialRender=!0,r.scrollTop=0,this.parent.pageSettings.currentPage=1,this.infiniteCache={},this.infiniteCurrentViewData={},this.resetContentModuleCache({}),this.isRemove=!1,this.top=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,n=(i.childGrid||i.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType),r="infiniteScroll"!==e.args.requestType&&("delete"===this.requestType||"add"===this.requestType),s=this.parent.pageSettings.currentPage;Object.keys(this.infiniteCache).length&&!r||(n&&(this.infiniteCache={}),this.setInitialCache(e.modelData,e.args,r)),t.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage])&&!n&&(this.infiniteCache[this.parent.pageSettings.currentPage]=e.modelData,this.resetContentModuleCache(this.infiniteCache)),e.isInfiniteScroll&&!this.isRemove&&(this.isRemove=(s-1)%this.parent.infiniteScrollSettings.maxBlocks==0,this.parent.contentModule.isRemove=this.isRemove)}},e.prototype.setInitialCache=function(e,i,n,r){for(var s=n?t.isNullOrUndefined(this.firstBlock)?1:this.firstBlock:1,o=1;o<=this.parent.infiniteScrollSettings.initialBlocks;o++){var a=(o-1)*this.parent.pageSettings.pageSize,l=o*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!r?this.setInitialGroupCache(e,s,a,l):r?this.infiniteCurrentViewData[parseInt(s.toString(),10)]=e.slice(a,l):(this.infiniteCache[parseInt(s.toString(),10)]=e.slice(a,l),this.resetContentModuleCache(this.infiniteCache)),s++}},e.prototype.setInitialGroupCache=function(e,t,i,n){for(var r=[],s=0,o=1;o<=Object.keys(this.infiniteCache).length;o++)s+=this.infiniteCache[parseInt(o.toString(),10)].length;for(var a=i,o=s;o<e.length&&a<n&&((e[parseInt(o.toString(),10)].index<n||e[parseInt(o.toString(),10)].isCaptionRow)&&(a=e[parseInt(o.toString(),10)].isCaptionRow?a:e[parseInt(o.toString(),10)].index,r.push(e[parseInt(o.toString(),10)])),!(e[parseInt(o.toString(),10)].index>=n||e[parseInt(o.toString(),10)].index===n-1));o++);this.infiniteCache[parseInt(t.toString(),10)]=r,this.resetContentModuleCache(this.infiniteCache)},e.prototype.resetContentModuleCache=function(e){this.parent.contentModule.infiniteCache=e},e.prototype.resetInfiniteCache=function(e){var t=Object.keys(this.infiniteCache).length;this.infiniteCache={};for(var i=1;i<=t;i++){var n=(i-1)*this.parent.pageSettings.pageSize,r=i*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.setInitialGroupCache(e,i,n,r):(this.infiniteCache[parseInt(i.toString(),10)]=e.slice(n,r),this.resetContentModuleCache(this.infiniteCache))}},e.prototype.destroy=function(){this.removeEventListener()},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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Oo=function(e){function i(t,i){var n=e.call(this,t,i)||this;return n.childCount=0,n.scrollData=[],n.isFirstChildRow=!1,n.isScrollDown=!1,n.isScrollUp=!1,n.groupCache={},n.cacheRowsObj={},n.startIndexes={},n.captionCounts={},n.rowsByUid={},n.objIdxByUid={},n.initialGroupCaptions={},n.requestType=["paging","columnstate","reorder","cancel","save","beginEdit","add","delete","filterBeforeOpen","filterchoicerequest","infiniteScroll","virtualscroll","columnVisibilityUpdate"],n.scrollTopCache=void 0,n.refRowsObj={},n.cacheMode=!1,n.cacheBlockSize=5,n.ignoreAccent=!!n.parent.allowFiltering&&n.parent.filterSettings.ignoreAccent,n.allowCaseSensitive=!0,n.lazyLoadQuery=[],n.startIndex=0,n.locator=i,n.groupGenerator=new bn(n.parent),n.summaryModelGen=new Sn(n.parent),n.captionModelGen=new Cn(n.parent),n.rowRenderer=new fn(n.locator,null,n.parent),n.eventListener(),n}return Eo(i,e),i.prototype.eventListener=function(){this.parent.addEventListener(qt,this.actionBegin.bind(this)),this.parent.addEventListener(Ut,this.actionComplete.bind(this)),this.parent.on(Jt,this.setLazyLoadPageSize,this),this.parent.on("group-cache",this.setCache,this),this.parent.on("lazy-load-scroll-handler",this.scrollHandler,this),this.parent.on(ci,this.setVisible,this),this.parent.on("group-collapse",this.collapseShortcut,this)},i.prototype.captionExpand=function(e){var t=this,i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)],r=e.getAttribute("data-uid");this.refreshCaches(),this.scrollTopCache&&!(this.parent.scrollModule.content.scrollTop>this.scrollTopCache)||this.parent.enableVirtualization||(this.scrollTopCache=this.parent.scrollModule.content.scrollTop);var s=this.getRowObjectIndexByUid(r),o=!!n[s+1]&&n[parseInt(s.toString(),10)].indent<n[s+1].indent;this.parent.enableVirtualization&&(o=!!this.cacheRowsObj[""+r]);for(var a=n[parseInt(s.toString(),10)],l=wt(s,n),d=0;d<l.fields.length;d++){var h=this.parent.getColumnByField(l.fields[parseInt(d.toString(),10)]);h.enableGroupByFormat&&(l.keys[parseInt(d.toString(),10)]=this.locator.getService("valueFormatter").fromView(l.keys[parseInt(d.toString(),10)],h.getParser(),"dateonly"===h.type?"date":h.type))}var p={captionRowElement:e,groupInfo:a,enableCaching:!0,cancel:!1};this.parent.trigger("lazyLoadGroupExpand",p,function(n){n.cancel||(n.keys=l.keys,n.fields=l.fields,n.rowIndex=e.rowIndex,n.makeRequest=!n.enableCaching||!o,!n.enableCaching&&o&&t.clearCache([r]),n.skip=0,n.take=t.pageSize,a.isExpand=!0,t.rowsByUid[parseInt(i.toString(),10)][a.uid]&&(t.rowsByUid[parseInt(i.toString(),10)][a.uid].isExpand=!0),t.captionRowExpand(n))})},i.prototype.captionCollapse=function(e){var i=this,n=this.groupCache[this.parent.pageSettings.currentPage],r=e.rowIndex,s=e.getAttribute("data-uid");this.refreshCaches();var o=this.getRowObjectIndexByUid(s),a={captionRowElement:e,groupInfo:n[parseInt(o.toString(),10)],cancel:!1};this.parent.trigger("lazyLoadGroupCollapse",a,function(e){if(!e.cancel){e.isExpand=!1;for(var n=0;n<i.lazyLoadQuery.length;n++){var a=i.lazyLoadQuery[parseInt(n.toString(),10)][0];e.groupInfo.data.key===a.value&&i.lazyLoadQuery.splice(n,1)}if(i.removeRows(o,r,s),i.parent.isRemote()){var l=i.parent.getHeaderContent().querySelector(".e-checkselectall");l&&(0===i.getAllPagesData().length&&i.parent.selectionModule&&!i.parent.selectionModule.selectedRowIndexes.length?l.parentElement.classList.add("e-checkbox-disabled"):l.parentElement.classList.remove("e-checkbox-disabled"))}(i.parent.enableInfiniteScrolling||i.parent.enableVirtualization)&&(i.groupCache[i.parent.pageSettings.currentPage]=t.extend([],i.refRowsObj[i.parent.pageSettings.currentPage]),i.refreshRowObjects([],o))}})},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 n=this.getRowObjectIndexByUid(e[parseInt(i.toString(),10)]),r=t[parseInt(n.toString(),10)];if(r){if(this.captionCounts[this.parent.pageSettings.currentPage][r.uid])for(var s=n+1;s<t.length;s++){if(t[parseInt(s.toString(),10)].indent===r.indent||t[parseInt(s.toString(),10)].indent<r.indent){delete this.captionCounts[this.parent.pageSettings.currentPage][r.uid];break}t[parseInt(s.toString(),10)].isCaptionRow&&delete this.captionCounts[this.parent.pageSettings.currentPage][t[parseInt(s.toString(),10)].uid]}if(r.isExpand){var o=this.parent.getRowElementByUID(r.uid);if(!o)return;this.parent.groupModule.expandCollapseRows(o.querySelector(".e-recordplusexpand"))}var a=this.getNextChilds(n);if(a.length){var l=[];a[a.length-1].isCaptionRow&&(l=this.getChildRowsByParentIndex(t.indexOf(a[a.length-1]),!1,!1,null,!0,!0));var d=t.indexOf(a[0]),h=l.length?t.indexOf(l[l.length-1]):t.indexOf(a[a.length-1]);t.splice(d,h-(d-1)),this.refreshCaches()}}}},i.prototype.refreshCaches=function(){var e=this.parent.pageSettings.currentPage,t=this.groupCache[parseInt(e.toString(),10)];this.parent.enableInfiniteScrolling?(this.rowsByUid[parseInt(e.toString(),10)]=[],this.objIdxByUid[parseInt(e.toString(),10)]=[]):(this.rowsByUid={},this.objIdxByUid={});for(var i=0;i<t.length;i++)this.maintainRows(t[parseInt(i.toString(),10)],i)},i.prototype.getInitialCaptionIndexes=function(){for(var e=this.parent.pageSettings.currentPage,t=[],i=0;i<this.initialGroupCaptions[parseInt(e.toString(),10)].length;i++)t.push(this.initialGroupCaptions[parseInt(e.toString(),10)][parseInt(i.toString(),10)].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&&F(e.target,Yi)&&"TR"===e.target.parentElement.tagName){if(!e.collapse&&F(e.target,Zi))return;var t=e.target.parentElement.getAttribute("data-uid");if(e.collapse){var i=this.getRowByUid(t);if((n=this.getRowByUid(i.parentUid)).isCaptionRow&&n.isExpand){r=this.getRowElementByUid(i.parentUid);this.parent.groupModule.expandCollapseRows(r.cells[i.indent-1])}}else{var n=this.getRowByUid(t);if(n.isCaptionRow&&!n.isExpand){var r=this.getRowElementByUid(t);this.parent.groupModule.expandCollapseRows(r.cells[n.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(),this.parent.enableVirtualization&&(this.parent.contentModule.currentInfo={})),"reorder"===e.requestType&&this.parent.groupSettings.columns.length)for(var t=Object.keys(this.groupCache),i=0;i<t.length;i++)for(var n=this.groupCache[t[parseInt(i.toString(),10)]],r=0;r<n.length;r++)if(n[parseInt(r.toString(),10)].isCaptionRow&&!this.captionModelGen.isEmpty()&&this.changeCaptionRow(n[parseInt(r.toString(),10)],null,t[parseInt(i.toString(),10)]),n[parseInt(r.toString(),10)].isDataRow){var s=e.fromIndex+n[parseInt(r.toString(),10)].indent,o=e.toIndex+n[parseInt(r.toString(),10)].indent;this.moveCells(n[parseInt(r.toString(),10)].cells,s,o)}("delete"===e.requestType||"add"===e.action&&"save"===e.requestType)&&(this.groupCache={},this.resetRowMaintenance(),this.parent.enableVirtualization&&(this.parent.contentModule.currentInfo={}))}},i.prototype.actionComplete=function(e){var t=["columnstate","reorder","save","beginEdit","delete","infiniteScroll","columnVisibilityUpdate","columnChooserClose","filterchoicerequest","filterAfterOpen"];!e.cancel&&-1===t.indexOf(e.requestType)&&this.parent.groupSettings.columns.length&&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 n=t-e.length;1+n--;)e.push(void 0);e.splice(t,0,e.splice(i,1)[0])},i.prototype.removeRows=function(e,i,n){var r,s=this.parent.pageSettings.currentPage,o=this.groupCache[parseInt(s.toString(),10)],a=[].slice.call(this.parent.getContent().querySelectorAll("tr")),l=0;if(this.parent.aggregates.length){var d=this.getAggregateByCaptionIndex(e);r=d.length?d[d.length-1].uid:void 0}var h=o[parseInt(e.toString(),10)].indent;this.addClass(this.getNextChilds(parseInt(e.toString(),10))),o[parseInt(e.toString(),10)].isExpand=!1,this.rowsByUid[parseInt(s.toString(),10)][o[parseInt(e.toString(),10)].uid]&&(this.rowsByUid[parseInt(s.toString(),10)][o[parseInt(e.toString(),10)].uid].isExpand=!1);for(var p,c=e+1;c<o.length;c++){if(o[parseInt(c.toString(),10)].indent===h||o[parseInt(c.toString(),10)].indent<h){p=o[parseInt(c.toString(),10)].uid;break}o[parseInt(c.toString(),10)].isCaptionRow&&o[parseInt(c.toString(),10)].isExpand&&this.addClass(this.getNextChilds(c))}for(c=i+1;c<a.length&&a[parseInt(c.toString(),10)].getAttribute("data-uid")!==p;c++){if(a[parseInt(c.toString(),10)].getAttribute("data-uid")===r){t.remove(a[parseInt(c.toString(),10)]);break}t.remove(a[parseInt(c.toString(),10)]),this.refRowsObj[parseInt(s.toString(),10)].splice(i+1,1),l+=1}this.cacheRowsObj[""+n]=this.groupCache[parseInt(s.toString(),10)].slice(e+1,e+1+l),this.groupCache[parseInt(s.toString(),10)].splice(e+1,l),this.parent.enableVirtualization&&(this.parent.notify("refresh-Virtual-LazyLoad-Cache",{rows:[],uid:o[parseInt(e.toString(),10)].uid,count:l}),this.parent.contentModule.setVirtualHeight(),this.parent.islazyloadRequest=!1),this.parent.scrollModule.content.scrollTop>this.scrollTopCache&&!this.parent.enableVirtualization&&(this.parent.scrollModule.content.scrollTop=this.scrollTopCache),this.parent.getContentTable().scrollHeight<this.parent.getContent().clientHeight&&"auto"!==this.parent.height&&this.parent.scrollModule.setLastRowCell(),this.parent.notify("refresh-Expand-and-Collapse",{rows:this.refRowsObj[parseInt(s.toString(),10)]})},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],n=t||i,r=i[parseInt(e.toString(),10)].indent+1,s=[],o=t?0:e+1;o<n.length&&!(n[parseInt(o.toString(),10)].indent<r);o++)n[parseInt(o.toString(),10)].indent===r&&s.push(n[parseInt(o.toString(),10)]);return s},i.prototype.lazyLoadHandler=function(e){this.setStartIndexes();var t=this.parent.getContent().querySelectorAll("tr")[e.index],i=t.getAttribute("data-uid"),n=this.getRowObjectIndexByUid(i),r=this.groupCache[this.parent.pageSettings.currentPage][parseInt(n.toString(),10)],s=e.isRowExist?e.isScroll?this.scrollData:this.parent.enableVirtualization?this.cacheRowsObj[""+i]:this.getChildRowsByParentIndex(n,!0,!0,null,!0):[];if(this.scrollData=[],!e.isRowExist)if(this.setRowIndexes(n,r),this.refreshCaptionRowCount(this.groupCache[this.parent.pageSettings.currentPage][parseInt(n.toString(),10)],e.count),-1!==Object.keys(e.data).indexOf("GroupGuid"))for(c=0;c<e.data.length;c++){var o=this.groupGenerator.generateCaptionRow(e.data[parseInt(c.toString(),10)],e.level,r.parentGid,void 0,0,r.uid);s.push(o),this.parent.aggregates.length&&(s=s.concat(this.summaryModelGen.generateRows(e.data[parseInt(c.toString(),10)],{level:e.level+1,parentUid:o.uid})))}else this.groupGenerator.index=this.parent.allowPaging?this.getStartIndex(n,e.isScroll):e.isScroll?this.startIndex:r.data.startIndex,s=this.groupGenerator.generateDataRows(e.data,e.level,r.parentGid,0,r.uid);var a=e.isScroll?this.rowIndex:e.index,l=this.getNextChilds(n,s),d=!!e.up||this.hasLastChildRow(e.isScroll,e.count,l.length);e.isRowExist||d||(l[this.blockSize].lazyLoadCssClass="e-lazyload-middle-down"),d||(l[l.length-1].lazyLoadCssClass="e-not-lazyload-end");var h=e.isScroll||e.isRowExist?[]:this.getAggregateByCaptionIndex(n);if(e.up||(!e.isRowExist||this.parent.enableVirtualization&&e.isRowExist&&this.cacheRowsObj[""+i])&&this.refreshRowObjects(s,e.isScroll?this.rowObjectIndex:n),this.parent.enableVirtualization){var p=e.isScroll?this.groupCache[this.parent.pageSettings.currentPage][this.rowIndex].uid:r.uid;this.parent.notify("refresh-Virtual-LazyLoad-Cache",{rows:s,uid:p}),this.parent.contentModule.setVirtualHeight(),this.parent.contentModule.isTop=!1}this.render(a,s,d,h),this.isFirstChildRow&&!e.up&&(this.parent.getContent().firstElementChild.scrollTop=s.length*this.parent.getRowHeight()),this.isFirstChildRow=!1,this.rowIndex=void 0,this.rowObjectIndex=void 0,this.childCount=0;for(var c=0;c<s.length;c++){this.refRowsObj[this.parent.pageSettings.currentPage].splice(n+c+1,0,s[parseInt(c.toString(),10)]);var u=s[parseInt(c.toString(),10)];u.isSelected&&(this.parent.selectionModule.selectedRecords.push(this.getRowByIndex(u.index)),this.parent.allowPaging&&this.parent.selectionModule.selectedRowIndexes.push(u.index))}d&&t.querySelector(".e-lastrowcell")&&this.parent.groupModule.lastCaptionRowBorder(),this.parent.notify("refresh-Expand-and-Collapse",{rows:this.refRowsObj[this.parent.pageSettings.currentPage]}),this.parent.enableVirtualMaskRow&&this.parent.removeMaskRow()},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,n=this.groupCache[parseInt(i.toString(),10)];if(t)return n[this.rowObjectIndex].index+1;var r=0,s=0,o=this.getRowByUid(n[parseInt(e.toString(),10)].parentUid);if(o&&(s=this.prevCaptionCount(o)),n[parseInt(e.toString(),10)].indent>0)for(var a=e-1;a>=0&&!(n[parseInt(a.toString(),10)].indent<n[parseInt(e.toString(),10)].indent);a--)n[parseInt(a.toString(),10)].isCaptionRow&&n[parseInt(a.toString(),10)].indent===n[parseInt(e.toString(),10)].indent&&(r+=n[parseInt(a.toString(),10)].data.count);return r+s+this.startIndexes[parseInt(i.toString(),10)][n[parseInt(e.toString(),10)].parentGid]},i.prototype.prevCaptionCount=function(e){for(var t=this.parent.pageSettings.currentPage,i=this.groupCache[parseInt(t.toString(),10)],n=0,r=i.indexOf(e)-1;r>=0&&0!==i[parseInt(r.toString(),10)].indent&&!(i[parseInt(r.toString(),10)].indent<e.indent);r--)if(i[parseInt(r.toString(),10)].isCaptionRow&&i[parseInt(r.toString(),10)].indent===e.indent){var s=this.captionCounts[parseInt(t.toString(),10)][i[parseInt(r.toString(),10)].uid];n+=s||i[parseInt(r.toString(),10)].data.count}var o=this.getRowByUid(e.parentUid);return o&&(n+=this.prevCaptionCount(o)),n},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,n=0;n<e.length;n++)e[parseInt(n.toString(),10)].isCaptionRow&&(t.length?t.push(e[parseInt(i.toString(),10)].data.count+t[t.length-1]):t.push(0),i=n);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,n){var r=this.parent.getContent().querySelectorAll("tr")[parseInt(e.toString(),10)],s=this.parent.getContent().firstElementChild,o=this.parent.getRowHeight();if(r&&n.length)for(l=n.length-1;l>=0;l--)r.insertAdjacentElement("afterend",this.rowRenderer.render(n[parseInt(l.toString(),10)],this.parent.getColumns()));if(r&&t.length){for(var a=this.parent.getHeaderContent().querySelector(".e-checkselectall"),l=t.length-1;l>=0;l--)this.confirmRowRendering(t[parseInt(l.toString(),10)])&&(r.insertAdjacentElement("afterend",this.rowRenderer.render(t[parseInt(l.toString(),10)],this.parent.getColumns())),this.isScrollDown&&(s.scrollTop=s.scrollTop-o),this.isScrollUp&&(s.scrollTop=s.scrollTop+o));this.parent.isRemote()&&this.parent.isCheckBoxSelection&&a&&a.nextElementSibling&&(a.nextElementSibling.classList.contains("e-check")||a.nextElementSibling.classList.contains("e-stop"))&&this.parent.selectionModule.onDataBound()}this.isScrollDown=!1,this.isScrollUp=!1},i.prototype.maintainRows=function(e,t){var i=this.parent.pageSettings.currentPage;this.rowsByUid[parseInt(i.toString(),10)]||(this.rowsByUid[parseInt(i.toString(),10)]={},this.objIdxByUid[parseInt(i.toString(),10)]={}),e.uid&&(this.rowsByUid[parseInt(i.toString(),10)][e.uid]=e),this.objIdxByUid[parseInt(i.toString(),10)][e.uid]=t},i.prototype.confirmRowRendering=function(e){var i=!0;if(t.isNullOrUndefined(e.indent)&&!e.isDataRow&&!e.isCaptionRow){var n=this.getRowByUid(e.parentUid);n.isCaptionRow&&!n.isExpand&&(i=!1)}return i},i.prototype.refreshRowObjects=function(e,i){var n=this.parent.pageSettings.currentPage,r=this.groupCache[parseInt(n.toString(),10)];this.rowsByUid[parseInt(n.toString(),10)]={},this.objIdxByUid[parseInt(n.toString(),10)]={};for(var s=[],o=0,a=0;a<r.length;a++)if(a===i){this.maintainRows(r[parseInt(a.toString(),10)],o),s.push(r[parseInt(a.toString(),10)]),o++;for(var l=0;l<e.length;l++)this.maintainRows(e[parseInt(l.toString(),10)],o),s.push(e[parseInt(l.toString(),10)]),o++}else this.maintainRows(r[parseInt(a.toString(),10)],o),s.push(r[parseInt(a.toString(),10)]),o++;this.groupCache[this.parent.pageSettings.currentPage]=t.extend([],s),this.updateCurrentViewData()},i.prototype.getAggregateByCaptionIndex=function(e){for(var i=this.groupCache[this.parent.pageSettings.currentPage],n=i[parseInt(e.toString(),10)],r=n.indent,s=n.uid,o=[],a=e+1;a<i.length&&i[parseInt(a.toString(),10)].indent!==r;a++)t.isNullOrUndefined(i[parseInt(a.toString(),10)].indent)&&i[parseInt(a.toString(),10)].parentUid===s&&o.push(i[parseInt(a.toString(),10)]);return o},i.prototype.getChildRowsByParentIndex=function(e,i,n,r,s,o){var a=r||this.groupCache[this.parent.pageSettings.currentPage],l=a[parseInt(e.toString(),10)],d=[];if(!l.isCaptionRow||l.isCaptionRow&&!l.isExpand&&!o)return[];s&&this.parent.aggregates.length&&(d=this.getAggregateByCaptionIndex(e));for(var h=l.indent,p=l.uid,c=[],u=0,g=e+1;g<a.length;g++){if(a[parseInt(g.toString(),10)].parentUid===p){if(t.isNullOrUndefined(a[parseInt(g.toString(),10)].indent))continue;if(u++,c.push(a[parseInt(g.toString(),10)]),i&&a[parseInt(g.toString(),10)].isCaptionRow&&(c=c.concat(this.getChildRowsByParentIndex(g,i,n,r,s))),n&&u===this.pageSize)break}if(a[parseInt(g.toString(),10)].indent===h)break}return c.concat(d)},i.prototype.initialGroupRows=function(e){var t=[],i=this.groupCache[this.parent.pageSettings.currentPage];if(e)return this.getRenderedRowsObject();for(var n=0;n<i.length;n++)0===i[parseInt(n.toString(),10)].indent&&(t.push(i[parseInt(n.toString(),10)]),t=t.concat(this.getChildRowsByParentIndex(n,!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[parseInt(i.toString(),10)].getAttribute("data-uid")));return e},i.prototype.getCacheRowsOnDownScroll=function(e){for(var i=[],n=this.groupCache[this.parent.pageSettings.currentPage],r=e,s=0;s<this.pageSize&&(n[parseInt(r.toString(),10)]&&!(n[parseInt(r.toString(),10)].indent<n[parseInt(e.toString(),10)].indent));s++)n[parseInt(r.toString(),10)].indent===n[parseInt(e.toString(),10)].indent&&(i.push(n[parseInt(r.toString(),10)]),n[parseInt(r.toString(),10)].isCaptionRow&&n[parseInt(r.toString(),10)].isExpand&&(i=i.concat(this.getChildRowsByParentIndex(r,!0,!0,null,!0)))),(n[parseInt(r.toString(),10)].indent>n[parseInt(e.toString(),10)].indent||t.isNullOrUndefined(n[parseInt(r.toString(),10)].indent))&&s--,r++;return i},i.prototype.getCacheRowsOnUpScroll=function(e,t,i){for(var n=[],r=this.groupCache[this.parent.pageSettings.currentPage],s=!1,o=0;o<r.length&&(!s||r[parseInt(o.toString(),10)]&&!(r[parseInt(o.toString(),10)].indent<r[parseInt(i.toString(),10)].indent)&&r[parseInt(o.toString(),10)].uid!==t);o++)s||r[parseInt(o.toString(),10)].uid!==e||(s=!0),s&&r[parseInt(o.toString(),10)].indent===r[parseInt(i.toString(),10)].indent&&(n.push(r[parseInt(o.toString(),10)]),r[parseInt(o.toString(),10)].isCaptionRow&&r[parseInt(o.toString(),10)].isExpand&&(n=n.concat(this.getChildRowsByParentIndex(o,!0,!0,null,!0))));return n},i.prototype.scrollHandler=function(e){if(!this.parent.isDestroyed&&!this.childCount){var t,i=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-down")),n=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-up")),r=[].slice.call(this.parent.getContent().getElementsByClassName("e-not-lazyload-end")),s=!1,o=!1,a=!1;if(e.scrollDown&&i.length&&(t=(p=this.findRowElements(i)).tr,s=p.entered),!e.scrollDown&&r)for(var l=0;l<r.length;l++){var d=r[parseInt(l.toString(),10)].getBoundingClientRect().top,h=this.parent.getContent().scrollHeight;if(d>0&&d<h){t=r[parseInt(l.toString(),10)],a=!0,this.rowIndex=t.rowIndex;break}}if(!e.scrollDown&&n.length&&!a){var p=this.findRowElements(n);t=p.tr,o=p.entered}t&&!t.classList.contains("e-masked-row")&&(s&&e.scrollDown&&s&&t&&this.scrollDownHandler(t),!e.scrollDown&&a&&t&&this.scrollUpEndRowHandler(t),this.cacheMode&&!e.scrollDown&&!a&&o&&t&&this.scrollUpHandler(t))}},i.prototype.scrollUpEndRowHandler=function(e){var t=this.parent.pageSettings.currentPage,i=this.groupCache[parseInt(t.toString(),10)],n=e.getAttribute("data-uid"),r=this.rowObjectIndex=this.getRowObjectIndexByUid(n),s=r,o=i[parseInt(r.toString(),10)],a=this.getRowByUid(o.parentUid),l=this.getRowObjectIndexByUid(a.uid),d=this.parent.getContent().querySelector("tr[data-uid="+a.uid+"]").rowIndex,h=this.getChildRowsByParentIndex(l).indexOf(o),p=Math.ceil(h/this.pageSize);if(1!==p)if(this.childCount=p*this.pageSize,r=this.getCurrentBlockEndIndex(o,r),this.childCount<a.data.count){e.classList.remove("e-not-lazyload-end"),o.lazyLoadCssClass="";var c=!!i[r+1]&&o.indent===i[r+1].indent;this.scrollData=c?this.getCacheRowsOnDownScroll(r+1):[];var u=wt(l,i),g={rowIndex:d,makeRequest:!c,groupInfo:a,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(l),m=Math.ceil(f.indexOf(i[parseInt(s.toString(),10)])/this.pageSize)-(this.cacheBlockSize-1);this.removeBlock(n,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,n=this.groupCache[parseInt(i.toString(),10)],r=e.getAttribute("data-uid"),s=this.getRowObjectIndexByUid(r),o=s,a=n[parseInt(s.toString(),10)],l=this.getRowByUid(a.parentUid),d=this.getRowObjectIndexByUid(l.uid),h=this.getRowElementByUid(l.uid).rowIndex,p=this.getChildRowsByParentIndex(d);if(0!==p.length){var c=p.indexOf(a),u=Math.ceil(c/this.pageSize);if(this.childCount=u*this.pageSize,!t.isNullOrUndefined(p[this.childCount-1])){this.parent.enableVirtualization&&(this.parent.islazyloadRequest=!0),s=this.rowObjectIndex=this.getRowObjectIndexByUid(p[this.childCount-1].uid);var g=n[parseInt(s.toString(),10)],f=this.getRowElementByUid(g.uid);if(this.rowIndex=f.rowIndex,s=this.getCurrentBlockEndIndex(g,s),this.childCount===l.data.count&&(this.parent.islazyloadRequest=!1),this.childCount<l.data.count){var m=!!n[s+1]&&a.indent===n[s+1].indent;if(m&&!t.isNullOrUndefined(this.getRowElementByUid(n[s+1].uid)))return this.parent.islazyloadRequest=!1,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=wt(d,n),v={rowIndex:h,makeRequest:!m,groupInfo:l,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){this.isScrollDown=!0;var S=this.getChildRowsByParentIndex(d),C=Math.ceil(S.indexOf(n[parseInt(o.toString(),10)])/this.pageSize)-1-(this.cacheBlockSize-1)+1;this.removeBlock(r,m,C,S,g),v.cachedRowIndex=C*this.pageSize}this.captionRowExpand(v)}else this.childCount=0,this.parent.islazyloadRequest=!1}}},i.prototype.getCurrentBlockEndIndex=function(e,t){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)];if(e.isCaptionRow){if(e.isExpand){var r=this.getChildRowsByParentIndex(t,!0).length;this.rowIndex=this.rowIndex+r}var s=this.getAggregateByCaptionIndex(t);this.rowObjectIndex=this.rowObjectIndex+s.length;for(var o=t,a=o+1;a<n.length;a++){if(n[parseInt(a.toString(),10)].indent===n[parseInt(t.toString(),10)].indent||n[parseInt(a.toString(),10)].indent<n[parseInt(t.toString(),10)].indent){t=o;break}o++}}return t},i.prototype.removeBlock=function(e,t,i,n,r){var s=this.parent.pageSettings.currentPage,o=this.groupCache[parseInt(s.toString(),10)],a=n[(i+1)*this.pageSize-1-this.blockSize].uid,l=n[i*this.pageSize-this.pageSize].uid,d=n[i*this.pageSize].uid,h=this.getRowObjectIndexByUid(a);o[parseInt(h.toString(),10)].lazyLoadCssClass="e-lazyload-middle-up",this.getRowElementByUid(a).classList.add("e-lazyload-middle-up"),r&&(this.getRowElementByUid(d).classList.add("e-not-lazyload-first"),this.getRowByUid(d).lazyLoadCssClass="e-not-lazyload-first",this.getRowByUid(l).lazyLoadCssClass=""),t?this.removeTopRows(r?r.uid:e,l,d):(this.uid1=l,this.uid2=d,this.uid3=r?r.uid:e)},i.prototype.scrollUpHandler=function(e){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)],r=e.getAttribute("data-uid"),s=this.getRowByUid(r),o=this.rowObjectIndex=this.getRowObjectIndexByUid(r),a=this.getRowByUid(s.parentUid),l=this.rowIndex=this.getRowObjectIndexByUid(a.uid),d=this.parent.getRowElementByUID(a.uid).rowIndex,h=this.getChildRowsByParentIndex(l),p=h.indexOf(n[parseInt(o.toString(),10)]),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=h[p-(u-1)-this.pageSize].uid,f=h[p-(u-1)].uid;this.scrollData=this.getCacheRowsOnUpScroll(g,f,o-(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(h.length!==a.data.count&&m*this.pageSize>h.length)return this.isFirstChildRow=!1,this.scrollData[0].lazyLoadCssClass="",void this.getRowElementByUid(f).classList.add("e-not-lazyload-first");var y=m*this.pageSize>a.data.count?a.data.count:m*this.pageSize,v=m*this.pageSize>a.data.count?this.pageSize-(this.pageSize*m-a.data.count):this.pageSize,S=this.getChildRowsByParentIndex(n.indexOf(h[y-1]),!0,!1,null,!0),C=S.length?S[S.length-1].uid:h[y-1].uid,w=h[y-v].uid,b=h[y-v-1].uid,I=this.objIdxByUid[parseInt(i.toString(),10)][""+w]-u;if("e-lazyload-middle-down"===n[parseInt(I.toString(),10)].lazyLoadCssClass){var x=this.getRowElementByUid(n[parseInt(I.toString(),10)].uid);x&&x.classList.add("e-lazyload-middle-down")}if(this.getRowByUid(C).lazyLoadCssClass="",this.getRowByUid(b).lazyLoadCssClass="e-not-lazyload-end",this.getRowElementByUid(b).classList.add("e-not-lazyload-end"),this.removeBottomRows(C,w,b),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 R=wt(this.getRowObjectIndexByUid(a.uid),n),D={rowIndex:d,makeRequest:!1,groupInfo:a,fields:R.fields,keys:R.keys,skip:this.childCount,take:this.pageSize,isScroll:!0,scrollUp:!0};this.isScrollUp=!0,this.captionRowExpand(D)},i.prototype.findRowElements=function(e){for(var t,i=!1,n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)].rowIndex;if(this.parent.enableVirtualization){var s=this.parent.contentModule.currentInfo;s&&s.blockIndexes&&s.blockIndexes[0]>1&&(r+=this.parent.contentModule.offsets[s.blockIndexes[0]-1]/this.parent.getRowHeight())}if(Fe(r,this.parent)){i=!0,this.rowIndex=r,t=e[parseInt(n.toString(),10)];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,n){for(var r=[].slice.call(this.parent.getContent().querySelectorAll("tr")),s=!1,o=0;o<r.length;o++){if(r[parseInt(o.toString(),10)].getAttribute("data-uid")===n){var a=this.parent.getContent().querySelector("tr[data-uid="+e+"]");a&&(this.rowIndex=a.rowIndex);break}r[parseInt(o.toString(),10)].getAttribute("data-uid")===i&&(s=!0),s&&t.remove(r[parseInt(o.toString(),10)])}},i.prototype.removeBottomRows=function(e,i,n){for(var r=[].slice.call(this.parent.getContent().querySelectorAll("tr")),s=!1,o=0;o<r.length&&(r[parseInt(o.toString(),10)].getAttribute("data-uid")===i&&(s=!0),!s||(t.remove(r[parseInt(o.toString(),10)]),r[parseInt(o.toString(),10)].getAttribute("data-uid")!==e));o++);},i.prototype.setCache=function(e){var i=this.parent.pageSettings.currentPage;if(this.parent.enableVirtualization&&(this.parent.lazyLoadRender=this),this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType&&e.args.prevPage!==e.args.currentPage){this.groupCache[parseInt(i.toString(),10)]=this.initialGroupCaptions[parseInt(i.toString(),10)]=this.groupCache[e.args.prevPage].concat(t.extend([],e.data));for(var n=Object.keys(this.groupCache),r=0;r<n.length;r++)e.args.currentPage!==parseInt(n[parseInt(r.toString(),10)],10)&&(delete this.groupCache[""+n[parseInt(r.toString(),10)]],delete this.initialGroupCaptions[""+n[parseInt(r.toString(),10)]])}else this.groupCache[parseInt(i.toString(),10)]=this.initialGroupCaptions[parseInt(i.toString(),10)]=t.extend([],e.data)},i.prototype.captionRowExpand=function(e){var t=this,i=e.groupInfo,n=this.parent.groupSettings.columns.indexOf(i.data.field)+1,r=Ct(St(e.fields,e.keys,this)),s={level:n,skip:e.skip,take:e.take,where:r};if(e.lazyLoadQuery=s,e.requestType="onDemandGroupInfo",e.makeRequest){var o=this.parent.renderModule.data.generateQuery(!0);o.isCountRequired||(o.isCountRequired=!0),o.lazyLoad.push({key:"onDemandGroupInfo",value:s}),this.lazyLoadQuery.push(s.where),e.isScroll&&this.parent.enableVirtualMaskRow?this.parent.showMaskRow():this.parent.showSpinner(),this.parent.renderModule.data.getData(e,o).then(function(i){if(t.parent.enableVirtualization&&(t.parent.islazyloadRequest=!0),t.parent.hideSpinner(),t.parent.removeMaskRow(),0!==i.result.length){var r=0===e.skip?e.groupInfo&&e.groupInfo.data&&e.groupInfo.data.startIndex:t.parent.groupSettings.columns.length===e.keys.length?e.skip+e.groupInfo.data.startIndex:t.startIndex;if(t.parent.groupSettings&&t.parent.groupSettings.columns.length!==e.keys.length)for(var s=0;s<i.result.length;s++)i.result[parseInt(s.toString(),10)].startIndex=r,r+=i.result[parseInt(s.toString(),10)].count;t.startIndex=r,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:n,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:n,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=[];if(this.getRows().filter(function(t){t.isDataRow&&(e[t.index]=t.data)}),this.parent.isRemote()){var t=this.parent.getHeaderContent().querySelector(".e-checkselectall");t&&(e.length||this.getAllPagesData().length?t.parentElement.classList.remove("e-checkbox-disabled"):this.parent.selectionModule&&!this.parent.selectionModule.selectedRowIndexes.length&&t.parentElement.classList.add("e-checkbox-disabled"))}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().getElementsByClassName(Zi))},i.prototype.getRowByIndex=function(e){for(var i,n=[].slice.call(this.parent.getContent().getElementsByClassName(Zi)),r=0;!t.isNullOrUndefined(e)&&r<n.length;r++){var s=parseInt(n[parseInt(r.toString(),10)].getAttribute(an),10);if(s&&s-1===e){i=n[parseInt(r.toString(),10)];break}}return i},i.prototype.setVisible=function(e){var i,n=this.parent;this.getRows().some(function(e){return e.isDataRow&&(i=e),e.isDataRow});for(var r=this.getRows().filter(function(e){return!e.isDetailRow}),s=0;s<e.length;s++){var o=e[parseInt(s.toString(),10)],a=this.parent.getNormalizedColumnIndex(o.uid),l=this.parent.getColumnIndexByUid(o.uid),d=!0===o.visible?"":"none",h=this.getColGroup();-1!==a&&i&&a<i.cells.length&&!t.isNullOrUndefined(h)&&t.setStyleAttribute(h.childNodes[parseInt(a.toString(),10)],{display:d}),this.setDisplayNone(n.getDataRows(),l,d,r,a),!this.parent.invokedFromMedia&&o.hideAtMedia&&this.parent.updateMediaColumns(o),this.parent.invokedFromMedia=!1}},i.prototype.setDisplayNone=function(e,i,n,r,s){if(this.parent.groupSettings.columns.length){var o=!1;if(this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.vgenerator){for(var a=this.parent.contentModule.vgenerator.cache,l=Object.keys(a),d=this.parent.getVisibleColumns().length,h=0;h<l.length;h++)for(var p=a[l[parseInt(h.toString(),10)]],c=0;c<p.length;c++){var u=p[parseInt(c.toString(),10)];u.isCaptionRow&&(u.cells[u.indent+1].colSpan=this.parent.enableColumnVirtualization?1:d+this.parent.groupSettings.columns.length+(this.parent.detailTemplate||this.parent.childGrid?1:0)-u.indent+(d?-1:0)),u.isDataRow&&(u.cells[parseInt(s.toString(),10)].visible=""===n)}o=!0}for(var g=Object.keys(this.groupCache),f=0;f<g.length;f++){var m=this.rowsByUid[g[parseInt(f.toString(),10)]];if(!t.isNullOrUndefined(m))for(var y=Object.keys(m),h=0;h<y.length;h++){var v=this.parent.getContent().querySelector("tr[data-uid="+y[parseInt(h.toString(),10)]+"]"),S=m[y[parseInt(h.toString(),10)]];S.isCaptionRow&&(this.captionModelGen.isEmpty()?(o||(S.cells[S.indent+1].colSpan=""===n?S.cells[S.indent+1].colSpan+1:S.cells[S.indent+1].colSpan-1),v&&(v.cells[S.indent+1].colSpan=S.cells[S.indent+1].colSpan)):this.changeCaptionRow(S,v,g[parseInt(f.toString(),10)])),S.isDataRow&&(this.showAndHideCells(v,i,n,!1),S.cells[parseInt(s.toString(),10)].visible=""===n),S.isCaptionRow||S.isDataRow||!t.isNullOrUndefined(S.indent)||(S.cells[parseInt(s.toString(),10)].visible=""===n,S.visible=S.cells.some(function(e){return e.isDataCell&&e.visible}),this.showAndHideCells(v,i,n,!0,S))}}}else ot(e,i,n,r)},i.prototype.changeCaptionRow=function(e,t,i){var n=e,r=e.data,s=this.groupGenerator.generateCaptionRow(r,n.indent,n.parentGid,void 0,n.tIndex,n.parentUid);s.uid=e.uid,s.isExpand=e.isExpand,s.lazyLoadCssClass=e.lazyLoadCssClass,this.rowsByUid[parseInt(i.toString(),10)][e.uid]=s,this.groupCache[parseInt(i.toString(),10)][this.objIdxByUid[parseInt(i.toString(),10)][e.uid]]=s,t&&this.parent.getContentTable().querySelector(ln).replaceChild(this.rowRenderer.render(s,this.parent.getColumns()),t)},i.prototype.showAndHideCells=function(e,i,n,r,s){if(e){var o=r?"td.e-summarycell":"td.e-rowcell";t.setStyleAttribute(e.querySelectorAll(o)[parseInt(i.toString(),10)],{display:n}),e.querySelectorAll(o)[parseInt(i.toString(),10)].classList.contains("e-hide")&&t.removeClass([e.querySelectorAll(o)[parseInt(i.toString(),10)]],["e-hide"]),r&&(s.visible&&e.classList.contains("e-hide")?t.removeClass([e],["e-hide"]):s.visible||t.addClass([e],["e-hide"]))}},i.prototype.getAllPagesData=function(){for(var e=[],t=Object.keys(this.groupCache),i=0;i<t.length;i++){var n=parseInt(t[parseInt(i.toString(),10)],10),r=this.groupCache[parseInt(n.toString(),10)];r&&r.length&&e.push.apply(e,r.filter(function(e){return e.isDataRow}).map(function(e){return e.data}))}return e},i}(In),ko=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(Yt,this.instantiateRenderer,this),this.parent.on(pi,this.destroy,this))},t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Yt,this.instantiateRenderer),this.parent.off(pi,this.destroy))},t.prototype.instantiateRenderer=function(){"auto"===this.parent.height&&(this.parent.height=this.parent.pageSettings.pageSize*this.parent.getRowHeight());var t=this.serviceLocator.getService("rendererFactory"),i=null;this.parent.groupSettings.enableLazyLoading&&(i=new Oo(this.parent,this.serviceLocator),t.addRenderer(e.RenderType.Content,i)),this.parent.enableVirtualization&&(this.parent.lazyLoadRender=i)},t.prototype.destroy=function(){this.removeEventListener()},t}(),Ao=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fo=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ao(n,e),n.prototype.write=function(e){this.column=e.column;var n="Dialog"!==this.parent.editSettings.mode;this.object=new o.AutoComplete(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),enabled:X(e.column,e.requestType,e.element),fields:{value:e.column.field},value:fe(e.column.field,e.rowData),actionComplete:this.selectedValues.bind(this),placeholder:n?"":e.column.headerText,floatLabelType:n?"Never":"Always"},e.column.edit.params)),this.object.appendTo(e.element),e.element.setAttribute("name",K(e.column.field))},n.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)},n}(Ws),Mo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Lo=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Mo(n,e),n.prototype.write=function(e){this.column=e.column;var n="Dialog"!==this.parent.editSettings.mode;this.obj=new o.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:fe(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.finalValue.bind(this),placeholder:n?"":e.column.headerText,floatLabelType:n?"Never":"Always",enabled:X(e.column,e.requestType,e.element),cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.edit.params)),this.obj.appendTo(e.element)},n.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)},n}(Ws),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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),No=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Po(i,e),i.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parent.editSettings.mode;this.obj=new o.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",cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.edit.params)),this.obj.appendTo(e.element),e.element.setAttribute("name",K(e.column.field))},i}(Ws),Bo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Bo(i,e),i.prototype.write=function(e){var i="Dialog"!==this.parent.editSettings.mode,n=fe(e.column.field,e.rowData);n=n?new Date(n):null,this.obj=new a.TimePicker(t.extend({floatLabelType:i?"Never":"Always",value:n,placeholder:i?"":e.column.headerText,enableRtl:this.parent.enableRtl,enabled:X(e.column,e.requestType,e.element)&&Y(F(e.element,"e-rowcell"),this.parent),cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.edit.params)),this.obj.appendTo(e.element)},i}(Ws),qo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Uo=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.activeClasses=["e-selectionbackground","e-active"],t}return qo(i,e),i.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),lt(this.parent,e.column,t,{type:"checkbox",value:e.value})},i.prototype.read=function(e){return e.checked},i.prototype.write=function(e){var i=!t.isNullOrUndefined(e.row)&&e.row.querySelector(".e-edit-checkselect"),n=fe(e.column.field,e.rowData),s=n&&JSON.parse(n.toString().toLowerCase());if(!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"));s=!!o&&o.isSelected}ee.apply(void 0,[[].slice.call(e.row.getElementsByClassName(_i)),s].concat(this.activeClasses))}this.obj=new r.Switch(t.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:s,disabled:!X(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.switchModeChange.bind(this),cssClass:this.parent.cssClass?this.parent.cssClass:""},e.column.edit.params)),this.obj.appendTo(e.element)},i.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"),ee.apply(void 0,[[].slice.call(this.editRow.getElementsByClassName(_i)),t].concat(this.activeClasses))}},i}(Ws),Ho=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),jo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ho(i,e),i.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parent.editSettings.mode;this.obj=new s.MaskedTextBox(t.extend({fields:{value:e.column.field},value:fe(e.column.field,e.rowData),floatLabelType:i?"Never":"Always",mask:"000-000-0000",enabled:X(e.column,e.requestType,e.element)&&Y(F(e.element,"e-rowcell"),this.parent),cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.edit.params)),this.obj.appendTo(e.element)},i}(Ws);return Wr.Inject(Is,hs,ur,is,Es,Ds,Ts,Os,ks,Ps,gr,js,po,Rs,mo,yo,Co,bo,Io,xo,uo,Do,To,ko),e.Aggregate=Ps,e.AutoCompleteEditCell=Fo,e.BatchEdit=ro,e.BatchEditRender=Gs,e.BooleanEditCell=Xs,e.BooleanFilterUI=ys,e.Cell=Vi,e.CellRenderer=Rn,e.CellRendererFactory=Yn,e.CheckBoxFilter=Cs,e.CheckBoxFilterBase=$r,e.Clipboard=wr,e.Column=Pt,e.ColumnChooser=uo,e.ColumnMenu=xo,e.ComboboxEditCell=Lo,e.CommandColumn=Co,e.CommandColumnModel=Nt,e.CommandColumnRenderer=So,e.ContentRender=In,e.ContextMenu=bo,e.Data=Hi,e.DateFilterUI=vs,e.DatePickerEditCell=lo,e.DefaultEditCell=eo,e.DetailRow=Os,e.DialogEdit=oo,e.DialogEditRender=_s,e.DropDownEditCell=Js,e.Edit=po,e.EditCellBase=Ws,e.EditRender=Ks,e.EditSettings=_r,e.ExcelExport=mo,e.ExcelFilter=bs,e.ExcelFilterBase=ts,e.ExportHelper=go,e.ExportValueFormatter=fo,e.ExternalMessage=ds,e.Filter=Is,e.FilterCellRenderer=us,e.FilterSettings=zr,e.FlMenuOptrUI=gs,e.ForeignKey=Do,e.Freeze=Io,e.Grid=Wr,e.GridColumn=Bt,e.Group=Es,e.GroupCaptionCellRenderer=Pn,e.GroupCaptionEmptyCellRenderer=Nn,e.GroupLazyLoadRenderer=Oo,e.GroupModelGenerator=bn,e.GroupSettings=Gr,e.HeaderCellRenderer=On,e.HeaderRender=xn,e.IndentCellRenderer=Mn,e.InfiniteScroll=To,e.InfiniteScrollSettings=Br,e.InlineEdit=no,e.InlineEditRender=Vs,e.InterSectionObserver=Ns,e.LazyLoadGroup=ko,e.LoadingIndicator=Kr,e.Logger=Tr,e.MaskedTextBoxCellEdit=jo,e.MultiSelectEditCell=No,e.NormalEdit=to,e.NumberFilterUI=ms,e.NumericContainer=ns,e.NumericEditCell=Zs,e.Page=hs,e.Pager=as,e.PagerDropDown=ls,e.PagerMessage=rs,e.PdfExport=yo,e.Predicate=Nr,e.Print=Qr,e.Render=Xn,e.Reorder=Ds,e.Resize=Rs,e.ResizeSettings=Vr,e.ResponsiveDialogRenderer=Jn,e.Row=ji,e.RowDD=Ts,e.RowDropSettings=Hr,e.RowModelGenerator=mn,e.RowRenderer=fn,e.Scroll=mr,e.Search=gr,e.SearchSettings=Ur,e.Selection=ur,e.SelectionSettings=qr,e.ServiceLocator=Zn,e.Sort=is,e.SortDescriptor=Lr,e.SortSettings=Pr,e.StackedColumn=zt,e.StackedHeaderCellRenderer=An,e.StringFilterUI=fs,e.TextWrapSettings=jr,e.TimePickerEditCell=zo,e.ToggleEditCell=Uo,e.Toolbar=ks,e.ValueFormatter=Ft,e.VirtualContentRenderer=qs,e.VirtualElementHandler=Hs,e.VirtualHeaderRenderer=Us,e.VirtualRowModelGenerator=Bs,e.VirtualScroll=js,e.accessPredicate="access-predicate",e.actionBegin=qt,e.actionComplete=Ut,e.actionFailure=Ht,e.addBegin="add-begin",e.addBiggerDialog=rt,e.addComplete="add-complete",e.addDeleteAction=xi,e.addFixedColumnBorder=Xe,e.addRemoveActiveClasses=ee,e.addRemoveEventListener=at,e.addStickyColumnPosition=$e,e.addedRecords="addedRecords",e.addedRow=tn,e.afterContentRender="after-content-renderer",e.afterFilterColumnMenuClose="after-filter-column-menu-close",e.appendChildren=q,e.appendInfiniteContent="append-infinite-content",e.applyBiggerTheme=Re,e.applyStickyLeftRightPosition=Ye,e.ariaColIndex=on,e.ariaRowIndex=an,e.autoCol=Ci,e.batchAdd="batchAdd",e.batchCancel="batchCancel",e.batchCnfrmDlgCancel="cancelcnfrmDlg",e.batchDelete="batchDelete",e.batchEditFormRendered="batcheditform-rendered",e.batchForm="batchedit-form",e.beforeAutoFill="beforeAutoFill",e.beforeBatchAdd="beforeBatchAdd",e.beforeBatchCancel="before-batch-cancel",e.beforeBatchDelete="beforeBatchDelete",e.beforeBatchSave="beforeBatchSave",e.beforeCellFocused=li,e.beforeCheckboxRenderer="beforeCheckboxRenderer",e.beforeCheckboxRendererQuery="before-checkbox-renderer-query",e.beforeCheckboxfilterRenderer="beforeCheckboxfilterRenderer",e.beforeCopy="beforeCopy",e.beforeCustomFilterOpen="beforeCustomFilterOpen",e.beforeDataBound="beforeDataBound",e.beforeDetailTemplateDetach="beforeDetailTemplateDetach",e.beforeExcelExport="beforeExcelExport",e.beforeFltrcMenuOpen="before-filter-cmenu-open",e.beforeFragAppend="beforeFragAppend",e.beforeOpen="beforeOpen",e.beforeOpenAdaptiveDialog="beforeOpenAdaptiveDialog",e.beforeOpenColumnChooser="beforeOpenColumnChooser",e.beforePaste="beforePaste",e.beforePdfExport="beforePdfExport",e.beforePrint="beforePrint",e.beforeRefreshOnDataChange="before-refresh-on-data-change",e.beforeSetPartialRecords="beforeSetPartialRecords",e.beforeStartEdit="edit-form",e.beginEdit="beginEdit",e.bulkSave="bulk-save",e.cBoxFltrBegin="cbox-filter-begin",e.cBoxFltrComplete=Ai,e.calculateAggregate=H,e.cancelBegin=Ti,e.capitalizeFirstLetter=It,e.captionActionComplete="infinite-group-collapse",e.cellDeselected="cellDeselected",e.cellDeselecting="cellDeselecting",e.cellEdit="cellEdit",e.cellFocused="cellfocused",e.cellSave="cellSave",e.cellSaved="cellSaved",e.cellSelected="cellSelected",e.cellSelecting="cellSelecting",e.cellSelectionBegin="cellselecting",e.cellSelectionComplete="cellselected",e.change="change",e.changedRecords="changedRecords",e.checkBoxChange="checkBoxChange",e.checkDepth=be,e.checkIsVirtual=xt,e.checkScrollReset="check-scroll-reset",e.clearReactVueTemplates=ut,e.click=hi,e.closeBatch="closebatch",e.closeEdit="close-edit",e.closeFilterDialog="close-filter-dialog",e.closeInline="closeinline",e.colGroup=dn,e.colGroupRefresh=ri,e.columnChooserCancelBtnClick="columnChooserCancelBtnClick",e.columnChooserClose="columnChooserClose",e.columnChooserOpened="columnChooserOpened",e.columnChooserSearch="columnChooserSearch",e.columnChooserUpdate="columnChooserUpdate",e.columnDataStateChange="columnDataStateChange",e.columnDeselected="columnDeselected",e.columnDeselecting="columnDeselecting",e.columnDrag=Gt,e.columnDragStart=Vt,e.columnDragStop=mi,e.columnDrop=_t,e.columnMenuClick="columnMenuClick",e.columnMenuClose="columnMenuClose",e.columnMenuOpen="columnMenuOpen",e.columnPositionChanged=ui,e.columnSelected="columnSelected",e.columnSelecting="columnSelecting",e.columnSelectionBegin="columnselecting",e.columnSelectionComplete="columnselected",e.columnVisibilityChanged=ci,e.columnWidthChanged="column-width-changed",e.columnsPrepared=ki,e.commandClick="commandClick",e.commandColumnDestroy=Ni,e.compareChanges=Ue,e.componentRendered="component-rendered",e.content=Yi,e.contentReady=$t,e.contextMenuClick="contextMenuClick",e.contextMenuClose="contextMenuClose",e.contextMenuOpen="contextMenuOpen",e.create="created",e.createCboxWithWrap=ae,e.createEditElement=lt,e.createVirtualValidationForm="create-virtual-validation-form",e.created="create",e.crudAction="crud-Action",e.customFilterClose="custom-filter-close",e.customFilterOpen="customFilterOpen",e.dataBound=jt,e.dataReady=Zt,e.dataSourceChanged="dataSourceChanged",e.dataSourceModified=vi,e.dataStateChange="dataStateChange",e.dblclick="dblclick",e.deleteBegin="delete-begin",e.deleteComplete="delete-complete",e.deletedRecords="deletedRecords",e.destroy=pi,e.destroyAutoFillElements="destroy-autofill-elements",e.destroyChildGrid="destroy-child-grid",e.destroyEditForm="destroy-edit-form",e.destroyForm="destroy-form",e.destroyed="destroy",e.detachDetailTemplate="detach-detail-template",e.detailCollapse="detailCollapse",e.detailDataBound="detailDataBound",e.detailExpand="detailExpand",e.detailIndentCellInfo="detail-indentcell-info",e.detailLists=Er,e.detailStateChange="detail-state-change",e.dialogDestroy=Ii,e.distinctStringValues=te,e.doesImplementInterface=u,e.doubleTap="double-tap",e.downArrow=pn,e.editBegin="edit-begin",e.editComplete="edit-complete",e.editNextValCell="editNextValCell",e.editReset="edit-reset",e.editedRow=en,e.endAdd="endAdd",e.endDelete="endDelete",e.endEdit="endEdit",e.ensureFirstRow=Ae,e.ensureLastRow=ke,e.enter=un,e.enterKeyHandler="enter-key-handler",e.eventPromise=Le,e.excelAggregateQueryCellInfo="excelAggregateQueryCellInfo",e.excelExportComplete="excelExportComplete",e.excelHeaderQueryCellInfo="excelHeaderQueryCellInfo",e.excelQueryCellInfo="excelQueryCellInfo",e.expandChildGrid="expandchildgrid",e.exportDataBound="export-DataBound",e.exportDetailDataBound="exportDetailDataBound",e.exportDetailTemplate="exportDetailTemplate",e.exportGroupCaption="exportGroupCaption",e.exportRowDataBound="export-RowDataBound",e.extend=D,e.extendObjWithFn=Se,e.filterAfterOpen="filterAfterOpen",e.filterBeforeOpen="filterBeforeOpen",e.filterBegin="filtering-begin",e.filterCboxValue="filter-cbox-value",e.filterChoiceRequest="filterchoicerequest",e.filterCmenuSelect="filter-cmenu-select",e.filterComplete="filtering-complete",e.filterDialogClose="filter-dialog-close",e.filterDialogCreated="filterDialogCreated",e.filterMenuClose=Di,e.filterOpen="filterOpen",e.filterSearchBegin="filterSearchBegin",e.findCellIndex=bt,e.fltrPrevent=Fi,e.focus="focus",e.foreignKeyData="foreignKeyData",e.freezeRefresh="freezerefresh",e.freezeRender=Ri,e.frozenContent="e-frozencontent",e.frozenDirection=Qe,e.frozenHeader="e-frozenheader",e.frozenHeight="frozenHeight",e.frozenLeft=sn,e.frozenRight=rn,e.generateExpandPredicates=St,e.generateQuery="generateQuery",e.getActualPropFromColl=P,e.getActualProperties=A,e.getActualRowHeight=G,e.getAggregateQuery="get-aggregate-query",e.getCellByColAndRowIndex=tt,e.getCellFromRow=Ze,e.getCellsByTableName=et,e.getCloneProperties=c,e.getCollapsedRowsCount=C,e.getColumnByForeignKeyValue=pe,e.getColumnModelByFieldName=ht,e.getColumnModelByUid=dt,e.getColumnWidth=Oe,e.getComplexFieldID=K,e.getCustomDateFormat=me,e.getDatePredicate=ue,e.getEditedDataIndex=Me,e.getElementIndex=M,e.getExpandedState=ye,e.getFilterBarOperator="get-filterbar-operator",e.getFilterMenuPostion=ie,e.getForeignData=he,e.getForeignKeyData="getForeignKeyData",e.getGroupKeysAndFields=wt,e.getListHeight=mt,e.getNumberFormat=nt,e.getObject=fe,e.getParentIns=vt,e.getParsedFieldID=W,e.getPosition=B,e.getPredicates=Ct,e.getPrintGridModel=ve,e.getPrototypesOfObj=Ce,e.getRowHeight=V,e.getRowIndexFromElement=yt,e.getScrollBarWidth=j,e.getScrollWidth=De,e.getSerachFilteredData=Dt,e.getStateEventArgument=Pe,e.getTransformValues=xe,e.getUid=z,e.getUpdateUsingRaf=m,e.getVirtualData="get-virtual-data",e.getVisiblePage=Rt,e.getZIndexCalcualtion=ne,e.gridChkBox=$i,e.gridContent=Wi,e.gridFooter=Qi,e.gridHeader=Ki,e.groupAggregates="group-aggregates",e.groupBegin="grouping-begin",e.groupCaptionRow="e-groupcaptionrow",e.groupCaptionRowLeftRightPos=Ee,e.groupCollapse="group-collapse",e.groupComplete="grouping-complete",e.groupReorderRowObject=qe,e.headerCellInfo="headerCellInfo",e.headerContent=Xi,e.headerDrop=yi,e.headerRefreshed=si,e.headerValueAccessor=f,e.hierarchyPrint=Ei,e.immutableBatchCancel="immutable-batch-cancel",e.inArray=L,e.inBoundModelChanged=ii,e.infiniteAppendElements=ft,e.infiniteCrudCancel="infinite-crud-cancel",e.infiniteEditHandler="infinite-edit-handler",e.infinitePageQuery="infinite-page-query",e.infiniteRemoveElements=gt,e.infiniteScrollComplete="infinitescroll-complete",e.infiniteScrollHandler="infinite-scroll-handler",e.infiniteShowHide="infinite-show-hide",e.initForeignKeyColumn="initForeignKeyColumn",e.initialCollapse="initial-collapse",e.initialEnd=Jt,e.initialFrozenColumnIndex="initialFrozenColumnIndex",e.initialLoad=Yt,e.isActionPrevent=J,e.isAngularMatContainer=Ge,e.isCellHaveWidth=Y,e.isChildColumn=Ke,e.isComplexField=_,e.isEditable=X,e.isEnableSeamlessScrolling=Tt,e.isExportColumns=y,e.isGroupAdaptive=ge,e.isMatDialogContainer=Ve,e.isRowEnteredInGrid=Fe,e.isRowPinned="isRowPinned",e.ispercentageWidth=Ne,e.iterateArrayOrObject=b,e.iterateExtend=I,e.keyPressed=di,e.lastRowCellBorderUpdated="last-rowcell-border-updated",e.lazyLoadGroupCollapse="lazyLoadGroupCollapse",e.lazyLoadGroupExpand="lazyLoadGroupExpand",e.lazyLoadScrollHandler="lazy-load-scroll-handler",e.leftRight=nn,e.load="load",e.measureColumnDepth=we,e.menuClass=wo,e.modelChanged=ni,e.movableContent="e-movablecontent",e.movableHeader="e-movableheader",e.nextCellIndex="next-cell-index",e.onEmpty=ti,e.onResize="resizing",e.open=hn,e.padZero=ce,e.pageBegin="paging-begin",e.pageComplete="paging-complete",e.pageDown="PageDown",e.pageUp="PageUp",e.pagerRefresh="pager-refresh",e.parents=U,e.parentsUntil=F,e.partialRefresh="partial-refresh",e.pdfAggregateQueryCellInfo="pdfAggregateQueryCellInfo",e.pdfExportComplete="pdfExportComplete",e.pdfHeaderQueryCellInfo="pdfHeaderQueryCellInfo",e.pdfQueryCellInfo="pdfQueryCellInfo",e.performComplexDataOperation=st,e.prepareColumns=E,e.preventBatch=bi,e.preventFrozenScrollRefresh="prevent-frozen-scroll-refresh",e.printComplete="printComplete",e.printGridInit="printGrid-Init",e.pushuid=We,e.queryCellInfo="queryCellInfo",e.recordAdded="recordAdded",e.recordClick="recordClick",e.recordDoubleClick="recordDoubleClick",e.recursive=w,e.refreshAggregateCell="refresh-aggregate-cell",e.refreshAggregateComplete="refresh-aggregate-on-save-complete",e.refreshAggregates="refresh-aggregates",e.refreshComplete="refresh-complete",e.refreshCustomFilterClearBtn="refresh-cutsom-filter-clear-button",e.refreshCustomFilterOkBtn=Pi,e.refreshExpandandCollapse="refresh-Expand-and-Collapse",e.refreshFilteredColsUid=Ie,e.refreshFooterRenderer="refresh-footer-rendered",e.refreshForeignData=de,e.refreshFrozenColumns="refresh-frozen-columns",e.refreshFrozenHeight="refresh-frozen-height",e.refreshFrozenPosition="refresh-Frozen-Position",e.refreshHandlers=Li,e.refreshInfiniteCurrentViewData="refresh-infinite-current-view-data",e.refreshInfiniteEditrowindex="refresh-infinite-editrowindex",e.refreshInfiniteModeBlocks=Mi,e.refreshInfinitePersistSelection="refresh-infinite-persist-selection",e.refreshResizePosition="refresh-Resize-Position",e.refreshSplitFrozenColumn="refresh-Split-Frozen-Column",e.refreshVirtualBlock=Si,e.refreshVirtualCache="refresh-virtual-cache",e.refreshVirtualEditFormCells="refresh-virtual-editform-cells",e.refreshVirtualFrozenHeight="refresh-virtual-frozen-height",e.refreshVirtualFrozenRows="refresh-virtual-frozenrows",e.refreshVirtualLazyLoadCache="refresh-Virtual-LazyLoad-Cache",e.refreshVirtualMaxPage="refresh-virtual-max-page",e.registerEventHandlers=pt,e.removeAddCboxClasses=le,e.removeElement=N,e.removeEventHandlers=ct,e.removeInfiniteRows="remove-infinite-rows",e.renderResponsiveChangeAction=Bi,e.renderResponsiveCmenu="render-responsive-cmenu",e.renderResponsiveColumnChooserDiv="render-Responsive-Column-Chooser-Div",e.reorderBegin="reorder-begin",e.reorderComplete=oi,e.resetCachedRowIndex=ze,e.resetColandRowSpanStickyPosition=Je,e.resetColspanGroupCaption=Te,e.resetColumns="reset-columns",e.resetDialogAppend=_e,e.resetInfiniteBlocks="reset-infinite-blocks",e.resetRowIndex=Be,e.resetVirtualFocus="reset-virtual-focus",e.resizeClassList=xs,e.resizeStart="resizeStart",e.resizeStop="resizeStop",e.restoreFocus="restore-Focus",e.row=Zi,e.rowCell=_i,e.rowDataBound="rowDataBound",e.rowDeselected="rowDeselected",e.rowDeselecting="rowDeselecting",e.rowDrag=Qt,e.rowDragAndDrop="row-drag-and-drop",e.rowDragAndDropBegin="rowdraganddrop-begin",e.rowDragAndDropComplete=ai,e.rowDragStart=Wt,e.rowDragStartHelper=Kt,e.rowDrop=Xt,e.rowModeChange="row-mode-change",e.rowPositionChanged=Oi,e.rowSelected="rowSelected",e.rowSelecting="rowSelecting",e.rowSelectionBegin="rowselecting",e.rowSelectionComplete="rowselected",e.rowsAdded=gi,e.rowsRemoved=fi,e.rtlUpdated="rtl-updated",e.saveComplete="save-complete",e.scroll="scroll",e.scrollToEdit="scroll-to-edit",e.searchBegin="searching-begin",e.searchComplete="searching-complete",e.selectRowOnContextOpen="select-row-on-context-open",e.selectVirtualRow="select-virtual-Row",e.setChecked=oe,e.setColumnIndex=T,e.setComplexFieldID=Q,e.setCssInGridPopUp=O,e.setDisplayValue=ot,e.setEnableSeamlessScrolling=Et,e.setFormatter=$,e.setFreezeSelection="set-freeze-selection",e.setFullScreenDialog="set-fullscreen-dialog",e.setGroupCache="group-cache",e.setHeightToFrozenElement="set-height-to-frozen-element",e.setInfiniteCache="set-infinite-cache",e.setInfiniteColFrozenHeight="set-infinite-col-frozen-height",e.setInfiniteFrozenHeight="set-infinite-frozen-height",e.setReorderDestinationElement="set-reorder-destination-element",e.setRowElements=He,e.setStyleAndAttributes=R,e.setValidationRuels=it,e.setVirtualPageQuery="set-virtual-page-query",e.shiftEnter=gn,e.shiftTab="shiftTab",e.showAddNewRowFocus=zi,e.showEmptyGrid="showEmptyGrid",e.sliceElements=je,e.sortBegin="sorting-begin",e.sortComplete="sorting-complete",e.stickyScrollComplete="sticky-scroll-complete",e.summaryIterator=Ot,e.tab="tab",e.table=Ji,e.tbody=ln,e.templateCompiler=x,e.textWrapRefresh="textWrapRefresh",e.toggleFilterUI=re,e.toogleCheckbox=se,e.toolbarClick="toolbarClick",e.toolbarRefresh="toolbar-refresh",e.tooltipDestroy="tooltip-destroy",e.uiUpdate=ei,e.ungroupBegin="ungrouping-begin",e.ungroupComplete="ungrouping-complete",e.upArrow=cn,e.updateColumnTypeForExportColumns=v,e.updateData=wi,e.updatecloneRow=S,e.valCustomPlacement="validation-custom-placement",e.validateVirtualForm="validate-virtual-form",e.valueAccessor=g,e.virtaulCellFocus="virtaul-cell-focus",e.virtaulKeyHandler="virtaul-key-handler",e.virtualScrollAddActionBegin="virtual-scroll-add-action-begin",e.virtualScrollEdit="virtual-scroll-edit",e.virtualScrollEditActionBegin="virtual-scroll-edit-action-begin",e.virtualScrollEditCancel="virtual-scroll-edit-cancel",e.virtualScrollEditSuccess="virtual-scroll-edit-success",e.wrap=Z,e}({},ej.base,ej.data,ej.popups,ej.buttons,ej.inputs,ej.dropdowns,ej.calendars,ej.navigations,ej.excelexport,ej.pdfexport),this.ejs=ej;
|
|
2
11
|
//# sourceMappingURL=ej2-grids.min.js.map
|