@syncfusion/ej2-grids
Version:
Feature-rich JavaScript datagrid (datatable) control with built-in support for editing, filtering, grouping, paging, sorting, and exporting to Excel.
10 lines • 1.39 MB
JavaScript
/*!
* filename: ej2-grids.min.js
* version : 29.1.35
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
this.ej=this.ej||{},this.ej.grids=function(e,t,i,n,r,s,o,a,l,h,d){"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){Ur=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?Ur+=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&&(Ur+=e.gSummary*(n-e.indent)+e[""+o]):i.groupSettings.columns.length&&(1!==i.groupSettings.columns.length?Ur+=e.gSummary*(i.groupSettings.columns.length-e.indent):Ur+=e.gSummary),Ur;for(var a=0,l=e.data.items.length;a<l;a++){var h=e.data.items[parseInt(a.toString(),10)];Ur+=h.items.length+(n===i.columns.length||t.isNullOrUndefined(h.items.records)?0:h.items.records.length),s+=t.isNullOrUndefined(h.items.records)||t.isNullOrUndefined(e[""+o])?h.items.length:h.items.records.length,h.items.GroupGuid&&0!==h.items.childLevels&&w(h)}return Ur+=e.data.items.length,t.isNullOrUndefined(e[""+o])||e[""+o]&&Ur&&0!==s&&(Ur+=(Ur-s)*e[""+o]+e[""+o]),Ur}function w(e){for(var t=0,i=e.items.length;t<i;t++){var n=e.items[parseInt(t.toString(),10)];Ur+=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({},F(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 E(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=E(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 T(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 Ot({field:e[parseInt(r.toString(),10)]},n):e[parseInt(r.toString(),10)]instanceof Ot&&!e[parseInt(r.toString(),10)].columns?o=e[parseInt(r.toString(),10)]:e[parseInt(r.toString(),10)].columns?(e[parseInt(r.toString(),10)].columns=T(e[parseInt(r.toString(),10)].columns,null,n),o=new Ot(e[parseInt(r.toString(),10)],n)):o=new Ot(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=A(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 A(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 F(e){return e instanceof t.ChildProperty?t.getValue("properties",e):e}function k(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+Hr++}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(){if(null!==jr)return jr;var e=document.createElement("div"),t=0;return e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth|0,document.body.removeChild(e),jr=t}function V(e,i){if(i&&void 0!==ki)return ki;if(void 0!==Fi)return Fi;var n=t.createElement("table",{className:Vi,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),ki=r.height,Fi=Math.ceil(r.height),i?ki:Fi}function G(e){var i=t.createElement("table",{className:Vi,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 W(e){return void 0===e&&(e=""),e.replace(/\./g,"___")}function K(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=k(i,Gi),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){return 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++)i?(t.classList(e[parseInt(s.toString(),10)],n.slice(),[]),e[parseInt(s.toString(),10)].setAttribute("aria-selected","true")):(t.classList(e[parseInt(s.toString(),10)],[],n.slice()),e[parseInt(s.toString(),10)].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){var i=t.element.style.display;t.element.style.display="block";var r=t.width,s=n.calculateRelativeBasedPosition(e,t.element);t.element.style.display=i,t.element.style.top=s.top+e.getBoundingClientRect().height-5+"px";var o=s.left-r+e.clientWidth;t.element.style.left=o<1?r+o-16+"px":o+-4+"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&&(a="dateui-"+i);var l="in"===e||"notin"===e,h=k(s.element.querySelector("#multiselect"+a),"e-control-wrapper"),d=k(s.element.querySelector("#"+a),"e-popup-flmenu");h&&(h.style.display=l?"inline-flex":"none"),d&&(d.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("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 he(e,i,n){for(s=0;s<(t.isNullOrUndefined(i)?0:i.length);s++)t.setValue(i[parseInt(s.toString(),10)].field,de(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 de(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,h=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(h).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,r){var s,o,a,l=t.extend({},F(e)),h=t.extend({},F(e));if(t.isNullOrUndefined(e.value)||""===e.value)return s=new i.Predicate(l.field,l.operator,l.value,!1);var d=new Date(e.value);if("dateonly"!==n||r)if(e.operator=e.operator.toLowerCase(),"equal"===e.operator||"notequal"===e.operator){"datetime"===n?(o=new Date(d.setSeconds(d.getSeconds()-1)),a=new Date(d.setSeconds(d.getSeconds()+2)),e.value=new Date(d.setSeconds(a.getSeconds()-1))):(o=new Date(d.setHours(0)-1),a=new Date(d.setHours(24))),l.value=o,h.value=a,"equal"===e.operator?(l.operator="greaterthan",h.operator="lessthan"):"notequal"===e.operator&&(l.operator="lessthanorequal",h.operator="greaterthanorequal");var p=new i.Predicate(l.field,l.operator,l.value,!1),c=new i.Predicate(h.field,h.operator,h.value,!1);s="equal"===e.operator?p.and(c):p.or(c)}else{"date"!==n||"lessthanorequal"!==e.operator&&"greaterthan"!==e.operator||(l.value=new Date(d.setHours(24)-1)),"string"==typeof l.value&&(l.value=new Date(l.value));var u=new i.Predicate(l.field,l.operator,l.value,!1);s=u}else{"string"==typeof l.value&&(l.value=new Date(l.value));var g=l.value.getFullYear()+"-"+ce(l.value.getMonth()+1)+"-"+ce(l.value.getDate());s=u=new i.Predicate(l.field,l.operator,g,!1)}return e.setProperties?e.setProperties({ejpredicate:s},!0):e.ejpredicate=s,s}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:F(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)],h=Object.keys(Object.getPrototypeOf(l)).length?Object.keys(l).concat(Ce(l)):Object.keys(l),d=0;d<h.length;d++){var p=s[h[parseInt(d.toString(),10)]],c=l[h[parseInt(d.toString(),10)]],u=void 0;r&&(t.isObject(c)||Array.isArray(c))?t.isObject(c)?(u=p||{},s[h[parseInt(d.toString(),10)]]=t.extend({},u,c,r)):(u=p||[],s[h[parseInt(d.toString(),10)]]=t.extend([],u,c,r)):s[h[parseInt(d.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?at(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 Ee(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+=parseInt(n[parseInt(o.toString(),10)].width.toString(),10),i++),r>s){i--;break}return i}function Te(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"),Ke(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(),h=0;h<l.length;h++){if(parseInt(o.getAttribute("colspan"),10)>1&&parseInt(l[parseInt(h.toString(),10)].width.toString(),10)+i>parseInt(t.width.toString(),10)-De(t)){var d=Ee(t,s);o.setAttribute("colspan",d.toString());break}if(l[parseInt(h.toString(),10)].visible&&(i+=parseInt(l[parseInt(h.toString(),10)].width.toString(),10),a--),0===a)break}}if(o.classList.contains("e-summarycell")){var p=o.getAttribute("e-mappinguid"),c=t.getColumnByUid(p);i+=parseInt(c.width.toString(),10)}}}function Oe(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 ke(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 Me(e,t){var n=Le(t),r=new i.Deferred;return n.dataSource=r.resolve,n.action=e,{state:n,deffered:r}}function Le(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 Pe(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 Ne(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(Zi,(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("index",s.toString());s++}t.length||e.renderModule.emptyRow(!0)}function Be(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(Zi,(s+1).toString()),a.isAltRow?l.classList.add("e-altrow"):l.classList.remove("e-altrow");for(var h=0;h<l.cells.length;h++)l.cells[parseInt(h.toString(),10)].setAttribute("index",s.toString());o++}s++}}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(i)}function ze(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")),h=0;h<i.rows.length;h++){var d=e.getRowObjectFromUID(i.rows[parseInt(h.toString(),10)].getAttribute("data-uid"));l===d&&(s=o.indexOf(l)),a.push(o.splice(o.indexOf(d),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(),h=0,u=n.length;h<u;h++){var g=parseInt(n[parseInt(h.toString(),10)].getAttribute(Zi),10)-1;p[parseInt(h.toString(),10)]=c[parseInt(g.toString(),10)]}for(var f=e.getRows(),h=0,u=n.length;h<u;h++)f[parseInt(h.toString(),10)]=n[parseInt(h.toString(),10)],c[parseInt(h.toString(),10)]=p[parseInt(h.toString(),10)]}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(o)}function qe(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 Ue(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 He(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 je(e,t){var i=e.createElement("div",{className:"e-grid-popup",id:e.element.id+"_e-popup"}),r=n.calculatePosition(e.element,"left","Top");document.getElementById(e.element.id+"_e-popup")&&(i=document.getElementById(e.element.id+"_e-popup")),i.style.top=r.top+"px",i.style.left=r.left+"px",i.style.zIndex=t.zIndex.toString(),i.style.width=t.element.offsetWidth+"px",i.appendChild(t.element);var s=k(e.element,"sb-demo-section")||k(e.element,"e-grid-dialog-fixed");if(s){var o=n.calculateRelativeBasedPosition(e.element,s);i.style.top=o.top+"px",i.style.left=o.left+"px",s.insertBefore(i,s.firstChild)}else document.body.insertBefore(i,document.body.firstChild)}function Ve(e,t){var i=[];return i.push(e.uid),Ge(e,i),i.indexOf(t)>-1}function Ge(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&&Ge(e.columns[parseInt(i.toString(),10)],t)}function _e(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?_e(e.columns[0]):"None"}function We(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 Ke(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 Qe(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 Xe(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 Ye(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)Ke(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()));Ke(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)Ke(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()));Ke(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()));Ke(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()));Ke(i,r-1,e.enableRtl,"Right")}else i.classList.add("e-unfreeze")}function Je(e,t,i){return[].slice.call(e.getDataRows()[parseInt(i.toString(),10)].getElementsByClassName(Bi))}function Ze(e,t,i,n){return Je(e,t,i)[parseInt(n.toString(),10)]}function $e(e,t,i,n,r,s,o){o?i[W(e.field)]=e.validationRules:e.getFreezeTableName()===Yi||!t&&e.getFreezeTableName()===Xi||1===s?i[W(e.field)]=e.validationRules:"movable"!==e.getFreezeTableName()&&e.getFreezeTableName()?e.getFreezeTableName()===Xi&&(r[W(e.field)]=e.validationRules):n[W(e.field)]=e.validationRules}function et(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 tt(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 it(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 nt(e,i,n,r,s,o){for(var a=Object.keys(e),l=i,h=0;h<a.length;h++){var d=e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)];if(s&&!s.isFrozenGrid()&&!s.isRowDragable()){if(d=!t.isNullOrUndefined(d)&&(parseInt(d.getAttribute("aria-colindex"),10)-1===i||k(d,"e-addedrow")&&d.parentElement.childNodes[parseInt(i.toString(),10)]===d)?d:e[parseInt(h.toString(),10)].querySelector('td[aria-colindex="'+(i+1)+'"]'),t.isNullOrUndefined(d))continue;i=s.getContentTable().querySelector(".e-detailrowcollapse, .e-detailrowexpand")?d.cellIndex-1:d.cellIndex}if(e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell").length&&d){if(t.setStyleAttribute(e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)],{display:n}),e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)].classList.contains("e-hide")&&t.removeClass([e[a[parseInt(h.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(h.toString(),10)]].cells[parseInt(p.toString(),10)].visible=""===n}else t.isNullOrUndefined(r[a[parseInt(h.toString(),10)]])||(r[a[parseInt(h.toString(),10)]].cells[parseInt(i.toString(),10)].visible=""===n,!1===r[a[parseInt(h.toString(),10)]].cells[parseInt(i.toString(),10)].visible&&e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(i.toString(),10)].classList.add("e-hide"));i=l}}}function rt(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 st(e,t,i,n){var r=W(t.field);return n=Object.assign(n,{id:e.element.id+r,name:r,"e-mappinguid":t.uid}),e.createElement("input",{className:i,attrs:n})}function ot(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 at(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 lt(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 ht(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 dt(e,t){e.destroyTemplate(t),e.isReact&&e.renderTemplates()}function pt(e){for(var i=0;i<e.length;i++)t.remove(e[i])}function ct(e,t){for(var i=0;i<e.length;i++)t.insertBefore(e[i],t.children[i])}function ut(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 gt(e){return parseInt(e.getAttribute(Zi),10)-1}function ft(e){return e.parentDetails&&e.parentDetails.parentInstObj?ft(e.parentDetails.parentInstObj):e}function mt(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(Vr.generateNullValuePredicates(l)):r.push(D({},{value:a},l))}return Vr.getPredicate(r)}function yt(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 vt(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 St(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 Ct(e){return e.charAt(0).toUpperCase()+e.slice(1)}function wt(e){return!(ge(e)||e.groupSettings.enableLazyLoading||!e.enableVirtualization&&e.enableColumnVirtualization)}function bt(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 It(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 xt(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(k(e.element,"e-rowcell")),cssClass:n||null,close:Rt.bind(r)}}function Rt(e){e.event&&"escape"===e.event.action&&(this.edit.editCellDialogClose=!0)}var Dt=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)?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}(),Et=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)}}(),Tt=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},Ot=function(){function e(e,n){var r=this;this.disableHtmlEncode=!0,this.allowSorting=!0,this.allowResizing=!0,this.allowFiltering=!0,this.allowGrouping=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.enableGroupByFormat=!1,this.allowEditing=!0,this.filter={},this.showInColumnChooser=!0,this.edit={},this.allowSearching=!0,this.autoFit=!1,this.sortDirection="Descending",this.getEditTemplate=function(){return 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 Dt;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.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,de(r,{},e)[0]),t=fe(r.foreignKeyValue,de(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}(),At=function(){function e(){}return Tt([t.Property()],e.prototype,"title",void 0),Tt([t.Property()],e.prototype,"type",void 0),Tt([t.Property()],e.prototype,"buttonOption",void 0),e}(),Ft=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Et(i,e),Tt([t.Property(null)],i.prototype,"columns",void 0),i}(Ot),kt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Et(t,e),t}(Ft),Mt="actionBegin",Lt="actionComplete",Pt="dataBound",Nt="columnDragStart",Bt="columnDrag",zt="columnDrop",qt="rowDragStartHelper",Ut="rowDragStart",Ht="rowDrag",jt="rowDrop",Vt="initial-load",Gt="initial-end",_t="data-ready",Wt="content-ready",Kt="ui-update",Qt="on-empty",Xt="inbound-model-changed",Yt="model-changed",Jt="colgroup-refresh",Zt="header-refreshed",$t="reorder-complete",ei="rowdraganddrop-complete",ti="beforecellfocused",ii="key-pressed",ni="click",ri="destroy",si="column-visible-changed",oi="column-position-changed",ai="rows-added",li="rows-removed",hi="column-drag-stop",di="header-drop",pi="datasource-modified",ci="refresh-virtual-block",ui="auto-col",gi="update-data",fi="prevent-batch",mi="dialog-destroy",yi="add-delete-Action",vi="freezerender",Si="filter-menu-close",Ci="hierarchyprint",wi="row-position-changed",bi="columns-prepared",Ii="cbox-filter-complete",xi="filter-Prevent",Ri="refresh-infinite-mode-blocks",Di="refreshResizeHandlers",Ei="refresh-cutsom-filter-ok-button",Ti="commandColumnDestroy",Oi="render-Responsive-Change-Action",Ai="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 Fi,ki,Mi=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(ai,this.addRows,this),this.parent.on(wi,this.reorderRows,this),this.parent.on(li,this.removeRows,this),this.parent.on(pi,this.initDataManager,this),this.parent.on(ri,this.destroy,this),this.parent.on(gi,this.crudActions,this),this.parent.on(yi,this.getData,this),this.parent.on(ui,this.refreshFilteredCols,this),this.parent.on(bi,this.refreshFilteredCols,this))}return e.prototype.reorderRows=function(e){this.parent.getDataModule().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.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,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&&(this.parent.log("grid_sort_comparer"),s=this.isRemote()?i[parseInt(r.toString(),10)].direction: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()):e.sortBy(a.field,s):n.push({direction:s,field:a.field})}for(var r=0,o=n