@syncfusion/ej2-treegrid 31.2.12 → 32.1.19

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.
Files changed (156) hide show
  1. package/dist/ej2-treegrid.min.js +1 -10
  2. package/dist/ej2-treegrid.umd.min.js +1 -10
  3. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-treegrid.es2015.js +1069 -324
  5. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es5.js +1075 -327
  7. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  8. package/dist/global/ej2-treegrid.min.js +1 -10
  9. package/dist/global/ej2-treegrid.min.js.map +1 -1
  10. package/dist/global/index.d.ts +0 -9
  11. package/package.json +5 -5
  12. package/src/treegrid/actions/batch-edit.js +22 -4
  13. package/src/treegrid/actions/context-menu.d.ts +1 -0
  14. package/src/treegrid/actions/context-menu.js +16 -0
  15. package/src/treegrid/actions/crud-actions.js +12 -5
  16. package/src/treegrid/actions/edit.d.ts +4 -1
  17. package/src/treegrid/actions/edit.js +59 -3
  18. package/src/treegrid/actions/freeze-column.js +1 -1
  19. package/src/treegrid/actions/rowdragdrop.js +3 -0
  20. package/src/treegrid/actions/selection.d.ts +226 -8
  21. package/src/treegrid/actions/selection.js +759 -288
  22. package/src/treegrid/actions/summary.js +1 -1
  23. package/src/treegrid/actions/virtual-scroll.js +6 -3
  24. package/src/treegrid/base/data.js +2 -1
  25. package/src/treegrid/base/treegrid-model.d.ts +16 -0
  26. package/src/treegrid/base/treegrid.d.ts +50 -4
  27. package/src/treegrid/base/treegrid.js +158 -19
  28. package/src/treegrid/models/column.d.ts +24 -0
  29. package/src/treegrid/models/column.js +12 -0
  30. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +5 -0
  31. package/src/treegrid/renderer/virtual-tree-content-render.js +24 -2
  32. package/styles/bds-lite.scss +17 -18
  33. package/styles/bds.scss +18 -19
  34. package/styles/bootstrap-dark-lite.scss +17 -18
  35. package/styles/bootstrap-dark.scss +18 -19
  36. package/styles/bootstrap-lite.scss +17 -18
  37. package/styles/bootstrap.scss +18 -19
  38. package/styles/bootstrap4-lite.scss +17 -18
  39. package/styles/bootstrap4.scss +18 -19
  40. package/styles/bootstrap5-dark-lite.scss +17 -18
  41. package/styles/bootstrap5-dark.scss +18 -19
  42. package/styles/bootstrap5-lite.scss +18 -18
  43. package/styles/bootstrap5.3-lite.css +81 -1
  44. package/styles/bootstrap5.3-lite.scss +18 -18
  45. package/styles/bootstrap5.3.css +81 -1
  46. package/styles/bootstrap5.3.scss +19 -19
  47. package/styles/bootstrap5.scss +19 -19
  48. package/styles/fabric-dark-lite.scss +18 -18
  49. package/styles/fabric-dark.scss +19 -19
  50. package/styles/fabric-lite.scss +18 -18
  51. package/styles/fabric.scss +19 -19
  52. package/styles/fluent-dark-lite.scss +18 -18
  53. package/styles/fluent-dark.scss +19 -19
  54. package/styles/fluent-lite.scss +18 -18
  55. package/styles/fluent.scss +19 -19
  56. package/styles/fluent2-lite.css +152 -4
  57. package/styles/fluent2-lite.scss +18 -18
  58. package/styles/fluent2.css +152 -4
  59. package/styles/fluent2.scss +19 -19
  60. package/styles/highcontrast-light-lite.scss +18 -18
  61. package/styles/highcontrast-light.scss +19 -19
  62. package/styles/highcontrast-lite.scss +18 -18
  63. package/styles/highcontrast.scss +19 -19
  64. package/styles/material-dark-lite.scss +18 -18
  65. package/styles/material-dark.scss +19 -19
  66. package/styles/material-lite.scss +17 -18
  67. package/styles/material.scss +18 -19
  68. package/styles/material3-dark-lite.css +140 -1
  69. package/styles/material3-dark-lite.scss +18 -18
  70. package/styles/material3-dark.css +140 -1
  71. package/styles/material3-dark.scss +19 -21
  72. package/styles/material3-lite.css +140 -1
  73. package/styles/material3-lite.scss +18 -18
  74. package/styles/material3.css +140 -1
  75. package/styles/material3.scss +19 -21
  76. package/styles/tailwind-dark-lite.scss +18 -18
  77. package/styles/tailwind-dark.scss +19 -19
  78. package/styles/tailwind-lite.scss +18 -18
  79. package/styles/tailwind.scss +19 -19
  80. package/styles/tailwind3-lite.css +119 -1
  81. package/styles/tailwind3-lite.scss +18 -18
  82. package/styles/tailwind3.css +119 -1
  83. package/styles/tailwind3.scss +19 -19
  84. package/styles/treegrid/_all.scss +2 -2
  85. package/styles/treegrid/_bds-definition.scss +2 -0
  86. package/styles/treegrid/_bigger.scss +2 -0
  87. package/styles/treegrid/_bootstrap-dark-definition.scss +2 -0
  88. package/styles/treegrid/_bootstrap-definition.scss +2 -0
  89. package/styles/treegrid/_bootstrap4-definition.scss +2 -0
  90. package/styles/treegrid/_bootstrap5-dark-definition.scss +26 -1
  91. package/styles/treegrid/_bootstrap5-definition.scss +2 -0
  92. package/styles/treegrid/_bootstrap5.3-definition.scss +2 -0
  93. package/styles/treegrid/_fabric-dark-definition.scss +2 -0
  94. package/styles/treegrid/_fabric-definition.scss +2 -0
  95. package/styles/treegrid/_fluent-dark-definition.scss +27 -1
  96. package/styles/treegrid/_fluent-definition.scss +2 -0
  97. package/styles/treegrid/_fluent2-definition.scss +2 -0
  98. package/styles/treegrid/_highcontrast-definition.scss +2 -0
  99. package/styles/treegrid/_highcontrast-light-definition.scss +2 -0
  100. package/styles/treegrid/_layout.scss +5 -2
  101. package/styles/treegrid/_material-dark-definition.scss +2 -0
  102. package/styles/treegrid/_material-definition.scss +2 -0
  103. package/styles/treegrid/_material3-dark-definition.scss +26 -1
  104. package/styles/treegrid/_material3-definition.scss +2 -0
  105. package/styles/treegrid/_tailwind-dark-definition.scss +26 -1
  106. package/styles/treegrid/_tailwind-definition.scss +2 -0
  107. package/styles/treegrid/_tailwind3-definition.scss +2 -0
  108. package/styles/treegrid/_theme-variables.scss +1 -0
  109. package/styles/treegrid/bds.scss +19 -19
  110. package/styles/treegrid/bootstrap-dark.scss +19 -19
  111. package/styles/treegrid/bootstrap.scss +19 -19
  112. package/styles/treegrid/bootstrap4.scss +19 -19
  113. package/styles/treegrid/bootstrap5-dark.scss +19 -19
  114. package/styles/treegrid/bootstrap5.3.css +81 -1
  115. package/styles/treegrid/bootstrap5.3.scss +19 -19
  116. package/styles/treegrid/bootstrap5.scss +19 -19
  117. package/styles/treegrid/fabric-dark.scss +19 -19
  118. package/styles/treegrid/fabric.scss +19 -19
  119. package/styles/treegrid/fluent-dark.scss +19 -19
  120. package/styles/treegrid/fluent.scss +19 -19
  121. package/styles/treegrid/fluent2.css +152 -4
  122. package/styles/treegrid/fluent2.scss +19 -19
  123. package/styles/treegrid/highcontrast-light.scss +19 -19
  124. package/styles/treegrid/highcontrast.scss +19 -19
  125. package/styles/treegrid/icons/_bds.scss +1 -0
  126. package/styles/treegrid/icons/_bootstrap-dark.scss +1 -0
  127. package/styles/treegrid/icons/_bootstrap.scss +1 -0
  128. package/styles/treegrid/icons/_bootstrap4.scss +1 -0
  129. package/styles/treegrid/icons/_bootstrap5-dark.scss +1 -1
  130. package/styles/treegrid/icons/_bootstrap5.3.scss +1 -0
  131. package/styles/treegrid/icons/_bootstrap5.scss +1 -0
  132. package/styles/treegrid/icons/_fabric-dark.scss +1 -0
  133. package/styles/treegrid/icons/_fabric.scss +1 -0
  134. package/styles/treegrid/icons/_fluent-dark.scss +1 -1
  135. package/styles/treegrid/icons/_fluent.scss +1 -0
  136. package/styles/treegrid/icons/_fluent2.scss +1 -0
  137. package/styles/treegrid/icons/_fusionnew.scss +1 -0
  138. package/styles/treegrid/icons/_highcontrast-light.scss +1 -0
  139. package/styles/treegrid/icons/_highcontrast.scss +1 -0
  140. package/styles/treegrid/icons/_material-dark.scss +1 -0
  141. package/styles/treegrid/icons/_material.scss +1 -0
  142. package/styles/treegrid/icons/_material3-dark.scss +1 -1
  143. package/styles/treegrid/icons/_material3.scss +1 -0
  144. package/styles/treegrid/icons/_tailwind-dark.scss +1 -0
  145. package/styles/treegrid/icons/_tailwind.scss +1 -0
  146. package/styles/treegrid/icons/_tailwind3.scss +1 -0
  147. package/styles/treegrid/material-dark.scss +19 -19
  148. package/styles/treegrid/material.scss +19 -19
  149. package/styles/treegrid/material3-dark.css +140 -1
  150. package/styles/treegrid/material3-dark.scss +19 -20
  151. package/styles/treegrid/material3.css +140 -1
  152. package/styles/treegrid/material3.scss +19 -20
  153. package/styles/treegrid/tailwind-dark.scss +19 -19
  154. package/styles/treegrid/tailwind.scss +19 -19
  155. package/styles/treegrid/tailwind3.css +119 -1
  156. package/styles/treegrid/tailwind3.scss +19 -19
@@ -1,11 +1,2 @@
1
- /*!
2
- * filename: ej2-treegrid.umd.min.js
3
- * version : 31.2.12
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
- */
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-grids","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-popups"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Grids,e.ej2Buttons,e.ej2Data,e.ej2Popups)}(this,function(r,C,w,T,b,V){"use strict";B=function(e,t){return(B=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])}))(e,t)};var B,z=function(e,t){function i(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},L=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},F=(j.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)this[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]],this.parent&&this.parent.isReact&&"template"===t[parseInt(i.toString(),10)]&&this.parent.clipboardModule.treeGridParent.renderModule.refreshReactColumnTemplateByUid(this.uid)},j);function j(e){this.allowEditing=!0,this.edit={},this.disableHtmlEncode=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowFiltering=!0,this.allowSorting=!0,this.allowResizing=!0,this.filter={},C.merge(this,e)}z(H,_=F),L([C.Property(null)],H.prototype,"columns",void 0);var _,L=H;function H(){return null!==_&&_.apply(this,arguments)||this}z(Q,G=L);var G,z=Q;function Q(){return null!==G&&G.apply(this,arguments)||this}K=function(e,t){return(K=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])}))(e,t)};var K,W,Y=function(e,t){function i(){this.constructor=e}K(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},J=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Y=(W=C.ChildProperty,Y(X,W),J([C.Property("Spinner")],X.prototype,"indicatorType",void 0),X);function X(){return null!==W&&W.apply(this,arguments)||this}$=function(e,t){return($=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])}))(e,t)};var $,Z,J=function(e,t){function i(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},ee=(Z=C.ChildProperty,J(t,Z),e([C.Property()],t.prototype,"field",void 0),e([C.Property()],t.prototype,"operator",void 0),e([C.Property()],t.prototype,"value",void 0),e([C.Property()],t.prototype,"matchCase",void 0),e([C.Property()],t.prototype,"ignoreAccent",void 0),e([C.Property()],t.prototype,"predicate",void 0),e([C.Property({})],t.prototype,"actualFilterValue",void 0),e([C.Property({})],t.prototype,"actualOperator",void 0),e([C.Property()],t.prototype,"type",void 0),e([C.Property()],t.prototype,"ejpredicate",void 0),e([C.Property()],t.prototype,"uid",void 0),e([C.Property()],t.prototype,"isForeignKey",void 0),t);function t(){return null!==Z&&Z.apply(this,arguments)||this}te=C.ChildProperty,J(ie,te),e([C.Collection([],ee)],ie.prototype,"columns",void 0),e([C.Property("FilterBar")],ie.prototype,"type",void 0),e([C.Property()],ie.prototype,"mode",void 0),e([C.Property(!0)],ie.prototype,"showFilterBarStatus",void 0),e([C.Property(1500)],ie.prototype,"immediateModeDelay",void 0),e([C.Property()],ie.prototype,"operators",void 0),e([C.Property(!1)],ie.prototype,"ignoreAccent",void 0),e([C.Property("Parent")],ie.prototype,"hierarchyMode",void 0);var te,J=ie;function ie(){return null!==te&&te.apply(this,arguments)||this}re=function(e,t){return(re=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])}))(e,t)};var re,ne,e=function(e,t){function i(){this.constructor=e}re(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},oe=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},e=(ne=C.ChildProperty,e(ae,ne),oe([C.Property("Both")],ae.prototype,"wrapMode",void 0),ae);function ae(){return null!==ne&&ne.apply(this,arguments)||this}var se,de,oe=function(e,t){function i(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},le="https://ej2.syncfusion.com/documentation/treegrid",pe="https://ej2.syncfusion.com/documentation",he=!(se=function(e,t){return(se=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])}))(e,t)}),ce=(de=w.Logger,oe(ue,de),ue.prototype.getModuleName=function(){return"logger"},ue.prototype.log=function(e,t){for(var i=e=e instanceof Array?e:[e],r=0;r<i.length;r++){var n,o=w.detailLists[i[parseInt(r.toString(),10)]],a=o.check(t,this.parent);a.success&&(a=(a=o.generateMessage(t,this.parent,a.options)).replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),he&&"primary_column_missing"===i[parseInt(r.toString(),10)]&&(a=a.replace("Editing","Row DragAndDrop"),he=!1),n=a.indexOf("https"),n=a.substring(n),"module_missing"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/modules"):"primary_column_missing"===i[parseInt(r.toString(),10)]||"selection_key_missing"===i[parseInt(r.toString(),10)]?a=a.replace(n,pe+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/edit"):"virtual_height"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/virtual"):"check_datasource_columns"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/columns"):"locale_missing"===i[parseInt(r.toString(),10)]&&(a=a.replace(n,le+"/global-local/#localization")),"datasource_syntax_mismatch"===i[parseInt(r.toString(),10)]&&(C.isNullOrUndefined(this.treeGridObj)||C.isNullOrUndefined(this.treeGridObj.dataStateChange))||console[o.logType](a))}},ue.prototype.treeLog=function(e,t,i){this.treeGridObj=i;var r=e=e instanceof Array?e:[e];i.allowRowDragAndDrop&&!i.columns.filter(function(e){return e.isPrimaryKey}).length&&(he=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=me[r[parseInt(n.toString(),10)]],a=o.check(t,i);a.success&&(a=o.generateMessage(t,i,a.options),console[o.logType](a))}},ue);function ue(e){return w.Grid.Inject(w.Logger),de.call(this,e)||this}var ge,fe,me={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,t){var i={success:!1};return i=C.isNullOrUndefined(t.idMapping)&&C.isNullOrUndefined(t.childMapping)&&C.isNullOrUndefined(t.parentIdMapping)||!C.isNullOrUndefined(t.idMapping)&&C.isNullOrUndefined(t.parentIdMapping)||C.isNullOrUndefined(t.idMapping)&&!C.isNullOrUndefined(t.parentIdMapping)?{success:!0}:i},generateMessage:function(){return"[EJ2TreeGrid.Error]: MAPPING FIELDS MISSING \nOne of the following fields is missing. It is required for the hierarchical relationship of records in TreeGrid:\n* childMapping\n* idMapping\n* parentIdMapping\nRefer to the following documentation links for more details.\n"+pe+"/api/treegrid#childmapping\n"+pe+"/api/treegrid#idmapping\n"+pe+"/api/treegrid#$parentidmapping"}}},ye="load",Se="rowDataBound",we="dataBound",Ie="queryCellInfo",Re="beforeDataBound",ve="actionBegin",xe="dataStateChange",Ce="actionComplete",be="rowSelecting",De="rowSelected",Me="checkboxChange",Oe="rowDeselected",Pe="toolbarClick",Ae="beforeExcelExport",Ee="beforePdfExport",Ne="resizeStop",Ue="expanded",ke="expanding",qe="collapsed",Te="collapsing",Ve="remoteExpand",Be="localPagedExpandCollapse",ze="pagingActions",Le="printGrid-Init",Fe="contextMenuOpen",je="contextMenuClick",_e="beforeCopy",He="beforePaste",Ge="crudAction",Qe="beginEdit",Ke="beginAdd",We="recordDoubleClick",Ye="cellSave",Je="cellSaved",Xe="cellEdit",$e="batchDelete",Ze="batchCancel",et="batchAdd",tt="beforeBatchDelete",it="beforeBatchAdd",rt="beforeBatchSave",nt="batchSave",ot="key-pressed",at="double-tap",st="virtual-action-args",dt="destroy",lt="data-listener",pt="index-modifier",ht="edit-form",ct="before-batch-cancel",ut="detailDataBound",gt="rowDrag",ft="rowDragStartHelper",mt="rowDrop",yt="rowDragStart",St="rows-add",wt="rows-remove",It="row-draging",Rt="row-dropped",vt="auto-col",xt="rowDeselecting",Ct="e-movablecontent",bt="e-frozencontent",Dt="aria-rowindex",Mt="actionFailure",oe=(ge=function(e,t){return(ge=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])}))(e,t)},function(e,t){function i(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Ot=(fe=w.Clipboard,oe(Pt,fe),Pt.prototype.setCopyData=function(e){var t="copyContent",i="getCopyData",r=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this[t]="";var n=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var o=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),a=0;a<o.length;a++){0<a&&(this.treeCopyContent+="\n");var s,d,l=o[parseInt(a.toString(),10)];n[l].classList.contains("e-summaryrow")||(s=[].slice.call(n[l].querySelectorAll(".e-rowcell")),d=this.treeGridParent.getSelectedRecords()[parseInt(a.toString(),10)].uniqueID,-1===this.copiedUniqueIdCollection.indexOf(d)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(r,l,n,e,a),this[i](s,!1,"\t",e),this.treeCopyContent+=this[t],this.copiedUniqueIdCollection.push(d),this[t]="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(r,o[parseInt(a.toString(),10)],n,e)))}e&&(p=this.treeGridParent.getVisibleColumns().map(function(e){return e.headerText}),this[i](p,!1,"\t",e),this.treeCopyContent=this[t]+"\n"+this.treeCopyContent);var p={data:this.treeCopyContent,cancel:!1};this.treeGridParent.trigger(_e,p),p.cancel||(this.clipBoardTextArea.value=this[t]=p.data,C.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0,this.copiedUniqueIdCollection=[],this.treeCopyContent="")}else fe.prototype.setCopyData.call(this,e)}},Pt.prototype.parentContentData=function(e,t,i,r,n){var o="copyContent",a="parentItem",s="uniqueID";if(!C.isNullOrUndefined(e[parseInt(t.toString(),10)][a]))for(var d=e[parseInt(t.toString(),10)][a].level,l=0;l<d+1;l++)for(var p=0;p<e.length;p++)if(!C.isNullOrUndefined(e[parseInt(t.toString(),10)][a])&&e[parseInt(p.toString(),10)][s]===e[parseInt(t.toString(),10)][a][s]){t=p;var h=[].slice.call(i[parseInt(t.toString(),10)].querySelectorAll(".e-rowcell")),c=e[parseInt(p.toString(),10)][s];if(-1===this.copiedUniqueIdCollection.indexOf(c)){this.getCopyData(h,!1,"\t",r),this.treeCopyContent=0<n?this.treeCopyContent+this[o]+"\n":this[o]+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(c),this[o]="";break}}},Pt.prototype.copy=function(e){fe.prototype.copy.call(this,e)},Pt.prototype.paste=function(e,t,i){fe.prototype.paste.call(this,e,t,i)},Pt.prototype.getModuleName=function(){return"clipboard"},Pt.prototype.destroy=function(){fe.prototype.destroy.call(this)},Pt.prototype.childContentData=function(e,t,i,r){var n="copyContent",o="uniqueID";if(e[parseInt(t.toString(),10)].hasChildRecords)for(var a=e[parseInt(t.toString(),10)].childRecords,s=0;s<a.length;s++)for(var d,l,p=0;p<e.length;p++)if(!C.isNullOrUndefined(a[parseInt(s.toString(),10)][o])&&e[parseInt(p.toString(),10)][o]===a[parseInt(s.toString(),10)][o]){C.isNullOrUndefined(i[parseInt(p.toString(),10)])||i[parseInt(p.toString(),10)].classList.contains("e-summaryrow")||(d=[].slice.call(i[parseInt(p.toString(),10)].querySelectorAll(".e-rowcell")),l=e[parseInt(p.toString(),10)][o],-1===this.copiedUniqueIdCollection.indexOf(l)&&(this.getCopyData(d,!1,"\t",r),this.treeCopyContent+="\n"+this[n],this[n]="",this.copiedUniqueIdCollection.push(l),this.childContentData(e,p,i,r)));break}},Pt);function Pt(e,t){var i=fe.call(this,e.grid,t)||this;return i.treeCopyContent="",i.copiedUniqueIdCollection=[],i.treeGridParent=e,i.serviceLocator=t,i}function S(e){var t;return e.treeGrid&&e.treeGrid.isGantt?!!e.taskFields.hasChildMapping&&e.dataSource instanceof b.DataManager&&((t=e.dataSource.adaptor)instanceof b.ODataAdaptor||t instanceof b.WebApiAdaptor||t instanceof b.WebMethodAdaptor||t instanceof b.CacheAdaptor||t instanceof b.UrlAdaptor):e.dataSource instanceof b.DataManager&&((t=e.dataSource.adaptor)instanceof b.ODataAdaptor||t instanceof b.WebApiAdaptor||t instanceof b.WebMethodAdaptor||t instanceof b.CacheAdaptor||t instanceof b.UrlAdaptor)}function I(e){return!!(e.dataSource&&"result"in e.dataSource)}function At(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function Et(e){return!((C.isNullOrUndefined(e.grid.searchSettings.key)||""===e.grid.searchSettings.key||"Child"!==e.searchSettings.hierarchyMode&&"None"!==e.searchSettings.hierarchyMode)&&(!e.allowFiltering||!e.grid.filterSettings.columns.length||"Child"!==e.filterSettings.hierarchyMode&&"None"!==e.filterSettings.hierarchyMode))}function Nt(e){for(var t=[],i=0,r=Object.keys(e).length;i<r;i++)w.getObject("hasChildRecords",e[parseInt(i.toString(),10)])&&t.push(e[parseInt(i.toString(),10)]);return t}function y(e,t,i){var r,t=C.isNullOrUndefined(t.parentItem)?null:x(e,t.parentItem.uniqueID);return null==t||(!e.initialRender||C.isNullOrUndefined(t[e.expandStateMapping])||t[e.expandStateMapping]?!1!==t.expanded&&(!t.parentItem||((r=x(e,t.parentItem.uniqueID))&&e.initialRender&&!C.isNullOrUndefined(r[e.expandStateMapping])&&!r[e.expandStateMapping]?r.expanded=!1:(!r||!1!==r.expanded)&&(!r||y(e,r)))):t.expanded=!1)}function R(e){var t=[];if(C.isNullOrUndefined(e)||!e.hasChildRecords&&!C.isNullOrUndefined(e.childRecords)&&!e.childRecords.length)return[];if(!C.isNullOrUndefined(e.childRecords))for(var i=e.childRecords.filter(function(e){return!e.isSummaryRow}),r=0,n=Object.keys(i).length;r<n;r++)t.push(i[parseInt(r.toString(),10)]),(i[parseInt(r.toString(),10)].hasChildRecords||!C.isNullOrUndefined(i[parseInt(r.toString(),10)].childRecords)&&i[parseInt(r.toString(),10)].childRecords.length)&&(t=t.concat(R(i[parseInt(r.toString(),10)])));return t}function v(e){return!S(e)||(e=e.dataSource,!C.isNullOrUndefined(e.ready))}function D(e){for(var t=[],i=0;e&&i<e.length;i++){for(var r=Object.keys(e[parseInt(i.toString(),10)]),n={},o=0;o<r.length;o++)n[r[parseInt(o.toString(),10)]]=e[parseInt(i.toString(),10)][r[parseInt(o.toString(),10)]];t.push(n)}return t}function Ut(e){return delete e.hasChildRecords,delete e.childRecords,delete e.index,delete e.parentItem,delete e.level,delete e.taskData,delete e.uniqueID,e}function x(e,t,i){return(i?e.uniqueIDFilterCollection:e.uniqueIDCollection)[""+t]}function kt(e){e=window.getComputedStyle(e);return"none"===e.display||"hidden"===e.visibility}i.prototype.getModuleName=function(){return"selection"},i.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},i.prototype.destroy=function(){this.removeEventListener()},i.prototype.checkboxSelection=function(e){var t,i,e=w.getObject("target",e),r=w.parentsUntil(e,"e-checkbox-wrapper");r&&0<r.querySelectorAll(".e-treecheckselect").length?(t=r.querySelector('input[type="checkbox"]'),(i=[]).push(e.closest("tr").rowIndex),this.selectCheckboxes(i),this.triggerChkChangeEvent(t,t.nextElementSibling.classList.contains("e-check"),e.closest("tr"))):r&&0<r.querySelectorAll(".e-treeselectall").length&&this.parent.autoCheckHierarchy&&(i=!r.querySelector(".e-frame").classList.contains("e-check")&&!r.querySelector(".e-frame").classList.contains("e-stop"),this.headerSelection(i),t=r.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(t,i,e.closest("tr"))),!C.isNullOrUndefined(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&0<this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length&&S(this.parent)&&0<this.parent.parentQuery.length&&((r=this.parent.query.queries).push.apply(r,this.parent.parentQuery),this.parent.parentQuery=[])},i.prototype.triggerChkChangeEvent=function(e,t,i){var r=this.parent.getCurrentViewRecords()[i.rowIndex],t={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():r};this.parent.trigger(Me,t)},i.prototype.getCheckboxcolumnIndex=function(){for(var e,t,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].showCheckbox&&(e=i[parseInt(r.toString(),10)].uid);for(var n=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv").length,o=0;o<n;o++)this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[parseInt(o.toString(),10)].getAttribute("data-mappinguid")===e&&(t=o);return t},i.prototype.headerCheckbox=function(){var e,t,i;this.columnIndex=this.getCheckboxcolumnIndex(),-1<this.columnIndex&&0===this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length?(e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex],i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}}),(t=T.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),t.insertBefore(i.cloneNode(),t.firstChild),C.isNullOrUndefined(e)||e.insertBefore(t,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()):-1<this.columnIndex&&0<this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length&&(i=(t=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0]).querySelector(".e-frame").classList.contains("e-check"),this.parent.autoCheckHierarchy)&&i&&this.headerSelection(i)},i.prototype.renderColumnCheckbox=function(e){var t=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),i=e.data,e=(e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox"),!C.isNullOrUndefined(i.checkboxState)&&"uncheck"!==i.checkboxState),e=T.createCheckBox(this.parent.createElement,!1,{checked:e,label:" "});return e.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(e.querySelector(".e-frame").style.width="18px"),"indeterminate"===i.checkboxState&&(i=e.querySelectorAll(".e-frame")[0],C.removeClass([i],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-stop")),e.insertBefore(t.cloneNode(),e.firstChild),e},i.prototype.columnCheckbox=function(e){var t,i,r=this.renderColumnCheckbox(e),n=e.cell.querySelector(".e-treecolumn-container");C.isNullOrUndefined(n)?(t=this.parent.createElement("span",{className:"e-treecheckbox"}),i=e.cell.innerHTML,e.cell.innerHTML="",t.innerHTML=i,(i=this.parent.createElement("div",{className:"e-treecheckbox-container"})).appendChild(r),i.appendChild(t),e.cell.appendChild(i)):e.cell.querySelector(".e-hierarchycheckbox")||n.insertBefore(r,n.querySelectorAll(".e-treecell")[0])},i.prototype.selectCheckboxes=function(e){C.isNullOrUndefined(e)&&this.parent.trigger(Mt,{error:"The provided value for the rowIndexes is undefined. Please ensure the rowIndexes contains number."});for(var t=0;t<e.length;t++){for(var i=this.parent.getCurrentViewRecords()[e[parseInt(t.toString(),10)]],r=x(this.parent,i.uniqueID),n="uncheck"===(i=r).checkboxState?"check":"uncheck",o=(i.checkboxState=n,Object.keys(i)),a=0;a<o.length;a++)Object.prototype.hasOwnProperty.call(r,o[parseInt(a.toString(),10)])&&(r[o[parseInt(a.toString(),10)]]=i[o[parseInt(a.toString(),10)]]);this.traverSelection(i,n,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},i.prototype.traverSelection=function(e,t,i){if(this.updateSelectedItems(e,t),!i&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy)for(var r=e.childRecords,n=(r=!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.parent.autoCheckHierarchy?this.getFilteredChildRecords(r):r).length,o=0;o<n;o++)r[parseInt(o.toString(),10)].isSummaryRow||(r[parseInt(o.toString(),10)].hasChildRecords?this.traverSelection(r[parseInt(o.toString(),10)],t,!0):this.updateSelectedItems(r[parseInt(o.toString(),10)],t))},i.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return-1<t.parent.filterModule.filteredResult.indexOf(e)})},i.prototype.updateParentSelection=function(e){var t,i=[],e=x(this.parent,e.uniqueID),r=(e&&e.childRecords&&(i=e.childRecords),t=(i=!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.parent.autoCheckHierarchy?this.getFilteredChildRecords(i):i)&&i.length,0),n=0;if(!C.isNullOrUndefined(e)){for(var o=0;o<i.length;o++){var a=x(this.parent,i[parseInt(o.toString(),10)].uniqueID);C.isNullOrUndefined(a)||("indeterminate"===a.checkboxState?r++:"check"===a.checkboxState&&n++)}0<r||0<n&&n!==t?e.checkboxState="indeterminate":(0!==n||e.hasFilteredChildRecords&&!C.isNullOrUndefined(e.hasFilteredChildRecords)||C.isNullOrUndefined(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==e.checkboxState)&&(0===n&&0===r||0===n&&e.hasFilteredChildRecords&&!C.isNullOrUndefined(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===e.checkboxState)?e.checkboxState="uncheck":e.checkboxState="check",this.updateSelectedItems(e,e.checkboxState),e.parentItem&&this.updateParentSelection(e.parentItem)}},i.prototype.headerSelection=function(e){var t,i=this,r=!1;if(!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&(o=this.parent.filterModule.filteredResult,0===this.filteredList.length&&(this.filteredList=o),this.parent.grid.searchSettings.key.length?this.searchingRecords=o:r=this.filteredList!==o&&(this.filteredList=o,!0)),0<this.filteredList.length&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length)&&!C.isNullOrUndefined(e)&&(this.filteredList=this.searchingRecords),t=!C.isNullOrUndefined(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&0<this.parent.filterSettings.columns.length||!C.isNullOrUndefined(this.parent.filterModule)&&0<this.filteredList.length?this.filteredList:this.parent.flatData,t=S(this.parent)?this.parent.getCurrentViewRecords():t,!C.isNullOrUndefined(e))for(var n=0;n<t.length;n++)e?"check"===t[parseInt(n.toString(),10)].checkboxState||r||(t[parseInt(n.toString(),10)].checkboxState="check",this.updateSelectedItems(t[parseInt(n.toString(),10)],t[parseInt(n.toString(),10)].checkboxState)):-1<this.selectedItems.indexOf(t[parseInt(n.toString(),10)])&&(t[parseInt(n.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(t[parseInt(n.toString(),10)],t[parseInt(n.toString(),10)].checkboxState),this.parent.autoCheckHierarchy)&&this.updateParentSelection(t[parseInt(n.toString(),10)]);!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],t.filter(function(e){e.checkboxState="uncheck",i.updateSelectedItems(e,e.checkboxState)}));var o=this.selectedItems.length,a=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];0<o&&0<t.length?o===t.length||e?(C.removeClass([a],["e-stop"]),a.classList.add("e-check")):(C.removeClass([a],["e-check"]),a.classList.add("e-stop")):C.removeClass([a],["e-check","e-stop"])},i.prototype.updateSelectedItems=function(t,e){var i,r=this.parent.grid.currentViewData.filter(function(e){return e.uniqueID===t.uniqueID}),r=this.parent.grid.currentViewData.indexOf(r[0]),n=x(this.parent,t.uniqueID),o=this.parent.getRows()[parseInt(r.toString(),10)],n=(-1<r&&(i=void 0,(this.parent.frozenRows||this.parent.getFrozenColumns())&&(i=this.parent.getDataRows()[parseInt(r.toString(),10)]),i=(o.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?o:i).querySelectorAll(".e-hierarchycheckbox .e-frame")[0],C.isNullOrUndefined(i)||C.removeClass([i],["e-check","e-stop","e-uncheck"])),"check"===((n=C.isNullOrUndefined(n=n)?t:n).checkboxState=e)&&C.isNullOrUndefined(t.isSummaryRow)?(-1!==r&&-1===this.selectedIndexes.indexOf(r)&&this.selectedIndexes.push(r),-1===this.selectedItems.indexOf(n)&&-1!==r&&!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.selectedItems.push(n),-1===this.selectedItems.indexOf(n)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.selectedItems.push(n),-1!==this.selectedItems.indexOf(n)||C.isNullOrUndefined(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(n),-1===this.selectedItems.indexOf(n)&&C.isNullOrUndefined(this.parent.filterModule)&&this.selectedItems.push(n)):"uncheck"!==e&&"indeterminate"!==e||!C.isNullOrUndefined(t.isSummaryRow)||(-1!==(n=this.selectedItems.indexOf(n))&&this.selectedItems.splice(n,1),-1!==this.selectedIndexes.indexOf(r)&&(n=this.selectedIndexes.indexOf(r),this.selectedIndexes.splice(n,1))),"indeterminate"===e?"e-stop":"e-"+e);-1<r&&(C.isNullOrUndefined(i)||(i.classList.add(n),o.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===e?"true":"uncheck"===e?"false":"mixed")))},i.prototype.updateGridActions=function(e){var r=this,t=e.requestType;if(At(this.parent))if(this.parent.autoCheckHierarchy)if("sorting"===t||"paging"===t){var i,n=this.parent.grid.getRows(),o=(i=this.parent.getCurrentViewRecords()).length;this.selectedIndexes=[];for(var a=0;a<o;a++)n[parseInt(a.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(a.toString(),10)],i[parseInt(a.toString(),10)].checkboxState)}else if("delete"===t||"add"===e.action){var s=[];"delete"===t?s=e.data:s.push(e.data);for(var d,a=0;a<s.length;a++)"delete"===t&&(d=this.parent.flatData.indexOf(s[parseInt(a.toString(),10)]),d=this.selectedIndexes.indexOf(d),this.selectedIndexes.splice(d,1),this.updateSelectedItems(s[parseInt(a.toString(),10)],"uncheck")),C.isNullOrUndefined(s[parseInt(a.toString(),10)].parentItem)||this.updateParentSelection(s[parseInt(a.toString(),10)].parentItem)}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":"filtering"!==t&&"searching"!==t&&("refresh"!==t||S(this.parent))||(this.selectedItems=[],this.selectedIndexes=[],(i=!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length?this.parent.filterModule.filteredResult:this.parent.flatData).forEach(function(e){if(r.parent.enableVirtualization){e.hasChildRecords&&0<e.childRecords.length?r.updateParentSelection(e):r.updateSelectedItems(e,e.checkboxState);for(var t=R(e),t=r.getFilteredChildRecords(t),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].hasChildRecords?r.updateParentSelection(t[parseInt(i.toString(),10)]):t[parseInt(i.toString(),10)].hasChildRecords||C.isNullOrUndefined(t[parseInt(i.toString(),10)])||r.updateSelectedItems(t[parseInt(i.toString(),10)],t[parseInt(i.toString(),10)].checkboxState)}else e.hasChildRecords?r.updateParentSelection(e):r.updateSelectedItems(e,e.checkboxState)}),this.headerSelection());else"filtering"!==t&&"searching"!==t&&"refresh"!==t||S(this.parent)||(this.selectedItems=[],this.selectedIndexes=[])},i.prototype.getCheckedrecords=function(){return this.selectedItems},i.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes};var qt=i;function i(e){this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}Vt.prototype.getModuleName=function(){return"print"},Vt.prototype.addEventListener=function(){this.parent.grid.on(Le,this.printTreeGrid,this)},Vt.prototype.removeEventListener=function(){this.parent.grid.off(Le,this.printTreeGrid)},Vt.prototype.printTreeGrid=function(e){var t=w.getObject("printgrid",e),e=w.getObject("element",e);t.addEventListener(Ie,this.parent.grid.queryCellInfo),t.addEventListener(Se,this.parent.grid.rowDataBound),t.addEventListener(Re,this.parent.grid.beforeDataBound),C.addClass([e],"e-treegrid")},Vt.prototype.print=function(){this.parent.grid.print()},Vt.prototype.destroy=function(){this.removeEventListener()};var Tt=Vt;function Vt(e){this.parent=e,w.Grid.Inject(w.Print),this.addEventListener()}Bt=function(e,t){return(Bt=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])}))(e,t)};var Bt,zt,oe=function(e,t){function i(){this.constructor=e}Bt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Lt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},oe=(zt=C.ChildProperty,oe(Ft,zt),Lt([C.Property()],Ft.prototype,"fields",void 0),Lt([C.Property(!1)],Ft.prototype,"ignoreCase",void 0),Lt([C.Property("contains")],Ft.prototype,"operator",void 0),Lt([C.Property()],Ft.prototype,"key",void 0),Lt([C.Property()],Ft.prototype,"hierarchyMode",void 0),Ft);function Ft(){return null!==zt&&zt.apply(this,arguments)||this}jt=function(e,t){return(jt=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])}))(e,t)};var jt,_t,Lt=function(e,t){function i(){this.constructor=e}jt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Lt=(_t=C.ChildProperty,Lt(Ht,_t),n([C.Property("Row")],Ht.prototype,"mode",void 0),n([C.Property("Flow")],Ht.prototype,"cellSelectionMode",void 0),n([C.Property("Single")],Ht.prototype,"type",void 0),n([C.Property(!1)],Ht.prototype,"persistSelection",void 0),n([C.Property("Default")],Ht.prototype,"checkboxMode",void 0),n([C.Property(!1)],Ht.prototype,"checkboxOnly",void 0),n([C.Property(!0)],Ht.prototype,"enableToggle",void 0),Ht);function Ht(){return null!==_t&&_t.apply(this,arguments)||this}Qt.prototype.RowModifier=function(t){var i,r,e,n;t.data&&(e=(i=t.data).parentItem,C.isNullOrUndefined(i.parentItem)||Et(this.parent)||this.parent.allowPaging&&"Root"!==this.parent.pageSettings.pageSizeMode&&(!S(this.parent)||v(this.parent))||(!this.parent.initialRender||(C.isNullOrUndefined(e[this.parent.expandStateMapping])||e[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll)&&y(this.parent,t.data,this.parent.grid.getCurrentViewRecords())||C.isNullOrUndefined(t.row)||(this.parent.toggleRowVisibility(t.row,"e-childrow-hidden"),e=this.parent.grid.getRowsObject(),this.parent.grid.isFrozenGrid())||C.isNullOrUndefined(t.row.getAttribute("data-uid"))||(e.filter(function(e){return e.uid===t.row.getAttribute("data-uid")})[0].visible=!1),S(this.parent)&&!v(this.parent)&&(r=this.parent,0<(e=this.parent.getCurrentViewRecords().filter(function(e){return C.getValue(r.idMapping,e)===C.getValue(r.parentIdMapping,i)})).length)&&!e[0].isSummaryRow&&!C.isNullOrUndefined(t.row)&&(e=e[0].expanded?"e-childrow-visible":"e-childrow-hidden",this.parent.toggleRowVisibility(t.row,e)),w.getObject("isSummaryRow",t.data)&&C.addClass([t.row],"e-summaryrow"),C.isNullOrUndefined(t.row)||(t.row.querySelector(".e-treegridexpand")?t.row.setAttribute("aria-expanded","true"):t.row.querySelector(".e-treegridcollapse")&&t.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&(C.isNullOrUndefined(i.parentItem)||this.parent.toggleRowVisibility(t.row,"e-childrow-hidden"))),this.parent.rowDragAndDropModule&&this.parent.grid.rowDragAndDropModule&&(this.parent.grid.rowDragAndDropModule.dragStartData||this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.getContentTable().scrollHeight<=this.parent.getContent().clientHeight&&(this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length-1].uniqueID!==t.data.uniqueID||C.isNullOrUndefined(t.row)||t.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(t.row,!0)),this.parent.isReact?(n=this).parent.renderReactTemplates(function(){n.parent.trigger(Se,t)}):this.parent.trigger(Se,t))},Qt.prototype.cellRender=function(e){if(e.data){var t=this.parent.grid,i=e.data,r=C.isNullOrUndefined(i.filterLevel)?i.level:i.filterLevel,n=0,o=this.parent.getColumnByUid(e.column.uid),a=i.isSummaryRow,s=this.parent.getFrozenColumns(),d=(C.isNullOrUndefined(i.parentItem)?i:i.parentItem).index,l=this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):t.getColumnIndexByUid(e.column.uid);if(l!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!C.isNullOrUndefined(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var p=C.createElement("div",{className:"e-treecolumn-container"}),h=C.createElement("span",{className:"e-icons e-none"});h.style.width="10px",h.style.display="inline-block";for(var c=0;c<r;c++)n+=10,p.appendChild(h.cloneNode());var u,g,l=C.isNullOrUndefined(i.hasFilteredChildRecords)?i.hasChildRecords:i.hasFilteredChildRecords;(l=l&&!C.isNullOrUndefined(i.childRecords)?this.parent.isFromGantt&&this.parent.loadChildOnDemand?i.hasChildRecords:!(0===i.childRecords.length):l)?(C.addClass([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",i.expanded?"true":"false"),l=C.createElement("span",{className:"e-icons"}),g=void 0,this.parent.initialRender?g=i.expanded&&(C.isNullOrUndefined(i[this.parent.expandStateMapping])||i[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll:(g=!(!i.expanded||!y(this.parent,i,this.parent.grid.getCurrentViewRecords())),"Cell"!==this.parent.editSettings.mode||S(this.parent)||(u=this.parent.flatData.find(function(e){return e.uniqueID===i.uniqueID}),C.isNullOrUndefined(u))||(g=(i.expanded!==u.expanded?u:i).expanded)),C.addClass([l],g?"e-treegridexpand":"e-treegridcollapse"),n+=18,p.appendChild(l),h.style.width="4px",n+=7,p.appendChild(h.cloneNode())):!r&&i.level||(n+=20,p.appendChild(h.cloneNode()),p.appendChild(h.cloneNode())),u=C.createElement("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(u.style.width="Calc(100% - "+n+"px)"),C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level),this.updateTreeCell(e,u),p.appendChild(u),e.cell.appendChild(p)}0<t.getFrozenLeftColumnsCount()||0<t.getFrozenRightColumnsCount()?(g=t.getFrozenRightColumns(),l=t.getFrozenLeftColumns(),m=t.getMovableColumns(),(0<g.length&&g[0].field===e.column.field||0<l.length&&l[0].field===e.column.field||0<m.length&&m[0].field===e.column.field)&&C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level)):(s>this.parent.treeColumnIndex&&0<s&&t.getColumnIndexByUid(e.column.uid)===s||s<this.parent.treeColumnIndex&&0<s&&(t.getColumnIndexByUid(e.column.uid)===s||t.getColumnIndexByUid(e.column.uid)===s-1)||s===this.parent.treeColumnIndex&&0<s&&t.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1)&&C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level),!C.isNullOrUndefined(o)&&o.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)&&(g=e.cell.querySelectorAll(".e-frame")[0],n=n+parseInt(g.style.width,16)+10,(u=t.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+n+"px)"),a&&(C.addClass([e.cell],"e-summarycell"),l=w.getObject(e.column.field,e.data),l=C.isNullOrUndefined(l)?null:l,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=l:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=l),this.parent.args=e;var f,m=C.getValue("columnModel",this.parent)[this.parent.treeColumnIndex];C.isNullOrUndefined(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template?this.parent.trigger(Ie,e):this.parent.isReact&&m.field!==e.column.field&&(f=this).parent.renderReactTemplates(function(){f.parent.trigger(Ie,e)})}},Qt.prototype.updateTreeCell=function(e,t){var i=C.getValue("columnModel",this.parent)[this.parent.treeColumnIndex],r="templateFn",n=e.column.index,n=(C.isNullOrUndefined(i.field)&&e.cell.setAttribute("aria-colindex",n+1+""),i.field!==e.column.field||C.isNullOrUndefined(i.template)||(e.column.template=i.template,e.column[r]=w.templateCompiler(e.column.template),e.cell.classList.add("e-templatecell")),(null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell"):e.cell).innerHTML);if("object"==typeof e.column.template&&this.templateResult)w.appendChildren(t,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var o=e.cell.children.length,a=this.parent.element.id+e.column.uid;if(i.field!==e.column.field||C.isNullOrUndefined(i.template))for(;0<o;o=e.cell.children.length)t.appendChild(e.cell.children[parseInt(0..toString(),10)]);else{var s,i="portals";this.parent.isReact&&"string"!=typeof e.column.template?(e.column[r](e.data,this.parent,"columnTemplate",a,null,null,t),C.isNullOrUndefined(this.parent.grid[i])&&(this.parent.grid[i]=this.parent[i]),this.parent.notify("renderReactTemplate",this.parent[i]),(s=this).parent.renderReactTemplates(function(){s.parent.trigger(Ie,e)})):(i=e.column[r](w.extend({index:""},e.data),this.parent,"template",a,this.parent.isStringTemplate),w.appendChildren(t,i)),delete e.column.template,delete e.column[r],e.cell.innerHTML=""}}else t.innerHTML=n,e.cell.innerHTML=""},Qt.prototype.refreshReactColumnTemplateByUid=function(d){var l=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var e=l.parent.grid.getRowsObject(),t=l.parent.getDataRows(),i=l.parent.grid.getIndentCount(),r=l.parent.grid.getNormalizedColumnIndex(d);if(0!==t.length)for(var n,o,a,s=0;s<e.length;s++)e[parseInt(s.toString(),10)].isDataRow&&!C.isNullOrUndefined(e[parseInt(s.toString(),10)].index)&&(n=e[parseInt(s.toString(),10)].cells[parseInt(r.toString(),10)],a=new w.CellRenderer(l.parent.grid,l.parent.grid.serviceLocator),o=t.length>=e.length?l.parent.getCellFromIndex(e[parseInt(s.toString(),10)].index,r-i):t[e[parseInt(s.toString(),10)].index].querySelector(".e-templatecell"),a.refreshTD(o,n,e[parseInt(s.toString(),10)].data,{index:e[parseInt(s.toString(),10)].index}),a=l.parent.getRows()[parseInt(s.toString(),10)].cells[parseInt(r.toString(),10)],l.cellRender({data:e[parseInt(s.toString(),10)].data,cell:a,column:n.column}))})},Qt.prototype.columnTemplateResult=function(e){this.templateResult=e.template},Qt.prototype.reactTemplateRender=function(e,t){var i="portals";this.parent[i]=e,this.parent.notify("renderReactTemplate",this.parent[i]),this.parent.renderReactTemplates(t)},Qt.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)};var Gt=Qt;function Qt(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}o.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on(Ve,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},o.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ve,this.collectExpandingRecs),this.parent.off("updateRemoteLevel",this.updateParentRemoteData),this.parent.off("updateAction",this.updateData),this.parent.off("dataProcessor",this.dataProcessor),this.parent.grid.off("sorting-begin",this.beginSorting))},o.prototype.destroy=function(){this.removeEventListener()},o.prototype.isRemote=function(){return this.parent.dataSource instanceof b.DataManager},o.prototype.convertToFlatData=function(e){var t,i,r=this;this.parent.flatData=C.isNullOrUndefined(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof b.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],S(this.parent)&&!v(this.parent)&&e instanceof b.DataManager&&!(e instanceof Array)?(t=this.parent.dataSource,this.parent.parentIdMapping&&(this.parent.query=C.isNullOrUndefined(this.parent.query)?new b.Query:this.parent.query,this.parent.parentIdMapping&&(i=this.parent.query.params.filter(function(e){return"IdMapping"===e.key}),this.parent.initialRender)&&!i.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping)),this.parent.hasChildMapping||((i=this.parent.query.clone()).queries=[],(i=i.select([this.parent.parentIdMapping])).isCountRequired=!0,t.executeQuery(i).then(function(e){r.parentItems=b.DataUtil.distinct(e.result,r.parent.parentIdMapping,!1),0===(e.result?0:1)&&(C.setValue("grid.contentModule.isLoaded",!0,r.parent),C.isNullOrUndefined(r.zerothLevelData)||(C.setValue("cancel",!1,r.zerothLevelData),C.getValue("grid.renderModule",r.parent).dataManagerSuccess(r.zerothLevelData),r.zerothLevelData=null),r.parent.grid.hideSpinner())})))):e instanceof Array&&this.convertJSONData(e)},o.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var t=Object.keys(e),i=0;i<t.length;i++){var r=e[parseInt(i.toString(),10)];this.hierarchyData.push(C.extend({},r)),C.isNullOrUndefined(r[this.parent.idMapping])||this.taskIds.push(r[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){for(var n=[],o=new b.DataManager(this.hierarchyData).executeLocal((new b.Query).group(this.parent.parentIdMapping)),i=0;i<o.length;i++){var a,s=o[parseInt(i.toString(),10)],d=this.taskIds.indexOf(s.key);!C.isNullOrUndefined(s.key)&&-1<d?(a=s.items,this.hierarchyData[parseInt(d.toString(),10)][this.parent.childMapping]=a):n.push.apply(n,s.items)}this.hierarchyData=this.selfReferenceUpdate(n)}var l;Object.keys(this.hierarchyData).length?this.createRecords(this.hierarchyData):(l=!(this.parent.dataSource instanceof b.DataManager)&&this.parent.isGantt,this.parent.flatData=l?this.parent.dataSource:[]),this.storedIndex=-1},o.prototype.selfReferenceUpdate=function(e){for(var t=[];0<this.hierarchyData.length&&0<e.length;){var i=e.indexOf(this.hierarchyData[0]);-1===i?this.hierarchyData.shift():(t.push(this.hierarchyData.shift()),e.splice(i,1))}return t},o.prototype.updateParentRemoteData=function(o){var a=this,e="actionArgs",s=(S(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===o[e].requestType&&this.parent.hideSpinner(),o.result);if(S(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===o[e].requestType||"clearFilter"===o[e].action||""===o[e].searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||!this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand)for(var d=this,t=0;t<s.length;t++)!function(t){var i,r,n,e;I(d.parent)&&s[parseInt(t.toString(),10)].hasChildRecords&&d.parent.initialRender&&(s[parseInt(t.toString(),10)].expanded=!1),S(d.parent)&&d.parent.enableVirtualization&&(i=[],r=d.parent,s.filter(function(e){e[""+r.parentIdMapping]===s[parseInt(t.toString(),10)][""+r.idMapping]&&i.push(e)}),i.length?s[parseInt(t.toString(),10)].expanded=!0:s[parseInt(t.toString(),10)].hasChildRecords&&(s[parseInt(t.toString(),10)].expanded=!1)),C.isNullOrUndefined(s[parseInt(t.toString(),10)].index)&&(s[parseInt(t.toString(),10)].taskData=C.extend({},s[parseInt(t.toString(),10)]),s[parseInt(t.toString(),10)].uniqueID=w.getUid(d.parent.element.id+"_data_"),C.setValue("uniqueIDCollection."+s[parseInt(t.toString(),10)].uniqueID,s[parseInt(t.toString(),10)],d.parent),S(d.parent)&&d.parent.enableVirtualization&&s[parseInt(t.toString(),10)][""+d.parent.parentIdMapping]&&(C.isNullOrUndefined(s[parseInt(t.toString(),10)].level)||0===s[parseInt(t.toString(),10)].level)?(n=s[parseInt(t.toString(),10)][""+d.parent.parentIdMapping],(e=s.find(function(e){return e[""+a.parent.idMapping]===n}))?s[parseInt(t.toString(),10)].level=e.level+1:(e=o.actual.flatData.find(function(e){return e[""+a.parent.idMapping]===n}),C.isNullOrUndefined(e[""+d.parent.parentIdMapping])?s[parseInt(t.toString(),10)].level=1:s[parseInt(t.toString(),10)].level=e.level+1)):s[parseInt(t.toString(),10)].level=0,s[parseInt(t.toString(),10)].index=Math.ceil(1e3*Math.random()),!s[parseInt(t.toString(),10)][d.parent.hasChildMapping]&&-1===d.parentItems.indexOf(s[parseInt(t.toString(),10)][d.parent.idMapping])||(s[parseInt(t.toString(),10)].hasChildRecords=!0),s[parseInt(t.toString(),10)].checkboxState="uncheck")}(t);else C.isNullOrUndefined(s)||!this.parent.loadChildOnDemand&&I(this.parent)&&!C.isNullOrUndefined(this.parent.dataResults.expandRecord)||S(this.parent)&&!this.parent.loadChildOnDemand&&o[e].isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(s);else this.zerothLevelData=o,C.setValue("cancel",!0,o);S(this.parent)&&!this.parent.loadChildOnDemand&&o[e].isExpandCollapse&&this.parent.enableVirtualization||S(this.parent)&&this.parent.enableVirtualization&&this.parent.loadChildOnDemand?o.result=s:o.result=this.parent.loadChildOnDemand?s:this.parent.flatData,S(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(e=o.query.queries.filter(function(e){return"onAggregates"===e.fn}),o.result=this.parent.summaryModule.calculateSummaryValue(e,this.parent.flatData,!0)),this.parent.notify("updateResults",o)},o.prototype.collectExpandingRecs=function(e,t){var i,r=this.parent.getRows();if(this.parent.rowTemplate&&(i=this.parent.getContentTable().rows,r=[].slice.call(i)),0<e.rows.length){t||(e.record.expanded=!0);for(var n=0;n<e.rows.length;n++){this.parent.toggleRowVisibility(e.rows[parseInt(n.toString(),10)],"e-childrow-visible"),this.parent.loadChildOnDemand||(a=e.rows[parseInt(n.toString(),10)].getElementsByClassName("e-treegridcollapse")[0],o=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(n.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(n.toString(),10)].getAttribute("data-uid")).data,!C.isNullOrUndefined(a)&&o.expanded&&(C.addClass([a],"e-treegridexpand"),C.removeClass([a],"e-treegridcollapse")),a=[],(a=r.filter(function(e){return e.querySelector(".e-gridrowindex"+o.index+"level"+(o.level+1))})).length&&o.expanded&&this.collectExpandingRecs({record:o,rows:a,parentRow:e.parentRow},!0));var o,a=e.rows[parseInt(n.toString(),10)].querySelector(".e-detailrowcollapse");C.isNullOrUndefined(a)||this.parent.grid.detailRowModule.expand(a)}this.parent.grid.pageSettings.totalRecordsCount+=e.rows.length}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},o.prototype.fetchRemoteChildData=function(g){var e,f=this,m={row:g.parentRow,data:g.record},t=this.parent.dataSource,i=this.parent.grid.getDataModule().generateQuery(),r=i.queries.filter(function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn}),r=(i.queries=r,i.isCountRequired=!0,parseInt(g.record[this.parent.idMapping],10));isNaN(r)&&(r=g.record[this.parent.idMapping].toString()),this.parent.enableVirtualization&&"remoteExpand"===g.action?(i.take(this.parent.grid.pageSettings.pageSize),(e=[]).push("ExpandingAction",r.toString()),i.expand(e)):this.parent.enableVirtualization&&"collapse"===g.action&&(i.take(this.parent.grid.pageSettings.pageSize),(e=[]).push("CollapsingAction",r.toString()),i.expand(e)),i.where(this.parent.parentIdMapping,"equal",g.record[this.parent.idMapping]),"remoteExpand"===g.action&&this.parent.grid.filterSettings&&this.parent.grid.filterSettings.columns.length&&(r=this.parent.grid.getDataModule().generateQuery().queries.filter(function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates}),i.queries.push(r[0])),V.showSpinner(this.parent.element),t.executeQuery(i).then(function(e){var o,a="remoteExpandedData",s="remoteCollapsedData",d=f.parent.grid.currentViewData.slice(),t=f.parent.idMapping;if(f.parent.isGantt&&f.parent.loadChildOnDemand&&f.parent.hasChildMapping){for(var i=0;i<f.parent.grid.currentViewData.length;i++)if(g.record[t]===f.parent.grid.currentViewData[i][t]){o=i;break}}else o=d.indexOf(g.record);if(f.parent.enableVirtualization&&("collapse"===g.action||"remoteExpand"===g.action))for(d=[],i=0;i<o;i++)d.push(f.parent.grid.currentViewData[parseInt(i.toString(),10)]);-1===o&&f.parent.grid.getRowsObject().forEach(function(e){e.data.uniqueID===g.record.uniqueID&&(o=e.index)});var l=w.getObject("actual.nextLevel",e),p=e.result,r=[];if("remoteExpand"===g.action&&f.parent.grid.filterModule&&f.parent.grid.filterModule.value){for(i=0;i<d.length;i++)Object.prototype.hasOwnProperty.call(d[parseInt(i.toString(),10)],f.parent.parentIdMapping)&&null!==d[parseInt(i.toString(),10)][""+f.parent.parentIdMapping]&&0===d[parseInt(i.toString(),10)].level&&(d.splice(i,1),i--);for(i=0;i<p.length;i++)g.record[""+f.parent.idMapping]!==p[parseInt(i.toString(),10)][""+f.parent.idMapping]&&g.record[""+f.parent.idMapping]===p[parseInt(i.toString(),10)][""+f.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(p,i)&&r.push(p[parseInt(i.toString(),10)]);p=r}if(f.parent.enableVirtualization&&"remoteExpand"===g.action){g.record.childRecords=[];for(i=0;i<p.length;i++)g.record[""+f.parent.idMapping]!==p[parseInt(i.toString(),10)][""+f.parent.idMapping]&&g.record[""+f.parent.idMapping]===p[parseInt(i.toString(),10)][""+f.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(p,i)&&g.record.childRecords.push(p[parseInt(i.toString(),10)])}else g.record.childRecords=p;for(var n=0;n<p.length;n++)!function(e){var t=p[parseInt(e.toString(),10)];if(f.parent.enableVirtualization&&t[""+f.parent.idMapping]===g.record[""+f.parent.idMapping]&&"remoteExpand"===g.action)f.parent[a].push(g.record);else if(f.parent.enableVirtualization&&t[""+f.parent.idMapping]===g.record[""+f.parent.idMapping]&&"collapse"===g.action)for(var i=0;i<f.parent[a].length;i++)g.record[""+f.parent.idMapping]===f.parent[a][parseInt(i.toString(),10)][""+f.parent.idMapping]&&f.parent[a].splice(i,1);if(t.taskData=C.extend({},t),t[""+f.parent.parentIdMapping]&&f.parent.enableVirtualization&&f.parent[a].length)for(var r,i=0;i<f.parent[a].length;i++)t[""+f.parent.parentIdMapping]===f.parent[a][parseInt(i.toString(),10)][""+f.parent.idMapping]&&(t.level=f.parent[a][parseInt(i.toString(),10)].level+1,delete(r=f.parent[a][parseInt(i.toString(),10)]).childRecords,t.parentItem=r,t.parentUniqueID=r.uniqueID);else f.parent.enableVirtualization?!t[""+f.parent.hasChildMapping]&&-1===f.parentItems.indexOf(t[""+f.parent.idMapping])||l&&!l[parseInt(e.toString(),10)]?(delete(r=C.extend({},g.record)).childRecords,t.parentItem=r,t.parentUniqueID=g.record.uniqueID):C.isNullOrUndefined(t[""+f.parent.parentIdMapping])?(t.level=0,"remoteExpand"===g.action&&(t.childRecords=[],t.childRecords=g.record.childRecords)):t.level=g.record.level:(t.level=g.record.level+1,delete(r=C.extend({},g.record)).childRecords,t.parentItem=r,t.parentUniqueID=g.record.uniqueID);if(t.index=Math.ceil(1e3*Math.random()),t.uniqueID=w.getUid(f.parent.element.id+"_data_"),g.record[""+f.parent.idMapping]===t[""+f.parent.idMapping]&&(g.record.uniqueID=t.uniqueID),t.checkboxState="uncheck",f.parent.enableVirtualization&&C.isNullOrUndefined(t.level))for(var n=0;n<f.parent.grid.currentViewData.length;n++)f.parent.grid.currentViewData[parseInt(n.toString(),10)][""+f.parent.idMapping]===t[""+f.parent.parentIdMapping]&&(t.level=f.parent.grid.currentViewData[parseInt(n.toString(),10)].level+1);if(C.setValue("uniqueIDCollection."+t.uniqueID,t,f.parent),(t[""+f.parent.hasChildMapping]||-1!==f.parentItems.indexOf(t[""+f.parent.idMapping]))&&(!l||l[parseInt(e.toString(),10)]))if(t.hasChildRecords=!0,f.parent.enableVirtualization&&!f.parent.loadChildOnDemand){for(i=0;i<f.parent[s].length;i++)t[""+f.parent.idMapping]===f.parent[s][parseInt(i.toString(),10)][""+f.parent.idMapping]&&(t.expanded=f.parent[s][parseInt(i.toString(),10)].expanded);if("collapse"===g.action&&t[""+f.parent.idMapping]!==g.record[""+f.parent.idMapping]&&!1!==t.expanded)t.expanded=!0;else if("collapse"===g.action&&t[""+f.parent.idMapping]===g.record[""+f.parent.idMapping])t.expanded=!1,f.parent[s].push(g.record);else if("remoteExpand"===g.action){for(i=0;i<f.parent.grid.currentViewData.length;i++)f.parent.grid.currentViewData[parseInt(i.toString(),10)][""+f.parent.idMapping]===t[""+f.parent.idMapping]&&p.splice(e,1,f.parent.grid.currentViewData[parseInt(i.toString(),10)]);if(t[f.parent.idMapping]===g.record[""+f.parent.idMapping])for(i=0;i<f.parent[s].length;i++)g.record[""+f.parent.idMapping]===f.parent[s][parseInt(i.toString(),10)][""+f.parent.idMapping]&&f.parent[s].splice(i,1);!1!==t.expanded&&(t.expanded=!0)}}else f.parent.enableVirtualization&&t[""+f.parent.idMapping]===g.record[""+f.parent.idMapping]&&"collapse"!==g.action?t.expanded=!0:f.parent.enableVirtualization&&!f.parent.loadChildOnDemand||(t.expanded=!1);d.some(function(e){return e[""+f.parent.idMapping]===t[f.parent.idMapping]})||d.splice(o+e+1,0,t)}(n);var h=f.parent.idMapping,c=(f.parent.enableVirtualization&&f.parent.loadChildOnDemand&&d.sort(function(e,t){return e[""+h]-t[""+h]}),C.setValue("result",d,e),C.setValue("action","beforecontentrender",e),f.parent.trigger(Ce,e),V.hideSpinner(f.parent.element),0<f.parent.grid.aggregates.length&&!f.parent.enableVirtualization&&(c=w.getObject("query",e),C.isNullOrUndefined(c)&&(c=C.getValue("grid.renderModule.data",f.parent).aggregateQuery(new b.Query)),C.isNullOrUndefined(c)||(c=c.queries.filter(function(e){return"onAggregates"===e.fn}),e.result=f.parent.summaryModule.calculateSummaryValue(c,e.result,!0))),"remoteExpand"===g.action&&f.parent.allowPaging&&"All"===f.parent.pageSettings.pageSizeMode&&(f.parent.grid.pageSettings.totalRecordsCount=f.parent.grid.pageSettings.totalRecordsCount+p.length),f.parent.enableVirtualization&&(f.parent.grid.pageSettings.totalRecordsCount=e.count),e.count=f.parent.grid.pageSettings.totalRecordsCount,{}),u=(f.parent.enableVirtualization&&f.remoteVirtualAction(c),{index:o,childData:p});f.parent.enableInfiniteScrolling?f.parent.notify("infinite-remote-expand",u):C.getValue("grid.renderModule",f.parent).dataManagerSuccess(e,c),f.parent.trigger(Ue,m)})},o.prototype.remoteVirtualAction=function(e){e.requestType="refresh",C.setValue("isExpandCollapse",!0,e);var e=C.getValue("grid.contentModule",this.parent),t=C.getValue("currentInfo",e),e=C.getValue("prevInfo",e);t.loadNext&&this.parent.grid.pageSettings.currentPage===t.nextInfo.page&&!this.parent.loadChildOnDemand&&(this.parent.grid.pageSettings.currentPage=e.page)},o.prototype.beginSorting=function(){var e;this.isSortAction=!0,S(this.parent)&&this.parent.enableVirtualization&&(-1!==(e=this.parent.query.queries.indexOf(this.parent.query.queries.filter(function(e){return"onSortBy"===e.fn})[0]))&&this.parent.query.queries.splice(e,1),0===this.parent.grid.sortSettings.columns.length)&&this.parent.query.sortBy(null,null)},o.prototype.createRecords=function(e,t){for(var i=[],r=0,n=Object.keys(e).length;r<n;r++){var o=C.extend({},e[parseInt(r.toString(),10)]),a=(o.taskData=e[parseInt(r.toString(),10)],0),s=(this.storedIndex++,Object.prototype.hasOwnProperty.call(o,"index")||(o.index=this.storedIndex),o[this.parent.childMapping]),d=!C.isNullOrUndefined(s)&&0<s.length,l=I(this.parent),p=o[this.parent.hasChildMapping],h=(o.hasChildRecords=!!(d&&!l||p&&l),(!C.isNullOrUndefined(s)&&!l||p&&l)&&(this.parent.enableCollapseAll||!C.isNullOrUndefined(this.parent.dataStateChange)&&C.isNullOrUndefined(s)?o.expanded=!1:o.expanded=!!C.isNullOrUndefined(o[this.parent.expandStateMapping])||o[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(o,"index")||(o.index=(o.hasChildRecords,this.storedIndex)),this.isSelfReference&&C.isNullOrUndefined(o[this.parent.parentIdMapping])&&this.parent.parentData.push(o),o.uniqueID=w.getUid(this.parent.element.id+"_data_"),C.setValue("uniqueIDCollection."+o.uniqueID,o,this.parent),C.isNullOrUndefined(t)||(delete(d=C.extend({},t)).childRecords,delete d[this.parent.childMapping],this.isSelfReference&&delete d.taskData[this.parent.childMapping],o.parentItem=d,o.parentUniqueID=d.uniqueID,a=t.level+1),Object.prototype.hasOwnProperty.call(o,"level")||(o.level=a),o.checkboxState="uncheck","remoteCollapsedData");if(this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&S(this.parent)&&!this.parent.initialRender){if(!o.hasChildRecords&&C.isNullOrUndefined(o[""+this.parent.parentIdMapping])){o.hasChildRecords=!0;for(var c=0;c<this.parent[h].length;c++)this.parent[h][parseInt(c.toString(),10)][""+this.parent.idMapping]===o[""+this.parent.idMapping]&&(o.expanded=!1)}else 0===o.level&&C.isNullOrUndefined(t)&&!o.hasChildRecords&&(o.level=o.level+1);o[""+this.parent.hasChildMapping]&&!C.isNullOrUndefined(o[""+this.parent.expandStateMapping])&&(o.expanded=o[""+this.parent.expandStateMapping],o.hasChildRecords=!0),this.parent.flatData.push(o)}else(C.isNullOrUndefined(o[""+this.parent.parentIdMapping])||o.parentItem)&&(!C.isNullOrUndefined(this.parent.rowDropSettings.targetID)&&this.parent.rowDragAndDropModule.isDuplicateData(o)||this.parent.flatData.push(o),this.parent.infiniteScrollData.push(o));this.isSelfReference||0!==o.level||this.parent.parentData.push(o),C.isNullOrUndefined(o[this.parent.childMapping]&&o[this.parent.childMapping].length)||(p=this.createRecords(o[this.parent.childMapping],o),o.childRecords=p),i.push(o)}return i},o.prototype.dataProcessor=function(e){var t=w.getObject("isExport",e),i=w.getObject("expresults",e),r=w.getObject("exportType",e),n=w.getObject("isPrinting",e),o=w.getObject("actionArgs",e),a=w.getObject("requestType",e),s=w.getObject("data",e),d=w.getObject("action",e),l=o,p=this.parent.getPrimaryKeyFieldNames()[0],h=w.getObject("data",l),l=(C.isNullOrUndefined(l)||C.isNullOrUndefined(l.action)||"add"!==l.action||C.isNullOrUndefined(l.data)||!C.isNullOrUndefined(l.data[""+p])||(l.data[""+p]=e.result[l.index][""+p],h.taskData[""+p]=e.result[l.index][""+p]),(!C.isNullOrUndefined(o)&&Object.keys(o).length||"save"===a)&&(a=a||o.requestType,s=s||w.getObject("data",o),d=d||w.getObject("action",o),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData)&&this.updateAction(s,d,a),(h=t&&!C.isNullOrUndefined(i)?i:I(this.parent)?C.getValue("result",this.parent.grid.dataSource):this.parent.grid.dataSource)instanceof b.DataManager?h.dataSource.json:h),p=(I(this.parent)?C.getValue("count",this.parent.dataSource):l.length,new b.Query),o=w.getObject("query",e);if(C.isNullOrUndefined(o)||(S=o.queries.filter(function(e){return"onWhere"===e.fn}),m=o.queries.filter(function(e){return"onSearch"===e.fn})),(this.parent.grid.allowFiltering&&this.parent.grid.filterSettings.columns.length||0<this.parent.grid.searchSettings.key.length||!C.isNullOrUndefined(o)&&(S.length||m.length)&&this.parent.isLocalData)&&(C.isNullOrUndefined(o)&&(o=new b.Query,o=C.getValue("grid.renderModule.data",this.parent).filterQuery(o),o=C.getValue("grid.renderModule.data",this.parent).searchQuery(o)),s=o.queries.filter(function(e){return"onWhere"===e.fn}),d=o.queries.filter(function(e){return"onSearch"===e.fn}),p.queries=s.concat(d),a=new b.DataManager(l).executeLocal(p),this.parent.notify("updateFilterRecs",{data:a}),l=this.dataResults.result,this.dataResults.result=null,0<this.parent.grid.aggregates.length)&&(c=w.getObject("query",e),C.isNullOrUndefined(o)&&(o=C.getValue("grid.renderModule.data",this.parent).aggregateQuery(new b.Query)),C.isNullOrUndefined(c)||(y=c.queries.filter(function(e){return"onAggregates"===e.fn}),l=this.parent.summaryModule.calculateSummaryValue(y,l,!0))),this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(i=w.getObject("query",e),y=(i=C.isNullOrUndefined(i)?C.getValue("grid.renderModule.data",this.parent).aggregateQuery(new b.Query):i).queries.filter(function(e){return"onAggregates"===e.fn}),l=this.parent.summaryModule.calculateSummaryValue(y,this.parent.flatData,!0)),0<this.parent.grid.sortSettings.columns.length||this.isSortAction){this.isSortAction=!1;for(var h=this.parent.parentData,c=w.getObject("query",e),u=new b.Query,g=this.parent.grid.sortSettings.columns.length-1;0<=g;g--){var f=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].field),f=f.sortComparer&&v(this.parent)?f.sortComparer.bind(f):this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].direction;u.sortBy(this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].field,f)}var m,y,S=new b.DataManager(h).executeLocal(u),d=(this.parent.allowRowDragAndDrop&&!C.isNullOrUndefined(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition&&(m=S.indexOf(this.parent.rowDragAndDropModule.draggedRecord),S.splice(m,1),s=S.indexOf(this.parent.rowDragAndDropModule.droppedRecord),this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?S.splice(s,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&S.splice(s+1,0,this.parent.rowDragAndDropModule.draggedRecord)),{modifiedData:S,filteredData:l,srtQry:u});this.parent.notify("createSort",d),l=d.modifiedData,this.dataResults.result=null,this.sortedData=l,this.parent.notify("updateModel",{}),0<this.parent.grid.aggregates.length&&!C.isNullOrUndefined(c)&&(y=w.getObject("query",e).queries.filter(function(e){return"onAggregates"===e.fn}),l=this.parent.summaryModule.calculateSummaryValue(y,this.sortedData,!1))}p=I(this.parent)?C.getValue("count",this.parent.dataSource):l.length,a=this.paging(l,p,t,n,r,e);l=a.result,p=a.count,e.result=l,e.count=p,this.parent.notify("updateResults",e)},o.prototype.paging=function(e,t,i,r,n,o){!this.parent.allowPaging||i&&"CurrentPage"!==n||r&&"CurrentPage"!==this.parent.printMode?!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||i&&"CurrentPage"!==n||"save"===C.getValue("requestType",o)||(i=this.parent.enableInfiniteScrolling?o:C.getValue("actionArgs",o),this.parent.notify(ze,{result:e,count:t,actionArgs:i}),e=this.dataResults.result,t=this.dataResults.count):(this.parent.notify(ze,{result:e,count:t,actionArgs:o}),e=this.dataResults.result,t=I(this.parent)?C.getValue("count",this.parent.dataSource):this.dataResults.count);n="isCollapsedStatePersist";if((!0===r||o.isPdfExport&&(C.isNullOrUndefined(o[n])||o[n]))&&"AllPages"===this.parent.printMode){for(var a=[],s=0;s<e.length;s++)y(this.parent,e[parseInt(s.toString(),10)],this.parent.parentData)&&a.push(e[parseInt(s.toString(),10)]);t=(e=a).length}return{result:e,count:t}},o.prototype.updateData=function(e){this.dataResults=e},o.prototype.updateAction=function(e,t,i){"delete"!==i&&"save"!==i||this.parent.notify(Ge,{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify(nt,{})};var Kt=o;function o(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!C.isNullOrUndefined(this.parent.parentIdMapping)}(n=r.ToolbarItem||(r.ToolbarItem={}))[n.Add=0]="Add",n[n.Edit=1]="Edit",n[n.Update=2]="Update",n[n.Delete=3]="Delete",n[n.Cancel=4]="Cancel",n[n.Search=5]="Search",n[n.ExpandAll=6]="ExpandAll",n[n.CollapseAll=7]="CollapseAll",n[n.ExcelExport=8]="ExcelExport",n[n.PdfExport=9]="PdfExport",n[n.CsvExport=10]="CsvExport",n[n.Print=11]="Print",n[n.RowIndent=12]="RowIndent",n[n.RowOutdent=13]="RowOutdent",(n=r.ContextMenuItems||(r.ContextMenuItems={}))[n.AutoFit=0]="AutoFit",n[n.AutoFitAll=1]="AutoFitAll",n[n.SortAscending=2]="SortAscending",n[n.SortDescending=3]="SortDescending",n[n.Edit=4]="Edit",n[n.Delete=5]="Delete",n[n.Save=6]="Save",n[n.Cancel=7]="Cancel",n[n.PdfExport=8]="PdfExport",n[n.ExcelExport=9]="ExcelExport",n[n.CsvExport=10]="CsvExport",n[n.FirstPage=11]="FirstPage",n[n.PrevPage=12]="PrevPage",n[n.LastPage=13]="LastPage",n[n.NextPage=14]="NextPage",n[n.AddRow=15]="AddRow",n[n.RowIndent=16]="RowIndent",n[n.RowOutdent=17]="RowOutdent";Wt=function(e,t){return(Wt=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])}))(e,t)};var Wt,Yt,n=function(e,t){function i(){this.constructor=e}Wt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},a=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},n=(Yt=C.ChildProperty,n(Jt,Yt),a([C.Property(12)],Jt.prototype,"pageSize",void 0),a([C.Property(8)],Jt.prototype,"pageCount",void 0),a([C.Property(1)],Jt.prototype,"currentPage",void 0),a([C.Property()],Jt.prototype,"totalRecordsCount",void 0),a([C.Property(!1)],Jt.prototype,"enableQueryString",void 0),a([C.Property(!1)],Jt.prototype,"pageSizes",void 0),a([C.Property(null)],Jt.prototype,"template",void 0),a([C.Property("All")],Jt.prototype,"pageSizeMode",void 0),Jt);function Jt(){return null!==Yt&&Yt.apply(this,arguments)||this}Xt=function(e,t){return(Xt=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])}))(e,t)};var Xt,$t,a=function(e,t){function i(){this.constructor=e}Xt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},s=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Zt=($t=C.ChildProperty,a(d,$t),d.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},d.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},d.prototype.getFormatter=function(){return this.formatFn},d.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[C.getEnumValue(w.CellType,w.CellType.Summary)]={fn:C.compile(this.footerTemplate,e),property:"footerTemplate"})},d.prototype.getTemplate=function(e){return this.templateFn[C.getEnumValue(w.CellType,e)]},d.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},s([C.Property()],d.prototype,"type",void 0),s([C.Property()],d.prototype,"footerTemplate",void 0),s([C.Property()],d.prototype,"field",void 0),s([C.Property()],d.prototype,"format",void 0),s([C.Property()],d.prototype,"columnName",void 0),s([C.Property()],d.prototype,"customAggregate",void 0),d);function d(){var e=null!==$t&&$t.apply(this,arguments)||this;return e.intl=new C.Internationalization,e.templateFn={},e}ei=C.ChildProperty,a(ti,ei),s([C.Collection([],Zt)],ti.prototype,"columns",void 0),s([C.Property(!0)],ti.prototype,"showChildSummary",void 0);var ei,a=ti;function ti(){return null!==ei&&ei.apply(this,arguments)||this}ii=function(e,t){return(ii=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])}))(e,t)};var ii,ri,s=function(e,t){function i(){this.constructor=e}ii(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},s=(ri=C.ChildProperty,s(p,ri),l([C.Property(!1)],p.prototype,"allowAdding",void 0),l([C.Property(!1)],p.prototype,"allowEditing",void 0),l([C.Property(!1)],p.prototype,"allowDeleting",void 0),l([C.Property("Cell")],p.prototype,"mode",void 0),l([C.Property("Top")],p.prototype,"newRowPosition",void 0),l([C.Property(!0)],p.prototype,"allowEditOnDblClick",void 0),l([C.Property(!0)],p.prototype,"showConfirmDialog",void 0),l([C.Property(!1)],p.prototype,"showDeleteConfirmDialog",void 0),l([C.Property("")],p.prototype,"template",void 0),l([C.Property({})],p.prototype,"dialog",void 0),l([C.Property(!1)],p.prototype,"allowNextRowEdit",void 0),p);function p(){return null!==ri&&ri.apply(this,arguments)||this}ni=function(e,t){return(ni=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])}))(e,t)};var ni,oi,l=function(e,t){function i(){this.constructor=e}ni(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ai=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},si=(oi=C.ChildProperty,l(di,oi),ai([C.Property()],di.prototype,"field",void 0),ai([C.Property()],di.prototype,"direction",void 0),di);function di(){return null!==oi&&oi.apply(this,arguments)||this}li=C.ChildProperty,l(pi,li),ai([C.Collection([],si)],pi.prototype,"columns",void 0),ai([C.Property(!0)],pi.prototype,"allowUnsort",void 0);var li,l=pi;function pi(){return null!==li&&li.apply(this,arguments)||this}function hi(e,o,a,s,t,d,i){var l,p,r=e.value,h=e.action,c=o.grid.getPrimaryKeyFieldNames()[0],u=o.dataSource instanceof b.DataManager?o.dataSource.dataSource.json:o.dataSource,g=[],f=r,n=!1;if("Batch"===o.editSettings.mode&&(p=o.grid.editModule.getBatchChanges()),("add"===h||"batchsave"===h&&"Batch"===o.editSettings.mode&&p.addedRecords.length)&&(r=(e=function(e,t,i,r,n,o){var a,s=!1,d=i.grid.getCurrentViewRecords();switch(a=Ut(a=C.extend({},e.value)),i.editSettings.newRowPosition){case"Top":t.unshift(a),s=!0;break;case"Bottom":t.push(a),s=!0;break;case"Above":a=C.isNullOrUndefined(o)?Ut(a=C.extend({},d[r+1])):Ut(a=C.extend({},o));break;case"Below":case"Child":var l,p;C.isNullOrUndefined(o)?(l=i.grid.getPrimaryKeyFieldNames()[0],p=d[parseInt(r.toString(),10)],a=Ut(a=!C.isNullOrUndefined(p)&&p[""+l]===e.value[""+l]||-1!==n?C.extend({},p):C.extend({},e.value)),i.editModule.internalProperties.taskData=a):a=Ut(a=C.extend({},o)),-1===n&&(t.unshift(a),s=!0)}return{value:a,isSkip:s}}(e,u,o,s,t,i)).value,n=e.isSkip),r instanceof Array?g=D(r):g.push(C.extend({},r)),!n&&("add"!==h||"Top"!==o.editSettings.newRowPosition&&"Bottom"!==o.editSettings.newRowPosition))for(var m=0;m<g.length;m++){"object"==typeof g[parseInt(m.toString(),10)][""+c]&&(g[parseInt(m.toString(),10)]=g[parseInt(m.toString(),10)][""+c]);for(var y=g[parseInt(m.toString(),10)].taskData?Object.keys(g[parseInt(m.toString(),10)].taskData):Object.keys(g[parseInt(m.toString(),10)]),S=u.length,w=function(){if(u[parseInt(S.toString(),10)][""+c]===g[parseInt(m.toString(),10)][""+c]){if("delete"!==h){var e;if("edit"===h)for(l=0;l<y.length;l++)Object.prototype.hasOwnProperty.call(u[parseInt(S.toString(),10)],y[parseInt(l.toString(),10)])&&("Cell"!==o.editSettings.mode||!C.isNullOrUndefined(p)&&0===p.changedRecords.length||y[parseInt(l.toString(),10)]===d)&&(e=x(o,g[parseInt(m.toString(),10)].uniqueID),u[parseInt(S.toString(),10)][y[parseInt(l.toString(),10)]]=g[parseInt(m.toString(),10)][y[parseInt(l.toString(),10)]],e)&&e.taskData&&(e.taskData[y[parseInt(l.toString(),10)]]=e[y[parseInt(l.toString(),10)]]=u[parseInt(S.toString(),10)][y[parseInt(l.toString(),10)]]);else"add"!==h&&"batchsave"!==h||("Child"===o.editSettings.newRowPosition?a?(f.taskData[""+o.parentIdMapping]=u[parseInt(S.toString(),10)][""+o.idMapping],u.splice(S+1,0,f.taskData)):(Object.prototype.hasOwnProperty.call(u[parseInt(S.toString(),10)],o.childMapping)||(u[parseInt(S.toString(),10)][""+o.childMapping]=[]),u[parseInt(S.toString(),10)][""+o.childMapping].push(f.taskData),M(c,u[parseInt(S.toString(),10)],h,o,a,f)):"Below"===o.editSettings.newRowPosition?(u.splice(S+1,0,f.taskData),C.isNullOrUndefined(f.parentItem)||M(c,u[S+1],h,o,a,f)):s?"Above"===o.editSettings.newRowPosition&&(u.splice(S,0,f.taskData),C.isNullOrUndefined(f.parentItem)||M(c,u[parseInt(S.toString(),10)],h,o,a,f)):u.splice(0,0,f.taskData));return"break"}var t=u[parseInt(S.toString(),10)];if(u.splice(S,1),a){if(!C.isNullOrUndefined(t[""+o.parentIdMapping]))for(var i=o.flatData.filter(function(e){return e[""+o.idMapping]===t[""+o.parentIdMapping]})[0],r=i?i[""+o.childMapping]:[],n=r.length-1;0<=n;n--)if(r[parseInt(n.toString(),10)][""+o.idMapping]===t[""+o.idMapping]){o.enableImmutableMode||i.childRecords.length!==i.Children.length||i.childRecords.splice(n,1),r.splice(n,1),r.length||(i.hasChildRecords=!1,M(c,i,h,o,a));break}return"break"}}else!C.isNullOrUndefined(u[parseInt(S.toString(),10)][""+o.childMapping])&&function e(t,i,r,n,o,a,s,d){var l=!1;var p=t.length;for(;p--&&0<=p;)if(t[parseInt(p.toString(),10)][""+n]===i[""+n]||a&&t[parseInt(p.toString(),10)][o.parentIdMapping]===i[o.idMapping]){if("edit"===r){for(var h,c=Object.keys(i),u=x(o,i.uniqueID),g=0;g<c.length;g++)!Object.prototype.hasOwnProperty.call(t[parseInt(p.toString(),10)],c[parseInt(g.toString(),10)])||"Cell"===o.editSettings.mode&&c[parseInt(g.toString(),10)]!==d||(u[c[parseInt(g.toString(),10)]]=u.taskData[c[parseInt(g.toString(),10)]]=t[parseInt(p.toString(),10)][c[parseInt(g.toString(),10)]]=i[c[parseInt(g.toString(),10)]],"Normal"!==o.grid.editSettings.mode)||"Cell"!==o.editSettings.mode||C.isNullOrUndefined(o.grid.editModule)||(h="editModule",o.grid.editModule[h].editRowIndex=i.index,o.grid.editModule[h].updateCurrentViewData(i));break}"add"===r||"batchsave"===r?"Child"===o.editSettings.newRowPosition?(a?(s[""+o.parentIdMapping]=t[parseInt(p.toString(),10)][o.idMapping],t.splice(p+1,0,s)):(Object.prototype.hasOwnProperty.call(t[parseInt(p.toString(),10)],o.childMapping)||(t[parseInt(p.toString(),10)][o.childMapping]=[]),t[parseInt(p.toString(),10)][o.childMapping].push(s.taskData)),M(n,t[parseInt(p.toString(),10)],r,o,a,s)):"Above"===o.editSettings.newRowPosition?(t.splice(p,0,s.taskData),C.isNullOrUndefined(s.parentItem)||M(n,t[parseInt(p.toString(),10)],r,o,a,s)):"Below"===o.editSettings.newRowPosition&&(t.splice(p+1,0,s.taskData),C.isNullOrUndefined(s.parentItem)||M(n,t[parseInt(p.toString(),10)],r,o,a,s)):(t.splice(p,1),t.length||(l=!0))}else C.isNullOrUndefined(t[parseInt(p.toString(),10)][o.childMapping])||e(t[parseInt(p.toString(),10)][o.childMapping],i,r,n,o,a,s,d)&&M(n,t[parseInt(p.toString(),10)],r,o,a);return l}(u[parseInt(S.toString(),10)][""+o.childMapping],g[parseInt(m.toString(),10)],h,c,o,a,f,d)&&M(c,u[parseInt(S.toString(),10)],h,o,a)};S--&&0<=S;)if("break"===w())break}}function M(i,r,e,t,n,o){if("Above"!==t.editSettings.newRowPosition&&"Below"!==t.editSettings.newRowPosition||"add"!==e&&"batchsave"!==e||C.isNullOrUndefined(o.parentItem)){for(var a,s=t.grid.getCurrentViewRecords(),d=(s.map(function(e,t){e[""+i]===r[""+i]&&(a=t)}),t.enableVirtualization&&C.isNullOrUndefined(a)&&(h=C.getValue("uniqueIDCollection."+o.parentUniqueID,t),r=h),C.isNullOrUndefined(a)||(r=s[parseInt(a.toString(),10)]),t.enableVirtualization&&C.isNullOrUndefined(r)&&!C.isNullOrUndefined(o)&&(r=C.getValue("uniqueIDCollection."+o.parentUniqueID,t)),n||C.isNullOrUndefined(r.childRecords)||!r.childRecords.length?r.hasChildRecords=!1:r.hasChildRecords=!0,"add"!==e&&"batchsave"!==e||(r.expanded=!0,r.hasChildRecords=!0,h=(o=t.sortSettings.columns.length&&C.isNullOrUndefined(o)?s.filter(function(e){return e.parentUniqueID===r.uniqueID?e:null}):o)?o instanceof Array?o[0]:o:s[a+1],"Below"!==t.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(r,"childRecords")?C.isNullOrUndefined(o)||r[""+i]===o[""+i]||r.childRecords.some(function(e){return e.uniqueID===o.uniqueID})||r.childRecords.push(o):r.childRecords=[],-1===r.childRecords.indexOf(h)&&r[""+i]!==o[""+i]&&r.childRecords.unshift(h),n)&&(Object.prototype.hasOwnProperty.call(r,t.childMapping)||(r[t.childMapping]=[]),-1===r[""+t.childMapping].indexOf(h))&&r[""+i]!==o[""+i]&&r[t.childMapping].unshift(h)),t.grid.getPrimaryKeyFieldNames()[0]),l=t.grid.dataSource instanceof b.DataManager?t.grid.dataSource.dataSource.json:t.grid.dataSource,p=0;p<l.length;p++)if(l[parseInt(p.toString(),10)][""+d]===r[""+d]){l[parseInt(p.toString(),10)]=r;break}t.grid.setRowData(i,r);var h,s=t.getRowByIndex(a),n=("Batch"===t.editSettings.mode&&(s="add"===e?t.getRows()[t.grid.getCurrentViewRecords().indexOf(r)]:t.getRows()[t.grid.getRowIndexByPrimaryKey(r[""+i])]),void 0);(t.frozenRows||t.getFrozenColumns())&&(n=t.getRowByIndex(a)),(t.enableVirtualization||C.isNullOrUndefined(s))&&C.isNullOrUndefined(n)||(h=t.treeColumnIndex,t.allowRowDragAndDrop&&t.enableImmutableMode&&(h+=1),t.renderModule.cellRender({data:r,cell:s.cells[parseInt(h.toString(),10)]?s.cells[parseInt(h.toString(),10)]:n.cells[h-t.getFrozenColumns()],column:t.grid.getColumns()[t.treeColumnIndex],requestType:e}),(t.enableImmutableMode&&"indenting"===t.action||"outdenting"===t.action)&&t.renderModule.RowModifier({data:r,row:s}))}else x(t,o.parentItem.uniqueID).childRecords.push(o)}ci=function(e,t){return(ci=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])}))(e,t)};var ci,ui,ai=function(e,t){function i(){this.constructor=e}ci(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},gi=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},ai=(ui=C.ChildProperty,ai(fi,ui),gi([C.Property(!1)],fi.prototype,"enableCache",void 0),gi([C.Property(3)],fi.prototype,"maxBlocks",void 0),gi([C.Property(3)],fi.prototype,"initialBlocks",void 0),fi);function fi(){return null!==ui&&ui.apply(this,arguments)||this}mi=function(e,t){return(mi=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])}))(e,t)};var mi,yi,gi=function(e,t){function i(){this.constructor=e}mi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Si=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},gi=(yi=C.ChildProperty,gi(wi,yi),Si([C.Property("startsWith")],wi.prototype,"operator",void 0),Si([C.Property(!1)],wi.prototype,"ignoreAccent",void 0),Si([C.Property(null)],wi.prototype,"headerTemplate",void 0),Si([C.Property(null)],wi.prototype,"template",void 0),Si([C.Property(null)],wi.prototype,"footerTemplate",void 0),Si([C.Property(!0)],wi.prototype,"enableSearching",void 0),Si([C.Property(null)],wi.prototype,"renderCustomColumnChooser",void 0),wi);function wi(){return null!==yi&&yi.apply(this,arguments)||this}Ii=function(e,t){return(Ii=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])}))(e,t)};var Ii,Ri,vi,Si=function(e,t){function i(){this.constructor=e}Ii(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Si=(Ri=C.Component,Si(c,Ri),(vi=c).prototype.excelExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!1)},c.prototype.csvExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!0)},c.prototype.pdfExport=function(e,t,i,r){return this.pdfExportModule.Map(e,t,i,r)},c.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},c.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},c.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},c.prototype.exportTreeGrid=function(e){var t=this.grid.getDataModule().generateQuery(!0),t=(new b.UrlAdaptor).processQuery(new b.DataManager({url:""}),t),t=JSON.parse(t.data),i=JSON.parse(this.addOnPersist(["allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","columns","locale","searchSettings","idMapping","parentIdMapping","childMapping","treeColumnIndex"])),t=(i.filterSettings.columns=t.where,i.searchSettings.fields=t.search&&t.search[0].fields||[],i.sortSettings.columns=t.sorted,i.columns=this.setHeaderText(i.columns,["field","headerText","type","format","visible","template","index","width","textAlign","headerTextAlign","columns"]),this.createElement("form",{id:"ExportForm"})),r=(t.style.display="none",this.createElement("input",{id:"treeGridInput",attrs:{name:"treeGridModel"}}));r.value=JSON.stringify(i),t.method="POST",t.action=e,t.appendChild(r),document.body.appendChild(t),t.submit(),t.remove()},c.prototype.setHeaderText=function(e,t){for(var i=0;i<e.length;i++)for(var r=this.getColumnByUid(e[parseInt(i.toString(),10)].uid),n=(this.stackedHeader&&C.isNullOrUndefined(r)&&(r=C.isNullOrUndefined(e[parseInt(i.toString(),10)].field)?e[parseInt(i.toString(),10)]:this.getColumnByField(e[parseInt(i.toString(),10)].field)),e[parseInt(i.toString(),10)].headerText=r.headerText,C.isNullOrUndefined(r.template)||(e[parseInt(i.toString(),10)].template="true"),e[parseInt(i.toString(),10)].format&&(e[parseInt(i.toString(),10)].format=w.getNumberFormat(this.getFormat(r.format),r.type,!1,this.currencyCode),this.isExcel||"datetime"!==r.type&&"date"!==r.type||(e[parseInt(i.toString(),10)].format=e[parseInt(i.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(i.toString(),10)].type=r.type),e[parseInt(i.toString(),10)].columns&&this.setHeaderText(e[parseInt(i.toString(),10)].columns,t),Object.keys(e[parseInt(i.toString(),10)])),o=0;o<n.length;o++)t.indexOf(n[parseInt(o.toString(),10)])<0&&delete e[parseInt(i.toString(),10)][n[parseInt(o.toString(),10)]];return e},c.prototype.getFormat=function(e){return"object"==typeof e?C.isNullOrUndefined(e.format)?e.skeleton:e.format:e},c.prototype.getModuleName=function(){return"treegrid"},c.prototype.preRender=function(){this.TreeGridLocale(),this.initProperties(),this.defaultLocale={Above:"Above",Below:"Below",Child:"Child",AddRow:"Add Row",ExpandAll:"Expand All",CollapseAll:"Collapse All",RowIndent:"Indent",RowOutdent:"Outdent"},this.l10n=new C.L10n("treegrid",this.defaultLocale,this.locale),this.isSelfReference&&C.isNullOrUndefined(this.childMapping)&&(this.childMapping="Children")},c.prototype.sortByColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},c.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},c.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},c.prototype.search=function(e){this.grid.search(e)},c.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},c.prototype.reorderColumns=function(e,t){this.grid.reorderColumns(e,t)},c.prototype.TreeGridLocale=function(){var e,t,i;C.isNullOrUndefined(this.locale)||(i=C.L10n.locale,C.setValue(this.locale,{},e={}),t={},t=w.getObject(this.locale,i),i={},i=w.getObject(this.getModuleName(),t),C.setValue("grid",i,w.getObject(this.locale,e)),C.L10n.load(e))},c.prototype.print=function(){this.printModule.print()},c.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var t,i,r=void 0,n=void 0,o=void 0,a=void 0,s=void 0;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"ctrlShiftUpArrow":o=(r=e.target).closest(".e-rowcell"),C.isNullOrUndefined(o)||(a=o.closest("tr"),C.isNullOrUndefined(a))||C.isNullOrUndefined(a.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridexpand"));break;case"ctrlShiftDownArrow":o=(r=e.target).closest(".e-rowcell"),C.isNullOrUndefined(o)||(a=o.closest("tr"),C.isNullOrUndefined(a))||C.isNullOrUndefined(a.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridcollapse"));break;case"downArrow":!this.enableVirtualization&&C.isNullOrUndefined(this.rowTemplate)&&(r=e.target,C.isNullOrUndefined(r.querySelectorAll(".e-rowcell"))||(r=w.parentsUntil(r,"e-rowcell")),C.isNullOrUndefined(r)||(n=r.parentElement,C.isNullOrUndefined(n))||((i=n.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(i).editType&&C.isNullOrUndefined(this.grid.getColumnByIndex(i).edit.obj)&&(n=r),null!==(s=this.findnextRowElement(n))?(t=r.cellIndex,t=s.children[parseInt(t.toString(),10)],C.isNullOrUndefined(t)||this.grid.isEdit||(this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus").forEach(function(e){C.removeClass([e],["e-focused","e-focus"])}),C.addClass([t],["e-focused","e-focus"]))):this.clearSelection()));break;case"upArrow":!this.enableVirtualization&&C.isNullOrUndefined(this.rowTemplate)&&(r=e.target,C.isNullOrUndefined(r.querySelectorAll(".e-rowcell"))||(r=w.parentsUntil(r,"e-rowcell")),C.isNullOrUndefined(r)||(n=r.parentElement,C.isNullOrUndefined(n))||((i=n.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(i).editType&&C.isNullOrUndefined(this.grid.getColumnByIndex(i).edit.obj)&&(n=r),null!==(s=this.findPreviousRowElement(n))?(t=r.cellIndex,C.isNullOrUndefined(t)||(i=s.children[parseInt(t.toString(),10)],C.isNullOrUndefined(i))||this.grid.isEdit||(this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus").forEach(function(e){C.removeClass([e],["e-focused","e-focus"])}),C.addClass([i],["e-focused","e-focus"]))):this.clearSelection()))}}},c.prototype.findnextRowElement=function(e){e=e.nextElementSibling;return e=null===e||-1===e.className.indexOf("e-summaryrow")&&!e.classList.contains("e-childrow-hidden")?e:this.findnextRowElement(e)},c.prototype.findPreviousRowElement=function(e){e=e.previousElementSibling;return e=null===e||-1===e.className.indexOf("e-summaryrow")&&!e.classList.contains("e-childrow-hidden")?e:this.findPreviousRowElement(e)},c.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!1,this.freezeColumnRefresh=!0,this.keyConfigs={ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",downArrow:"downArrow",upArrow:"upArrow"},this.isLocalData=!(this.dataSource instanceof b.DataManager)||this.dataSource.dataSource.offline||!C.isNullOrUndefined(this.dataSource.ready)||this.dataSource.adaptor instanceof b.RemoteSaveAdaptor,this.isSelfReference=!C.isNullOrUndefined(this.parentIdMapping)},c.prototype.wireEvents=function(){C.EventHandler.add(this.grid.element,"click",this.mouseClickHandler,this),C.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),this.keyboardModule=new C.KeyboardEvents(this.element,{keyAction:this.treeGridkeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex)},c.prototype.requiredModules=function(){var e,t=[],i="mergedColumns";return this[i]&&(this.grid[i]=this[i]),C.isNullOrUndefined(this.changedProperties.columns)&&this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed||(t.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),C.isNullOrUndefined(this.toolbar)||t.push({member:"toolbar",args:[this],name:"Toolbar"}),this.contextMenuItems&&t.push({member:"contextMenu",args:[this],name:"ContextMenu"}),this.allowPaging&&t.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowReordering&&t.push({member:"reorder",args:[this],name:"Reorder"}),this.allowSorting&&t.push({member:"sort",args:[this],name:"Sort"}),0<this.aggregates.length&&t.push({member:"summary",args:[this],name:"Aggregate"}),this.resizeCheck()&&t.push({member:"resize",args:[this],name:"Resize"}),this.allowExcelExport&&t.push({member:"ExcelExport",args:[this],name:"ExcelExport"}),i=this.injectedModules.filter(function(e){return"freeze"===e.prototype.getModuleName()}),e=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze}),(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||e)&&0<i.length&&t.push({member:"freeze",args:[this],name:"Freeze"}),this.detailTemplate&&t.push({member:"detailRow",args:[this],name:"DetailRow"}),this.allowPdfExport&&t.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.showColumnMenu&&t.push({member:"columnMenu",args:[this],name:"ColumnMenu"}),this.showColumnChooser&&t.push({member:"ColumnChooser",args:[this],name:"ColumnChooser"}),this.extendRequiredModules(t)),t},c.prototype.resizeCheck=function(){var e=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),t=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||e||t},c.prototype.extendRequiredModules=function(e){var t=this.injectedModules.filter(function(e){return"rowDragAndDrop"===e.prototype.getModuleName()});(this.allowRowDragAndDrop||t.length)&&(C.isNullOrUndefined(this.toolbar)||!this.toolbar.includes("Indent")&&!this.toolbar.includes("Outdent")||(this.isIndentEnabled=!0),e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"})),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this],name:"Edit"}),!C.isNullOrUndefined(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this],name:"CommandColumn"}),this.allowSelection&&e.push({member:"selection",args:[this],name:"Selection"}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this],name:"VirtualScroll"}),this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this],name:"InfiniteScroll"}),e.push({member:"logger",args:[this.grid]})},c.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},c.prototype.unwireEvents=function(){this.grid&&this.grid.element&&C.EventHandler.remove(this.grid.element,"click",this.mouseClickHandler),this.element&&(C.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.allowKeyboard)&&this.element.removeAttribute("tabIndex")},c.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},c.prototype.render=function(){var r=this,e=(this.isReact&&(this.grid.isReact=!0,this.grid.portals=[]),this.isVue&&(this.grid.isVue=!0,this.grid.vueInstance=this.vueInstance),V.createSpinner({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new Gt(this),this.dataModule=new Kt(this),this.printModule=new Tt(this),this.trigger(ye),this.autoGenerateColumns(),this.initialRender=!0,C.isNullOrUndefined(this.dataSource)||this.convertTreeData(this.dataSource),this.loadGrid(),this.element.classList.contains("e-treegrid")&&this.rowDropSettings.targetID&&(this.grid.rowDropSettings.targetID+="_gridcontrol"),this.addListener(),C.createElement("div",{id:this.element.id+"_gridcontrol",className:"e-treelistgrid"})),i=(C.addClass([this.element],"e-treegrid"),C.isNullOrUndefined(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),C.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.element.appendChild(e),this.grid.requiredModules),t=(this.grid.requiredModules=function(){for(var e=[],e=i.apply(this),t=0;t<e.length;t++)"virtualscroll"===e[parseInt(t.toString(),10)].member&&(e[parseInt(t.toString(),10)].member="treeVirtualScroll");return e},"root");this.grid[t]=this[t]||this,this.grid.appendTo(e),this.actionFailureHandler();this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var t=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table"),e=(C.isNullOrUndefined(t)||t.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.wireEvents(),this.renderComplete(),"destroyTemplate"),n=this.grid[e];this.grid[e]=function(e,t,i){n.apply(r.grid);r.isReact&&C.isNullOrUndefined(r.portals)?C.isNullOrUndefined(i)||i():r.clearTemplate(e,t,i)}},c.prototype.actionFailureHandler=function(){var i,t=this,e=[],r=this.getPrimaryKeyFieldNames(),n=this.flatData.length,r=((this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&0===r.length&&0!==n&&e.push("For the CRUD actions, it is necessary to enable Primary Key field for the unique data column."),this.allowRowDragAndDrop&&0===r.length&&0!==n&&e.push("For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column."),this.allowPaging&&this.enableVirtualization&&e.push("Paging is not allowed in virtualization case."),0===n&&0===this.columns.length&&e.push("Either of the Data source or columns should be given."),0<this.frozenColumns&&this.columnModel.filter(function(e){return e.isFrozen})&&e.push("Use only one attribute for Frozen either IsFrozen or FrozenColumns."),this.enableVirtualization&&!C.isNullOrUndefined(this.detailTemplate)&&e.push("Virtual scrolling is not compatible with the detail template"),!(0<this.frozenColumns||0<this.frozenRows||this.columnModel.filter(function(e){return e.isFrozen}))||C.isNullOrUndefined(this.detailTemplate)&&C.isNullOrUndefined(this.rowTemplate)||e.push("Frozen rows and columns are not supported with the Detail template and row template."),(0<this.frozenColumns||0<this.columnModel.filter(function(e){return e.isFrozen}).length||0<this.frozenRows)&&"Cell"===this.editSettings.mode&&e.push("Frozen rows and columns are not supported with cell editing."),this.allowSelection&&!C.isNullOrUndefined(this.rowTemplate)&&e.push("Selection is not supported in RowTemplate"),this.treeColumnIndex>=this.columns.length&&e.push("TreeColumnIndex value should not exceed the total column count."),this.enableVirtualization&&(this.columnModel.some(function(e){return/%$/.test(e.width)})||/%$/.test(this.height.toString()))&&e.push("column width and height should be in pixels"),"Children"===this.childMapping||C.isNullOrUndefined(this.idMapping)||e.push("Both IdMapping and ChildMapping should not be used together for tree grid rendering."),(!C.isNullOrUndefined(this.idMapping)&&C.isNullOrUndefined(this.parentIdMapping)||C.isNullOrUndefined(this.idMapping)&&!C.isNullOrUndefined(this.parentIdMapping))&&e.push("IdMapping and ParentIdMapping properties should be defined and vice versa."),this.columnModel.filter(function(e){return e.showCheckbox})),n=this.columns[this.treeColumnIndex];0!==r.length&&(r!==n&&e.push("ShowCheckbox column should not be defined other than the tree column."),1<r.length)&&e.push("Only one column can have the ShowCheckbox option enabled."),null!==this.treeColumnIndex&&-1!==this.treeColumnIndex&&this.treeColumnIndex<this.columns.length&&0!==this.columnModel.filter(function(e){return"Right"===e.textAlign&&e.field===t.columnModel[t.treeColumnIndex].field}).length&&e.push("TextAlign right for the tree column is not applicable."),0<e.length&&(i={error:{}},e.forEach(function(e,t){i.error[parseInt(t.toString(),10)]=e}),this.trigger(Mt,i))},c.prototype.refreshToolbarItems=function(){var e=this.toolbarModule.getToolbar(),t=this.element.id+"_gridcontrol_indent",i=this.element.id+"_gridcontrol_outdent",t=e.querySelector("#"+t).parentElement,e=e.querySelector("#"+i).parentElement;t.classList.add("e-hidden"),e.classList.add("e-hidden")},c.prototype.afterGridRender=function(){C.isNullOrUndefined(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new Ot(this,this.grid.serviceLocator)},c.prototype.convertTreeData=function(e){if((e=I(this)?C.getValue("result",e):e)instanceof Array&&0<e.length&&Object.prototype.hasOwnProperty.call(e[0],"level")){this.flatData=e;for(var i=this,t=0,r=this.flatData.length;t<r;t++)!function(e){var t=i.flatData[parseInt(e.toString(),10)];C.setValue("uniqueIDCollection."+t.uniqueID,t,i),0!==t.level||i.parentData.some(function(e){return e.uniqueID===t.uniqueID})||i.parentData.push(t)}(t)}else{var n;I(this)?(n=C.getValue("result",this.dataSource),this.dataModule.convertToFlatData(n)):this.dataModule.convertToFlatData(e)}},c.prototype.bindGridProperties=function(){this.bindedDataSource(),this.grid.enableRtl=this.enableRtl,this.grid.allowKeyboard=this.allowKeyboard,this.grid.columns=this.getGridColumns(this.columns),this.grid.allowExcelExport=this.allowExcelExport,this.grid.allowPdfExport=this.allowPdfExport,this.grid.query=this.query,this.grid.columnQueryMode=this.columnQueryMode,this.grid.allowPaging=this.allowPaging,this.grid.pageSettings=w.getActualProperties(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,this.grid.allowMultiSorting=this.allowMultiSorting,this.grid.allowFiltering=this.allowFiltering,this.grid.enableVirtualization=this.enableVirtualization,this.grid.enableColumnVirtualization=this.enableColumnVirtualization,this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling,this.grid.infiniteScrollSettings=this.infiniteScrollSettings,this.grid.enableVirtualMaskRow=this.enableVirtualMaskRow,this.grid.loadingIndicator=this.loadingIndicator,this.grid.width=this.width,this.grid.height=this.height,this.grid.enableAltRow=this.enableAltRow,this.grid.allowReordering=this.allowReordering,this.grid.allowTextWrap=this.allowTextWrap,this.grid.allowResizing=this.allowResizing,this.grid.enableHover=this.enableHover,this.grid.enableAutoFill=this.enableAutoFill,this.grid.enableAdaptiveUI=this.enableAdaptiveUI,this.grid.enableImmutableMode=this.enableImmutableMode,this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop,this.grid.rowDropSettings=w.getActualProperties(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=w.getActualProperties(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.columnChooserSettings=this.columnChooserSettings,this.grid.filterSettings=w.getActualProperties(this.filterSettings),this.grid.selectionSettings=w.getActualProperties(this.selectionSettings),this.grid.sortSettings=w.getActualProperties(this.sortSettings),this.grid.searchSettings=w.getActualProperties(this.searchSettings),this.grid.aggregates=w.getActualProperties(this.aggregates),this.grid.textWrapSettings=w.getActualProperties(this.textWrapSettings),this.grid.printMode=w.getActualProperties(this.printMode),this.grid.locale=w.getActualProperties(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=w.getActualProperties(this.getContextMenu()),this.grid.columnMenuItems=w.getActualProperties(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=w.getActualProperties(this.rowTemplate),this.grid.detailTemplate=w.getActualProperties(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=w.getActualProperties(this.clipMode);var e="templateDotnetInstance";this.grid[e]=this[e],this.grid.isJsComponent=!0,this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer,this.grid.enableStickyHeader=this.enableStickyHeader,this.grid.emptyRecordTemplate=this.emptyRecordTemplate,this.grid.isRowSelectable=this.isRowSelectable;this.grid.isTreeGrid=!0},c.prototype.triggerEvents=function(e){this.trigger(w.getObject("name",e),e)},c.prototype.IsExpandCollapseClicked=function(e){this.isFromChartSide||C.isNullOrUndefined(e.target)||!(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-summarycell"))||this.selectionSettings.checkboxOnly||(!C.isNullOrUndefined(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&C.isNullOrUndefined(e.data))&&(e.cancel=!0)},c.prototype.bindGridEvents=function(){var r=this;this.grid.rowSelecting=function(e){r.IsExpandCollapseClicked(e),!C.isNullOrUndefined(e.data)&&r.selectionSettings.persistSelection&&0<r.columnModel.filter(function(e){return"checkbox"===e.type}).length&&S(r)&&(C.isNullOrUndefined(e.data.parentItem)&&!e.isHeaderCheckboxClicked||(r.parentQuery=r.query.queries.filter(function(e){return e.e.field===r.parentIdMapping}),r.query.queries=r.query.queries.slice(0,0))),"Root"===r.pageSettings.pageSizeMode&&(r.grid.selectionModule.totalRecordsCount=r.grid.currentViewData.length),e.cancel||r.trigger(be,e)},this.grid.rowDeselecting=function(e){r.IsExpandCollapseClicked(e),!C.isNullOrUndefined(e.data)&&r.selectionSettings.persistSelection&&0<r.columnModel.filter(function(e){return"checkbox"===e.type}).length&&S(r)&&(r.parentQuery=r.query.queries.filter(function(e){return e.e.field===r.parentIdMapping}),r.query.queries=r.query.queries.slice(0,0)),r.trigger(xt,e)},this.grid.rowSelected=function(e){r.enableVirtualization&&r.virtualScrollModule.updateSelection(e),r.selectedRowIndex=r.grid.selectedRowIndex,r.notify(De,e),r.trigger(De,e)},this.grid.rowDeselected=function(e){r.selectedRowIndex=r.grid.selectedRowIndex,C.isNullOrUndefined(e.data)||r.notify(Oe,e),r.trigger(Oe,e)},this.grid.resizeStop=function(e){r.updateColumnModel(),r.trigger(Ne,e)},this.grid.excelQueryCellInfo=function(e){r.notify("excelCellInfo",e),r.dataResults},this.grid.excelAggregateQueryCellInfo=function(e){r.notify("excelAggregateCellInfo",e),r.dataResults},this.grid.pdfAggregateQueryCellInfo=function(e){r.notify("pdfAggregateCellInfo",e),r.dataResults},this.grid.pdfQueryCellInfo=function(e){r.notify("pdfCellInfo",e),r.dataResults},this.grid.checkBoxChange=function(e){r.trigger(Me,e)},this.grid.pdfExportComplete=this.triggerEvents.bind(this),this.grid.excelExportComplete=this.triggerEvents.bind(this),this.grid.excelHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.pdfHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.dataSourceChanged=this.triggerEvents.bind(this),this.grid.recordDoubleClick=this.triggerEvents.bind(this),this.grid.cellDeselected=this.triggerEvents.bind(this),this.grid.cellDeselecting=this.triggerEvents.bind(this),this.grid.columnMenuOpen=this.triggerEvents.bind(this),this.grid.columnMenuClick=this.triggerEvents.bind(this),this.grid.cellSelected=this.triggerEvents.bind(this),this.grid.headerCellInfo=this.triggerEvents.bind(this),this.grid.resizeStart=this.triggerEvents.bind(this),this.grid.resizing=this.triggerEvents.bind(this),this.grid.columnDrag=this.triggerEvents.bind(this),this.grid.columnDragStart=this.triggerEvents.bind(this),this.grid.columnDrop=this.triggerEvents.bind(this),this.grid.beforePrint=this.triggerEvents.bind(this),this.grid.beforeCopy=this.triggerEvents.bind(this),this.grid.beforePaste=function(e){for(var t=r.getRows(),i="rowIndex";t[e[i]].classList.contains("e-summaryrow");)e[i]++;r.trigger(He,e)},this.grid.load=function(){r.grid.on("initial-end",r.afterGridRender,r),C.isNullOrUndefined(r.loggerModule)||(r.loggerModule=r.grid.loggerModule=new ce(r.grid))},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=function(e){r.trigger(Mt,e)},this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},c.prototype.lastRowBorder=function(e,t){for(var i=0;i<e.cells.length;i++)t?C.addClass([e.cells[parseInt(i.toString(),10)]],"e-lastrowcell"):C.removeClass([e.cells[parseInt(i.toString(),10)]],"e-lastrowcell")},c.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},c.prototype.extendedGridDataBoundEvent=function(){var a=this,r=(this.grid.dataBound=function(e){if(a.lastRowBorderEventListener(),a.updateRowTemplate(),a.updateColumnModel(),a.updateAltRow(a.getRows()),a.notify("dataBoundArg",e),!S(a)||v(a)||a.hasChildMapping||(t=void 0,t=a.dataResults.result?0:1,C.setValue("grid.contentModule.isLoaded",!(0<t),a)),a.isPixelHeight()&&a.initialRender)for(var t=a.getContentTable().rows,i=[].slice.call(t),r=i.length-1;0<r;r--)if(!kt(i[parseInt(r.toString(),10)])){i[parseInt(r.toString(),10)].nextElementSibling&&a.lastRowBorder(i[parseInt(r.toString(),10)],!0);break}if(a.enableVirtualization&&a.selectionSettings.persistSelection&&("expand"===a.dataResults.action||"collapse"===a.dataResults.action)&&(a.grid.selectionModule.refreshPersistSelection(),"Single"===a.grid.selectionSettings.type)&&(n="updateRowSelection",o=a.getCurrentViewRecords().indexOf(a.grid.selectionModule.data),a.grid.selectionModule[""+n](a.getRows()[parseInt(o.toString(),10)],o)),a.enableVirtualization&&a.selectionSettings.persistSelection&&!C.isNullOrUndefined(a.virtualScrollModule.prevSelectedRecord))for(r=0;r<a.virtualScrollModule.prevSelectedRecord.length;r++){var n="updateRowSelection",o=a.getCurrentViewRecords().indexOf(a.virtualScrollModule.prevSelectedRecord[parseInt(r.toString(),10)]);a.grid.selectionModule[""+n](a.getRows()[parseInt(o.toString(),10)],o)}a.trigger(we,e),a.initialRender=!1},this);this.grid.beforeDataBound=function(e){var t,i=w.getObject("action",e);if((S(r)&&!v(r)||I(this))&&"edit"!==i?(r.notify("updateRemoteLevel",e),e=r.dataResults):0===r.flatData.length&&v(r)&&r.dataSource instanceof b.DataManager&&(i=r.dataSource,r.dataModule.convertToFlatData(i.dataSource.json),e.result=r.grid.dataSource.dataSource.json=r.flatData),S(r)||I(this)||C.isNullOrUndefined(r.dataSource)||(this.isPrinting&&C.setValue("isPrinting",!0,e),r.notify("dataProcessor",e)),C.extend(e,r.dataResults),r.enableImmutableMode&&(e.result=e.result.slice()),r.initialRender&&(this.contentModule.objectEqualityChecker=r.objectEqualityChecker),!this.isPrinting)return t=new b.Deferred,r.trigger(Re,e,function(e){t.resolve(e)}),t},this.grid.log=function(e,t){a.loggerModule&&a.loggerModule.log(e,t)}},c.prototype.lastRowBorderEventListener=function(){this.grid.on("last-rowcell-border-updated",this.lastRowCellBorderUpdated,this)},c.prototype.bindCallBackEvents=function(){var r=this;this.grid.toolbarClick=function(t){var i;if(!(t.item.id===r.grid.element.id+"_excelexport"&&!1===r.allowExcelExport||t.item.id===r.grid.element.id+"_pdfexport"&&!1===r.allowPdfExport||t.item.id===r.grid.element.id+"_csvexport"&&!1===r.allowExcelExport))return i=new b.Deferred,r.trigger(Pe,t,function(e){e.cancel||r.notify(Pe,t),i.resolve(e)}),i},this.grid.cellSelecting=function(e){var t=r.grid.selectionModule.actualTarget,i=(C.isNullOrUndefined(t)||!t.classList.contains("e-treegridexpand")&&!t.classList.contains("e-treegridcollapse")||(e.cancel=!0),new b.Deferred);return r.trigger(w.getObject("name",e),e,function(e){i.resolve(e)}),i},this.grid.beginEdit=function(e){var t;if(C.isNullOrUndefined(e.row)||!e.row.classList.contains("e-summaryrow"))return t=new b.Deferred,r.trigger(Qe,e,function(e){t.resolve(e)}),t;e.cancel=!0}},c.prototype.extendedGridEditEvents=function(){var r=this;this.grid.dataStateChange=function(e){r.isExpandRefresh?(r.isExpandRefresh=!1,r.grid.dataSource={result:r.flatData,count:C.getValue("count",r.grid.dataSource)}):("infiniteScroll"!==e.action.requestType&&(r.infiniteScrollData=[]),r.trigger(xe,e))},this.grid.cellSave=function(e){r.grid.isContextMenuOpen()&&(t=r.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0],!C.isNullOrUndefined(t)&&t.id===r.element.id+"_gridcontrol_cmenu_Save"||(e.cancel=!0));var t,i=new b.Deferred;return r.trigger(Ye,e,function(e){e.cancel||r.notify(Ye,e),i.resolve(e)}),i},this.grid.cellSaved=function(e){r.trigger(Je,e),r.notify(Je,e)},this.grid.cellEdit=function(e){var t=new b.Deferred;return e.promise=t,r.notify(Xe,e),t},this.grid.batchAdd=function(e){r.trigger(et,e),r.notify(et,e)},this.grid.beforeBatchSave=function(e){r.trigger(rt,e),r.notify(rt,e)},this.grid.beforeBatchAdd=function(e){r.trigger(it,e),r.notify(it,e)},this.grid.batchDelete=function(e){r.trigger($e,e),r.notify($e,e)},this.grid.beforeBatchDelete=function(e){r.trigger(tt,e),r.notify(tt,e)},this.grid.batchCancel=function(e){"Cell"!==r.editSettings.mode&&r.trigger(Ze,e),r.notify(Ze,e)}},c.prototype.updateRowTemplate=function(){var n=this;this.rowTemplate&&(this.isReact&&0===this.getContentTable().rows.length?setTimeout(function(){if(n.treeColumnRowTemplate(),n.enableCollapseAll)for(var e=n.getCurrentViewRecords(),t=n.getContentTable().rows,i=0;i<t.length;i++){var r={data:e[parseInt(i.toString(),10)],row:t[parseInt(i.toString(),10)]};n.renderModule.RowModifier(r)}},0):this.treeColumnRowTemplate())},c.prototype.bindedDataSource=function(){var e,t,i,r="dataSource",n="ready";this.dataSource&&I(this)?(e=this.flatData,t=C.getValue("count",this.dataSource),this.grid.dataSource={result:e,count:t}):this.grid.dataSource=this.dataSource instanceof b.DataManager?new b.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0):this.flatData,this.dataSource instanceof b.DataManager&&(this.dataSource.dataSource.offline||this.dataSource.ready)&&(this.grid.dataSource[r].json=D(this.dataSource[r].json),this.grid.dataSource[n]=this.dataSource.ready,C.isNullOrUndefined((i=this).grid.dataSource[n])||this.grid.dataSource[n].then(function(e){var t=i.grid.dataSource;t[r].offline=!0,t.isDataAvailable=!0,t[r].json=e.result,t.adaptor=new b.JsonAdaptor}))},c.prototype.extendedGridActionEvents=function(){var n=this;this.grid.actionBegin=function(e){var t;if(!("sorting"===e.requestType&&e.target&&e.target.parentElement&&e.target.parentElement.classList.contains("e-hierarchycheckbox")))return"reorder"===w.getObject("requestType",e)&&n.notify("getColumnIndex",{}),S(n)&&n.enableVirtualization&&("virtualscroll"===e.requestType?(n.query.expand("VirtualScrollingAction"),n.showSpinner()):"searching"===e.requestType&&""===e.searchString?n.query.expand("ClearSearchingAction"):"clearFilter"===e.action&&n.query.expand("ClearFilteringAction")),n.notify("actionBegin",{editAction:e}),S(n)||C.isNullOrUndefined(n.filterModule)||I(n)||0!==n.grid.filterSettings.columns.length||0!==n.grid.searchSettings.key.length||(n.notify("clearFilters",{flatData:n.grid.dataSource}),n.grid.setProperties({dataSource:n.dataResults.result},!0),C.isNullOrUndefined(n.grid.changedProperties.dataSource)&&(n.grid.renderModule.data.dataManager=n.grid.dataSource instanceof b.DataManager?n.grid.dataSource:C.isNullOrUndefined(n.grid.dataSource)?new b.DataManager:new b.DataManager(n.grid.dataSource),n.grid.renderModule.data.isQueryInvokedFromData=!0,n.grid.query=n.grid.query instanceof b.Query?n.grid.query:new b.Query)),"indenting"!==n.action&&"outdenting"!==n.action?(t=new b.Deferred,n.trigger(ve,e,function(e){e.cancel||n.notify(Qe,e),t.resolve(e)}),t):void 0;e.cancel=!0},this.grid.actionComplete=function(e){var t,i,r;n.notify("actioncomplete",e),n.updateColumnModel(),n.updateTreeGridModel(),"reorder"===e.requestType&&n.notify("setColumnIndex",{}),n.notify("actionComplete",{editAction:e}),"add"===e.requestType&&"Top"!==n.editSettings.newRowPosition&&"Bottom"!==n.editSettings.newRowPosition&&n.notify(Ke,e),"batchsave"===e.requestType&&n.notify(nt,e),n.notify("updateGridActions",e),"save"===e.requestType&&n.aggregates.map(function(e){return!0===e.showChildSummary}).length&&n.grid.refresh(),"filter"!==e.action||e.isCollapseMaintain||""===n.filterModule.currentFilterObject||!n.enableVirtualization||n.initialRender||S(n)&&n.enableVirtualization||n.expandAll(),"searching"!==e.requestType||e.isCollapseMaintain||""===n.searchSettings.key||!n.enableVirtualization||n.initialRender||S(n)&&n.enableVirtualization||n.expandAll(),"clearFilter"===e.action&&n.enableCollapseAll&&n.collapseAll(),"indenting"===n.action||"outdenting"===n.action?(n.action="indenting"===n.action?"indented":"outdented",i={data:t=[n.selectedRecords],dropIndex:n.dropIndex,dropPosition:n.dropPosition,modifiedRecords:n.modifiedRecords,requestType:n.action,row:n.selectedRows},n.trigger(Ce,i),n.getCurrentViewRecords().filter(function(e){return e.uniqueID===t[0].uniqueID}).length||n.refreshToolbarItems(),n.action="",n.selectedRecords=n.selectedRows=n.modifiedRecords=[]):(n.grid.isFrozenGrid()&&n.enableVirtualization&&"movable"===e.tableName&&(i=n.grid.element.querySelector("."+Ct),r=n.grid.element.querySelector("."+bt),i.style.height=r.style.height="auto"),n.trigger(Ce,e))}},c.prototype.extendedGridEvents=function(){var t=this,i=this;this.grid.recordDoubleClick=function(e){t.trigger(We,e),t.notify(We,e)},this.grid.detailDataBound=function(e){t.notify("detaildataBound",e),t.trigger(ut,e)},this.grid.rowDataBound=function(e){C.isNullOrUndefined(this.isPrinting)?C.setValue("isPrinting",!1,e):C.setValue("isPrinting",this.isPrinting,e),i.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){C.isNullOrUndefined(this.isPrinting)?C.setValue("isPrinting",!1,e):C.setValue("isPrinting",this.isPrinting,e),i.renderModule.cellRender(e)},this.grid.contextMenuClick=function(e){t.notify(je,e),t.trigger(je,e)},this.grid.contextMenuOpen=function(e){t.notify(Fe,e),t.trigger(Fe,e)},this.grid.queryCellInfo=function(e){t.renderModule.cellRender(e)}},c.prototype.bindGridDragEvents=function(){var t=this;this.grid.rowDragStartHelper=function(e){t.trigger(ft,e)},this.grid.rowDragStart=function(e){t.trigger(yt,e)},this.grid.rowDrag=function(e){t.grid.isEdit?e.cancel=!0:(t.notify(It,e),t.trigger(gt,e))},this.grid.rowDrop=function(e){t.grid.isEdit||t.notify(Rt,e),e.cancel=!0}},c.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),C.setValue("registeredTemplate",this.registeredTemplate,this.grid);C.setValue("viewContainerRef",this.viewContainerRef,this.grid)},c.prototype.autoGenerateColumns=function(){var e,t=this;this.columns.length||this.dataModule.isRemote()||!Object.keys(this.dataSource).length||(this.columns=[],e=this.dataSource[0],e=Object.keys(e),this.columns=e.filter(function(e){return-1===[t.childMapping,t.parentIdMapping].indexOf(e)}))},c.prototype.getGridEditSettings=function(){var e={};switch(e.allowAdding=this.editSettings.allowAdding,e.allowEditing=this.editSettings.allowEditing,e.allowDeleting=this.editSettings.allowDeleting,e.newRowPosition="Bottom"===this.editSettings.newRowPosition?"Bottom":"Top",e.allowEditOnDblClick=this.editSettings.allowEditOnDblClick,e.showConfirmDialog=this.editSettings.showConfirmDialog,e.template=this.editSettings.template,e.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,e.allowNextRowEdit=this.editSettings.allowNextRowEdit,e.guid=this.editSettings.guid,e.dialog=this.editSettings.dialog,this.editSettings.mode){case"Dialog":case"Batch":e.mode=this.editSettings.mode;break;case"Row":e.mode="Normal";break;case"Cell":e.mode="Normal",e.showConfirmDialog=!1}return e},c.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var e=[],t=0;t<this.contextMenuItems.length;t++)switch(this.contextMenuItems[parseInt(t.toString(),10)]){case"AddRow":case r.ContextMenuItems.AddRow:e.push({text:this.l10n.getConstant("AddRow"),target:".e-content",id:this.element.id+"_gridcontrol_cmenu_AddRow",items:[{text:this.l10n.getConstant("Above"),id:"Above"},{text:this.l10n.getConstant("Below"),id:"Below"},{text:this.l10n.getConstant("Child"),id:"Child"}]});break;case"Indent":case r.ContextMenuItems.RowIndent:e.push({text:this.l10n.getConstant("RowIndent"),target:".e-content",iconCss:"e-indent e-icons",id:this.element.id+"_gridcontrol_cmenu_Indent"});break;case"Outdent":case r.ContextMenuItems.RowOutdent:e.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:e.push(this.contextMenuItems[parseInt(t.toString(),10)])}return e}return null},c.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new C.L10n("treegrid",this.defaultLocale,this.locale);for(var e=[],t=void 0,i=0;i<this.toolbar.length;i++)switch(this.toolbar[parseInt(i.toString(),10)]){case"Search":case r.ToolbarItem.Search:e.push("Search");break;case"Print":case r.ToolbarItem.Print:e.push("Print");break;case"ExpandAll":case r.ToolbarItem.ExpandAll:t=this.l10n.getConstant("ExpandAll"),e.push({text:t,tooltipText:t,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case r.ToolbarItem.CollapseAll:t=this.l10n.getConstant("CollapseAll"),e.push({text:t,tooltipText:t,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case r.ToolbarItem.RowIndent:t=this.l10n.getConstant("RowIndent"),e.push({text:t,tooltipText:t,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case r.ToolbarItem.RowOutdent:t=this.l10n.getConstant("RowOutdent"),e.push({text:t,tooltipText:t,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:e.push(this.toolbar[parseInt(i.toString(),10)])}return e}return null},c.prototype.getGridColumns=function(e,t,i){void 0===i&&(i=0);for(var r=e,n=((t=void 0===t?!0:t)&&(this.columnModel=[]),0===this.columnModel.length&&(i=0===i?-1:i),[]),o=0;o<r.length;o++){i+=1;var a=this.grid.getColumnByUid(r[parseInt(o.toString(),10)].uid),s=a||{},d={};if("string"==typeof this.columns[parseInt(o.toString(),10)])s.field=d.field=this.columns[parseInt(o.toString(),10)];else for(var l=Object.keys(r[parseInt(o.toString(),10)]),p=0;p<l.length;p++){var h=l[parseInt(p.toString(),10)];i===this.treeColumnIndex&&"template"===h?d[""+h]=r[parseInt(o.toString(),10)][""+h]:"columns"!==h||C.isNullOrUndefined(r[parseInt(o.toString(),10)][""+h])?this.initialRender&&!C.isNullOrUndefined(a)&&this.enablePersistence&&"edit"===h?s[""+h]=d[""+h]=a[""+h]:a&&"sortComparer"===h||(s[""+h]=d[""+h]=r[parseInt(o.toString(),10)][""+h]):(s[""+h]=this.getGridColumns(r[parseInt(o.toString(),10)][""+h],!1,this.columnModel.length-1),d[""+h]=r[parseInt(o.toString(),10)][""+h])}d.columns||this.columnModel.push(new F(d)),n.push(s),!C.isNullOrUndefined(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&s.field===this.columnModel[this.treeColumnIndex].field&&(C.isNullOrUndefined(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),s.textAlign="Right")}return n},c.prototype.lastRowCellBorderUpdated=function(){var e=this.getContentTable().querySelectorAll("tr.e-row"),e=Array.from(e).filter(function(e){return!e.classList.contains("e-childrow-hidden")});0<e.length&&(e=e[e.length-1],this.lastRowBorder(e,!0))},c.prototype.onPropertyChanged=function(e){var t=Object.keys(e),i=!1;-1<t.indexOf("columns")&&!C.isNullOrUndefined(e.columns)&&this.refreshColumns();for(var r=0,n=t;r<n.length;r++){var o,a=n[r];switch(a){case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=w.getActualProperties(this.pageSettings),i=!0;break;case"enableVirtualization":this.grid.enableVirtualization=this.enableVirtualization;break;case"enableColumnVirtualization":this.grid.enableColumnVirtualization=this.enableColumnVirtualization;break;case"toolbar":this.grid.toolbar=this.getGridToolbar();break;case"allowSelection":this.grid.allowSelection=this.allowSelection;break;case"selectionSettings":this.grid.selectionSettings=w.getActualProperties(this.selectionSettings);break;case"allowSorting":this.grid.allowSorting=this.allowSorting;break;case"allowMultiSorting":this.grid.allowMultiSorting=this.allowMultiSorting;break;case"sortSettings":this.grid.sortSettings=w.getActualProperties(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=w.getActualProperties(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=w.getActualProperties(this.filterSettings));break;case"showColumnMenu":this.grid.showColumnMenu=this.showColumnMenu;break;case"allowRowDragAndDrop":this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop;break;case"aggregates":this.grid.aggregates=w.getActualProperties(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":this.isLocalData=!(this.dataSource instanceof b.DataManager)||!C.isNullOrUndefined(this.dataSource.ready)||this.dataSource.adaptor instanceof b.RemoteSaveAdaptor,this.convertTreeData(this.dataSource),this.isLocalData?(I(this)?(o=C.getValue("count",this.dataSource),this.grid.dataSource={result:this.flatData,count:o}):(o=this.dataSource,this.grid.dataSource=o instanceof b.DataManager?new b.DataManager(o.dataSource,o.defaultQuery,o.adaptor):this.flatData),this.enableVirtualization&&(this.grid.contentModule.isDataSourceChanged=!0)):(this.bindedDataSource(),this.enableVirtualization&&(this.grid.contentModule.removeEventListener(),this.grid.contentModule.eventListener("on"),this.grid.contentModule.renderTable()));break;case"query":this.grid.query=this.query;break;case"enableCollapseAll":e[""+a]?this.collapseAll():this.expandAll();break;case"expandStateMapping":this.grid.refresh();break;case"gridLines":this.grid.gridLines=this.gridLines;break;case"rowTemplate":this.grid.rowTemplate=w.getActualProperties(this.rowTemplate);break;case"frozenRows":this.grid.frozenRows=this.frozenRows;break;case"frozenColumns":this.grid.frozenColumns=this.frozenColumns;break;case"rowHeight":this.grid.rowHeight=this.rowHeight,this.refresh();break;case"height":C.isNullOrUndefined(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),this.grid.height=this.height;break;case"width":C.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.grid.width=this.width;break;case"locale":this.grid.locale=this.locale,this.TreeGridLocale(),this.grid.toolbar=this.getGridToolbar(),this.grid.contextMenuItems=this.getContextMenu();break;case"selectedRowIndex":this.grid.selectedRowIndex=this.selectedRowIndex;break;case"enableAltRow":this.grid.enableAltRow=this.enableAltRow;break;case"enableHover":this.grid.enableHover=this.enableHover;break;case"enableAutoFill":this.grid.enableAutoFill=this.enableAutoFill;break;case"columnChooserSettings":this.grid.columnChooserSettings=w.getActualProperties(this.columnChooserSettings);break;case"enableAdaptiveUI":this.grid.enableAdaptiveUI=this.enableAdaptiveUI;break;case"enableImmutableMode":this.grid.enableImmutableMode=this.enableImmutableMode;break;case"allowExcelExport":this.grid.allowExcelExport=this.allowExcelExport;break;case"allowPdfExport":this.grid.allowPdfExport=this.allowPdfExport;break;case"enableRtl":C.isNullOrUndefined(this.treeColumnField)||this.updateTreeColumnTextAlign(),this.grid.enableRtl=this.enableRtl;break;case"allowReordering":this.grid.allowReordering=this.allowReordering;break;case"allowResizing":this.grid.allowResizing=this.allowResizing;break;case"textWrapSettings":this.grid.textWrapSettings=w.getActualProperties(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=w.getActualProperties(this.allowTextWrap),this.grid.refresh();break;case"contextMenuItems":this.grid.contextMenuItems=this.getContextMenu();break;case"showColumnChooser":this.grid.showColumnChooser=this.showColumnChooser;break;case"detailTemplate":this.grid.detailTemplate=w.getActualProperties(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=w.getActualProperties(this.columnMenuItems);break;case"enableStickyHeader":this.grid.enableStickyHeader=this.enableStickyHeader;break;case"emptyRecordTemplate":this.grid.emptyRecordTemplate=this.emptyRecordTemplate;break;case"isRowSelectable":this.grid.isRowSelectable=this.isRowSelectable;break;case"editSettings":this.grid.isEdit&&"Normal"===this.grid.editSettings.mode&&e[""+a].mode&&("Cell"===e[""+a].mode||"Row"===e[""+a].mode)&&this.grid.closeEdit(),this.grid.editSettings=this.getGridEditSettings()}i&&this.grid.refresh()}},c.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},c.prototype.destroy=function(){var e=this.element;if(e){for(var e=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent")),t=(e&&this.unwireEvents(),this.removeListener(),e&&Ri.prototype.destroy.call(this),this.grid&&this.grid.destroy(),this.dataModule&&this.dataModule.destroy(),["dataModule","sortModule","renderModule","filterModule","printModule","clipboardModule","excelExportModule","pdfExportModule","toolbarModule","summaryModule","reorderModule","resizeModule","pagerModule","keyboardModule","columnMenuModule","contextMenuModule","editModule","virtualScrollModule","selectionModule","detailRow","rowDragAndDropModule","freezeModule"]),i=0;i<t.length;i++)this[t[parseInt(i.toString(),10)]]&&(this[t[parseInt(i.toString(),10)]]=null);this.element.innerHTML="",this.grid=null}},c.prototype.dataBind=function(){C.isNullOrUndefined(this.grid)||(!C.isNullOrUndefined(this.rowDropSettings.targetID)&&C.isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))&&(document.getElementById(this.rowDropSettings.targetID).id=this.grid.rowDropSettings.targetID,this.rowDropSettings.targetID=this.grid.rowDropSettings.targetID),Ri.prototype.dataBind.call(this),this.grid.dataBind())},c.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","scrollPosition"],t={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},i=0;i<e.length;i++)for(var r=this[e[parseInt(i.toString(),10)]],n=0,o=t[e[parseInt(i.toString(),10)]];!C.isNullOrUndefined(o)&&n<o.length;n++)delete r[""+o[parseInt(n.toString(),10)]];return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},c.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].columns?(this.ignoreInColumn(e,t[parseInt(i.toString(),10)]),this.ignoreInArrays(e,t[parseInt(i.toString(),10)].columns)):this.ignoreInColumn(e,t[parseInt(i.toString(),10)])},c.prototype.ignoreInColumn=function(e,t){if(C.isNullOrUndefined(t.template))for(var i=0;i<e.length;i++)delete t[e[parseInt(i.toString(),10)]],t.filter={}},c.prototype.mouseClickHandler=function(e){var t,i,r,n=this;C.isNullOrUndefined(e.touches)&&(!(e=e.target).classList.contains("e-treegridexpand")&&!e.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(e),(e.classList.contains("e-treegridexpand")||e.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:e}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map(function(e){return!0===e.showChildSummary}).length&&(t=this.grid.getHeaderContent().querySelector(".e-checkselectall"),i=this.grid.getSelectedRowIndexes().length,0<(r=this.getCurrentViewRecords().length))&&i===r&&(i=t.nextElementSibling,C.removeClass([i],["e-stop","e-uncheck"]),C.addClass([i],["e-check"])),e.classList.contains("e-flmenu-cancelbtn")||e.classList.contains("e-flmenu-okbtn")||e.classList.contains("e-content")||e.classList.contains("e-rowcell"))&&!C.isNullOrUndefined(this.grid.filterModule)&&this.isReact&&!C.isNullOrUndefined(this.grid.filterModule.column)&&this.grid.filterModule.column.filterTemplate&&(r=document.getElementById(this.grid.filterModule.filterModule.dlgObj.element.id),this.grid.filterModule.fltrDlgDetails.isOpen=!1,this.grid.filterModule.filterModule.dlgObj)&&!this.grid.filterModule.filterModule.dlgObj.isDestroyed&&r&&this.clearTemplate(["filterTemplate"],void 0,function(){n.grid.filterModule.filterModule.dlgObj.destroy()})},c.prototype.getRows=function(){return this.grid.getRows()},c.prototype.getPager=function(){return this.grid.getPager()},c.prototype.addRecord=function(e,t,i){this.editModule&&(this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i))},c.prototype.closeEdit=function(){this.grid.editModule&&this.editModule.closeEdit()},c.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},c.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},c.prototype.updateRow=function(e,t){var i;this.grid.editModule&&(C.isNullOrUndefined(e)?this.grid.editModule.updateRow(e,t):(i=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)],C.extend(i,t),this.grid.editModule.updateRow(e,i)))},c.prototype.deleteRecord=function(e,t){(C.isNullOrUndefined(e)&&C.isNullOrUndefined(t)||this.getSelectedRecords().length<=0)&&this.trigger(Mt,{error:"The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number."}),this.grid.editModule&&this.grid.editModule.deleteRecord(e,t)},c.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},c.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},c.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},c.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},c.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},c.prototype.deleteRow=function(e){this.grid.editModule&&this.grid.editModule.deleteRow(e)},c.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},c.prototype.setCellValue=function(e,t,i){this.grid.setCellValue(e,t,i);i=this.grid.getRowIndexByPrimaryKey(e),e=this.getCurrentViewRecords()[parseInt(i.toString(),10)];hi({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,t)},c.prototype.setRowData=function(t,e){var i=this.getCurrentViewRecords(),r=this.grid.getPrimaryKeyFieldNames()[0],n={},o=(i.some(function(e){return e[""+r]===t&&(n=e,!0)}),o=n.level,e.level=o,e.index=n.index,e.childRecords=n.childRecords,e.taskData=n.taskData,e.uniqueID=n.uniqueID,e.parentItem=n.parentItem,e.checkboxState=n.checkboxState,e.hasChildRecords=n.hasChildRecords,e.parentUniqueID=n.parentUniqueID,e.expanded=n.expanded,this.grid.setRowData(t,e),this.getVisibleRecords());0<o.length&&t===o[o.length-1][""+r]&&(e=this.getContentTable().scrollHeight,o=this.getContent().clientHeight,this.lastRowBorder(this.getRows()[i.indexOf(n)],e<=o))},c.prototype.goToPage=function(e){this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},c.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},c.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},c.prototype.getColumnByField=function(t){return w.iterateArrayOrObject(this.columnModel,function(e){if(e.field===t)return e})[0]},c.prototype.getColumnByUid=function(t){var e=(this.initialRender?this.grid:this).columns;return this.grid.columns.length!==this.columnModel.length&&(e=this.grid.columnModel),w.iterateArrayOrObject(e,function(e){if(e.uid===t)return e})[0]},c.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},c.prototype.getFooterContent=function(){return this.grid.getFooterContent()},c.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},c.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},c.prototype.hideColumns=function(e,t){this.grid.hideColumns(e,t),this.updateColumnModel()},c.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},c.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},c.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},c.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},c.prototype.getVirtualColIndexByUid=function(i){var e=w.iterateArrayOrObject(this.grid.columnModel,function(e,t){if(e.uid===i)return t})[0];return C.isNullOrUndefined(e)?-1:e},c.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},c.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},c.prototype.updateColumnModel=function(e){var t,i,r=C.isNullOrUndefined(e)?this.grid.getColumns():e;if(-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!C.isNullOrUndefined(this.columnModel[this.treeColumnIndex].template)&&(t=this.columnModel[this.treeColumnIndex].template,i=this.columnModel[this.treeColumnIndex].field),!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===r.length){this.columnModel=[];for(var n=0;n<r.length;n++){for(var o={},a=0,s=Object.keys(r[parseInt(n.toString(),10)]);a<s.length;a++){var d=s[a];o[""+d]=r[parseInt(n.toString(),10)][""+d]}this.columnModel.push(new F(o)),i!==this.columnModel[parseInt(n.toString(),10)].field||"checkbox"===this.columnModel[parseInt(n.toString(),10)].type||C.isNullOrUndefined(t)||""===t||(this.columnModel[parseInt(n.toString(),10)].template=t)}}e="deepMerge";return this[e]=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&!C.isNullOrUndefined(this.detailTemplate)&&this.trigger(Mt,{error:"Stacked header is not compatible with the detail template"}),this.stackedHeader&&this.allowResizing&&!C.isNullOrUndefined(this.columns)&&this.updateColumnsWidth(this.columns),this.stackedHeader||C.isNullOrUndefined(this.columns)||C.merge(this.columns,this.columnModel),this[e]=void 0,this.columnModel},c.prototype.updateColumnsWidth=function(e){var i=this;e.forEach(function(e){var t;!C.isNullOrUndefined(e)&&e.columns?i.updateColumnsWidth(e.columns):!C.isNullOrUndefined(e)&&e.field&&(t=i.grid.getColumnByField(e.field),C.isNullOrUndefined(t)||(e.width=t.width))})},c.prototype.getContent=function(){return this.grid.getContent()},c.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},c.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},c.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this)},c.prototype.splitFrozenCount=function(e){var t=0<this.frozenColumns?this.grid:this;this.grid.splitFrozenCount.apply(t,[e])},c.prototype.removeBorder=function(e){this.grid.removeBorder.apply(this.grid,[e])},c.prototype.frozenLeftBorderColumns=function(e){this.grid.frozenLeftBorderColumns.apply(this.grid,[e])},c.prototype.frozenRightBorderColumns=function(e){this.grid.frozenRightBorderColumns.apply(this.grid,[e])},c.prototype.isFrozenGrid=function(){var e=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return 0<this.frozenColumns||0<this.frozenRows||0<this.getFrozenColumns()||e},c.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:w.getObject("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:w.getObject("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:w.getObject("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:w.getObject("properties",this.grid.sortSettings)},!0)},c.prototype.hasPreAndPostMiddleware=function(e){return e&&"function"==typeof e.applyPreRequestMiddlewares&&"function"==typeof e.applyPostRequestMiddlewares},c.prototype.getContentTable=function(){return this.grid.getContentTable()},c.prototype.getDataRows=function(){for(var e=[],t=this.grid.getDataRows(),i=0,r=t.length;i<r;i++)t[parseInt(i.toString(),10)].classList.contains("e-summaryrow")||e.push(t[parseInt(i.toString(),10)]);return e},c.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter(function(e){return C.isNullOrUndefined(e.isSummaryRow)})},c.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},c.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},c.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},c.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},c.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},c.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},c.prototype.getVisibleColumns=function(){return this.columnModel.filter(function(e){return e.visible})},c.prototype.showSpinner=function(){V.showSpinner(this.element)},c.prototype.hideSpinner=function(){V.hideSpinner(this.element)},c.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),I(this)||(this.dataSource instanceof b.DataManager?this.grid.setProperties({dataSource:new b.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},c.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},c.prototype.getVisibleRecords=function(){var e=[],t=this.getCurrentViewRecords();if(this.allowPaging)e=t;else for(var i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)]),t[parseInt(i.toString(),10)].expanded||(i+=R(t[parseInt(i.toString(),10)]).length);return e},c.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},c.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},c.prototype.refreshColumns=function(e){C.isNullOrUndefined(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.getTreeColumn(),this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},c.prototype.getTreeColumn=function(){var e=this.columnModel[this.treeColumnIndex],t=this.getColumns(),i=w.getObject("field",e),e=t.findIndex(function(e){return w.getObject("field",e)===i});C.isNullOrUndefined(e)||this.setProperties({treeColumnIndex:e},!0)},c.prototype.refreshHeader=function(){this.grid.refreshHeader()},c.prototype.expandCollapseRequest=function(e){if("Batch"===this.editSettings.mode)if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog)return t=this.grid.editModule.dialogObj,this.grid.editModule.showDialog("CancelEdit",t),void(this.targetElement=e);var t,i,r;this.rowTemplate?(t=e.closest(".e-treerowcell").parentElement,r=this.getCurrentViewRecords()[t.rowIndex],e.classList.contains("e-treegridexpand")?this.collapseRow(t,r):this.expandRow(t,r)):(r=(i=this.grid.getRowInfo(e)).rowData,this.grid.isFrozenGrid()&&this.enableVirtualization&&!Object.keys(r).length&&(r=this.grid.contentModule.freezeRows.filter(function(e){return e.uid===i.row.getAttribute("data-uid")})[0].data),this.enableImmutableMode&&(r=this.getCurrentViewRecords()[i.rowIndex]),e.classList.contains("e-treegridexpand")?this.collapseRow(i.row,r):this.expandRow(i.row,r))},c.prototype.expandRow=function(t,i,r,n){var e,o,a=this,s=(this.isCollapseAll=!1,this.parentData);this.enableVirtualization||(s=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(t,i),C.isNullOrUndefined(t)&&C.isNullOrUndefined(i)||(!C.isNullOrUndefined(t)&&t.cells&&t.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(t,!1),this.isExpandAll&&!S(this)?(e=!(o={data:s,row:t,cancel:!1}),this.grid.pagerModule&&!C.isNullOrUndefined(this.grid.pagerModule.pagerObj.pagerdropdownModule)&&(e=!!this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value),this.isExpandingEventTriggered?(!this.allowPaging||e&&"All"===this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value)&&!this.expandAllPrevent&&this.isExpandingEventTriggered&&this.expandRows(t,i,s):this.trigger(ke,o,function(e){a.expandAllPrevent=e.cancel,e.cancel||C.isNullOrUndefined(i)||(e.expandAll&&a.expandCollapseAllChildren(i,"expand",r,n),a.expandRows(t,i,s))}),this.isExpandingEventTriggered=!0):(!this.isExpandAll||this.isExpandAll&&S(this))&&(o={data:i,row:t,cancel:!1},this.trigger(ke,o,function(e){e.cancel||(e.expandAll&&a.expandCollapseAllChildren(i,"expand",r,n),a.expandRows(t,i,s))})))},c.prototype.expandRows=function(e,t,i){this.expandCollapse("expand",e,t);S(this)&&!v(this)||I(this)&&C.isNullOrUndefined(t.Children)||(t={data:t,row:e},C.isNullOrUndefined(this.expandStateMapping)||this.updateExpandStateMapping(t.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,this.trigger(Ue,t={data:i,row:e})):!this.isExpandAll&&this.enableVirtualization&&this.selectionSettings.persistSelection&&!C.isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)?this.virtualScrollModule.prevSelectedRecord=[]:this.isExpandAll||this.trigger(Ue,t))},c.prototype.expandCollapseAllChildren=function(e,t,i,r){if((C.isNullOrUndefined(i)||e[this.getPrimaryKeyFieldNames()[0]]===i)&&(C.isNullOrUndefined(r)||r===e.level)){var n=R(e).filter(function(e){return e.hasChildRecords});n.unshift(e);for(var o=0;o<n.length;o++)this.expandCollapse(t,null,n[parseInt(o.toString(),10)])}},c.prototype.getCollapseExpandRecords=function(e,t){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&C.isNullOrUndefined(t)&&!S(this)?t=this.flatData.filter(function(e){return e.hasChildRecords}):C.isNullOrUndefined(t)&&!C.isNullOrUndefined(e)&&(t=this.detailTemplate?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.enableVirtualization&&(this.isCollapseAll||this.isExpandAll)?-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]),t},c.prototype.collapseRow=function(t,i,r){var e,n=this,o=(this.isExpandAll=!1,this.parentData);this.enableVirtualization||(o=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(t,i),C.isNullOrUndefined(t)&&C.isNullOrUndefined(i)||(this.isCollapseAll&&!S(this)?(e={data:o,row:t,cancel:!1},this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(t,i,o):this.trigger(Te,e,function(e){n.collapseAllPrevent=e.cancel,e.cancel||(e.collapseAll&&n.expandCollapseAllChildren(i,"collapse",r),n.collapseRows(t,i,o))}),this.isCollapsingEventTriggered=!0):(!this.isCollapseAll||this.isCollapseAll&&S(this))&&(e={data:i,row:t,cancel:!1},this.trigger(Te,e,function(e){e.cancel||n.collapseRows(t,i,o)})))},c.prototype.collapseRows=function(e,t,i){this.expandCollapse("collapse",e,t);t={data:t,row:e};S(this)||(C.isNullOrUndefined(this.expandStateMapping)||this.updateExpandStateMapping(t.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,this.trigger(qe,t={data:i,row:e})):this.isCollapseAll||this.trigger(qe,t),this.enableInfiniteScrolling&&this.grid.getContent().firstElementChild.scrollHeight-this.grid.getContent().firstElementChild.scrollTop<this.grid.getRowHeight()+ +this.height&&this.grid.getContent().firstElementChild.scrollBy(0,this.grid.getRowHeight()))},c.prototype.updateExpandStateMapping=function(e,t){var i=e;if(i.length)for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)][this.expandStateMapping]=t,hi({value:i[parseInt(r.toString(),10)],action:"edit"},this,this.isSelfReference,i[parseInt(r.toString(),10)].index,this.grid.selectedRowIndex,this.expandStateMapping);else e[""+this.expandStateMapping]=t,hi({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},c.prototype.expandAtLevel=function(t){var e;(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!S(this)?(e=this.grid.dataSource.filter(function(e){return e.hasChildRecords&&e.level===t&&(e.expanded=!0),e.hasChildRecords&&e.level===t}),this.expandAction(e,null,t,!0)):(e=this.getRecordDetails(t),e=w.getObject("records",e),this.expandAction(e,null,t))},c.prototype.expandByKey=function(e){this.expandCollapseActionByKey(e,"Expand")},c.prototype.expandAction=function(r,n,o,a){void 0===a&&(a=!1);for(var s=this,e=0;e<r.length;e++)!function(e){var t,i;C.isNullOrUndefined(r[parseInt(e.toString(),10)].parentItem)||(t=r[parseInt(e.toString(),10)].parentItem.uniqueID,i=s.flatData.filter(function(e){return e.uniqueID===t}),!1===(i=S(s)?s.getCurrentViewRecords().filter(function(e){return e.uniqueID===t}):i)[0].expanded?(r.push(i[0]),i[0].expanded=!0):y(s,i[0],s.parentData)||i[0].expanded&&void 0!==i[0].parentItem&&r.push(i[0])),a||s.expandRow(null,r[parseInt(e.toString(),10)],n,o)}(e);a&&this.expandRow(null,r,n,o)},c.prototype.getRecordDetails=function(t){var e=this.getRows().filter(function(e){return-1!==e.className.indexOf("level"+t)&&(e.querySelector(".e-treegridcollapse")||e.querySelector(".e-treegridexpand"))});return{records:this.getCurrentViewRecords().filter(function(e){return e.level===t&&e.hasChildRecords}),rows:e}},c.prototype.collapseAtLevel=function(t){var e;(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!S(this)?(e=this.grid.dataSource.filter(function(e){return e.hasChildRecords&&e.level===t&&(e.expanded=!1),e.hasChildRecords&&e.level===t}),this.collapseAction(e,null,!0)):(e=this.getRecordDetails(t),e=w.getObject("records",e),this.collapseAction(e))},c.prototype.collapseByKey=function(e){this.expandCollapseActionByKey(e,"Collapse")},c.prototype.expandCollapseActionByKey=function(t,e){var i=this.getPrimaryKeyFieldNames()[0],r=S(this)?this.getCurrentViewRecords():this.grid.dataSource;C.isNullOrUndefined(i)||(r=r.filter(function(e){return e[""+i].toString()===t.toString()}),"Expand"===e?this.expandAction(r,t,null):this.collapseAction(r,t))},c.prototype.collapseAction=function(e,t,i){if(i=void 0===i?!1:i)this.collapseRow(null,e);else for(var r=0;r<e.length;r++)this.collapseRow(null,e[parseInt(r.toString(),10)],t);!this.grid.contentModule.isDataSourceChanged&&this.enableVirtualization&&this.getRows()&&this.parentData.length===this.getRows().length&&(this.grid.contentModule.startIndex=-1,this.grid.contentModule.endIndex=-1)},c.prototype.expandAll=function(){if(0===this.getCurrentViewRecords().length&&this.trigger(Mt,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."}),this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],e=Array.isArray(e.addedRecords)?e.addedRecords:[];if((0<t.length||0<i.length||0<e.length)&&this.editSettings.showConfirmDialog)return t=this.grid.editModule.dialogObj,void this.grid.editModule.showDialog("CancelEdit",t)}this.expandCollapseAll("expand")},c.prototype.collapseAll=function(){if(0===this.getCurrentViewRecords().length&&this.trigger(Mt,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."}),this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],e=Array.isArray(e.addedRecords)?e.addedRecords:[];if((0<t.length||0<i.length||0<e.length)&&this.editSettings.showConfirmDialog)return t=this.grid.editModule.dialogObj,void this.grid.editModule.showDialog("CancelEdit",t)}this.expandCollapseAll("collapse")},c.prototype.expandCollapseAll=function(t){var e,i=this.rowTemplate?[].slice.call(this.grid.getContentTable().querySelectorAll("tr")).filter(function(e){return e.querySelector(".e-treegrid"+("expand"===t?"collapse":"expand"))}):this.getRows().filter(function(e){return e.querySelector(".e-treegrid"+("expand"===t?"collapse":"expand"))});if(!i.length&&this.getRows().length&&i.push(this.getRows()[0]),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&("All"===this.pageSettings.pageSizeMode||"Root"===this.pageSettings.pageSizeMode)||this.enableVirtualization||this.enableInfiniteScrolling)&&!S(this))if(this.flatData.filter(function(e){e.hasChildRecords&&(e.expanded="collapse"!==t)}),i.length)for(var r=0;r<i.length;r++)"collapse"===t?C.isNullOrUndefined(this.getCurrentViewRecords()[i[parseInt(r.toString(),10)].rowIndex])||this.collapseRow(i[parseInt(r.toString(),10)]):this.enableVirtualization?"true"!==i[0].getAttribute("aria-expanded")&&this.expandRow(i[0]):this.expandRow(i[parseInt(r.toString(),10)]);else this.allowPaging&&(e=this.enableCollapseAll,this.setProperties({enableCollapseAll:!0},!0),this.grid.pagerModule.goToPage(1),this.setProperties({enableCollapseAll:e},!0));else for(r=0;r<i.length;r++)"collapse"===t?this.collapseRow(i[parseInt(r.toString(),10)]):this.expandRow(i[parseInt(r.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},c.prototype.expandCollapse=function(e,t,i,r){var n,o=this,a={row:t,data:i,childData:[],requestType:e},s=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===i.uniqueID}),a=((!S(this)&&"expand"===e&&this.isSelfReference&&I(this)&&!s.length||"collapse"===e||this.isExpandAll&&!this.loadChildOnDemand&&!S(this)&&this.isSelfReference&&I(this))&&this.updateChildOnDemand(a),this.getRows());if(this.rowTemplate&&(p=this.getContentTable().rows,a=[].slice.call(p)),C.isNullOrUndefined(t)?(d=this.grid.currentViewData.indexOf(i),t=a[parseInt(d.toString(),10)]):d=+t.getAttribute("aria-rowindex")-1,C.isNullOrUndefined(t)||t.setAttribute("aria-expanded","expand"===e?"true":"false"),(!this.allowPaging||"All"!==this.pageSettings.pageSizeMode&&"Root"!==this.pageSettings.pageSizeMode)&&!this.enableVirtualization||S(this)||I(this)){var d=void 0;if("expand"===e){if(d="e-childrow-visible",r||(i.expanded=!0,this.flatData.forEach(function(e){e.expanded=(e.uniqueID===i.uniqueID&&e.expanded!==i.expanded?i:e).expanded}),this.uniqueIDCollection[i.uniqueID].expanded=i.expanded),C.isNullOrUndefined(t)||(n=t.getElementsByClassName("e-treegridcollapse")[0]),r&&!C.isNullOrUndefined(i[this.expandStateMapping])&&i[this.expandStateMapping]&&C.isNullOrUndefined(n)&&(n=t.getElementsByClassName("e-treegridexpand")[0]),C.isNullOrUndefined(n))return;n.classList.contains("e-treegridexpand")||C.addClass([n],"e-treegridexpand"),C.removeClass([n],"e-treegridcollapse")}else{if(d="e-childrow-hidden",r&&!I(this)||(i.expanded=!1,this.flatData.forEach(function(e){e.expanded=(e.uniqueID===i.uniqueID&&e.expanded!==i.expanded?i:e).expanded}),this.uniqueIDCollection[i.uniqueID].expanded=i.expanded),C.isNullOrUndefined(t)||(n=t.getElementsByClassName("e-treegridexpand")[0]),r&&!C.isNullOrUndefined(i[this.expandStateMapping])&&!i[this.expandStateMapping]&&C.isNullOrUndefined(n)&&(n=t.getElementsByClassName("e-treegridcollapse")[0]),C.isNullOrUndefined(n))return;n.classList.contains("e-treegridcollapse")||C.addClass([n],"e-treegridcollapse"),C.removeClass([n],"e-treegridexpand")}t.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");r=a.filter(function(e){return e.classList.contains("e-griddetailrowindex"+i.index+"level"+(i.level+1))});if(S(this)&&!v(this)?this.remoteExpand(e,t,i):(I(this)&&!s.length&&"collapse"!==e||this.localExpand(e,t,i),s=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,s=this.getRowByIndex(s),this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!C.isNullOrUndefined(s)&&!s.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(s,!0)),I(this)&&"expand"===e&&(s=this.getCurrentViewRecords().filter(function(e){return y(o,e,o.parentData)}),this.dataResults.result=s),!C.isNullOrUndefined(n)&&n.closest(".e-treerowcell").classList.contains("e-cellselectionbackground")&&(n.closest(".e-treerowcell").classList.remove("e-cellselectionbackground"),n.closest(".e-treerowcell").removeAttribute("aria-selected")),this.isPixelHeight()&&!t.cells[0].classList.contains("e-lastrowcell")){this.getRows();for(var l,p=this.getContentTable().rows,h=(l=[].slice.call(p)).length-1;0<=h;h--)if(!kt(l[parseInt(h.toString(),10)])){var c=this.getContentTable().scrollHeight,u=this.getContent().clientHeight;this.lastRowBorder(l[parseInt(h.toString(),10)],c<=u);break}}this.notify("rowExpandCollapse",{detailrows:r,action:d,record:i,row:t}),this.updateAltRow(a)}else this.notify(Be,{action:e,row:t,record:i})},c.prototype.updateChildOnDemand=function(d){var l=this;if("collapse"===d.requestType&&I(this)){for(var e=this.flatData.slice(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].parentUniqueID===d.data.uniqueID&&(e.splice(t,1),t-=1);this.dataResults.result=e}else{var i,r=new b.Deferred,p=(this.query?(i=this.grid.getDataModule().getStateEventArgument(this.query)).action=d:i=d,d.childDataBind=r.resolve,d.data);this.trigger(xe,i),r.promise.then(function(){if(d.childData.length){I(l)&&(l.flatData=l.dataResults.result),l.enableInfiniteScrolling&&I(l)&&(l.flatData=l.infiniteScrollData);for(var e=l.flatData,t=0,i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].taskData===p.taskData){t=i;break}for(var r=C.getValue("result",l.dataSource),n=D(d.childData),o=(p[l.childMapping]&&p[l.childMapping].length>n.length?p[l.childMapping]:n).length,i=0;i<o;i++)p[l.childMapping]&&r.filter(function(e,t){e[l.parentIdMapping]===p[l.idMapping]&&r.splice(t,1)}),n[parseInt(i.toString(),10)]?(n[parseInt(i.toString(),10)].level=p.level+1,n[parseInt(i.toString(),10)].index=Math.ceil(1e3*Math.random()),n[parseInt(i.toString(),10)].parentItem=C.extend({},p),n[parseInt(i.toString(),10)].taskData=C.extend({},n[parseInt(i.toString(),10)]),delete n[parseInt(i.toString(),10)].parentItem.childRecords,delete n[parseInt(i.toString(),10)].taskData.parentItem,n[parseInt(i.toString(),10)].parentUniqueID=p.uniqueID,n[parseInt(i.toString(),10)].uniqueID=w.getUid(l.element.id+"_data_"),C.setValue("uniqueIDCollection."+n[parseInt(i.toString(),10)].uniqueID,n[parseInt(i.toString(),10)],l),(!C.isNullOrUndefined(n[parseInt(i.toString(),10)][l.childMapping])||n[parseInt(i.toString(),10)][l.hasChildMapping]&&I(l))&&(n[parseInt(i.toString(),10)].hasChildRecords=!0),I(l)&&p[l.childMapping]&&p[l.childMapping][parseInt(i.toString(),10)]?e.splice(t+1+i,0,n[parseInt(i.toString(),10)]):e.splice(t+1+i,p[l.childMapping]&&p[l.childMapping][parseInt(i.toString(),10)]?1:0,n[parseInt(i.toString(),10)])):e.splice(t+1+i,1);e[parseInt(t.toString(),10)][""+l.childMapping]=n,e[parseInt(t.toString(),10)].childRecords=n,e[parseInt(t.toString(),10)].expanded=!0,C.setValue("uniqueIDCollection."+e[parseInt(t.toString(),10)].uniqueID,e[parseInt(t.toString(),10)],l);for(var a=0;a<d.childData.length;a++)r.push(d.childData[parseInt(a.toString(),10)])}I(l)&&!l.loadChildOnDemand&&"expand"===d.requestType&&(l.dataResults.expandRecord={},l.dataResults.expandRecord=d.data),l.isExpandRefresh=!0;var s=l.getContentTable().parentElement.scrollTop;l.grid.refresh(),l.enableInfiniteScrolling&&(l.getContentTable().parentElement.scrollTop=s),l.trigger(Ue,d)})}},c.prototype.remoteExpand=function(e,t,i){var r=this.getRows(),n=C.getValue("isCollapseAll",this)?"collapseAll":"refresh",n=(this.grid.contentModule.requestType=n,this.rowTemplate&&(n=this.getContentTable().rows,r=[].slice.call(n)),{data:i,row:t}),r=r.filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))||e.querySelector(".e-gridrowindex"+i.index+"level0.e-summarycell")});"expand"===e?(this.notify(Ve,{record:i,rows:r,parentRow:t}),0<r.length&&this.trigger(Ue,{row:t,data:i})):"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:n.data,rows:null,parentRow:n.row}):(this.collapseRemoteChild({record:i,rows:r}),this.trigger(qe,n))},c.prototype.localExpand=function(e,t,i){var r,n,o=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===i.uniqueID}),a=(this.isPixelHeight()&&t.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(t,!1),this.getRows()),s=(this.rowTemplate&&(t=this.getContentTable().rows,a=[].slice.call(t)),"expand"===e?"e-childrow-visible":"e-childrow-hidden"),d=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging)for(var l=[],p=0;p<o.length;p++){var h=this.grid.getRowIndexByPrimaryKey(o[parseInt(p.toString(),10)][""+d]);l.push(this.getRows()[parseInt(h.toString(),10)])}else l=a.filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))});for(var c,t=0<this.grid.getFrozenLeftColumnsCount()||0<this.grid.getFrozenRightColumnsCount(),u=((this.frozenRows||this.frozenColumns||this.getFrozenColumns()||t)&&(r=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))})),t&&(n=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))})),this.grid.getRowsObject()),g=this.grid.currentViewData,f=g.filter(function(e){return e.uniqueID===i.uniqueID}),m=g.indexOf(f[0]),y=(C.isNullOrUndefined(u[parseInt(m.toString(),10)].visible)||!1===u[parseInt(m.toString(),10)].visible||(u[parseInt(m.toString(),10)].visible=!0),this.detailTemplate&&a.forEach(function(e){e.classList.contains("e-detailrow")&&"none"===e.style.display&&(e.style.display="")}),a.filter(function(e){return e.classList.contains("e-griddetailrowindex"+i.index+"level"+(i.level+1))})),p=0;p<l.length;p++)C.isNullOrUndefined(l[parseInt(p.toString(),10)])||this.toggleRowVisibility(l[parseInt(p.toString(),10)],s),C.isNullOrUndefined(l[parseInt(p.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||S(this)||I(this)||(C.isNullOrUndefined(u[l[parseInt(p.toString(),10)].rowIndex])||(u[l[parseInt(p.toString(),10)].rowIndex].visible="e-childrow-hidden"!=s),c=g.filter(function(e){return e.uniqueID===f[0].parentUniqueID}),!C.isNullOrUndefined(c[0])&&a[g.indexOf(c[0])].getElementsByClassName("e-treegridcollapse").length&&(u[parseInt(m.toString(),10)].visible=!1)),C.isNullOrUndefined(r)||this.toggleRowVisibility(r[parseInt(p.toString(),10)],s),C.isNullOrUndefined(n)||this.toggleRowVisibility(n[parseInt(p.toString(),10)],s),this.notify("childRowExpand",{row:l[parseInt(p.toString(),10)]}),!C.isNullOrUndefined(o)&&!C.isNullOrUndefined(o[parseInt(p.toString(),10)].childRecords)&&0<o[parseInt(p.toString(),10)].childRecords.length&&("expand"!==e||C.isNullOrUndefined(o[parseInt(p.toString(),10)].expanded)||o[parseInt(p.toString(),10)].expanded)&&(this.expandCollapse(e,l[parseInt(p.toString(),10)],o[parseInt(p.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex)&&!C.isNullOrUndefined(r)&&this.expandCollapse(e,r[parseInt(p.toString(),10)],o[parseInt(p.toString(),10)],!0);for(p=0;p<y.length;p++)C.isNullOrUndefined(y[parseInt(p.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||S(this)||I(this)||(u[y[parseInt(p.toString(),10)].rowIndex].visible="e-childrow-hidden"!=s,this.toggleRowVisibility(y[parseInt(p.toString(),10)],s));this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||S(this)||I(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},c.prototype.toggleRowVisibility=function(e,t){e&&(e.classList.remove("e-childrow-hidden","e-childrow-visible","e-hide"),e.classList.add(t))},c.prototype.updateAltRow=function(e){if(this.enableAltRow&&!this.rowTemplate)for(var t=0,i=0;e&&i<e.length;i++){var r=e[parseInt(i.toString(),10)];r.classList.contains("e-childrow-hidden")||(r.classList.contains("e-altrow")&&C.removeClass([r],"e-altrow"),t%2==0||r.classList.contains("e-summaryrow")||r.classList.contains("e-detailrow")||C.addClass([r],"e-altrow"),r.classList.contains("e-summaryrow"))||r.classList.contains("e-detailrow")||t++}},c.prototype.treeColumnRowTemplate=function(){for(var e=this.getContentTable().rows,e=[].slice.call(e),t=this.grid.getRowsObject(),i=0;i<e.length;i++){var r=this.grid.getContentTable().rows[parseInt(i.toString(),10)].cells[this.treeColumnIndex],n=e[parseInt(i.toString(),10)],n={data:0!==t.length?t[parseInt(i.toString(),10)].data:new Object,row:n,cell:r,column:this.getColumns()[this.treeColumnIndex]};this.renderModule.cellRender(n)}},c.prototype.collapseRemoteChild=function(t,e){C.isNullOrUndefined(e)||e||!this.loadChildOnDemand||(t.record.expanded=!1);var i=t.rows,r=[],n=[],o=0<this.getFrozenLeftColumnsCount()||0<this.getFrozenRightColumnsCount();o&&(r=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}),n=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}));for(var a=0;a<i.length;a++){this.toggleRowVisibility(i[parseInt(a.toString(),10)],"e-childrow-hidden");var s=i[parseInt(a.toString(),10)],d=i[parseInt(a.toString(),10)].querySelector(".e-detailrowexpand");if(C.isNullOrUndefined(d)||this.grid.detailRowModule.collapse(d),o&&(this.toggleRowVisibility(r[parseInt(a.toString(),10)],"e-childrow-hidden"),this.toggleRowVisibility(n[parseInt(a.toString(),10)],"e-childrow-hidden"),i[parseInt(a.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")||(r[parseInt(a.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")?s=r[parseInt(a.toString(),10)]:n[parseInt(a.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")&&(s=n[parseInt(a.toString(),10)]))),s.querySelector(".e-treecolumn-container .e-treegridexpand")){var d=s.querySelector(".e-treecolumn-container .e-treegridexpand"),l=this.rowTemplate?this.grid.getCurrentViewRecords()[i[parseInt(a.toString(),10)].rowIndex]:this.grid.getRowObjectFromUID(i[parseInt(a.toString(),10)].getAttribute("data-Uid")).data;!C.isNullOrUndefined(d)&&l.expanded&&(C.removeClass([d],"e-treegridexpand"),C.addClass([d],"e-treegridcollapse"));for(var p=[],h=this.getRows(),c=0;c<h.length;c++)h[parseInt(c.toString(),10)].querySelector(".e-gridrowindex"+l.index+"level"+(l.level+1))&&p.push(h[parseInt(c.toString(),10)]);p.length&&l.expanded&&this.collapseRemoteChild({record:l,rows:p},!1)}}this.grid.pageSettings.totalRecordsCount-=i.length},c.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?C.SanitizeHtmlHelper.sanitize(e):e},c.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this),this.grid.on("partial-filter-update",this.partialFilterUpdate,this)},c.prototype.updateResultModel=function(e){this.dataResults=e},c.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender),this.grid.off("last-rowcell-border-updated",this.lastRowCellBorderUpdated),this.grid.off("partial-filter-update",this.partialFilterUpdate))},c.prototype.partialFilterUpdate=function(e){e=e.gridFiltered;this.notify("updateFilterRecs",{data:e})},c.prototype.filterByColumn=function(e,t,i,r,n,o,a,s){this.grid.filterByColumn(e,t,i,r,n,o,a,s)},c.prototype.clearFiltering=function(){this.grid.clearFiltering()},c.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},c.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},c.prototype.selectRows=function(e){this.grid.selectRows(e)},c.prototype.clearSelection=function(){C.isNullOrUndefined(this.grid.selectionModule)||(this.grid.selectionModule.actualTarget=null),this.grid.clearSelection()},c.prototype.copy=function(e){this.clipboardModule.copy(e)},c.prototype.paste=function(e,t,i){this.clipboardModule.paste(e,t,i)},c.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},c.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},c.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},c.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},c.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},c.prototype.getMovableRows=function(){return this.grid.getRows()},c.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},c.prototype.getFrozenRightRows=function(){return this.grid.getRows()},c.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},c.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},c.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},c.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},c.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},c.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},c.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},c.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},c.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},c.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},c.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},c.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},c.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},c.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},c.prototype.getFrozenColumns=function(){return this.getFrozenCount(!C.isNullOrUndefined(this.columns)&&this.columns,0)+this.frozenColumns},c.prototype.getFrozenCount=function(e,t){for(var i=0,r=e.length;i<r;i++)e[parseInt(i.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&t++;return t},c.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},c.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},c.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},c.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},c.prototype.reorderRows=function(e,t,i){C.isNullOrUndefined(this.rowDragAndDropModule)||this.rowDragAndDropModule.reorderRows(e,t,i)},c.prototype.indent=function(e){C.isNullOrUndefined(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"indent")},c.prototype.outdent=function(e){C.isNullOrUndefined(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent")},h([C.Property(0)],c.prototype,"frozenRows",void 0),h([C.Property(0)],c.prototype,"frozenColumns",void 0),h([C.Property("Ellipsis")],c.prototype,"clipMode",void 0),h([C.Property([])],c.prototype,"columns",void 0),h([C.Property(null)],c.prototype,"childMapping",void 0),h([C.Property(null)],c.prototype,"hasChildMapping",void 0),h([C.Property(0)],c.prototype,"treeColumnIndex",void 0),h([C.Property(null)],c.prototype,"idMapping",void 0),h([C.Property(null)],c.prototype,"parentIdMapping",void 0),h([C.Property(!1)],c.prototype,"enableCollapseAll",void 0),h([C.Property(null)],c.prototype,"expandStateMapping",void 0),h([C.Property(!1)],c.prototype,"allowRowDragAndDrop",void 0),h([C.Property([])],c.prototype,"dataSource",void 0),h([C.Property()],c.prototype,"query",void 0),h([C.Property()],c.prototype,"cloneQuery",void 0),h([C.Property("AllPages")],c.prototype,"printMode",void 0),h([C.Property(!1)],c.prototype,"allowPaging",void 0),h([C.Property(!0)],c.prototype,"loadChildOnDemand",void 0),h([C.Property(!1)],c.prototype,"allowTextWrap",void 0),h([C.Complex({},e)],c.prototype,"textWrapSettings",void 0),h([C.Property(!1)],c.prototype,"allowReordering",void 0),h([C.Property(!1)],c.prototype,"allowResizing",void 0),h([C.Property(!1)],c.prototype,"autoCheckHierarchy",void 0),h([C.Complex({},n)],c.prototype,"pageSettings",void 0),h([C.Complex({},w.RowDropSettings)],c.prototype,"rowDropSettings",void 0),h([C.Property("USD")],c.prototype,"currencyCode",void 0),h([C.Property()],c.prototype,"pagerTemplate",void 0),h([C.Property(!1)],c.prototype,"showColumnMenu",void 0),h([C.Property(!1)],c.prototype,"showColumnChooser",void 0),h([C.Complex({},gi)],c.prototype,"columnChooserSettings",void 0),h([C.Property(!1)],c.prototype,"allowSorting",void 0),h([C.Property(!0)],c.prototype,"allowMultiSorting",void 0),h([C.Complex({},l)],c.prototype,"sortSettings",void 0),h([C.Collection([],a)],c.prototype,"aggregates",void 0),h([C.Complex({},s)],c.prototype,"editSettings",void 0),h([C.Property(!1)],c.prototype,"allowFiltering",void 0),h([C.Property()],c.prototype,"detailTemplate",void 0),h([C.Complex({},J)],c.prototype,"filterSettings",void 0),h([C.Complex({},oe)],c.prototype,"searchSettings",void 0),h([C.Property()],c.prototype,"toolbar",void 0),h([C.Property()],c.prototype,"toolbarTemplate",void 0),h([C.Property("Default")],c.prototype,"gridLines",void 0),h([C.Property()],c.prototype,"contextMenuItems",void 0),h([C.Property()],c.prototype,"columnMenuItems",void 0),h([C.Property()],c.prototype,"rowTemplate",void 0),h([C.Property("Parent")],c.prototype,"copyHierarchyMode",void 0),h([C.Property(null)],c.prototype,"rowHeight",void 0),h([C.Property(!0)],c.prototype,"enableAltRow",void 0),h([C.Property(!0)],c.prototype,"allowKeyboard",void 0),h([C.Property(!1)],c.prototype,"enableHover",void 0),h([C.Property(!1)],c.prototype,"enableAutoFill",void 0),h([C.Property(!1)],c.prototype,"enableAdaptiveUI",void 0),h([C.Property(!1)],c.prototype,"enableImmutableMode",void 0),h([C.Property(!1)],c.prototype,"enableStickyHeader",void 0),h([C.Property()],c.prototype,"emptyRecordTemplate",void 0),h([C.Property("auto")],c.prototype,"height",void 0),h([C.Property("auto")],c.prototype,"width",void 0),h([C.Complex({},Y)],c.prototype,"loadingIndicator",void 0),h([C.Property(!0)],c.prototype,"enableVirtualMaskRow",void 0),h([C.Property(!1)],c.prototype,"enableVirtualization",void 0),h([C.Property(!1)],c.prototype,"enableColumnVirtualization",void 0),h([C.Property(!1)],c.prototype,"enableHtmlSanitizer",void 0),h([C.Property(!1)],c.prototype,"enableInfiniteScrolling",void 0),h([C.Complex({},ai)],c.prototype,"infiniteScrollSettings",void 0),h([C.Property("All")],c.prototype,"columnQueryMode",void 0),h([C.Property(!0)],c.prototype,"allowSelection",void 0),h([C.Property(-1)],c.prototype,"selectedRowIndex",void 0),h([C.Property(null)],c.prototype,"isRowSelectable",void 0),h([C.Complex({},Lt)],c.prototype,"selectionSettings",void 0),h([C.Property(!1)],c.prototype,"allowExcelExport",void 0),h([C.Property(!1)],c.prototype,"allowPdfExport",void 0),h([C.Event()],c.prototype,"created",void 0),h([C.Event()],c.prototype,"load",void 0),h([C.Event()],c.prototype,"expanding",void 0),h([C.Event()],c.prototype,"expanded",void 0),h([C.Event()],c.prototype,"collapsing",void 0),h([C.Event()],c.prototype,"collapsed",void 0),h([C.Event()],c.prototype,"cellSave",void 0),h([C.Event()],c.prototype,"cellSaved",void 0),h([C.Event()],c.prototype,"actionBegin",void 0),h([C.Event()],c.prototype,"actionComplete",void 0),h([C.Event()],c.prototype,"beginEdit",void 0),h([C.Event()],c.prototype,"batchAdd",void 0),h([C.Event()],c.prototype,"batchDelete",void 0),h([C.Event()],c.prototype,"batchCancel",void 0),h([C.Event()],c.prototype,"beforeBatchAdd",void 0),h([C.Event()],c.prototype,"beforeBatchDelete",void 0),h([C.Event()],c.prototype,"beforeBatchSave",void 0),h([C.Event()],c.prototype,"cellEdit",void 0),h([C.Event()],c.prototype,"actionFailure",void 0),h([C.Event()],c.prototype,"dataBound",void 0),h([C.Event()],c.prototype,"dataSourceChanged",void 0),h([C.Event()],c.prototype,"dataStateChange",void 0),h([C.Event()],c.prototype,"recordDoubleClick",void 0),h([C.Event()],c.prototype,"rowDataBound",void 0),h([C.Event()],c.prototype,"detailDataBound",void 0),h([C.Event()],c.prototype,"queryCellInfo",void 0),h([C.Event()],c.prototype,"rowSelecting",void 0),h([C.Event()],c.prototype,"rowSelected",void 0),h([C.Event()],c.prototype,"rowDeselecting",void 0),h([C.Event()],c.prototype,"rowDeselected",void 0),h([C.Event()],c.prototype,"headerCellInfo",void 0),h([C.Event()],c.prototype,"cellSelecting",void 0),h([C.Event()],c.prototype,"columnMenuOpen",void 0),h([C.Event()],c.prototype,"columnMenuClick",void 0),h([C.Event()],c.prototype,"cellSelected",void 0),h([C.Event()],c.prototype,"cellDeselecting",void 0),h([C.Event()],c.prototype,"cellDeselected",void 0),h([C.Event()],c.prototype,"resizeStart",void 0),h([C.Event()],c.prototype,"resizing",void 0),h([C.Event()],c.prototype,"resizeStop",void 0),h([C.Event()],c.prototype,"columnDragStart",void 0),h([C.Event()],c.prototype,"columnDrag",void 0),h([C.Event()],c.prototype,"columnDrop",void 0),h([C.Event()],c.prototype,"checkboxChange",void 0),h([C.Event()],c.prototype,"printComplete",void 0),h([C.Event()],c.prototype,"beforePrint",void 0),h([C.Event()],c.prototype,"toolbarClick",void 0),h([C.Event()],c.prototype,"beforeDataBound",void 0),h([C.Event()],c.prototype,"contextMenuOpen",void 0),h([C.Event()],c.prototype,"contextMenuClick",void 0),h([C.Event()],c.prototype,"beforeCopy",void 0),h([C.Event()],c.prototype,"beforePaste",void 0),h([C.Event()],c.prototype,"rowDrag",void 0),h([C.Event()],c.prototype,"rowDragStart",void 0),h([C.Event()],c.prototype,"rowDragStartHelper",void 0),h([C.Event()],c.prototype,"rowDrop",void 0),h([C.Event()],c.prototype,"pdfQueryCellInfo",void 0),h([C.Event()],c.prototype,"pdfHeaderQueryCellInfo",void 0),h([C.Event()],c.prototype,"excelQueryCellInfo",void 0),h([C.Event()],c.prototype,"pdfAggregateQueryCellInfo",void 0),h([C.Event()],c.prototype,"excelAggregateQueryCellInfo",void 0),h([C.Event()],c.prototype,"excelHeaderQueryCellInfo",void 0),h([C.Event()],c.prototype,"beforeExcelExport",void 0),h([C.Event()],c.prototype,"excelExportComplete",void 0),h([C.Event()],c.prototype,"beforePdfExport",void 0),h([C.Event()],c.prototype,"pdfExportComplete",void 0),vi=h([C.NotifyPropertyChanges],c));function c(e,t){e=Ri.call(this,e,t)||this;e.dataResults={},e.uniqueIDCollection={},e.uniqueIDFilterCollection={},e.changedRecords="changedRecords",e.deletedRecords="deletedRecords",e.addedRecords="addedRecords",e.indentOutdentAction="indentOutdentAction",e.isFromChartSide=!1,e.modifiedRecords=[],e.stackedHeader=!1,e.freezeColumnRefresh=!0,e.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),r=!0,n=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","index"],o=0;o<i.length;o++)if(e[i[parseInt(o.toString(),10)]]!==t[i[parseInt(o.toString(),10)]]&&-1===n.indexOf(i[parseInt(o.toString(),10)]))if(!(e[i[parseInt(o.toString(),10)]]instanceof Date&&t[i[parseInt(o.toString(),10)]]instanceof Date)||e[i[parseInt(o.toString(),10)]].getTime()!==t[i[parseInt(o.toString(),10)]].getTime()){r=!1;break}return r}return!1},vi.Inject(qt,ce),C.setValue("mergePersistData",e.mergePersistTreeGridData,e),C.isNullOrUndefined(e.injectedModules.Logger)||w.Grid.Inject(w.Logger),e.injectedModules.filter(function(e){"freeze"===e.prototype.getModuleName()&&w.Grid.Inject(w.Freeze)});return e.grid=new w.Grid,e}xi.prototype.getModuleName=function(){return"reorder"},xi.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.updateTreeColumn,this)},xi.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.updateTreeColumn)},xi.prototype.destroy=function(){this.removeEventListener()},xi.prototype.updateTreeColumn=function(){this.parent.getTreeColumn()};e=xi;function xi(e){w.Grid.Inject(w.Reorder),this.parent=e,this.addEventListener()}Ci.prototype.autoFitColumns=function(e){this.parent.grid.autoFitColumns(e)},Ci.prototype.getModuleName=function(){return"resize"},Ci.prototype.destroy=function(){this.parent.isDestroyed||this.parent.grid.resizeModule.destroy()};gi=Ci;function Ci(e){w.Grid.Inject(w.Resize),this.parent=e}u.prototype.getChildrecordsByParentID=function(t){var e=this.parent.dataSource instanceof b.DataManager&&v(this.parent)?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;return e.filter(function(e){return e.uniqueID===t})},u.prototype.addEventListener=function(){this.parent.on(It,this.Rowdraging,this),this.parent.on(Rt,this.rowDropped,this),this.parent.on(St,this.rowsAdded,this),this.parent.on(wt,this.rowsRemoved,this)},u.prototype.reorderRows=function(e,t,i){var r=this.parent;if(e[0]!==t&&-1!==["above","below","child"].indexOf(i)){var n="action";if(e[0]!==t&&-1!==["above","below","child"].indexOf(i)){"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment"),this.parent.dropPosition=this.dropPosition;for(var o=[],a=0;a<e.length;a++){var s=this.parent.getRowByIndex(e[parseInt(a.toString(),10)]).rowIndex;o[parseInt(a.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(s.toString(),10)]}var d,l,p,i={data:o,dropIndex:t};I(this.parent)||this.dropRows(i,!0),r.isLocalData&&(r.flatData=this.orderToIndex(r.flatData)),"outdenting"!==this.parent[n]||C.isNullOrUndefined(o[0].parentItem)||(o[0].level=o[0].parentItem.level+1),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition&&(s=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"indenting"===this.parent[n]?this.parent.treeColumnIndex:void 0,d=this.parent.getRows()[e[0]],r=i.data[0],p=[],(l=[]).push(r),p.push(d),r=x(this.parent,i.data[0].parentUniqueID),t=this.parent.getRows()[parseInt(t.toString(),10)],l.push(r),p.push(t),this.updateRowAndCellElements(l,p,s)),this.parent.enableImmutableMode&&"outdenting"===this.parent[n]&&(s=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"outdenting"===this.parent[n]?this.parent.treeColumnIndex:void 0,r=i.data[0],d=this.parent.getRows()[e[0]],p=[],(l=[]).push(r),p.push(d),this.updateRowAndCellElements(l,p,s))}}},u.prototype.updateRowAndCellElements=function(e,t,i){for(var r=0;r<e.length;r++)this.parent.renderModule.cellRender({data:e[parseInt(r.toString(),10)],cell:t[parseInt(r.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.parent.action&&"outdenting"!==this.parent.action||this.parent.renderModule.RowModifier({data:e[parseInt(r.toString(),10)],row:t[parseInt(r.toString(),10)]})},u.prototype.indentOutdentAction=function(e,t){var i=this.parent,r="dropIndex",n=-1;if(!C.isNullOrUndefined(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?n=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(n=this.parent.selectedRowIndex),this.selectedItem=C.isNullOrUndefined(e)?i.getCurrentViewRecords()[parseInt(n.toString(),10)]:e;var o,e=this.parent.getPrimaryKeyFieldNames()[0],e=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+e]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==n?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(e),this.selectedRecord=this.parent[this.selectedRecords]=-1!==n?i.getCurrentViewRecords()[parseInt(n.toString(),10)]:this.selectedItem,"indent"===t){var a=i.getCurrentViewRecords()[this.selectedRow.rowIndex-1],s=void 0;if(0!==this.selectedRow.rowIndex&&-1!==this.selectedRow.rowIndex&&i.getCurrentViewRecords()[this.selectedRow.rowIndex].level-a.level!=1){if(a.level>this.selectedRecord.level)for(var d=0;d<i.getCurrentViewRecords().length;d++)i.getCurrentViewRecords()[parseInt(d.toString(),10)].taskData===a.parentItem.taskData&&(s=d,i.enableVirtualization)&&(s=parseInt(i.getRows()[parseInt(d.toString(),10)].getAttribute("aria-rowindex"),10)-1);else s=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||a.level>this.selectedRecord.level||(s=parseInt(this.selectedRow.getAttribute("aria-rowindex"),10)-2),i.action="indenting",i[r]=s,this.eventTrigger("indenting",s)}}else"outdent"===t&&(e=-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex,n=0===i.getCurrentViewRecords()[this.selectedRow.rowIndex].level,e||n||(o=this.selectedRecord.parentItem,-1!==(s=i.getCurrentViewRecords().findIndex(function(e){return e.uniqueID===o.uniqueID}))&&(this.parent.enableVirtualization&&this.selectedRecord&&(t=this.parent.getRows()[parseInt(s.toString(),10)].getAttribute("aria-rowindex"),s=parseInt(t,10)-1),i.action="outdenting",i[r]=s,this.eventTrigger("outdenting",s))))}},u.prototype.eventTrigger=function(e,t){var i=this,e={action:e,cancel:!1,data:[this.parent[this.selectedRecords]],row:this.parent[this.selectedRows]};this.parent.trigger(ve,e,function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"below"):i.reorderRows([i.selectedRow.rowIndex],t,"below")))})},u.prototype.orderToIndex=function(e){for(var t,i=0;i<e.length;i++)e[parseInt(i.toString(),10)].index=i,C.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem)||(t=C.getValue("uniqueIDCollection."+e[parseInt(i.toString(),10)].parentUniqueID,this.parent),e[parseInt(i.toString(),10)].parentItem.index=t.index);return e},u.prototype.rowsAdded=function(e){for(var t,i,r,n=e.records,o=e.records.length-1;-1<o;o--)(r=n[parseInt(o.toString(),10)]).parentUniqueID&&(i=n.filter(function(e){return e.uniqueID===r.parentUniqueID})).length&&(t=i[0].childRecords.indexOf(r),i=i[0],-1!==t)&&(C.isNullOrUndefined(this.parent.idMapping)&&(i.childRecords.splice(t,1),i.childRecords.length||(i.hasChildRecords=!1,i.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0);if(C.isNullOrUndefined(this.parent.dataSource)||!this.parent.dataSource.length){for(var a,s=this.parent,d=e.records,o=e.records.length-1;-1<o;o--){a=d[parseInt(o.toString(),10)],!o&&a.hasChildRecords&&(a.taskData[this.parent.parentIdMapping]=null);if(C.isNullOrUndefined(s.parentIdMapping)||(s.childMapping=null),C.isNullOrUndefined(a.taskData)||C.isNullOrUndefined(s.childMapping)||Object.prototype.hasOwnProperty.call(a.taskData,s.childMapping)||(a.taskData[s.childMapping]=[]),!C.isNullOrUndefined(a[s.childMapping])&&Object.prototype.hasOwnProperty.call(a,s.childMapping)&&a[s.childMapping].length&&!this.isDraggedWithChild&&!C.isNullOrUndefined(s.parentIdMapping))for(var l=a[s.childMapping],p=0;p<l.length;p++)-1===d.indexOf(l[parseInt(p.toString(),10)])&&(d.splice(p,0,l[parseInt(p.toString(),10)]),l[parseInt(p.toString(),10)].taskData=C.extend({},l[parseInt(p.toString(),10)]),o+=1);Object.prototype.hasOwnProperty.call(a,s.parentIdMapping)&&null!==a[s.parentIdMapping]&&!this.isDraggedWithChild&&(a.taskData[s.parentIdMapping]=null,delete a.parentItem,delete a.parentUniqueID),C.isNullOrUndefined(s.dataSource)&&(s.dataSource=[]),s.dataSource.splice(0,0,a.taskData)}s.setProperties({dataSource:s.dataSource},!1)}else{for(o=0;o<n.length;o++)C.setValue("uniqueIDCollection."+n[parseInt(o.toString(),10)].uniqueID,n[parseInt(o.toString(),10)],this.parent);e={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof b.DataManager?(this.treeGridData=this.parent.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource),C.isNullOrUndefined(this.dropPosition)&&(this.dropPosition="bottomSegment",e.dropIndex=1<this.parent.getCurrentViewRecords().length?this.parent.getCurrentViewRecords().length-1:e.dropIndex,e.data=e.data.map(function(e){return e.hasChildRecords&&C.isNullOrUndefined(e.parentItem)||(delete e.parentItem,delete e.parentUniqueID),e.level=0,e})),this.dropRows(e)}},u.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)this.draggedRecord=e.records[parseInt(t.toString(),10)],(this.draggedRecord.hasChildRecords||this.draggedRecord.parentItem&&-1!==this.parent.grid.dataSource.indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0])||0===this.draggedRecord.level)&&this.deleteDragRow()},u.prototype.refreshGridDataSource=function(){var e,t=this.draggedRecord,i=this.droppedRecord,r=this.parent,n=this.parent.dataSource instanceof b.DataManager&&v(this.parent)?r.dataSource.dataSource.json:r.dataSource;if(!n||C.isNullOrUndefined(i)||i.parentItem||C.isNullOrUndefined(i.taskData)){if(!this.parent.parentIdMapping&&!C.isNullOrUndefined(i)&&i.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition))for(var o=this.getChildrecordsByParentID(i.parentUniqueID)[0].childRecords,a=0;a<o.length;a++)i.parentItem.taskData[this.parent.childMapping][parseInt(a.toString(),10)]=o[parseInt(a.toString(),10)].taskData}else{for(var s,d=Object.keys(n),a=0;a<d.length;a++)n[parseInt(a.toString(),10)][this.parent.childMapping]?n[parseInt(a.toString(),10)][this.parent.childMapping]===i.taskData[this.parent.childMapping]&&(e=a):(s=this.parent.getPrimaryKeyFieldNames()[0],n[parseInt(a.toString(),10)][""+s]===i.taskData[""+s]&&(e=a));this.parent.idMapping||(r="topSegment"===this.dropPosition?0:1,"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition)||n.splice(e+r,0,t.taskData)}this.parent.parentIdMapping&&(t.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(t[this.parent.parentIdMapping]=i[this.parent.parentIdMapping],t.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]):(t[this.parent.parentIdMapping]=i[this.parent.idMapping],t.taskData[this.parent.parentIdMapping]=i[this.parent.idMapping]):(t.taskData[this.parent.parentIdMapping]=null,t[this.parent.parentIdMapping]=null))},u.prototype.removeFirstrowBorder=function(e){var t="bottomSegment"===this.dropPosition;0<this.parent.element.getElementsByClassName("e-firstrow-border").length&&e&&(0!==e.rowIndex||t)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},u.prototype.removeLastrowBorder=function(e){var t;!e||e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")||(e=(this.parent.enableVirtualization?this.parent.getRows()[this.parent.getCurrentViewRecords().length-1]:this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1)).getAttribute("data-uid")!==e.getAttribute("data-uid")||"topSegment"===this.dropPosition,(t=this.parent.element.getElementsByClassName("e-lastrow-border")[0])&&e&&t.remove())},u.prototype.updateIcon=function(e,t,i){var r=i.target?C.closest(i.target,"tr"):null,n=(this.dropPosition=void 0,0);this.removeFirstrowBorder(r),this.removeLastrowBorder(r);for(var o=0;o<i.rows.length;o++)(C.isNullOrUndefined(r)||r.getAttribute("data-uid")!==i.rows[parseInt(o.toString(),10)].getAttribute("data-uid"))&&w.parentsUntil(i.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem(),C.isNullOrUndefined(this.parent.rowDropSettings.targetID)&&(this.removetopOrBottomBorder(),this.removeChildBorder()));var a=this.parent,s=0,d=a.toolbar&&a.toolbar.length?document.getElementById(a.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,l=this.getOffset(a.element),l=a.getHeaderContent().offsetHeight+l.top+d,d=a.getContent().firstElementChild.scrollTop,s=(C.isNullOrUndefined(r)||(n=r.offsetTop-d),this.parent.enableVirtualization?r.getBoundingClientRect().top:n+l+0),a=((0!==e[0].offsetHeight&&C.isNullOrUndefined(r)?s+e[0].offsetHeight:s+r.offsetHeight)-s)/3,d=s+a,n=d+a,l=n+a,s=w.getObject("originalEvent.event",i),a=w.getObject("originalEvent.event",i),p="mousemove"===s.type?s.pageY:C.isNullOrUndefined(a)||C.isNullOrUndefined(a.changedTouches)?null:a.changedTouches[0].pageY,s=(p=this.parent.enableVirtualization?"mousemove"===s.type?s.clientY:C.isNullOrUndefined(a)||C.isNullOrUndefined(a.changedTouches)?null:a.changedTouches[0].clientY:p)<=d,a=d<p&&p<=n,d=n<p&&p<=l,n=!0;return(s||a||d)&&(s&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(r),this.removeErrorElem(),this.removeLastrowBorder(r)),a&&"Invalid"!==this.dropPosition&&(this.removetopOrBottomBorder(),this.dropPosition="middleSegment",this.addLastRowborder(r),this.addFirstrowBorder(r)),d&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(r),this.removeFirstrowBorder(r)),(s||d)&&"Invalid"!==this.dropPosition?(n=this.updateBorderStatus(e,t),this.topOrBottomBorder(i.target,n)):a&&"Invalid"!==this.dropPosition&&(p=[],l=C.closest(i.target,"tr"),p=[].slice.call(l.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")),n=this.updateBorderStatus(e,t),0<p.length)&&n&&this.addRemoveClasses(p,!0,"e-childborder")),this.dropPosition},u.prototype.updateBorderStatus=function(s,d){var n=this,l=!0,p=this.parent.grid.getRows(),h=[],o=!1,e=(C.isNullOrUndefined(this.parent.detailTemplate)||(p=this.parent.getDataRows(),o=!0),this.parent.treeColumnIndex),c=this.parent.allowRowDragAndDrop?o?e+2:e+1:o?e+1:e,u=(C.isNullOrUndefined(this.parent.rowDropSettings.targetID)||(c=e),s),g=[p[""+d]];return"topSegment"===this.dropPosition&&(s.filter(function(e){if(!(C.isNullOrUndefined(e)||C.isNullOrUndefined(e.cells)||C.isNullOrUndefined(g[0])||C.isNullOrUndefined(g[0].cells))){var t=/index(\d+)|level(\d+)/g,e=null==e?void 0:e.cells[""+c].className.match(t),i=g[0].cells[""+c].className.match(t);if(!(C.isNullOrUndefined(i)||C.isNullOrUndefined(i)||C.isNullOrUndefined(e))){var r=+e[1].match(/\d+/)[0],e=+i[1].match(/\d+/)[0],n=!1;if(0==r||r==e){for(var o=0;o<p.length;o++)if((n=p[parseInt(o.toString(),10)]===u[0]?!0:n)&&p[parseInt(o.toString(),10)]!==u[0]){var a=+p[parseInt(o.toString(),10)].cells[""+c].className.match(t)[1].match(/\d+/)[0];if(!(a!=r&&r<a))break;h.push(p[parseInt(o.toString(),10)])}r==e&&(0<h.length&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1==d-(h.length+1)||0===h.length&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1==d-1)&&(l=!1)}}}return!0}),l=!(!C.isNullOrUndefined(s)&&0===h.length&&!C.isNullOrUndefined(s[0].getAttribute("aria-rowindex"))&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1==d-1&&C.isNullOrUndefined(s[0]))&&l),"bottomSegment"===this.dropPosition&&(g.filter(function(e){if(!(C.isNullOrUndefined(e)||C.isNullOrUndefined(e.cells)||C.isNullOrUndefined(u[0])||C.isNullOrUndefined(u[0].cells))){var t=/index(\d+)|level(\d+)/g,e=null==e?void 0:e.cells[""+c].className.match(t),i=u[0].cells[""+c].className.match(t);if(!C.isNullOrUndefined(i)&&!C.isNullOrUndefined(e)){var r=+e[1].match(/\d+/)[0],e=+i[1].match(/\d+/)[0],n=!1;if(0==r||r==e){for(var o=0;o<p.length;o++)if((n=p[parseInt(o.toString(),10)]===g[0]?!0:n)&&p[parseInt(o.toString(),10)]!==g[0]){var a=+p[parseInt(o.toString(),10)].cells[""+c].className.match(t)[1].match(/\d+/)[0];if(!(a!=r&&r<a))break;h.push(p[parseInt(o.toString(),10)])}!C.isNullOrUndefined(s)&&r==e&&(0<h.length&&!C.isNullOrUndefined(s[0].getAttribute("aria-rowindex"))&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1===d+(h.length+1)||0===h.length&&!C.isNullOrUndefined(s[0].getAttribute("aria-rowindex"))&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1===d+1)&&(l=!1)}}}return!0}),l=!(!C.isNullOrUndefined(s)&&0===h.length&&!C.isNullOrUndefined(s[0].getAttribute("aria-rowindex"))&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1===d+1&&C.isNullOrUndefined(s[0]))&&l),"middleSegment"===this.dropPosition&&g.filter(function(e){if(C.isNullOrUndefined(e)||C.isNullOrUndefined(e.cells)||C.isNullOrUndefined(u[0])||C.isNullOrUndefined(u[0].cells))return!0;for(var t=0;t<u.length;t++){var i=g[0].rowIndex,r=u[parseInt(t.toString(),10)].cells[""+c].className.match(/index(\d+)|level(\d+)/g);if(!r)return!0;r=parseInt(r.find(function(e){return e.includes("index")}).match(/\d+/)[0]||"0",10);if(o&&(i/=2),r!==i||n.parent.rowDropSettings.targetID){l=!0;break}l=!1}return l||(n.dropPosition="Invalid",n.addErrorElem()),l}),this.canDrop=l},u.prototype.removeChildBorder=function(){var e;0<(e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"))).length&&this.addRemoveClasses(e,!1,"e-childborder")},u.prototype.addFirstrowBorder=function(e){var t,i,r=this.parent.element,n=this.parent;e&&0===e.rowIndex&&!e.classList.contains("e-emptyrow")&&(e=this.parent.createElement("div",{className:"e-firstrow-border"}),t=this.parent.getHeaderContent(),i=0,n.toolbar&&(i=n.toolbarModule.getToolbar().offsetHeight),(n=!C.isNullOrUndefined(this.parent.rowDropSettings.targetID))&&(e.style.top=this.parent.grid.element.getElementsByClassName("e-gridheader")[0].offsetHeight+i+"px"),e.style.width=n?r.offsetWidth+"px":r.offsetWidth-this.getScrollWidth()+"px",t.querySelectorAll(".e-firstrow-border").length||t.appendChild(e))},u.prototype.addLastRowborder=function(e){var t;!e||(t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")))||e&&!t&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")===e.getAttribute("data-uid")&&(t=this.parent.createElement("div",{className:"e-lastrow-border"}),e=this.parent.getContent(),t.style.width=this.parent.element.offsetWidth-this.getScrollWidth()+"px",e.querySelectorAll(".e-lastrow-border").length||(e.classList.add("e-treegrid-relative"),e.appendChild(t),t.style.bottom=this.getScrollWidth()+"px"))},u.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?w.Scroll.getScrollBarWidth():0},u.prototype.addErrorElem=function(){var e,t,i,r=document.getElementsByClassName("e-cloneproperties")[0],n="sanitize";r.querySelectorAll(".e-errorelem").length||this.parent.rowDropSettings.targetID||((e=document.createElement("div")).classList.add("e-errorcontainer","e-icons","e-errorelem"),i=r.querySelector(".e-rowcell"),r=r.querySelector(".errorValue"),t=i.innerHTML,r&&(t=this.parent[n](r.innerHTML),r.parentNode.removeChild(r)),i.innerHTML="",(r=document.createElement("span")).className="errorValue",r.style.paddingLeft="16px",r.innerHTML=this.parent[n](t),i.appendChild(e),i.appendChild(r),n=document.querySelector(".e-dropitemscount"),this.hasDropItem&&n&&(t=parseInt(n.style.left,10)+e.offsetWidth+16,i=this.parent.enableRtl?0:t,n.style.left=i+"px",this.hasDropItem=!1))},u.prototype.removeErrorElem=function(){var e,t=document.querySelector(".e-errorelem"),i=document.querySelector(".errorValue"),r=document.querySelector(".e-dropitemscount");t&&(r&&(e=parseInt(r.style.left,10)-t.offsetWidth-16,C.setStyleAttribute(i,{paddingLeft:"0px"}),this.parent.enableRtl||C.setStyleAttribute(r,{left:e+"px"})),t.remove()),this.hasDropItem=!0},u.prototype.topOrBottomBorder=function(e,t){void 0===t&&(t=!0);var e=C.closest(e,"tr"),e=e?Array.from(e.querySelectorAll(".e-rowcell, .e-rowdragdrop, .e-detailrowcollapse")):[];e.length&&(t=t?this.addRemoveClasses.bind(this,e,!0):this.addRemoveClasses.bind(this,e,!1,"e-dragborder"),"topSegment"===this.dropPosition&&(t("e-droptop"),e=this.parent.element.querySelector(".e-lastrow-dragborder"))&&e.remove(),"bottomSegment"===this.dropPosition)&&t("e-dropbottom")},u.prototype.removetopOrBottomBorder=function(){var e=[],e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop"));(e=this.parent.rowDropSettings.targetID?[].slice.call(document.querySelectorAll(".e-dropbottom, .e-droptop")):e).length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},u.prototype.addRemoveClasses=function(e,t,i){for(var r=0,n=e.length;r<n;r++)t?e[parseInt(r.toString(),10)].classList.add(i):e[parseInt(r.toString(),10)].classList.remove(i)},u.prototype.getOffset=function(e){var e=e.getBoundingClientRect(),t=document.body,i=document.documentElement,r=window.pageYOffset||i.scrollTop||t.scrollTop,n=window.pageXOffset||i.scrollLeft||t.scrollLeft,o=i.clientTop||t.clientTop||0,i=i.clientLeft||t.clientLeft||0,t=e.top+r-o,r=e.left+n-i;return{top:Math.round(t),left:Math.round(r)}},u.prototype.Rowdraging=function(e){var t,i,r,n,o,a=this.parent,s=this.parent.element.querySelector(".e-cloneproperties");s&&(s.style.cursor="",t=e.target?C.closest(e.target,"tr"):null,(o=-1)===(o=C.isNullOrUndefined(this.parent.detailTemplate)?t?t.rowIndex:-1:t?this.parent.getDataRows().indexOf(t):-1)?(this.canDrop=!1,this.addErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder()):(t=Array.isArray(e.data)?e.data:[e.data],i=a.getCurrentViewRecords()[parseInt(o.toString(),10)],a.rowDropSettings.targetID&&(n=w.parentsUntil(e.target,"e-treegrid"))&&n.id===this.parent.rowDropSettings.targetID&&(i=(r=n.ej2_instances[0]).getCurrentViewRecords()[parseInt(o.toString(),10)]),this.removeErrorElem(),this.canDrop=!0,this.ensuredropPosition(t,i),a.rowDropSettings.targetID||!this.canDrop||C.isNullOrUndefined(e.rows[0])||a.rowDragAndDropModule.updateIcon(e.rows,o,e),a.rowDropSettings.targetID&&(n=w.parentsUntil(e.target,"e-treegrid"))&&n.id===this.parent.rowDropSettings.targetID&&((r=n.ej2_instances[0]).rowDragAndDropModule.updateIcon(e.rows,o,e),this.dropPosition=r.rowDragAndDropModule.dropPosition),e.target&&C.closest(e.target,"#"+a.rowDropSettings.targetID)&&((n=w.parentsUntil(e.target,"e-treegrid"))||(s.style.cursor="default"))))},u.prototype.rowDropped=function(e){var t=this.parent;if(t.rowDropSettings.targetID){if((e.target&&C.closest(e.target,"#"+t.rowDropSettings.targetID)||w.parentsUntil(e.target,"e-treegrid")&&w.parentsUntil(e.target,"e-treegrid").id===t.rowDropSettings.targetID||e.target&&document.getElementById(t.rowDropSettings.targetID))&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),C.setValue("dropPosition",this.dropPosition,e),t.trigger(mt,e),!e.cancel)&&t.rowDropSettings.targetID){if("Invalid"===this.dropPosition&&!this.canDrop)return;this.dragDropGrid(e),t.isLocalData&&(t.flatData=this.orderToIndex(t.flatData))}}else if((w.parentsUntil(e.target,"e-content")||"Invalid"===this.dropPosition||!this.canDrop)&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),C.setValue("dropPosition",this.dropPosition,e),t.trigger(mt,e),!e.cancel)){if(!I(this.parent)&&"Invalid"===this.dropPosition&&!this.canDrop)return;I(this.parent)||this.dropRows(e),t.isLocalData&&(t.flatData=this.orderToIndex(t.flatData)),t.grid.refresh(),this.removeRowBorders()}if(this.removetopOrBottomBorder(),this.removeChildBorder(),this.removeRowBorders(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!C.isNullOrUndefined(e.data[0].parentItem)){var i=this.parent.treeColumnIndex,t=(i+=1,this.parent.getPrimaryKeyFieldNames()[0]),r=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+t]),n=this.parent.getRows()[parseInt(r.toString(),10)],o=e.data[0];if("middleSegment"===this.dropPosition){var a=[],s=[],o=(a.push(o),s.push(n),x(this.parent,e.data[0].parentUniqueID)),r=this.parent.grid.getRowIndexByPrimaryKey(o[""+t]),e=this.parent.getRows()[parseInt(r.toString(),10)];a.push(o),s.push(e);for(var d=0;d<a.length;d++)this.parent.renderModule.cellRender({data:a[parseInt(d.toString(),10)],cell:s[parseInt(d.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});t=e.getElementsByClassName("e-treegridcollapse")[0];C.isNullOrUndefined(t)||(C.removeClass([t],"e-treegridcollapse"),C.addClass([t],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:o,cell:n.cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},u.prototype.removeRowBorders=function(){var t=this;["e-firstrow-border","e-lastrow-border"].forEach(function(e){e=t.parent.element.getElementsByClassName(e)[0];e&&e.remove()})},u.prototype.dragDropGrid=function(e){var t=this.parent,i=C.closest(e.target,"tr"),i=isNaN(this.getTargetIdx(i))?0:this.getTargetIdx(i),e=w.parentsUntil(e.target,"e-treegrid");if(e&&e.id===this.parent.rowDropSettings.targetID&&!S(this.parent)&&!I(this.parent)){for(var r=e.ej2_instances[0],n=t.getSelectedRecords(),o=[],a=0;a<n.length;a++)o[parseInt(a.toString(),10)]=n[parseInt(a.toString(),10)].index;var s=r.dataSource;if(null!==this.parent.idMapping&&(C.isNullOrUndefined(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!s.length){for(var d=[],a=0;a<n.length;a++)if(n[parseInt(a.toString(),10)].hasChildRecords){d.push(n[parseInt(a.toString(),10)]);for(var l=R(n[parseInt(a.toString(),10)]),p=0;p<l.length;p++)d.push(l[parseInt(p.toString(),10)])}d.length&&(n=d)}t.notify(wt,{indexes:o,records:n}),r.notify(St,{toIndex:i,records:n});var h=r.rowDragAndDropModule.treeGridData;if(!C.isNullOrUndefined(h))for(var c,a=0;a<h.length;a++)h[parseInt(a.toString(),10)].index=a,C.isNullOrUndefined(h[parseInt(a.toString(),10)].parentItem)||(c=C.getValue("uniqueIDCollection."+h[parseInt(a.toString(),10)].parentUniqueID+".index",r),h[parseInt(a.toString(),10)].parentItem.index=c);t.grid.refresh(),r.grid.refresh(),1<r.grid.dataSource.length&&(r.grid.refresh(),C.isNullOrUndefined(r.getHeaderContent().querySelector(".e-firstrow-border"))||r.getHeaderContent().querySelector(".e-firstrow-border").remove(),C.isNullOrUndefined(r.getContent().querySelector(".e-lastrow-border"))||r.getContent().querySelector(".e-lastrow-border").remove())}I(this.parent)&&(r=e.ej2_instances[0],t.grid.refresh(),r.grid.refresh())},u.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10)-1:0},u.prototype.getParentData=function(e,t){var i,e=e.parentItem,r=-1;this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?r=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(r=this.parent.selectedRowIndex),"bottomSegment"===this.dropPosition&&(i=this.parent.getPrimaryKeyFieldNames()[0],t=-1===r?this.parent.grid.getRowIndexByPrimaryKey(t[0][""+i]):this.parent.getSelectedRowIndexes()[0],i=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)],this.droppedRecord=x(this.parent,i.parentItem.uniqueID)),"middleSegment"===this.dropPosition&&(this.parent.getCurrentViewRecords()[parseInt(r.toString(),10)].level===e.level?this.droppedRecord=x(this.parent,e.uniqueID):this.getParentData(e))},u.prototype.dropRows=function(l,p){if("Invalid"!==this.dropPosition&&!S(this.parent)){var h,c=this.parent,u=void 0,g=(C.isNullOrUndefined(l.dropIndex)?(e=this.parent.getPrimaryKeyFieldNames()[0],e=-1===c.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(l.data[0][""+e])-1:c.getSelectedRowIndexes()[0]-1,e=c.getCurrentViewRecords()[parseInt(e.toString(),10)],this.getParentData(e,l.data)):(l.dropIndex=l.dropIndex===l.fromIndex?this.getTargetIdx(l.target.parentElement):l.dropIndex,this.parent.enableVirtualization?(e=this.parent.getRowByIndex(l.dropIndex).rowIndex,this.droppedRecord=c.getCurrentViewRecords()[parseInt(e.toString(),10)]):C.isNullOrUndefined(this.parent.rowDropSettings.targetID)?this.droppedRecord=c.getCurrentViewRecords()[l.dropIndex]:(e=this.parent.grid.getRowsObject(),this.droppedRecord=0<e.length?e[l.dropIndex].data:void 0)),[]),u=this.droppedRecord;l.data[0]?g=l.data:g.push(l.data),this.parent[this.modifiedRecords].push(l.data[0],u);for(var f=0,e=this.parent.rowDropSettings.targetID,t=((this.isMultipleGrid=e)?this.isaddtoBottom=e&&this.isDraggedWithChild:this.ensuredropPosition(g,u),g.length),m=((!C.isNullOrUndefined(this.parent.idMapping)||"bottomSegment"===this.dropPosition&&1<g.length&&C.isNullOrUndefined(this.parent.idMapping))&&g.reverse(),this),i=0;i<t;i++)!function(e){if(h=g[parseInt(e.toString(),10)],m.draggedRecord=h,!m.draggedRecord.hasChildRecords)for(var t=0,i=g;t<i.length;t++){var r=i[t];C.isNullOrUndefined(r.childRecords)||-1===r.childRecords.indexOf(m.draggedRecord)||(m.draggedRecord=void 0)}var n,o,a,s,d;C.isNullOrUndefined(m.draggedRecord)||("Invalid"===m.dropPosition||C.isNullOrUndefined(m.droppedRecord)||(c.rowDropSettings.targetID&&!p||m.deleteDragRow(),m.draggedRecord===m.droppedRecord&&(e=m.getTargetIdx(l.target.offsetParent.parentElement),isNaN(e)&&(e=m.getTargetIdx(l.target.parentElement)),l.dropIndex=e,u=m.droppedRecord=m.parent.getCurrentViewRecords()[l.dropIndex]),!u.parentItem&&"middleSegment"!==m.dropPosition||-1===(s=(a=c.parentData).indexOf(m.draggedRecord))||a.splice(s,1),e=m.treeGridData.indexOf(u),m.dropAtTop(e),"bottomSegment"===m.dropPosition&&(u.hasChildRecords?(f=m.getChildCount(u,0),m.parent.parentIdMapping&&m.treeData.splice(e+f+1,0,m.draggedRecord.taskData),m.treeGridData.splice(e+f+1,0,m.draggedRecord)):(m.parent.parentIdMapping&&m.treeData.splice(e+1,0,m.draggedRecord.taskData),m.treeGridData.splice(e+1,0,m.draggedRecord)),C.isNullOrUndefined(u.parentItem)&&(delete h.parentItem,delete h.parentUniqueID,h.level=0,m.parent.parentIdMapping)&&(h[m.parent.parentIdMapping]=null),u.parentItem&&(o=(n=m.getChildrecordsByParentID(u.parentUniqueID)[0].childRecords).indexOf(u)+1,n.splice(o,0,h),h.parentItem=u.parentItem,h.parentUniqueID=u.parentUniqueID,h.level=u.level,m.parent.parentIdMapping)&&(h[m.parent.parentIdMapping]=u[m.parent.parentIdMapping],h.parentItem=u.parentItem,h.level=u.level),h.hasChildRecords)&&(m.updateChildRecordLevel(h,1),m.updateChildRecord(h,e+f+1)),m.dropMiddle(e)),C.isNullOrUndefined(h.parentItem)&&(s=(a=c.parentData).indexOf(m.droppedRecord),d=0,a.filter(function(e){h.uniqueID===e.uniqueID&&d++}),"bottomSegment"===m.dropPosition&&0===d?a.splice(s+1,0,h):"topSegment"===m.dropPosition&&0===d&&a.splice(s,0,h)),c.rowDragAndDropModule.refreshGridDataSource())}(i)}},u.prototype.dropMiddle=function(e){var t=this.parent,i=R(this.droppedRecord),i=C.isNullOrUndefined(i)||0===i.length?e+1:i.length+e+1;"middleSegment"===this.dropPosition&&(t.parentIdMapping&&this.treeData.splice(i,0,this.draggedRecord.taskData),this.treeGridData.splice(i,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords)&&this.updateChildRecord(this.draggedRecord,i)},u.prototype.dropAtTop=function(e){var t=this.parent;"topSegment"===this.dropPosition&&(t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData),t=this.treeGridData[parseInt(e.toString(),10)],this.draggedRecord.parentItem=t.parentItem,this.draggedRecord.parentUniqueID=t.parentUniqueID,this.draggedRecord.level=t.level,this.treeGridData.splice(parseInt(e.toString(),10),0,this.draggedRecord),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)),this.droppedRecord.parentItem)&&(e=(t=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID)[0].childRecords).indexOf(this.droppedRecord),t.splice(e,0,this.draggedRecord))},u.prototype.recordLevel=function(){var e,t=this.parent,i=this.draggedRecord,r=this.droppedRecord,n=t.childMapping;!r.hasChildRecords&&(r.hasChildRecords=!0,r.hasFilteredChildRecords=!0,C.isNullOrUndefined(r.childRecords)||0===r.childRecords.length)&&(r.childRecords=[],!t.parentIdMapping)&&C.isNullOrUndefined(r.taskData[""+n])&&(r.taskData[""+n]=[]),"middleSegment"===this.dropPosition&&(delete(e=C.extend({},r)).childRecords,i.parentItem=e,i.parentUniqueID=r.uniqueID,r.childRecords.splice(r.childRecords.length,0,i),C.setValue("uniqueIDCollection."+i.uniqueID,i,t),t.isSelfReference&&(r[t.childMapping]=[],r[t.childMapping].splice(r[t.childMapping].length,0,i)),C.isNullOrUndefined(i)||t.parentIdMapping||C.isNullOrUndefined(r.taskData[""+n])||r.taskData[t.childMapping].splice(r.childRecords.length,0,i.taskData),i.hasChildRecords?(i.level=r.level+1,this.updateChildRecordLevel(i,1)):i.level=r.level+1,r.expanded=!0)},u.prototype.deleteDragRow=function(){this.parent.dataSource instanceof b.DataManager&&v(this.parent)?(this.treeGridData=this.parent.grid.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource);var e=x(this.parent,this.draggedRecord.uniqueID);!C.isNullOrUndefined(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},u.prototype.updateChildRecord=function(e,t){var i,r=this.parent;if(!e.hasChildRecords)return 0;for(var n=e.childRecords.length,o=0;o<n;o++)i=this.isMultipleGrid?e.childRecords[parseInt(o.toString(),10)]:C.getValue("uniqueIDCollection."+e.childRecords[parseInt(o.toString(),10)].uniqueID,r),r.flatData.splice(++t,0,i),C.setValue("uniqueIDCollection."+i.uniqueID,i,this.parent),r.parentIdMapping&&this.treeData.splice(t,0,i.taskData),i.hasChildRecords&&(t=this.updateChildRecord(i,t));return t},u.prototype.updateChildRecordLevel=function(e,t){if(t++,!e.hasChildRecords)return 0;for(var i=e.childRecords.length,r=0;r<i;r++){var n=this.isMultipleGrid?e.childRecords[parseInt(r.toString(),10)]:C.getValue("uniqueIDCollection."+e.childRecords[parseInt(r.toString(),10)].uniqueID,this.parent),o=void 0;e.parentItem&&(o=x(this.parent,e.parentItem.uniqueID)),C.isNullOrUndefined(o)&&!C.isNullOrUndefined(e.parentItem)&&(o=e.parentItem),n.level=e.parentItem?o.level+t:e.level+1,n.hasChildRecords&&(t--,t=this.updateChildRecordLevel(n,t))}return t},u.prototype.removeRecords=function(e){var t=this,i=this.parent,r=this.parent.dataSource instanceof b.DataManager&&v(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,n=e,e=!C.isNullOrUndefined(i.parentIdMapping),o=this.getChildrecordsByParentID(n.parentUniqueID)[0];if(n){n.parentItem&&(a=0,s=o?o.childRecords:[])&&0<s.length&&(a=s.indexOf(n),o.childRecords.splice(a,1),this.parent.parentIdMapping&&!i.enableImmutableMode||hi({value:n,action:"delete"},this.parent,e,n.index,n.index)),i.parentIdMapping&&(n.hasChildRecords&&0<n.childRecords.length&&this.removeChildItem(n),s=r.findIndex(function(e){return e[t.parent.idMapping]===n.taskData[t.parent.idMapping]}),a=this.treeGridData.findIndex(function(e){return e[t.parent.idMapping]===n.taskData[t.parent.idMapping]}),-1===s||C.isNullOrUndefined(s)||r.splice(s,1),-1===a||C.isNullOrUndefined(a)||this.treeGridData.splice(a,1));var a,s,d=this.treeGridData.indexOf(n);if(i.parentIdMapping||-1!==(e=this.parent.parentData.indexOf(n))&&(i.parentData.splice(e,1),r.splice(e,1)),-1===d&&!i.parentIdMapping)for(var l=i.getPrimaryKeyFieldNames()[0],p=0;p<this.treeGridData.length;p++)this.treeGridData[parseInt(p.toString(),10)][""+l]===n[""+l]&&(d=p);i.parentIdMapping||(s=this.getChildCount(n,0),this.treeGridData.splice(d,s+1)),n.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(o.expanded=!1,o.hasChildRecords=!1,o.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(o)||C.isNullOrUndefined(o)||this.parent[this.modifiedRecords].push(o),C.isNullOrUndefined(o)||this.updateModifiedRecords(o)}},u.prototype.updateModifiedRecords=function(e){e=x(this.parent,e.parentUniqueID);C.isNullOrUndefined(e)||(this.parent[this.modifiedRecords].push(e),this.updateModifiedRecords(e))},u.prototype.removeChildItem=function(e){for(var t,i,r,n=this.parent.dataSource instanceof b.DataManager&&v(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,o=0;o<e.childRecords.length;o++){t=e.childRecords[parseInt(o.toString(),10)],!C.isNullOrUndefined(t.childRecords)&&t.childRecords.length&&(t.hasChildRecords=!0);for(var a=void 0,a=this.parent.dataSource instanceof b.DataManager&&v(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,s=0;s<a.length;s++)a[parseInt(s.toString(),10)][this.parent.idMapping]===t.taskData[this.parent.idMapping]&&(i=s);for(var d=0;d<this.treeGridData.length;d++)if(this.treeGridData[parseInt(d.toString(),10)][this.parent.idMapping]===t.taskData[this.parent.idMapping]){r=d;break}-1===i||C.isNullOrUndefined(i)||n.splice(i,1),-1===r||C.isNullOrUndefined(r)||this.treeGridData.splice(r,1),t.hasChildRecords&&this.removeChildItem(t)}},u.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)t++,(i=e.childRecords[parseInt(r.toString(),10)]).hasChildRecords&&(t=this.getChildCount(i,t));return t},u.prototype.ensuredropPosition=function(e,t){var i=this;e.filter(function(e){e.hasChildRecords&&!C.isNullOrUndefined(e.childRecords)&&(-1===e.childRecords.indexOf(t)?i.ensuredropPosition(e.childRecords,t):(i.dropPosition="Invalid",i.addErrorElem(),i.canDrop=!1,C.isNullOrUndefined(i.parent.rowDropSettings.targetID)&&(i.removetopOrBottomBorder(),i.removeChildBorder())))})},u.prototype.isDuplicateData=function(i){var e=this.parent.getPrimaryKeyFieldNames();return 0!==e.length&&this.parent.flatData.some(function(t){return e.every(function(e){return t[e]===i[e]})})},u.prototype.destroy=function(){this.removeEventListener()},u.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(It,this.Rowdraging),this.parent.off(Rt,this.rowDropped),this.parent.off(St,this.rowsAdded),this.parent.off(wt,this.rowsRemoved))},u.prototype.getModuleName=function(){return"rowDragAndDrop"};h=u;function u(e){this.canDrop=!0,this.isDraggedWithChild=!1,this.modifiedRecords="modifiedRecords",this.selectedRecords="selectedRecords",this.selectedRows="selectedRows",this.hasDropItem=!0,this.isaddtoBottom=!1,w.Grid.Inject(w.RowDD),this.parent=e,this.addEventListener()}bi=function(e,t){return(bi=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])}))(e,t)};var bi,Di,Mi=function(e,t){function i(){this.constructor=e}bi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Oi=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Mi=(Di=C.ChildProperty,Mi(Pi,Di),Oi([C.Property()],Pi.prototype,"targetID",void 0),Pi);function Pi(){return null!==Di&&Di.apply(this,arguments)||this}Ai=function(e,t){return(Ai=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])}))(e,t)};var Ai,Ei,Oi=function(e,t){function i(){this.constructor=e}Ai(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ni=(Ei=w.VirtualRowModelGenerator,Oi(Ui,Ei),Ui.prototype.addEventListener=function(){this.parent.on(lt,this.getDatas,this)},Ui.prototype.getDatas=function(e){this.visualData=e.data},Ui.prototype.getDataInfo=function(){return Ei.prototype.getData.call(this)},Ui.prototype.generateRows=function(e,t){var i=this.getDataInfo();if("refresh"===t.requestType&&t.isExpandCollapse&&(t.virtualInfo=this.prevInfo),C.isNullOrUndefined(t.virtualInfo)||this.parent.root.loadChildOnDemand&&S(this.parent.root)||("right"!==t.virtualInfo.direction&&"left"!==t.virtualInfo.direction?S(this.parent.root)&&!I(this.parent)&&1!==t.virtualInfo.blockIndexes.length||(t.virtualInfo.blockIndexes=i.blockIndexes):t.virtualInfo.blockIndexes=this.getBlockIndexes(t.virtualInfo.page)),this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||I(this.parent))return Ei.prototype.generateRows.call(this,e,t);C.isNullOrUndefined(t.requestType)||"collapseAll"!==t.requestType.toString()||(t.requestType="refresh");var r=Ei.prototype.generateRows.call(this,e,t);if(!C.isNullOrUndefined(this.visualData))for(var n=0;n<r.length;n++)r[parseInt(n.toString(),10)].index=this.visualData.indexOf(r[parseInt(n.toString(),10)].data);return r},Ui.prototype.checkAndResetCache=function(t){var e,i=["paging","refresh","sorting","filtering","searching","reorder","save","delete"].some(function(e){return t===e});return this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||I(this.parent)?(e=this.model.currentPage,i?(this.cache={},this.data={},this.groups={}):"virtualscroll"===t&&this.cache[parseInt(e.toString(),10)]&&this.cache[parseInt(e.toString(),10)].length>this.parent.contentModule.getBlockSize()&&this.cache[parseInt(e.toString(),10)].length>this.parent.contentModule.getBlockSize()&&(this.cache[parseInt(e.toString(),10)]=this.cache[parseInt(e.toString(),10)].slice(0,this.parent.contentModule.getBlockSize()))):!i&&"virtualscroll"!==t||(this.cache={},this.data={},this.groups={}),i},Ui);function Ui(e){e=Ei.call(this,e)||this;return e.addEventListener(),e}g.prototype.getModuleName=function(){return"filter"},g.prototype.destroy=function(){this.removeEventListener()},g.prototype.addEventListener=function(){this.parent.on("updateFilterRecs",this.updatedFilteredRecord,this),this.parent.on("clearFilters",this.clearFilterLevel,this)},g.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateFilterRecs",this.updatedFilteredRecord),this.parent.off("clearFilters",this.clearFilterLevel))},g.prototype.updatedFilteredRecord=function(e){C.setValue("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var t=(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode,i=0;i<this.flatFilteredData.length;i++){var r=this.flatFilteredData[parseInt(i.toString(),10)],n=(this.addParentRecord(r),"Child"!==t&&"None"!==t||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0),w.getObject("childRecords",r)),n=(!C.isNullOrUndefined(n)&&n.length&&C.setValue("hasFilteredChildRecords",this.checkChildExsist(r),r),w.getObject("parentItem",r));C.isNullOrUndefined(n)||(n=x(this.parent,r.parentItem.uniqueID,!0),C.setValue("hasFilteredChildRecords",!0,n),n&&n.parentItem&&this.updateParentFilteredRecord(n))}0<this.flatFilteredData.length&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},g.prototype.updateParentFilteredRecord=function(e){var e=x(this.parent,e.parentItem.uniqueID,!0),t=C.getValue("uniqueIDFilterCollection",this.parent);e&&Object.prototype.hasOwnProperty.call(t,e.uniqueID)&&C.setValue("hasFilteredChildRecords",!0,e),e&&e.parentItem&&this.updateParentFilteredRecord(e)},g.prototype.addParentRecord=function(e){var t=x(this.parent,e.parentUniqueID);"None"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key?(C.isNullOrUndefined(t)||("Child"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||-1!==this.flatFilteredData.indexOf(t))&&this.addParentRecord(t),-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),C.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))):C.isNullOrUndefined(t)?-1!==this.flatFilteredData.indexOf(e)&&-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),C.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent),e.hasFilteredChildRecords=!0):(this.addParentRecord(t),-1!==this.flatFilteredData.indexOf(t)||-1!==this.filteredResult.indexOf(t)?-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),C.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),C.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)))},g.prototype.checkChildExsist=function(e){for(var t=w.getObject("childRecords",e),i=!1,r=0;r<t.length;r++){var n,o=t[parseInt(r.toString(),10)].childRecords,a=(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode;if("Child"!==a&&"Both"!==a||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(n=C.getValue("uniqueIDFilterCollection",this.parent),Object.prototype.hasOwnProperty.call(n,t[parseInt(r.toString(),10)].uniqueID))||(this.filteredResult.push(t[parseInt(r.toString(),10)]),C.setValue("uniqueIDFilterCollection."+t[parseInt(r.toString(),10)].uniqueID,t[parseInt(r.toString(),10)],this.parent),i=!0),"None"===a&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(t[parseInt(r.toString(),10)])){i=!0;break}!C.isNullOrUndefined(o)&&o.length&&(i=this.checkChildExsist(t[parseInt(r.toString(),10)])),"Child"!==a&&"Both"!==a||!t.length||(i=!0)}return i},g.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,i=0;i<t;i++){var r=x(this.parent,e[parseInt(i.toString(),10)].parentUniqueID);-1!==e.indexOf(r)?(r=x(this.parent,e[parseInt(i.toString(),10)].parentUniqueID,!0),e[parseInt(i.toString(),10)].filterLevel=r.filterLevel+1):(e[parseInt(i.toString(),10)].filterLevel=0,this.filteredParentRecs.push(e[parseInt(i.toString(),10)]))}},g.prototype.clearFilterLevel=function(e){for(var t=0,i=e.flatData,r=i.length;t<r;t++){var n,o=(n=i[parseInt(t.toString(),10)]).filterLevel;!o&&0!==o&&C.isNullOrUndefined(n.hasFilteredChildRecords)||(n.hasFilteredChildRecords=null,n.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:i,count:i.length})};Oi=g;function g(e){w.Grid.Inject(w.Filter),this.parent=e,this.isHierarchyFilter=!1,this.filteredResult=[],this.flatFilteredData=[],this.filteredParentRecs=[],this.addEventListener()}f.prototype.getModuleName=function(){return"ExcelExport"},f.prototype.addEventListener=function(){this.parent.on("updateResults",this.updateExcelResultModel,this),this.parent.on("excelCellInfo",this.excelQueryCellInfo,this),this.parent.grid.on("export-RowDataBound",this.exportRowDataBound,this),this.parent.on("excelAggregateCellInfo",this.excelAggregateCellInfo,this),this.parent.grid.on("finalPageSetup",this.finalPageSetup,this)},f.prototype.destroy=function(){this.removeEventListener()},f.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateResults",this.updateExcelResultModel),this.parent.off("excelCellInfo",this.excelQueryCellInfo),this.parent.grid.off("export-RowDataBound",this.exportRowDataBound),this.parent.off("excelAggregateCellInfo",this.excelAggregateCellInfo),this.parent.grid.off("finalPageSetup",this.finalPageSetup))},f.prototype.updateExcelResultModel=function(e){this.dataResults=e},f.prototype.Map=function(r,n,o,a,s){var d=this,l=this.parent.dataSource,p=new w.Data(this.parent.grid),h=Object();if(C.setValue("isCsv",s,h),C.setValue("cancel",!1,h),C.isNullOrUndefined(r)||(this.isCollapsedStatePersist=r.isCollapsedStatePersist),!C.isNullOrUndefined(r)){if(!this.isLocal()&&!C.isNullOrUndefined(r.dataSource)&&!r.dataSource.dataSource)return this.parent.grid.excelExportModule.Map(this.parent.grid,r,n,o,s,a);if("CurrentPage"===r.exportType)return r.dataSource=this.parent.getCurrentViewRecords(),this.parent.grid.excelExportModule.Map(this.parent.grid,r,n,o,s,a)}return new Promise(function(i){var e=!d.isLocal()||l instanceof b.DataManager?d.parent.dataSource:new b.DataManager(l),t=new b.Query;if(d.isLocal()||((t=d.generateQuery(t)).queries=d.parent.grid.getDataModule().generateQuery().queries,t=w.ExportHelper.getQuery(d.parent.grid,p),C.isNullOrUndefined(d.parent.filterModule)&&(t.queries=t.queries.slice(1,2),t.params=t.params.slice(0,0)),C.setValue("query",t,h)),d.parent.trigger(Ae,C.extend(h,r)),w.getObject("cancel",h))return null;e.executeQuery(t).then(function(e){var t=null;return C.isNullOrUndefined(r)||C.isNullOrUndefined(r.dataSource)||(t=r.dataSource),r=d.manipulateExportProperties(r,l,e),d.parent.grid.excelExportModule.Map(d.parent.grid,r,n,o,s,a).then(function(e){null!=t?r.dataSource=t:delete r.dataSource,i(e)})})})},f.prototype.generateQuery=function(e,t){return!C.isNullOrUndefined(t)&&"CurrentPage"===t.exportType&&this.parent.allowPaging&&(t.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=w.getObject("grid.renderModule.data.pageQuery",this.parent)(e)),e},f.prototype.manipulateExportProperties=function(e,t,i){var r,n=Object();return C.isNullOrUndefined(this.parent.grid.getDataModule())||C.setValue("query",this.parent.grid.getDataModule().generateQuery(!0),n),C.setValue("isExport",!0,n),C.isNullOrUndefined(e)||C.isNullOrUndefined(e.exportType)||C.setValue("exportType",e.exportType,n),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(w.getObject("result",i)),C.setValue("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),n=this.dataResults,t=C.isNullOrUndefined(n.result)?this.parent.flatData.slice(0):n.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource&&(i=this.parent.flatData,r=e.dataSource instanceof b.DataManager?e.dataSource.dataSource.json:e.dataSource,this.parent.dataModule.convertToFlatData(r),t=this.parent.flatData,this.parent.flatData=i),(e=C.isNullOrUndefined(e)?Object():e).dataSource=new b.DataManager({json:t}),0<this.parent.aggregates.length&&(e.query=n.query),e},f.prototype.excelQueryCellInfo=function(e){var t,i;this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex&&(t={},i=e.data,i=C.isNullOrUndefined(i.filterLevel)?i.level:i.filterLevel,t.indent=i,e.style=t),this.parent.notify("updateResults",e),this.parent.trigger("excelQueryCellInfo",e)},f.prototype.excelAggregateCellInfo=function(e){this.parent.trigger("excelAggregateQueryCellInfo",e)},f.prototype.exportRowDataBound=function(e){var t,i,r,n,o,a;"excel"===e.type&&(t=e.rowObj.data,n=this.parent.grid.filterSettings.columns.length,i=e.excelRows.length,r=t.level,t.parentItem&&x(this.parent,t.parentItem.uniqueID,Boolean(n))?(o=n=!1,a=y(this.parent,t,this.parent.parentData),!this.isCollapsedStatePersist||a&&this.parent.isLocalData||(n=!0,o=!t.expanded),e.excelRows[i-1].grouping={outlineLevel:r,isCollapsed:o,isHidden:n}):t.hasChildRecords&&C.isNullOrUndefined(t.parentItem)&&(e.excelRows[i-1].grouping={outlineLevel:r}))},f.prototype.finalPageSetup=function(e){for(var t=0;t<e.worksheets.length;t++)e.worksheets[parseInt(t.toString(),10)].rows&&(e.worksheets[parseInt(t.toString(),10)].pageSetup={isSummaryRowBelow:!1})},f.prototype.isLocal=function(){return!S(this.parent)&&v(this.parent)};var ki=f;function f(e){this.isCollapsedStatePersist=!1,w.Grid.Inject(w.ExcelExport),this.parent=e,this.dataResults={},this.addEventListener()}m.prototype.getModuleName=function(){return"PdfExport"},m.prototype.addEventListener=function(){this.parent.on("pdfCellInfo",this.pdfQueryCellInfo,this),this.parent.on("updateResults",this.updatePdfResultModel,this),this.parent.on("pdfAggregateCellInfo",this.pdfAggregateCellInfo,this)},m.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel),this.parent.off("pdfAggregateCellInfo",this.pdfAggregateCellInfo))},m.prototype.destroy=function(){this.removeEventListener()},m.prototype.updatePdfResultModel=function(e){this.dataResults=e},m.prototype.Map=function(r,n,o,a){var s=this,d=this.parent.dataSource,l=Object(),p=!S(this.parent)&&v(this.parent);return C.setValue("cancel",!1,l),new Promise(function(i){var e=!p||d instanceof b.DataManager?s.parent.dataSource:new b.DataManager(d),t=new b.Query;if(p||(t=s.generateQuery(t),C.setValue("query",t,l)),s.parent.trigger(Ee,C.extend(l,r)),w.getObject("cancel",l))return null;e.executeQuery(t).then(function(e){var t=null;return C.isNullOrUndefined(r)||C.isNullOrUndefined(r.dataSource)||(t=r.dataSource),r=s.manipulatePdfProperties(r,d,e),s.parent.grid.pdfExportModule.Map(s.parent.grid,r,n,o,a).then(function(e){null!=t?r.dataSource=t:delete r.dataSource,i(e)})})})},m.prototype.generateQuery=function(e,t){return!C.isNullOrUndefined(t)&&"CurrentPage"===t.exportType&&this.parent.allowPaging&&(t.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=w.getObject("grid.renderModule.data.pageQuery",this.parent)(e)),e},m.prototype.manipulatePdfProperties=function(e,t,i){var r={},n=!S(this.parent)&&v(this.parent);return C.setValue("query",this.parent.grid.getDataModule().generateQuery(!0),r),C.setValue("isExport",!0,r),C.setValue("isPdfExport",!0,r),C.isNullOrUndefined(e)||C.isNullOrUndefined(e.isCollapsedStatePersist)||C.setValue("isCollapsedStatePersist",e.isCollapsedStatePersist,r),C.isNullOrUndefined(e)||C.isNullOrUndefined(e.exportType)||C.setValue("exportType",e.exportType,r),n||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(C.getValue("result",i)),C.setValue("expresults",this.parent.flatData,r)),this.parent.notify("dataProcessor",r),r=this.dataResults,t=C.isNullOrUndefined(r.result)?this.parent.flatData.slice(0):r.result,n||(this.parent.flatData=[]),e&&e.dataSource&&n&&(i=this.parent.flatData,n=e.dataSource instanceof b.DataManager?e.dataSource.dataSource.json:e.dataSource,this.parent.dataModule.convertToFlatData(n),t=this.parent.flatData,this.parent.flatData=i),(e=C.isNullOrUndefined(e)?{}:e).dataSource=new b.DataManager({json:t}),e.query=r.query,e},m.prototype.pdfQueryCellInfo=function(e){var t,i;this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex&&(t={},i=w.getObject("data",e),i=C.isNullOrUndefined(i.filterLevel)?i.level:i.filterLevel,t.paragraphIndent=3*i,e.style=t),this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)},m.prototype.pdfAggregateCellInfo=function(e){this.parent.trigger("pdfAggregateQueryCellInfo",e)};var qi=m;function m(e){w.Grid.Inject(w.PdfExport),this.parent=e,this.dataResults={},this.addEventListener()}O.prototype.addEventListener=function(){this.parent.on(Be,this.collapseExpandPagedchilds,this),this.parent.on(ze,this.pageAction,this)},O.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Be,this.collapseExpandPagedchilds),this.parent.off(ze,this.pageAction))},O.prototype.getModuleName=function(){return"pager"},O.prototype.refresh=function(){this.parent.grid.pagerModule.refresh()},O.prototype.destroy=function(){this.removeEventListener()},O.prototype.goToPage=function(e){this.parent.grid.pagerModule.goToPage(e)},O.prototype.updateExternalMessage=function(e){C.isNullOrUndefined(e)&&this.parent.trigger(Mt,{error:"The provided value for the message is undefined. Please ensure the message contains string."}),this.parent.grid.pagerModule.updateExternalMessage(e)},O.prototype.collapseExpandPagedchilds=function(t){t.record.expanded="collapse"!==t.action,this.parent.flatData.map(function(e){return e.expanded=(e.uniqueID===t.record.uniqueID&&e.expanded!==t.record.expanded?t.record:e).expanded}),this.parent.enableImmutableMode&&(i=this.parent.getPrimaryKeyFieldNames()[0],(r=this.parent.flatData.filter(function(e){return e[""+i]===t.record[""+i]})).length)&&(r[0].expanded=t.record.expanded);var i,e,r={result:this.parent.flatData,row:t.row,action:t.action,record:t.record,count:this.parent.flatData.length};C.getValue("grid.renderModule",this.parent).dataManagerSuccess(r),this.parent.enableImmutableMode&&(e=void 0,"collapse"===r.action?(e=r.row.getElementsByClassName("e-treegridexpand")[0],C.isNullOrUndefined(e)||(C.removeClass([e],"e-treegridexpand"),C.addClass([e],"e-treegridcollapse"))):"expand"===r.action&&(e=r.row.getElementsByClassName("e-treegridcollapse")[0],C.isNullOrUndefined(e)||(C.removeClass([e],"e-treegridcollapse"),C.addClass([e],"e-treegridexpand"))))},O.prototype.pageRoot=function(i,r,e){for(var n=C.isNullOrUndefined(e)?[]:e,o=this,t=0;t<r.length;t++)!function(t){n.push(r[parseInt(t.toString(),10)]);var e;r[parseInt(t.toString(),10)].hasChildRecords&&(e=i.filter(function(e){return r[parseInt(t.toString(),10)].uniqueID===e.parentUniqueID}),n=o.pageRoot(i,e,n))}(t);return n},O.prototype.updatePageSize=function(e){var e=e.count,t=this.parent.grid.pagerModule;!0===this.parent.pageSettings.pageSizes&&t.pagerObj.pagerdropdownModule.dropDownListObject.value===t.pagerObj.getLocalizedLabel("All")&&(t.pagerObj.totalRecordsCount=e,this.parent.grid.pageSettings.pageSize=e)},O.prototype.pageAction=function(e){var t,i,r,n,o,a,s=this,d=new b.DataManager(e.result);"Root"===this.parent.pageSettings.pageSizeMode?(t=[],r=0<this.parent.grid.filterSettings.columns.length&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",r=(new b.Query).where(r,"equal",0),t=d.executeLocal(r),e.count=t.length,a=(n=this.parent.grid.pageSettings.pageSize)*((o=this.parent.grid.pageSettings.currentPage)-1),r=r.skip(a).take(n),t=d.executeLocal(r),d=this.pageRoot(e.result,t),e.result=d):(t=new b.DataManager(e.result),d=new b.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),d=t.executeLocal((new b.Query).where(d)),i=void 0,i=Et(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?d:d.filter(function(e){return y(s.parent,e)}),e.count=i.length,r=new b.Query,n=this.parent.grid.pageSettings.pageSize,this.updatePageSize(e),o=this.parent.grid.pageSettings.currentPage,i.length<o*n&&(o=Math.floor(i.length/n)+(i.length%n?1:0),this.parent.grid.setProperties({pageSettings:{currentPage:o=o||1}},!0)),r=r.skip(a=n*(o-1)).take(n),t.dataSource.json=i,e.result=t.executeLocal(r)),this.parent.notify("updateAction",e)};var Ti=O;function O(e){w.Grid.Inject(w.Page),this.parent=e,this.addEventListener()}Bi.prototype.getModuleName=function(){return"toolbar"},Bi.prototype.addEventListener=function(){this.parent.on(De,this.refreshToolbar,this),this.parent.on(Oe,this.refreshToolbar,this),this.parent.on(Pe,this.toolbarClickHandler,this)},Bi.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(De,this.refreshToolbar),this.parent.off(Oe,this.refreshToolbar),this.parent.off(Pe,this.toolbarClickHandler))},Bi.prototype.refreshToolbar=function(e){var t,i,r,n,o,a,s=this.parent.grid.toolbarModule.getToolbar();C.isNullOrUndefined(s)||(a=o=void 0,n=(t=this.parent).element.id+"_gridcontrol_indent",i=t.element.id+"_gridcontrol_outdent",n=s.querySelector("#"+n),s=s.querySelector("#"+i),i=e.row,r=t.getSelectedRows()[0],C.isNullOrUndefined(i[0])||(i=i[0]),i=C.isNullOrUndefined(r)||r.rowIndex===i.rowIndex?i:r,null!==n&&null!==s&&(o=n.parentElement,a=s.parentElement,0===i.rowIndex||1<t.getSelectedRowIndexes().length?(o.classList.add("e-hidden"),a.classList.add("e-hidden")):("rowDeselected"!==e.name||!C.isNullOrUndefined(r)&&t.grid.isCheckBoxSelection)&&(n=t.getCurrentViewRecords()[i.rowIndex],C.isNullOrUndefined(n)||(n.level>t.getCurrentViewRecords()[i.rowIndex-1].level?o.classList.add("e-hidden"):o.classList.remove("e-hidden"),n.level===t.getCurrentViewRecords()[i.rowIndex-1].level&&o.classList.remove("e-hidden"),0===n.level&&a.classList.add("e-hidden"),0!==n.level&&a.classList.remove("e-hidden"))),"rowDeselected"===e.name)&&C.isNullOrUndefined(r)&&!t.grid.isCheckBoxSelection&&(this.parent.toolbar.includes("Indent")&&o.classList.add("e-hidden"),this.parent.toolbar.includes("Outdent"))&&a.classList.add("e-hidden"))},Bi.prototype.toolbarClickHandler=function(e){var t=this.parent,i="indentOutdentAction";"Cell"===this.parent.editSettings.mode&&"Batch"===this.parent.grid.editSettings.mode&&e.item.id===this.parent.grid.element.id+"_update"&&(e.cancel=!0,this.parent.grid.editModule.saveCell()),e.item.id===this.parent.grid.element.id+"_expandall"&&this.parent.expandAll(),e.item.id===this.parent.grid.element.id+"_collapseall"&&this.parent.collapseAll(),e.item.id===t.grid.element.id+"_indent"&&t.getSelectedRecords().length&&!C.isNullOrUndefined(t.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[i](null,"indent"),e.item.id===t.grid.element.id+"_outdent"&&t.getSelectedRecords().length&&!C.isNullOrUndefined(t.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[i](null,"outdent")},Bi.prototype.getToolbar=function(){return this.parent.grid.toolbarModule.getToolbar()},Bi.prototype.enableItems=function(e,t){this.parent.grid.toolbarModule.enableItems(e,t)},Bi.prototype.destroy=function(){this.removeEventListener()};var Vi=Bi;function Bi(e){w.Grid.Inject(w.Toolbar),this.parent=e,this.addEventListener()}Li.prototype.getModuleName=function(){return"summary"},Li.prototype.removeEventListener=function(){this.parent.isDestroyed},Li.prototype.calculateSummaryValue=function(e,t,a){this.summaryQuery=e;var s,d,e=t.filter(function(e){return!w.getObject("isSummaryRow",e)}),i=Nt(e),l=e.slice(),r=Object.keys(this.parent.aggregates).length,t=Object.keys(i).length,p=this.parent.getColumns();if(this.parent.aggregates.filter(function(e){return e.showChildSummary}).length){for(var n=0,o=t;n<o;n++)if(s=i[parseInt(n.toString(),10)],d=this.getChildRecordsLength(s,l)){for(var h=this,c=1,u=r;c<=u;c++)!function(e){for(var t=void 0,t={},i=0;i<p.length;i++)t[""+(C.isNullOrUndefined(w.getObject("field",p[parseInt(i.toString(),10)]))?p[parseInt(i.toString(),10)]:w.getObject("field",p[parseInt(i.toString(),10)]))]=null;if(t=h.createSummaryItem(t,h.parent.aggregates[e-1]),!h.parent.aggregates[e-1].showChildSummary)return;l.map(function(e,t){e.uniqueID===s.uniqueID&&(r=t)});var r,e=r+d+e,n=C.extend({},s),o=(delete n.childRecords,delete n[h.parent.childMapping],C.setValue("parentItem",n,t),w.getObject("level",n));C.setValue("level",o+1,t),C.setValue("isSummaryRow",!0,t),C.setValue("parentUniqueID",n.uniqueID,t),a&&(o=w.getObject("childRecords",s)).length&&o.push(t),l.splice(e,0,t)}(c);this.flatChildRecords=[]}}else{for(var g={},f=0,m=p.length;f<m;f++)g[""+(C.isNullOrUndefined(w.getObject("field",p[parseInt(f.toString(),10)]))?p[parseInt(f.toString(),10)]:w.getObject("field",p[parseInt(f.toString(),10)]))]=null;for(var c=1,y=r;c<=y;c++)this.createSummaryItem(g,this.parent.aggregates[c-1])}return l},Li.prototype.getChildRecordsLength=function(e,t){for(var i=0,r=Object.keys(t).length;i<r;i++){var n=t[parseInt(i.toString(),10)];e===(C.isNullOrUndefined(n.parentItem)?null:t.filter(function(e){return e.uniqueID===n.parentItem.uniqueID})[0])&&(this.flatChildRecords.push(n),w.getObject("hasChildRecords",n))&&this.getChildRecordsLength(n,t)}return this.flatChildRecords.length},Li.prototype.createSummaryItem=function(e,t){for(var i=0,r=Object.keys(t.columns).length;i<r;i++)for(var n=C.isNullOrUndefined(t.columns[parseInt(i.toString(),10)].columnName)?t.columns[parseInt(i.toString(),10)].field:t.columns[parseInt(i.toString(),10)].columnName,o=0,a=Object.keys(e);o<a.length;o++){var s,d=a[o];d===n&&(this.flatChildRecords.length?e[""+d]=this.getSummaryValues(t.columns[parseInt(i.toString(),10)],this.flatChildRecords):this.parent.isLocalData&&(s=this.parent.dataSource instanceof b.DataManager?this.parent.dataSource.dataSource.json:this.parent.flatData,e[""+d]=this.getSummaryValues(t.columns[parseInt(i.toString(),10)],s)))}return e},Li.prototype.getSummaryValues=function(e,t){for(var i=new b.Query,r={},n={},o=C.isNullOrUndefined(e.field)?void 0:this.parent.getColumnByField(e.field).type,a=(e.setPropertiesSilent({format:this.getFormatFromType(e.format,o)}),e.setFormatter(this.parent.grid.locale),e.getFormatter()||function(e){return e}),o=(e.setTemplate(n),e.getTemplate(2)),s=(i.queries=this.summaryQuery,i.requiresCount(),new b.DataManager(t).executeLocal(i)),d=e.type,d=[e.type],l=0;l<d.length;l++){var p=d[parseInt(l.toString(),10)],h=e.field+" - "+d[parseInt(l.toString(),10)].toLowerCase(),c="Custom"!==d[parseInt(l.toString(),10)]?w.getObject("aggregates",s):w.calculateAggregate(d[parseInt(l.toString(),10)],s,e,this.parent),u=e.columnName,g="Custom"!==d[parseInt(l.toString(),10)]?c[h]:c;r[""+u]=r[""+u]||{},r[""+u][h]=g,r[""+u][d[parseInt(l.toString(),10)]]=C.isNullOrUndefined(c)?" ":a(g)}n.format=e.getFormatter();t=C.createElement("td",{className:"e-summary"}),this.parent.isReact&&"string"!=typeof e.footerTemplate?(o.fn(r[e.columnName],this.parent,o.property,"",null,null,t),this.parent.renderReactTemplates()):w.appendChildren(t,o.fn(r[e.columnName],this.parent,o.property)),i=r[""+e.columnName][""+p];return-1===t.innerHTML.indexOf(i)?t.innerHTML+i:t.innerHTML},Li.prototype.getFormatFromType=function(e,t){if(C.isNullOrUndefined(t)||"string"!=typeof e)return e;var i;switch(t){case"number":i={format:e};break;case"datetime":i={type:"dateTime",skeleton:e};break;case"date":i={type:t,skeleton:e}}return i},Li.prototype.destroy=function(){this.removeEventListener()};var zi=Li;function Li(e){w.Grid.Inject(w.Aggregate),this.parent=e,this.flatChildRecords=[],this.summaryQuery=[]}P.prototype.getModuleName=function(){return"sort"},P.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("createSort",this.createdSortedRecords,this)},P.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("createSort",this.createdSortedRecords))},P.prototype.createdSortedRecords=function(e){var t=e.modifiedData,i=e.srtQry;this.iterateSort(t,i),this.storedIndex=-1,e.modifiedData=this.flatSortedData,this.flatSortedData=[]},P.prototype.iterateSort=function(e,t){var i=this.parent.query,r=[];C.isNullOrUndefined(i)||(r=i.queries.filter(function(e){return"onWhere"===e.fn}));for(var n,o,a=0;a<e.length;a++)(0<r.length||0<this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&C.isNullOrUndefined(x(this.parent,e[parseInt(a.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(a.toString(),10)]),e[parseInt(a.toString(),10)].hasChildRecords&&(n=new b.DataManager(e[parseInt(a.toString(),10)].childRecords).executeLocal(t),this.parent.allowRowDragAndDrop&&-1!==e[parseInt(a.toString(),10)].childRecords.indexOf(this.parent.rowDragAndDropModule.draggedRecord)&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition&&(o=n.indexOf(this.parent.rowDragAndDropModule.draggedRecord),n.splice(o,1),o=n.indexOf(this.parent.rowDragAndDropModule.droppedRecord),"topSegment"===this.parent.rowDragAndDropModule.dropPosition?n.splice(o,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&n.splice(o+1,0,this.parent.rowDragAndDropModule.draggedRecord)),this.iterateSort(n,t))},P.prototype.sortColumn=function(e,t,i){this.parent.grid.sortColumn(e,t,i)},P.prototype.removeSortColumn=function(e){this.parent.grid.removeSortColumn(e)},P.prototype.updateModel=function(){this.parent.setProperties({sortSettings:w.getActualProperties(this.parent.grid.sortSettings)},!0)},P.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},P.prototype.destroy=function(){this.removeEventListener()};var Fi=P;function P(e){w.Grid.Inject(w.Sort),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!C.isNullOrUndefined(this.parent.parentIdMapping),this.addEventListener()}_i.prototype.getColumnMenu=function(){return this.parent.grid.columnMenuModule.getColumnMenu()},_i.prototype.destroy=function(){},_i.prototype.getModuleName=function(){return"columnMenu"};var ji=_i;function _i(e){w.Grid.Inject(w.ColumnMenu),this.parent=e}Gi.prototype.addEventListener=function(){this.parent.on("contextMenuOpen",this.contextMenuOpen,this),this.parent.on("contextMenuClick",this.contextMenuClick,this)},Gi.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contextMenuOpen",this.contextMenuOpen),this.parent.off("contextMenuClick",this.contextMenuClick))},Gi.prototype.contextMenuOpen=function(e){var t=C.select("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),i=C.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),r=C.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),n=C.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Outdent",e.element),o=(t&&(!1===this.parent.grid.editSettings.allowAdding||this.parent.grid.isEdit?t.style.display="none":t.style.display="block"),"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||C.isNullOrUndefined(i)||i.classList.contains("e-menu-hide")||(i.style.display="none"),this.parent),t=o.getSelectedRows()[0];if(!r&&!n||C.isNullOrUndefined(t)){if((r||n||o.grid.isEdit)&&C.isNullOrUndefined(t)){for(var a=0,s=e.items;a<s.length;a++)"Outdent"!==(d=s[a]).text&&"Indent"!==d.text||o.grid.contextMenuModule.hiddenItems.includes(d.text)||o.grid.contextMenuModule.hiddenItems.push(d.text);o.grid.contextMenuModule.contextMenu.hideItems(o.grid.contextMenuModule.hiddenItems),(r||n)&&(r.style.display=n.style.display="none")}}else{var i=e.event.target.closest("td");if(!C.isNullOrUndefined(i)&&(C.isNullOrUndefined(i)||i.classList.contains("e-rowcell")&&0===i.querySelectorAll(".e-gridform").length))0===t.rowIndex||1<o.getSelectedRowIndexes().length?r.style.display=n.style.display="none":("rowDeselected"!==e.name||!C.isNullOrUndefined(t)&&o.grid.isCheckBoxSelection)&&(i=o.getCurrentViewRecords()[t.rowIndex],C.isNullOrUndefined(i)||(i.level>o.getCurrentViewRecords()[t.rowIndex-1].level?r.style.display="none":r.style.display="block",i.level===o.getCurrentViewRecords()[t.rowIndex-1].level&&(r.style.display="block"),0===i.level?n.style.display="none":n.style.display="block"));else{for(var d,l=0,p=e.items;l<p.length;l++)"Outdent"!==(d=p[l]).text&&"Indent"!==d.text||o.grid.contextMenuModule.hiddenItems.push(d.text);o.grid.contextMenuModule.contextMenu.hideItems(o.grid.contextMenuModule.hiddenItems),r.style.display=n.style.display="none"}}},Gi.prototype.contextMenuClick=function(e){"Above"!==e.item.id&&"Below"!==e.item.id&&"Child"!==e.item.id||(this.parent.notify("savePreviousRowPosition",e),this.parent.setProperties({editSettings:{newRowPosition:e.item.id}},!0),this.parent.editModule.isAddedRowByContextMenu=!0,this.parent.addRecord()),e.item.id!==this.parent.element.id+"_gridcontrol_cmenu_Indent"&&e.item.id!==this.parent.element.id+"_gridcontrol_cmenu_Outdent"||C.isNullOrUndefined(this.parent.rowDragAndDropModule)||(e=e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"?"indent":"outdent",this.parent.rowDragAndDropModule.indentOutdentAction(null,e))},Gi.prototype.getModuleName=function(){return"contextMenu"},Gi.prototype.destroy=function(){this.removeEventListener()},Gi.prototype.getContextMenu=function(){return this.parent.grid.contextMenuModule.getContextMenu()};var Hi=Gi;function Gi(e){w.Grid.Inject(w.ContextMenu),this.parent=e,this.addEventListener()}A.prototype.addEventListener=function(){this.parent.on(Je,this.cellSaved,this),this.parent.on(et,this.batchAdd,this),this.parent.on(it,this.beforeBatchAdd,this),this.parent.on(nt,this.batchSave,this),this.parent.on(tt,this.beforeBatchDelete,this),this.parent.on(rt,this.beforeBatchSave,this),this.parent.on("batchPageAction",this.batchPageAction,this),this.parent.on("batchCancelAction",this.batchCancelAction,this),this.parent.grid.on("immutable-batch-cancel",this.immutableBatchAction,this),this.parent.grid.on("next-cell-index",this.nextCellIndex,this),this.parent.grid.on("cellfocused",this.onCellFocused,this)},A.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Je,this.cellSaved),this.parent.off(et,this.batchAdd),this.parent.off(nt,this.batchSave),this.parent.off(it,this.beforeBatchAdd),this.parent.off(tt,this.beforeBatchDelete),this.parent.off(rt,this.beforeBatchSave),this.parent.off("batchPageAction",this.batchPageAction),this.parent.off("batchCancelAction",this.batchCancelAction),this.parent.grid.off("immutable-batch-cancel",this.immutableBatchAction),this.parent.grid.off("next-cell-index",this.nextCellIndex),this.parent.grid.off("cellfocused",this.onCellFocused))},A.prototype.destroy=function(){this.removeEventListener()},A.prototype.getBatchRecords=function(){return this.batchRecords},A.prototype.getAddRowIndex=function(){return this.addRowIndex},A.prototype.getSelectedIndex=function(){return this.selectedIndex},A.prototype.getBatchChildCount=function(){return this.batchChildCount},A.prototype.batchPageAction=function(){var e,i=this,r=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!C.isNullOrUndefined(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var t=0;t<this.batchAddedRecords.length;t++)!function(t){e=r.findIndex(function(e){return e[""+n]===i.batchAddedRecords[parseInt(t.toString(),10)][""+n]}),r.splice(e,1)}(t);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.batchDeletedRecords=this.currentViewRecords=[]},A.prototype.cellSaved=function(e){var t,i,r,n,o,a,s,d,l,p,h,c;e.column.index===this.parent.treeColumnIndex&&this.parent.renderModule.cellRender({data:e.rowData,cell:e.cell,column:this.parent.grid.getColumnByIndex(e.column.index)}),this.isAdd&&"Batch"===this.parent.editSettings.mode&&"Bottom"!==this.parent.editSettings.newRowPosition&&(e=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,t=void 0,i=this.parent.grid.getPrimaryKeyFieldNames()[0],r=h=void 0,n="parentItem",o=-1<this.selectedIndex?this.batchRecords[parseInt(this.addRowIndex.toString(),10)][n]:null,d=s=a=void 0,c="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1,c=this.getActualRowObjectIndex(c),this.newBatchRowAdded)&&(this.batchRecords.length&&(a=this.batchRecords[this.addRowIndex][this.parent.idMapping],d=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)][n])&&(s=this.batchRecords[parseInt(this.addRowIndex.toString(),10)][n].uniqueID),this.batchAddedRecords=D(this.batchAddedRecords),this.batchAddRowRecord=D(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),t=this.parent.grid.getRowsObject()[parseInt(c.toString(),10)].changes,C.isNullOrUndefined(t)||(t.uniqueID=w.getUid(this.parent.element.id+"_data_"),C.setValue("uniqueIDCollection."+t.uniqueID,t,this.parent),Object.prototype.hasOwnProperty.call(t,"level"))||(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition?(t.primaryParent=o,-1<this.selectedIndex&&(t.parentItem=C.extend({},this.batchRecords[this.addRowIndex]),t.parentUniqueID=t.parentItem.uniqueID,delete t.parentItem.childRecords,delete t.parentItem[this.parent.childMapping],t.level=t.parentItem.level+1,t.index=this.batchIndex,l=R(this.batchRecords[this.addRowIndex]).length,p=R(this.batchRecords[this.addRowIndex])[l-1],p=C.isNullOrUndefined(p)?this.batchRecords[this.addRowIndex]:p,h=e.map(function(e){return e[""+i]}).indexOf(p[""+i]),this.isSelfReference&&(t[this.parent.parentIdMapping]=a),M(i,t.parentItem,"add",this.parent,this.isSelfReference,t))):"Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||C.isNullOrUndefined(this.batchRecords[this.addRowIndex])||(t.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,t.level&&-1<this.selectedIndex&&(t.parentItem=o,t.parentUniqueID=s,delete t.parentItem.childRecords,delete t.parentItem[this.parent.childMapping]),t.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&-1<this.selectedIndex&&(l=R(this.batchRecords[this.addRowIndex]).length,p=R(this.batchRecords[this.addRowIndex])[l-1],p=C.isNullOrUndefined(p)?this.batchRecords[this.addRowIndex]:p,h=e.map(function(e){return e[""+i]}).indexOf(p[""+i])),"Above"===this.parent.editSettings.newRowPosition&&-1<this.selectedIndex&&(p=this.batchRecords[this.addRowIndex],h=e.map(function(e){return e[""+i]}).indexOf(p[""+i])),this.isSelfReference&&(t[this.parent.parentIdMapping]=d)),t.index=-1===t.index?0:t.index,t.hasChildRecords=!1,t.childRecords=[],this.batchRecords.splice(t.index,0,t),this.currentViewRecords.splice(t.index,0,t),r=h||t.index,"Above"!==this.parent.editSettings.newRowPosition&&(r=0===t.index?r:r+1),e.splice(r,0,t),this.batchAddedRecords.push(t)),this.parent.grid.getRowsObject()[parseInt(c.toString(),10)].data=t,this.newBatchRowAdded=!1)},A.prototype.beforeBatchAdd=function(e){var t="isTabLastRow";"Cell"===this.parent.editSettings.mode&&this.parent.editModule[t]?(e.cancel=!0,this.parent.editModule[t]=!1):!this.parent.editModule.isAddedRowByMethod||C.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||-1!==this.parent.grid.selectedRowIndex&&!this.parent.editModule.batchEditModule.isAdd?(this.selectedIndex=this.parent.grid.selectedRowIndex,this.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,this.parent.editModule.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,this.addRowRecord=this.parent.getSelectedRecords()[0]):(this.selectedIndex=this.parent.editModule.selectedIndex,this.addRowIndex=this.parent.editModule.addRowIndex,this.addRowRecord=(this.batchRecords.length?this.batchRecords:this.parent.getCurrentViewRecords())[this.selectedIndex])},A.prototype.batchAdd=function(e){var t,i,r;"Bottom"!==this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.newBatchRowAdded=!0,t=0,this.batchRecords.length||(this.batchAddedRecords=[],this.batchRecords=D(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=D(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!C.isNullOrUndefined(this.parent.editModule.addRowIndex)&&C.classList(this.parent.grid.getDataRows()[0],["e-batchrow"],[]),"Top"!==this.parent.editSettings.newRowPosition&&(i=this.parent.grid.getCurrentViewRecords(),"Batch"===this.parent.editSettings.mode&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)&&(i=this.batchRecords),this.updateChildCount(i),this.parent.notify(Ke,{}),this.batchChildCount=0),this.updateRowIndex(),i=C.getValue("focusModule",this.parent.grid),r=this.parent.getContentTable(),this.parent.getBatchChanges()[this.deletedRecords].length&&"Above"===this.parent.editSettings.newRowPosition?(t=e.row.rowIndex,i.getContent().matrix.matrix=this.matrix):t=r.getElementsByClassName("e-batchrow")[0].rowIndex,i.getContent().matrix.current=[t,i.getContent().matrix.current[1]],!this.parent.editModule.isAddedRowByMethod||C.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||(e=this.parent.getBatchChanges().addedRecords,r=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[e.length-1].getAttribute("aria-rowindex"),10)-1,this.batchRecords.splice(r,0,e[e.length-1])))},A.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=D(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=D(this.parent.grid.getCurrentViewRecords()));var t,i,r=C.getValue("focusModule",this.parent.grid),n=(this.matrix=r.getContent().matrix.matrix,[]),o=[],a=this.parent.grid.getPrimaryKeyFieldNames()[0],r=Array.isArray(e.row)?e.row[0]:e.row,e=(C.isNullOrUndefined(r)||-1!==this.parent.getSelectedRows().indexOf(r)?(i=R(t=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1]),this.parent.getSelectedRows()[0]):(i=R(t=e.rowData),r)).getAttribute("data-uid"),r=parseInt(this.parent.grid.getRowElementByUID(e).getAttribute("aria-rowindex"),10)-1;if(i.length)for(var s=r+i.length,d=1+r;d<=s;d++)n.push(this.parent.grid.getDataRows()[parseInt(d.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&n.push(this.parent.grid.getHeaderContent()[parseInt(d.toString(),10)]);C.isNullOrUndefined(t.parentItem)||(e=x(this.parent,t.parentItem.uniqueID),!C.isNullOrUndefined(e)&&e.hasChildRecords&&(r=e.childRecords.indexOf(t),e.childRecords.splice(r,1)),this.batchDeletedRecords=D(this.batchDeletedRecords),this.batchDeletedRecords.push(t)),i.push(t);for(var o=i,l=this,d=0;d<o.length;d++)!function(t){var e=l.batchRecords.findIndex(function(e){return e[""+a]===o[parseInt(t.toString(),10)][""+a]});-1!==e&&l.batchRecords.splice(e,1)}(d);for(d=0;d<n.length;d++)C.isNullOrUndefined(n[parseInt(d.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(n[parseInt(d.toString(),10)])},A.prototype.updateRowIndex=function(){for(var e=this.parent.grid.getDataRows(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].setAttribute("aria-rowindex",(t+1).toString())},A.prototype.updateChildCount=function(e){for(var t=this.parent.grid.getPrimaryKeyFieldNames()[0],i=this.parent.getBatchChanges().addedRecords||[],r="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",n=0;n<i.length;n++)C.isNullOrUndefined(i[parseInt(n.toString(),10)][r])||i[parseInt(n.toString(),10)][r][""+t]===e[parseInt(this.addRowIndex.toString(),10)][""+t]&&(this.batchChildCount=this.batchChildCount+1)},A.prototype.beforeBatchSave=function(e){var t="changedRecords",i="deletedRecords",r=e.batchChanges[t];if(e.batchChanges[t].length)for(var n=0;n<r.length;n++)hi({value:r[parseInt(n.toString(),10)],action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,void 0);if(e.batchChanges[i].length)for(var o=e.batchChanges[i],n=0;n<o.length;n++){this.deleteUniqueID(o[parseInt(n.toString(),10)].uniqueID);for(var a=R(o[parseInt(n.toString(),10)]),s=0;s<a.length;s++)this.deleteUniqueID(a[parseInt(s.toString(),10)].uniqueID);e.batchChanges[i]=e.batchChanges[i].concat(a)}this.isAdd=!1},A.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},A.prototype.batchCancelAction=function(){var e,r=this,t="targetElement",n="parentItem",i="index",o=this.parent.grid.getCurrentViewRecords(),a="childRecords",s=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,d=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!C.isNullOrUndefined(this.batchAddedRecords))for(var l=this,p=0;p<this.batchAddedRecords.length;p++)!function(t){if(-1!==(h=s.findIndex(function(e){return e[""+d]===r.batchAddedRecords[parseInt(t.toString(),10)][""+d]}))&&s.splice(h,1),"Child"===l.parent.editSettings.newRowPosition&&(h=o.map(function(e){return e[""+d]}).indexOf((l.batchAddedRecords[parseInt(t.toString(),10)][""+n]?l.batchAddedRecords[parseInt(t.toString(),10)][""+n]:l.batchAddedRecords[parseInt(t.toString(),10)])[""+d]),!C.isNullOrUndefined(o[parseInt(h.toString(),10)])))for(var e=o[parseInt(h.toString(),10)][""+a],i=0;e&&i<e.length;i++)e[parseInt(i.toString(),10)][""+d]===l.batchAddedRecords[parseInt(t.toString(),10)][""+d]&&e.splice(i,1)}(p);if(C.isNullOrUndefined(this.parent[t])||(e=this.parent[t].closest("tr"),this.parent.collapseRow(e),this.parent[t]=null),!C.isNullOrUndefined(this.batchDeletedRecords))for(var h,c,p=0;p<this.batchDeletedRecords.length;p++)C.isNullOrUndefined(this.batchDeletedRecords[parseInt(p.toString(),10)][""+n])||(h=o.map(function(e){return e[""+d]}).indexOf(this.batchDeletedRecords[parseInt(p.toString(),10)][""+n][""+d]),c=0===this.batchDeletedRecords[parseInt(p.toString(),10)][i]?this.batchDeletedRecords[parseInt(p.toString(),10)][i]:this.batchDeletedRecords[parseInt(p.toString(),10)][i]-1,C.isNullOrUndefined(o[parseInt(h.toString(),10)]))||o[parseInt(h.toString(),10)][""+a].splice(c,0,this.batchDeletedRecords[parseInt(p.toString(),10)]);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=D(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=D(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},A.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var t,i,r,n,o=void 0,a=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),s="deletedRecords",d=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,l=this.parent.grid.getCurrentViewRecords(),p=this.parent.grid.getPrimaryKeyFieldNames()[0],h=a.addedRecords,c="parentItem",u=void 0,g=void 0,f="childRecords";if(1<h.length&&"Bottom"!==this.parent.editSettings.newRowPosition&&h.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(d.splice(d.length-h.length,h.length),this.parent.editModule.isAddedRowByMethod&&h.length&&!C.isNullOrUndefined(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){h.reverse();for(var m=0;m<h.length;m++){var y=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(m.toString(),10)].getAttribute("aria-rowindex"),10)-1;d.splice(y,0,h[parseInt(m.toString(),10)])}}this.parent.allowPaging||d.length===l.length?(i=D(d)).length&&(n=(r=i.map(function(e){return e[""+p]}).indexOf(l[0][""+p]))+this.parent.grid.pageSettings.pageSize,l=i.splice(r,n)):l.length>h.length&&l.splice(l.length-h.length,h.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&h.reverse(),o=0;o<h.length;o++){var S,w=C.extend({},h[parseInt(o.toString(),10)]);if(delete w.parentItem,delete w.uniqueID,delete w.index,delete w.level,delete w.hasChildRecords,delete w.childRecords,delete w.parentUniqueID,C.isNullOrUndefined(w.primaryParent)||delete w.primaryParent,1<h.length&&this.parent.editModule.isAddedRowByContextMenu&&(S=this.parent.editSettings.newRowPosition,this.parent.editSettings.newRowPosition=this.parent.editModule.previousNewRowPosition,this.parent.editModule.previousNewRowPosition=S),h[parseInt(o.toString(),10)].taskData=w,t=this.batchAddRowRecord[parseInt(o.toString(),10)],C.isNullOrUndefined(t)&&(t=this.batchAddRowRecord[o-1]),!this.isSelfReference||C.isNullOrUndefined(h[parseInt(o.toString(),10)].parentItem)||M(p,h[parseInt(o.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,h[parseInt(o.toString(),10)]),C.isNullOrUndefined(t)||(g=t.index),C.isNullOrUndefined(h[parseInt(o.toString(),10)].index)&&(g=0),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&C.isNullOrUndefined(h[parseInt(o.toString(),10)].parentItem)&&-1===this.selectedIndex&&(u=-1,t=null),hi({value:h[parseInt(o.toString(),10)],action:"add"},this.parent,this.isSelfReference,g,u,void 0,t),u=null,"Child"===this.parent.editSettings.newRowPosition&&!C.isNullOrUndefined(h[parseInt(o.toString(),10)][c])&&(C.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.isSelfReference)){var I=l.map(function(e){return e[""+p]}).indexOf(h[parseInt(o.toString(),10)][c][""+p]),R=l[parseInt(I.toString(),10)][f];if(!C.isNullOrUndefined(g)&&R.some(function(e){return e.uniqueID===t.uniqueID}))for(var v=0;v<R.length;v++)R[parseInt(v.toString(),10)][""+p]===h[parseInt(o.toString(),10)][""+p]&&l[parseInt(I.toString(),10)][f].splice(v,1)}}if(a[s].length)for(o=0;o<a[s].length;o++)hi({value:a[s][parseInt(o.toString(),10)],action:"delete"},this.parent,this.isSelfReference,g,u,void 0,t);this.parent.parentData=[];for(var x=0;x<d.length;x++)d[parseInt(x.toString(),10)].index=x,C.setValue("uniqueIDCollection."+d[parseInt(x.toString(),10)].uniqueID+".index",x,this.parent),d[parseInt(x.toString(),10)].level||this.parent.parentData.push(d[parseInt(x.toString(),10)])}this.batchAddRowRecord=this.batchAddedRecords=this.batchRecords=this.batchDeletedRecords=this.currentViewRecords=[],this.parent.editModule.isAddedRowByContextMenu&&(this.parent.editModule.isAddedRowByContextMenu=!1)},A.prototype.getActualRowObjectIndex=function(e){var t=this.parent.grid.getDataRows();return("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&-1<this.selectedIndex&&(!C.isNullOrUndefined(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length?(e+=R(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition&&(e+=this.getBatchChildCount())):e+=R(this.batchRecords[this.addRowIndex]).length),e>=t.length&&(e=t.length-1),this.updateChildCount(this.parent.grid.getCurrentViewRecords()),this.batchChildCount&&(e+=this.batchChildCount),this.batchChildCount=0),e},A.prototype.immutableBatchAction=function(e){e.args.cancel=!0;var t=this.parent.grid.getBatchChanges(),i=[];Object.keys(t).length&&(i=t.addedRecords);for(var r=0;r<i.length;r++)e.rows.splice(i[parseInt(r.toString(),10)].index,1)},A.prototype.nextCellIndex=function(e){var t="index",i=this.parent.getBatchChanges().deletedRecords;this.parent.getSelectedRows().length?this.isAdd&&0<i.length?e[t]=this.parent.getSelectedRecords()[0][t]:e[t]=this.parent.getSelectedRows()[0].rowIndex:e[t]=this.batchIndex},A.prototype.onCellFocused=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.grid.isEdit&&e.keyArgs&&"shiftEnter"===e.keyArgs.action&&(e.keyArgs.preventDefault(),this.parent.endEdit())};var Qi=A;function A(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!C.isNullOrUndefined(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}E.prototype.getModuleName=function(){return"edit"},E.prototype.addEventListener=function(){this.parent.on(Ge,this.crudAction,this),this.parent.on(Qe,this.beginEdit,this),this.parent.on(Ke,this.beginAdd,this),this.parent.on(We,this.recordDoubleClick,this),this.parent.on(Ye,this.cellSave,this),this.parent.on(Ze,this.batchCancel,this),this.parent.grid.on(ot,this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on(Xe,this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on(at,this.recordDoubleClick,this),this.parent.grid.on("dblclick",this.gridDblClick,this),this.parent.grid.on("recordAdded",this.customCellSave,this),this.parent.on("savePreviousRowPosition",this.savePreviousRowPosition,this),this.parent.grid.on(ht,this.beforeStartEdit,this),this.parent.grid.on(ct,this.beforeBatchCancel,this),this.parent.grid.on("reset-edit-props",this.resetIsOnBatch,this),this.parent.grid.on("get-row-position",this.getRowPosition,this)},E.prototype.gridDblClick=function(e){this.doubleClickTarget=e.target,e.target.classList.contains("e-frame")&&0===this.parent.getCurrentViewRecords().length&&(this.doubleClickTarget=null),(e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand"))&&(e=(e=w.parentsUntil(e.target,"e-row"))&&parseInt(e.getAttribute("aria-rowindex"),10)-1,!C.isNullOrUndefined(e))&&0<=e&&this.parent.allowPaging&&(this.parent.grid.getDataRows()[e].dataset.uid=this.parent.grid.contentModule.getRows()[e].uid)},E.prototype.getRowPosition=function(e){e.newRowPosition=this.parent.editSettings.newRowPosition,e.addRowIndex=this.addRowIndex,e.dataRowIndex=+this.prevAriaRowIndex},E.prototype.beforeStartEdit=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.trigger(ve,e)},E.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger(Ce,e))},E.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ge,this.crudAction),this.parent.off(Qe,this.beginEdit),this.parent.off(Ke,this.beginAdd),this.parent.off(We,this.recordDoubleClick),this.parent.off(Ze,this.batchCancel),this.parent.grid.off(ot,this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off(Xe,this.cellEdit),this.parent.off("actionBegin",this.editActionEvents),this.parent.off("actionComplete",this.editActionEvents),this.parent.grid.off("recordAdded",this.customCellSave),this.parent.grid.off(at,this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off(ht,this.beforeStartEdit),this.parent.grid.off(ct,this.beforeBatchCancel),this.parent.grid.off("dblclick",this.gridDblClick),this.parent.grid.off("reset-edit-props",this.resetIsOnBatch),this.parent.grid.off("get-row-position",this.getRowPosition))},E.prototype.destroy=function(){this.removeEventListener()},E.prototype.applyFormValidation=function(e){this.parent.grid.editModule.applyFormValidation(e)},E.prototype.editActionEvents=function(e){var e=w.getObject("editAction",e),t=w.getObject("name",e),i=this.parent,r=!C.isNullOrUndefined(i.dataSource)&&i.dataSource.adaptor;if(!C.isNullOrUndefined(r)&&(S(i)||r instanceof b.RemoteSaveAdaptor)&&"save"===e.requestType&&"add"===e.action&&("Child"===i.editSettings.newRowPosition||"Below"===i.editSettings.newRowPosition||"Above"===i.editSettings.newRowPosition))if("actionBegin"===t){r=C.isNullOrUndefined(e.row)||!Object.keys(e.row).length?this.selectedIndex:e.row.rowIndex-1,r=C.isNullOrUndefined(r)||-1===r?-1:i.getCurrentViewRecords()[parseInt(r.toString(),10)][i.getPrimaryKeyFieldNames()[0]];i.grid.query.addParams("relationalKey",r)}else if("actionComplete"===t)for(var n=i.grid.query.params.length,o=0;o<n;o++)"relationalKey"===i.grid.query.params[parseInt(o.toString(),10)].key&&i.grid.query.params.splice(o);this.parent.enableInfiniteScrolling&&"actionComplete"===t&&this.infiniteAddAction(e),"Batch"===this.parent.editSettings.mode&&"paging"===e.requestType&&this.parent.notify("batchPageAction",{})},E.prototype.infiniteAddAction=function(e){var t,i,r;("save"===e.requestType&&"add"===e.action||"delete"===e.requestType)&&("Top"!==this.parent.editSettings.newRowPosition&&-1!==this.selectedIndex&&"save"===e.requestType&&"add"===e.action&&(t=(e=this.parent.grid.getRowsObject()).splice(0,1)[0],r=this.addRowIndex,i=this.parent.getCurrentViewRecords(),"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(r+=R(i[r+1]).length),r="Below"===this.parent.editSettings.newRowPosition?r+1:r,e.splice(r,0,t),e=i.splice(0,1)[0],i.splice(r,0,e),this.updateInfiniteCurrentViewData(e,this.addRowIndex)),t=this.parent.grid.getRows(),i=this.parent.grid.getRowsObject(),(r=this.parent.infiniteScrollSettings.enableCache)||(w.resetRowIndex(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0),this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords())),!r)&&0<this.parent.getFrozenColumns()&&(w.resetRowIndex(this.parent.grid,i,t,0),this.updateIndex(this.parent.grid.dataSource,t,this.parent.getCurrentViewRecords()))},E.prototype.updateInfiniteCurrentViewData=function(e,t){var i=this,r=Math.ceil(t/this.parent.grid.pageSettings.pageSize),r=0<r?r:1,n=t-(r-1)*this.parent.pageSettings.pageSize,t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,o=(t[1].splice(0,1),t[parseInt(r.toString(),10)]);!C.isNullOrUndefined(this.addRowRecord)&&(o.filter(function(e,t){e.uniqueID===i.addRowRecord.uniqueID&&(n=t)}),this.addRowRecord.hasChildRecords&&this.addRowRecord.childRecords.length&&"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(n+=R(this.addRowRecord).length),n>=this.parent.pageSettings.pageSize&&(r+=1,o=t[parseInt(r.toString(),10)],n=0<=n-this.parent.pageSettings.pageSize?n-this.parent.pageSettings.pageSize:0),n="Below"===this.parent.editSettings.newRowPosition?n+1:n,o.splice(n,0,e),this.parent.grid.infiniteScrollModule.updateCurrentViewData()},E.prototype.recordDoubleClick=function(e){var t,i=e.target;C.isNullOrUndefined(i.closest("td.e-rowcell"))||this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit&&(t=this.parent.grid.getColumnByIndex(+i.closest("td.e-rowcell").getAttribute("aria-colindex")-1),"Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&t&&!t.isPrimaryKey&&this.parent.editSettings.allowEditing&&t.allowEditing&&!i.classList.contains("e-treegridexpand")&&!i.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick?(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization&&(i=w.parentsUntil(e.target,"e-row"),this.prevAriaRowIndex=i.getAttribute("aria-rowindex"),i.setAttribute("aria-rowindex",i.rowIndex+1+"")),this.updateGridEditMode("Batch")):"Cell"!==this.parent.editSettings.mode||t.allowEditing&&!t.isPrimaryKey||(this.isOnBatch=!0,this.updateGridEditMode("Batch")))},E.prototype.updateGridEditMode=function(e){this.parent.grid.setProperties({editSettings:{mode:e}},!0),w.getObject("updateEditObj",this.parent.grid.editModule).apply(this.parent.grid.editModule),this.parent.grid.isEdit=!1},E.prototype.resetIsOnBatch=function(){this.parent.enableVirtualization&&"Cell"===this.parent.editSettings.mode&&(this.isOnBatch=!1,this.updateGridEditMode("Normal"))},E.prototype.keyPressed=function(e){!this.isOnBatch&&"tab"!==e.action&&"shiftTab"!==e.action||(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.closeEdit()},E.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},E.prototype.cellEdit=function(e){var t=this,i="promise",r=e[i];delete e[i],this.parent.enableVirtualization&&!C.isNullOrUndefined(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("aria-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger(Xe,e,function(e){e.cancel||"Cell"!==t.parent.editSettings.mode?e.cancel&&"Cell"===t.parent.editSettings.mode&&(t.isOnBatch=!1,t.updateGridEditMode("Normal")):t.enableToolbarItems("edit"),C.isNullOrUndefined(r)||r.resolve(e)}),this.doubleClickTarget&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-summarycell"))?(e.cancel=!0,this.doubleClickTarget=null):("Cell"===this.parent.editSettings.mode&&("tab"===this.keyPress||"shiftTab"===this.keyPress?this.keyPress=null:"enter"===this.keyPress&&(e.cancel=!0,this.keyPress=null,C.setValue("isEditCollapse",!1,this.parent)),e.columnObject.allowEditing||(e.cancel=!0)),this.parent.enableVirtualization&&(this.parent.grid.contentModule.editedRowIndex=this.parent.grid.editModule.editModule.index))},E.prototype.enableToolbarItems=function(e){var t;C.isNullOrUndefined(this.parent.grid.toolbarModule)||(t=this.parent.element.id+"_gridcontrol_",this.parent.grid.toolbarModule.enableItems([t+"add",t+"edit",t+"delete"],"save"===e),this.parent.grid.toolbarModule.enableItems([t+"update",t+"cancel"],"edit"===e))},E.prototype.batchCancel=function(){var e,t;"Cell"===this.parent.editSettings.mode&&(e=C.getValue("editModule.cellDetails",this.parent.grid.editModule),C.isNullOrUndefined(this.editedRowIndex)||(e.rowIndex=this.editedRowIndex),t=this.parent.getCellFromIndex(e.rowIndex,this.parent.treeColumnIndex),this.parent.renderModule.cellRender({data:e.rowData,cell:t,column:this.parent.grid.getColumns()[this.parent.treeColumnIndex]}),this.updateGridEditMode("Normal"),this.isOnBatch=!1),"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchCancelAction",{})},E.prototype.customCellSave=function(e){I(this.parent)&&"Cell"===this.parent.editSettings.mode&&"edit"===e.action&&(this.updateCell(e,e.rowIndex),this.afterCellSave(e,e.row))},E.prototype.cellSave=function(i){var t,r,n,e,o=this;"Cell"===this.parent.editSettings.mode&&this.parent.element.querySelector("form")&&(i.cancel=!0,C.setValue("isEditCollapse",!0,this.parent),i.rowData[i.columnName]=i.value,t=(C.isNullOrUndefined(i.cell)?this.parent.grid.editModule.editModule.form.parentElement:i.cell).parentNode,r=this.parent.getPrimaryKeyFieldNames(),C.isNullOrUndefined(t)?this.parent.grid.getCurrentViewRecords().filter(function(e,t){e[r[0]]===i.rowData[r[0]]&&(n=t)}):n=(0<this.parent.getFrozenLeftColumnsCount()||0<this.parent.getFrozenRightColumnsCount()?(this.parent.getRows().indexOf(t),this.parent):-1===this.parent.getRows().indexOf(t)&&0<this.parent.getFrozenColumns()?this.parent.grid:this.parent).getRows().indexOf(t),C.extend(e={},i),e.cancel=!1,e.type="save",t=this.parent.grid.getRows()[t.rowIndex],this.parent.trigger(ve,e),e.cancel?this.parent.grid.isEdit=!0:(t.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),S(this.parent)||this.parent.dataSource instanceof b.DataManager&&this.parent.dataSource.adaptor instanceof b.RemoteSaveAdaptor?(S(this.parent)||this.parent.dataSource instanceof b.DataManager&&this.parent.dataSource.adaptor instanceof b.RemoteSaveAdaptor)&&(e=this.parent.grid.query,this.parent.isGantt&&this.parent.loadChildOnDemand?(this.updateCell(i,n),C.setValue("isEdit",!1,this.parent.grid),this.afterCellSave(i,t)):this.parent.grid.dataSource.update(r[0],i.rowData,e.fromTable,e,i.previousValue).then(function(e){C.isNullOrUndefined(e)||(i.rowData[i.columnName]=e[i.columnName]),o.updateCell(i,n),C.setValue("isEdit",!1,o.parent.grid),o.afterCellSave(i,t)})):I(this.parent)?(e={requestType:"save",data:i.rowData,action:"edit",row:t,rowIndex:n,rowData:i.rowData,columnName:i.columnName,filterChoiceCount:null,excelSearchOperator:null},this.parent.grid.getDataModule().eventPromise(e,this.parent.grid.query)):(this.updateCell(i,n),C.setValue("isEdit",!1,this.parent.grid),this.afterCellSave(i,t)))),this.parent.enableVirtualization&&(this.parent.grid.contentModule.virtualData={})},E.prototype.afterCellSave=function(e,t){this.parent.grid.aggregateModule&&this.parent.grid.aggregateModule.refresh(e.rowData),this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(e.columnName)]),this.parent.grid.editModule.formObj.destroy(),"tab"!==this.keyPress&&"shiftTab"!==this.keyPress&&(this.updateGridEditMode("Normal"),this.isOnBatch=!1),this.enableToolbarItems("save"),C.removeClass([t],["e-editedrow","e-batchrow"]),C.removeClass(t.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),hi({value:e.rowData,action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,e.columnName),t.rowIndex===this.parent.getCurrentViewRecords().length-1&&"enter"===this.keyPress&&(this.keyPress=null);t={type:"save",column:this.parent.getColumnByField(e.columnName),data:e.rowData,previousData:e.previousValue,row:t,target:e.cell};this.parent.aggregates.map(function(e){return!0===e.showChildSummary}).length&&this.parent.grid.refresh(),this.parent.trigger(Ce,t)},E.prototype.lastCellTab=function(){!this.parent.grid.isEdit&&this.isOnBatch&&"tab"===this.keyPress&&"Cell"===this.parent.editSettings.mode&&(this.parent.editSettings.allowNextRowEdit?this.enableToolbarItems("edit"):(this.updateGridEditMode("Normal"),this.isOnBatch=!1,this.keyPress=null))},E.prototype.updateCell=function(e,t){this.parent.grid.editModule.updateCell(t,e.columnName,e.rowData[e.columnName]),this.parent.grid.getRowsObject()[parseInt(t.toString(),10)].data=e.rowData},E.prototype.crudAction=function(e,t){hi(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,t,this.addRowRecord),this.parent.parentData=[];for(var i=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,r=0;r<i.length;r++){i[parseInt(r.toString(),10)].index=r;var n=this.parent.grid.getPrimaryKeyFieldNames()[0],n=(e.value[""+n]===i[parseInt(r.toString(),10)][""+n]&&"add"===e.action&&(i[parseInt(r.toString(),10)].level=this.internalProperties.level,i[parseInt(r.toString(),10)].taskData=this.internalProperties.taskData,i[parseInt(r.toString(),10)].uniqueID=this.internalProperties.uniqueID,C.isNullOrUndefined(this.internalProperties.parentItem)||(i[parseInt(r.toString(),10)].parentItem=this.internalProperties.parentItem,i[parseInt(r.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),i[parseInt(r.toString(),10)].childRecords=this.internalProperties.childRecords),C.setValue("uniqueIDCollection."+i[parseInt(r.toString(),10)].uniqueID+".index",r,this.parent),this.parent.dataSource.adaptor);(S(this.parent)||n instanceof b.RemoteSaveAdaptor)&&C.setValue("uniqueIDCollection."+i[parseInt(r.toString(),10)].uniqueID,i[parseInt(r.toString(),10)],this.parent),i[parseInt(r.toString(),10)].level||this.parent.parentData.push(i[parseInt(r.toString(),10)])}this.parent.enableInfiniteScrolling||"add"===e.action&&null!=this.previousNewRowPosition&&(this.parent.setProperties({editSettings:{newRowPosition:this.previousNewRowPosition}},!0),this.previousNewRowPosition=null)},E.prototype.updateIndex=function(e,t,i){for(var r=0;r<this.parent.getDataRows().length;r++){var n,o=i[parseInt(r.toString(),10)];C.isNullOrUndefined(o)||(c=C.getValue("uniqueIDCollection."+o.uniqueID+".index",this.parent),o.index=c,C.isNullOrUndefined(o.parentItem))||(n=C.getValue("uniqueIDCollection."+o.parentItem.uniqueID+".index",this.parent),o.parentItem.index=n)}var a=-1,s=this.parent.treeColumnIndex;if(0<this.parent.getFrozenColumns())for(var d=t[0].querySelectorAll(".e-rowcell"),l=0;l<d.length;l++)if(d[parseInt(l.toString(),10)].classList.contains("e-gridrowindex0level0")){s=l;break}for(var p=0;p<this.parent.getRows().length;p++){t[parseInt(p.toString(),10)].classList.contains("e-detailrow")||a++;var h=i[parseInt(a.toString(),10)];if(!C.isNullOrUndefined(h)){var c=h.index,u=h.level,g=t[parseInt(p.toString(),10)],f=(C.isNullOrUndefined(h.parentItem)||(c=C.getValue("uniqueIDCollection."+h.parentItem.uniqueID+".index",this.parent)),g.cells[parseInt(s.toString(),10)]);if(!C.isNullOrUndefined(f)){for(l=0;l<f.classList.length;l++){var m=f.classList[parseInt(l.toString(),10)],y=m.match(/e-gridrowindex/i),S=m.match(/e-griddetailrowindex/i);null!=y&&C.removeClass([f],m),null!=S&&C.removeClass([f],m)}t[parseInt(p.toString(),10)].classList.contains("e-detailrow")?C.addClass([f],"e-griddetailrowindex"+c+"level"+u):C.addClass([f],"e-gridrowindex"+c+"level"+u)}}}},E.prototype.beginAdd=function(){var e=this.addRowIndex,t=this.parent.grid.getCurrentViewRecords(),i=("Batch"===this.parent.editSettings.mode&&(e=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex(),1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)&&(t=this.batchEditModule.getBatchRecords()),this.parent.grid.getDataRows()),r=i.length?+i[0].getAttribute("aria-rowindex")-1:0,n=i.length?+i[i.length-1].getAttribute("aria-rowindex")-1:0,r=this.selectedIndex>=r&&this.selectedIndex<=n,n=this.parent.enableVirtualization&&-1<this.addRowIndex&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode&&("Above"===this.parent.editSettings.newRowPosition?a="before":("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(-1<this.selectedIndex||n)&&r&&(a="after",!C.isNullOrUndefined(t[parseInt(e.toString(),10)]))&&t[parseInt(e.toString(),10)].expanded&&("Batch"===this.parent.editSettings.mode&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)?(e+=R(t[parseInt(e.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition&&(e+=this.batchEditModule.getBatchChildCount())):this.parent.enableVirtualization||(e+=R(t[parseInt(e.toString(),10)]).length)),(-1<this.selectedIndex||n)&&r&&(e||"Child"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition))){e>=i.length-1&&(e=i.length-2);var t="rows",r=this.parent.grid.contentModule[t][0],o=document.activeElement,a=(i[e+1][""+a](i[0]),C.setValue("batchIndex",e+1,this.batchEditModule),"Above"===this.parent.editSettings.newRowPosition?e:e+1);if("Batch"===this.parent.editSettings.mode&&(this.parent.grid.contentModule[t].splice(0,1),this.parent.grid.contentModule[t].splice(a,0,r)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var s=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),d=0;d<s.length;d++)s[parseInt(d.toString(),10)].remove();C.setValue("errorRules",[],this.parent.grid.editModule.formObj)}n&&(this.prevAriaRowIndex="-1"),this.parent.enableVirtualization&&!this.parent.enableVirtualization||(this.isScrollByFocus=!0,o.focus()),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}if("Batch"===this.parent.editSettings.mode&&!C.isNullOrUndefined(this.addRowIndex)&&-1!==this.addRowIndex&&this.isAddedRowByMethod&&!this.isAddedRowByContextMenu){e=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();var l=this.parent.getBatchChanges().addedRecords,p=void 0;if(l.length)for(d=0;d<l.length;d++)C.isNullOrUndefined(l[parseInt(d.toString(),10)].uniqueID)&&(p=l[parseInt(d.toString(),10)]);i={action:"add",data:p,index:e,seletedRow:0};this.beginAddEdit(i),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(i.data)}},E.prototype.beginEdit=function(i){if("refresh"===i.requestType&&this.isOnBatch)i.cancel=!0;else if("Cell"===this.parent.editSettings.mode&&"beginEdit"===i.requestType)i.cancel=!0;else if(this.doubleClickTarget&&"delete"!==i.requestType&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-frame")))i.cancel=!0,this.doubleClickTarget=null;else{if("delete"===i.requestType){var r=i.data;if(C.isNullOrUndefined(i.data[0].uniqueID))for(var n=this.parent.getPrimaryKeyFieldNames(),e=this,t=0;t<r.length;t++)!function(t){e.parent.flatData.filter(function(e){e[""+n[0]]===i.data[parseInt(t.toString(),10)][n[0]]&&(r[parseInt(t.toString(),10)]=e)})}(t);for(t=0;t<r.length;t++){this.deleteUniqueID(r[parseInt(t.toString(),10)].uniqueID);for(var o=R(r[parseInt(t.toString(),10)]),a=0;a<o.length;a++)this.deleteUniqueID(o[parseInt(a.toString(),10)].uniqueID);i.data=i.data.concat(o)}}var s,d;("add"===i.requestType||this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&((-1===this.parent.grid.selectedRowIndex&&this.isAddedRowByMethod||i.index!==this.parent.grid.selectedRowIndex)&&0!==i.index||(this.selectedIndex=this.parent.grid.selectedRowIndex),this.parent.enableVirtualization?(d='.e-row[aria-rowindex="'+(this.selectedIndex+1)+'"]',s=void 0,-1<this.selectedIndex&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),s=this.parent.getContent().querySelector(d),this.addRowIndex=s?s.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(d='.e-row[aria-rowindex="'+(this.prevAriaRowIndex+1)+'"]',s=this.parent.getContent().querySelector(d),this.addRowIndex=s?s.rowIndex:0):this.addRowIndex=0):this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?0!==i.index?this.addRowIndex=i.index:this.addRowIndex=this.parent.grid.selectedRowIndex:this.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,d=this.parent.getSelectedRecords()[0],(this.isAddedRowByMethod||this.isAddedRowByContextMenu&&-1!==this.parent.grid.selectedRowIndex)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.addRowRecord=this.parent.flatData[this.parent.grid.selectedRowIndex],this.parent.enableVirtualization&&this.isAddedRowByContextMenu&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex])):C.isNullOrUndefined(d)||(this.addRowRecord=d)),this.isAddedRowByMethod&&0!==i.index&&(this.addRowRecord=this.parent.flatData[i.index],this.addRowIndex=i.index),"Child"!==this.parent.editSettings.newRowPosition||!this.isIndexUndefined&&!this.isAddedRowByMethod||C.isNullOrUndefined(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0],this.isIndexUndefined=!1),C.isNullOrUndefined(this.addRowRecord)&&this.parent.getCurrentViewRecords().length>this.addRowIndex&&"save"===i.requestType&&0!==this.parent.getSelectedRecords().length&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex]),this.isAddedRowByMethod=!1,i=this.beginAddEdit(i)}},E.prototype.savePreviousRowPosition=function(){null===this.previousNewRowPosition&&(this.previousNewRowPosition=this.parent.editSettings.newRowPosition)},E.prototype.beginAddEdit=function(e){var t,i,r,n,o,a,s,d,l,p,h,c,u,g=e.data;if("add"===e.action&&(t=this.parent.grid.getPrimaryKeyFieldNames()[0],d=null,u=void(g.taskData=C.isNullOrUndefined(g.taskData)?C.extend({},e.data):g.taskData),u=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!C.isNullOrUndefined(this.addRowIndex)?this.batchEditModule.batchRecords:this.parent.grid.getCurrentViewRecords(),this.parent.enableVirtualization&&0!==e.index&&(this.addRowIndex=this.parent.flatData.indexOf(this.addRowRecord),this.selectedIndex=this.addRowIndex),l=this.addRowIndex,g.uniqueID=w.getUid(this.parent.element.id+"_data_"),C.setValue("uniqueIDCollection."+g.uniqueID,g,this.parent),o=n=r=i=void(c=0),a=this.parent.enableVirtualization&&-1<this.addRowIndex&&"-1"!==this.prevAriaRowIndex,s=(p=this.parent.getRows()).length?u.indexOf(u[0]):0,p=p.length?+p[p.length-1].getAttribute("aria-rowindex")-1:0,s=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=s&&this.selectedIndex<=p,u.length&&!C.isNullOrUndefined(l)&&(i=u[this.addRowIndex][this.parent.idMapping],o=u[this.addRowIndex][this.parent.parentIdMapping],u[this.addRowIndex].parentItem&&(r=u[this.addRowIndex].parentItem.uniqueID),n=u[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&u.length&&!C.isNullOrUndefined(l)&&(c=u[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition?(d="before",l=u[this.addRowIndex].index):"Below"===this.parent.editSettings.newRowPosition?(d="after",p=R(u[this.addRowIndex]).length,h=u[this.addRowIndex].index,l=0<p?h+p:h):"Child"===this.parent.editSettings.newRowPosition&&(d="after",(-1<this.selectedIndex||a)&&s&&(g.parentItem=C.extend({},u[this.addRowIndex]),g.parentUniqueID=g.parentItem.uniqueID,delete g.parentItem.childRecords,delete g.parentItem[this.parent.childMapping]),p=R(u[this.addRowIndex]).length,h=u[this.addRowIndex].index,0<=this.selectedIndex&&(g.level=c+1),l=0<p?h+p:h,this.isSelfReference)&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?g.taskData[this.parent.parentIdMapping]=g[this.parent.parentIdMapping]=i:g.taskData[this.parent.parentIdMapping]=g[this.parent.parentIdMapping]=null,C.isNullOrUndefined(g.parentItem)||M(t,g.parentItem,"add",this.parent,this.isSelfReference,g)),"Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((-1<this.selectedIndex||a)&&c&&s&&(g.parentUniqueID=r,g.parentItem=C.extend({},n),delete g.parentItem.childRecords,delete g.parentItem[this.parent.childMapping]),g.level=c,this.isSelfReference&&(g.taskData[this.parent.parentIdMapping]=g[this.parent.parentIdMapping]=o,C.isNullOrUndefined(g.parentItem)||M(t,g.parentItem,"add",this.parent,this.isSelfReference,g))),null!=d&&(-1<this.selectedIndex||a)&&s&&(e.index="before"===d?l:l+1),"Bottom"===this.parent.editSettings.newRowPosition)&&(c=0,u=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,e.index=u.length),C.isNullOrUndefined(g.level)&&(g.level=c),g.hasChildRecords=!1,g.childRecords=[],g.index=0),"add"===e.action&&(this.internalProperties={level:g.level,parentItem:g.parentItem,uniqueID:g.uniqueID,taskData:g.taskData,parentUniqueID:C.isNullOrUndefined(g.parentItem)?void 0:g.parentItem.uniqueID,childRecords:g.childRecords}),"delete"===e.requestType){var f=e.data,m=this.parent.getPrimaryKeyFieldNames();if(!C.isNullOrUndefined(m)&&0<m.length)for(var y=this,S=0;S<f.length;S++)!function(t){var e,i=f[parseInt(t.toString(),10)].parentItem;i&&(i=x(y.parent,i.uniqueID),!C.isNullOrUndefined(i))&&i.hasChildRecords&&(e=i.childRecords.findIndex(function(e){return f[parseInt(t.toString(),10)][m[0]]===e[m[0]]}),i.childRecords.splice(e,1))}(S)}return e},E.prototype.addRecord=function(e,t,i){var r,n,o;this.parent.editSettings.newRowPosition!==this.previousNewRowPosition&&null!==this.previousNewRowPosition||(this.previousNewRowPosition=this.parent.editSettings.newRowPosition),C.isNullOrUndefined(t)&&(this.isIndexUndefined=!0),this.isSelfReference||C.isNullOrUndefined(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping)?(e&&(-1<t?(this.selectedIndex=t,this.addRowIndex=t):(this.selectedIndex=this.parent.selectedRowIndex,this.addRowIndex=this.parent.selectedRowIndex),i)&&this.parent.setProperties({editSettings:{newRowPosition:i}},!0),this.parent.grid.editModule.addRecord(e,t)):(n=this.parent.editSettings.mode,o=this.parent.grid.editSettings.mode,(r=[]).push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),C.isNullOrUndefined(i)||this.parent.setProperties({editSettings:{newRowPosition:i}},!0),this.parent.notify(nt,{updatedRecords:{addedRecords:r,changedRecords:[],deletedRecords:[]},index:t}),this.parent.setProperties({editSettings:{mode:n}},!0),this.parent.grid.setProperties({editSettings:{mode:o}},!0),this.parent.refresh())},E.prototype.editFormValidate=function(){return this.parent.grid.editModule.editFormValidate()},E.prototype.destroyForm=function(){this.parent.grid.editModule.destroyForm()},E.prototype.contentready=function(e){C.isNullOrUndefined(e.args.requestType)||"delete"!==e.args.requestType.toString()&&"save"!==e.args.requestType.toString()&&("Batch"!==this.parent.editSettings.mode||"batchsave"!==e.args.requestType.toString())||(this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),(this.parent.frozenRows||this.parent.getFrozenColumns()||this.parent.frozenColumns)&&this.parent.grid.dataSource.length===this.parent.getDataRows().length&&this.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords()))},E.prototype.editCell=function(e,t){"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||("Batch"!==this.parent.editSettings.mode&&(this.isOnBatch=!0,this.updateGridEditMode("Batch")),this.parent.grid.editModule.editCell(e,t))},E.prototype.closeEdit=function(){this.parent.enableVirtualization&&"Batch"===this.parent.grid.editSettings.mode&&1<this.parent.grid.pageSettings.currentPage&&(this.editedRowIndex=this.parent.grid.editModule.editModule.cellDetails.rowIndex,this.parent.grid.editModule.editModule.cellDetails.rowIndex=parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule.cellDetails.rowIndex].getAttribute("aria-rowIndex"),10)-1),this.parent.grid.editModule.closeEdit()};var Ki=E;function E(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,this.isIndexUndefined=!1,w.Grid.Inject(w.Edit),this.parent=e,this.isSelfReference=!C.isNullOrUndefined(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new Qi(this.parent),this.addEventListener()}Yi.prototype.getModuleName=function(){return"commandColumn"},Yi.prototype.destroy=function(){};var Wi=Yi;function Yi(e){w.Grid.Inject(w.CommandColumn),this.parent=e}N.prototype.getModuleName=function(){return"detailRow"},N.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.on("detaildataBound",this.detaildataBound,this),this.parent.grid.on("detail-indentcell-info",this.setIndentVisibility,this),this.parent.on("childRowExpand",this.childRowExpand,this),this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("actioncomplete",this.actioncomplete,this)},N.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.off("detaildataBound",this.detaildataBound),this.parent.off("childRowExpand",this.childRowExpand),this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("actioncomplete",this.actioncomplete),this.parent.grid.off("detail-indentcell-info",this.setIndentVisibility))},N.prototype.setIndentVisibility=function(e){e.visible=!1},N.prototype.dataBoundArg=function(){for(var e=this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)].getElementsByClassName("e-detailrowcollapse"),r=this.parent.grid.getRowObjectFromUID(e[parseInt(t.toString(),10)].getAttribute("data-Uid")),n=w.getObject("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(t.toString(),10)]);(C.isNullOrUndefined(n)||!C.isNullOrUndefined(n)&&y(this.parent,r.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(i[0])}},N.prototype.childRowExpand=function(e){e=e.row.getElementsByClassName("e-detailrowcollapse");C.isNullOrUndefined(e[0])||this.parent.grid.detailRowModule.expand(e[0])},N.prototype.rowExpandCollapse=function(e){if(!S(this.parent))for(var t=0;t<e.detailrows.length;t++)this.parent.toggleRowVisibility(e.detailrows[parseInt(t.toString(),10)],e.action)},N.prototype.detaildataBound=function(e){var t=e.data,i=e.detailElement.parentElement.previousSibling,r="e-gridrowindex"+(C.isNullOrUndefined(t.parentItem)?t:t.parentItem).index+"level"+t.level,t=i.querySelector("."+r).classList,i=[].slice.call(t).filter(function(e){return e===r}),t=i[0].length,i=i.toString().slice(6,t);C.addClass([e.detailElement.parentElement],"e-griddetail"+i)},N.prototype.actioncomplete=function(e){"beginEdit"!==e.requestType&&"add"!==e.requestType||(t=e.row.querySelectorAll(".e-editcell")[0].getAttribute("colSpan"),t=parseInt(t,10)-1,e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",t.toString()));for(var t,i=this.parent.grid.contentModule.getRows(),r=0;r<i.length;r++)i[parseInt(r.toString(),10)].cells[0].visible=!1;w.getObject("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},N.prototype.destroy=function(){this.removeEventListener()};var Ji=N;function N(e){w.Grid.Inject(w.DetailRow),this.parent=e,this.addEventListener()}Xi=function(e,t){return(Xi=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])}))(e,t)};var Xi,U,$i=function(e,t){function i(){this.constructor=e}Xi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Zi=(U=w.VirtualContentRenderer,$i(k,U),k.prototype.getModelGenerator=function(){return new Ni(this.parent)},k.prototype.getRowByIndex=function(t){var e;return this.parent.enableVirtualization&&this.parent.isFrozenGrid()?this.getRowCollection(t,!0):!(e=this.parent.getDataRows().find(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1===t}))&&this.parent.isEdit&&"Batch"===this.parent.editSettings.mode?null!=t?this.parent.getRows()[parseInt(t.toString(),10)]:void 0:e},k.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},k.prototype.getRowCollection=function(e,t,i,r){var n=parseInt(this.parent.getRows()[0].getAttribute(Dt),10)-1,o=this.parent.getDataRows(),a=(i?this.parent.getCurrentViewRecords():o)[e-n];return a=null==(a=this.parent.frozenRows&&1<this.parent.pageSettings.currentPage?i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:a:e<=this.parent.frozenRows?o[parseInt(e.toString(),10)]:o[e-n+this.parent.frozenRows]:a)&&null!=e&&"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&t?o[parseInt(e.toString(),10)]:a},k.prototype.addEventListener=function(){this.parent.on(st,this.virtualOtherAction,this),this.parent.on(pt,this.indexModifier,this)},k.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},k.prototype.indexModifier=function(e){var t,i=this.parent.getContent().querySelector(".e-content"),r=this.parent.pageSettings.pageSize;(this.recordAdded||"delete"===e.requestType&&this.endIndex>e.count-this.parent.pageSettings.pageSize)&&-1<this.startIndex&&-1<this.endIndex&&(this.endIndex>e.count-r?((t=(i=~~(i.scrollTop/this.parent.getRowHeight()))+this.parent.getRows().length)>e.count&&(t=i+(e.count-i)),this.startIndex=t-this.parent.getRows().length,this.endIndex=t):("Top"!==this.parent.root.editSettings.newRowPosition&&-1!==this.parent.root.editModule.selectedIndex||-1!==this.parent.root.editModule.selectedIndex)&&(this.startIndex+=1,this.endIndex+=1),this.recordAdded=!1),this.isDataSourceChanged&&(this.startIndex=0,this.endIndex=r-1),this.endIndex-this.startIndex!==r&&this.totalRecords>r&&this.endIndex===this.totalRecords?e.startIndex=this.endIndex-r:e.startIndex=this.startIndex,e.endIndex=this.endIndex},k.prototype.eventListener=function(e){var t=this;this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&I(this.parent)?U.prototype.eventListener.call(this,"on"):(this.parent[""+e]("data-ready",this.onDataReady,this),this.parent[""+e]("refresh-virtual-block",this.refreshContentRows,this),this.fn=function(){t.observers.observes(function(e){return t.scrollListeners(e)},t.onEnteredAction(),t.parent);var e=t.parent;e.root.enablePersistence&&e.root.scrollPosition&&(t.content.scrollTop=e.root.scrollPosition.top,e.root.enableColumnVirtualization&&(t.content.scrollLeft=e.root.scrollPosition.left),e={direction:"down",sentinel:t.observer.sentinelInfo.down,offset:e.root.scrollPosition,focusElement:e.element},t.scrollListeners(e)),t.parent.off("content-ready",t.fn)},this.parent.addEventListener("dataBound",this.dataBoundEvent.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelectedEvent.bind(this)),this.parent[""+e]("select-virtual-Row",this.toSelectVirtualRow,this),this.parent.on("content-ready",this.fn,this),this.parent.addEventListener(ve,this.handleActionBegin.bind(this)),this.parent.addEventListener(Ce,this.onActionComplete.bind(this)),this.parent[""+e]("virtual-scroll-edit-action-begin",this.beginEdit,this),this.parent[""+e]("virtual-scroll-add-action-begin",this.beginAdd,this),this.parent[""+e]("virtual-scroll-edit-success",this.virtualEditSuccess,this),this.parent[""+e]("edit-reset",this.resetIseditValue,this),this.parent[""+e]("get-virtual-data",this.getData,this),this.parent[""+e]("virtual-scroll-edit-cancel",this.cancelEdit,this),this.parent[""+e]("select-row-on-context-open",this.toSelectRowOnContextOpen,this),this.parent[""+e]("refresh-virtual-editform-cells",this.refreshCell,this),this.parent[""+e]("virtaul-cell-focus",this.cellFocus,this),this.parent[""+e]("virtual-scroll-edit",this.restoreEditState,this),this.parent[""+e]("set-virtual-page-query",this.SetVirtualPageQury,this))},k.prototype.cellFocus=function(e){U.prototype.virtualCellFocus.call(this,e)},k.prototype.onDataReady=function(e){var t,i;U.prototype.onDataReady.call(this,e),this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&I(this.parent)||(C.isNullOrUndefined(e.count)||(this.totalRecords=e.count,this.parent.isFrozenGrid()&&e.count<Object.keys(this.parent.dataSource).length&&(t=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length-1)+"px":"100%",i=this.parent.getRowHeight()*e.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize,C.getValue("virtualEle",this).setVirtualHeight(i,t)),this.parent.enableColumnVirtualization)||this.parent.isFrozenGrid()||C.getValue("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*e.count,"100%"),(!C.isNullOrUndefined(e.requestType)&&"collapseAll"===e.requestType.toString()||this.isDataSourceChanged&&(-1===this.startIndex||0===this.startIndex&&0===this.preStartIndex))&&(this.contents.scrollTop=0,this.isDataSourceChanged=!1))},k.prototype.renderTable=function(){U.prototype.renderTable.call(this),this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&I(this.parent)||(C.getValue("observer",this).options.debounceEvent=!1,this.observers=new tr(C.getValue("observer",this).element,C.getValue("observer",this).options),this.contents=this.getPanel().firstChild)},k.prototype.getTranslateY=function(e,t,i,r){if(this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||I(this.parent)){if(this.isRemoteExpand)return this.isRemoteExpand=!1,this.preTranslate;this.preTranslate=U.prototype.getTranslateY.call(this,e,t,i,r)}return U.prototype.getTranslateY.call(this,e,t,i,r)},k.prototype.dataBoundEvent=function(){var e,t,i="initialRowTop";C.isNullOrUndefined(this.parent.getRows())||!this.parent.getRows().length||C.isNullOrUndefined(this.parent.getRowByIndex(0))||this[i]||(e=this.parent.getRowByIndex(0).getBoundingClientRect().top,t=this.parent.element.getBoundingClientRect().top,0<e?this[i]=this.parent.getRowByIndex(0).getBoundingClientRect().top-t:-1===this.parent.selectedRowIndex&&(this[i]=this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height)),U.prototype.dataBound.call(this)},k.prototype.rowSelectedEvent=function(e){U.prototype.rowSelected.call(this,e),this.parent.notify("virtualTransform",{requestType:"transformChange"})},k.prototype.toSelectVirtualRow=function(t){var e;!this.parent.isEdit&&(C.isNullOrUndefined(this.observer[e="containerRect"])&&(this.observer[e]=this.observers[e]),e=this.parent.clipboardModule.treeGridParent,C.isNullOrUndefined(e.editModule)||C.isNullOrUndefined(e.editModule.addRowIndex)||0!==t.selectedIndex)&&(!C.isNullOrUndefined(e.grid.sortModule)&&0<e.grid.sortModule.sortedColumns.length&&(e=e.dataModule.sortedData,!C.isNullOrUndefined(e))&&0<e.length&&(e=e.findIndex(function(e){return e.index===t.selectedIndex}),t.selectedIndex=e),U.prototype.selectVirtualRow.call(this,t))},k.prototype.refreshCell=function(e){e.cells=this.generateCells()},k.prototype.generateCells=function(){for(var e=[],t=0;t<this.parent.columns.length;t++)e.push(this.generateCell(this.parent.columns[parseInt(t.toString(),10)]));return e},k.prototype.getVirtualRowIndex=function(e){return C.isNullOrUndefined(this.prevInfo)?e:this.parent.getRowsObject()[0].index+e},k.prototype.generateCell=function(e,t,i,r,n,o){t={visible:e.visible,isDataCell:!C.isNullOrUndefined(e.field||e.template),isTemplate:!C.isNullOrUndefined(e.template),rowID:t,column:e,cellType:C.isNullOrUndefined(i)?w.CellType.Data:i,colSpan:r,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&C.getValue(e.field,o)};return(t.isDataCell||"checkbox"===t.column.type||t.commands)&&(t.index=n),new w.Cell(t)},k.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[aria-rowindex="'+(e.index+1)+'"]',t=this.parent.getContent().querySelector(t).rowIndex,t=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)];e.data=t},k.prototype.beginAdd=function(e){var t={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex},t=(this.parent.notify("get-row-position",t),this.rowPosition=t.newRowPosition,this.addRowIndex=t.addRowIndex,this.dataRowIndex=t.dataRowIndex,this.parent.getRows()),i=t.length?+t[0].getAttribute("aria-rowindex")-1:0,t=t.length?+t[t.length-1].getAttribute("aria-rowindex")-1:0,i=this.parent.selectedRowIndex>=i&&this.parent.selectedRowIndex<=t;"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.isAdd=!0),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.addRowIndex&&-1!==this.addRowIndex||-1!==this.parent.selectedRowIndex&&i)||U.prototype.addActionBegin.call(this,e)},k.prototype.restoreEditState=function(){U.prototype.restoreEdit.call(this)},k.prototype.SetVirtualPageQury=function(e){var t=[];this.prevInfo&&this.prevInfo.blockIndexes&&(t=w.getVisiblePage(this.prevInfo.blockIndexes)),"refresh"===this.requestType&&t.length&&(e.query.skip(this.parent.pageSettings.pageSize*(t[0]-1)),e.query.take(this.parent.pageSettings.pageSize*t.length),e.skipPage=!0)},k.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||U.prototype.resetIsedit.call(this)},k.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},k.prototype.cancelEdit=function(e){U.prototype.editCancel.call(this,e)},k.prototype.toSelectRowOnContextOpen=function(e){U.prototype.selectRowOnContextOpen.call(this,e)},k.prototype.restoreNewRow=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&!e.querySelector(".e-addedrow")&&(this.parent.isEdit=!1,this.parent.editModule.addRecord(null,this.parent.root.editModule.selectedIndex))},k.prototype.getData=function(e){U.prototype.getVirtualData.call(this,e)},k.prototype.handleActionBegin=function(e){U.prototype.actionBegin.call(this,e)},k.prototype.onActionComplete=function(e){var t;"add"===e.requestType&&(t={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex},this.parent.notify("get-row-position",t),this.rowPosition=t.newRowPosition,this.addRowIndex=t.addRowIndex,this.dataRowIndex=this.parent.root.editModule.selectedIndex);U.prototype.actionComplete.call(this,e)},k.prototype.onEnteredAction=function(){var p=this;return function(e,t,i,r,n,o){var a,s,d,l;p.parent.directVirtualRender||(a="preventEvent",!C.Browser.isIE||n||!o||p[a]||p.parent.enableVirtualMaskRow||p.parent.showSpinner(),p.parent.enableVirtualMaskRow&&!p[a]&&setTimeout(function(){p.parent.showMaskRow(t.axis),p.parent.notify("showGanttShimmer",{requestType:"showShimmer"})},0),n=p.content.getBoundingClientRect().height,o=p.prevInfo.offsets?p.prevInfo.offsets.top:null,a="X"===t.axis,d=p.getColumnOffset(a?p.vgenerator.getColumnIndexes()[0]-1:p.prevInfo.columnIndexes[0]-1),p.parent.isFrozenGrid()&&p.parent.enableColumnVirtualization&&p.currentInfo&&p.currentInfo.columnIndexes&&(l=p.currentInfo.columnIndexes[0]-1,s=0,p.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(s+=parseInt(e.width.toString(),10))}),l>p.parent.getVisibleFrozenLeftCount())&&(d-=s),a&&(l=Object.keys(p.vgenerator.cOffsets).length-p.prevInfo.columnIndexes.length,d=(l=p.vgenerator.cOffsets[l-1])<d?l:d),l=p.getTranslateY(r.top,n,a&&o===r.top?p.prevInfo:void 0,!0),p.parent.isFrozenGrid()&&!p.parent.enableVirtualMaskRow)||(p.parent.enableVirtualMaskRow?(n=r.top-p.translateY<0,l=Math.round(p.translateY)>l&&!n?Math.round(p.translateY):l,p.virtualEle.adjustTable(d,l)):p.virtualEle.adjustTable(d,p.translateY),p.parent.enableColumnVirtualization&&(p.header.virtualEle.adjustTable(d,0),p.parent.isFrozenGrid())&&p.parent.contentModule.resetStickyLeftPos(d))}},k.prototype.scrollListeners=function(e){this.scrollAfterEdit(),this.shouldPreventScrolling(e),this.parent.root.enablePersistence&&(this.parent.root.scrollPosition=e.offset);var t,i,r,n=e.sentinel,o=this.parent.getRowHeight(),a=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2),s=(C.isNullOrUndefined(this.parent.contentModule)||(t=this.parent.getContent().querySelector(".e-content")),a*o),d=e.offset.top-this.translateY<0&&"downArrow"!==this.activeKey,s=Math.ceil(e.offset.top-this.translateY)+o>=s,l="selectedRowIndex",p=this.parent.currentViewData,h="index";d&&"right"!==e.direction&&"left"!==e.direction&&!C.isNullOrUndefined(t)?(i=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),i=0<(i=Math.floor(t.scrollTop/o)+Math.ceil(i/o)-this.parent.pageSettings.pageSize)?i:0,!C.isNullOrUndefined(this[l])&&-1!==this[l]&&i!==this[l]&&this.parent.rowHeight*this.parent.pageSettings.pageSize<t.scrollTop&&!this.parent.allowRowDragAndDrop&&(i=this[l]),this.startIndex=i,this.endIndex=i+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords&&(i=this.totalRecords,r=this.endIndex%i,this.endIndex=i,this.startIndex=this.startIndex-r<0?0:this.startIndex-r),p.length&&p[0][h]>=this.parent.pageSettings.pageSize/2&&p[0][h]-this.startIndex<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule&&this.parent.selectionModule.isRowSelected&&(this.startIndex=p[0][h]-this.parent.pageSettings.pageSize/2,this.endIndex=this.startIndex+this.parent.pageSettings.pageSize),i=Math.ceil(e.offset.top/o),i%=this.parent.pageSettings.pageSize,(r=0)===(r=C.isNullOrUndefined(this.parent.getRows()[parseInt(i.toString(),10)])||C.isNullOrUndefined(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(i.toString(),10)])?r:+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(i.toString(),10)].querySelector("td").getAttribute("index"))?this.endIndex-this.startIndex<this.parent.pageSettings.pageSize?this.translateY=C.isNullOrUndefined(this.endIndex)?0:(this.endIndex-this.parent.pageSettings.pageSize)*(this.parent.rowHeight||this.parent.getRowHeight()):this.startIndex===this[l]?this.translateY=e.offset.top:this.translateY=0<e.offset.top-a*o?e.offset.top-a*o+o:0:(0<this.parent.getFrozenColumns()&&(e.offset.top=e.offset.top+80),this.translateY=0<e.offset.top-a*o?e.offset.top-a*o+10:0)):s&&"right"!==e.direction&&"left"!==e.direction&&!C.isNullOrUndefined(t)&&(p=~~(t.scrollTop/o),h=!(this[l]+this.parent.pageSettings.pageSize<this.totalRecords),(i=(p=C.isNullOrUndefined(this[l])||-1===this[l]||p===this[l]||h||this.parent.allowRowDragAndDrop?p:this[l])+this.parent.pageSettings.pageSize)>this.totalRecords&&(i=p+(this.totalRecords-p)),this.startIndex=!h||C.isNullOrUndefined(this[l])?i-this.parent.pageSettings.pageSize:p,this.endIndex=i,p+this.parent.pageSettings.pageSize>this.totalRecords&&this.endIndex-this.startIndex<this.parent.pageSettings.pageSize/2&&this.endIndex-p<this.parent.pageSettings.pageSize/2&&(this.startIndex=i-this.parent.pageSettings.pageSize/2),e.offset.top>o*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,t.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.totalRecords===this.endIndex&&(this.parent.isEdit?this.translateY=this.totalRecords*o-this.parent.pageSettings.pageSize*o+o:this.translateY=this.totalRecords*o-this.parent.pageSettings.pageSize*o):0<this.parent.getFrozenColumns()?this.translateY=e.offset.top-(2*o+this.parent.pageSettings.pageSize):this.translateY=e.offset.top),s&&"up"!==e.direction&&e.offset.top<o*this.totalRecords||d||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url?(r=this.currentInfo=C.getValue("getInfoFromView",this).apply(this,[e.direction,n,e.offset]),this.previousInfo=r,this.prevInfo&&S(this.parent.root)&&"model-changed"!==r.event&&("Y"===n.axis&&this.prevInfo.blockIndexes.toString()===r.blockIndexes.toString()||"X"===n.axis&&this.prevInfo.columnIndexes.toString()===r.columnIndexes.toString()||this.parent.isFrozenGrid()&&this.parent.getVisibleFrozenLeftCount()>=r.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(r.columnIndexes.toString()))?(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),C.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,"Y"===n.axis&&this.restoreEditState()):(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?r.columnIndexes:[]),a=(r.loadNext&&!r.loadSelf?r.nextInfo:r).page,this.parent.setProperties({pageSettings:{currentPage:a}},!0),this.requestType="virtualscroll","right"===e.direction||"left"===e.direction||S(this.parent.root)||(r.event="refresh-virtual-block"===r.event?"model-changed":r.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(n.axis),this.parent.addShimmerEffect(),this.parent.notify("showGanttShimmer",{requestType:"showShimmer"})),this.parent.notify(r.event,{requestType:"virtualscroll",virtualInfo:r,focusElement:e.focusElement}))):this.parent.enableVirtualMaskRow&&(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}))},k.prototype.shouldPreventScrolling=function(e){this.parent.element.querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&0!==e.offset.top&&this.parent.closeEdit()},k.prototype.appendContent=function(e,t,i){var r,n,o,a,s,d;this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||I(this.parent)||this.parent.isFrozenGrid()&&(void 0===i.requestType||!C.isNullOrUndefined(i.virtualInfo)&&("right"===i.virtualInfo.direction||"left"===i.virtualInfo.direction))?(C.getValue("isExpandCollapse",i)&&(this.isRemoteExpand=!0),U.prototype.appendContent.call(this,e,t,i),-1!==C.getValue("requestTypes",this).indexOf("isFrozen")&&(C.getValue("requestTypes",this).splice(C.getValue("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType)):(n=(r=i.virtualInfo.sentinelInfo&&"Y"===i.virtualInfo.sentinelInfo.axis&&C.getValue("currentInfo",this).page&&C.getValue("currentInfo",this).page!==i.virtualInfo.page?C.getValue("currentInfo",this):i.virtualInfo).columnIndexes[0]-1,o=this.getColumnOffset(n),a=void 0,this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(o,0),d=r.columnIndexes,a=this.getColumnOffset(d[d.length-1])-this.getColumnOffset(d[0]-1)+"",this.header.virtualEle.setWrapperWidth(a)),this.virtualEle.setWrapperWidth(a,C.Browser.isIE||"edge"===C.Browser.info.name),(e=this.parent.createElement("tbody")).appendChild(t),this.getTable().querySelector("tbody").replaceWith(e),"virtualscroll"===i.requestType&&"Y"===i.virtualInfo.sentinelInfo.axis&&(this.isExpandCollapse=!1),this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&(s=0,this.parent.getColumns().filter(function(e){e.visible&&(parseInt(e.width.toString(),10),"Left"===e.freeze)&&(s+=parseInt(e.width.toString(),10))}),d=r.columnIndexes,a=this.getColumnOffset(d[d.length-1])-this.getColumnOffset(d[0]-1)+"",n>this.parent.getVisibleFrozenLeftCount()&&(o-=s),this.resetStickyLeftPos(o,t)),this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,C.getValue("virtualEle",this).adjustTable(o,this.translateY),this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(o,0),this.parent.isFrozenGrid())&&this.resetStickyLeftPos(o)),C.setValue("prevInfo",this.previousInfo||r,this),"virtualscroll"===i.requestType&&"X"===i.virtualInfo.sentinelInfo.axis&&this.parent.notify(vt,{}),U.prototype.focusCell.call(this,i),this.isAdd&&!this.parent.getContent().querySelector(".e-content").querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.dataRowIndex>=this.startIndex?this.restoreNewRow():this.addRowIndex&&-1<this.addRowIndex&&(this.isAdd=!1,this.parent.isEdit=!1)),this.restoreEditState(),U.prototype.restoreAdd.call(this),U.prototype.ensureSelectedRowPosition.call(this))},k.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("data-ready",this.onDataReady),this.parent.off("content-ready",this.fn),this.parent.off("select-virtual-Row",this.toSelectVirtualRow),this.parent.off("dataBound",this.dataBoundEvent),this.parent.off("rowSelected",this.rowSelectedEvent),this.parent.off(st,this.virtualOtherAction),this.parent.off(pt,this.indexModifier),this.parent.off("virtual-scroll-edit-action-begin",this.beginEdit),this.parent.off("virtual-scroll-add-action-begin",this.beginAdd),this.parent.off("virtual-scroll-edit-success",this.virtualEditSuccess),this.parent.off("edit-reset",this.resetIseditValue),this.parent.off("get-virtual-data",this.getData),this.parent.off("virtual-scroll-edit-cancel",this.cancelEdit),this.parent.off("select-row-on-context-open",this.toSelectRowOnContextOpen),this.parent.off("refresh-virtual-editform-cells",this.refreshCell),this.parent.off("virtaul-cell-focus",this.cellFocus),this.parent.off("virtual-scroll-edit",this.restoreEditState))},k);function k(e,t){e=U.call(this,e,t)||this;return e.isExpandCollapse=!1,e.translateY=0,e.maxiPage=0,e.recordAdded=!1,e.startIndex=-1,e.endIndex=-1,e.preTranslate=0,e.isRemoteExpand=!1,e.isDataSourceChanged=!1,e.addEventListener(),e}er=w.InterSectionObserver,$i(ir,er),ir.prototype.observes=function(e,t,i){er.prototype.containerRect=C.getValue("options",this).container.getBoundingClientRect(),C.EventHandler.add(C.getValue("options",this).container,"scroll",this.virtualScrollHandlers(e,t,i),this),C.getValue("options",this).movableContainer&&(er.prototype.movableContainerRect=C.getValue("options",this).movableContainer.getBoundingClientRect(),C.EventHandler.add(C.getValue("options",this).movableContainer,"scroll",this.virtualScrollHandlers(e,t,i),this))},ir.prototype.clear=function(){this.lastPos=null},ir.prototype.virtualScrollHandlers=function(a,s,d){var l=this,e="chrome"===C.Browser.info.name?200:100,p="options",h="movableEle",c="fromWheel",u=C.debounce(a,e),g=C.debounce(a,50),f=(this[p].prevTop=this[p].prevLeft=0,"isScrollByFocus");return function(e){var t,i,r,n,o="keyPress";d&&d.root&&d.root.editModule&&d.root.editModule[o]&&(t=d.root.editModule[o]),d.isEdit&&d.root.editModule[f]||d.isEdit&&("tab"===t||"shiftTab"===t)?d.root.editModule[f]=!1:(o=(l[p].movableContainer?l[p].container:e.target).scrollTop,t=(l[p].movableContainer?l[p].scrollbar:e.target).scrollLeft,i=l[p].prevTop<o?"down":"up",i=l[p].prevLeft===t?i:l[p].prevLeft<t?"right":"left",l[p].prevTop=o,l[p].prevLeft=t,r=l.sentinelInfo[i],n=0,l.newPos=o,null!=l.lastPos&&(n=l.newPos-l.lastPos),l.lastPos=l.newPos,l.timer&&clearTimeout(l.timer),l.timer=setTimeout(l.clear,0),(100<n||n<-100)&&e&&e.preventDefault&&(e.returnValue=!1,e.preventDefault()),-1!==l[p].axes.indexOf(r.axis)&&(l.containerRect=l[p].container.getBoundingClientRect(),n=l.check(i),r.entered&&("X"===r.axis||d.enableVirtualMaskRow)&&(!l[h]||"right"!=i&&"left"!=i?s(l.element,r,i,{top:o,left:t},l[c],n):s(l[h],r,i,{top:o,left:t},l[c],n)),n&&(e=g,("X"===r.axis?e:d.dataSource instanceof b.DataManager&&void 0!==d.dataSource.dataSource.url&&!d.dataSource.dataSource.offline&&""!==d.dataSource.dataSource.url||I(d)||d.enableVirtualMaskRow?e=d.enableVirtualMaskRow?u:e:a)({direction:i,sentinel:r,offset:{top:o,left:t},focusElement:document.activeElement})),l[c]=!1))}};var er,tr=ir;function ir(){var e=null!==er&&er.apply(this,arguments)||this;return e.isWheeling=!1,e.newPos=0,e.lastPos=0,e.timer=0,e}rr=function(e,t){return(rr=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])}))(e,t)};var rr,$i=function(e,t){function i(){this.constructor=e}rr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},nr=(or.prototype.getModuleName=function(){return"virtualScroll"},or.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Be,this.collapseExpandVirtualchilds,this),this.parent.on(ze,this.virtualPageAction,this),this.parent.on(dt,this.destroy,this))},or.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Be,this.collapseExpandVirtualchilds),this.parent.off(ze,this.virtualPageAction),this.parent.off(dt,this.destroy))},or.prototype.collapseExpandVirtualchilds=function(t){this.parent.grid.notify(st,{isExpandCollapse:!0}),this.expandCollapseRec=t.record,t.record.expanded="collapse"!==t.action,this.parent.flatData.map(function(e){return e.expanded=(e.uniqueID===t.record.uniqueID&&e.expanded!==t.record.expanded?t.record:e).expanded});var e={result:this.parent.flatData,row:t.row,action:t.action,record:t.record,count:this.parent.flatData.length},i=(this.handleSelection(),C.getValue("isCollapseAll",this.parent)?"collapseAll":"refresh");C.getValue("grid.renderModule",this.parent).dataManagerSuccess(e,{requestType:i})},or.prototype.handleSelection=function(){"Cell"!==this.parent.selectionSettings.mode&&("Row"!==this.parent.selectionSettings.mode||this.parent.selectionSettings.persistSelection)||this.parent.grid.clearSelection(),C.getValue("isCollapseAll",this.parent)&&this.parent.selectionSettings.persistSelection&&0<this.parent.getSelectedRecords().length&&(this.prevSelectedRecord=this.parent.getSelectedRecords(),this.parent.grid.clearSelection())},or.prototype.virtualPageAction=function(e){var t,i,r,n=this,o=new b.DataManager(e.result),a=new b.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),a=o.executeLocal((new b.Query).where(a)).filter(function(e){return y(n.parent,e)}),s=(this.visualData=a,e.count=a.length,this.parent.grid.notify(lt,{data:a}),{startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType}),d=(this.parent.grid.notify(pt,s),s.startIndex),l=s.endIndex;e.count=a.length,-1===d&&-1===l?(i=new b.Query,t=this.parent.grid.pageSettings.pageSize,r=this.parent.grid.pageSettings.currentPage,i=i.skip(t*(r-1)).take(t),o.dataSource.json=a,e.result=o.executeLocal(i)):(("filtering"===(r=e.actionArgs.requestType)||"collapseAll"===r||"searching"===r||"refresh"===r&&C.getValue("isExpandAll",this.parent)||"refresh"===r&&this.parent.enableCollapseAll&&l>a.length&&C.isNullOrUndefined(this.expandCollapseRec))&&(d=0,l=this.parent.grid.pageSettings.pageSize,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify(st,{setTop:!0})),("save"===r&&e.actionArgs.index>=s.count-this.parent.grid.pageSettings.pageSize||"refresh"===r&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&(this.setEndIndexToGantt&&(this.ganttEndIndex=s.endIndex),!(s.endIndex+this.parent.pageSettings.pageSize>=s.count&&this.parent.root&&s.count!==this.ganttEndIndex&&this.parent.isAddedFromGantt)&&this.parent.isGantt&&this.parent.isAddedFromGantt||(d=s.startIndex+(s.count-s.endIndex),l=s.count,this.setEndIndexToGantt=!1),this.ganttEndIndex=l,this.parent.isAddedFromGantt=!1),t=this.parent.grid.contentModule.virtualEle.wrapper,o=w.getTransformValues(t).height,!C.isNullOrUndefined(this.expandCollapseRec)&&("virtualscroll"===e.actionArgs.requestType||"refresh"===e.actionArgs.requestType&&d!==this.prevstartIndex)&&d<this.parent.getRows().length&&l<=d+this.parent.getRows().length&&0===o&&(d=0),"save"===e.actionArgs.requestType&&d!==this.prevstartIndex&&d<this.parent.getRows().length&&l<=d+this.parent.getRows().length&&0===o&&(l=(d=0)+this.parent.grid.pageSettings.pageSize),C.isNullOrUndefined(this.expandCollapseRec)||(i=this.parent.grid.pageSettings.pageSize,r=a.indexOf(this.expandCollapseRec),a.slice(r,r+i).length<i&&0<=r&&0!==d?(r=a.length-i,(l=a.length)-d<i&&(d=r=0<r?r:0,a.indexOf(this.expandCollapseRec)>a.length-i/2)&&(s=d*this.parent.grid.getRowHeight(),this.parent.grid.contentModule.translateY=s,this.parent.grid.contentModule.virtualEle.adjustTable(0,s))):C.getValue("isCollapseAll",this.parent)&&(l=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(st,{setTop:!(d=0)}))),"collapseAll"!==this.prevrequestType||"virtualscroll"!==e.actionArgs.requestType||C.isNullOrUndefined(this.parent.idMapping)||0!==d||(l=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(st,{setTop:!(d=0)})),!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||C.isNullOrUndefined(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?d=0:this.parent.isExpandAll||0!==this.parent.grid.contentModule.translateY||(d=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,d=d<0?0:d,0===l&&0<a.length?e.result=a:e.result=a.slice(d,l),this.prevstartIndex=d,this.prevendIndex=l,this.prevrequestType=e.actionArgs.requestType),this.parent.notify("updateAction",e)},or.prototype.destroy=function(){this.removeEventListener()},or.prototype.updateSelection=function(e){if(e.isHeaderCheckboxClicked&&this.parent.grid.currentViewData.length!==this.parent.grid.selectionModule.selectedRowIndexes.length&&e.target.classList.contains("e-uncheck"))for(var t=0;t<this.parent.getRows().length;t++)this.parent.getRows()[parseInt(t.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&!this.parent.getRows()[parseInt(t.toString(),10)].querySelector(".e-checkbox-disabled")&&this.parent.grid.selectionModule.updateRowSelection(this.parent.getRows()[parseInt(t.toString(),10)],this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)].index)},or);function or(e){this.prevstartIndex=-1,this.setEndIndexToGantt=!0,this.prevendIndex=-1,this.prevSelectedRecord=[],this.parent=e,w.Grid.Inject(sr),this.addEventListener()}ar=w.VirtualScroll,$i(dr,ar),dr.prototype.getModuleName=function(){return"treeVirtualScroll"},dr.prototype.instantiateRenderers=function(){var e=C.getValue("parent",this),t=(C.getValue("parent",this).log(["limitation","virtual_height"],"virtualization"),C.getValue("locator",this).getService("rendererFactory"));e.enableColumnVirtualization&&C.getValue("addRenderer",t).apply(t,[w.RenderType.Header,new w.VirtualHeaderRenderer(C.getValue("parent",this),C.getValue("locator",this))]),C.getValue("addRenderer",t).apply(t,[w.RenderType.Content,new Zi(C.getValue("parent",this),C.getValue("locator",this))]),this.ensurePageSize()},dr.prototype.ensurePageSize=function(){var e=C.getValue("parent",this),t=e.getRowHeight();C.isNullOrUndefined(e.height)||"string"!=typeof e.height||-1===e.height.indexOf("%")||(e.element.style.height=e.height);var t=2*~~((e.height.toString().indexOf("%")<0?parseInt(e.height.toString(),10):e.element.getBoundingClientRect().height)/t),i=e.pageSettings.pageSize;e.setProperties({pageSettings:{pageSize:i<t?t:i}},!0)};var ar,sr=dr;function dr(e,t){e=ar.call(this,e,t)||this;return C.getValue("parent",e).off("initial-load",C.getValue("instantiateRenderer",e),e),C.getValue("parent",e).on("initial-load",e.instantiateRenderers,e),e}lr.prototype.addEventListener=function(){this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.grid.on("dblclick",this.dblClickHandler,this)},lr.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.grid.off("dblclick",this.dblClickHandler))},lr.prototype.rowExpandCollapse=function(t){var e,i=this.parent.getDataRows(),r=this.parent.getRows(),n=0<this.parent.getFrozenLeftColumnsCount()||0<this.parent.getFrozenRightColumnsCount();n&&(e=this.parent.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}));for(var o=t.detailrows.length?t.detailrows:i.filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}),a=0;a<o.length;a++){var s=o[parseInt(a.toString(),10)],d=this.parent.grid.getRowObjectFromUID(s.getAttribute("data-uid")).data,l=(!C.isNullOrUndefined(i)&&0<s.parentElement.firstElementChild.clientHeight&&(s.style.height=s.parentElement.firstElementChild.clientHeight+"px"),this.parent.toggleRowVisibility(s,t.action),n&&e.length&&this.parent.toggleRowVisibility(e[parseInt(a.toString(),10)],t.action),"e-childrow-hidden"===t.action?".e-treecolumn-container .e-treegridcollapse":".e-treecolumn-container .e-treegridexpand");if(r[s.rowIndex].querySelector(l)){for(var p=[],h=0;h<i.length;h++)i[parseInt(h.toString(),10)].querySelector(".e-gridrowindex"+d.index+"level"+(d.level+1))&&p.push(i[parseInt(h.toString(),10)]);p.length&&(s=this.parent.getCurrentViewRecords()[p[0].rowIndex],this.rowExpandCollapse({detailrows:p,action:t.action,record:s}))}}},lr.prototype.dblClickHandler=function(e){w.parentsUntil(e.target,"e-rowcell")&&this.parent.grid.editSettings.allowEditOnDblClick&&"Cell"!==this.parent.editSettings.mode&&!e.target.classList.contains("e-treegridcollapse")&&!e.target.classList.contains("e-treegridexpand")&&this.parent.startEdit(w.parentsUntil(e.target,"e-row"))},lr.prototype.dataBoundArg=function(){this.parent.getColumns().filter(function(e){return e.showCheckbox}).length&&this.parent.freezeModule&&this.parent.initialRender&&C.addClass([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},lr.prototype.destroy=function(){this.removeEventListener()},lr.prototype.getModuleName=function(){return"freeze"};$i=lr;function lr(e){w.Grid.Inject(w.Freeze),this.parent=e,this.addEventListener()}hr.prototype.openColumnChooser=function(e,t){return this.parent.grid.columnChooserModule.openColumnChooser(e,t)},hr.prototype.destroy=function(){},hr.prototype.getModuleName=function(){return"ColumnChooser"};var pr=hr;function hr(e){w.Grid.Inject(w.ColumnChooser),this.parent=e}q.prototype.getModuleName=function(){return"infiniteScroll"},q.prototype.addEventListener=function(){this.parent.on(ze,this.infinitePageAction,this),this.parent.on("infinite-remote-expand",this.infiniteRemoteExpand,this),this.parent.grid.on("delete-complete",this.infiniteDeleteHandler,this),this.parent.grid.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.grid.on("infinite-crud-cancel",this.createRows,this),this.parent.grid.on("content-ready",this.contentready,this)},q.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("infinite-remote-expand",this.infiniteRemoteExpand),this.parent.grid.off("delete-complete",this.infiniteDeleteHandler),this.parent.grid.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off(ze,this.infinitePageAction),this.parent.grid.off("infinite-crud-cancel",this.createRows),this.parent.grid.off("content-ready",this.contentready))},q.prototype.infiniteRemoteExpand=function(e){for(var t=this.parent.grid.getRowsObject(),i=this.parent.grid.infiniteScrollModule.serviceLocator,r=new w.RowRenderer(i,null,this.parent.grid),n=this.parent.getRows(),o=e.index===n.length-1?"after":"before",a=this.parent.grid.getColumns(),s=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),d=[],l=0;l<s.length;l++)d.push(r.render(s[parseInt(l.toString(),10)],a));t.splice.apply(t,[e.index+1,0].concat(s));for(l=0;l<d.length;l++)("after"==o?n[e.index+l]:n[e.index+l+1])[o](d[parseInt(l.toString(),10)]),n.splice(e.index+1+l,0,d[parseInt(l.toString(),10)]);w.resetRowIndex(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},q.prototype.contentready=function(){var e;this.parent.infiniteScrollSettings.enableCache&&!C.isNullOrUndefined(this.parent.editModule)&&(this.parent.editModule[e="updateIndex"](this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),this.parent.getFrozenColumns())&&this.parent.editModule[e](this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords())},q.prototype.infinitePageAction=function(e){var t=new b.DataManager(e.result),i=new b.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),i=t.executeLocal((new b.Query).where(i)),r=C.getValue("actionArgs",e.actionArgs),n=C.getValue("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var o,a,s,d,l,n=!!n.some(function(e){return e===r.requestType})||!!this.parent.initialRender;this.visualData=i,e.count=i.length,C.getValue("isPrinting",e.actionArgs)?e.result=i:(l=new b.Query,(o=this.parent.infiniteScrollSettings.enableCache)&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks),n=n?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,d=this.parent.grid.pageSettings.currentPage,l=C.isNullOrUndefined(r)?l.page(d,n):(a=C.getValue("lastIndex",this.parent.grid.infiniteScrollModule),s=C.getValue("firstIndex",this.parent.grid.infiniteScrollModule),o||"delete"!==r.requestType?o&&"delete"===r.requestType||"save"===r.requestType&&"add"===r.action?(l=l.skip(s)).take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize):l.page(d,n):(s=a-r.data.length+1,d=r.data.length,l.skip(s).take(d))),t.dataSource.json=i,o||C.isNullOrUndefined(r)||"save"!==r.requestType||"add"!==r.action?e.result=t.executeLocal(l):e.result=[r.data]),this.parent.notify("updateAction",e)},q.prototype.infiniteEditHandler=function(e){var t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,i=Object.keys(t);if("delete"===e.e.requestType&&1<e.result.length)for(var r=1;r<e.result.length;r++)t[i[i.length-1]].push(e.result[parseInt(r.toString(),10)])},q.prototype.infiniteDeleteHandler=function(e){var t,i,r;"delete"===e.requestType&&(r=this.parent.grid.getRowsObject(),i=this.parent.getRows(),e=e.data instanceof Array?e.data:[e.data],t=this.parent.grid.getPrimaryKeyFieldNames()[0],this.removeRows(i,r,e,t,!0),0<this.parent.getFrozenColumns())&&(i=this.parent.grid.getRowsObject(),r=this.parent.grid.getRows(),this.removeRows(r,i,e,t))},q.prototype.removeRows=function(r,n,o,a,s){for(var d=this,e=0;e<o.length;e++)!function(i){n.filter(function(e,t){e.data[""+a]===o[parseInt(i.toString(),10)][""+a]&&(s&&(e=Math.ceil((t+1)/d.parent.grid.pageSettings.pageSize),d.parent.grid.infiniteScrollModule.resetInfiniteCurrentViewData(e,t)),n.splice(t,1),C.remove(r[parseInt(t.toString(),10)]),r.splice(t,1))})}(e)},q.prototype.createRows=function(e){var t,i=e.args.e,r=e.row,n=this.parent.grid.infiniteScrollModule.serviceLocator,o=new w.RowRenderer(n,null,this.parent.grid),a=this.parent.getCurrentViewRecords(),s=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows(),d=(e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-content"):(this.parent.grid.isFrozenGrid()?(e.isMovable,this.parent.grid):this.parent).getContent()).querySelector("tbody");this.parent.frozenRows&&(d=e.isFrozenRows&&"add"!==this.parent.grid.infiniteScrollModule.requestType||!e.isFrozenRows&&"add"===this.parent.grid.infiniteScrollModule.requestType?(this.parent.grid.isFrozenGrid()?!e.isMovable&&e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-header"):this.parent.grid.getHeaderContent():this.parent.getHeaderContent()).querySelector("tbody"):d);for(var l="addRowIndex",p=this.parent.editModule[l],h=0;h<r.length;h++){var c=o.render(r[parseInt(h.toString(),10)],this.parent.grid.getColumns());"save"===i.requestType&&"add"===i.action?-1!==C.getValue("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(t="after",p+=R(a[parseInt(p.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&--p,s[parseInt(p.toString(),10)][""+t](c)):"Above"===this.parent.editSettings.newRowPosition&&s[this.parent.editModule[l]][""+(t="before")](c):"Bottom"===this.parent.editSettings.newRowPosition?d.appendChild(c):d.insertBefore(c,d.firstElementChild):"delete"===i.requestType&&d.appendChild(c)}e.cancel=!0},q.prototype.destroy=function(){this.removeEventListener()};var cr=q;function q(e){this.parent=e,w.Grid.Inject(w.InfiniteScroll),this.addEventListener()}r.Aggregate=zi,r.AggregateColumn=Zt,r.AggregateRow=a,r.Column=F,r.ColumnChooser=pr,r.ColumnMenu=ji,r.CommandColumn=Wi,r.ContextMenu=Hi,r.DataManipulation=Kt,r.DetailRow=Ji,r.Edit=Ki,r.EditSettings=s,r.ExcelExport=ki,r.Filter=Oi,r.FilterSettings=J,r.Freeze=$i,r.InfiniteScroll=cr,r.InfiniteScrollSettings=ai,r.LoadingIndicator=Y,r.Logger=ce,r.Page=Ti,r.PageSettings=n,r.PdfExport=qi,r.Predicate=ee,r.Render=Gt,r.Reorder=e,r.Resize=gi,r.RowDD=h,r.RowDropSettings=Mi,r.SearchSettings=oe,r.Selection=qt,r.SelectionSettings=Lt,r.Sort=Fi,r.SortDescriptor=si,r.SortSettings=l,r.StackedColumn=z,r.Toolbar=Vi,r.TreeClipboard=Ot,r.TreeGrid=Si,r.TreeGridColumn=L,r.TreeVirtual=sr,r.TreeVirtualRowModelGenerator=Ni,r.VirtualScroll=nr,r.actionBegin=ve,r.actionComplete=Ce,r.actionFailure=Mt,r.ariaColIndex="aria-colindex",r.ariaRowIndex=Dt,r.autoCol=vt,r.batchAdd=et,r.batchCancel=Ze,r.batchDelete=$e,r.batchEditFormRendered="batcheditform-rendered",r.batchSave=nt,r.beforeBatchAdd=it,r.beforeBatchCancel=ct,r.beforeBatchDelete=tt,r.beforeBatchSave=rt,r.beforeCopy=_e,r.beforeDataBound=Re,r.beforeExcelExport=Ae,r.beforePaste=He,r.beforePdfExport=Ee,r.beforeStartEdit=ht,r.beginAdd=Ke,r.beginEdit=Qe,r.cellEdit=Xe,r.cellSave=Ye,r.cellSaved=Je,r.checkboxChange=Me,r.collapsed=qe,r.collapsing=Te,r.content="e-content",r.contextMenuClick=je,r.contextMenuOpen=Fe,r.crudAction=Ge,r.dataBound=we,r.dataListener=lt,r.dataStateChange=xe,r.destroy=dt,r.detailDataBound=ut,r.doubleTap=at,r.expanded=Ue,r.expanding=ke,r.extendArray=D,r.findChildrenRecords=R,r.findParentRecords=Nt,r.frozenContent=bt,r.frozenHeader="e-frozenheader",r.frozenLeft="frozen-left",r.frozenRight="frozen-right",r.getExpandStatus=y,r.getParentData=x,r.getPlainData=Ut,r.headerContent="e-headercontent",r.indexModifier=pt,r.isCheckboxcolumn=At,r.isCountRequired=I,r.isFilterChildHierarchy=Et,r.isHidden=kt,r.isOffline=v,r.isRemoteData=S,r.keyPressed=ot,r.leftRight="Left-Right",r.load=ye,r.localPagedExpandCollapse=Be,r.movableContent=Ct,r.movableHeader="e-movableheader",r.pagingActions=ze,r.printGridInit=Le,r.queryCellInfo=Ie,r.recordDoubleClick=We,r.remoteExpand=Ve,r.resizeStop=Ne,r.rowDataBound=Se,r.rowDeselected=Oe,r.rowDeselecting=xt,r.rowDrag=gt,r.rowDragStart=yt,r.rowDragStartHelper=ft,r.rowDrop=mt,r.rowDropped=Rt,r.rowSelected=De,r.rowSelecting=be,r.rowdraging=It,r.rowsAdd=St,r.rowsRemove=wt,r.savePreviousRowPosition="savePreviousRowPosition",r.table="e-table",r.toolbarClick=Pe,r.treeGridDetails=me,r.updateData="update-data",r.virtualActionArgs=st,r.virtualColumnIndex="virtualColumnIndex",Object.defineProperty(r,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-grids","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-popups"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Grids,e.ej2Buttons,e.ej2Data,e.ej2Popups)}(this,function(r,C,w,T,b,B){"use strict";V=function(e,t){return(V=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])}))(e,t)};var V,z=function(e,t){function i(){this.constructor=e}V(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},L=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},F=(j.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)this[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]],this.parent&&this.parent.isReact&&"template"===t[parseInt(i.toString(),10)]&&this.parent.clipboardModule.treeGridParent.renderModule.refreshReactColumnTemplateByUid(this.uid)},j);function j(e){this.allowEditing=!0,this.edit={},this.disableHtmlEncode=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowFiltering=!0,this.allowSorting=!0,this.allowResizing=!0,this.filter={},this.enableRowSpan=!0,this.enableColumnSpan=!0,C.merge(this,e)}z(H,_=F),L([C.Property(null)],H.prototype,"columns",void 0);var _,L=H;function H(){return null!==_&&_.apply(this,arguments)||this}z(Q,G=L);var G,z=Q;function Q(){return null!==G&&G.apply(this,arguments)||this}K=function(e,t){return(K=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])}))(e,t)};var K,W,Y=function(e,t){function i(){this.constructor=e}K(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},J=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Y=(W=C.ChildProperty,Y(X,W),J([C.Property("Spinner")],X.prototype,"indicatorType",void 0),X);function X(){return null!==W&&W.apply(this,arguments)||this}$=function(e,t){return($=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])}))(e,t)};var $,Z,J=function(e,t){function i(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},ee=(Z=C.ChildProperty,J(t,Z),e([C.Property()],t.prototype,"field",void 0),e([C.Property()],t.prototype,"operator",void 0),e([C.Property()],t.prototype,"value",void 0),e([C.Property()],t.prototype,"matchCase",void 0),e([C.Property()],t.prototype,"ignoreAccent",void 0),e([C.Property()],t.prototype,"predicate",void 0),e([C.Property({})],t.prototype,"actualFilterValue",void 0),e([C.Property({})],t.prototype,"actualOperator",void 0),e([C.Property()],t.prototype,"type",void 0),e([C.Property()],t.prototype,"ejpredicate",void 0),e([C.Property()],t.prototype,"uid",void 0),e([C.Property()],t.prototype,"isForeignKey",void 0),t);function t(){return null!==Z&&Z.apply(this,arguments)||this}te=C.ChildProperty,J(ie,te),e([C.Collection([],ee)],ie.prototype,"columns",void 0),e([C.Property("FilterBar")],ie.prototype,"type",void 0),e([C.Property()],ie.prototype,"mode",void 0),e([C.Property(!0)],ie.prototype,"showFilterBarStatus",void 0),e([C.Property(1500)],ie.prototype,"immediateModeDelay",void 0),e([C.Property()],ie.prototype,"operators",void 0),e([C.Property(!1)],ie.prototype,"ignoreAccent",void 0),e([C.Property("Parent")],ie.prototype,"hierarchyMode",void 0);var te,J=ie;function ie(){return null!==te&&te.apply(this,arguments)||this}re=function(e,t){return(re=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])}))(e,t)};var re,ne,e=function(e,t){function i(){this.constructor=e}re(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},oe=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},e=(ne=C.ChildProperty,e(ae,ne),oe([C.Property("Both")],ae.prototype,"wrapMode",void 0),ae);function ae(){return null!==ne&&ne.apply(this,arguments)||this}var se,de,oe=function(e,t){function i(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},le="https://ej2.syncfusion.com/documentation/treegrid",pe="https://ej2.syncfusion.com/documentation",he=!(se=function(e,t){return(se=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])}))(e,t)}),ce=(de=w.Logger,oe(ue,de),ue.prototype.getModuleName=function(){return"logger"},ue.prototype.log=function(e,t){for(var i=e=e instanceof Array?e:[e],r=0;r<i.length;r++){var n,o=w.detailLists[i[parseInt(r.toString(),10)]],a=o.check(t,this.parent);a.success&&(a=(a=o.generateMessage(t,this.parent,a.options)).replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),he&&"primary_column_missing"===i[parseInt(r.toString(),10)]&&(a=a.replace("Editing","Row DragAndDrop"),he=!1),n=a.indexOf("https"),n=a.substring(n),"module_missing"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/modules"):"primary_column_missing"===i[parseInt(r.toString(),10)]||"selection_key_missing"===i[parseInt(r.toString(),10)]?a=a.replace(n,pe+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/edit"):"virtual_height"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/virtual"):"check_datasource_columns"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/columns"):"locale_missing"===i[parseInt(r.toString(),10)]&&(a=a.replace(n,le+"/global-local/#localization")),"datasource_syntax_mismatch"===i[parseInt(r.toString(),10)]&&(C.isNullOrUndefined(this.treeGridObj)||C.isNullOrUndefined(this.treeGridObj.dataStateChange))||console[o.logType](a))}},ue.prototype.treeLog=function(e,t,i){this.treeGridObj=i;var r=e=e instanceof Array?e:[e];i.allowRowDragAndDrop&&!i.columns.filter(function(e){return e.isPrimaryKey}).length&&(he=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=me[r[parseInt(n.toString(),10)]],a=o.check(t,i);a.success&&(a=o.generateMessage(t,i,a.options),console[o.logType](a))}},ue);function ue(e){return w.Grid.Inject(w.Logger),de.call(this,e)||this}var ge,fe,me={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,t){var i={success:!1};return i=C.isNullOrUndefined(t.idMapping)&&C.isNullOrUndefined(t.childMapping)&&C.isNullOrUndefined(t.parentIdMapping)||!C.isNullOrUndefined(t.idMapping)&&C.isNullOrUndefined(t.parentIdMapping)||C.isNullOrUndefined(t.idMapping)&&!C.isNullOrUndefined(t.parentIdMapping)?{success:!0}:i},generateMessage:function(){return"[EJ2TreeGrid.Error]: MAPPING FIELDS MISSING \nOne of the following fields is missing. It is required for the hierarchical relationship of records in TreeGrid:\n* childMapping\n* idMapping\n* parentIdMapping\nRefer to the following documentation links for more details.\n"+pe+"/api/treegrid#childmapping\n"+pe+"/api/treegrid#idmapping\n"+pe+"/api/treegrid#$parentidmapping"}}},ye="load",Se="rowDataBound",we="dataBound",Ie="queryCellInfo",Re="beforeDataBound",ve="actionBegin",xe="dataStateChange",Ce="actionComplete",be="rowSelecting",De="rowSelected",Me="checkboxChange",Oe="rowDeselected",Pe="toolbarClick",Ae="beforeExcelExport",Ee="beforePdfExport",Ne="resizeStop",Ue="expanded",ke="expanding",qe="collapsed",Te="collapsing",Be="remoteExpand",Ve="localPagedExpandCollapse",ze="pagingActions",Le="printGrid-Init",Fe="contextMenuOpen",je="contextMenuClick",_e="beforeCopy",He="beforePaste",Ge="crudAction",Qe="beginEdit",Ke="beginAdd",We="recordDoubleClick",Ye="cellSave",Je="cellSaved",Xe="cellEdit",$e="batchDelete",Ze="batchCancel",et="batchAdd",tt="beforeBatchDelete",it="beforeBatchAdd",rt="beforeBatchSave",nt="batchSave",ot="key-pressed",at="double-tap",st="virtual-action-args",dt="destroy",lt="data-listener",pt="index-modifier",ht="edit-form",ct="before-batch-cancel",ut="detailDataBound",gt="rowDrag",ft="rowDragStartHelper",mt="rowDrop",yt="rowDragStart",St="rows-add",wt="rows-remove",It="row-draging",Rt="row-dropped",vt="auto-col",xt="rowDeselecting",Ct="e-movablecontent",bt="e-frozencontent",Dt="aria-rowindex",Mt="actionFailure",oe=(ge=function(e,t){return(ge=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])}))(e,t)},function(e,t){function i(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Ot=(fe=w.Clipboard,oe(Pt,fe),Pt.prototype.setCopyData=function(e){var t="copyContent",i="getCopyData",r=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this[t]="";var n=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var o=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),a=0;a<o.length;a++){0<a&&(this.treeCopyContent+="\n");var s,d,l=o[parseInt(a.toString(),10)];n[l].classList.contains("e-summaryrow")||(s=[].slice.call(n[l].querySelectorAll(".e-rowcell")),d=this.treeGridParent.getSelectedRecords()[parseInt(a.toString(),10)].uniqueID,-1===this.copiedUniqueIdCollection.indexOf(d)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(r,l,n,e,a),this[i](s,!1,"\t",e),this.treeCopyContent+=this[t],this.copiedUniqueIdCollection.push(d),this[t]="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(r,o[parseInt(a.toString(),10)],n,e)))}e&&(p=this.treeGridParent.getVisibleColumns().map(function(e){return e.headerText}),this[i](p,!1,"\t",e),this.treeCopyContent=this[t]+"\n"+this.treeCopyContent);var p={data:this.treeCopyContent,cancel:!1};this.treeGridParent.trigger(_e,p),p.cancel||(this.clipBoardTextArea.value=this[t]=p.data,C.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0,this.copiedUniqueIdCollection=[],this.treeCopyContent="")}else fe.prototype.setCopyData.call(this,e)}},Pt.prototype.parentContentData=function(e,t,i,r,n){var o="copyContent",a="parentItem",s="uniqueID";if(!C.isNullOrUndefined(e[parseInt(t.toString(),10)][a]))for(var d=e[parseInt(t.toString(),10)][a].level,l=0;l<d+1;l++)for(var p=0;p<e.length;p++)if(!C.isNullOrUndefined(e[parseInt(t.toString(),10)][a])&&e[parseInt(p.toString(),10)][s]===e[parseInt(t.toString(),10)][a][s]){t=p;var h=[].slice.call(i[parseInt(t.toString(),10)].querySelectorAll(".e-rowcell")),c=e[parseInt(p.toString(),10)][s];if(-1===this.copiedUniqueIdCollection.indexOf(c)){this.getCopyData(h,!1,"\t",r),this.treeCopyContent=0<n?this.treeCopyContent+this[o]+"\n":this[o]+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(c),this[o]="";break}}},Pt.prototype.copy=function(e){fe.prototype.copy.call(this,e)},Pt.prototype.paste=function(e,t,i){fe.prototype.paste.call(this,e,t,i)},Pt.prototype.getModuleName=function(){return"clipboard"},Pt.prototype.destroy=function(){fe.prototype.destroy.call(this)},Pt.prototype.childContentData=function(e,t,i,r){var n="copyContent",o="uniqueID";if(e[parseInt(t.toString(),10)].hasChildRecords)for(var a=e[parseInt(t.toString(),10)].childRecords,s=0;s<a.length;s++)for(var d,l,p=0;p<e.length;p++)if(!C.isNullOrUndefined(a[parseInt(s.toString(),10)][o])&&e[parseInt(p.toString(),10)][o]===a[parseInt(s.toString(),10)][o]){C.isNullOrUndefined(i[parseInt(p.toString(),10)])||i[parseInt(p.toString(),10)].classList.contains("e-summaryrow")||(d=[].slice.call(i[parseInt(p.toString(),10)].querySelectorAll(".e-rowcell")),l=e[parseInt(p.toString(),10)][o],-1===this.copiedUniqueIdCollection.indexOf(l)&&(this.getCopyData(d,!1,"\t",r),this.treeCopyContent+="\n"+this[n],this[n]="",this.copiedUniqueIdCollection.push(l),this.childContentData(e,p,i,r)));break}},Pt);function Pt(e,t){var i=fe.call(this,e.grid,t)||this;return i.treeCopyContent="",i.copiedUniqueIdCollection=[],i.treeGridParent=e,i.serviceLocator=t,i}function I(e){var t;return e.treeGrid&&e.treeGrid.isGantt?!!e.taskFields.hasChildMapping&&e.dataSource instanceof b.DataManager&&((t=e.dataSource.adaptor)instanceof b.ODataAdaptor||t instanceof b.WebApiAdaptor||t instanceof b.WebMethodAdaptor||t instanceof b.CacheAdaptor||t instanceof b.UrlAdaptor):e.dataSource instanceof b.DataManager&&((t=e.dataSource.adaptor)instanceof b.ODataAdaptor||t instanceof b.WebApiAdaptor||t instanceof b.WebMethodAdaptor||t instanceof b.CacheAdaptor||t instanceof b.UrlAdaptor)}function R(e){return!!(e.dataSource&&"result"in e.dataSource)}function At(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function Et(e){return!((C.isNullOrUndefined(e.grid.searchSettings.key)||""===e.grid.searchSettings.key||"Child"!==e.searchSettings.hierarchyMode&&"None"!==e.searchSettings.hierarchyMode)&&(!e.allowFiltering||!e.grid.filterSettings.columns.length||"Child"!==e.filterSettings.hierarchyMode&&"None"!==e.filterSettings.hierarchyMode))}function Nt(e){for(var t=[],i=0,r=Object.keys(e).length;i<r;i++)w.getObject("hasChildRecords",e[parseInt(i.toString(),10)])&&t.push(e[parseInt(i.toString(),10)]);return t}function y(e,t,i){var r,t=C.isNullOrUndefined(t.parentItem)?null:M(e,t.parentItem.uniqueID);return null==t||(!e.initialRender||C.isNullOrUndefined(t[e.expandStateMapping])||t[e.expandStateMapping]?!1!==t.expanded&&(!t.parentItem||((r=M(e,t.parentItem.uniqueID))&&e.initialRender&&!C.isNullOrUndefined(r[e.expandStateMapping])&&!r[e.expandStateMapping]?r.expanded=!1:(!r||!1!==r.expanded)&&(!r||y(e,r)))):t.expanded=!1)}function v(e){var t=[];if(C.isNullOrUndefined(e)||!e.hasChildRecords&&!C.isNullOrUndefined(e.childRecords)&&!e.childRecords.length)return[];if(!C.isNullOrUndefined(e.childRecords))for(var i=e.childRecords.filter(function(e){return!e.isSummaryRow}),r=0,n=Object.keys(i).length;r<n;r++)t.push(i[parseInt(r.toString(),10)]),(i[parseInt(r.toString(),10)].hasChildRecords||!C.isNullOrUndefined(i[parseInt(r.toString(),10)].childRecords)&&i[parseInt(r.toString(),10)].childRecords.length)&&(t=t.concat(v(i[parseInt(r.toString(),10)])));return t}function x(e){return!I(e)||(e=e.dataSource,!C.isNullOrUndefined(e.ready))}function D(e){for(var t=[],i=0;e&&i<e.length;i++){for(var r=Object.keys(e[parseInt(i.toString(),10)]),n={},o=0;o<r.length;o++)n[r[parseInt(o.toString(),10)]]=e[parseInt(i.toString(),10)][r[parseInt(o.toString(),10)]];t.push(n)}return t}function Ut(e){return delete e.hasChildRecords,delete e.childRecords,delete e.index,delete e.parentItem,delete e.level,delete e.taskData,delete e.uniqueID,e}function M(e,t,i){return(i?e.uniqueIDFilterCollection:e.uniqueIDCollection)[""+t]}function kt(e){e=window.getComputedStyle(e);return"none"===e.display||"hidden"===e.visibility}i.prototype.getModuleName=function(){return"selection"},i.prototype.buildVisibleUidMap=function(){this.visibleUidIndex={};var e=this.parent.grid.currentViewData;if(e)for(var t=0,i=e.length;t<i;t++){var r=e[parseInt(t.toString(),10)];r&&r.uniqueID&&(this.visibleUidIndex[r.uniqueID]=t)}},i.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},i.prototype.destroy=function(){this.resetSelectionCaches(),this.removeEventListener()},i.prototype.checkboxSelection=function(e){var t,i,e=w.getObject("target",e),r=w.parentsUntil(e,"e-checkbox-wrapper");r&&0<r.querySelectorAll(".e-treecheckselect").length?(t=r.querySelector('input[type="checkbox"]'),i=[],this.parent.frozenRows?i.push(parseInt(e.closest("tr").getAttribute("aria-rowindex"),10)-1):i.push(e.closest("tr").rowIndex),this.selectCheckboxes(i),i=t.nextElementSibling.classList.contains("e-check"),this.triggerChkChangeEvent(t,i,e.closest("tr"))):r&&0<r.querySelectorAll(".e-treeselectall").length&&this.parent.autoCheckHierarchy&&(i=!(i=r.querySelector(".e-frame")).classList.contains("e-check")&&!i.classList.contains("e-stop"),this.headerSelection(i),t=r.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(t,i,e.closest("tr"))),!C.isNullOrUndefined(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&0<this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length&&I(this.parent)&&0<this.parent.parentQuery.length&&((r=this.parent.query.queries).push.apply(r,this.parent.parentQuery),this.parent.parentQuery=[])},i.prototype.triggerChkChangeEvent=function(e,t,i){var r=this.parent.getCurrentViewRecords()[i.rowIndex],t={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():r};this.parent.trigger(Me,t)},i.prototype.getCheckboxcolumnIndex=function(){if(-2===this.checkboxColIndexCache){for(var e,t=-1,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].showCheckbox){e=i[parseInt(r.toString(),10)].uid;break}for(var n=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv"),o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].getAttribute("data-mappinguid")===e){t=o;break}this.checkboxColIndexCache=C.isNullOrUndefined(t)?-1:t}return this.checkboxColIndexCache},i.prototype.headerCheckbox=function(){var e,t,i;this.buildVisibleUidMap(),this.totalSelectableCount=this.countSelectableRecords(this.resolveHeaderSelectionList(!0)),this.columnIndex=this.getCheckboxcolumnIndex(),-1<this.columnIndex&&((e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex])&&0===e.querySelectorAll(".e-treeselectall").length?(t=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}}),(i=T.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),i.insertBefore(t.cloneNode(),i.firstChild),C.isNullOrUndefined(e)||e.insertBefore(i,e.firstChild),this.headerCheckboxFrameEl=i.querySelector(".e-frame"),this.parent.autoCheckHierarchy&&this.headerSelection()):e&&0<e.querySelectorAll(".e-treeselectall").length&&(this.headerCheckboxFrameEl=e.querySelector(".e-frame"),this.parent.autoCheckHierarchy)&&this.headerSelection())},i.prototype.renderColumnCheckbox=function(e){var t,i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),r=e.data,e=(e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox"),"check"===r.checkboxState),e=T.createCheckBox(this.parent.createElement,!1,{checked:e,label:" "});return e.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(e.querySelector(".e-frame").style.width="18px"),"indeterminate"===r.checkboxState?(t=e.querySelectorAll(".e-frame")[0],C.removeClass([t],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-stop")):"uncheck"===r.checkboxState?(t=e.querySelectorAll(".e-frame")[0],C.removeClass([t],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-uncheck")):"check"===r.checkboxState&&(t=e.querySelectorAll(".e-frame")[0],C.removeClass([t],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-check")),e.insertBefore(i.cloneNode(),e.firstChild),e},i.prototype.columnCheckbox=function(e){var t,i,r=this.renderColumnCheckbox(e),n=e.cell.querySelector(".e-treecolumn-container");C.isNullOrUndefined(n)?(t=this.parent.createElement("span",{className:"e-treecheckbox"}),i=e.cell.innerHTML,e.cell.innerHTML="",t.innerHTML=i,(i=this.parent.createElement("div",{className:"e-treecheckbox-container"})).appendChild(r),i.appendChild(t),e.cell.appendChild(i)):e.cell.querySelector(".e-hierarchycheckbox")||n.insertBefore(r,n.querySelectorAll(".e-treecell")[0])},i.prototype.selectCheckboxes=function(e){for(var t=0;t<e.length;t++){var i=this.parent.getCurrentViewRecords()[e[parseInt(t.toString(),10)]],i=M(this.parent,i.uniqueID),r="check"===i.checkboxState?"uncheck":"check";i.checkboxState=r,this.traverSelection(i,r,!1)}},i.prototype.traverSelection=function(e,t,i){var r=e.checkboxState,n=(i||this.buildVisibleUidMap(),Array.isArray(e.childRecords)?e.childRecords:[]);if(n&&0!==n.length||!this.parent.autoCheckHierarchy||(n=this.getChildrenFromFlat(e)),this.parent.filterModule&&0<this.parent.filterModule.filteredResult.length&&n&&n.length&&(n=this.getFilteredChildRecords(n)),this.parent.autoCheckHierarchy&&n&&0!==n.length){for(var o=0,a=0,s=0,d=0;d<n.length;d++){var l=n[parseInt(d.toString(),10)];l&&!l.isSummaryRow&&(o++,this.updateSelectedItems(l,t,!0),l.hasChildRecords&&this.traverSelection(l,t,!0),"check"===l.checkboxState?a++:"indeterminate"===l.checkboxState&&s++)}e.uniqueID&&(this.parentSelectionCounters[e.uniqueID]={total:o,checked:a,indeterminate:s});var p=this.parentSelectionCounters[e.uniqueID],h=this.deriveParentState(e,p);"check"===t&&0<p.total&&p.checked===p.total&&0===p.indeterminate&&(h="check"),this.updateSelectedItems(e,h),!i&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem,r,h),i||(p=this.resolveHeaderSelectionList(),this.updateSelectedCollectionsAfterBulk(p,""),this.refreshVisibleCheckboxes(),this.updateHeaderCheckboxState())}else this.updateSelectedItems(e,t),i||(e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),""),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState())},i.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return-1<t.parent.filterModule.filteredResult.indexOf(e)})},i.prototype.getChildrenFromFlat=function(e){var t=this.parent.flatData;if(!t||!e)return[];for(var i=e.uniqueID,r=[],n=0;n<t.length;n++){var o,a=t[parseInt(n.toString(),10)];a&&!a.isSummaryRow&&((o=a.parentItem)&&o.uniqueID===i)&&r.push(a)}return r},i.prototype.updateParentSelection=function(e,t,i){var r,e=M(this.parent,e.uniqueID);e&&(r=this.buildSelectionSummary(e),t&&this.applySummaryDelta(r,t,-1),i&&this.applySummaryDelta(r,i,1),e.uniqueID&&(this.parentSelectionCounters[e.uniqueID]=r),t=this.deriveParentState(e,r),e.checkboxState!==t)&&(i=e.checkboxState,e.checkboxState=t,this.updateSelectedItems(e,t),e.parentItem)&&this.updateParentSelection(e.parentItem,i,t)},i.prototype.buildSelectionSummary=function(e,t){var i={total:0,checked:0,indeterminate:0},r=[],r=e&&Array.isArray(e.childRecords)&&e.childRecords.length?e.childRecords:this.getChildrenFromFlat(e);!t&&this.parent.filterModule&&0<this.parent.filterModule.filteredResult.length&&(r=this.getFilteredChildRecords(r));for(var n=0;n<r.length;n++){var o=r[parseInt(n.toString(),10)];o&&!o.isSummaryRow&&(i.total++,"check"===o.checkboxState?i.checked++:"indeterminate"===o.checkboxState&&i.indeterminate++)}return i},i.prototype.applySummaryDelta=function(e,t,i){"check"===t?e.checked=Math.max(0,e.checked+i):"indeterminate"===t&&(e.indeterminate=Math.max(0,e.indeterminate+i))},i.prototype.deriveParentState=function(e,t){var i=t.total,r=t.checked;return 0<t.indeterminate||0<r&&r!==i?"indeterminate":r===i&&0<i?"check":"uncheck"},i.prototype.headerSelection=function(e){!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&(t=this.parent.filterModule.filteredResult,0===this.filteredList.length&&(this.filteredList=t),this.parent.grid.searchSettings.key.length?this.searchingRecords=t:this.filteredList===t||this.parent.grid.searchSettings.key.length||(this.filteredList=t,this.searchingRecords=[])),0<this.searchingRecords.length&&!C.isNullOrUndefined(e)?this.filteredList=this.searchingRecords:0<this.filteredList.length&&!this.parent.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(this.filteredList=[]);var t=this.resolveHeaderSelectionList(!0);C.isNullOrUndefined(e)?this.totalSelectableCount=this.countSelectableRecords(t):(this.resetSelectionCaches(),this.headerSelectionState=e=e?"check":"uncheck",this.processHeaderSelection(t,e),this.finalizeParentsAfterBulk(t),this.updateSelectedCollectionsAfterBulk(t,""),this.refreshVisibleCheckboxes()),this.updateHeaderCheckboxState()},i.prototype.finalizeParentsAfterBulk=function(e){for(var t=e,i=0;i<t.length;i++){var r,n,o=t[parseInt(i.toString(),10)];o&&o.hasChildRecords&&(r=this.buildSelectionSummary(o,!0),this.parentSelectionCounters[o.uniqueID]=r,n=this.deriveParentState(o,r),"check"===this.headerSelectionState&&0<r.total&&r.checked===r.total&&0===r.indeterminate?n="check":"uncheck"===this.headerSelectionState&&(n="uncheck"),o.checkboxState!==n)&&this.updateSelectedItems(o,n)}},i.prototype.processHeaderSelection=function(e,t){for(var i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)];r&&r.checkboxState!==t&&(r.checkboxState=t,this.updateSelectedItems(r,t,!0))}},i.prototype.updateSelectedCollectionsAfterBulk=function(e,t){for(var i=!!(this.parent.filterModule&&this.parent.filterModule.filteredResult&&this.parent.filterModule.filteredResult.length),r=!!(this.parent.grid&&this.parent.grid.searchSettings&&this.parent.grid.searchSettings.key&&this.parent.grid.searchSettings.key.length),n=i||r||"refresh"===t||"searching"===t,i=n?e:this.selectedItems.slice(),o=[],a=new Map,s=[],d=0,l=i;d<l.length;d++)(f=l[d]).hasChildRecords&&n&&0===f.level&&this.updateParentSelection(f),f.uniqueID&&"check"===f.checkboxState&&(o.push(f),a.set(f.uniqueID,!0));if(!n){r=this.parent.flatData;if(r)for(var p=0,h=r;p<h.length;p++){var c=h[p];c&&!c.isSummaryRow&&c.uniqueID&&"check"===c.checkboxState&&!a.has(c.uniqueID)&&(o.push(c),a.set(c.uniqueID,!0))}}this.selectedItems=o,this.selectedUidMap=a,this.buildVisibleUidMap();for(var u=0,g=this.selectedItems;u<g.length;u++){var f=g[u],m=this.visibleUidIndex[f.uniqueID];void 0!==m&&s.push(m)}this.selectedIndexes=s,this.checkedItemCount=this.selectedItems.length,this.totalSelectableCount=this.countSelectableRecords(e)},i.prototype.refreshVisibleCheckboxes=function(){this.buildVisibleUidMap();for(var e=this.parent.getCurrentViewRecords(),t=this.parent.uniqueIDCollection,i=0;e&&i<e.length;i++){var r,n,o=e[parseInt(i.toString(),10)];o&&(r=o.uniqueID,r=(r=t&&null!=r?t[String(r)]:o)&&r.checkboxState?r.checkboxState:"uncheck",n=null,n=!(n=(o=o.uid)?this.parent.grid.getRowElementByUID(o):n)&&(n=(o=this.parent.getRows())&&o[parseInt(i.toString(),10)],this.parent.frozenRows||this.parent.getFrozenColumns())&&!n?(o=this.parent.getDataRows())&&o[parseInt(i.toString(),10)]:n)&&(o=n.querySelector(".e-hierarchycheckbox .e-frame"))&&(C.removeClass([o],["e-check","e-stop","e-uncheck"]),o.classList.add("indeterminate"===r?"e-stop":"e-"+r),o=n.querySelector(".e-treecheckselect"))&&o.setAttribute("aria-checked","check"===r?"true":"uncheck"===r?"false":"mixed")}},i.prototype.resetSelectionCaches=function(){this.parentSelectionCounters={},this.selectedUidMap=new Map,this.selectedItems=[],this.selectedIndexes=[],this.totalSelectableCount=0,this.headerSelectionState="uncheck",this.checkedItemCount=0},i.prototype.countSelectableRecords=function(e){var t=0;if(e)for(var i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)];r&&!r.isSummaryRow&&t++}return t},i.prototype.resolveHeaderSelectionList=function(e){var t,i;return I(this.parent)?this.parent.getCurrentViewRecords():(t=!!(this.parent.filterModule&&this.parent.filterModule.filteredResult&&this.parent.filterModule.filteredResult.length),i=!!(this.parent.grid&&this.parent.grid.searchSettings&&this.parent.grid.searchSettings.key&&this.parent.grid.searchSettings.key.length),t?this.filteredList&&this.filteredList.length?this.filteredList:this.parent.filterModule.filteredResult:i&&this.searchingRecords&&this.searchingRecords.length?this.searchingRecords:this.parent.flatData)},i.prototype.updateHeaderCheckboxState=function(){var e=this.headerCheckboxFrameEl;if(e){for(var t=this.resolveHeaderSelectionList(!0),i=(this.totalSelectableCount=this.countSelectableRecords(t),0),r=0,n=t;r<n.length;r++){var o=n[r];o&&!o.isSummaryRow&&"check"===o.checkboxState&&i++}C.removeClass([e],["e-check","e-stop","e-uncheck"]),0===this.totalSelectableCount||0===i?e.classList.add("e-uncheck"):i===this.totalSelectableCount?e.classList.add("e-check"):e.classList.add("e-stop")}},i.prototype.updateSelectedItems=function(e,t,i){this.buildVisibleUidMap();var r=e.uniqueID,n=this.parent.uniqueIDCollection,n=n&&null!=r&&n[String(r)]?n[String(r)]:e,o=!0===e.isSummaryRow,a=n.checkboxState,s=this.visibleUidIndex[String(r)];n.checkboxState=t,i||(o||a===t||("check"===t?(this.checkedItemCount++,this.selectedUidMap.has(String(r))||(n.uniqueID&&this.selectedUidMap.set(String(n.uniqueID),!0),this.selectedItems.push(n),void 0!==s&&-1===this.selectedIndexes.indexOf(s)&&this.selectedIndexes.push(s))):"check"!==a&&"indeterminate"!==a||(0<this.checkedItemCount&&this.checkedItemCount--,n&&n.uniqueID&&this.selectedUidMap.has(String(n.uniqueID))&&(this.selectedUidMap.delete(String(n.uniqueID)),-1!==(i=this.selectedItems.indexOf(n))&&this.selectedItems.splice(i,1),void 0!==s)&&-1<(o=this.selectedIndexes.indexOf(s))&&this.selectedIndexes.splice(o,1))),a=null,(a=(n=e.uid)?this.parent.grid.getRowElementByUID(n):a)||-1<(i=void 0!==s?s:"number"==typeof this.visibleUidIndex[String(r)]?this.visibleUidIndex[String(r)]:-1)&&((a=this.parent.getRows()[parseInt(i.toString(),10)])||!this.parent.frozenRows&&!this.parent.getFrozenColumns()||(a=this.parent.getDataRows()[parseInt(i.toString(),10)])),a&&((o=a.querySelector(".e-hierarchycheckbox .e-frame"))&&(C.removeClass([o],["e-check","e-stop","e-uncheck"]),o.classList.add("indeterminate"===t?"e-stop":"e-"+t)),e=a.querySelector(".e-treecheckselect"))&&e.setAttribute("aria-checked","check"===t?"true":"uncheck"===t?"false":"mixed"))},i.prototype.updateGridActions=function(e){var t=e.requestType;if(At(this.parent))if(this.parent.autoCheckHierarchy)if("sorting"===t||"paging"===t)this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),""),this.refreshVisibleCheckboxes(),this.updateHeaderCheckboxState();else if("delete"===t||"add"===e.action){var i=[];"delete"===t?i=e.data:i.push(e.data);for(var r=0;r<i.length;r++)"delete"===t&&this.updateSelectedItems(i[parseInt(r.toString(),10)],"uncheck",!1),C.isNullOrUndefined(i[parseInt(r.toString(),10)].parentItem)||this.updateParentSelection(i[parseInt(r.toString(),10)].parentItem);this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(!0),""),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState()}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":"filtering"!==t&&"searching"!==t&&"refresh"!==t||(this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),t),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState());else"filtering"!==t&&"searching"!==t&&"refresh"!==t&&"sorting"!==t&&"paging"!==t&&"expanding"!==t&&"expand"!==t&&"collapsing"!==t&&"collapse"!==t||I(this.parent)||(this.selectedItems=[],this.selectedUidMap=new Map,this.selectedIndexes=[],this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState())},i.prototype.getCheckedrecords=function(){return this.selectedItems},i.prototype.getCheckedRowIndexes=function(){this.buildVisibleUidMap();for(var e=[],t=0,i=this.selectedItems;t<i.length;t++){var r=i[t].uniqueID;void 0!==r&&void 0!==this.visibleUidIndex[r]&&e.push(this.visibleUidIndex[r])}return e};var qt=i;function i(e){this.headerCheckboxFrameEl=null,this.checkboxColIndexCache=-2,this.parentSelectionCounters={},this.selectedUidMap=new Map,this.totalSelectableCount=0,this.headerSelectionState="uncheck",this.checkedItemCount=0,this.visibleUidIndex={},this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}Bt.prototype.getModuleName=function(){return"print"},Bt.prototype.addEventListener=function(){this.parent.grid.on(Le,this.printTreeGrid,this)},Bt.prototype.removeEventListener=function(){this.parent.grid.off(Le,this.printTreeGrid)},Bt.prototype.printTreeGrid=function(e){var t=w.getObject("printgrid",e),e=w.getObject("element",e);t.addEventListener(Ie,this.parent.grid.queryCellInfo),t.addEventListener(Se,this.parent.grid.rowDataBound),t.addEventListener(Re,this.parent.grid.beforeDataBound),C.addClass([e],"e-treegrid")},Bt.prototype.print=function(){this.parent.grid.print()},Bt.prototype.destroy=function(){this.removeEventListener()};var Tt=Bt;function Bt(e){this.parent=e,w.Grid.Inject(w.Print),this.addEventListener()}Vt=function(e,t){return(Vt=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])}))(e,t)};var Vt,zt,oe=function(e,t){function i(){this.constructor=e}Vt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Lt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},oe=(zt=C.ChildProperty,oe(Ft,zt),Lt([C.Property()],Ft.prototype,"fields",void 0),Lt([C.Property(!1)],Ft.prototype,"ignoreCase",void 0),Lt([C.Property("contains")],Ft.prototype,"operator",void 0),Lt([C.Property()],Ft.prototype,"key",void 0),Lt([C.Property()],Ft.prototype,"hierarchyMode",void 0),Ft);function Ft(){return null!==zt&&zt.apply(this,arguments)||this}jt=function(e,t){return(jt=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])}))(e,t)};var jt,_t,Lt=function(e,t){function i(){this.constructor=e}jt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Lt=(_t=C.ChildProperty,Lt(Ht,_t),n([C.Property("Row")],Ht.prototype,"mode",void 0),n([C.Property("Flow")],Ht.prototype,"cellSelectionMode",void 0),n([C.Property("Single")],Ht.prototype,"type",void 0),n([C.Property(!1)],Ht.prototype,"persistSelection",void 0),n([C.Property("Default")],Ht.prototype,"checkboxMode",void 0),n([C.Property(!1)],Ht.prototype,"checkboxOnly",void 0),n([C.Property(!0)],Ht.prototype,"enableToggle",void 0),Ht);function Ht(){return null!==_t&&_t.apply(this,arguments)||this}Qt.prototype.RowModifier=function(t){var i,r,e,n;t.data&&(e=(i=t.data).parentItem,C.isNullOrUndefined(i.parentItem)||Et(this.parent)||this.parent.allowPaging&&"Root"!==this.parent.pageSettings.pageSizeMode&&(!I(this.parent)||x(this.parent))||(!this.parent.initialRender||(C.isNullOrUndefined(e[this.parent.expandStateMapping])||e[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll)&&y(this.parent,t.data,this.parent.grid.getCurrentViewRecords())||C.isNullOrUndefined(t.row)||(this.parent.toggleRowVisibility(t.row,"e-childrow-hidden"),e=this.parent.grid.getRowsObject(),this.parent.grid.isFrozenGrid())||C.isNullOrUndefined(t.row.getAttribute("data-uid"))||(e.filter(function(e){return e.uid===t.row.getAttribute("data-uid")})[0].visible=!1),I(this.parent)&&!x(this.parent)&&(r=this.parent,0<(e=this.parent.getCurrentViewRecords().filter(function(e){return C.getValue(r.idMapping,e)===C.getValue(r.parentIdMapping,i)})).length)&&!e[0].isSummaryRow&&!C.isNullOrUndefined(t.row)&&(e=e[0].expanded?"e-childrow-visible":"e-childrow-hidden",this.parent.toggleRowVisibility(t.row,e)),w.getObject("isSummaryRow",t.data)&&C.addClass([t.row],"e-summaryrow"),C.isNullOrUndefined(t.row)||(t.row.querySelector(".e-treegridexpand")?t.row.setAttribute("aria-expanded","true"):t.row.querySelector(".e-treegridcollapse")&&t.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&(C.isNullOrUndefined(i.parentItem)||this.parent.toggleRowVisibility(t.row,"e-childrow-hidden"))),this.parent.rowDragAndDropModule&&this.parent.grid.rowDragAndDropModule&&(this.parent.grid.rowDragAndDropModule.dragStartData||this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.getContentTable().scrollHeight<=this.parent.getContent().clientHeight&&(this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length-1].uniqueID!==t.data.uniqueID||C.isNullOrUndefined(t.row)||t.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(t.row,!0)),this.parent.isReact?(n=this).parent.renderReactTemplates(function(){n.parent.trigger(Se,t)}):this.parent.trigger(Se,t))},Qt.prototype.cellRender=function(e){if(e.data){var t=this.parent.grid,i=e.data,r=C.isNullOrUndefined(i.filterLevel)?i.level:i.filterLevel,n=0,o=this.parent.getColumnByUid(e.column.uid),a=i.isSummaryRow,s=this.parent.getFrozenColumns(),d=(C.isNullOrUndefined(i.parentItem)?i:i.parentItem).index,l=this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):t.getColumnIndexByUid(e.column.uid);if(l!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!C.isNullOrUndefined(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var p=C.createElement("div",{className:"e-treecolumn-container"}),h=C.createElement("span",{className:"e-icons e-none"});h.style.width="10px",h.style.display="inline-block";for(var c=0;c<r;c++)n+=10,p.appendChild(h.cloneNode());var u,g,l=C.isNullOrUndefined(i.hasFilteredChildRecords)?i.hasChildRecords:i.hasFilteredChildRecords;(l=l&&!C.isNullOrUndefined(i.childRecords)?this.parent.isFromGantt&&this.parent.loadChildOnDemand?i.hasChildRecords:!(0===i.childRecords.length):l)?(C.addClass([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",i.expanded?"true":"false"),l=C.createElement("span",{className:"e-icons"}),g=void 0,this.parent.initialRender?g=i.expanded&&(C.isNullOrUndefined(i[this.parent.expandStateMapping])||i[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll:(g=!(!i.expanded||!y(this.parent,i,this.parent.grid.getCurrentViewRecords())),"Cell"!==this.parent.editSettings.mode||I(this.parent)||(u=this.parent.flatData.find(function(e){return e.uniqueID===i.uniqueID}),C.isNullOrUndefined(u))||(g=(i.expanded!==u.expanded?u:i).expanded)),C.addClass([l],g?"e-treegridexpand":"e-treegridcollapse"),n+=18,p.appendChild(l),h.style.width="4px",n+=7,p.appendChild(h.cloneNode())):!r&&i.level||(n+=20,p.appendChild(h.cloneNode()),p.appendChild(h.cloneNode())),u=C.createElement("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(u.style.width="Calc(100% - "+n+"px)"),C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level),this.updateTreeCell(e,u),p.appendChild(u),e.cell.appendChild(p)}0<t.getFrozenLeftColumnsCount()||0<t.getFrozenRightColumnsCount()?(g=t.getFrozenRightColumns(),l=t.getFrozenLeftColumns(),m=t.getMovableColumns(),(0<g.length&&g[0].field===e.column.field||0<l.length&&l[0].field===e.column.field||0<m.length&&m[0].field===e.column.field)&&C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level)):(s>this.parent.treeColumnIndex&&0<s&&t.getColumnIndexByUid(e.column.uid)===s||s<this.parent.treeColumnIndex&&0<s&&(t.getColumnIndexByUid(e.column.uid)===s||t.getColumnIndexByUid(e.column.uid)===s-1)||s===this.parent.treeColumnIndex&&0<s&&t.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1)&&C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level),!C.isNullOrUndefined(o)&&o.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)&&(g=e.cell.querySelectorAll(".e-frame")[0],n=n+parseInt(g.style.width,16)+10,(u=t.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+n+"px)"),a&&(C.addClass([e.cell],"e-summarycell"),l=w.getObject(e.column.field,e.data),l=C.isNullOrUndefined(l)?null:l,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=l:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=l),this.parent.args=e;var f,m=C.getValue("columnModel",this.parent)[this.parent.treeColumnIndex];C.isNullOrUndefined(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template?this.parent.trigger(Ie,e):this.parent.isReact&&m.field!==e.column.field&&(f=this).parent.renderReactTemplates(function(){f.parent.trigger(Ie,e)})}},Qt.prototype.updateTreeCell=function(e,t){var i=C.getValue("columnModel",this.parent)[this.parent.treeColumnIndex],r="templateFn",n=e.column.index,n=(C.isNullOrUndefined(i.field)&&e.cell.setAttribute("aria-colindex",n+1+""),i.field!==e.column.field||C.isNullOrUndefined(i.template)||(e.column.template=i.template,e.column[r]=w.templateCompiler(e.column.template),e.cell.classList.add("e-templatecell")),(null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell"):e.cell).innerHTML);if("object"==typeof e.column.template&&this.templateResult)w.appendChildren(t,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var o=e.cell.children.length,a=this.parent.element.id+e.column.uid;if(i.field!==e.column.field||C.isNullOrUndefined(i.template))for(;0<o;o=e.cell.children.length)t.appendChild(e.cell.children[parseInt(0..toString(),10)]);else{var s,i="portals";this.parent.isReact&&"string"!=typeof e.column.template?(e.column[r](e.data,this.parent,"columnTemplate",a,null,null,t),C.isNullOrUndefined(this.parent.grid[i])&&(this.parent.grid[i]=this.parent[i]),this.parent.notify("renderReactTemplate",this.parent[i]),(s=this).parent.renderReactTemplates(function(){s.parent.trigger(Ie,e)})):(i=e.column[r](w.extend({index:""},e.data),this.parent,"template",a,this.parent.isStringTemplate),w.appendChildren(t,i)),delete e.column.template,delete e.column[r],e.cell.innerHTML=""}}else t.innerHTML=n,e.cell.innerHTML=""},Qt.prototype.refreshReactColumnTemplateByUid=function(d){var l=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var e=l.parent.grid.getRowsObject(),t=l.parent.getDataRows(),i=l.parent.grid.getIndentCount(),r=l.parent.grid.getNormalizedColumnIndex(d);if(0!==t.length)for(var n,o,a,s=0;s<e.length;s++)e[parseInt(s.toString(),10)].isDataRow&&!C.isNullOrUndefined(e[parseInt(s.toString(),10)].index)&&(n=e[parseInt(s.toString(),10)].cells[parseInt(r.toString(),10)],a=new w.CellRenderer(l.parent.grid,l.parent.grid.serviceLocator),o=t.length>=e.length?l.parent.getCellFromIndex(e[parseInt(s.toString(),10)].index,r-i):t[e[parseInt(s.toString(),10)].index].querySelector(".e-templatecell"),a.refreshTD(o,n,e[parseInt(s.toString(),10)].data,{index:e[parseInt(s.toString(),10)].index}),a=l.parent.getRows()[parseInt(s.toString(),10)].cells[parseInt(r.toString(),10)],l.cellRender({data:e[parseInt(s.toString(),10)].data,cell:a,column:n.column}))})},Qt.prototype.columnTemplateResult=function(e){this.templateResult=e.template},Qt.prototype.reactTemplateRender=function(e,t){var i="portals";this.parent[i]=e,this.parent.notify("renderReactTemplate",this.parent[i]),this.parent.renderReactTemplates(t)},Qt.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)};var Gt=Qt;function Qt(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}o.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on(Be,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},o.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Be,this.collectExpandingRecs),this.parent.off("updateRemoteLevel",this.updateParentRemoteData),this.parent.off("updateAction",this.updateData),this.parent.off("dataProcessor",this.dataProcessor),this.parent.grid.off("sorting-begin",this.beginSorting))},o.prototype.destroy=function(){this.removeEventListener(),this.hierarchyData=null},o.prototype.isRemote=function(){return this.parent.dataSource instanceof b.DataManager},o.prototype.convertToFlatData=function(e){var t,i,r=this;this.parent.flatData=C.isNullOrUndefined(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof b.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],I(this.parent)&&!x(this.parent)&&e instanceof b.DataManager&&!(e instanceof Array)?(t=this.parent.dataSource,this.parent.parentIdMapping&&(this.parent.query=C.isNullOrUndefined(this.parent.query)?new b.Query:this.parent.query,this.parent.parentIdMapping&&(i=this.parent.query.params.filter(function(e){return"IdMapping"===e.key}),this.parent.initialRender)&&!i.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping)),this.parent.hasChildMapping||((i=this.parent.query.clone()).queries=[],(i=i.select([this.parent.parentIdMapping])).isCountRequired=!0,t.executeQuery(i).then(function(e){r.parentItems=b.DataUtil.distinct(e.result,r.parent.parentIdMapping,!1),0===(e.result?0:1)&&(C.setValue("grid.contentModule.isLoaded",!0,r.parent),C.isNullOrUndefined(r.zerothLevelData)||(C.setValue("cancel",!1,r.zerothLevelData),C.getValue("grid.renderModule",r.parent).dataManagerSuccess(r.zerothLevelData),r.zerothLevelData=null),r.parent.grid.hideSpinner())})))):e instanceof Array&&this.convertJSONData(e)},o.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var t=Object.keys(e),i=0;i<t.length;i++){var r=e[parseInt(i.toString(),10)];this.hierarchyData.push(C.extend({},r)),C.isNullOrUndefined(r[this.parent.idMapping])||this.taskIds.push(r[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){for(var n=[],o=new b.DataManager(this.hierarchyData).executeLocal((new b.Query).group(this.parent.parentIdMapping)),i=0;i<o.length;i++){var a,s=o[parseInt(i.toString(),10)],d=this.taskIds.indexOf(s.key);!C.isNullOrUndefined(s.key)&&-1<d?(a=s.items,this.hierarchyData[parseInt(d.toString(),10)][this.parent.childMapping]=a):n.push.apply(n,s.items)}this.hierarchyData=this.selfReferenceUpdate(n)}var l;Object.keys(this.hierarchyData).length?this.createRecords(this.hierarchyData):(l=!(this.parent.dataSource instanceof b.DataManager)&&this.parent.isGantt,this.parent.flatData=l?this.parent.dataSource:[]),this.storedIndex=-1},o.prototype.selfReferenceUpdate=function(e){for(var t=[];0<this.hierarchyData.length&&0<e.length;){var i=e.indexOf(this.hierarchyData[0]);-1===i?this.hierarchyData.shift():(t.push(this.hierarchyData.shift()),e.splice(i,1))}return t},o.prototype.updateParentRemoteData=function(o){var a=this,e="actionArgs",s=(I(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===o[e].requestType&&this.parent.hideSpinner(),o.result);if(I(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===o[e].requestType||"clearFilter"===o[e].action||""===o[e].searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||!this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand)for(var d=this,t=0;t<s.length;t++)!function(t){var i,r,n,e;R(d.parent)&&s[parseInt(t.toString(),10)].hasChildRecords&&d.parent.initialRender&&(s[parseInt(t.toString(),10)].expanded=!1),I(d.parent)&&d.parent.enableVirtualization&&(i=[],r=d.parent,s.filter(function(e){e[""+r.parentIdMapping]===s[parseInt(t.toString(),10)][""+r.idMapping]&&i.push(e)}),i.length?s[parseInt(t.toString(),10)].expanded=!0:s[parseInt(t.toString(),10)].hasChildRecords&&(s[parseInt(t.toString(),10)].expanded=!1)),C.isNullOrUndefined(s[parseInt(t.toString(),10)].index)&&(s[parseInt(t.toString(),10)].taskData=C.extend({},s[parseInt(t.toString(),10)]),s[parseInt(t.toString(),10)].uniqueID=w.getUid(d.parent.element.id+"_data_"),C.setValue("uniqueIDCollection."+s[parseInt(t.toString(),10)].uniqueID,s[parseInt(t.toString(),10)],d.parent),I(d.parent)&&d.parent.enableVirtualization&&s[parseInt(t.toString(),10)][""+d.parent.parentIdMapping]&&(C.isNullOrUndefined(s[parseInt(t.toString(),10)].level)||0===s[parseInt(t.toString(),10)].level)?(n=s[parseInt(t.toString(),10)][""+d.parent.parentIdMapping],(e=s.find(function(e){return e[""+a.parent.idMapping]===n}))?s[parseInt(t.toString(),10)].level=e.level+1:(e=o.actual.flatData.find(function(e){return e[""+a.parent.idMapping]===n}),C.isNullOrUndefined(e[""+d.parent.parentIdMapping])?s[parseInt(t.toString(),10)].level=1:s[parseInt(t.toString(),10)].level=e.level+1)):s[parseInt(t.toString(),10)].level=0,s[parseInt(t.toString(),10)].index=Math.ceil(1e3*Math.random()),!s[parseInt(t.toString(),10)][d.parent.hasChildMapping]&&-1===d.parentItems.indexOf(s[parseInt(t.toString(),10)][d.parent.idMapping])||(s[parseInt(t.toString(),10)].hasChildRecords=!0),s[parseInt(t.toString(),10)].checkboxState="uncheck")}(t);else C.isNullOrUndefined(s)||!this.parent.loadChildOnDemand&&R(this.parent)&&!C.isNullOrUndefined(this.parent.dataResults.expandRecord)||I(this.parent)&&!this.parent.loadChildOnDemand&&o[e].isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(s);else this.zerothLevelData=o,C.setValue("cancel",!0,o);I(this.parent)&&!this.parent.loadChildOnDemand&&o[e].isExpandCollapse&&this.parent.enableVirtualization||I(this.parent)&&this.parent.enableVirtualization&&this.parent.loadChildOnDemand?o.result=s:o.result=this.parent.loadChildOnDemand?s:this.parent.flatData,I(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(e=o.query.queries.filter(function(e){return"onAggregates"===e.fn}),o.result=this.parent.summaryModule.calculateSummaryValue(e,this.parent.flatData,!0)),this.parent.notify("updateResults",o)},o.prototype.collectExpandingRecs=function(e,t){var i,r=this.parent.getRows();if(this.parent.rowTemplate&&(i=this.parent.getContentTable().rows,r=[].slice.call(i)),0<e.rows.length){t||(e.record.expanded=!0);for(var n=0;n<e.rows.length;n++){this.parent.toggleRowVisibility(e.rows[parseInt(n.toString(),10)],"e-childrow-visible"),this.parent.loadChildOnDemand||(a=e.rows[parseInt(n.toString(),10)].getElementsByClassName("e-treegridcollapse")[0],o=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(n.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(n.toString(),10)].getAttribute("data-uid")).data,!C.isNullOrUndefined(a)&&o.expanded&&(C.addClass([a],"e-treegridexpand"),C.removeClass([a],"e-treegridcollapse")),a=[],(a=r.filter(function(e){return e.querySelector(".e-gridrowindex"+o.index+"level"+(o.level+1))})).length&&o.expanded&&this.collectExpandingRecs({record:o,rows:a,parentRow:e.parentRow},!0));var o,a=e.rows[parseInt(n.toString(),10)].querySelector(".e-detailrowcollapse");C.isNullOrUndefined(a)||this.parent.grid.detailRowModule.expand(a)}this.parent.grid.pageSettings.totalRecordsCount+=e.rows.length}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},o.prototype.fetchRemoteChildData=function(g){var e,f=this,m={row:g.parentRow,data:g.record},t=this.parent.dataSource,i=this.parent.grid.getDataModule().generateQuery(),r=i.queries.filter(function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn}),r=(i.queries=r,i.isCountRequired=!0,parseInt(g.record[this.parent.idMapping],10));isNaN(r)&&(r=g.record[this.parent.idMapping].toString()),this.parent.enableVirtualization&&"remoteExpand"===g.action?(i.take(this.parent.grid.pageSettings.pageSize),(e=[]).push("ExpandingAction",r.toString()),i.expand(e)):this.parent.enableVirtualization&&"collapse"===g.action&&(i.take(this.parent.grid.pageSettings.pageSize),(e=[]).push("CollapsingAction",r.toString()),i.expand(e)),i.where(this.parent.parentIdMapping,"equal",g.record[this.parent.idMapping]),"remoteExpand"===g.action&&this.parent.grid.filterSettings&&this.parent.grid.filterSettings.columns.length&&(r=this.parent.grid.getDataModule().generateQuery().queries.filter(function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates}),i.queries.push(r[0])),B.showSpinner(this.parent.element),t.executeQuery(i).then(function(e){var o,a="remoteExpandedData",s="remoteCollapsedData",d=f.parent.grid.currentViewData.slice(),t=f.parent.idMapping;if(f.parent.isGantt&&f.parent.loadChildOnDemand&&f.parent.hasChildMapping){for(var i=0;i<f.parent.grid.currentViewData.length;i++)if(g.record[t]===f.parent.grid.currentViewData[i][t]){o=i;break}}else o=d.indexOf(g.record);if(f.parent.enableVirtualization&&("collapse"===g.action||"remoteExpand"===g.action))for(d=[],i=0;i<o;i++)d.push(f.parent.grid.currentViewData[parseInt(i.toString(),10)]);-1===o&&f.parent.grid.getRowsObject().forEach(function(e){e.data.uniqueID===g.record.uniqueID&&(o=e.index)});var l=w.getObject("actual.nextLevel",e),p=e.result,r=[];if("remoteExpand"===g.action&&f.parent.grid.filterModule&&f.parent.grid.filterModule.value){for(i=0;i<d.length;i++)Object.prototype.hasOwnProperty.call(d[parseInt(i.toString(),10)],f.parent.parentIdMapping)&&null!==d[parseInt(i.toString(),10)][""+f.parent.parentIdMapping]&&0===d[parseInt(i.toString(),10)].level&&(d.splice(i,1),i--);for(i=0;i<p.length;i++)g.record[""+f.parent.idMapping]!==p[parseInt(i.toString(),10)][""+f.parent.idMapping]&&g.record[""+f.parent.idMapping]===p[parseInt(i.toString(),10)][""+f.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(p,i)&&r.push(p[parseInt(i.toString(),10)]);p=r}if(f.parent.enableVirtualization&&"remoteExpand"===g.action){g.record.childRecords=[];for(i=0;i<p.length;i++)g.record[""+f.parent.idMapping]!==p[parseInt(i.toString(),10)][""+f.parent.idMapping]&&g.record[""+f.parent.idMapping]===p[parseInt(i.toString(),10)][""+f.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(p,i)&&g.record.childRecords.push(p[parseInt(i.toString(),10)])}else g.record.childRecords=p;for(var n=0;n<p.length;n++)!function(e){var t=p[parseInt(e.toString(),10)];if(f.parent.enableVirtualization&&t[""+f.parent.idMapping]===g.record[""+f.parent.idMapping]&&"remoteExpand"===g.action)f.parent[a].push(g.record);else if(f.parent.enableVirtualization&&t[""+f.parent.idMapping]===g.record[""+f.parent.idMapping]&&"collapse"===g.action)for(var i=0;i<f.parent[a].length;i++)g.record[""+f.parent.idMapping]===f.parent[a][parseInt(i.toString(),10)][""+f.parent.idMapping]&&f.parent[a].splice(i,1);if(t.taskData=C.extend({},t),t[""+f.parent.parentIdMapping]&&f.parent.enableVirtualization&&f.parent[a].length)for(var r,i=0;i<f.parent[a].length;i++)t[""+f.parent.parentIdMapping]===f.parent[a][parseInt(i.toString(),10)][""+f.parent.idMapping]&&(t.level=f.parent[a][parseInt(i.toString(),10)].level+1,delete(r=f.parent[a][parseInt(i.toString(),10)]).childRecords,t.parentItem=r,t.parentUniqueID=r.uniqueID);else f.parent.enableVirtualization?!t[""+f.parent.hasChildMapping]&&-1===f.parentItems.indexOf(t[""+f.parent.idMapping])||l&&!l[parseInt(e.toString(),10)]?(delete(r=C.extend({},g.record)).childRecords,t.parentItem=r,t.parentUniqueID=g.record.uniqueID):C.isNullOrUndefined(t[""+f.parent.parentIdMapping])?(t.level=0,"remoteExpand"===g.action&&(t.childRecords=[],t.childRecords=g.record.childRecords)):t.level=g.record.level:(t.level=g.record.level+1,delete(r=C.extend({},g.record)).childRecords,t.parentItem=r,t.parentUniqueID=g.record.uniqueID);if(t.index=Math.ceil(1e3*Math.random()),t.uniqueID=w.getUid(f.parent.element.id+"_data_"),g.record[""+f.parent.idMapping]===t[""+f.parent.idMapping]&&(g.record.uniqueID=t.uniqueID),t.checkboxState="uncheck",f.parent.enableVirtualization&&C.isNullOrUndefined(t.level))for(var n=0;n<f.parent.grid.currentViewData.length;n++)f.parent.grid.currentViewData[parseInt(n.toString(),10)][""+f.parent.idMapping]===t[""+f.parent.parentIdMapping]&&(t.level=f.parent.grid.currentViewData[parseInt(n.toString(),10)].level+1);if(C.setValue("uniqueIDCollection."+t.uniqueID,t,f.parent),(t[""+f.parent.hasChildMapping]||-1!==f.parentItems.indexOf(t[""+f.parent.idMapping]))&&(!l||l[parseInt(e.toString(),10)]))if(t.hasChildRecords=!0,f.parent.enableVirtualization&&!f.parent.loadChildOnDemand){for(i=0;i<f.parent[s].length;i++)t[""+f.parent.idMapping]===f.parent[s][parseInt(i.toString(),10)][""+f.parent.idMapping]&&(t.expanded=f.parent[s][parseInt(i.toString(),10)].expanded);if("collapse"===g.action&&t[""+f.parent.idMapping]!==g.record[""+f.parent.idMapping]&&!1!==t.expanded)t.expanded=!0;else if("collapse"===g.action&&t[""+f.parent.idMapping]===g.record[""+f.parent.idMapping])t.expanded=!1,f.parent[s].push(g.record);else if("remoteExpand"===g.action){for(i=0;i<f.parent.grid.currentViewData.length;i++)f.parent.grid.currentViewData[parseInt(i.toString(),10)][""+f.parent.idMapping]===t[""+f.parent.idMapping]&&p.splice(e,1,f.parent.grid.currentViewData[parseInt(i.toString(),10)]);if(t[f.parent.idMapping]===g.record[""+f.parent.idMapping])for(i=0;i<f.parent[s].length;i++)g.record[""+f.parent.idMapping]===f.parent[s][parseInt(i.toString(),10)][""+f.parent.idMapping]&&f.parent[s].splice(i,1);!1!==t.expanded&&(t.expanded=!0)}}else f.parent.enableVirtualization&&t[""+f.parent.idMapping]===g.record[""+f.parent.idMapping]&&"collapse"!==g.action?t.expanded=!0:f.parent.enableVirtualization&&!f.parent.loadChildOnDemand||(t.expanded=!1);d.some(function(e){return e[""+f.parent.idMapping]===t[f.parent.idMapping]})||d.splice(o+e+1,0,t)}(n);var h=f.parent.idMapping,c=(f.parent.enableVirtualization&&f.parent.loadChildOnDemand&&d.sort(function(e,t){return e[""+h]-t[""+h]}),C.setValue("result",d,e),C.setValue("action","beforecontentrender",e),f.parent.trigger(Ce,e),B.hideSpinner(f.parent.element),0<f.parent.grid.aggregates.length&&!f.parent.enableVirtualization&&(c=w.getObject("query",e),C.isNullOrUndefined(c)&&(c=C.getValue("grid.renderModule.data",f.parent).aggregateQuery(new b.Query)),C.isNullOrUndefined(c)||(c=c.queries.filter(function(e){return"onAggregates"===e.fn}),e.result=f.parent.summaryModule.calculateSummaryValue(c,e.result,!0))),"remoteExpand"===g.action&&f.parent.allowPaging&&"All"===f.parent.pageSettings.pageSizeMode&&(f.parent.grid.pageSettings.totalRecordsCount=f.parent.grid.pageSettings.totalRecordsCount+p.length),f.parent.enableVirtualization&&(f.parent.grid.pageSettings.totalRecordsCount=e.count),e.count=f.parent.grid.pageSettings.totalRecordsCount,{}),u=(f.parent.enableVirtualization&&f.remoteVirtualAction(c),{index:o,childData:p});f.parent.enableInfiniteScrolling?f.parent.notify("infinite-remote-expand",u):C.getValue("grid.renderModule",f.parent).dataManagerSuccess(e,c),f.parent.trigger(Ue,m)})},o.prototype.remoteVirtualAction=function(e){e.requestType="refresh",C.setValue("isExpandCollapse",!0,e);var e=C.getValue("grid.contentModule",this.parent),t=C.getValue("currentInfo",e),e=C.getValue("prevInfo",e);t.loadNext&&this.parent.grid.pageSettings.currentPage===t.nextInfo.page&&!this.parent.loadChildOnDemand&&(this.parent.grid.pageSettings.currentPage=e.page)},o.prototype.beginSorting=function(){var e;this.isSortAction=!0,I(this.parent)&&this.parent.enableVirtualization&&(-1!==(e=this.parent.query.queries.indexOf(this.parent.query.queries.filter(function(e){return"onSortBy"===e.fn})[0]))&&this.parent.query.queries.splice(e,1),0===this.parent.grid.sortSettings.columns.length)&&this.parent.query.sortBy(null,null)},o.prototype.createRecords=function(e,t){for(var i=[],r=0,n=Object.keys(e).length;r<n;r++){var o=C.extend({},e[parseInt(r.toString(),10)]),a=(o.taskData=e[parseInt(r.toString(),10)],0),s=(this.storedIndex++,Object.prototype.hasOwnProperty.call(o,"index")||(o.index=this.storedIndex),o[this.parent.childMapping]),d=!C.isNullOrUndefined(s)&&0<s.length,l=R(this.parent),p=o[this.parent.hasChildMapping],h=(o.hasChildRecords=!!(d&&!l||p&&l),(!C.isNullOrUndefined(s)&&!l||p&&l)&&(this.parent.enableCollapseAll||!C.isNullOrUndefined(this.parent.dataStateChange)&&C.isNullOrUndefined(s)?o.expanded=!1:o.expanded=!!C.isNullOrUndefined(o[this.parent.expandStateMapping])||o[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(o,"index")||(o.index=(o.hasChildRecords,this.storedIndex)),this.isSelfReference&&C.isNullOrUndefined(o[this.parent.parentIdMapping])&&this.parent.parentData.push(o),o.uniqueID=w.getUid(this.parent.element.id+"_data_"),this.parent.uniqueIDCollection[o.uniqueID]=o,C.isNullOrUndefined(t)||(delete(d=C.extend({},t)).childRecords,delete d[this.parent.childMapping],this.isSelfReference&&delete d.taskData[this.parent.childMapping],o.parentItem=d,o.parentUniqueID=d.uniqueID,a=t.level+1),Object.prototype.hasOwnProperty.call(o,"level")||(o.level=a),o.checkboxState="uncheck","remoteCollapsedData");if(this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&I(this.parent)&&!this.parent.initialRender){if(!o.hasChildRecords&&C.isNullOrUndefined(o[""+this.parent.parentIdMapping])){o.hasChildRecords=!0;for(var c=0;c<this.parent[h].length;c++)this.parent[h][parseInt(c.toString(),10)][""+this.parent.idMapping]===o[""+this.parent.idMapping]&&(o.expanded=!1)}else 0===o.level&&C.isNullOrUndefined(t)&&!o.hasChildRecords&&(o.level=o.level+1);o[""+this.parent.hasChildMapping]&&!C.isNullOrUndefined(o[""+this.parent.expandStateMapping])&&(o.expanded=o[""+this.parent.expandStateMapping],o.hasChildRecords=!0),this.parent.flatData.push(o)}else(C.isNullOrUndefined(o[""+this.parent.parentIdMapping])||o.parentItem)&&(!C.isNullOrUndefined(this.parent.rowDropSettings.targetID)&&this.parent.rowDragAndDropModule.isDuplicateData(o)||this.parent.flatData.push(o),this.parent.infiniteScrollData.push(o));this.isSelfReference||0!==o.level||this.parent.parentData.push(o),C.isNullOrUndefined(o[this.parent.childMapping]&&o[this.parent.childMapping].length)||(p=this.createRecords(o[this.parent.childMapping],o),o.childRecords=p),i.push(o)}return i},o.prototype.dataProcessor=function(e){var t=w.getObject("isExport",e),i=w.getObject("expresults",e),r=w.getObject("exportType",e),n=w.getObject("isPrinting",e),o=w.getObject("actionArgs",e),a=w.getObject("requestType",e),s=w.getObject("data",e),d=w.getObject("action",e),l=o,p=this.parent.getPrimaryKeyFieldNames()[0],h=w.getObject("data",l),l=(C.isNullOrUndefined(l)||C.isNullOrUndefined(l.action)||"add"!==l.action||C.isNullOrUndefined(l.data)||!C.isNullOrUndefined(l.data[""+p])||(l.data[""+p]=e.result[l.index][""+p],h.taskData[""+p]=e.result[l.index][""+p]),(!C.isNullOrUndefined(o)&&Object.keys(o).length||"save"===a)&&(a=a||o.requestType,s=s||w.getObject("data",o),d=d||w.getObject("action",o),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData)&&this.updateAction(s,d,a),(h=t&&!C.isNullOrUndefined(i)?i:R(this.parent)?C.getValue("result",this.parent.grid.dataSource):this.parent.grid.dataSource)instanceof b.DataManager?h.dataSource.json:h),p=(R(this.parent)?C.getValue("count",this.parent.dataSource):l.length,new b.Query),o=w.getObject("query",e);if(C.isNullOrUndefined(o)||(S=o.queries.filter(function(e){return"onWhere"===e.fn}),m=o.queries.filter(function(e){return"onSearch"===e.fn})),(this.parent.grid.allowFiltering&&this.parent.grid.filterSettings.columns.length||0<this.parent.grid.searchSettings.key.length||!C.isNullOrUndefined(o)&&(S.length||m.length)&&this.parent.isLocalData)&&(C.isNullOrUndefined(o)&&(o=new b.Query,o=C.getValue("grid.renderModule.data",this.parent).filterQuery(o),o=C.getValue("grid.renderModule.data",this.parent).searchQuery(o)),s=o.queries.filter(function(e){return"onWhere"===e.fn}),d=o.queries.filter(function(e){return"onSearch"===e.fn}),p.queries=s.concat(d),a=new b.DataManager(l).executeLocal(p),this.parent.notify("updateFilterRecs",{data:a}),l=this.dataResults.result,this.dataResults.result=null,0<this.parent.grid.aggregates.length)&&(c=w.getObject("query",e),C.isNullOrUndefined(o)&&(o=C.getValue("grid.renderModule.data",this.parent).aggregateQuery(new b.Query)),C.isNullOrUndefined(c)||(y=c.queries.filter(function(e){return"onAggregates"===e.fn}),l=this.parent.summaryModule.calculateSummaryValue(y,l,!0))),this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(i=w.getObject("query",e),y=(i=C.isNullOrUndefined(i)?C.getValue("grid.renderModule.data",this.parent).aggregateQuery(new b.Query):i).queries.filter(function(e){return"onAggregates"===e.fn}),l=this.parent.summaryModule.calculateSummaryValue(y,this.parent.flatData,!0)),0<this.parent.grid.sortSettings.columns.length||this.isSortAction){this.isSortAction=!1;for(var h=this.parent.parentData,c=w.getObject("query",e),u=new b.Query,g=this.parent.grid.sortSettings.columns.length-1;0<=g;g--){var f=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].field),f=f.sortComparer&&x(this.parent)?f.sortComparer.bind(f):this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].direction;u.sortBy(this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].field,f)}var m,y,S=new b.DataManager(h).executeLocal(u),d=(this.parent.allowRowDragAndDrop&&!C.isNullOrUndefined(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition&&(m=S.indexOf(this.parent.rowDragAndDropModule.draggedRecord),S.splice(m,1),s=S.indexOf(this.parent.rowDragAndDropModule.droppedRecord),this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?S.splice(s,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&S.splice(s+1,0,this.parent.rowDragAndDropModule.draggedRecord)),{modifiedData:S,filteredData:l,srtQry:u});this.parent.notify("createSort",d),l=d.modifiedData,this.dataResults.result=null,this.sortedData=l,this.parent.notify("updateModel",{}),0<this.parent.grid.aggregates.length&&!C.isNullOrUndefined(c)&&(y=w.getObject("query",e).queries.filter(function(e){return"onAggregates"===e.fn}),l=this.parent.summaryModule.calculateSummaryValue(y,this.sortedData,!1))}p=R(this.parent)?C.getValue("count",this.parent.dataSource):l.length,a=this.paging(l,p,t,n,r,e);l=a.result,p=a.count,e.result=l,e.count=p,this.parent.notify("updateResults",e)},o.prototype.paging=function(e,t,i,r,n,o){!this.parent.allowPaging||i&&"CurrentPage"!==n||r&&"CurrentPage"!==this.parent.printMode?!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||i&&"CurrentPage"!==n||"save"===C.getValue("requestType",o)||(i=this.parent.enableInfiniteScrolling?o:C.getValue("actionArgs",o),this.parent.notify(ze,{result:e,count:t,actionArgs:i}),e=this.dataResults.result,t=this.dataResults.count):(this.parent.notify(ze,{result:e,count:t,actionArgs:o}),e=this.dataResults.result,t=R(this.parent)?C.getValue("count",this.parent.dataSource):this.dataResults.count);n="isCollapsedStatePersist";if((!0===r||o.isPdfExport&&(C.isNullOrUndefined(o[n])||o[n]))&&"AllPages"===this.parent.printMode){for(var a=[],s=0;s<e.length;s++)y(this.parent,e[parseInt(s.toString(),10)],this.parent.parentData)&&a.push(e[parseInt(s.toString(),10)]);t=(e=a).length}return{result:e,count:t}},o.prototype.updateData=function(e){this.dataResults=e},o.prototype.updateAction=function(e,t,i){"delete"!==i&&"save"!==i||this.parent.notify(Ge,{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify(nt,{})};var Kt=o;function o(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!C.isNullOrUndefined(this.parent.parentIdMapping)}(n=r.ToolbarItem||(r.ToolbarItem={}))[n.Add=0]="Add",n[n.Edit=1]="Edit",n[n.Update=2]="Update",n[n.Delete=3]="Delete",n[n.Cancel=4]="Cancel",n[n.Search=5]="Search",n[n.ExpandAll=6]="ExpandAll",n[n.CollapseAll=7]="CollapseAll",n[n.ExcelExport=8]="ExcelExport",n[n.PdfExport=9]="PdfExport",n[n.CsvExport=10]="CsvExport",n[n.Print=11]="Print",n[n.RowIndent=12]="RowIndent",n[n.RowOutdent=13]="RowOutdent",(n=r.ContextMenuItems||(r.ContextMenuItems={}))[n.AutoFit=0]="AutoFit",n[n.AutoFitAll=1]="AutoFitAll",n[n.SortAscending=2]="SortAscending",n[n.SortDescending=3]="SortDescending",n[n.Edit=4]="Edit",n[n.Delete=5]="Delete",n[n.Save=6]="Save",n[n.Cancel=7]="Cancel",n[n.PdfExport=8]="PdfExport",n[n.ExcelExport=9]="ExcelExport",n[n.CsvExport=10]="CsvExport",n[n.FirstPage=11]="FirstPage",n[n.PrevPage=12]="PrevPage",n[n.LastPage=13]="LastPage",n[n.NextPage=14]="NextPage",n[n.AddRow=15]="AddRow",n[n.RowIndent=16]="RowIndent",n[n.RowOutdent=17]="RowOutdent";Wt=function(e,t){return(Wt=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])}))(e,t)};var Wt,Yt,n=function(e,t){function i(){this.constructor=e}Wt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},a=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},n=(Yt=C.ChildProperty,n(Jt,Yt),a([C.Property(12)],Jt.prototype,"pageSize",void 0),a([C.Property(8)],Jt.prototype,"pageCount",void 0),a([C.Property(1)],Jt.prototype,"currentPage",void 0),a([C.Property()],Jt.prototype,"totalRecordsCount",void 0),a([C.Property(!1)],Jt.prototype,"enableQueryString",void 0),a([C.Property(!1)],Jt.prototype,"pageSizes",void 0),a([C.Property(null)],Jt.prototype,"template",void 0),a([C.Property("All")],Jt.prototype,"pageSizeMode",void 0),Jt);function Jt(){return null!==Yt&&Yt.apply(this,arguments)||this}Xt=function(e,t){return(Xt=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])}))(e,t)};var Xt,$t,a=function(e,t){function i(){this.constructor=e}Xt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},s=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Zt=($t=C.ChildProperty,a(d,$t),d.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},d.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},d.prototype.getFormatter=function(){return this.formatFn},d.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[C.getEnumValue(w.CellType,w.CellType.Summary)]={fn:C.compile(this.footerTemplate,e),property:"footerTemplate"})},d.prototype.getTemplate=function(e){return this.templateFn[C.getEnumValue(w.CellType,e)]},d.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},s([C.Property()],d.prototype,"type",void 0),s([C.Property()],d.prototype,"footerTemplate",void 0),s([C.Property()],d.prototype,"field",void 0),s([C.Property()],d.prototype,"format",void 0),s([C.Property()],d.prototype,"columnName",void 0),s([C.Property()],d.prototype,"customAggregate",void 0),d);function d(){var e=null!==$t&&$t.apply(this,arguments)||this;return e.intl=new C.Internationalization,e.templateFn={},e}ei=C.ChildProperty,a(ti,ei),s([C.Collection([],Zt)],ti.prototype,"columns",void 0),s([C.Property(!0)],ti.prototype,"showChildSummary",void 0);var ei,a=ti;function ti(){return null!==ei&&ei.apply(this,arguments)||this}ii=function(e,t){return(ii=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])}))(e,t)};var ii,ri,s=function(e,t){function i(){this.constructor=e}ii(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},s=(ri=C.ChildProperty,s(p,ri),l([C.Property(!1)],p.prototype,"allowAdding",void 0),l([C.Property(!1)],p.prototype,"allowEditing",void 0),l([C.Property(!1)],p.prototype,"allowDeleting",void 0),l([C.Property("Cell")],p.prototype,"mode",void 0),l([C.Property("Top")],p.prototype,"newRowPosition",void 0),l([C.Property(!0)],p.prototype,"allowEditOnDblClick",void 0),l([C.Property(!0)],p.prototype,"showConfirmDialog",void 0),l([C.Property(!1)],p.prototype,"showDeleteConfirmDialog",void 0),l([C.Property("")],p.prototype,"template",void 0),l([C.Property({})],p.prototype,"dialog",void 0),l([C.Property(!1)],p.prototype,"allowNextRowEdit",void 0),p);function p(){return null!==ri&&ri.apply(this,arguments)||this}ni=function(e,t){return(ni=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])}))(e,t)};var ni,oi,l=function(e,t){function i(){this.constructor=e}ni(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ai=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},si=(oi=C.ChildProperty,l(di,oi),ai([C.Property()],di.prototype,"field",void 0),ai([C.Property()],di.prototype,"direction",void 0),di);function di(){return null!==oi&&oi.apply(this,arguments)||this}li=C.ChildProperty,l(pi,li),ai([C.Collection([],si)],pi.prototype,"columns",void 0),ai([C.Property(!0)],pi.prototype,"allowUnsort",void 0);var li,l=pi;function pi(){return null!==li&&li.apply(this,arguments)||this}function hi(e,o,a,s,t,d,i){var l,p,r=e.value,h=e.action,c=o.grid.getPrimaryKeyFieldNames()[0],u=o.dataSource instanceof b.DataManager?o.dataSource.dataSource.json:o.dataSource,g=o.grid.dataSource,f=[],m=r,n=!1;if("Batch"===o.editSettings.mode&&(p=o.grid.editModule.getBatchChanges()),("add"===h||"batchsave"===h&&"Batch"===o.editSettings.mode&&p.addedRecords.length)&&(r=(e=function(e,t,i,r,n,o){var a,s=!1,d=i.grid.getCurrentViewRecords();switch(a=Ut(a=C.extend({},e.value)),i.editSettings.newRowPosition){case"Top":t.unshift(a),s=!0;break;case"Bottom":t.push(a),s=!0;break;case"Above":a=C.isNullOrUndefined(o)?0===d.length?Ut(a):Ut(a=C.extend({},d[r+1])):Ut(a=C.extend({},o));break;case"Below":case"Child":var l,p;C.isNullOrUndefined(o)?(l=i.grid.getPrimaryKeyFieldNames()[0],p=0<d.length?d[parseInt(r.toString(),10)]:[],a=Ut(a=!C.isNullOrUndefined(p)&&p[""+l]===e.value[""+l]||-1!==n&&0!==t.length?C.extend({},p):C.extend({},e.value)),i.editModule.internalProperties.taskData=a):a=Ut(a=C.extend({},o)),-1===n&&(t.unshift(a),s=!0)}return{value:a,isSkip:s}}(e,u,o,s,t,i)).value,n=e.isSkip),r instanceof Array?f=D(r):f.push(C.extend({},r)),!n&&("add"!==h||"Top"!==o.editSettings.newRowPosition&&"Bottom"!==o.editSettings.newRowPosition))for(var y=0;y<f.length;y++){"object"==typeof f[parseInt(y.toString(),10)][""+c]&&(f[parseInt(y.toString(),10)]=f[parseInt(y.toString(),10)][""+c]);for(var S=f[parseInt(y.toString(),10)].taskData?Object.keys(f[parseInt(y.toString(),10)].taskData):Object.keys(f[parseInt(y.toString(),10)]),w=(0===u.length&&1===g.length?g:u).length,I=function(){if(0===u.length&&1===g.length&&g[parseInt(w.toString(),10)][""+c]===f[parseInt(y.toString(),10)][""+c]||u[parseInt(w.toString(),10)][""+c]===f[parseInt(y.toString(),10)][""+c]){if("delete"!==h){var e;if("edit"===h)for(l=0;l<S.length;l++)Object.prototype.hasOwnProperty.call(u[parseInt(w.toString(),10)],S[parseInt(l.toString(),10)])&&("Cell"!==o.editSettings.mode||!C.isNullOrUndefined(p)&&0===p.changedRecords.length||S[parseInt(l.toString(),10)]===d)&&(e=M(o,f[parseInt(y.toString(),10)].uniqueID),u[parseInt(w.toString(),10)][S[parseInt(l.toString(),10)]]=f[parseInt(y.toString(),10)][S[parseInt(l.toString(),10)]],e)&&e.taskData&&(e.taskData[S[parseInt(l.toString(),10)]]=e[S[parseInt(l.toString(),10)]]=u[parseInt(w.toString(),10)][S[parseInt(l.toString(),10)]]);else"add"!==h&&"batchsave"!==h||("Child"===o.editSettings.newRowPosition?0===u.length&&1===g.length?u.push(m.taskData):a?(m.taskData[""+o.parentIdMapping]=u[parseInt(w.toString(),10)][""+o.idMapping],u.splice(w+1,0,m.taskData)):(Object.prototype.hasOwnProperty.call(u[parseInt(w.toString(),10)],o.childMapping)||(u[parseInt(w.toString(),10)][""+o.childMapping]=[]),u[parseInt(w.toString(),10)][""+o.childMapping].push(m.taskData),O(c,u[parseInt(w.toString(),10)],h,o,a,m)):"Below"===o.editSettings.newRowPosition?(u.splice(w+1,0,m.taskData),C.isNullOrUndefined(m.parentItem)||O(c,u[w+1],h,o,a,m)):s?"Above"===o.editSettings.newRowPosition&&(u.splice(w,0,m.taskData),C.isNullOrUndefined(m.parentItem)||O(c,u[parseInt(w.toString(),10)],h,o,a,m)):u.splice(0,0,m.taskData));return"break"}var t=u[parseInt(w.toString(),10)];if(u.splice(w,1),a){if(!C.isNullOrUndefined(t[""+o.parentIdMapping]))for(var i=o.flatData.filter(function(e){return e[""+o.idMapping]===t[""+o.parentIdMapping]})[0],r=i?i[""+o.childMapping]:[],n=r.length-1;0<=n;n--)if(r[parseInt(n.toString(),10)][""+o.idMapping]===t[""+o.idMapping]){o.enableImmutableMode||i.childRecords.length!==i.Children.length||i.childRecords.splice(n,1),r.splice(n,1),r.length||(i.hasChildRecords=!1,O(c,i,h,o,a));break}return"break"}}else!C.isNullOrUndefined(u[parseInt(w.toString(),10)][""+o.childMapping])&&function e(t,i,r,n,o,a,s,d){var l=!1;var p=t.length;for(;p--&&0<=p;)if(t[parseInt(p.toString(),10)][""+n]===i[""+n]||a&&t[parseInt(p.toString(),10)][o.parentIdMapping]===i[o.idMapping]){if("edit"===r){for(var h,c=Object.keys(i),u=M(o,i.uniqueID),g=0;g<c.length;g++)!Object.prototype.hasOwnProperty.call(t[parseInt(p.toString(),10)],c[parseInt(g.toString(),10)])||"Cell"===o.editSettings.mode&&c[parseInt(g.toString(),10)]!==d||(u[c[parseInt(g.toString(),10)]]=u.taskData[c[parseInt(g.toString(),10)]]=t[parseInt(p.toString(),10)][c[parseInt(g.toString(),10)]]=i[c[parseInt(g.toString(),10)]],"Normal"!==o.grid.editSettings.mode)||"Cell"!==o.editSettings.mode||C.isNullOrUndefined(o.grid.editModule)||(h="editModule",o.grid.editModule[h].editRowIndex=i.index,o.grid.editModule[h].updateCurrentViewData(i));break}"add"===r||"batchsave"===r?"Child"===o.editSettings.newRowPosition?(a?(s[""+o.parentIdMapping]=t[parseInt(p.toString(),10)][o.idMapping],t.splice(p+1,0,s)):(Object.prototype.hasOwnProperty.call(t[parseInt(p.toString(),10)],o.childMapping)||(t[parseInt(p.toString(),10)][o.childMapping]=[]),t[parseInt(p.toString(),10)][o.childMapping].push(s.taskData)),O(n,t[parseInt(p.toString(),10)],r,o,a,s)):"Above"===o.editSettings.newRowPosition?(t.splice(p,0,s.taskData),C.isNullOrUndefined(s.parentItem)||O(n,t[parseInt(p.toString(),10)],r,o,a,s)):"Below"===o.editSettings.newRowPosition&&(t.splice(p+1,0,s.taskData),C.isNullOrUndefined(s.parentItem)||O(n,t[parseInt(p.toString(),10)],r,o,a,s)):(t.splice(p,1),t.length||(l=!0))}else C.isNullOrUndefined(t[parseInt(p.toString(),10)][o.childMapping])||e(t[parseInt(p.toString(),10)][o.childMapping],i,r,n,o,a,s,d)&&O(n,t[parseInt(p.toString(),10)],r,o,a);return l}(u[parseInt(w.toString(),10)][""+o.childMapping],f[parseInt(y.toString(),10)],h,c,o,a,m,d)&&O(c,u[parseInt(w.toString(),10)],h,o,a)};w--&&0<=w;)if("break"===I())break}}function O(i,r,e,t,n,o){if("Above"!==t.editSettings.newRowPosition&&"Below"!==t.editSettings.newRowPosition||"add"!==e&&"batchsave"!==e||C.isNullOrUndefined(o.parentItem)){for(var a,s=t.grid.getCurrentViewRecords(),d=(s.map(function(e,t){e[""+i]===r[""+i]&&(a=t)}),t.enableVirtualization&&C.isNullOrUndefined(a)&&(h=C.getValue("uniqueIDCollection."+o.parentUniqueID,t),r=h),C.isNullOrUndefined(a)||(r=s[parseInt(a.toString(),10)]),t.enableVirtualization&&C.isNullOrUndefined(r)&&!C.isNullOrUndefined(o)&&(r=C.getValue("uniqueIDCollection."+o.parentUniqueID,t)),n||C.isNullOrUndefined(r.childRecords)||!r.childRecords.length?r.hasChildRecords=!1:r.hasChildRecords=!0,"add"!==e&&"batchsave"!==e||(r.expanded=!0,r.hasChildRecords=!0,h=(o=t.sortSettings.columns.length&&C.isNullOrUndefined(o)?s.filter(function(e){return e.parentUniqueID===r.uniqueID?e:null}):o)?o instanceof Array?o[0]:o:s[a+1],"Below"!==t.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(r,"childRecords")?C.isNullOrUndefined(o)||r[""+i]===o[""+i]||r.childRecords.some(function(e){return e.uniqueID===o.uniqueID})||r.childRecords.push(o):r.childRecords=[],-1===r.childRecords.indexOf(h)&&r[""+i]!==o[""+i]&&r.childRecords.unshift(h),n)&&(Object.prototype.hasOwnProperty.call(r,t.childMapping)||(r[t.childMapping]=[]),-1===r[""+t.childMapping].indexOf(h))&&r[""+i]!==o[""+i]&&r[t.childMapping].unshift(h)),t.grid.getPrimaryKeyFieldNames()[0]),l=t.grid.dataSource instanceof b.DataManager?t.grid.dataSource.dataSource.json:t.grid.dataSource,p=0;p<l.length;p++)if(l[parseInt(p.toString(),10)][""+d]===r[""+d]){l[parseInt(p.toString(),10)]=r;break}t.grid.setRowData(i,r);var h,s=t.getRowByIndex(a),n=("Batch"===t.editSettings.mode&&(s="add"===e?t.getRows()[t.grid.getCurrentViewRecords().indexOf(r)]:t.getRows()[t.grid.getRowIndexByPrimaryKey(r[""+i])]),void 0);(t.frozenRows||t.getFrozenColumns())&&(n=t.getRowByIndex(a)),(t.enableVirtualization||C.isNullOrUndefined(s))&&C.isNullOrUndefined(n)||(h=t.treeColumnIndex,t.allowRowDragAndDrop&&t.enableImmutableMode&&(h+=1),t.renderModule.cellRender({data:r,cell:s.cells[parseInt(h.toString(),10)]?s.cells[parseInt(h.toString(),10)]:n.cells[h-t.getFrozenColumns()],column:t.grid.getColumns()[t.treeColumnIndex],requestType:e}),(t.enableImmutableMode&&"indenting"===t.action||"outdenting"===t.action)&&t.renderModule.RowModifier({data:r,row:s}))}else M(t,o.parentItem.uniqueID).childRecords.push(o)}ci=function(e,t){return(ci=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])}))(e,t)};var ci,ui,ai=function(e,t){function i(){this.constructor=e}ci(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},gi=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},ai=(ui=C.ChildProperty,ai(fi,ui),gi([C.Property(!1)],fi.prototype,"enableCache",void 0),gi([C.Property(3)],fi.prototype,"maxBlocks",void 0),gi([C.Property(3)],fi.prototype,"initialBlocks",void 0),fi);function fi(){return null!==ui&&ui.apply(this,arguments)||this}mi=function(e,t){return(mi=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])}))(e,t)};var mi,yi,gi=function(e,t){function i(){this.constructor=e}mi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Si=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},gi=(yi=C.ChildProperty,gi(wi,yi),Si([C.Property("startsWith")],wi.prototype,"operator",void 0),Si([C.Property(!1)],wi.prototype,"ignoreAccent",void 0),Si([C.Property(null)],wi.prototype,"headerTemplate",void 0),Si([C.Property(null)],wi.prototype,"template",void 0),Si([C.Property(null)],wi.prototype,"footerTemplate",void 0),Si([C.Property(!0)],wi.prototype,"enableSearching",void 0),Si([C.Property(null)],wi.prototype,"renderCustomColumnChooser",void 0),wi);function wi(){return null!==yi&&yi.apply(this,arguments)||this}Ii=function(e,t){return(Ii=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])}))(e,t)};var Ii,Ri,vi,Si=function(e,t){function i(){this.constructor=e}Ii(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Si=(Ri=C.Component,Si(c,Ri),(vi=c).prototype.excelExport=function(e,t,i,r){return this.allowExcelExport?this.excelExportModule.Map(e,t,i,r,!1):null},c.prototype.csvExport=function(e,t,i,r){return this.allowExcelExport?this.excelExportModule.Map(e,t,i,r,!0):null},c.prototype.pdfExport=function(e,t,i,r){return this.allowPdfExport?this.pdfExportModule.Map(e,t,i,r):null},c.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},c.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},c.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},c.prototype.exportTreeGrid=function(e){var t=this.grid.getDataModule().generateQuery(!0),t=(new b.UrlAdaptor).processQuery(new b.DataManager({url:""}),t),t=JSON.parse(t.data),i=JSON.parse(this.addOnPersist(["allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","columns","locale","searchSettings","idMapping","parentIdMapping","childMapping","treeColumnIndex"])),t=(i.filterSettings.columns=t.where,i.searchSettings.fields=t.search&&t.search[0].fields||[],i.sortSettings.columns=t.sorted,i.columns=this.setHeaderText(i.columns,["field","headerText","type","format","visible","template","index","width","textAlign","headerTextAlign","columns"]),this.createElement("form",{id:"ExportForm"})),r=(t.style.display="none",this.createElement("input",{id:"treeGridInput",attrs:{name:"treeGridModel"}}));r.value=JSON.stringify(i),t.method="POST",t.action=e,t.appendChild(r),document.body.appendChild(t),t.submit(),t.remove()},c.prototype.setHeaderText=function(e,t){for(var i=0;i<e.length;i++)for(var r=this.getColumnByUid(e[parseInt(i.toString(),10)].uid),n=(this.stackedHeader&&C.isNullOrUndefined(r)&&(r=C.isNullOrUndefined(e[parseInt(i.toString(),10)].field)?e[parseInt(i.toString(),10)]:this.getColumnByField(e[parseInt(i.toString(),10)].field)),e[parseInt(i.toString(),10)].headerText=r.headerText,C.isNullOrUndefined(r.template)||(e[parseInt(i.toString(),10)].template="true"),e[parseInt(i.toString(),10)].format&&(e[parseInt(i.toString(),10)].format=w.getNumberFormat(this.getFormat(r.format),r.type,!1,this.currencyCode),this.isExcel||"datetime"!==r.type&&"date"!==r.type||(e[parseInt(i.toString(),10)].format=e[parseInt(i.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(i.toString(),10)].type=r.type),e[parseInt(i.toString(),10)].columns&&this.setHeaderText(e[parseInt(i.toString(),10)].columns,t),Object.keys(e[parseInt(i.toString(),10)])),o=0;o<n.length;o++)t.indexOf(n[parseInt(o.toString(),10)])<0&&delete e[parseInt(i.toString(),10)][n[parseInt(o.toString(),10)]];return e},c.prototype.getFormat=function(e){return"object"==typeof e?C.isNullOrUndefined(e.format)?e.skeleton:e.format:e},c.prototype.getModuleName=function(){return"treegrid"},c.prototype.refreshLayout=function(){this.componentRefresh()},c.prototype.setProperties=function(e,t){Ri.prototype.setProperties.call(this,e,t)},c.prototype.preRender=function(){this.isComponentRefresh&&(this.grid=new w.Grid),this.TreeGridLocale(),this.initProperties(),this.defaultLocale={Above:"Above",Below:"Below",Child:"Child",AddRow:"Add Row",ExpandAll:"Expand All",CollapseAll:"Collapse All",RowIndent:"Indent",RowOutdent:"Outdent"},this.l10n=new C.L10n("treegrid",this.defaultLocale,this.locale),this.isSelfReference&&C.isNullOrUndefined(this.childMapping)&&(this.childMapping="Children")},c.prototype.sortByColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},c.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},c.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},c.prototype.search=function(e){this.grid.search(e)},c.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},c.prototype.reorderColumns=function(e,t){this.grid.reorderColumns(e,t)},c.prototype.TreeGridLocale=function(){var e,t,i;C.isNullOrUndefined(this.locale)||(i=C.L10n.locale,C.setValue(this.locale,{},e={}),t={},t=w.getObject(this.locale,i),i={},i=w.getObject(this.getModuleName(),t),C.setValue("grid",i,w.getObject(this.locale,e)),C.L10n.load(e))},c.prototype.print=function(){this.printModule.print()},c.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var t,i,r=void 0,n=void 0,o=void 0,a=void 0,s=void 0;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"ctrlShiftUpArrow":o=(r=e.target).closest(".e-rowcell"),C.isNullOrUndefined(o)||(a=o.closest("tr"),C.isNullOrUndefined(a))||C.isNullOrUndefined(a.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridexpand"));break;case"ctrlShiftDownArrow":o=(r=e.target).closest(".e-rowcell"),C.isNullOrUndefined(o)||(a=o.closest("tr"),C.isNullOrUndefined(a))||C.isNullOrUndefined(a.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridcollapse"));break;case"downArrow":!this.enableVirtualization&&C.isNullOrUndefined(this.rowTemplate)&&(r=e.target,C.isNullOrUndefined(r.querySelectorAll(".e-rowcell"))||(r=w.parentsUntil(r,"e-rowcell")),C.isNullOrUndefined(r)||(n=r.parentElement,C.isNullOrUndefined(n))||((i=n.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(i).editType&&C.isNullOrUndefined(this.grid.getColumnByIndex(i).edit.obj)&&(n=r),null!==(s=this.findnextRowElement(n))?(t=r.cellIndex,t=s.children[parseInt(t.toString(),10)],C.isNullOrUndefined(t)||this.grid.isEdit||(this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus").forEach(function(e){C.removeClass([e],["e-focused","e-focus"])}),C.addClass([t],["e-focused","e-focus"]))):(t=this.grid.getContent().querySelector(".e-table tbody"),n&&t&&n!==t.lastElementChild&&this.clearSelection())));break;case"upArrow":!this.enableVirtualization&&C.isNullOrUndefined(this.rowTemplate)&&(r=e.target,C.isNullOrUndefined(r.querySelectorAll(".e-rowcell"))||(r=w.parentsUntil(r,"e-rowcell")),C.isNullOrUndefined(r)||(n=r.parentElement,C.isNullOrUndefined(n))||((i=n.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(i).editType&&C.isNullOrUndefined(this.grid.getColumnByIndex(i).edit.obj)&&(n=r),null!==(s=this.findPreviousRowElement(n))?(t=r.cellIndex,C.isNullOrUndefined(t)||(i=s.children[parseInt(t.toString(),10)],C.isNullOrUndefined(i))||this.grid.isEdit||(this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus").forEach(function(e){C.removeClass([e],["e-focused","e-focus"])}),C.addClass([i],["e-focused","e-focus"]))):this.clearSelection()))}}},c.prototype.findnextRowElement=function(e){e=e.nextElementSibling;return e=null===e||-1===e.className.indexOf("e-summaryrow")&&!e.classList.contains("e-childrow-hidden")?e:this.findnextRowElement(e)},c.prototype.findPreviousRowElement=function(e){e=e.previousElementSibling;return e=null===e||-1===e.className.indexOf("e-summaryrow")&&!e.classList.contains("e-childrow-hidden")?e:this.findPreviousRowElement(e)},c.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!1,this.freezeColumnRefresh=!0,this.componentRefresh=C.Component.prototype.refresh,this.isComponentRefresh=!1,this.keyConfigs={ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",downArrow:"downArrow",upArrow:"upArrow"},this.isLocalData=!(this.dataSource instanceof b.DataManager)||this.dataSource.dataSource.offline||!C.isNullOrUndefined(this.dataSource.ready)||this.dataSource.adaptor instanceof b.RemoteSaveAdaptor,this.isSelfReference=!C.isNullOrUndefined(this.parentIdMapping)},c.prototype.wireEvents=function(){C.EventHandler.add(this.grid.element,"click",this.mouseClickHandler,this),C.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),this.keyboardModule=new C.KeyboardEvents(this.element,{keyAction:this.treeGridkeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex)},c.prototype.requiredModules=function(){var e,t=[],i="mergedColumns";return this[i]&&(this.grid[i]=this[i]),C.isNullOrUndefined(this.changedProperties.columns)&&this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed||(t.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),C.isNullOrUndefined(this.toolbar)||t.push({member:"toolbar",args:[this],name:"Toolbar"}),this.contextMenuItems&&t.push({member:"contextMenu",args:[this],name:"ContextMenu"}),this.allowPaging&&t.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowReordering&&t.push({member:"reorder",args:[this],name:"Reorder"}),this.allowSorting&&t.push({member:"sort",args:[this],name:"Sort"}),0<this.aggregates.length&&t.push({member:"summary",args:[this],name:"Aggregate"}),this.resizeCheck()&&t.push({member:"resize",args:[this],name:"Resize"}),this.allowExcelExport&&t.push({member:"ExcelExport",args:[this],name:"ExcelExport"}),i=this.injectedModules.filter(function(e){return"freeze"===e.prototype.getModuleName()}),e=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze}),(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||e)&&0<i.length&&t.push({member:"freeze",args:[this],name:"Freeze"}),this.detailTemplate&&t.push({member:"detailRow",args:[this],name:"DetailRow"}),this.allowPdfExport&&t.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.showColumnMenu&&t.push({member:"columnMenu",args:[this],name:"ColumnMenu"}),this.showColumnChooser&&t.push({member:"ColumnChooser",args:[this],name:"ColumnChooser"}),this.extendRequiredModules(t)),t},c.prototype.resizeCheck=function(){var e=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),t=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||e||t},c.prototype.extendRequiredModules=function(e){var t=this.injectedModules.filter(function(e){return"rowDragAndDrop"===e.prototype.getModuleName()});(this.allowRowDragAndDrop||t.length)&&(C.isNullOrUndefined(this.toolbar)||!this.toolbar.includes("Indent")&&!this.toolbar.includes("Outdent")||(this.isIndentEnabled=!0),e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"})),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this],name:"Edit"}),!C.isNullOrUndefined(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this],name:"CommandColumn"}),this.allowSelection&&e.push({member:"selection",args:[this],name:"Selection"}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this],name:"VirtualScroll"}),this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this],name:"InfiniteScroll"}),e.push({member:"logger",args:[this.grid]})},c.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},c.prototype.unwireEvents=function(){this.grid&&this.grid.element&&C.EventHandler.remove(this.grid.element,"click",this.mouseClickHandler),this.element&&(C.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.allowKeyboard)&&this.element.removeAttribute("tabIndex")},c.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},c.prototype.render=function(){var r=this,e=(this.isReact&&(this.grid.isReact=!0,this.grid.portals=[]),this.isVue&&(this.grid.isVue=!0,this.grid.vueInstance=this.vueInstance),B.createSpinner({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new Gt(this),this.dataModule=new Kt(this),this.printModule=new Tt(this),this.trigger(ye),this.autoGenerateColumns(),this.initialRender=!0,C.isNullOrUndefined(this.dataSource)||this.convertTreeData(this.dataSource),this.loadGrid(),this.element.classList.contains("e-treegrid")&&this.rowDropSettings.targetID&&(this.grid.rowDropSettings.targetID+="_gridcontrol"),this.addListener(),C.createElement("div",{id:this.element.id+"_gridcontrol",className:"e-treelistgrid"})),i=(C.addClass([this.element],"e-treegrid"),C.isNullOrUndefined(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),C.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.element.appendChild(e),this.grid.requiredModules),t=(this.grid.requiredModules=function(){for(var e=[],e=i.apply(this),t=0;t<e.length;t++)"virtualscroll"===e[parseInt(t.toString(),10)].member&&(e[parseInt(t.toString(),10)].member="treeVirtualScroll");return e},"root");this.grid[t]=this[t]||this,this.grid.appendTo(e),this.actionFailureHandler();this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var t=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table"),e=(C.isNullOrUndefined(t)||t.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.updateColumnModel(),this.wireEvents(),this.renderComplete(),"destroyTemplate"),n=this.grid[e];this.grid[e]=function(e,t,i){n.apply(r.grid);r.isReact&&C.isNullOrUndefined(r.portals)?C.isNullOrUndefined(i)||i():r.clearTemplate(e,t,i)}},c.prototype.actionFailureHandler=function(){var i,t=this,e=[],r=this.getPrimaryKeyFieldNames(),n=this.flatData.length,r=((this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&0===r.length&&0!==n&&e.push("For the CRUD actions, it is necessary to enable Primary Key field for the unique data column."),this.allowRowDragAndDrop&&0===r.length&&0!==n&&e.push("For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column."),this.allowPaging&&this.enableVirtualization&&e.push("Paging is not allowed in virtualization case."),0===n&&0===this.columns.length&&e.push("Either of the Data source or columns should be given."),0<this.frozenColumns&&this.columnModel.filter(function(e){return e.isFrozen})&&e.push("Use only one attribute for Frozen either IsFrozen or FrozenColumns."),this.enableVirtualization&&!C.isNullOrUndefined(this.detailTemplate)&&e.push("Virtual scrolling is not compatible with the detail template"),!(0<this.frozenColumns||0<this.frozenRows||this.columnModel.filter(function(e){return e.isFrozen}))||C.isNullOrUndefined(this.detailTemplate)&&C.isNullOrUndefined(this.rowTemplate)||e.push("Frozen rows and columns are not supported with the Detail template and row template."),(0<this.frozenColumns||0<this.columnModel.filter(function(e){return e.isFrozen}).length||0<this.frozenRows)&&"Cell"===this.editSettings.mode&&e.push("Frozen rows and columns are not supported with cell editing."),this.allowSelection&&!C.isNullOrUndefined(this.rowTemplate)&&e.push("Selection is not supported in RowTemplate"),this.allowExcelExport||"csvExport"!==this.action||e.push("CSV export is not allowed when allowExcelExport is disabled."),this.allowPdfExport||"pdfExport"!==this.action||e.push("PDF export is not allowed when allowPdfExport is disabled"),this.allowExcelExport||"excelExport"!==this.action||e.push("Excel export is not allowed when allowExcelExport is disabled."),this.treeColumnIndex>=this.columns.length&&e.push("TreeColumnIndex value should not exceed the total column count."),this.enableVirtualization&&(this.columnModel.some(function(e){return/%$/.test(e.width)})||/%$/.test(this.height.toString()))&&e.push("column width and height should be in pixels"),"Children"===this.childMapping||C.isNullOrUndefined(this.idMapping)||e.push("Both IdMapping and ChildMapping should not be used together for tree grid rendering."),(!C.isNullOrUndefined(this.idMapping)&&C.isNullOrUndefined(this.parentIdMapping)||C.isNullOrUndefined(this.idMapping)&&!C.isNullOrUndefined(this.parentIdMapping))&&e.push("IdMapping and ParentIdMapping properties should be defined and vice versa."),this.columnModel.filter(function(e){return e.showCheckbox})),n=this.columns[this.treeColumnIndex];0!==r.length&&(r!==n&&e.push("ShowCheckbox column should not be defined other than the tree column."),1<r.length)&&e.push("Only one column can have the ShowCheckbox option enabled."),null!==this.treeColumnIndex&&-1!==this.treeColumnIndex&&this.treeColumnIndex<this.columns.length&&0!==this.columnModel.filter(function(e){return"Right"===e.textAlign&&e.field===t.columnModel[t.treeColumnIndex].field}).length&&e.push("TextAlign right for the tree column is not applicable."),0<e.length&&(i={error:{}},e.forEach(function(e,t){i.error[parseInt(t.toString(),10)]=e}),this.trigger(Mt,i))},c.prototype.refreshToolbarItems=function(){var e=this.toolbarModule.getToolbar(),t=this.element.id+"_gridcontrol_indent",i=this.element.id+"_gridcontrol_outdent",t=e.querySelector("#"+t).parentElement,e=e.querySelector("#"+i).parentElement;t.classList.add("e-hidden"),e.classList.add("e-hidden")},c.prototype.afterGridRender=function(){C.isNullOrUndefined(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new Ot(this,this.grid.serviceLocator)},c.prototype.convertTreeData=function(e){if((e=R(this)?C.getValue("result",e):e)instanceof Array&&0<e.length&&Object.prototype.hasOwnProperty.call(e[0],"level")){this.flatData=e;for(var i=this,t=0,r=this.flatData.length;t<r;t++)!function(e){var t=i.flatData[parseInt(e.toString(),10)];C.setValue("uniqueIDCollection."+t.uniqueID,t,i),0!==t.level||i.parentData.some(function(e){return e.uniqueID===t.uniqueID})||i.parentData.push(t)}(t)}else{var n;R(this)?(n=C.getValue("result",this.dataSource),this.dataModule.convertToFlatData(n)):this.dataModule.convertToFlatData(e)}},c.prototype.bindGridProperties=function(){this.bindedDataSource(),this.grid.enableRtl=this.enableRtl,this.grid.allowKeyboard=this.allowKeyboard,this.grid.columns=this.getGridColumns(this.columns),this.grid.allowExcelExport=this.allowExcelExport,this.grid.allowPdfExport=this.allowPdfExport,this.grid.query=this.query,this.grid.columnQueryMode=this.columnQueryMode,this.grid.allowPaging=this.allowPaging,this.grid.pageSettings=w.getActualProperties(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,this.grid.allowMultiSorting=this.allowMultiSorting,this.grid.allowFiltering=this.allowFiltering,this.grid.enableVirtualization=this.enableVirtualization,this.grid.enableColumnVirtualization=this.enableColumnVirtualization,this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling,this.grid.infiniteScrollSettings=this.infiniteScrollSettings,this.grid.enableVirtualMaskRow=this.enableVirtualMaskRow,this.grid.loadingIndicator=this.loadingIndicator,this.grid.width=this.width,this.grid.height=this.height,this.grid.enableAltRow=this.enableAltRow,this.grid.allowReordering=this.allowReordering,this.grid.allowTextWrap=this.allowTextWrap,this.grid.allowResizing=this.allowResizing,this.grid.enableHover=this.enableHover,this.grid.enableAutoFill=this.enableAutoFill,this.grid.enableAdaptiveUI=this.enableAdaptiveUI,this.grid.enableImmutableMode=this.enableImmutableMode,this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop,this.grid.rowDropSettings=w.getActualProperties(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=w.getActualProperties(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.columnChooserSettings=this.columnChooserSettings,this.grid.filterSettings=w.getActualProperties(this.filterSettings),this.grid.selectionSettings=w.getActualProperties(this.selectionSettings),this.grid.sortSettings=w.getActualProperties(this.sortSettings),this.grid.searchSettings=w.getActualProperties(this.searchSettings),this.grid.aggregates=w.getActualProperties(this.aggregates),this.grid.textWrapSettings=w.getActualProperties(this.textWrapSettings),this.grid.printMode=w.getActualProperties(this.printMode),this.grid.locale=w.getActualProperties(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=w.getActualProperties(this.getContextMenu()),this.grid.columnMenuItems=w.getActualProperties(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=w.getActualProperties(this.rowTemplate),this.grid.detailTemplate=w.getActualProperties(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=w.getActualProperties(this.clipMode),this.grid.enableColumnSpan=this.enableColumnSpan,this.grid.enableRowSpan=this.enableRowSpan;var e="templateDotnetInstance";this.grid[e]=this[e],this.grid.isJsComponent=!0,this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer,this.grid.enableStickyHeader=this.enableStickyHeader,this.grid.emptyRecordTemplate=this.emptyRecordTemplate,this.grid.isRowSelectable=this.isRowSelectable;this.grid.isTreeGrid=!0},c.prototype.triggerEvents=function(e){this.trigger(w.getObject("name",e),e)},c.prototype.IsExpandCollapseClicked=function(e){this.isFromChartSide||C.isNullOrUndefined(e.target)||!(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-summarycell"))||this.selectionSettings.checkboxOnly||(!C.isNullOrUndefined(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&C.isNullOrUndefined(e.data))&&(e.cancel=!0)},c.prototype.bindGridEvents=function(){var r=this;this.grid.rowSelecting=function(e){r.IsExpandCollapseClicked(e),!C.isNullOrUndefined(e.data)&&r.selectionSettings.persistSelection&&0<r.columnModel.filter(function(e){return"checkbox"===e.type}).length&&I(r)&&(C.isNullOrUndefined(e.data.parentItem)&&!e.isHeaderCheckboxClicked||(r.parentQuery=r.query.queries.filter(function(e){return e.e.field===r.parentIdMapping}),r.query.queries=r.query.queries.slice(0,0))),"Root"===r.pageSettings.pageSizeMode&&(r.grid.selectionModule.totalRecordsCount=r.grid.currentViewData.length),e.cancel||r.trigger(be,e)},this.grid.rowDeselecting=function(e){r.IsExpandCollapseClicked(e),!C.isNullOrUndefined(e.data)&&r.selectionSettings.persistSelection&&0<r.columnModel.filter(function(e){return"checkbox"===e.type}).length&&I(r)&&(r.parentQuery=r.query.queries.filter(function(e){return e.e.field===r.parentIdMapping}),r.query.queries=r.query.queries.slice(0,0)),r.trigger(xt,e)},this.grid.rowSelected=function(e){r.enableVirtualization&&r.virtualScrollModule.updateSelection(e),r.selectedRowIndex=r.grid.selectedRowIndex,r.notify(De,e),r.trigger(De,e)},this.grid.rowDeselected=function(e){r.selectedRowIndex=r.grid.selectedRowIndex,C.isNullOrUndefined(e.data)||r.notify(Oe,e),r.trigger(Oe,e)},this.grid.resizeStop=function(e){r.updateColumnModel(),r.trigger(Ne,e)},this.grid.excelQueryCellInfo=function(e){r.notify("excelCellInfo",e),r.dataResults},this.grid.excelAggregateQueryCellInfo=function(e){r.notify("excelAggregateCellInfo",e),r.dataResults},this.grid.pdfAggregateQueryCellInfo=function(e){r.notify("pdfAggregateCellInfo",e),r.dataResults},this.grid.pdfQueryCellInfo=function(e){r.notify("pdfCellInfo",e),r.dataResults},this.grid.checkBoxChange=function(e){r.trigger(Me,e)},this.grid.pdfExportComplete=this.triggerEvents.bind(this),this.grid.excelExportComplete=this.triggerEvents.bind(this),this.grid.excelHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.pdfHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.dataSourceChanged=this.triggerEvents.bind(this),this.grid.recordDoubleClick=this.triggerEvents.bind(this),this.grid.cellDeselected=this.triggerEvents.bind(this),this.grid.cellDeselecting=this.triggerEvents.bind(this),this.grid.columnMenuOpen=this.triggerEvents.bind(this),this.grid.columnMenuClick=this.triggerEvents.bind(this),this.grid.cellSelected=this.triggerEvents.bind(this),this.grid.headerCellInfo=this.triggerEvents.bind(this),this.grid.resizeStart=this.triggerEvents.bind(this),this.grid.resizing=this.triggerEvents.bind(this),this.grid.columnDrag=this.triggerEvents.bind(this),this.grid.columnDragStart=this.triggerEvents.bind(this),this.grid.columnDrop=this.triggerEvents.bind(this),this.grid.beforePrint=this.triggerEvents.bind(this),this.grid.beforeCopy=this.triggerEvents.bind(this),this.grid.beforePaste=function(e){for(var t=r.getRows(),i="rowIndex";t[e[i]].classList.contains("e-summaryrow");)e[i]++;r.trigger(He,e)},this.grid.load=function(){r.grid.on("initial-end",r.afterGridRender,r),C.isNullOrUndefined(r.loggerModule)||(r.loggerModule=r.grid.loggerModule=new ce(r.grid))},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=function(e){r.trigger(Mt,e)},this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},c.prototype.lastRowBorder=function(e,t){for(var i=0;i<e.cells.length;i++)t?C.addClass([e.cells[parseInt(i.toString(),10)]],"e-lastrowcell"):C.removeClass([e.cells[parseInt(i.toString(),10)]],"e-lastrowcell")},c.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},c.prototype.extendedGridDataBoundEvent=function(){var a=this,r=(this.grid.dataBound=function(e){if(a.lastRowBorderEventListener(),a.updateRowTemplate(),a.updateColumnModel(),a.updateAltRow(a.getRows()),a.notify("dataBoundArg",e),!I(a)||x(a)||a.hasChildMapping||(t=void 0,t=a.dataResults.result?0:1,C.setValue("grid.contentModule.isLoaded",!(0<t),a)),a.isPixelHeight()&&a.initialRender)for(var t=a.getContentTable().rows,i=[].slice.call(t),r=i.length-1;0<r;r--)if(!kt(i[parseInt(r.toString(),10)])){i[parseInt(r.toString(),10)].nextElementSibling&&a.lastRowBorder(i[parseInt(r.toString(),10)],!0);break}if(a.enableVirtualization&&a.selectionSettings.persistSelection&&("expand"===a.dataResults.action||"collapse"===a.dataResults.action)&&(a.grid.selectionModule.refreshPersistSelection(),"Single"===a.grid.selectionSettings.type)&&(n="updateRowSelection",o=a.getCurrentViewRecords().indexOf(a.grid.selectionModule.data),a.grid.selectionModule[""+n](a.getRows()[parseInt(o.toString(),10)],o)),a.enableVirtualization&&a.selectionSettings.persistSelection&&!C.isNullOrUndefined(a.virtualScrollModule.prevSelectedRecord))for(r=0;r<a.virtualScrollModule.prevSelectedRecord.length;r++){var n="updateRowSelection",o=a.getCurrentViewRecords().indexOf(a.virtualScrollModule.prevSelectedRecord[parseInt(r.toString(),10)]);a.grid.selectionModule[""+n](a.getRows()[parseInt(o.toString(),10)],o)}a.trigger(we,e),a.initialRender=!1},this);this.grid.beforeDataBound=function(e){var t,i=w.getObject("action",e);if((I(r)&&!x(r)||R(this))&&"edit"!==i?(r.notify("updateRemoteLevel",e),e=r.dataResults):0===r.flatData.length&&x(r)&&r.dataSource instanceof b.DataManager&&(i=r.dataSource,r.dataModule.convertToFlatData(i.dataSource.json),e.result=r.grid.dataSource.dataSource.json=r.flatData),I(r)||R(this)||C.isNullOrUndefined(r.dataSource)||(this.isPrinting&&C.setValue("isPrinting",!0,e),r.notify("dataProcessor",e)),C.extend(e,r.dataResults),r.enableImmutableMode&&(e.result=e.result.slice()),r.initialRender&&(this.contentModule.objectEqualityChecker=r.objectEqualityChecker),!this.isPrinting)return t=new b.Deferred,r.trigger(Re,e,function(e){t.resolve(e)}),t},this.grid.log=function(e,t){a.loggerModule&&a.loggerModule.log(e,t)}},c.prototype.lastRowBorderEventListener=function(){this.grid.on("last-rowcell-border-updated",this.lastRowCellBorderUpdated,this)},c.prototype.bindCallBackEvents=function(){var r=this;this.grid.toolbarClick=function(t){var i;if(!(t.item.id===r.grid.element.id+"_excelexport"&&!1===r.allowExcelExport||t.item.id===r.grid.element.id+"_pdfexport"&&!1===r.allowPdfExport||t.item.id===r.grid.element.id+"_csvexport"&&!1===r.allowExcelExport))return i=new b.Deferred,r.trigger(Pe,t,function(e){e.cancel||r.notify(Pe,t),i.resolve(e)}),i},this.grid.cellSelecting=function(e){var t=r.grid.selectionModule.actualTarget,i=(C.isNullOrUndefined(t)||!t.classList.contains("e-treegridexpand")&&!t.classList.contains("e-treegridcollapse")||(e.cancel=!0),new b.Deferred);return r.trigger(w.getObject("name",e),e,function(e){i.resolve(e)}),i},this.grid.beginEdit=function(e){var t;if(C.isNullOrUndefined(e.row)||!e.row.classList.contains("e-summaryrow"))return t=new b.Deferred,r.trigger(Qe,e,function(e){t.resolve(e)}),t;e.cancel=!0}},c.prototype.extendedGridEditEvents=function(){var r=this;this.grid.dataStateChange=function(e){r.isExpandRefresh?(r.isExpandRefresh=!1,r.grid.dataSource={result:r.flatData,count:C.getValue("count",r.grid.dataSource)}):("infiniteScroll"!==e.action.requestType&&(r.infiniteScrollData=[]),r.trigger(xe,e))},this.grid.cellSave=function(e){r.grid.isContextMenuOpen()&&(t=r.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0],!C.isNullOrUndefined(t)&&t.id===r.element.id+"_gridcontrol_cmenu_Save"||(e.cancel=!0));var t,i=new b.Deferred;return r.trigger(Ye,e,function(e){e.cancel||r.notify(Ye,e),i.resolve(e)}),i},this.grid.cellSaved=function(e){r.trigger(Je,e),r.notify(Je,e)},this.grid.cellEdit=function(e){var t=new b.Deferred;return e.promise=t,r.notify(Xe,e),t},this.grid.batchAdd=function(e){r.trigger(et,e),r.notify(et,e)},this.grid.beforeBatchSave=function(e){r.trigger(rt,e),r.notify(rt,e)},this.grid.beforeBatchAdd=function(e){r.trigger(it,e),r.notify(it,e)},this.grid.batchDelete=function(e){r.trigger($e,e),r.notify($e,e)},this.grid.beforeBatchDelete=function(e){r.trigger(tt,e),r.notify(tt,e)},this.grid.batchCancel=function(e){"Cell"!==r.editSettings.mode&&r.trigger(Ze,e),r.notify(Ze,e)}},c.prototype.updateRowTemplate=function(){var n=this;this.rowTemplate&&(this.isReact&&0===this.getContentTable().rows.length?setTimeout(function(){if(n.treeColumnRowTemplate(),n.enableCollapseAll)for(var e=n.getCurrentViewRecords(),t=n.getContentTable().rows,i=0;i<t.length;i++){var r={data:e[parseInt(i.toString(),10)],row:t[parseInt(i.toString(),10)]};n.renderModule.RowModifier(r)}},0):this.treeColumnRowTemplate())},c.prototype.bindedDataSource=function(){var e,t,i,r="dataSource",n="ready";this.dataSource&&R(this)?(e=this.flatData,t=C.getValue("count",this.dataSource),this.grid.dataSource={result:e,count:t}):this.grid.dataSource=this.dataSource instanceof b.DataManager?new b.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0):this.flatData,this.dataSource instanceof b.DataManager&&(this.dataSource.dataSource.offline||this.dataSource.ready)&&(this.grid.dataSource[r].json=D(this.dataSource[r].json),this.grid.dataSource[n]=this.dataSource.ready,C.isNullOrUndefined((i=this).grid.dataSource[n])||this.grid.dataSource[n].then(function(e){var t=i.grid.dataSource;t[r].offline=!0,t.isDataAvailable=!0,t[r].json=e.result,t.adaptor=new b.JsonAdaptor}))},c.prototype.extendedGridActionEvents=function(){var n=this;this.grid.actionBegin=function(e){var t;if(!("sorting"===e.requestType&&e.target&&e.target.parentElement&&e.target.parentElement.classList.contains("e-hierarchycheckbox")))return"reorder"===w.getObject("requestType",e)&&n.notify("getColumnIndex",{}),I(n)&&n.enableVirtualization&&("virtualscroll"===e.requestType?(n.query.expand("VirtualScrollingAction"),n.showSpinner()):"searching"===e.requestType&&""===e.searchString?n.query.expand("ClearSearchingAction"):"clearFilter"===e.action&&n.query.expand("ClearFilteringAction")),n.notify("actionBegin",{editAction:e}),I(n)||C.isNullOrUndefined(n.filterModule)||R(n)||0!==n.grid.filterSettings.columns.length||0!==n.grid.searchSettings.key.length||(n.notify("clearFilters",{flatData:n.grid.dataSource}),n.grid.setProperties({dataSource:n.dataResults.result},!0),C.isNullOrUndefined(n.grid.changedProperties.dataSource)&&(n.grid.renderModule.data.dataManager=n.grid.dataSource instanceof b.DataManager?n.grid.dataSource:C.isNullOrUndefined(n.grid.dataSource)?new b.DataManager:new b.DataManager(n.grid.dataSource),n.grid.renderModule.data.isQueryInvokedFromData=!0,n.grid.query=n.grid.query instanceof b.Query?n.grid.query:new b.Query)),"indenting"!==n.action&&"outdenting"!==n.action?(t=new b.Deferred,n.trigger(ve,e,function(e){e.cancel||n.notify(Qe,e),t.resolve(e)}),t):void 0;e.cancel=!0},this.grid.actionComplete=function(e){var t,i,r;n.notify("actioncomplete",e),n.updateColumnModel(),n.updateTreeGridModel(),"reorder"===e.requestType&&n.notify("setColumnIndex",{}),n.notify("actionComplete",{editAction:e}),"add"===e.requestType&&"Top"!==n.editSettings.newRowPosition&&"Bottom"!==n.editSettings.newRowPosition&&n.notify(Ke,e),"batchsave"===e.requestType&&n.notify(nt,e),n.notify("updateGridActions",e),"save"===e.requestType&&n.aggregates.map(function(e){return!0===e.showChildSummary}).length&&n.grid.refresh(),"filter"!==e.action||e.isCollapseMaintain||""===n.filterModule.currentFilterObject||!n.enableVirtualization||n.initialRender||n.expandStateMapping||I(n)&&n.enableVirtualization||n.expandAll(),"searching"!==e.requestType||e.isCollapseMaintain||""===n.searchSettings.key||!n.enableVirtualization||n.initialRender||n.expandStateMapping||I(n)&&n.enableVirtualization||n.expandAll(),"clearFilter"===e.action&&n.enableCollapseAll&&n.collapseAll(),"indenting"===n.action||"outdenting"===n.action?(n.action="indenting"===n.action?"indented":"outdented",i={data:t=[n.selectedRecords],dropIndex:n.dropIndex,dropPosition:n.dropPosition,modifiedRecords:n.modifiedRecords,requestType:n.action,row:n.selectedRows},n.trigger(Ce,i),n.getCurrentViewRecords().filter(function(e){return e.uniqueID===t[0].uniqueID}).length||n.refreshToolbarItems(),n.action="",n.selectedRecords=n.selectedRows=n.modifiedRecords=[]):(n.grid.isFrozenGrid()&&n.enableVirtualization&&"movable"===e.tableName&&(i=n.grid.element.querySelector("."+Ct),r=n.grid.element.querySelector("."+bt),i.style.height=r.style.height="auto"),n.trigger(Ce,e))}},c.prototype.extendedGridEvents=function(){var t=this,i=this;this.grid.recordDoubleClick=function(e){t.trigger(We,e),t.notify(We,e)},this.grid.detailDataBound=function(e){t.notify("detaildataBound",e),t.trigger(ut,e)},this.grid.rowDataBound=function(e){C.isNullOrUndefined(this.isPrinting)?C.setValue("isPrinting",!1,e):C.setValue("isPrinting",this.isPrinting,e),i.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){C.isNullOrUndefined(this.isPrinting)?C.setValue("isPrinting",!1,e):C.setValue("isPrinting",this.isPrinting,e),i.renderModule.cellRender(e)},this.grid.contextMenuClick=function(e){t.notify(je,e),t.trigger(je,e)},this.grid.contextMenuOpen=function(e){t.notify(Fe,e),t.trigger(Fe,e)},this.grid.queryCellInfo=function(e){t.renderModule.cellRender(e)}},c.prototype.bindGridDragEvents=function(){var t=this;this.grid.rowDragStartHelper=function(e){t.trigger(ft,e)},this.grid.rowDragStart=function(e){t.trigger(yt,e)},this.grid.rowDrag=function(e){t.grid.isEdit?e.cancel=!0:(t.notify(It,e),t.trigger(gt,e))},this.grid.rowDrop=function(e){t.grid.isEdit||t.notify(Rt,e),e.cancel=!0}},c.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),C.setValue("registeredTemplate",this.registeredTemplate,this.grid);C.setValue("viewContainerRef",this.viewContainerRef,this.grid)},c.prototype.autoGenerateColumns=function(){var e,t=this;this.columns.length||this.dataModule.isRemote()||!Object.keys(this.dataSource).length||(this.columns=[],e=this.dataSource[0],e=Object.keys(e),this.columns=e.filter(function(e){return-1===[t.childMapping,t.parentIdMapping].indexOf(e)}))},c.prototype.getGridEditSettings=function(){var e={};switch(e.allowAdding=this.editSettings.allowAdding,e.allowEditing=this.editSettings.allowEditing,e.allowDeleting=this.editSettings.allowDeleting,e.newRowPosition="Bottom"===this.editSettings.newRowPosition?"Bottom":"Top",e.allowEditOnDblClick=this.editSettings.allowEditOnDblClick,e.showConfirmDialog=this.editSettings.showConfirmDialog,e.template=this.editSettings.template,e.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,e.allowNextRowEdit=this.editSettings.allowNextRowEdit,e.guid=this.editSettings.guid,e.dialog=this.editSettings.dialog,this.editSettings.mode){case"Dialog":case"Batch":e.mode=this.editSettings.mode;break;case"Row":e.mode="Normal";break;case"Cell":e.mode="Normal",e.showConfirmDialog=!1}return e},c.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var e=[],t=0;t<this.contextMenuItems.length;t++)switch(this.contextMenuItems[parseInt(t.toString(),10)]){case"AddRow":case r.ContextMenuItems.AddRow:e.push({text:this.l10n.getConstant("AddRow"),target:".e-content",id:this.element.id+"_gridcontrol_cmenu_AddRow",items:[{text:this.l10n.getConstant("Above"),id:"Above"},{text:this.l10n.getConstant("Below"),id:"Below"},{text:this.l10n.getConstant("Child"),id:"Child"}]});break;case"Indent":case r.ContextMenuItems.RowIndent:e.push({text:this.l10n.getConstant("RowIndent"),target:".e-content",iconCss:"e-indent e-icons",id:this.element.id+"_gridcontrol_cmenu_Indent"});break;case"Outdent":case r.ContextMenuItems.RowOutdent:e.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:e.push(this.contextMenuItems[parseInt(t.toString(),10)])}return e}return null},c.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new C.L10n("treegrid",this.defaultLocale,this.locale);for(var e=[],t=void 0,i=0;i<this.toolbar.length;i++)switch(this.toolbar[parseInt(i.toString(),10)]){case"Search":case r.ToolbarItem.Search:e.push("Search");break;case"Print":case r.ToolbarItem.Print:e.push("Print");break;case"ExpandAll":case r.ToolbarItem.ExpandAll:t=this.l10n.getConstant("ExpandAll"),e.push({text:t,tooltipText:t,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case r.ToolbarItem.CollapseAll:t=this.l10n.getConstant("CollapseAll"),e.push({text:t,tooltipText:t,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case r.ToolbarItem.RowIndent:t=this.l10n.getConstant("RowIndent"),e.push({text:t,tooltipText:t,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case r.ToolbarItem.RowOutdent:t=this.l10n.getConstant("RowOutdent"),e.push({text:t,tooltipText:t,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:e.push(this.toolbar[parseInt(i.toString(),10)])}return e}return null},c.prototype.getGridColumns=function(e,t,i){void 0===i&&(i=0);for(var r=e,n=((t=void 0===t?!0:t)&&(this.columnModel=[]),0===this.columnModel.length&&(i=0===i?-1:i),[]),o=0;o<r.length;o++){i+=1;var a=this.grid.getColumnByUid(r[parseInt(o.toString(),10)].uid),s=a||{},d={};if("string"==typeof this.columns[parseInt(o.toString(),10)])s.field=d.field=this.columns[parseInt(o.toString(),10)];else for(var l=Object.keys(r[parseInt(o.toString(),10)]),p=0;p<l.length;p++){var h=l[parseInt(p.toString(),10)];i===this.treeColumnIndex&&"template"===h?d[""+h]=r[parseInt(o.toString(),10)][""+h]:"columns"!==h||C.isNullOrUndefined(r[parseInt(o.toString(),10)][""+h])?this.initialRender&&!C.isNullOrUndefined(a)&&this.enablePersistence&&"edit"===h?s[""+h]=d[""+h]=a[""+h]:a&&"sortComparer"===h||(s[""+h]=d[""+h]=r[parseInt(o.toString(),10)][""+h]):(s[""+h]=this.getGridColumns(r[parseInt(o.toString(),10)][""+h],!1,this.columnModel.length-1),d[""+h]=r[parseInt(o.toString(),10)][""+h])}d.columns||this.columnModel.push(new F(d)),n.push(s),!C.isNullOrUndefined(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&s.field===this.columnModel[this.treeColumnIndex].field&&(C.isNullOrUndefined(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),s.textAlign="Right")}return n},c.prototype.lastRowCellBorderUpdated=function(){var e=this.getContentTable().querySelectorAll("tr.e-row"),e=Array.from(e).filter(function(e){return!e.classList.contains("e-childrow-hidden")});0<e.length&&(e=e[e.length-1],this.lastRowBorder(e,!0))},c.prototype.onPropertyChanged=function(e){for(var t=!1,i=0,r=Object.keys(e);i<r.length;i++){var n,o=r[i];switch(o){case"columns":C.isNullOrUndefined(e.columns)||this.refreshColumns(),t=!0;break;case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=w.getActualProperties(this.pageSettings),t=!0;break;case"enableVirtualization":this.grid.enableVirtualization=this.enableVirtualization;break;case"enableColumnVirtualization":this.grid.enableColumnVirtualization=this.enableColumnVirtualization;break;case"toolbar":this.grid.toolbar=this.getGridToolbar();break;case"allowSelection":this.grid.allowSelection=this.allowSelection;break;case"selectionSettings":this.grid.selectionSettings=w.getActualProperties(this.selectionSettings);break;case"allowSorting":this.grid.allowSorting=this.allowSorting;break;case"allowMultiSorting":this.grid.allowMultiSorting=this.allowMultiSorting;break;case"sortSettings":this.grid.sortSettings=w.getActualProperties(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=w.getActualProperties(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=w.getActualProperties(this.filterSettings));break;case"showColumnMenu":this.grid.showColumnMenu=this.showColumnMenu;break;case"allowRowDragAndDrop":this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop;break;case"aggregates":this.grid.aggregates=w.getActualProperties(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":this.isLocalData=!(this.dataSource instanceof b.DataManager)||!C.isNullOrUndefined(this.dataSource.ready)||this.dataSource.adaptor instanceof b.RemoteSaveAdaptor,this.convertTreeData(this.dataSource),this.isLocalData?(R(this)?(n=C.getValue("count",this.dataSource),this.grid.dataSource={result:this.flatData,count:n}):(n=this.dataSource,this.grid.dataSource=n instanceof b.DataManager?new b.DataManager(n.dataSource,n.defaultQuery,n.adaptor):this.flatData),this.enableVirtualization&&(this.grid.contentModule.isDataSourceChanged=!0)):(this.bindedDataSource(),this.enableVirtualization&&(this.grid.contentModule.removeEventListener(),this.grid.contentModule.eventListener("on"),this.grid.contentModule.renderTable()));break;case"query":this.grid.query=this.query;break;case"enableCollapseAll":e[""+o]?this.collapseAll():this.expandAll();break;case"expandStateMapping":this.grid.refresh();break;case"gridLines":this.grid.gridLines=this.gridLines;break;case"rowTemplate":this.grid.rowTemplate=w.getActualProperties(this.rowTemplate);break;case"frozenRows":this.grid.frozenRows=this.frozenRows;break;case"frozenColumns":this.grid.frozenColumns=this.frozenColumns;break;case"rowHeight":this.grid.rowHeight=this.rowHeight,this.refresh();break;case"height":C.isNullOrUndefined(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),this.grid.height=this.height;break;case"width":C.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.grid.width=this.width;break;case"locale":this.grid.locale=this.locale,this.TreeGridLocale(),this.grid.toolbar=this.getGridToolbar(),this.grid.contextMenuItems=this.getContextMenu();break;case"selectedRowIndex":this.grid.selectedRowIndex=this.selectedRowIndex;break;case"enableAltRow":this.grid.enableAltRow=this.enableAltRow;break;case"enableHover":this.grid.enableHover=this.enableHover;break;case"enableAutoFill":this.grid.enableAutoFill=this.enableAutoFill;break;case"columnChooserSettings":this.grid.columnChooserSettings=w.getActualProperties(this.columnChooserSettings);break;case"enableAdaptiveUI":this.grid.enableAdaptiveUI=this.enableAdaptiveUI;break;case"enableImmutableMode":this.grid.enableImmutableMode=this.enableImmutableMode;break;case"allowExcelExport":this.grid.allowExcelExport=this.allowExcelExport;break;case"allowPdfExport":this.grid.allowPdfExport=this.allowPdfExport;break;case"enableRtl":C.isNullOrUndefined(this.treeColumnField)||this.updateTreeColumnTextAlign(),this.grid.enableRtl=this.enableRtl;break;case"allowReordering":this.grid.allowReordering=this.allowReordering;break;case"allowResizing":this.grid.allowResizing=this.allowResizing;break;case"textWrapSettings":this.grid.textWrapSettings=w.getActualProperties(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=w.getActualProperties(this.allowTextWrap),this.grid.refresh();break;case"contextMenuItems":this.grid.contextMenuItems=this.getContextMenu();break;case"showColumnChooser":this.grid.showColumnChooser=this.showColumnChooser;break;case"detailTemplate":this.grid.detailTemplate=w.getActualProperties(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=w.getActualProperties(this.columnMenuItems);break;case"enableStickyHeader":this.grid.enableStickyHeader=this.enableStickyHeader;break;case"emptyRecordTemplate":this.grid.emptyRecordTemplate=this.emptyRecordTemplate;break;case"isRowSelectable":this.grid.isRowSelectable=this.isRowSelectable;break;case"editSettings":this.grid.isEdit&&"Normal"===this.grid.editSettings.mode&&e[""+o].mode&&("Cell"===e[""+o].mode||"Row"===e[""+o].mode)&&this.grid.closeEdit(),this.grid.editSettings=this.getGridEditSettings();break;case"enableRowSpan":case"enableColumnSpan":this.grid.enableRowSpan=this.enableRowSpan,this.grid.enableColumnSpan=this.enableColumnSpan,this.refreshColumns()}}t&&(this.isFrozenGrid()?this.refreshLayout():this.grid.refresh())},c.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},c.prototype.destroy=function(){this.isComponentRefresh=!0;var e=this.element;if(e){for(var e=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent")),t=(e&&this.unwireEvents(),this.removeListener(),this.dataModule&&this.dataModule.destroy(),this.grid&&(this.grid.dataSource=null,this.grid.destroy()),e&&Ri.prototype.destroy.call(this),this.infiniteScrollData=null,this.remoteCollapsedData=null,this.remoteExpandedData=null,this.parentData=null,["dataModule","sortModule","renderModule","filterModule","printModule","clipboardModule","excelExportModule","pdfExportModule","toolbarModule","summaryModule","reorderModule","resizeModule","pagerModule","keyboardModule","columnMenuModule","contextMenuModule","editModule","virtualScrollModule","selectionModule","detailRow","rowDragAndDropModule","freezeModule"]),i=0;i<t.length;i++)this[t[parseInt(i.toString(),10)]]&&(this[t[parseInt(i.toString(),10)]]=null);this.dataResults=null,this.uniqueIDCollection={},this.uniqueIDFilterCollection={},this.element.innerHTML="",this.grid=null}},c.prototype.dataBind=function(){C.isNullOrUndefined(this.grid)||(!C.isNullOrUndefined(this.rowDropSettings.targetID)&&C.isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))&&(document.getElementById(this.rowDropSettings.targetID).id=this.grid.rowDropSettings.targetID,this.rowDropSettings.targetID=this.grid.rowDropSettings.targetID),Ri.prototype.dataBind.call(this),this.grid.dataBind())},c.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","scrollPosition"],t={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},i=0;i<e.length;i++)for(var r=this[e[parseInt(i.toString(),10)]],n=0,o=t[e[parseInt(i.toString(),10)]];!C.isNullOrUndefined(o)&&n<o.length;n++)delete r[""+o[parseInt(n.toString(),10)]];return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},c.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].columns?(this.ignoreInColumn(e,t[parseInt(i.toString(),10)]),this.ignoreInArrays(e,t[parseInt(i.toString(),10)].columns)):this.ignoreInColumn(e,t[parseInt(i.toString(),10)])},c.prototype.ignoreInColumn=function(e,t){if(C.isNullOrUndefined(t.template))for(var i=0;i<e.length;i++)delete t[e[parseInt(i.toString(),10)]],t.filter={}},c.prototype.mouseClickHandler=function(e){var t,i,r,n=this;C.isNullOrUndefined(e.touches)&&(!(e=e.target).classList.contains("e-treegridexpand")&&!e.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(e),(e.classList.contains("e-treegridexpand")||e.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:e}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map(function(e){return!0===e.showChildSummary}).length&&(t=this.grid.getHeaderContent().querySelector(".e-checkselectall"),i=this.grid.getSelectedRowIndexes().length,0<(r=this.getCurrentViewRecords().length))&&i===r&&(i=t.nextElementSibling,C.removeClass([i],["e-stop","e-uncheck"]),C.addClass([i],["e-check"])),e.classList.contains("e-flmenu-cancelbtn")||e.classList.contains("e-flmenu-okbtn")||e.classList.contains("e-content")||e.classList.contains("e-rowcell"))&&!C.isNullOrUndefined(this.grid.filterModule)&&this.isReact&&!C.isNullOrUndefined(this.grid.filterModule.column)&&this.grid.filterModule.column.filterTemplate&&(r=document.getElementById(this.grid.filterModule.filterModule.dlgObj.element.id),this.grid.filterModule.fltrDlgDetails.isOpen=!1,this.grid.filterModule.filterModule.dlgObj)&&!this.grid.filterModule.filterModule.dlgObj.isDestroyed&&r&&this.clearTemplate(["filterTemplate"],void 0,function(){n.grid.filterModule.filterModule.dlgObj.destroy()})},c.prototype.getRows=function(){return this.grid.getRows()},c.prototype.getPager=function(){return this.grid.getPager()},c.prototype.addRecord=function(e,t,i){this.editModule&&(this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i))},c.prototype.closeEdit=function(){this.grid.editModule&&this.editModule.closeEdit()},c.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},c.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},c.prototype.updateRow=function(e,t){var i;this.grid.editModule&&(C.isNullOrUndefined(e)?this.grid.editModule.updateRow(e,t):(i=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)],C.extend(i,t),this.grid.editModule.updateRow(e,i)))},c.prototype.deleteRecord=function(e,t){(C.isNullOrUndefined(e)&&C.isNullOrUndefined(t)||this.getSelectedRecords().length<=0)&&this.trigger(Mt,{error:"The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number."}),this.grid.editModule&&this.grid.editModule.deleteRecord(e,t)},c.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},c.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},c.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},c.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},c.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},c.prototype.deleteRow=function(e){this.grid.editModule&&this.grid.editModule.deleteRow(e)},c.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},c.prototype.setCellValue=function(e,t,i){this.grid.setCellValue(e,t,i);i=this.grid.getRowIndexByPrimaryKey(e),e=this.getCurrentViewRecords()[parseInt(i.toString(),10)];hi({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,t)},c.prototype.setRowData=function(t,e){var i=this.getCurrentViewRecords(),r=this.grid.getPrimaryKeyFieldNames()[0],n={},o=(i.some(function(e){return e[""+r]===t&&(n=e,!0)}),o=n.level,e.level=o,e.index=n.index,e.childRecords=n.childRecords,e.taskData=n.taskData,e.uniqueID=n.uniqueID,e.parentItem=n.parentItem,e.checkboxState=n.checkboxState,e.hasChildRecords=n.hasChildRecords,e.parentUniqueID=n.parentUniqueID,e.expanded=n.expanded,this.grid.setRowData(t,e),this.getVisibleRecords());0<o.length&&t===o[o.length-1][""+r]&&(e=this.getContentTable().scrollHeight,o=this.getContent().clientHeight,this.lastRowBorder(this.getRows()[i.indexOf(n)],e<=o))},c.prototype.goToPage=function(e){this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},c.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},c.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},c.prototype.getColumnByField=function(t){return w.iterateArrayOrObject(this.columnModel,function(e){if(e.field===t)return e})[0]},c.prototype.getColumnByUid=function(t){var e=(this.initialRender?this.grid:this).columns;return this.grid.columns.length!==this.columnModel.length&&(e=this.grid.columnModel),w.iterateArrayOrObject(e,function(e){if(e.uid===t)return e})[0]},c.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},c.prototype.getFooterContent=function(){return this.grid.getFooterContent()},c.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},c.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},c.prototype.hideColumns=function(e,t){this.grid.hideColumns(e,t),this.updateColumnModel()},c.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},c.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},c.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},c.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},c.prototype.getVirtualColIndexByUid=function(i){var e=w.iterateArrayOrObject(this.grid.columnModel,function(e,t){if(e.uid===i)return t})[0];return C.isNullOrUndefined(e)?-1:e},c.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},c.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},c.prototype.updateColumnModel=function(e){var t,i,r=C.isNullOrUndefined(e)?this.grid.getColumns():e;if(-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!C.isNullOrUndefined(this.columnModel[this.treeColumnIndex].template)&&(t=this.columnModel[this.treeColumnIndex].template,i=this.columnModel[this.treeColumnIndex].field),!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===r.length){this.columnModel=[];for(var n=0;n<r.length;n++){for(var o={},a=0,s=Object.keys(r[parseInt(n.toString(),10)]);a<s.length;a++){var d=s[a];o[""+d]=r[parseInt(n.toString(),10)][""+d]}this.columnModel.push(new F(o)),i!==this.columnModel[parseInt(n.toString(),10)].field||"checkbox"===this.columnModel[parseInt(n.toString(),10)].type||C.isNullOrUndefined(t)||""===t||(this.columnModel[parseInt(n.toString(),10)].template=t)}}e="deepMerge";return this[e]=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&!C.isNullOrUndefined(this.detailTemplate)&&this.trigger(Mt,{error:"Stacked header is not compatible with the detail template"}),this.stackedHeader&&this.allowResizing&&!C.isNullOrUndefined(this.columns)&&this.updateColumnsWidth(this.columns),this.stackedHeader||C.isNullOrUndefined(this.columns)||C.merge(this.columns,this.columnModel),this[e]=void 0,this.columnModel},c.prototype.updateColumnsWidth=function(e){var i=this;e.forEach(function(e){var t;!C.isNullOrUndefined(e)&&e.columns?i.updateColumnsWidth(e.columns):!C.isNullOrUndefined(e)&&e.field&&(t=i.grid.getColumnByField(e.field),C.isNullOrUndefined(t)||(e.width=t.width))})},c.prototype.getContent=function(){return this.grid.getContent()},c.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},c.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},c.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this)},c.prototype.splitFrozenCount=function(e){var t=0<this.frozenColumns?this.grid:this;this.grid.splitFrozenCount.apply(t,[e])},c.prototype.removeBorder=function(e){this.grid.removeBorder.apply(this.grid,[e])},c.prototype.frozenLeftBorderColumns=function(e){this.grid.frozenLeftBorderColumns.apply(this.grid,[e])},c.prototype.frozenRightBorderColumns=function(e){this.grid.frozenRightBorderColumns.apply(this.grid,[e])},c.prototype.isFrozenGrid=function(){var e=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return 0<this.frozenColumns||0<this.frozenRows||0<this.getFrozenColumns()||e},c.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:w.getObject("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:w.getObject("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:w.getObject("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:w.getObject("properties",this.grid.sortSettings)},!0)},c.prototype.hasPreAndPostMiddleware=function(e){return e&&"function"==typeof e.applyPreRequestMiddlewares&&"function"==typeof e.applyPostRequestMiddlewares},c.prototype.getContentTable=function(){return this.grid.getContentTable()},c.prototype.getDataRows=function(){for(var e=[],t=this.grid.getDataRows(),i=0,r=t.length;i<r;i++)t[parseInt(i.toString(),10)].classList.contains("e-summaryrow")||e.push(t[parseInt(i.toString(),10)]);return e},c.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter(function(e){return C.isNullOrUndefined(e.isSummaryRow)})},c.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},c.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},c.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},c.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},c.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},c.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},c.prototype.getVisibleColumns=function(){return this.columnModel.filter(function(e){return e.visible})},c.prototype.showSpinner=function(){B.showSpinner(this.element)},c.prototype.hideSpinner=function(){B.hideSpinner(this.element)},c.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),R(this)||(this.dataSource instanceof b.DataManager?this.grid.setProperties({dataSource:new b.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},c.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},c.prototype.getVisibleRecords=function(){var e=[],t=this.getCurrentViewRecords();if(this.allowPaging)e=t;else for(var i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)]),t[parseInt(i.toString(),10)].expanded||(i+=v(t[parseInt(i.toString(),10)]).length);return e},c.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},c.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},c.prototype.refreshColumns=function(e){C.isNullOrUndefined(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.getTreeColumn(),this.isFrozenGrid()||this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},c.prototype.getTreeColumn=function(){var e=this.columnModel[this.treeColumnIndex],t=this.getColumns(),i=w.getObject("field",e),e=t.findIndex(function(e){return w.getObject("field",e)===i});C.isNullOrUndefined(e)||this.setProperties({treeColumnIndex:e},!0)},c.prototype.refreshHeader=function(){this.grid.refreshHeader()},c.prototype.expandCollapseRequest=function(e){if("Batch"===this.editSettings.mode)if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog)return t=this.grid.editModule.dialogObj,this.grid.editModule.showDialog("CancelEdit",t),void(this.targetElement=e);var t,i,r;this.rowTemplate?(t=e.closest(".e-treerowcell").parentElement,r=this.getCurrentViewRecords()[t.rowIndex],e.classList.contains("e-treegridexpand")?this.collapseRow(t,r):this.expandRow(t,r)):(r=(i=this.grid.getRowInfo(e)).rowData,this.grid.isFrozenGrid()&&this.enableVirtualization&&!Object.keys(r).length&&(r=this.grid.contentModule.freezeRows.filter(function(e){return e.uid===i.row.getAttribute("data-uid")})[0].data),this.enableImmutableMode&&(r=this.getCurrentViewRecords()[i.rowIndex]),e.classList.contains("e-treegridexpand")?this.collapseRow(i.row,r):this.expandRow(i.row,r))},c.prototype.expandRow=function(t,i,r,n){var e,o,a=this,s=(this.isCollapseAll=!1,this.parentData);this.enableVirtualization||(s=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(t,i),C.isNullOrUndefined(t)&&C.isNullOrUndefined(i)||(!C.isNullOrUndefined(t)&&t.cells&&t.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(t,!1),this.isExpandAll&&!I(this)?(e=!(o={data:s,row:t,cancel:!1}),this.grid.pagerModule&&!C.isNullOrUndefined(this.grid.pagerModule.pagerObj.pagerdropdownModule)&&(e=!!this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value),this.isExpandingEventTriggered?(!this.allowPaging||e&&"All"===this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value)&&!this.expandAllPrevent&&this.isExpandingEventTriggered&&this.expandRows(t,i,s):this.trigger(ke,o,function(e){a.expandAllPrevent=e.cancel,e.cancel||C.isNullOrUndefined(i)||(e.expandAll&&a.expandCollapseAllChildren(i,"expand",r,n),a.expandRows(t,i,s))}),this.isExpandingEventTriggered=!0):(!this.isExpandAll||this.isExpandAll&&I(this))&&(o={data:i,row:t,cancel:!1},this.trigger(ke,o,function(e){e.cancel||(e.expandAll&&a.expandCollapseAllChildren(i,"expand",r,n),a.expandRows(t,i,s))})))},c.prototype.expandRows=function(e,t,i){this.expandCollapse("expand",e,t);I(this)&&!x(this)||R(this)&&C.isNullOrUndefined(t.Children)||(t={data:t,row:e},C.isNullOrUndefined(this.expandStateMapping)||this.updateExpandStateMapping(t.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,this.trigger(Ue,t={data:i,row:e})):!this.isExpandAll&&this.enableVirtualization&&this.selectionSettings.persistSelection&&!C.isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)?this.virtualScrollModule.prevSelectedRecord=[]:this.isExpandAll||this.trigger(Ue,t))},c.prototype.expandCollapseAllChildren=function(e,t,i,r){if((C.isNullOrUndefined(i)||e[this.getPrimaryKeyFieldNames()[0]]===i)&&(C.isNullOrUndefined(r)||r===e.level)){var n=v(e).filter(function(e){return e.hasChildRecords});n.unshift(e);for(var o=0;o<n.length;o++)this.expandCollapse(t,null,n[parseInt(o.toString(),10)])}},c.prototype.getCollapseExpandRecords=function(e,t){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&C.isNullOrUndefined(t)&&!I(this)?t=this.flatData.filter(function(e){return e.hasChildRecords}):C.isNullOrUndefined(t)&&!C.isNullOrUndefined(e)&&(t=this.detailTemplate?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.enableVirtualization&&(this.isCollapseAll||this.isExpandAll)?-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]),t},c.prototype.collapseRow=function(t,i,r){var e,n=this,o=(this.isExpandAll=!1,this.parentData);this.enableVirtualization||(o=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(t,i),C.isNullOrUndefined(t)&&C.isNullOrUndefined(i)||(this.isCollapseAll&&!I(this)?(e={data:o,row:t,cancel:!1},this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(t,i,o):this.trigger(Te,e,function(e){n.collapseAllPrevent=e.cancel,e.cancel||(e.collapseAll&&n.expandCollapseAllChildren(i,"collapse",r),n.collapseRows(t,i,o))}),this.isCollapsingEventTriggered=!0):(!this.isCollapseAll||this.isCollapseAll&&I(this))&&(e={data:i,row:t,cancel:!1},this.trigger(Te,e,function(e){e.cancel||n.collapseRows(t,i,o)})))},c.prototype.collapseRows=function(e,t,i){this.expandCollapse("collapse",e,t);t={data:t,row:e};I(this)||(C.isNullOrUndefined(this.expandStateMapping)||this.updateExpandStateMapping(t.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,this.trigger(qe,t={data:i,row:e})):this.isCollapseAll||this.trigger(qe,t),this.enableInfiniteScrolling&&this.grid.getContent().firstElementChild.scrollHeight-this.grid.getContent().firstElementChild.scrollTop<this.grid.getRowHeight()+ +this.height&&this.grid.getContent().firstElementChild.scrollBy(0,this.grid.getRowHeight()))},c.prototype.updateExpandStateMapping=function(e,t){var i=e;if(i.length)for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)][this.expandStateMapping]=t,hi({value:i[parseInt(r.toString(),10)],action:"edit"},this,this.isSelfReference,i[parseInt(r.toString(),10)].index,this.grid.selectedRowIndex,this.expandStateMapping);else e[""+this.expandStateMapping]=t,hi({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},c.prototype.expandAtLevel=function(t){var e;(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!I(this)?(e=this.grid.dataSource.filter(function(e){return e.hasChildRecords&&e.level===t&&(e.expanded=!0),e.hasChildRecords&&e.level===t}),this.expandAction(e,null,t,!0)):(e=this.getRecordDetails(t),e=w.getObject("records",e),this.expandAction(e,null,t))},c.prototype.expandByKey=function(e){this.expandCollapseActionByKey(e,"Expand")},c.prototype.expandAction=function(r,n,o,a){void 0===a&&(a=!1);for(var s=this,e=0;e<r.length;e++)!function(e){var t,i;C.isNullOrUndefined(r[parseInt(e.toString(),10)].parentItem)||(t=r[parseInt(e.toString(),10)].parentItem.uniqueID,i=s.flatData.filter(function(e){return e.uniqueID===t}),!1===(i=I(s)?s.getCurrentViewRecords().filter(function(e){return e.uniqueID===t}):i)[0].expanded?(r.push(i[0]),i[0].expanded=!0):y(s,i[0],s.parentData)||i[0].expanded&&void 0!==i[0].parentItem&&r.push(i[0])),a||s.expandRow(null,r[parseInt(e.toString(),10)],n,o)}(e);a&&this.expandRow(null,r,n,o)},c.prototype.getRecordDetails=function(t){var e=this.getRows().filter(function(e){return-1!==e.className.indexOf("level"+t)&&(e.querySelector(".e-treegridcollapse")||e.querySelector(".e-treegridexpand"))});return{records:this.getCurrentViewRecords().filter(function(e){return e.level===t&&e.hasChildRecords}),rows:e}},c.prototype.collapseAtLevel=function(t){var e;(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!I(this)?(e=this.grid.dataSource.filter(function(e){return e.hasChildRecords&&e.level===t&&(e.expanded=!1),e.hasChildRecords&&e.level===t}),this.collapseAction(e,null,!0)):(e=this.getRecordDetails(t),e=w.getObject("records",e),this.collapseAction(e))},c.prototype.collapseByKey=function(e){this.expandCollapseActionByKey(e,"Collapse")},c.prototype.expandCollapseActionByKey=function(t,e){var i=this.getPrimaryKeyFieldNames()[0],r=I(this)?this.getCurrentViewRecords():this.grid.dataSource;C.isNullOrUndefined(i)||(r=r.filter(function(e){return e[""+i].toString()===t.toString()}),"Expand"===e?this.expandAction(r,t,null):this.collapseAction(r,t))},c.prototype.collapseAction=function(e,t,i){if(i=void 0===i?!1:i)this.collapseRow(null,e);else for(var r=0;r<e.length;r++)this.collapseRow(null,e[parseInt(r.toString(),10)],t);!this.grid.contentModule.isDataSourceChanged&&this.enableVirtualization&&this.getRows()&&this.parentData.length===this.getRows().length&&(this.grid.contentModule.startIndex=-1,this.grid.contentModule.endIndex=-1)},c.prototype.expandAll=function(){if(0===this.getCurrentViewRecords().length&&this.trigger(Mt,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."}),this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],e=Array.isArray(e.addedRecords)?e.addedRecords:[];if((0<t.length||0<i.length||0<e.length)&&this.editSettings.showConfirmDialog)return t=this.grid.editModule.dialogObj,void this.grid.editModule.showDialog("CancelEdit",t)}this.expandCollapseAll("expand")},c.prototype.collapseAll=function(){if(0===this.getCurrentViewRecords().length&&this.trigger(Mt,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."}),this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],e=Array.isArray(e.addedRecords)?e.addedRecords:[];if((0<t.length||0<i.length||0<e.length)&&this.editSettings.showConfirmDialog)return t=this.grid.editModule.dialogObj,void this.grid.editModule.showDialog("CancelEdit",t)}this.expandCollapseAll("collapse")},c.prototype.expandCollapseAll=function(t){var e,i=this.rowTemplate?[].slice.call(this.grid.getContentTable().querySelectorAll("tr")).filter(function(e){return e.querySelector(".e-treegrid"+("expand"===t?"collapse":"expand"))}):this.getRows().filter(function(e){return e.querySelector(".e-treegrid"+("expand"===t?"collapse":"expand"))});if(!i.length&&this.getRows().length&&i.push(this.getRows()[0]),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&("All"===this.pageSettings.pageSizeMode||"Root"===this.pageSettings.pageSizeMode)||this.enableVirtualization||this.enableInfiniteScrolling)&&!I(this))if(this.flatData.filter(function(e){e.hasChildRecords&&(e.expanded="collapse"!==t)}),i.length)for(var r,n=0;n<i.length;n++)"collapse"===t?(r=this.frozenRows?this.getCurrentViewRecords()[parseInt(i[parseInt(n.toString(),10)].getAttribute("aria-rowindex"),10)-1]:this.getCurrentViewRecords()[i[parseInt(n.toString(),10)].rowIndex],C.isNullOrUndefined(r)||this.collapseRow(i[parseInt(n.toString(),10)])):this.enableVirtualization?"true"!==i[0].getAttribute("aria-expanded")&&this.expandRow(i[0]):this.expandRow(i[parseInt(n.toString(),10)]);else this.allowPaging&&(e=this.enableCollapseAll,this.setProperties({enableCollapseAll:!0},!0),this.grid.pagerModule.goToPage(1),this.setProperties({enableCollapseAll:e},!0));else for(n=0;n<i.length;n++)"collapse"===t?this.collapseRow(i[parseInt(n.toString(),10)]):this.expandRow(i[parseInt(n.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},c.prototype.expandCollapse=function(e,t,i,r){var n,o=this,a={row:t,data:i,childData:[],requestType:e},s=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===i.uniqueID}),a=((!I(this)&&"expand"===e&&this.isSelfReference&&R(this)&&!s.length||"collapse"===e||this.isExpandAll&&!this.loadChildOnDemand&&!I(this)&&this.isSelfReference&&R(this))&&this.updateChildOnDemand(a),this.getRows());if(this.rowTemplate&&(p=this.getContentTable().rows,a=[].slice.call(p)),C.isNullOrUndefined(t)?(d=this.grid.currentViewData.indexOf(i),t=a[parseInt(d.toString(),10)]):d=+t.getAttribute("aria-rowindex")-1,C.isNullOrUndefined(t)||t.setAttribute("aria-expanded","expand"===e?"true":"false"),(!this.allowPaging||"All"!==this.pageSettings.pageSizeMode&&"Root"!==this.pageSettings.pageSizeMode)&&!this.enableVirtualization||I(this)||R(this)){var d=void 0;if("expand"===e){if(d="e-childrow-visible",r||(i.expanded=!0,this.flatData.forEach(function(e){e.expanded=(e.uniqueID===i.uniqueID&&e.expanded!==i.expanded?i:e).expanded}),this.uniqueIDCollection[i.uniqueID].expanded=i.expanded),C.isNullOrUndefined(t)||(n=t.getElementsByClassName("e-treegridcollapse")[0]),r&&!C.isNullOrUndefined(i[this.expandStateMapping])&&i[this.expandStateMapping]&&C.isNullOrUndefined(n)&&(n=t.getElementsByClassName("e-treegridexpand")[0]),C.isNullOrUndefined(n))return;n.classList.contains("e-treegridexpand")||C.addClass([n],"e-treegridexpand"),C.removeClass([n],"e-treegridcollapse")}else{if(d="e-childrow-hidden",r&&!R(this)||(i.expanded=!1,this.flatData.forEach(function(e){e.expanded=(e.uniqueID===i.uniqueID&&e.expanded!==i.expanded?i:e).expanded}),this.uniqueIDCollection[i.uniqueID].expanded=i.expanded),C.isNullOrUndefined(t)||(n=t.getElementsByClassName("e-treegridexpand")[0]),r&&!C.isNullOrUndefined(i[this.expandStateMapping])&&!i[this.expandStateMapping]&&C.isNullOrUndefined(n)&&(n=t.getElementsByClassName("e-treegridcollapse")[0]),C.isNullOrUndefined(n))return;n.classList.contains("e-treegridcollapse")||C.addClass([n],"e-treegridcollapse"),C.removeClass([n],"e-treegridexpand")}t.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");r=a.filter(function(e){return e.classList.contains("e-griddetailrowindex"+i.index+"level"+(i.level+1))});if(I(this)&&!x(this)?this.remoteExpand(e,t,i):(R(this)&&!s.length&&"collapse"!==e||this.localExpand(e,t,i),s=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,s=(s=this.getRowByIndex(s))?s.nextElementSibling&&s.nextElementSibling.classList.contains("e-detailrow")?s.nextElementSibling:s:null,this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!C.isNullOrUndefined(s)&&!s.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(s,!0)),R(this)&&"expand"===e&&(s=this.getCurrentViewRecords().filter(function(e){return y(o,e,o.parentData)}),this.dataResults.result=s),!C.isNullOrUndefined(n)&&n.closest(".e-treerowcell").classList.contains("e-cellselectionbackground")&&(n.closest(".e-treerowcell").classList.remove("e-cellselectionbackground"),n.closest(".e-treerowcell").removeAttribute("aria-selected")),this.isPixelHeight()&&!t.cells[0].classList.contains("e-lastrowcell")){this.getRows();for(var l,p=this.getContentTable().rows,h=(l=[].slice.call(p)).length-1;0<=h;h--)if(!kt(l[parseInt(h.toString(),10)])){var c=this.getContentTable().scrollHeight,u=this.getContent().clientHeight;this.lastRowBorder(l[parseInt(h.toString(),10)],c<=u);break}}this.notify("rowExpandCollapse",{detailrows:r,action:d,record:i,row:t}),this.updateAltRow(a)}else this.notify(Ve,{action:e,row:t,record:i})},c.prototype.updateChildOnDemand=function(d){var l=this;if("collapse"===d.requestType&&R(this)){for(var e=this.flatData.slice(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].parentUniqueID===d.data.uniqueID&&(e.splice(t,1),t-=1);this.dataResults.result=e}else{var i,r=new b.Deferred,p=(this.query?(i=this.grid.getDataModule().getStateEventArgument(this.query)).action=d:i=d,d.childDataBind=r.resolve,d.data);this.trigger(xe,i),r.promise.then(function(){if(d.childData.length){R(l)&&(l.flatData=l.dataResults.result),l.enableInfiniteScrolling&&R(l)&&(l.flatData=l.infiniteScrollData);for(var e=l.flatData,t=0,i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].taskData===p.taskData){t=i;break}for(var r=C.getValue("result",l.dataSource),n=D(d.childData),o=(p[l.childMapping]&&p[l.childMapping].length>n.length?p[l.childMapping]:n).length,i=0;i<o;i++)p[l.childMapping]&&r.filter(function(e,t){e[l.parentIdMapping]===p[l.idMapping]&&r.splice(t,1)}),n[parseInt(i.toString(),10)]?(n[parseInt(i.toString(),10)].level=p.level+1,n[parseInt(i.toString(),10)].index=Math.ceil(1e3*Math.random()),n[parseInt(i.toString(),10)].parentItem=C.extend({},p),n[parseInt(i.toString(),10)].taskData=C.extend({},n[parseInt(i.toString(),10)]),delete n[parseInt(i.toString(),10)].parentItem.childRecords,delete n[parseInt(i.toString(),10)].taskData.parentItem,n[parseInt(i.toString(),10)].parentUniqueID=p.uniqueID,n[parseInt(i.toString(),10)].uniqueID=w.getUid(l.element.id+"_data_"),C.setValue("uniqueIDCollection."+n[parseInt(i.toString(),10)].uniqueID,n[parseInt(i.toString(),10)],l),(!C.isNullOrUndefined(n[parseInt(i.toString(),10)][l.childMapping])||n[parseInt(i.toString(),10)][l.hasChildMapping]&&R(l))&&(n[parseInt(i.toString(),10)].hasChildRecords=!0),R(l)&&p[l.childMapping]&&p[l.childMapping][parseInt(i.toString(),10)]?e.splice(t+1+i,0,n[parseInt(i.toString(),10)]):e.splice(t+1+i,p[l.childMapping]&&p[l.childMapping][parseInt(i.toString(),10)]?1:0,n[parseInt(i.toString(),10)])):e.splice(t+1+i,1);e[parseInt(t.toString(),10)][""+l.childMapping]=n,e[parseInt(t.toString(),10)].childRecords=n,e[parseInt(t.toString(),10)].expanded=!0,C.setValue("uniqueIDCollection."+e[parseInt(t.toString(),10)].uniqueID,e[parseInt(t.toString(),10)],l);for(var a=0;a<d.childData.length;a++)r.push(d.childData[parseInt(a.toString(),10)])}R(l)&&!l.loadChildOnDemand&&"expand"===d.requestType&&(l.dataResults.expandRecord={},l.dataResults.expandRecord=d.data),l.isExpandRefresh=!0;var s=l.getContentTable().parentElement.scrollTop;l.grid.refresh(),l.enableInfiniteScrolling&&(l.getContentTable().parentElement.scrollTop=s),l.trigger(Ue,d)})}},c.prototype.remoteExpand=function(e,t,i){var r=this.getRows(),n=C.getValue("isCollapseAll",this)?"collapseAll":"refresh",n=(this.grid.contentModule.requestType=n,this.rowTemplate&&(n=this.getContentTable().rows,r=[].slice.call(n)),{data:i,row:t}),r=r.filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))||e.querySelector(".e-gridrowindex"+i.index+"level0.e-summarycell")});"expand"===e?(this.notify(Be,{record:i,rows:r,parentRow:t}),0<r.length&&this.trigger(Ue,{row:t,data:i})):"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:n.data,rows:null,parentRow:n.row}):(this.collapseRemoteChild({record:i,rows:r}),this.trigger(qe,n))},c.prototype.localExpand=function(e,t,i){var r,n,o=t.nextElementSibling&&t.nextElementSibling.classList.contains("e-detailrow")?t.nextElementSibling:null,a=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===i.uniqueID}),s=(this.isPixelHeight()&&t.cells[0].classList.contains("e-lastrowcell")?this.lastRowBorder(t,!1):this.isPixelHeight()&&o&&o.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(t.nextElementSibling,!1),this.getRows()),d=(this.rowTemplate&&(o=this.getContentTable().rows,s=[].slice.call(o)),"expand"===e?"e-childrow-visible":"e-childrow-hidden"),l=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging)for(var p=[],h=0;h<a.length;h++){var c=this.grid.getRowIndexByPrimaryKey(a[parseInt(h.toString(),10)][""+l]);p.push(this.getRows()[parseInt(c.toString(),10)])}else p=s.filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))});for(var u,t=0<this.grid.getFrozenLeftColumnsCount()||0<this.grid.getFrozenRightColumnsCount(),g=((this.frozenRows||this.frozenColumns||this.getFrozenColumns()||t)&&(r=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))})),t&&(n=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))})),this.grid.getRowsObject()),f=this.grid.currentViewData,m=f.filter(function(e){return e.uniqueID===i.uniqueID}),y=f.indexOf(m[0]),S=(C.isNullOrUndefined(g[parseInt(y.toString(),10)].visible)||!1===g[parseInt(y.toString(),10)].visible||(g[parseInt(y.toString(),10)].visible=!0),this.detailTemplate&&s.forEach(function(e){e.classList.contains("e-detailrow")&&"none"===e.style.display&&(e.style.display="")}),s.filter(function(e){return e.classList.contains("e-griddetailrowindex"+i.index+"level"+(i.level+1))})),h=0;h<p.length;h++)C.isNullOrUndefined(p[parseInt(h.toString(),10)])||this.toggleRowVisibility(p[parseInt(h.toString(),10)],d),C.isNullOrUndefined(p[parseInt(h.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||I(this)||R(this)||(C.isNullOrUndefined(g[p[parseInt(h.toString(),10)].rowIndex])||(g[p[parseInt(h.toString(),10)].rowIndex].visible="e-childrow-hidden"!=d),u=f.filter(function(e){return e.uniqueID===m[0].parentUniqueID}),!C.isNullOrUndefined(u[0])&&s[f.indexOf(u[0])].getElementsByClassName("e-treegridcollapse").length&&(g[parseInt(y.toString(),10)].visible=!1)),C.isNullOrUndefined(r)||this.toggleRowVisibility(r[parseInt(h.toString(),10)],d),C.isNullOrUndefined(n)||this.toggleRowVisibility(n[parseInt(h.toString(),10)],d),this.notify("childRowExpand",{row:p[parseInt(h.toString(),10)]}),!C.isNullOrUndefined(a)&&!C.isNullOrUndefined(a[parseInt(h.toString(),10)].childRecords)&&0<a[parseInt(h.toString(),10)].childRecords.length&&("expand"!==e||C.isNullOrUndefined(a[parseInt(h.toString(),10)].expanded)||a[parseInt(h.toString(),10)].expanded)&&(this.expandCollapse(e,p[parseInt(h.toString(),10)],a[parseInt(h.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex)&&!C.isNullOrUndefined(r)&&this.expandCollapse(e,r[parseInt(h.toString(),10)],a[parseInt(h.toString(),10)],!0);for(h=0;h<S.length;h++)C.isNullOrUndefined(S[parseInt(h.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||I(this)||R(this)||(g[S[parseInt(h.toString(),10)].rowIndex].visible="e-childrow-hidden"!=d,this.toggleRowVisibility(S[parseInt(h.toString(),10)],d));this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||I(this)||R(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},c.prototype.toggleRowVisibility=function(e,t){e&&(e.classList.remove("e-childrow-hidden","e-childrow-visible","e-hide"),e.classList.add(t))},c.prototype.updateAltRow=function(e){if(this.enableAltRow&&!this.rowTemplate)for(var t=0,i=0;e&&i<e.length;i++){var r=e[parseInt(i.toString(),10)];r.classList.contains("e-childrow-hidden")||(r.classList.contains("e-altrow")&&C.removeClass([r],"e-altrow"),t%2==0||r.classList.contains("e-summaryrow")||r.classList.contains("e-detailrow")||C.addClass([r],"e-altrow"),r.classList.contains("e-summaryrow"))||r.classList.contains("e-detailrow")||t++}},c.prototype.treeColumnRowTemplate=function(){for(var e=this.getContentTable().rows,e=[].slice.call(e),t=this.grid.getRowsObject(),i=0;i<e.length;i++){var r=this.grid.getContentTable().rows[parseInt(i.toString(),10)].cells[this.treeColumnIndex],n=e[parseInt(i.toString(),10)],n={data:0!==t.length?t[parseInt(i.toString(),10)].data:new Object,row:n,cell:r,column:this.getColumns()[this.treeColumnIndex]};this.renderModule.cellRender(n)}},c.prototype.collapseRemoteChild=function(t,e){C.isNullOrUndefined(e)||e||!this.loadChildOnDemand||(t.record.expanded=!1);var i=t.rows,r=[],n=[],o=0<this.getFrozenLeftColumnsCount()||0<this.getFrozenRightColumnsCount();o&&(r=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}),n=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}));for(var a=0;a<i.length;a++){this.toggleRowVisibility(i[parseInt(a.toString(),10)],"e-childrow-hidden");var s=i[parseInt(a.toString(),10)],d=i[parseInt(a.toString(),10)].querySelector(".e-detailrowexpand");if(C.isNullOrUndefined(d)||this.grid.detailRowModule.collapse(d),o&&(this.toggleRowVisibility(r[parseInt(a.toString(),10)],"e-childrow-hidden"),this.toggleRowVisibility(n[parseInt(a.toString(),10)],"e-childrow-hidden"),i[parseInt(a.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")||(r[parseInt(a.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")?s=r[parseInt(a.toString(),10)]:n[parseInt(a.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")&&(s=n[parseInt(a.toString(),10)]))),s.querySelector(".e-treecolumn-container .e-treegridexpand")){var d=s.querySelector(".e-treecolumn-container .e-treegridexpand"),l=this.rowTemplate?this.grid.getCurrentViewRecords()[i[parseInt(a.toString(),10)].rowIndex]:this.grid.getRowObjectFromUID(i[parseInt(a.toString(),10)].getAttribute("data-Uid")).data;!C.isNullOrUndefined(d)&&l.expanded&&(C.removeClass([d],"e-treegridexpand"),C.addClass([d],"e-treegridcollapse"));for(var p=[],h=this.getRows(),c=0;c<h.length;c++)h[parseInt(c.toString(),10)].querySelector(".e-gridrowindex"+l.index+"level"+(l.level+1))&&p.push(h[parseInt(c.toString(),10)]);p.length&&l.expanded&&this.collapseRemoteChild({record:l,rows:p},!1)}}this.grid.pageSettings.totalRecordsCount-=i.length},c.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?C.SanitizeHtmlHelper.sanitize(e):e},c.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this),this.grid.on("partial-filter-update",this.partialFilterUpdate,this),this.grid.on("get-row-cells",this.getCellsByTableName,this)},c.prototype.updateResultModel=function(e){this.dataResults=e},c.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender),this.grid.off("last-rowcell-border-updated",this.lastRowCellBorderUpdated),this.grid.off("partial-filter-update",this.partialFilterUpdate),this.grid.off("get-row-cells",this.getCellsByTableName))},c.prototype.getCellsByTableName=function(e){var t;Array.isArray(e.elements)||(e.elements=[]),e.rowIndex<this.grid.getDataRows().length&&(t=[].slice.call(this.grid.getDataRows()[parseInt(e.rowIndex.toString(),10)].getElementsByClassName("e-rowcell")),Array.prototype.push.apply(e.elements,t))},c.prototype.partialFilterUpdate=function(e){e=e.gridFiltered;this.notify("updateFilterRecs",{data:e})},c.prototype.filterByColumn=function(e,t,i,r,n,o,a,s){this.grid.filterByColumn(e,t,i,r,n,o,a,s)},c.prototype.clearFiltering=function(){this.grid.clearFiltering()},c.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},c.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},c.prototype.selectRows=function(e){this.grid.selectRows(e)},c.prototype.clearSelection=function(){C.isNullOrUndefined(this.grid.selectionModule)||(this.grid.selectionModule.actualTarget=null),this.grid.clearSelection()},c.prototype.copy=function(e){this.clipboardModule.copy(e)},c.prototype.paste=function(e,t,i){this.clipboardModule.paste(e,t,i)},c.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},c.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},c.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},c.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},c.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},c.prototype.getMovableRows=function(){return this.grid.getRows()},c.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},c.prototype.getFrozenRightRows=function(){return this.grid.getRows()},c.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},c.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},c.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},c.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},c.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},c.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},c.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},c.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},c.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},c.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},c.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},c.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},c.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},c.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},c.prototype.getFrozenColumns=function(){return this.getFrozenCount(!C.isNullOrUndefined(this.columns)&&this.columns,0)+this.frozenColumns},c.prototype.getFrozenCount=function(e,t){for(var i=0,r=e.length;i<r;i++)e[parseInt(i.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&t++;return t},c.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},c.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},c.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},c.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},c.prototype.reorderRows=function(e,t,i){C.isNullOrUndefined(this.rowDragAndDropModule)||this.rowDragAndDropModule.reorderRows(e,t,i)},c.prototype.indent=function(e){C.isNullOrUndefined(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"indent")},c.prototype.outdent=function(e){C.isNullOrUndefined(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent")},c.prototype.getPageSizeByHeight=function(e){var t,i,r;return C.isNullOrUndefined(e)&&(e=(t=document.getElementById(this.element.id))?t.clientHeight:(t=this.element)&&(t.offsetHeight||t.clientHeight)||0),(this.allowTextWrap&&"Header"===this.textWrapSettings.wrapMode||!this.allowTextWrap)&&(t=0,"string"==typeof e&&-1!==e.indexOf("%")&&(e=parseInt(e,10)/100*this.element.clientHeight),this.grid.getNoncontentHeight()+this.grid.getRowHeight()<e&&(i=this.grid.getNoncontentHeight(),(r=document.getElementsByClassName("e-pagerexternalmsg")[0])&&(i+=r.clientHeight),t=(e-i)/this.grid.getRowHeight()),0<this.frozenRows&&(t+=this.frozenRows),0<t)?Math.floor(t):0},h([C.Property(0)],c.prototype,"frozenRows",void 0),h([C.Property(0)],c.prototype,"frozenColumns",void 0),h([C.Property("Ellipsis")],c.prototype,"clipMode",void 0),h([C.Property([])],c.prototype,"columns",void 0),h([C.Property(null)],c.prototype,"childMapping",void 0),h([C.Property(null)],c.prototype,"hasChildMapping",void 0),h([C.Property(0)],c.prototype,"treeColumnIndex",void 0),h([C.Property(null)],c.prototype,"idMapping",void 0),h([C.Property(null)],c.prototype,"parentIdMapping",void 0),h([C.Property(!1)],c.prototype,"enableCollapseAll",void 0),h([C.Property(null)],c.prototype,"expandStateMapping",void 0),h([C.Property(!1)],c.prototype,"allowRowDragAndDrop",void 0),h([C.Property([])],c.prototype,"dataSource",void 0),h([C.Property()],c.prototype,"query",void 0),h([C.Property()],c.prototype,"cloneQuery",void 0),h([C.Property("AllPages")],c.prototype,"printMode",void 0),h([C.Property(!1)],c.prototype,"allowPaging",void 0),h([C.Property(!0)],c.prototype,"loadChildOnDemand",void 0),h([C.Property(!1)],c.prototype,"allowTextWrap",void 0),h([C.Complex({},e)],c.prototype,"textWrapSettings",void 0),h([C.Property(!1)],c.prototype,"allowReordering",void 0),h([C.Property(!1)],c.prototype,"allowResizing",void 0),h([C.Property(!1)],c.prototype,"autoCheckHierarchy",void 0),h([C.Complex({},n)],c.prototype,"pageSettings",void 0),h([C.Complex({},w.RowDropSettings)],c.prototype,"rowDropSettings",void 0),h([C.Property("USD")],c.prototype,"currencyCode",void 0),h([C.Property()],c.prototype,"pagerTemplate",void 0),h([C.Property(!1)],c.prototype,"showColumnMenu",void 0),h([C.Property(!1)],c.prototype,"showColumnChooser",void 0),h([C.Complex({},gi)],c.prototype,"columnChooserSettings",void 0),h([C.Property(!1)],c.prototype,"allowSorting",void 0),h([C.Property(!0)],c.prototype,"allowMultiSorting",void 0),h([C.Complex({},l)],c.prototype,"sortSettings",void 0),h([C.Collection([],a)],c.prototype,"aggregates",void 0),h([C.Complex({},s)],c.prototype,"editSettings",void 0),h([C.Property(!1)],c.prototype,"allowFiltering",void 0),h([C.Property()],c.prototype,"detailTemplate",void 0),h([C.Complex({},J)],c.prototype,"filterSettings",void 0),h([C.Complex({},oe)],c.prototype,"searchSettings",void 0),h([C.Property()],c.prototype,"toolbar",void 0),h([C.Property()],c.prototype,"toolbarTemplate",void 0),h([C.Property("Default")],c.prototype,"gridLines",void 0),h([C.Property()],c.prototype,"contextMenuItems",void 0),h([C.Property()],c.prototype,"columnMenuItems",void 0),h([C.Property()],c.prototype,"rowTemplate",void 0),h([C.Property("Parent")],c.prototype,"copyHierarchyMode",void 0),h([C.Property(null)],c.prototype,"rowHeight",void 0),h([C.Property(!0)],c.prototype,"enableAltRow",void 0),h([C.Property(!0)],c.prototype,"allowKeyboard",void 0),h([C.Property(!1)],c.prototype,"enableHover",void 0),h([C.Property(!1)],c.prototype,"enableAutoFill",void 0),h([C.Property(!1)],c.prototype,"enableAdaptiveUI",void 0),h([C.Property(!1)],c.prototype,"enableImmutableMode",void 0),h([C.Property(!1)],c.prototype,"enableStickyHeader",void 0),h([C.Property()],c.prototype,"emptyRecordTemplate",void 0),h([C.Property("auto")],c.prototype,"height",void 0),h([C.Property("auto")],c.prototype,"width",void 0),h([C.Complex({},Y)],c.prototype,"loadingIndicator",void 0),h([C.Property(!0)],c.prototype,"enableVirtualMaskRow",void 0),h([C.Property(!1)],c.prototype,"enableVirtualization",void 0),h([C.Property(!1)],c.prototype,"enableColumnVirtualization",void 0),h([C.Property(!1)],c.prototype,"enableHtmlSanitizer",void 0),h([C.Property(!1)],c.prototype,"enableInfiniteScrolling",void 0),h([C.Complex({},ai)],c.prototype,"infiniteScrollSettings",void 0),h([C.Property("All")],c.prototype,"columnQueryMode",void 0),h([C.Property(!0)],c.prototype,"allowSelection",void 0),h([C.Property(-1)],c.prototype,"selectedRowIndex",void 0),h([C.Property(null)],c.prototype,"isRowSelectable",void 0),h([C.Complex({},Lt)],c.prototype,"selectionSettings",void 0),h([C.Property(!1)],c.prototype,"allowExcelExport",void 0),h([C.Property(!1)],c.prototype,"allowPdfExport",void 0),h([C.Property(!1)],c.prototype,"enableColumnSpan",void 0),h([C.Property(!1)],c.prototype,"enableRowSpan",void 0),h([C.Event()],c.prototype,"created",void 0),h([C.Event()],c.prototype,"load",void 0),h([C.Event()],c.prototype,"expanding",void 0),h([C.Event()],c.prototype,"expanded",void 0),h([C.Event()],c.prototype,"collapsing",void 0),h([C.Event()],c.prototype,"collapsed",void 0),h([C.Event()],c.prototype,"cellSave",void 0),h([C.Event()],c.prototype,"cellSaved",void 0),h([C.Event()],c.prototype,"actionBegin",void 0),h([C.Event()],c.prototype,"actionComplete",void 0),h([C.Event()],c.prototype,"beginEdit",void 0),h([C.Event()],c.prototype,"batchAdd",void 0),h([C.Event()],c.prototype,"batchDelete",void 0),h([C.Event()],c.prototype,"batchCancel",void 0),h([C.Event()],c.prototype,"beforeBatchAdd",void 0),h([C.Event()],c.prototype,"beforeBatchDelete",void 0),h([C.Event()],c.prototype,"beforeBatchSave",void 0),h([C.Event()],c.prototype,"cellEdit",void 0),h([C.Event()],c.prototype,"actionFailure",void 0),h([C.Event()],c.prototype,"dataBound",void 0),h([C.Event()],c.prototype,"dataSourceChanged",void 0),h([C.Event()],c.prototype,"dataStateChange",void 0),h([C.Event()],c.prototype,"recordDoubleClick",void 0),h([C.Event()],c.prototype,"rowDataBound",void 0),h([C.Event()],c.prototype,"detailDataBound",void 0),h([C.Event()],c.prototype,"queryCellInfo",void 0),h([C.Event()],c.prototype,"rowSelecting",void 0),h([C.Event()],c.prototype,"rowSelected",void 0),h([C.Event()],c.prototype,"rowDeselecting",void 0),h([C.Event()],c.prototype,"rowDeselected",void 0),h([C.Event()],c.prototype,"headerCellInfo",void 0),h([C.Event()],c.prototype,"cellSelecting",void 0),h([C.Event()],c.prototype,"columnMenuOpen",void 0),h([C.Event()],c.prototype,"columnMenuClick",void 0),h([C.Event()],c.prototype,"cellSelected",void 0),h([C.Event()],c.prototype,"cellDeselecting",void 0),h([C.Event()],c.prototype,"cellDeselected",void 0),h([C.Event()],c.prototype,"resizeStart",void 0),h([C.Event()],c.prototype,"resizing",void 0),h([C.Event()],c.prototype,"resizeStop",void 0),h([C.Event()],c.prototype,"columnDragStart",void 0),h([C.Event()],c.prototype,"columnDrag",void 0),h([C.Event()],c.prototype,"columnDrop",void 0),h([C.Event()],c.prototype,"checkboxChange",void 0),h([C.Event()],c.prototype,"printComplete",void 0),h([C.Event()],c.prototype,"beforePrint",void 0),h([C.Event()],c.prototype,"toolbarClick",void 0),h([C.Event()],c.prototype,"beforeDataBound",void 0),h([C.Event()],c.prototype,"contextMenuOpen",void 0),h([C.Event()],c.prototype,"contextMenuClick",void 0),h([C.Event()],c.prototype,"beforeCopy",void 0),h([C.Event()],c.prototype,"beforePaste",void 0),h([C.Event()],c.prototype,"rowDrag",void 0),h([C.Event()],c.prototype,"rowDragStart",void 0),h([C.Event()],c.prototype,"rowDragStartHelper",void 0),h([C.Event()],c.prototype,"rowDrop",void 0),h([C.Event()],c.prototype,"pdfQueryCellInfo",void 0),h([C.Event()],c.prototype,"pdfHeaderQueryCellInfo",void 0),h([C.Event()],c.prototype,"excelQueryCellInfo",void 0),h([C.Event()],c.prototype,"pdfAggregateQueryCellInfo",void 0),h([C.Event()],c.prototype,"excelAggregateQueryCellInfo",void 0),h([C.Event()],c.prototype,"excelHeaderQueryCellInfo",void 0),h([C.Event()],c.prototype,"beforeExcelExport",void 0),h([C.Event()],c.prototype,"excelExportComplete",void 0),h([C.Event()],c.prototype,"beforePdfExport",void 0),h([C.Event()],c.prototype,"pdfExportComplete",void 0),vi=h([C.NotifyPropertyChanges],c));function c(e,t){e=Ri.call(this,e,t)||this;e.dataResults={},e.uniqueIDCollection={},e.uniqueIDFilterCollection={},e.changedRecords="changedRecords",e.deletedRecords="deletedRecords",e.addedRecords="addedRecords",e.indentOutdentAction="indentOutdentAction",e.isFromChartSide=!1,e.modifiedRecords=[],e.stackedHeader=!1,e.freezeColumnRefresh=!0,e.componentRefresh=C.Component.prototype.refresh,e.isComponentRefresh=!1,e.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),r=!0,n=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","index"],o=0;o<i.length;o++)if(e[i[parseInt(o.toString(),10)]]!==t[i[parseInt(o.toString(),10)]]&&-1===n.indexOf(i[parseInt(o.toString(),10)]))if(!(e[i[parseInt(o.toString(),10)]]instanceof Date&&t[i[parseInt(o.toString(),10)]]instanceof Date)||e[i[parseInt(o.toString(),10)]].getTime()!==t[i[parseInt(o.toString(),10)]].getTime()){r=!1;break}return r}return!1},vi.Inject(qt,ce),C.setValue("mergePersistData",e.mergePersistTreeGridData,e),C.isNullOrUndefined(e.injectedModules.Logger)||w.Grid.Inject(w.Logger),e.injectedModules.filter(function(e){"freeze"===e.prototype.getModuleName()&&w.Grid.Inject(w.Freeze)});return e.grid=new w.Grid,e}xi.prototype.getModuleName=function(){return"reorder"},xi.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.updateTreeColumn,this)},xi.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.updateTreeColumn)},xi.prototype.destroy=function(){this.removeEventListener()},xi.prototype.updateTreeColumn=function(){this.parent.getTreeColumn()};e=xi;function xi(e){w.Grid.Inject(w.Reorder),this.parent=e,this.addEventListener()}Ci.prototype.autoFitColumns=function(e){this.parent.grid.autoFitColumns(e)},Ci.prototype.getModuleName=function(){return"resize"},Ci.prototype.destroy=function(){this.parent.isDestroyed||this.parent.grid.resizeModule.destroy()};gi=Ci;function Ci(e){w.Grid.Inject(w.Resize),this.parent=e}u.prototype.getChildrecordsByParentID=function(t){var e=this.parent.dataSource instanceof b.DataManager&&x(this.parent)?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;return e.filter(function(e){return e.uniqueID===t})},u.prototype.addEventListener=function(){this.parent.on(It,this.Rowdraging,this),this.parent.on(Rt,this.rowDropped,this),this.parent.on(St,this.rowsAdded,this),this.parent.on(wt,this.rowsRemoved,this)},u.prototype.reorderRows=function(e,t,i){var r=this.parent;if(e[0]!==t&&-1!==["above","below","child"].indexOf(i)){var n="action";if(e[0]!==t&&-1!==["above","below","child"].indexOf(i)){"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment"),this.parent.dropPosition=this.dropPosition;for(var o=[],a=0;a<e.length;a++){var s=this.parent.getRowByIndex(e[parseInt(a.toString(),10)]).rowIndex;o[parseInt(a.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(s.toString(),10)]}var d,l,p,i={data:o,dropIndex:t};R(this.parent)||this.dropRows(i,!0),r.isLocalData&&(r.flatData=this.orderToIndex(r.flatData)),"outdenting"!==this.parent[n]||C.isNullOrUndefined(o[0].parentItem)||(o[0].level=o[0].parentItem.level+1),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition&&(s=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"indenting"===this.parent[n]?this.parent.treeColumnIndex:void 0,d=this.parent.getRows()[e[0]],r=i.data[0],p=[],(l=[]).push(r),p.push(d),r=M(this.parent,i.data[0].parentUniqueID),t=this.parent.getRows()[parseInt(t.toString(),10)],l.push(r),p.push(t),this.updateRowAndCellElements(l,p,s)),this.parent.enableImmutableMode&&"outdenting"===this.parent[n]&&(s=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"outdenting"===this.parent[n]?this.parent.treeColumnIndex:void 0,r=i.data[0],d=this.parent.getRows()[e[0]],p=[],(l=[]).push(r),p.push(d),this.updateRowAndCellElements(l,p,s))}}},u.prototype.updateRowAndCellElements=function(e,t,i){for(var r=0;r<e.length;r++)this.parent.renderModule.cellRender({data:e[parseInt(r.toString(),10)],cell:t[parseInt(r.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.parent.action&&"outdenting"!==this.parent.action||this.parent.renderModule.RowModifier({data:e[parseInt(r.toString(),10)],row:t[parseInt(r.toString(),10)]})},u.prototype.indentOutdentAction=function(e,t){var i=this.parent,r="dropIndex",n=-1;if(!C.isNullOrUndefined(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?n=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(n=this.parent.selectedRowIndex),this.selectedItem=C.isNullOrUndefined(e)?i.getCurrentViewRecords()[parseInt(n.toString(),10)]:e;e=this.parent.getPrimaryKeyFieldNames()[0];if(e){var o,e=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+e]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==n?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(e),this.selectedRecord=this.parent[this.selectedRecords]=-1!==n?i.getCurrentViewRecords()[parseInt(n.toString(),10)]:this.selectedItem,"indent"===t){var a=i.getCurrentViewRecords()[this.selectedRow.rowIndex-1],s=void 0;if(0!==this.selectedRow.rowIndex&&-1!==this.selectedRow.rowIndex&&i.getCurrentViewRecords()[this.selectedRow.rowIndex].level-a.level!=1){if(a.level>this.selectedRecord.level)for(var d=0;d<i.getCurrentViewRecords().length;d++)i.getCurrentViewRecords()[parseInt(d.toString(),10)].taskData===a.parentItem.taskData&&(s=d,i.enableVirtualization)&&(s=parseInt(i.getRows()[parseInt(d.toString(),10)].getAttribute("aria-rowindex"),10)-1);else s=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||a.level>this.selectedRecord.level||(s=parseInt(this.selectedRow.getAttribute("aria-rowindex"),10)-2),i.action="indenting",i[r]=s,this.eventTrigger("indenting",s)}}else"outdent"===t&&(e=-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex,n=0===i.getCurrentViewRecords()[this.selectedRow.rowIndex].level,e||n||(o=this.selectedRecord.parentItem,-1!==(s=i.getCurrentViewRecords().findIndex(function(e){return e.uniqueID===o.uniqueID}))&&(this.parent.enableVirtualization&&this.selectedRecord&&(t=this.parent.getRows()[parseInt(s.toString(),10)].getAttribute("aria-rowindex"),s=parseInt(t,10)-1),i.action="outdenting",i[r]=s,this.eventTrigger("outdenting",s))))}}},u.prototype.eventTrigger=function(e,t){var i=this,e={action:e,cancel:!1,data:[this.parent[this.selectedRecords]],row:this.parent[this.selectedRows]};this.parent.trigger(ve,e,function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"below"):i.reorderRows([i.selectedRow.rowIndex],t,"below")))})},u.prototype.orderToIndex=function(e){for(var t,i=0;i<e.length;i++)e[parseInt(i.toString(),10)].index=i,C.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem)||(t=C.getValue("uniqueIDCollection."+e[parseInt(i.toString(),10)].parentUniqueID,this.parent),e[parseInt(i.toString(),10)].parentItem.index=t.index);return e},u.prototype.rowsAdded=function(e){for(var t,i,r,n=e.records,o=e.records.length-1;-1<o;o--)(r=n[parseInt(o.toString(),10)]).parentUniqueID&&(i=n.filter(function(e){return e.uniqueID===r.parentUniqueID})).length&&(t=i[0].childRecords.indexOf(r),i=i[0],-1!==t)&&(C.isNullOrUndefined(this.parent.idMapping)&&(i.childRecords.splice(t,1),i.childRecords.length||(i.hasChildRecords=!1,i.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0);if(C.isNullOrUndefined(this.parent.dataSource)||!this.parent.dataSource.length){for(var a,s=this.parent,d=e.records,o=e.records.length-1;-1<o;o--){a=d[parseInt(o.toString(),10)],!o&&a.hasChildRecords&&(a.taskData[this.parent.parentIdMapping]=null);if(C.isNullOrUndefined(s.parentIdMapping)||(s.childMapping=null),C.isNullOrUndefined(a.taskData)||C.isNullOrUndefined(s.childMapping)||Object.prototype.hasOwnProperty.call(a.taskData,s.childMapping)||(a.taskData[s.childMapping]=[]),!C.isNullOrUndefined(a[s.childMapping])&&Object.prototype.hasOwnProperty.call(a,s.childMapping)&&a[s.childMapping].length&&!this.isDraggedWithChild&&!C.isNullOrUndefined(s.parentIdMapping))for(var l=a[s.childMapping],p=0;p<l.length;p++)-1===d.indexOf(l[parseInt(p.toString(),10)])&&(d.splice(p,0,l[parseInt(p.toString(),10)]),l[parseInt(p.toString(),10)].taskData=C.extend({},l[parseInt(p.toString(),10)]),o+=1);Object.prototype.hasOwnProperty.call(a,s.parentIdMapping)&&null!==a[s.parentIdMapping]&&!this.isDraggedWithChild&&(a.taskData[s.parentIdMapping]=null,delete a.parentItem,delete a.parentUniqueID),C.isNullOrUndefined(s.dataSource)&&(s.dataSource=[]),s.dataSource.splice(0,0,a.taskData)}s.setProperties({dataSource:s.dataSource},!1)}else{for(o=0;o<n.length;o++)C.setValue("uniqueIDCollection."+n[parseInt(o.toString(),10)].uniqueID,n[parseInt(o.toString(),10)],this.parent);e={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof b.DataManager?(this.treeGridData=this.parent.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource),C.isNullOrUndefined(this.dropPosition)&&(this.dropPosition="bottomSegment",e.dropIndex=1<this.parent.getCurrentViewRecords().length?this.parent.getCurrentViewRecords().length-1:e.dropIndex,e.data=e.data.map(function(e){return e.hasChildRecords&&C.isNullOrUndefined(e.parentItem)||(delete e.parentItem,delete e.parentUniqueID),e.level=0,e})),this.dropRows(e)}},u.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)this.draggedRecord=e.records[parseInt(t.toString(),10)],(this.draggedRecord.hasChildRecords||this.draggedRecord.parentItem&&-1!==this.parent.grid.dataSource.indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0])||0===this.draggedRecord.level)&&this.deleteDragRow()},u.prototype.refreshGridDataSource=function(){var e,t=this.draggedRecord,i=this.droppedRecord,r=this.parent,n=this.parent.dataSource instanceof b.DataManager&&x(this.parent)?r.dataSource.dataSource.json:r.dataSource;if(!n||C.isNullOrUndefined(i)||i.parentItem||C.isNullOrUndefined(i.taskData)){if(!this.parent.parentIdMapping&&!C.isNullOrUndefined(i)&&i.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition))for(var o=this.getChildrecordsByParentID(i.parentUniqueID)[0].childRecords,a=0;a<o.length;a++)i.parentItem.taskData[this.parent.childMapping][parseInt(a.toString(),10)]=o[parseInt(a.toString(),10)].taskData}else{for(var s,d=Object.keys(n),a=0;a<d.length;a++)n[parseInt(a.toString(),10)][this.parent.childMapping]?n[parseInt(a.toString(),10)][this.parent.childMapping]===i.taskData[this.parent.childMapping]&&(e=a):(s=this.parent.getPrimaryKeyFieldNames()[0],n[parseInt(a.toString(),10)][""+s]===i.taskData[""+s]&&(e=a));this.parent.idMapping||(r="topSegment"===this.dropPosition?0:1,"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition)||n.splice(e+r,0,t.taskData)}this.parent.parentIdMapping&&(t.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(t[this.parent.parentIdMapping]=i[this.parent.parentIdMapping],t.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]):(t[this.parent.parentIdMapping]=i[this.parent.idMapping],t.taskData[this.parent.parentIdMapping]=i[this.parent.idMapping]):(t.taskData[this.parent.parentIdMapping]=null,t[this.parent.parentIdMapping]=null))},u.prototype.removeFirstrowBorder=function(e){var t="bottomSegment"===this.dropPosition;0<this.parent.element.getElementsByClassName("e-firstrow-border").length&&e&&(0!==e.rowIndex||t)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},u.prototype.removeLastrowBorder=function(e){var t;!e||e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")||(e=(this.parent.enableVirtualization?this.parent.getRows()[this.parent.getCurrentViewRecords().length-1]:this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1)).getAttribute("data-uid")!==e.getAttribute("data-uid")||"topSegment"===this.dropPosition,(t=this.parent.element.getElementsByClassName("e-lastrow-border")[0])&&e&&t.remove())},u.prototype.updateIcon=function(e,t,i){var r=i.target?C.closest(i.target,"tr"):null,n=(this.dropPosition=void 0,0);this.removeFirstrowBorder(r),this.removeLastrowBorder(r);for(var o=0;o<i.rows.length;o++)(C.isNullOrUndefined(r)||r.getAttribute("data-uid")!==i.rows[parseInt(o.toString(),10)].getAttribute("data-uid"))&&w.parentsUntil(i.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem(),C.isNullOrUndefined(this.parent.rowDropSettings.targetID)&&(this.removetopOrBottomBorder(),this.removeChildBorder()));var a=this.parent,s=0,d=a.toolbar&&a.toolbar.length?document.getElementById(a.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,l=this.getOffset(a.element),l=a.getHeaderContent().offsetHeight+l.top+d,d=a.getContent().firstElementChild.scrollTop,s=(C.isNullOrUndefined(r)||(n=r.offsetTop-d),this.parent.enableVirtualization?r.getBoundingClientRect().top:n+l+0),a=((0!==e[0].offsetHeight&&C.isNullOrUndefined(r)?s+e[0].offsetHeight:s+r.offsetHeight)-s)/3,d=s+a,n=d+a,l=n+a,s=w.getObject("originalEvent.event",i),a=w.getObject("originalEvent.event",i),p="mousemove"===s.type?s.pageY:C.isNullOrUndefined(a)||C.isNullOrUndefined(a.changedTouches)?null:a.changedTouches[0].pageY,s=(p=this.parent.enableVirtualization?"mousemove"===s.type?s.clientY:C.isNullOrUndefined(a)||C.isNullOrUndefined(a.changedTouches)?null:a.changedTouches[0].clientY:p)<=d,a=d<p&&p<=n,d=n<p&&p<=l,n=!0;return(s||a||d)&&(s&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(r),this.removeErrorElem(),this.removeLastrowBorder(r)),a&&"Invalid"!==this.dropPosition&&(this.removetopOrBottomBorder(),this.dropPosition="middleSegment",this.addLastRowborder(r),this.addFirstrowBorder(r)),d&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(r),this.removeFirstrowBorder(r)),(s||d)&&"Invalid"!==this.dropPosition?(n=this.updateBorderStatus(e,t),this.topOrBottomBorder(i.target,n)):a&&"Invalid"!==this.dropPosition&&(p=[],l=C.closest(i.target,"tr"),p=[].slice.call(l.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")),n=this.updateBorderStatus(e,t),0<p.length)&&n&&this.addRemoveClasses(p,!0,"e-childborder")),this.dropPosition},u.prototype.updateBorderStatus=function(s,d){var n=this,l=!0,p=this.parent.grid.getRows(),h=[],o=!1,e=(C.isNullOrUndefined(this.parent.detailTemplate)||(p=this.parent.getDataRows(),o=!0),this.parent.treeColumnIndex),c=this.parent.allowRowDragAndDrop?o?e+2:e+1:o?e+1:e,u=(C.isNullOrUndefined(this.parent.rowDropSettings.targetID)||(c=e),s),g=[p[""+d]];return"topSegment"===this.dropPosition&&(s.filter(function(e){if(!(C.isNullOrUndefined(e)||C.isNullOrUndefined(e.cells)||C.isNullOrUndefined(g[0])||C.isNullOrUndefined(g[0].cells))){var t=/index(\d+)|level(\d+)/g,e=null==e?void 0:e.cells[""+c].className.match(t),i=g[0].cells[""+c].className.match(t);if(!(C.isNullOrUndefined(i)||C.isNullOrUndefined(i)||C.isNullOrUndefined(e))){var r=+e[1].match(/\d+/)[0],e=+i[1].match(/\d+/)[0],n=!1;if(0==r||r==e){for(var o=0;o<p.length;o++)if((n=p[parseInt(o.toString(),10)]===u[0]?!0:n)&&p[parseInt(o.toString(),10)]!==u[0]){var a=+p[parseInt(o.toString(),10)].cells[""+c].className.match(t)[1].match(/\d+/)[0];if(!(a!=r&&r<a))break;h.push(p[parseInt(o.toString(),10)])}r==e&&(0<h.length&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1==d-(h.length+1)||0===h.length&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1==d-1)&&(l=!1)}}}return!0}),l=!(!C.isNullOrUndefined(s)&&0===h.length&&!C.isNullOrUndefined(s[0].getAttribute("aria-rowindex"))&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1==d-1&&C.isNullOrUndefined(s[0]))&&l),"bottomSegment"===this.dropPosition&&(g.filter(function(e){if(!(C.isNullOrUndefined(e)||C.isNullOrUndefined(e.cells)||C.isNullOrUndefined(u[0])||C.isNullOrUndefined(u[0].cells))){var t=/index(\d+)|level(\d+)/g,e=null==e?void 0:e.cells[""+c].className.match(t),i=u[0].cells[""+c].className.match(t);if(!C.isNullOrUndefined(i)&&!C.isNullOrUndefined(e)){var r=+e[1].match(/\d+/)[0],e=+i[1].match(/\d+/)[0],n=!1;if(0==r||r==e){for(var o=0;o<p.length;o++)if((n=p[parseInt(o.toString(),10)]===g[0]?!0:n)&&p[parseInt(o.toString(),10)]!==g[0]){var a=+p[parseInt(o.toString(),10)].cells[""+c].className.match(t)[1].match(/\d+/)[0];if(!(a!=r&&r<a))break;h.push(p[parseInt(o.toString(),10)])}!C.isNullOrUndefined(s)&&r==e&&(0<h.length&&!C.isNullOrUndefined(s[0].getAttribute("aria-rowindex"))&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1===d+(h.length+1)||0===h.length&&!C.isNullOrUndefined(s[0].getAttribute("aria-rowindex"))&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1===d+1)&&(l=!1)}}}return!0}),l=!(!C.isNullOrUndefined(s)&&0===h.length&&!C.isNullOrUndefined(s[0].getAttribute("aria-rowindex"))&&parseInt(s[0].getAttribute("aria-rowindex"),10)-1===d+1&&C.isNullOrUndefined(s[0]))&&l),"middleSegment"===this.dropPosition&&g.filter(function(e){if(C.isNullOrUndefined(e)||C.isNullOrUndefined(e.cells)||C.isNullOrUndefined(u[0])||C.isNullOrUndefined(u[0].cells))return!0;for(var t=0;t<u.length;t++){var i=g[0].rowIndex,r=u[parseInt(t.toString(),10)].cells[""+c].className.match(/index(\d+)|level(\d+)/g);if(!r)return!0;r=parseInt(r.find(function(e){return e.includes("index")}).match(/\d+/)[0]||"0",10);if(o&&(i/=2),r!==i||n.parent.rowDropSettings.targetID){l=!0;break}l=!1}return l||(n.dropPosition="Invalid",n.addErrorElem()),l}),this.canDrop=l},u.prototype.removeChildBorder=function(){var e;0<(e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"))).length&&this.addRemoveClasses(e,!1,"e-childborder")},u.prototype.addFirstrowBorder=function(e){var t,i,r=this.parent.element,n=this.parent;e&&0===e.rowIndex&&!e.classList.contains("e-emptyrow")&&(e=this.parent.createElement("div",{className:"e-firstrow-border"}),t=this.parent.getHeaderContent(),i=0,n.toolbar&&(i=n.toolbarModule.getToolbar().offsetHeight),(n=!C.isNullOrUndefined(this.parent.rowDropSettings.targetID))&&(e.style.top=this.parent.grid.element.getElementsByClassName("e-gridheader")[0].offsetHeight+i+"px"),e.style.width=n?r.offsetWidth+"px":r.offsetWidth-this.getScrollWidth()+"px",t.querySelectorAll(".e-firstrow-border").length||t.appendChild(e))},u.prototype.addLastRowborder=function(e){var t;!e||(t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")))||e&&!t&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")===e.getAttribute("data-uid")&&(t=this.parent.createElement("div",{className:"e-lastrow-border"}),e=this.parent.getContent(),t.style.width=this.parent.element.offsetWidth-this.getScrollWidth()+"px",e.querySelectorAll(".e-lastrow-border").length||(e.classList.add("e-treegrid-relative"),e.appendChild(t),t.style.bottom=this.getScrollWidth()+"px"))},u.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?w.Scroll.getScrollBarWidth():0},u.prototype.addErrorElem=function(){var e,t,i,r=document.getElementsByClassName("e-cloneproperties")[0],n="sanitize";r.querySelectorAll(".e-errorelem").length||this.parent.rowDropSettings.targetID||((e=document.createElement("div")).classList.add("e-errorcontainer","e-icons","e-errorelem"),i=r.querySelector(".e-rowcell"),r=r.querySelector(".errorValue"),t=i.innerHTML,r&&(t=this.parent[n](r.innerHTML),r.parentNode.removeChild(r)),i.innerHTML="",(r=document.createElement("span")).className="errorValue",r.style.paddingLeft="16px",r.innerHTML=this.parent[n](t),i.appendChild(e),i.appendChild(r),n=document.querySelector(".e-dropitemscount"),this.hasDropItem&&n&&(t=parseInt(n.style.left,10)+e.offsetWidth+16,i=this.parent.enableRtl?0:t,n.style.left=i+"px",this.hasDropItem=!1))},u.prototype.removeErrorElem=function(){var e,t=document.querySelector(".e-errorelem"),i=document.querySelector(".errorValue"),r=document.querySelector(".e-dropitemscount");t&&(r&&(e=parseInt(r.style.left,10)-t.offsetWidth-16,C.setStyleAttribute(i,{paddingLeft:"0px"}),this.parent.enableRtl||C.setStyleAttribute(r,{left:e+"px"})),t.remove()),this.hasDropItem=!0},u.prototype.topOrBottomBorder=function(e,t){void 0===t&&(t=!0);var e=C.closest(e,"tr"),e=e?Array.from(e.querySelectorAll(".e-rowcell, .e-rowdragdrop, .e-detailrowcollapse")):[];e.length&&(t=t?this.addRemoveClasses.bind(this,e,!0):this.addRemoveClasses.bind(this,e,!1,"e-dragborder"),"topSegment"===this.dropPosition&&(t("e-droptop"),e=this.parent.element.querySelector(".e-lastrow-dragborder"))&&e.remove(),"bottomSegment"===this.dropPosition)&&t("e-dropbottom")},u.prototype.removetopOrBottomBorder=function(){var e=[],e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop"));(e=this.parent.rowDropSettings.targetID?[].slice.call(document.querySelectorAll(".e-dropbottom, .e-droptop")):e).length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},u.prototype.addRemoveClasses=function(e,t,i){for(var r=0,n=e.length;r<n;r++)t?e[parseInt(r.toString(),10)].classList.add(i):e[parseInt(r.toString(),10)].classList.remove(i)},u.prototype.getOffset=function(e){var e=e.getBoundingClientRect(),t=document.body,i=document.documentElement,r=window.pageYOffset||i.scrollTop||t.scrollTop,n=window.pageXOffset||i.scrollLeft||t.scrollLeft,o=i.clientTop||t.clientTop||0,i=i.clientLeft||t.clientLeft||0,t=e.top+r-o,r=e.left+n-i;return{top:Math.round(t),left:Math.round(r)}},u.prototype.Rowdraging=function(e){var t,i,r,n,o,a=this.parent,s=this.parent.element.querySelector(".e-cloneproperties");s&&(s.style.cursor="",t=e.target?C.closest(e.target,"tr"):null,(o=-1)===(o=C.isNullOrUndefined(this.parent.detailTemplate)?t?t.rowIndex:-1:t?this.parent.getDataRows().indexOf(t):-1)?(this.canDrop=!1,this.addErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder()):(t=Array.isArray(e.data)?e.data:[e.data],i=a.getCurrentViewRecords()[parseInt(o.toString(),10)],a.rowDropSettings.targetID&&(n=w.parentsUntil(e.target,"e-treegrid"))&&n.id===this.parent.rowDropSettings.targetID&&(i=(r=n.ej2_instances[0]).getCurrentViewRecords()[parseInt(o.toString(),10)]),this.removeErrorElem(),this.canDrop=!0,this.ensuredropPosition(t,i),a.rowDropSettings.targetID||!this.canDrop||C.isNullOrUndefined(e.rows[0])||a.rowDragAndDropModule.updateIcon(e.rows,o,e),a.rowDropSettings.targetID&&(n=w.parentsUntil(e.target,"e-treegrid"))&&n.id===this.parent.rowDropSettings.targetID&&((r=n.ej2_instances[0]).rowDragAndDropModule.updateIcon(e.rows,o,e),this.dropPosition=r.rowDragAndDropModule.dropPosition),e.target&&C.closest(e.target,"#"+a.rowDropSettings.targetID)&&((n=w.parentsUntil(e.target,"e-treegrid"))||(s.style.cursor="default"))))},u.prototype.rowDropped=function(e){var t=this.parent;if(t.rowDropSettings.targetID){if((e.target&&C.closest(e.target,"#"+t.rowDropSettings.targetID)||w.parentsUntil(e.target,"e-treegrid")&&w.parentsUntil(e.target,"e-treegrid").id===t.rowDropSettings.targetID||e.target&&document.getElementById(t.rowDropSettings.targetID))&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),C.setValue("dropPosition",this.dropPosition,e),t.trigger(mt,e),!e.cancel)&&t.rowDropSettings.targetID){if("Invalid"===this.dropPosition&&!this.canDrop)return;this.dragDropGrid(e),t.isLocalData&&(t.flatData=this.orderToIndex(t.flatData))}}else if((w.parentsUntil(e.target,"e-content")||"Invalid"===this.dropPosition||!this.canDrop)&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),C.setValue("dropPosition",this.dropPosition,e),t.trigger(mt,e),!e.cancel)){if(!R(this.parent)&&"Invalid"===this.dropPosition&&!this.canDrop)return;R(this.parent)||this.dropRows(e),t.isLocalData&&(t.flatData=this.orderToIndex(t.flatData)),t.grid.refresh(),this.removeRowBorders()}if(this.removetopOrBottomBorder(),this.removeChildBorder(),this.removeRowBorders(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!C.isNullOrUndefined(e.data[0].parentItem)){var i=this.parent.treeColumnIndex,t=(i+=1,this.parent.getPrimaryKeyFieldNames()[0]),r=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+t]),n=this.parent.getRows()[parseInt(r.toString(),10)],o=e.data[0];if("middleSegment"===this.dropPosition){var a=[],s=[],o=(a.push(o),s.push(n),M(this.parent,e.data[0].parentUniqueID)),r=this.parent.grid.getRowIndexByPrimaryKey(o[""+t]),e=this.parent.getRows()[parseInt(r.toString(),10)];a.push(o),s.push(e);for(var d=0;d<a.length;d++)this.parent.renderModule.cellRender({data:a[parseInt(d.toString(),10)],cell:s[parseInt(d.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});t=e.getElementsByClassName("e-treegridcollapse")[0];C.isNullOrUndefined(t)||(C.removeClass([t],"e-treegridcollapse"),C.addClass([t],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:o,cell:n.cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},u.prototype.removeRowBorders=function(){var t=this;["e-firstrow-border","e-lastrow-border"].forEach(function(e){e=t.parent.element.getElementsByClassName(e)[0];e&&e.remove()})},u.prototype.dragDropGrid=function(e){var t=this.parent,i=C.closest(e.target,"tr"),i=isNaN(this.getTargetIdx(i))?0:this.getTargetIdx(i),e=w.parentsUntil(e.target,"e-treegrid");if(e&&e.id===this.parent.rowDropSettings.targetID&&!I(this.parent)&&!R(this.parent)){for(var r=e.ej2_instances[0],n=t.getSelectedRecords(),o=[],a=0;a<n.length;a++)o[parseInt(a.toString(),10)]=n[parseInt(a.toString(),10)].index;var s=r.dataSource;if(null!==this.parent.idMapping&&(C.isNullOrUndefined(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!s.length){for(var d=[],a=0;a<n.length;a++)if(n[parseInt(a.toString(),10)].hasChildRecords){d.push(n[parseInt(a.toString(),10)]);for(var l=v(n[parseInt(a.toString(),10)]),p=0;p<l.length;p++)d.push(l[parseInt(p.toString(),10)])}d.length&&(n=d)}t.notify(wt,{indexes:o,records:n}),r.notify(St,{toIndex:i,records:n});var h=r.rowDragAndDropModule.treeGridData;if(!C.isNullOrUndefined(h))for(var c,a=0;a<h.length;a++)h[parseInt(a.toString(),10)].index=a,C.isNullOrUndefined(h[parseInt(a.toString(),10)].parentItem)||(c=C.getValue("uniqueIDCollection."+h[parseInt(a.toString(),10)].parentUniqueID+".index",r),h[parseInt(a.toString(),10)].parentItem.index=c);t.grid.refresh(),r.grid.refresh(),1<r.grid.dataSource.length&&(r.grid.refresh(),C.isNullOrUndefined(r.getHeaderContent().querySelector(".e-firstrow-border"))||r.getHeaderContent().querySelector(".e-firstrow-border").remove(),C.isNullOrUndefined(r.getContent().querySelector(".e-lastrow-border"))||r.getContent().querySelector(".e-lastrow-border").remove())}R(this.parent)&&(r=e.ej2_instances[0],t.grid.refresh(),r.grid.refresh())},u.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10)-1:0},u.prototype.getParentData=function(e,t){var i,e=e.parentItem,r=-1;this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?r=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(r=this.parent.selectedRowIndex),"bottomSegment"===this.dropPosition&&(i=this.parent.getPrimaryKeyFieldNames()[0],t=-1===r?this.parent.grid.getRowIndexByPrimaryKey(t[0][""+i]):this.parent.getSelectedRowIndexes()[0],i=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)],this.droppedRecord=M(this.parent,i.parentItem.uniqueID)),"middleSegment"===this.dropPosition&&(this.parent.getCurrentViewRecords()[parseInt(r.toString(),10)].level===e.level?this.droppedRecord=M(this.parent,e.uniqueID):this.getParentData(e))},u.prototype.dropRows=function(l,p){if("Invalid"!==this.dropPosition&&!I(this.parent)){var h,c=this.parent,u=void 0,g=(C.isNullOrUndefined(l.dropIndex)?(e=this.parent.getPrimaryKeyFieldNames()[0],e=-1===c.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(l.data[0][""+e])-1:c.getSelectedRowIndexes()[0]-1,e=c.getCurrentViewRecords()[parseInt(e.toString(),10)],this.getParentData(e,l.data)):(l.dropIndex=l.dropIndex===l.fromIndex?this.getTargetIdx(l.target.parentElement):l.dropIndex,this.parent.enableVirtualization?(e=this.parent.getRowByIndex(l.dropIndex).rowIndex,this.droppedRecord=c.getCurrentViewRecords()[parseInt(e.toString(),10)]):C.isNullOrUndefined(this.parent.rowDropSettings.targetID)?this.droppedRecord=c.getCurrentViewRecords()[l.dropIndex]:(e=this.parent.grid.getRowsObject(),this.droppedRecord=0<e.length?e[l.dropIndex].data:void 0)),[]),u=this.droppedRecord;l.data[0]?g=l.data:g.push(l.data),this.parent[this.modifiedRecords].push(l.data[0],u);for(var f=0,e=this.parent.rowDropSettings.targetID,t=((this.isMultipleGrid=e)?this.isaddtoBottom=e&&this.isDraggedWithChild:this.ensuredropPosition(g,u),g.length),m=((!C.isNullOrUndefined(this.parent.idMapping)||"bottomSegment"===this.dropPosition&&1<g.length&&C.isNullOrUndefined(this.parent.idMapping))&&g.reverse(),this),i=0;i<t;i++)!function(e){if(h=g[parseInt(e.toString(),10)],m.draggedRecord=h,!m.draggedRecord.hasChildRecords)for(var t=0,i=g;t<i.length;t++){var r=i[t];C.isNullOrUndefined(r.childRecords)||-1===r.childRecords.indexOf(m.draggedRecord)||(m.draggedRecord=void 0)}var n,o,a,s,d;C.isNullOrUndefined(m.draggedRecord)||("Invalid"===m.dropPosition||C.isNullOrUndefined(m.droppedRecord)||(c.rowDropSettings.targetID&&!p||m.deleteDragRow(),m.draggedRecord===m.droppedRecord&&(e=m.getTargetIdx(l.target.offsetParent.parentElement),isNaN(e)&&(e=m.getTargetIdx(l.target.parentElement)),l.dropIndex=e,u=m.droppedRecord=m.parent.getCurrentViewRecords()[l.dropIndex]),!u.parentItem&&"middleSegment"!==m.dropPosition||-1===(s=(a=c.parentData).indexOf(m.draggedRecord))||a.splice(s,1),e=m.treeGridData.indexOf(u),m.dropAtTop(e),"bottomSegment"===m.dropPosition&&(u.hasChildRecords?(f=m.getChildCount(u,0),m.parent.parentIdMapping&&m.treeData.splice(e+f+1,0,m.draggedRecord.taskData),m.treeGridData.splice(e+f+1,0,m.draggedRecord)):(m.parent.parentIdMapping&&m.treeData.splice(e+1,0,m.draggedRecord.taskData),m.treeGridData.splice(e+1,0,m.draggedRecord)),C.isNullOrUndefined(u.parentItem)&&(delete h.parentItem,delete h.parentUniqueID,h.level=0,m.parent.parentIdMapping)&&(h[m.parent.parentIdMapping]=null),u.parentItem&&(o=(n=m.getChildrecordsByParentID(u.parentUniqueID)[0].childRecords).indexOf(u)+1,n.splice(o,0,h),h.parentItem=u.parentItem,h.parentUniqueID=u.parentUniqueID,h.level=u.level,m.parent.parentIdMapping)&&(h[m.parent.parentIdMapping]=u[m.parent.parentIdMapping],h.parentItem=u.parentItem,h.level=u.level),h.hasChildRecords)&&(m.updateChildRecordLevel(h,1),m.updateChildRecord(h,e+f+1)),m.dropMiddle(e)),C.isNullOrUndefined(h.parentItem)&&(s=(a=c.parentData).indexOf(m.droppedRecord),d=0,a.filter(function(e){h.uniqueID===e.uniqueID&&d++}),"bottomSegment"===m.dropPosition&&0===d?a.splice(s+1,0,h):"topSegment"===m.dropPosition&&0===d&&a.splice(s,0,h)),c.rowDragAndDropModule.refreshGridDataSource())}(i)}},u.prototype.dropMiddle=function(e){var t=this.parent,i=v(this.droppedRecord),i=C.isNullOrUndefined(i)||0===i.length?e+1:i.length+e+1;"middleSegment"===this.dropPosition&&(t.parentIdMapping&&this.treeData.splice(i,0,this.draggedRecord.taskData),this.treeGridData.splice(i,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords)&&this.updateChildRecord(this.draggedRecord,i)},u.prototype.dropAtTop=function(e){var t=this.parent;"topSegment"===this.dropPosition&&(t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData),t=this.treeGridData[parseInt(e.toString(),10)],this.draggedRecord.parentItem=t.parentItem,this.draggedRecord.parentUniqueID=t.parentUniqueID,this.draggedRecord.level=t.level,this.treeGridData.splice(parseInt(e.toString(),10),0,this.draggedRecord),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)),this.droppedRecord.parentItem)&&(e=(t=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID)[0].childRecords).indexOf(this.droppedRecord),t.splice(e,0,this.draggedRecord))},u.prototype.recordLevel=function(){var e,t=this.parent,i=this.draggedRecord,r=this.droppedRecord,n=t.childMapping;!r.hasChildRecords&&(r.hasChildRecords=!0,r.hasFilteredChildRecords=!0,C.isNullOrUndefined(r.childRecords)||0===r.childRecords.length)&&(r.childRecords=[],!t.parentIdMapping)&&C.isNullOrUndefined(r.taskData[""+n])&&(r.taskData[""+n]=[]),"middleSegment"===this.dropPosition&&(delete(e=C.extend({},r)).childRecords,i.parentItem=e,i.parentUniqueID=r.uniqueID,r.childRecords.splice(r.childRecords.length,0,i),C.setValue("uniqueIDCollection."+i.uniqueID,i,t),t.isSelfReference&&(r[t.childMapping]=[],r[t.childMapping].splice(r[t.childMapping].length,0,i)),C.isNullOrUndefined(i)||t.parentIdMapping||C.isNullOrUndefined(r.taskData[""+n])||r.taskData[t.childMapping].splice(r.childRecords.length,0,i.taskData),i.hasChildRecords?(i.level=r.level+1,this.updateChildRecordLevel(i,1)):i.level=r.level+1,r.expanded=!0)},u.prototype.deleteDragRow=function(){this.parent.dataSource instanceof b.DataManager&&x(this.parent)?(this.treeGridData=this.parent.grid.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource);var e=M(this.parent,this.draggedRecord.uniqueID);!C.isNullOrUndefined(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},u.prototype.updateChildRecord=function(e,t){var i,r=this.parent;if(!e.hasChildRecords)return 0;for(var n=e.childRecords.length,o=0;o<n;o++)i=this.isMultipleGrid?e.childRecords[parseInt(o.toString(),10)]:C.getValue("uniqueIDCollection."+e.childRecords[parseInt(o.toString(),10)].uniqueID,r),r.flatData.splice(++t,0,i),C.setValue("uniqueIDCollection."+i.uniqueID,i,this.parent),r.parentIdMapping&&this.treeData.splice(t,0,i.taskData),i.hasChildRecords&&(t=this.updateChildRecord(i,t));return t},u.prototype.updateChildRecordLevel=function(e,t){if(t++,!e.hasChildRecords)return 0;for(var i=e.childRecords.length,r=0;r<i;r++){var n=this.isMultipleGrid?e.childRecords[parseInt(r.toString(),10)]:C.getValue("uniqueIDCollection."+e.childRecords[parseInt(r.toString(),10)].uniqueID,this.parent),o=void 0;e.parentItem&&(o=M(this.parent,e.parentItem.uniqueID)),C.isNullOrUndefined(o)&&!C.isNullOrUndefined(e.parentItem)&&(o=e.parentItem),n.level=e.parentItem?o.level+t:e.level+1,n.hasChildRecords&&(t--,t=this.updateChildRecordLevel(n,t))}return t},u.prototype.removeRecords=function(e){var t=this,i=this.parent,r=this.parent.dataSource instanceof b.DataManager&&x(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,n=e,e=!C.isNullOrUndefined(i.parentIdMapping),o=this.getChildrecordsByParentID(n.parentUniqueID)[0];if(n){n.parentItem&&(a=0,s=o?o.childRecords:[])&&0<s.length&&(a=s.indexOf(n),o.childRecords.splice(a,1),this.parent.parentIdMapping&&!i.enableImmutableMode||hi({value:n,action:"delete"},this.parent,e,n.index,n.index)),i.parentIdMapping&&(n.hasChildRecords&&0<n.childRecords.length&&this.removeChildItem(n),s=r.findIndex(function(e){return e[t.parent.idMapping]===n.taskData[t.parent.idMapping]}),a=this.treeGridData.findIndex(function(e){return e[t.parent.idMapping]===n.taskData[t.parent.idMapping]}),-1===s||C.isNullOrUndefined(s)||r.splice(s,1),-1===a||C.isNullOrUndefined(a)||this.treeGridData.splice(a,1));var a,s,d=this.treeGridData.indexOf(n);if(i.parentIdMapping||-1!==(e=this.parent.parentData.indexOf(n))&&(i.parentData.splice(e,1),r.splice(e,1)),-1===d&&!i.parentIdMapping)for(var l=i.getPrimaryKeyFieldNames()[0],p=0;p<this.treeGridData.length;p++)this.treeGridData[parseInt(p.toString(),10)][""+l]===n[""+l]&&(d=p);i.parentIdMapping||(s=this.getChildCount(n,0),this.treeGridData.splice(d,s+1)),n.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(o.expanded=!1,o.hasChildRecords=!1,o.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(o)||C.isNullOrUndefined(o)||this.parent[this.modifiedRecords].push(o),C.isNullOrUndefined(o)||this.updateModifiedRecords(o)}},u.prototype.updateModifiedRecords=function(e){e=M(this.parent,e.parentUniqueID);C.isNullOrUndefined(e)||(this.parent[this.modifiedRecords].push(e),this.updateModifiedRecords(e))},u.prototype.removeChildItem=function(e){for(var t,i,r,n=this.parent.dataSource instanceof b.DataManager&&x(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,o=0;o<e.childRecords.length;o++){t=e.childRecords[parseInt(o.toString(),10)],!C.isNullOrUndefined(t.childRecords)&&t.childRecords.length&&(t.hasChildRecords=!0);for(var a=void 0,a=this.parent.dataSource instanceof b.DataManager&&x(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,s=0;s<a.length;s++)a[parseInt(s.toString(),10)][this.parent.idMapping]===t.taskData[this.parent.idMapping]&&(i=s);for(var d=0;d<this.treeGridData.length;d++)if(this.treeGridData[parseInt(d.toString(),10)][this.parent.idMapping]===t.taskData[this.parent.idMapping]){r=d;break}-1===i||C.isNullOrUndefined(i)||n.splice(i,1),-1===r||C.isNullOrUndefined(r)||this.treeGridData.splice(r,1),t.hasChildRecords&&this.removeChildItem(t)}},u.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)t++,(i=e.childRecords[parseInt(r.toString(),10)]).hasChildRecords&&(t=this.getChildCount(i,t));return t},u.prototype.ensuredropPosition=function(e,t){var i=this;e.filter(function(e){e.hasChildRecords&&!C.isNullOrUndefined(e.childRecords)&&(-1===e.childRecords.indexOf(t)?i.ensuredropPosition(e.childRecords,t):(i.dropPosition="Invalid",i.addErrorElem(),i.canDrop=!1,C.isNullOrUndefined(i.parent.rowDropSettings.targetID)&&(i.removetopOrBottomBorder(),i.removeChildBorder())))})},u.prototype.isDuplicateData=function(i){var e=this.parent.getPrimaryKeyFieldNames();return 0!==e.length&&this.parent.flatData.some(function(t){return e.every(function(e){return t[e]===i[e]})})},u.prototype.destroy=function(){this.removeEventListener()},u.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(It,this.Rowdraging),this.parent.off(Rt,this.rowDropped),this.parent.off(St,this.rowsAdded),this.parent.off(wt,this.rowsRemoved))},u.prototype.getModuleName=function(){return"rowDragAndDrop"};h=u;function u(e){this.canDrop=!0,this.isDraggedWithChild=!1,this.modifiedRecords="modifiedRecords",this.selectedRecords="selectedRecords",this.selectedRows="selectedRows",this.hasDropItem=!0,this.isaddtoBottom=!1,w.Grid.Inject(w.RowDD),this.parent=e,this.addEventListener()}bi=function(e,t){return(bi=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])}))(e,t)};var bi,Di,Mi=function(e,t){function i(){this.constructor=e}bi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Oi=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Mi=(Di=C.ChildProperty,Mi(Pi,Di),Oi([C.Property()],Pi.prototype,"targetID",void 0),Pi);function Pi(){return null!==Di&&Di.apply(this,arguments)||this}Ai=function(e,t){return(Ai=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])}))(e,t)};var Ai,Ei,Oi=function(e,t){function i(){this.constructor=e}Ai(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ni=(Ei=w.VirtualRowModelGenerator,Oi(Ui,Ei),Ui.prototype.addEventListener=function(){this.parent.on(lt,this.getDatas,this)},Ui.prototype.getDatas=function(e){this.visualData=e.data},Ui.prototype.getDataInfo=function(){return Ei.prototype.getData.call(this)},Ui.prototype.generateRows=function(e,t){var i=this.getDataInfo();if("refresh"===t.requestType&&t.isExpandCollapse&&(t.virtualInfo=this.prevInfo),C.isNullOrUndefined(t.virtualInfo)||this.parent.root.loadChildOnDemand&&I(this.parent.root)||("right"!==t.virtualInfo.direction&&"left"!==t.virtualInfo.direction?I(this.parent.root)&&!R(this.parent)&&1!==t.virtualInfo.blockIndexes.length||(t.virtualInfo.blockIndexes=i.blockIndexes):t.virtualInfo.blockIndexes=this.getBlockIndexes(t.virtualInfo.page)),this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||R(this.parent))return Ei.prototype.generateRows.call(this,e,t);C.isNullOrUndefined(t.requestType)||"collapseAll"!==t.requestType.toString()||(t.requestType="refresh");var r=Ei.prototype.generateRows.call(this,e,t);if(!C.isNullOrUndefined(this.visualData))for(var n=0;n<r.length;n++)r[parseInt(n.toString(),10)].index=this.visualData.indexOf(r[parseInt(n.toString(),10)].data);return r},Ui.prototype.checkAndResetCache=function(t){var e,i=["paging","refresh","sorting","filtering","searching","reorder","save","delete"].some(function(e){return t===e});return this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||R(this.parent)?(e=this.model.currentPage,i?(this.cache={},this.data={},this.groups={}):"virtualscroll"===t&&this.cache[parseInt(e.toString(),10)]&&this.cache[parseInt(e.toString(),10)].length>this.parent.contentModule.getBlockSize()&&this.cache[parseInt(e.toString(),10)].length>this.parent.contentModule.getBlockSize()&&(this.cache[parseInt(e.toString(),10)]=this.cache[parseInt(e.toString(),10)].slice(0,this.parent.contentModule.getBlockSize()))):!i&&"virtualscroll"!==t||(this.cache={},this.data={},this.groups={}),i},Ui);function Ui(e){e=Ei.call(this,e)||this;return e.addEventListener(),e}g.prototype.getModuleName=function(){return"filter"},g.prototype.destroy=function(){this.removeEventListener()},g.prototype.addEventListener=function(){this.parent.on("updateFilterRecs",this.updatedFilteredRecord,this),this.parent.on("clearFilters",this.clearFilterLevel,this)},g.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateFilterRecs",this.updatedFilteredRecord),this.parent.off("clearFilters",this.clearFilterLevel))},g.prototype.updatedFilteredRecord=function(e){C.setValue("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var t=(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode,i=0;i<this.flatFilteredData.length;i++){var r=this.flatFilteredData[parseInt(i.toString(),10)],n=(this.addParentRecord(r),"Child"!==t&&"None"!==t||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0),w.getObject("childRecords",r)),n=(!C.isNullOrUndefined(n)&&n.length&&C.setValue("hasFilteredChildRecords",this.checkChildExsist(r),r),w.getObject("parentItem",r));C.isNullOrUndefined(n)||(n=M(this.parent,r.parentItem.uniqueID,!0),C.setValue("hasFilteredChildRecords",!0,n),n&&n.parentItem&&this.updateParentFilteredRecord(n))}0<this.flatFilteredData.length&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},g.prototype.updateParentFilteredRecord=function(e){var e=M(this.parent,e.parentItem.uniqueID,!0),t=C.getValue("uniqueIDFilterCollection",this.parent);e&&Object.prototype.hasOwnProperty.call(t,e.uniqueID)&&C.setValue("hasFilteredChildRecords",!0,e),e&&e.parentItem&&this.updateParentFilteredRecord(e)},g.prototype.addParentRecord=function(e){var t=M(this.parent,e.parentUniqueID);"None"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key?(C.isNullOrUndefined(t)||("Child"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||-1!==this.flatFilteredData.indexOf(t))&&this.addParentRecord(t),-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),C.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))):C.isNullOrUndefined(t)?-1!==this.flatFilteredData.indexOf(e)&&-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),C.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent),e.hasFilteredChildRecords=!0):(this.addParentRecord(t),-1!==this.flatFilteredData.indexOf(t)||-1!==this.filteredResult.indexOf(t)?-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),C.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),C.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)))},g.prototype.checkChildExsist=function(e){for(var t=w.getObject("childRecords",e),i=!1,r=0;r<t.length;r++){var n,o=t[parseInt(r.toString(),10)].childRecords,a=(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode;if("Child"!==a&&"Both"!==a||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(n=C.getValue("uniqueIDFilterCollection",this.parent),Object.prototype.hasOwnProperty.call(n,t[parseInt(r.toString(),10)].uniqueID))||(this.filteredResult.push(t[parseInt(r.toString(),10)]),C.setValue("uniqueIDFilterCollection."+t[parseInt(r.toString(),10)].uniqueID,t[parseInt(r.toString(),10)],this.parent),i=!0),"None"===a&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(t[parseInt(r.toString(),10)])){i=!0;break}!C.isNullOrUndefined(o)&&o.length&&(i=this.checkChildExsist(t[parseInt(r.toString(),10)])),"Child"!==a&&"Both"!==a||!t.length||(i=!0)}return i},g.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,i=0;i<t;i++){var r=M(this.parent,e[parseInt(i.toString(),10)].parentUniqueID);-1!==e.indexOf(r)?(r=M(this.parent,e[parseInt(i.toString(),10)].parentUniqueID,!0),e[parseInt(i.toString(),10)].filterLevel=r.filterLevel+1):(e[parseInt(i.toString(),10)].filterLevel=0,this.filteredParentRecs.push(e[parseInt(i.toString(),10)]))}},g.prototype.clearFilterLevel=function(e){for(var t=0,i=e.flatData,r=i.length;t<r;t++){var n,o=(n=i[parseInt(t.toString(),10)]).filterLevel;!o&&0!==o&&C.isNullOrUndefined(n.hasFilteredChildRecords)||(n.hasFilteredChildRecords=null,n.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:i,count:i.length})};Oi=g;function g(e){w.Grid.Inject(w.Filter),this.parent=e,this.isHierarchyFilter=!1,this.filteredResult=[],this.flatFilteredData=[],this.filteredParentRecs=[],this.addEventListener()}f.prototype.getModuleName=function(){return"ExcelExport"},f.prototype.addEventListener=function(){this.parent.on("updateResults",this.updateExcelResultModel,this),this.parent.on("excelCellInfo",this.excelQueryCellInfo,this),this.parent.grid.on("export-RowDataBound",this.exportRowDataBound,this),this.parent.on("excelAggregateCellInfo",this.excelAggregateCellInfo,this),this.parent.grid.on("finalPageSetup",this.finalPageSetup,this)},f.prototype.destroy=function(){this.removeEventListener()},f.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateResults",this.updateExcelResultModel),this.parent.off("excelCellInfo",this.excelQueryCellInfo),this.parent.grid.off("export-RowDataBound",this.exportRowDataBound),this.parent.off("excelAggregateCellInfo",this.excelAggregateCellInfo),this.parent.grid.off("finalPageSetup",this.finalPageSetup))},f.prototype.updateExcelResultModel=function(e){this.dataResults=e},f.prototype.Map=function(r,n,o,a,s){var d=this,l=this.parent.dataSource,p=new w.Data(this.parent.grid),h=Object();if(C.setValue("isCsv",s,h),C.setValue("cancel",!1,h),C.isNullOrUndefined(r)||(this.isCollapsedStatePersist=r.isCollapsedStatePersist),!C.isNullOrUndefined(r)){if(!this.isLocal()&&!C.isNullOrUndefined(r.dataSource)&&!r.dataSource.dataSource)return this.parent.grid.excelExportModule.Map(this.parent.grid,r,n,o,s,a);if("CurrentPage"===r.exportType)return r.dataSource=this.parent.getCurrentViewRecords(),this.parent.grid.excelExportModule.Map(this.parent.grid,r,n,o,s,a)}return new Promise(function(i){var e=!d.isLocal()||l instanceof b.DataManager?d.parent.dataSource:new b.DataManager(l),t=new b.Query;if(d.isLocal()||((t=d.generateQuery(t)).queries=d.parent.grid.getDataModule().generateQuery().queries,t=w.ExportHelper.getQuery(d.parent.grid,p),C.isNullOrUndefined(d.parent.filterModule)&&(t.queries=t.queries.slice(1,2),t.params=t.params.slice(0,0)),C.setValue("query",t,h)),d.parent.trigger(Ae,C.extend(h,r)),w.getObject("cancel",h))return null;e.executeQuery(t).then(function(e){var t=null;return C.isNullOrUndefined(r)||C.isNullOrUndefined(r.dataSource)||(t=r.dataSource),r=d.manipulateExportProperties(r,l,e),d.parent.grid.excelExportModule.Map(d.parent.grid,r,n,o,s,a).then(function(e){null!=t?r.dataSource=t:delete r.dataSource,i(e)})})})},f.prototype.generateQuery=function(e,t){return!C.isNullOrUndefined(t)&&"CurrentPage"===t.exportType&&this.parent.allowPaging&&(t.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=w.getObject("grid.renderModule.data.pageQuery",this.parent)(e)),e},f.prototype.manipulateExportProperties=function(e,t,i){var r,n=Object();return C.isNullOrUndefined(this.parent.grid.getDataModule())||C.setValue("query",this.parent.grid.getDataModule().generateQuery(!0),n),C.setValue("isExport",!0,n),C.isNullOrUndefined(e)||C.isNullOrUndefined(e.exportType)||C.setValue("exportType",e.exportType,n),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(w.getObject("result",i)),C.setValue("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),n=this.dataResults,t=C.isNullOrUndefined(n.result)?this.parent.flatData.slice(0):n.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource&&(i=this.parent.flatData,r=e.dataSource instanceof b.DataManager?e.dataSource.dataSource.json:e.dataSource,this.parent.dataModule.convertToFlatData(r),t=this.parent.flatData,this.parent.flatData=i),(e=C.isNullOrUndefined(e)?Object():e).dataSource=new b.DataManager({json:t}),0<this.parent.aggregates.length&&(e.query=n.query),e},f.prototype.excelQueryCellInfo=function(e){var t,i;this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex&&(t={},i=e.data,i=C.isNullOrUndefined(i.filterLevel)?i.level:i.filterLevel,t.indent=i,e.style=t),this.parent.notify("updateResults",e),this.parent.trigger("excelQueryCellInfo",e)},f.prototype.excelAggregateCellInfo=function(e){this.parent.trigger("excelAggregateQueryCellInfo",e)},f.prototype.exportRowDataBound=function(e){var t,i,r,n,o,a;"excel"===e.type&&(t=e.rowObj.data,n=this.parent.grid.filterSettings.columns.length,i=e.excelRows.length,r=t.level,t.parentItem&&M(this.parent,t.parentItem.uniqueID,Boolean(n))?(o=n=!1,a=y(this.parent,t,this.parent.parentData),!this.isCollapsedStatePersist||a&&this.parent.isLocalData||(n=!0,o=!t.expanded),e.excelRows[i-1].grouping={outlineLevel:r,isCollapsed:o,isHidden:n}):t.hasChildRecords&&C.isNullOrUndefined(t.parentItem)&&(e.excelRows[i-1].grouping={outlineLevel:r}))},f.prototype.finalPageSetup=function(e){for(var t=0;t<e.worksheets.length;t++)e.worksheets[parseInt(t.toString(),10)].rows&&(e.worksheets[parseInt(t.toString(),10)].pageSetup={isSummaryRowBelow:!1})},f.prototype.isLocal=function(){return!I(this.parent)&&x(this.parent)};var ki=f;function f(e){this.isCollapsedStatePersist=!1,w.Grid.Inject(w.ExcelExport),this.parent=e,this.dataResults={},this.addEventListener()}m.prototype.getModuleName=function(){return"PdfExport"},m.prototype.addEventListener=function(){this.parent.on("pdfCellInfo",this.pdfQueryCellInfo,this),this.parent.on("updateResults",this.updatePdfResultModel,this),this.parent.on("pdfAggregateCellInfo",this.pdfAggregateCellInfo,this)},m.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel),this.parent.off("pdfAggregateCellInfo",this.pdfAggregateCellInfo))},m.prototype.destroy=function(){this.removeEventListener()},m.prototype.updatePdfResultModel=function(e){this.dataResults=e},m.prototype.Map=function(r,n,o,a){var s=this,d=this.parent.dataSource,l=Object(),p=!I(this.parent)&&x(this.parent);return C.setValue("cancel",!1,l),new Promise(function(i){var e=!p||d instanceof b.DataManager?s.parent.dataSource:new b.DataManager(d),t=new b.Query;if(p||(t=s.generateQuery(t),C.setValue("query",t,l)),s.parent.trigger(Ee,C.extend(l,r)),w.getObject("cancel",l))return null;e.executeQuery(t).then(function(e){var t=null;return C.isNullOrUndefined(r)||C.isNullOrUndefined(r.dataSource)||(t=r.dataSource),r=s.manipulatePdfProperties(r,d,e),s.parent.grid.pdfExportModule.Map(s.parent.grid,r,n,o,a).then(function(e){null!=t?r.dataSource=t:delete r.dataSource,i(e)})})})},m.prototype.generateQuery=function(e,t){return!C.isNullOrUndefined(t)&&"CurrentPage"===t.exportType&&this.parent.allowPaging&&(t.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=w.getObject("grid.renderModule.data.pageQuery",this.parent)(e)),e},m.prototype.manipulatePdfProperties=function(e,t,i){var r={},n=!I(this.parent)&&x(this.parent);return C.setValue("query",this.parent.grid.getDataModule().generateQuery(!0),r),C.setValue("isExport",!0,r),C.setValue("isPdfExport",!0,r),C.isNullOrUndefined(e)||C.isNullOrUndefined(e.isCollapsedStatePersist)||C.setValue("isCollapsedStatePersist",e.isCollapsedStatePersist,r),C.isNullOrUndefined(e)||C.isNullOrUndefined(e.exportType)||C.setValue("exportType",e.exportType,r),n||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(C.getValue("result",i)),C.setValue("expresults",this.parent.flatData,r)),this.parent.notify("dataProcessor",r),r=this.dataResults,t=C.isNullOrUndefined(r.result)?this.parent.flatData.slice(0):r.result,n||(this.parent.flatData=[]),e&&e.dataSource&&n&&(i=this.parent.flatData,n=e.dataSource instanceof b.DataManager?e.dataSource.dataSource.json:e.dataSource,this.parent.dataModule.convertToFlatData(n),t=this.parent.flatData,this.parent.flatData=i),(e=C.isNullOrUndefined(e)?{}:e).dataSource=new b.DataManager({json:t}),e.query=r.query,e},m.prototype.pdfQueryCellInfo=function(e){var t,i;this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex&&(t={},i=w.getObject("data",e),i=C.isNullOrUndefined(i.filterLevel)?i.level:i.filterLevel,t.paragraphIndent=3*i,e.style=t),this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)},m.prototype.pdfAggregateCellInfo=function(e){this.parent.trigger("pdfAggregateQueryCellInfo",e)};var qi=m;function m(e){w.Grid.Inject(w.PdfExport),this.parent=e,this.dataResults={},this.addEventListener()}S.prototype.addEventListener=function(){this.parent.on(Ve,this.collapseExpandPagedchilds,this),this.parent.on(ze,this.pageAction,this)},S.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ve,this.collapseExpandPagedchilds),this.parent.off(ze,this.pageAction))},S.prototype.getModuleName=function(){return"pager"},S.prototype.refresh=function(){this.parent.grid.pagerModule.refresh()},S.prototype.destroy=function(){this.removeEventListener()},S.prototype.goToPage=function(e){this.parent.grid.pagerModule.goToPage(e)},S.prototype.updateExternalMessage=function(e){C.isNullOrUndefined(e)&&this.parent.trigger(Mt,{error:"The provided value for the message is undefined. Please ensure the message contains string."}),this.parent.grid.pagerModule.updateExternalMessage(e)},S.prototype.collapseExpandPagedchilds=function(t){t.record.expanded="collapse"!==t.action,this.parent.flatData.map(function(e){return e.expanded=(e.uniqueID===t.record.uniqueID&&e.expanded!==t.record.expanded?t.record:e).expanded}),this.parent.enableImmutableMode&&(i=this.parent.getPrimaryKeyFieldNames()[0],(r=this.parent.flatData.filter(function(e){return e[""+i]===t.record[""+i]})).length)&&(r[0].expanded=t.record.expanded);var i,e,r={result:this.parent.flatData,row:t.row,action:t.action,record:t.record,count:this.parent.flatData.length};C.getValue("grid.renderModule",this.parent).dataManagerSuccess(r),this.parent.enableImmutableMode&&(e=void 0,"collapse"===r.action?(e=r.row.getElementsByClassName("e-treegridexpand")[0],C.isNullOrUndefined(e)||(C.removeClass([e],"e-treegridexpand"),C.addClass([e],"e-treegridcollapse"))):"expand"===r.action&&(e=r.row.getElementsByClassName("e-treegridcollapse")[0],C.isNullOrUndefined(e)||(C.removeClass([e],"e-treegridcollapse"),C.addClass([e],"e-treegridexpand"))))},S.prototype.pageRoot=function(i,r,e){for(var n=C.isNullOrUndefined(e)?[]:e,o=this,t=0;t<r.length;t++)!function(t){n.push(r[parseInt(t.toString(),10)]);var e;r[parseInt(t.toString(),10)].hasChildRecords&&(e=i.filter(function(e){return r[parseInt(t.toString(),10)].uniqueID===e.parentUniqueID}),n=o.pageRoot(i,e,n))}(t);return n},S.prototype.updatePageSize=function(e){var e=e.count,t=this.parent.grid.pagerModule;!0===this.parent.pageSettings.pageSizes&&t.pagerObj.pagerdropdownModule.dropDownListObject.value===t.pagerObj.getLocalizedLabel("All")&&(t.pagerObj.totalRecordsCount=e,this.parent.grid.pageSettings.pageSize=e)},S.prototype.pageAction=function(e){var t,i,r,n,o,a,s=this,d=new b.DataManager(e.result);"Root"===this.parent.pageSettings.pageSizeMode?(t=[],r=0<this.parent.grid.filterSettings.columns.length&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",r=(new b.Query).where(r,"equal",0),t=d.executeLocal(r),e.count=t.length,a=(n=this.parent.grid.pageSettings.pageSize)*((o=this.parent.grid.pageSettings.currentPage)-1),r=r.skip(a).take(n),t=d.executeLocal(r),d=this.pageRoot(e.result,t),e.result=d):(t=new b.DataManager(e.result),d=new b.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),d=t.executeLocal((new b.Query).where(d)),i=void 0,i=Et(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?d:d.filter(function(e){return y(s.parent,e)}),e.count=i.length,r=new b.Query,n=this.parent.grid.pageSettings.pageSize,this.updatePageSize(e),o=this.parent.grid.pageSettings.currentPage,i.length<o*n&&(o=Math.floor(i.length/n)+(i.length%n?1:0),this.parent.grid.setProperties({pageSettings:{currentPage:o=o||1}},!0)),r=r.skip(a=n*(o-1)).take(n),t.dataSource.json=i,e.result=t.executeLocal(r)),this.parent.notify("updateAction",e)};var Ti=S;function S(e){w.Grid.Inject(w.Page),this.parent=e,this.addEventListener()}Vi.prototype.getModuleName=function(){return"toolbar"},Vi.prototype.addEventListener=function(){this.parent.on(De,this.refreshToolbar,this),this.parent.on(Oe,this.refreshToolbar,this),this.parent.on(Pe,this.toolbarClickHandler,this)},Vi.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(De,this.refreshToolbar),this.parent.off(Oe,this.refreshToolbar),this.parent.off(Pe,this.toolbarClickHandler))},Vi.prototype.refreshToolbar=function(e){var t,i,r,n,o,a,s=this.parent.grid.toolbarModule.getToolbar();C.isNullOrUndefined(s)||(a=o=void 0,n=(t=this.parent).element.id+"_gridcontrol_indent",i=t.element.id+"_gridcontrol_outdent",n=s.querySelector("#"+n),s=s.querySelector("#"+i),i=e.row,r=t.getSelectedRows()[0],C.isNullOrUndefined(i[0])||(i=i[0]),i=C.isNullOrUndefined(r)||r.rowIndex===i.rowIndex?i:r,null!==n&&null!==s&&(o=n.parentElement,a=s.parentElement,0===i.rowIndex||1<t.getSelectedRowIndexes().length?(o.classList.add("e-hidden"),a.classList.add("e-hidden")):("rowDeselected"!==e.name||!C.isNullOrUndefined(r)&&t.grid.isCheckBoxSelection)&&(n=t.getCurrentViewRecords()[i.rowIndex],C.isNullOrUndefined(n)||(n.level>t.getCurrentViewRecords()[i.rowIndex-1].level?o.classList.add("e-hidden"):o.classList.remove("e-hidden"),n.level===t.getCurrentViewRecords()[i.rowIndex-1].level&&o.classList.remove("e-hidden"),0===n.level&&a.classList.add("e-hidden"),0!==n.level&&a.classList.remove("e-hidden"))),"rowDeselected"===e.name)&&C.isNullOrUndefined(r)&&!t.grid.isCheckBoxSelection&&(this.parent.toolbar.includes("Indent")&&o.classList.add("e-hidden"),this.parent.toolbar.includes("Outdent"))&&a.classList.add("e-hidden"))},Vi.prototype.toolbarClickHandler=function(e){var t=this.parent,i="indentOutdentAction";"Cell"===this.parent.editSettings.mode&&"Batch"===this.parent.grid.editSettings.mode&&e.item.id===this.parent.grid.element.id+"_update"&&(e.cancel=!0,this.parent.grid.editModule.saveCell()),e.item.id===this.parent.grid.element.id+"_expandall"&&this.parent.expandAll(),e.item.id===this.parent.grid.element.id+"_collapseall"&&this.parent.collapseAll(),e.item.id===t.grid.element.id+"_indent"&&t.getSelectedRecords().length&&!C.isNullOrUndefined(t.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[i](null,"indent"),e.item.id===t.grid.element.id+"_outdent"&&t.getSelectedRecords().length&&!C.isNullOrUndefined(t.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[i](null,"outdent")},Vi.prototype.getToolbar=function(){return this.parent.grid.toolbarModule.getToolbar()},Vi.prototype.enableItems=function(e,t){this.parent.grid.toolbarModule.enableItems(e,t)},Vi.prototype.destroy=function(){this.removeEventListener()};var Bi=Vi;function Vi(e){w.Grid.Inject(w.Toolbar),this.parent=e,this.addEventListener()}Li.prototype.getModuleName=function(){return"summary"},Li.prototype.removeEventListener=function(){this.parent.isDestroyed},Li.prototype.calculateSummaryValue=function(e,t,a){this.summaryQuery=e;var s,d,e=t.filter(function(e){return!w.getObject("isSummaryRow",e)}),i=Nt(e),l=e.slice(),r=Object.keys(this.parent.aggregates).length,t=Object.keys(i).length,p=this.parent.getColumns();if(this.parent.aggregates.filter(function(e){return e.showChildSummary}).length){for(var n=0,o=t;n<o;n++)if(s=i[parseInt(n.toString(),10)],d=this.getChildRecordsLength(s,l)){for(var h=this,c=1,u=r;c<=u;c++)!function(e){for(var t=void 0,t={},i=0;i<p.length;i++)t[""+(C.isNullOrUndefined(w.getObject("field",p[parseInt(i.toString(),10)]))?p[parseInt(i.toString(),10)]:w.getObject("field",p[parseInt(i.toString(),10)]))]=null;if(t=h.createSummaryItem(t,h.parent.aggregates[e-1]),!h.parent.aggregates[e-1].showChildSummary)return;l.map(function(e,t){e.uniqueID===s.uniqueID&&(r=t)});var r,e=r+d+e,n=C.extend({},s),o=(delete n.childRecords,delete n[h.parent.childMapping],C.setValue("parentItem",n,t),w.getObject("level",n));C.setValue("level",o+1,t),C.setValue("isSummaryRow",!0,t),C.setValue("parentUniqueID",n.uniqueID,t),a&&(o=w.getObject("childRecords",s)).length&&o.push(t),l.splice(e,0,t)}(c);this.flatChildRecords=[]}}else{for(var g={},f=0,m=p.length;f<m;f++)g[""+(C.isNullOrUndefined(w.getObject("field",p[parseInt(f.toString(),10)]))?p[parseInt(f.toString(),10)]:w.getObject("field",p[parseInt(f.toString(),10)]))]=null;for(var c=1,y=r;c<=y;c++)this.createSummaryItem(g,this.parent.aggregates[c-1])}return l},Li.prototype.getChildRecordsLength=function(e,t){for(var i=0,r=Object.keys(t).length;i<r;i++){var n=t[parseInt(i.toString(),10)];e===(C.isNullOrUndefined(n.parentItem)?null:t.filter(function(e){return e.uniqueID===n.parentItem.uniqueID})[0])&&(this.flatChildRecords.push(n),w.getObject("hasChildRecords",n))&&this.getChildRecordsLength(n,t)}return this.flatChildRecords.length},Li.prototype.createSummaryItem=function(e,t){for(var i=0,r=Object.keys(t.columns).length;i<r;i++)for(var n=C.isNullOrUndefined(t.columns[parseInt(i.toString(),10)].columnName)?t.columns[parseInt(i.toString(),10)].field:t.columns[parseInt(i.toString(),10)].columnName,o=0,a=Object.keys(e);o<a.length;o++){var s,d=a[o];d===n&&(this.flatChildRecords.length?e[""+d]=this.getSummaryValues(t.columns[parseInt(i.toString(),10)],this.flatChildRecords):this.parent.isLocalData&&(s=this.parent.dataSource instanceof b.DataManager?this.parent.dataSource.dataSource.json:this.parent.flatData,e[""+d]=this.getSummaryValues(t.columns[parseInt(i.toString(),10)],s)))}return e},Li.prototype.getSummaryValues=function(e,t){for(var i=new b.Query,r={},n={},o=C.isNullOrUndefined(e.field)?void 0:this.parent.getColumnByField(e.field).type,a=(e.setPropertiesSilent({format:this.getFormatFromType(e.format,o)}),e.setFormatter(this.parent.grid.locale),e.getFormatter()||function(e){return e}),o=(e.setTemplate(n),e.getTemplate(2)),s=(i.queries=this.summaryQuery,i.requiresCount(),new b.DataManager(t).executeLocal(i)),d=e.type,d=[e.type],l=0;l<d.length;l++){var p=d[parseInt(l.toString(),10)],h=e.field+" - "+d[parseInt(l.toString(),10)].toLowerCase(),c="Custom"!==d[parseInt(l.toString(),10)]?w.getObject("aggregates",s):w.calculateAggregate(d[parseInt(l.toString(),10)],s,e,this.parent),u=e.columnName,g="Custom"!==d[parseInt(l.toString(),10)]?c[h]:c;r[""+u]=r[""+u]||{},r[""+u][h]=g,r[""+u][d[parseInt(l.toString(),10)]]=C.isNullOrUndefined(c)||C.isNullOrUndefined(g)?" ":a(g)}n.format=e.getFormatter();t=C.createElement("td",{className:"e-summary"}),this.parent.isReact&&"string"!=typeof e.footerTemplate?(o.fn(r[e.columnName],this.parent,o.property,"",null,null,t),this.parent.renderReactTemplates()):w.appendChildren(t,o.fn(r[e.columnName],this.parent,o.property)),i=r[""+e.columnName][""+p];return-1===t.innerHTML.indexOf(i)?t.innerHTML+i:t.innerHTML},Li.prototype.getFormatFromType=function(e,t){if(C.isNullOrUndefined(t)||"string"!=typeof e)return e;var i;switch(t){case"number":i={format:e};break;case"datetime":i={type:"dateTime",skeleton:e};break;case"date":i={type:t,skeleton:e}}return i},Li.prototype.destroy=function(){this.removeEventListener()};var zi=Li;function Li(e){w.Grid.Inject(w.Aggregate),this.parent=e,this.flatChildRecords=[],this.summaryQuery=[]}P.prototype.getModuleName=function(){return"sort"},P.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("createSort",this.createdSortedRecords,this)},P.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("createSort",this.createdSortedRecords))},P.prototype.createdSortedRecords=function(e){var t=e.modifiedData,i=e.srtQry;this.iterateSort(t,i),this.storedIndex=-1,e.modifiedData=this.flatSortedData,this.flatSortedData=[]},P.prototype.iterateSort=function(e,t){var i=this.parent.query,r=[];C.isNullOrUndefined(i)||(r=i.queries.filter(function(e){return"onWhere"===e.fn}));for(var n,o,a=0;a<e.length;a++)(0<r.length||0<this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&C.isNullOrUndefined(M(this.parent,e[parseInt(a.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(a.toString(),10)]),e[parseInt(a.toString(),10)].hasChildRecords&&(n=new b.DataManager(e[parseInt(a.toString(),10)].childRecords).executeLocal(t),this.parent.allowRowDragAndDrop&&-1!==e[parseInt(a.toString(),10)].childRecords.indexOf(this.parent.rowDragAndDropModule.draggedRecord)&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition&&(o=n.indexOf(this.parent.rowDragAndDropModule.draggedRecord),n.splice(o,1),o=n.indexOf(this.parent.rowDragAndDropModule.droppedRecord),"topSegment"===this.parent.rowDragAndDropModule.dropPosition?n.splice(o,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&n.splice(o+1,0,this.parent.rowDragAndDropModule.draggedRecord)),this.iterateSort(n,t))},P.prototype.sortColumn=function(e,t,i){this.parent.grid.sortColumn(e,t,i)},P.prototype.removeSortColumn=function(e){this.parent.grid.removeSortColumn(e)},P.prototype.updateModel=function(){this.parent.setProperties({sortSettings:w.getActualProperties(this.parent.grid.sortSettings)},!0)},P.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},P.prototype.destroy=function(){this.removeEventListener()};var Fi=P;function P(e){w.Grid.Inject(w.Sort),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!C.isNullOrUndefined(this.parent.parentIdMapping),this.addEventListener()}_i.prototype.getColumnMenu=function(){return this.parent.grid.columnMenuModule.getColumnMenu()},_i.prototype.destroy=function(){},_i.prototype.getModuleName=function(){return"columnMenu"};var ji=_i;function _i(e){w.Grid.Inject(w.ColumnMenu),this.parent=e}Gi.prototype.addEventListener=function(){this.parent.on("contextMenuOpen",this.contextMenuOpen,this),this.parent.on("contextMenuClick",this.contextMenuClick,this),this.parent.on("contextMenuItemClick",this.contextMenuItemClick,this)},Gi.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contextMenuOpen",this.contextMenuOpen),this.parent.off("contextMenuClick",this.contextMenuClick),this.parent.off("contextMenuItemClick",this.contextMenuItemClick))},Gi.prototype.contextMenuItemClick=function(e){(e.item&&e.item.id?e.item.id:"")===this.parent.element.id+"_gridcontrol_cmenu_Delete"&&(this.parent.getSelectedRecords()[0].hasChildRecords||1<this.parent.getSelectedRecords().length?this.parent.deleteRecord():this.parent.deleteRow(this.parent.getSelectedRows()[0]),e.cancel=!0)},Gi.prototype.contextMenuOpen=function(e){var t=C.select("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),i=C.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),r=C.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),n=C.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Outdent",e.element),o=(t&&(!1===this.parent.grid.editSettings.allowAdding||this.parent.grid.isEdit?t.style.display="none":t.style.display="block"),"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||C.isNullOrUndefined(i)||i.classList.contains("e-menu-hide")||(i.style.display="none"),this.parent),t=o.getSelectedRows()[0];if(!r&&!n||C.isNullOrUndefined(t)){if((r||n||o.grid.isEdit)&&C.isNullOrUndefined(t)){for(var a=0,s=e.items;a<s.length;a++)"Outdent"!==(d=s[a]).text&&"Indent"!==d.text||o.grid.contextMenuModule.hiddenItems.includes(d.text)||o.grid.contextMenuModule.hiddenItems.push(d.text);o.grid.contextMenuModule.contextMenu.hideItems(o.grid.contextMenuModule.hiddenItems),(r||n)&&(r.style.display=n.style.display="none")}}else{var i=e.event.target.closest("td");if(!C.isNullOrUndefined(i)&&(C.isNullOrUndefined(i)||i.classList.contains("e-rowcell")&&0===i.querySelectorAll(".e-gridform").length))0===t.rowIndex||1<o.getSelectedRowIndexes().length?r.style.display=n.style.display="none":("rowDeselected"!==e.name||!C.isNullOrUndefined(t)&&o.grid.isCheckBoxSelection)&&(i=o.getCurrentViewRecords()[t.rowIndex],C.isNullOrUndefined(i)||(i.level>o.getCurrentViewRecords()[t.rowIndex-1].level?r.style.display="none":r.style.display="block",i.level===o.getCurrentViewRecords()[t.rowIndex-1].level&&(r.style.display="block"),0===i.level?n.style.display="none":n.style.display="block"));else{for(var d,l=0,p=e.items;l<p.length;l++)"Outdent"!==(d=p[l]).text&&"Indent"!==d.text||o.grid.contextMenuModule.hiddenItems.push(d.text);o.grid.contextMenuModule.contextMenu.hideItems(o.grid.contextMenuModule.hiddenItems),r.style.display=n.style.display="none"}}},Gi.prototype.contextMenuClick=function(e){"Above"!==e.item.id&&"Below"!==e.item.id&&"Child"!==e.item.id||(this.parent.notify("savePreviousRowPosition",e),this.parent.setProperties({editSettings:{newRowPosition:e.item.id}},!0),this.parent.editModule.isAddedRowByContextMenu=!0,this.parent.addRecord()),e.item.id!==this.parent.element.id+"_gridcontrol_cmenu_Indent"&&e.item.id!==this.parent.element.id+"_gridcontrol_cmenu_Outdent"||C.isNullOrUndefined(this.parent.rowDragAndDropModule)||(e=e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"?"indent":"outdent",this.parent.rowDragAndDropModule.indentOutdentAction(null,e))},Gi.prototype.getModuleName=function(){return"contextMenu"},Gi.prototype.destroy=function(){this.removeEventListener()},Gi.prototype.getContextMenu=function(){return this.parent.grid.contextMenuModule.getContextMenu()};var Hi=Gi;function Gi(e){w.Grid.Inject(w.ContextMenu),this.parent=e,this.addEventListener()}A.prototype.addEventListener=function(){this.parent.on(Je,this.cellSaved,this),this.parent.on(et,this.batchAdd,this),this.parent.on(it,this.beforeBatchAdd,this),this.parent.on(nt,this.batchSave,this),this.parent.on(tt,this.beforeBatchDelete,this),this.parent.on(rt,this.beforeBatchSave,this),this.parent.on("batchPageAction",this.batchPageAction,this),this.parent.on("batchCancelAction",this.batchCancelAction,this),this.parent.grid.on("immutable-batch-cancel",this.immutableBatchAction,this),this.parent.grid.on("next-cell-index",this.nextCellIndex,this),this.parent.grid.on("cellfocused",this.onCellFocused,this)},A.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Je,this.cellSaved),this.parent.off(et,this.batchAdd),this.parent.off(nt,this.batchSave),this.parent.off(it,this.beforeBatchAdd),this.parent.off(tt,this.beforeBatchDelete),this.parent.off(rt,this.beforeBatchSave),this.parent.off("batchPageAction",this.batchPageAction),this.parent.off("batchCancelAction",this.batchCancelAction),this.parent.grid.off("immutable-batch-cancel",this.immutableBatchAction),this.parent.grid.off("next-cell-index",this.nextCellIndex),this.parent.grid.off("cellfocused",this.onCellFocused))},A.prototype.destroy=function(){this.removeEventListener()},A.prototype.getBatchRecords=function(){return this.batchRecords},A.prototype.getAddRowIndex=function(){return this.addRowIndex},A.prototype.getSelectedIndex=function(){return this.selectedIndex},A.prototype.getBatchChildCount=function(){return this.batchChildCount},A.prototype.batchPageAction=function(){var e,i=this,r=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!C.isNullOrUndefined(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var t=0;t<this.batchAddedRecords.length;t++)!function(t){e=r.findIndex(function(e){return e[""+n]===i.batchAddedRecords[parseInt(t.toString(),10)][""+n]}),r.splice(e,1)}(t);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.batchDeletedRecords=this.currentViewRecords=[]},A.prototype.cellSaved=function(e){var t,i,r,n,o,a,s,d,l,p,h,c;e.column.index===this.parent.treeColumnIndex&&this.parent.renderModule.cellRender({data:e.rowData,cell:e.cell,column:this.parent.grid.getColumnByIndex(e.column.index)}),this.isAdd&&"Batch"===this.parent.editSettings.mode&&"Bottom"!==this.parent.editSettings.newRowPosition&&(e=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,t=void 0,i=this.parent.grid.getPrimaryKeyFieldNames()[0],r=h=void 0,n="parentItem",o=-1<this.selectedIndex?this.batchRecords[parseInt(this.addRowIndex.toString(),10)][n]:null,d=s=a=void 0,c="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1,c=this.getActualRowObjectIndex(c),this.newBatchRowAdded)&&(this.batchRecords.length&&(a=this.batchRecords[this.addRowIndex][this.parent.idMapping],d=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)][n])&&(s=this.batchRecords[parseInt(this.addRowIndex.toString(),10)][n].uniqueID),this.batchAddedRecords=D(this.batchAddedRecords),this.batchAddRowRecord=D(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),t=this.parent.grid.getRowsObject()[parseInt(c.toString(),10)].changes,C.isNullOrUndefined(t)||(t.uniqueID=w.getUid(this.parent.element.id+"_data_"),C.setValue("uniqueIDCollection."+t.uniqueID,t,this.parent),Object.prototype.hasOwnProperty.call(t,"level"))||(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition?(t.primaryParent=o,-1<this.selectedIndex&&(t.parentItem=C.extend({},this.batchRecords[this.addRowIndex]),t.parentUniqueID=t.parentItem.uniqueID,delete t.parentItem.childRecords,delete t.parentItem[this.parent.childMapping],t.level=t.parentItem.level+1,t.index=this.batchIndex,l=v(this.batchRecords[this.addRowIndex]).length,p=v(this.batchRecords[this.addRowIndex])[l-1],p=C.isNullOrUndefined(p)?this.batchRecords[this.addRowIndex]:p,h=e.map(function(e){return e[""+i]}).indexOf(p[""+i]),this.isSelfReference&&(t[this.parent.parentIdMapping]=a),O(i,t.parentItem,"add",this.parent,this.isSelfReference,t))):"Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||C.isNullOrUndefined(this.batchRecords[this.addRowIndex])||(t.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,t.level&&-1<this.selectedIndex&&(t.parentItem=o,t.parentUniqueID=s,delete t.parentItem.childRecords,delete t.parentItem[this.parent.childMapping]),t.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&-1<this.selectedIndex&&(l=v(this.batchRecords[this.addRowIndex]).length,p=v(this.batchRecords[this.addRowIndex])[l-1],p=C.isNullOrUndefined(p)?this.batchRecords[this.addRowIndex]:p,h=e.map(function(e){return e[""+i]}).indexOf(p[""+i])),"Above"===this.parent.editSettings.newRowPosition&&-1<this.selectedIndex&&(p=this.batchRecords[this.addRowIndex],h=e.map(function(e){return e[""+i]}).indexOf(p[""+i])),this.isSelfReference&&(t[this.parent.parentIdMapping]=d)),t.index=-1===t.index?0:t.index,t.hasChildRecords=!1,t.childRecords=[],this.batchRecords.splice(t.index,0,t),this.currentViewRecords.splice(t.index,0,t),r=h||t.index,"Above"!==this.parent.editSettings.newRowPosition&&(r=0===t.index?r:r+1),e.splice(r,0,t),this.batchAddedRecords.push(t)),this.parent.grid.getRowsObject()[parseInt(c.toString(),10)].data=t,this.newBatchRowAdded=!1)},A.prototype.beforeBatchAdd=function(e){var t="isTabLastRow";"Cell"===this.parent.editSettings.mode&&this.parent.editModule[t]?(e.cancel=!0,this.parent.editModule[t]=!1):!this.parent.editModule.isAddedRowByMethod||C.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||-1!==this.parent.grid.selectedRowIndex&&!this.parent.editModule.batchEditModule.isAdd?(this.selectedIndex=this.parent.grid.selectedRowIndex,this.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,this.parent.editModule.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,this.addRowRecord=this.parent.getSelectedRecords()[0]):(this.selectedIndex=this.parent.editModule.selectedIndex,this.addRowIndex=this.parent.editModule.addRowIndex,this.addRowRecord=(this.batchRecords.length?this.batchRecords:this.parent.getCurrentViewRecords())[this.selectedIndex])},A.prototype.batchAdd=function(e){var t,i,r;"Bottom"!==this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.newBatchRowAdded=!0,t=0,this.batchRecords.length||(this.batchAddedRecords=[],this.batchRecords=D(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=D(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!C.isNullOrUndefined(this.parent.editModule.addRowIndex)&&C.classList(this.parent.grid.getDataRows()[0],["e-batchrow"],[]),"Top"!==this.parent.editSettings.newRowPosition&&(i=this.parent.grid.getCurrentViewRecords(),"Batch"===this.parent.editSettings.mode&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)&&(i=this.batchRecords),this.updateChildCount(i),this.parent.notify(Ke,{}),this.batchChildCount=0),this.updateRowIndex(),i=C.getValue("focusModule",this.parent.grid),r=this.parent.getContentTable(),this.parent.getBatchChanges()[this.deletedRecords].length&&"Above"===this.parent.editSettings.newRowPosition?(t=e.row.rowIndex,i.getContent().matrix.matrix=this.matrix):t=this.parent.frozenRows?this.batchIndex:this.parent.editModule.isAddedMultipleRowsByMethod?e.index:r.getElementsByClassName("e-batchrow")[0].rowIndex,i.getContent().matrix.current=[t,i.getContent().matrix.current[1]],!this.parent.editModule.isAddedRowByMethod||C.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||this.parent.editModule.isAddedMultipleRowsByMethod||(e=this.parent.getBatchChanges().addedRecords,r=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[e.length-1].getAttribute("aria-rowindex"),10)-1,this.batchRecords.splice(r,0,e[e.length-1])))},A.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=D(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=D(this.parent.grid.getCurrentViewRecords()));var t,i,r=C.getValue("focusModule",this.parent.grid),n=(this.matrix=r.getContent().matrix.matrix,[]),o=[],a=this.parent.grid.getPrimaryKeyFieldNames()[0],r=Array.isArray(e.row)?e.row[0]:e.row,e=(C.isNullOrUndefined(r)||-1!==this.parent.getSelectedRows().indexOf(r)?(i=v(t=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1]),this.parent.getSelectedRows()[0]):(i=v(t=e.rowData),r)).getAttribute("data-uid"),r=parseInt(this.parent.grid.getRowElementByUID(e).getAttribute("aria-rowindex"),10)-1;if(i.length)for(var s=r+i.length,d=1+r;d<=s;d++)n.push(this.parent.grid.getDataRows()[parseInt(d.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&n.push(this.parent.grid.getHeaderContent()[parseInt(d.toString(),10)]);C.isNullOrUndefined(t.parentItem)||(e=M(this.parent,t.parentItem.uniqueID),!C.isNullOrUndefined(e)&&e.hasChildRecords&&(r=e.childRecords.indexOf(t),e.childRecords.splice(r,1)),this.batchDeletedRecords=D(this.batchDeletedRecords),this.batchDeletedRecords.push(t)),i.push(t);for(var o=i,l=this,d=0;d<o.length;d++)!function(t){var e=l.batchRecords.findIndex(function(e){return e[""+a]===o[parseInt(t.toString(),10)][""+a]});-1!==e&&l.batchRecords.splice(e,1)}(d);for(d=0;d<n.length;d++)C.isNullOrUndefined(n[parseInt(d.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(n[parseInt(d.toString(),10)])},A.prototype.updateRowIndex=function(){for(var e=this.parent.grid.getDataRows(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].setAttribute("aria-rowindex",(t+1).toString())},A.prototype.updateChildCount=function(e){for(var t=this.parent.grid.getPrimaryKeyFieldNames()[0],i=this.parent.getBatchChanges().addedRecords||[],r="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",n=0;n<i.length;n++)C.isNullOrUndefined(i[parseInt(n.toString(),10)][r])||i[parseInt(n.toString(),10)][r][""+t]===e[parseInt(this.addRowIndex.toString(),10)][""+t]&&(this.batchChildCount=this.batchChildCount+1)},A.prototype.beforeBatchSave=function(e){var t="changedRecords",i="deletedRecords",r=e.batchChanges[t];if(e.batchChanges[t].length)for(var n=0;n<r.length;n++)hi({value:r[parseInt(n.toString(),10)],action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,void 0);if(e.batchChanges[i].length)for(var o=e.batchChanges[i],n=0;n<o.length;n++){this.deleteUniqueID(o[parseInt(n.toString(),10)].uniqueID);for(var a=v(o[parseInt(n.toString(),10)]),s=0;s<a.length;s++)this.deleteUniqueID(a[parseInt(s.toString(),10)].uniqueID);e.batchChanges[i]=e.batchChanges[i].concat(a)}this.isAdd=!1},A.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},A.prototype.batchCancelAction=function(){var e,r=this,t="targetElement",n="parentItem",i="index",o=this.parent.grid.getCurrentViewRecords(),a="childRecords",s=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,d=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!C.isNullOrUndefined(this.batchAddedRecords))for(var l=this,p=0;p<this.batchAddedRecords.length;p++)!function(t){if(-1!==(h=s.findIndex(function(e){return e[""+d]===r.batchAddedRecords[parseInt(t.toString(),10)][""+d]}))&&s.splice(h,1),"Child"===l.parent.editSettings.newRowPosition&&(h=o.map(function(e){return e[""+d]}).indexOf((l.batchAddedRecords[parseInt(t.toString(),10)][""+n]?l.batchAddedRecords[parseInt(t.toString(),10)][""+n]:l.batchAddedRecords[parseInt(t.toString(),10)])[""+d]),!C.isNullOrUndefined(o[parseInt(h.toString(),10)])))for(var e=o[parseInt(h.toString(),10)][""+a],i=0;e&&i<e.length;i++)e[parseInt(i.toString(),10)][""+d]===l.batchAddedRecords[parseInt(t.toString(),10)][""+d]&&e.splice(i,1)}(p);if(C.isNullOrUndefined(this.parent[t])||(e=this.parent[t].closest("tr"),this.parent.collapseRow(e),this.parent[t]=null),!C.isNullOrUndefined(this.batchDeletedRecords))for(var h,c,p=0;p<this.batchDeletedRecords.length;p++)C.isNullOrUndefined(this.batchDeletedRecords[parseInt(p.toString(),10)][""+n])||(h=o.map(function(e){return e[""+d]}).indexOf(this.batchDeletedRecords[parseInt(p.toString(),10)][""+n][""+d]),c=0===this.batchDeletedRecords[parseInt(p.toString(),10)][i]?this.batchDeletedRecords[parseInt(p.toString(),10)][i]:this.batchDeletedRecords[parseInt(p.toString(),10)][i]-1,C.isNullOrUndefined(o[parseInt(h.toString(),10)]))||o[parseInt(h.toString(),10)][""+a].splice(c,0,this.batchDeletedRecords[parseInt(p.toString(),10)]);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=D(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=D(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},A.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var t,i,r,n,o=void 0,a=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),s="deletedRecords",d=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,l=this.parent.grid.getCurrentViewRecords(),p=this.parent.grid.getPrimaryKeyFieldNames()[0],h=a.addedRecords,c="parentItem",u=void 0,g=void 0,f="childRecords";if(1<h.length&&"Bottom"!==this.parent.editSettings.newRowPosition&&h.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(d.splice(d.length-h.length,h.length),this.parent.editModule.isAddedRowByMethod&&h.length&&!C.isNullOrUndefined(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){h.reverse();for(var m=0;m<h.length;m++){var y=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(m.toString(),10)].getAttribute("aria-rowindex"),10)-1;d.splice(y,0,h[parseInt(m.toString(),10)])}}this.parent.allowPaging||d.length===l.length?(i=D(d)).length&&0!==l.length&&(n=(r=i.map(function(e){return e[""+p]}).indexOf(l[0][""+p]))+this.parent.grid.pageSettings.pageSize,l=i.splice(r,n)):l.length>h.length&&l.splice(l.length-h.length,h.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&h.reverse(),o=0;o<h.length;o++){var S,w=C.extend({},h[parseInt(o.toString(),10)]);if(delete w.parentItem,delete w.uniqueID,delete w.index,delete w.level,delete w.hasChildRecords,delete w.childRecords,delete w.parentUniqueID,C.isNullOrUndefined(w.primaryParent)||delete w.primaryParent,1<h.length&&this.parent.editModule.isAddedRowByContextMenu&&(S=this.parent.editSettings.newRowPosition,this.parent.editSettings.newRowPosition=this.parent.editModule.previousNewRowPosition,this.parent.editModule.previousNewRowPosition=S),h[parseInt(o.toString(),10)].taskData=w,t=1<this.batchAddRowRecord.length?this.batchAddRowRecord[parseInt(o.toString(),10)]:this.batchAddRowRecord[0],C.isNullOrUndefined(t)&&(t=this.batchAddRowRecord[o-1]),!this.isSelfReference||C.isNullOrUndefined(h[parseInt(o.toString(),10)].parentItem)||O(p,h[parseInt(o.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,h[parseInt(o.toString(),10)]),C.isNullOrUndefined(t)||(g=t.index),C.isNullOrUndefined(h[parseInt(o.toString(),10)].index)&&(g=0),this.parent.editModule.isAddedMultipleRowsByMethod&&this.isSelfReference&&("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)&&(g=e.index,t=this.parent.flatData[e.index]),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&C.isNullOrUndefined(h[parseInt(o.toString(),10)].parentItem)&&-1===this.selectedIndex&&(u=-1,t=null),hi({value:h[parseInt(o.toString(),10)],action:"add"},this.parent,this.isSelfReference,g,u,void 0,t),u=null,"Child"===this.parent.editSettings.newRowPosition&&!C.isNullOrUndefined(h[parseInt(o.toString(),10)][c])&&(C.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.isSelfReference)){var I=l.map(function(e){return e[""+p]}).indexOf(h[parseInt(o.toString(),10)][c][""+p]),R=l[parseInt(I.toString(),10)][f];if(!C.isNullOrUndefined(g)&&R.some(function(e){return e.uniqueID===t.uniqueID}))for(var v=0;v<R.length;v++)R[parseInt(v.toString(),10)][""+p]===h[parseInt(o.toString(),10)][""+p]&&l[parseInt(I.toString(),10)][f].splice(v,1)}}if(a[s].length)for(o=0;o<a[s].length;o++)hi({value:a[s][parseInt(o.toString(),10)],action:"delete"},this.parent,this.isSelfReference,g,u,void 0,t);this.parent.parentData=[];for(var x=0;x<d.length;x++)d[parseInt(x.toString(),10)].index=x,C.setValue("uniqueIDCollection."+d[parseInt(x.toString(),10)].uniqueID+".index",x,this.parent),d[parseInt(x.toString(),10)].level||this.parent.parentData.push(d[parseInt(x.toString(),10)])}this.batchAddRowRecord=this.batchAddedRecords=this.batchRecords=this.batchDeletedRecords=this.currentViewRecords=[],this.parent.editModule.isAddedRowByContextMenu&&(this.parent.editModule.isAddedRowByContextMenu=!1)},A.prototype.getActualRowObjectIndex=function(e){var t=this.parent.grid.getDataRows();return("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&-1<this.selectedIndex&&(!C.isNullOrUndefined(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length?(e+=v(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition&&(e+=this.getBatchChildCount())):e+=v(this.batchRecords[this.addRowIndex]).length),e>=t.length&&(e=t.length-1),this.updateChildCount(this.parent.grid.getCurrentViewRecords()),this.batchChildCount&&(e+=this.batchChildCount),this.batchChildCount=0),e},A.prototype.immutableBatchAction=function(e){e.args.cancel=!0;var t=this.parent.grid.getBatchChanges(),i=[];Object.keys(t).length&&(i=t.addedRecords);for(var r=0;r<i.length;r++)e.rows.splice(i[parseInt(r.toString(),10)].index,1)},A.prototype.nextCellIndex=function(e){var t="index",i=this.parent.getBatchChanges().deletedRecords;this.parent.getSelectedRows().length?this.isAdd&&0<i.length?e[t]=this.parent.getSelectedRecords()[0][t]:e[t]=this.parent.getSelectedRows()[0].rowIndex:e[t]=this.batchIndex},A.prototype.onCellFocused=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.grid.isEdit&&e.keyArgs&&"shiftEnter"===e.keyArgs.action&&(e.keyArgs.preventDefault(),this.parent.endEdit())};var Qi=A;function A(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!C.isNullOrUndefined(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}E.prototype.getModuleName=function(){return"edit"},E.prototype.addEventListener=function(){this.parent.on(Ge,this.crudAction,this),this.parent.on(Qe,this.beginEdit,this),this.parent.on(Ke,this.beginAdd,this),this.parent.on(We,this.recordDoubleClick,this),this.parent.on(Ye,this.cellSave,this),this.parent.on(Ze,this.batchCancel,this),this.parent.grid.on(ot,this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on(Xe,this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on(at,this.recordDoubleClick,this),this.parent.grid.on("dblclick",this.gridDblClick,this),this.parent.grid.on("recordAdded",this.customCellSave,this),this.parent.on("savePreviousRowPosition",this.savePreviousRowPosition,this),this.parent.grid.on(ht,this.beforeStartEdit,this),this.parent.grid.on(ct,this.beforeBatchCancel,this),this.parent.grid.on("reset-edit-props",this.resetIsOnBatch,this),this.parent.grid.on("get-row-position",this.getRowPosition,this)},E.prototype.gridDblClick=function(e){this.doubleClickTarget=e.target,e.target.classList.contains("e-frame")&&0===this.parent.getCurrentViewRecords().length&&(this.doubleClickTarget=null),(e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand"))&&(e=(e=w.parentsUntil(e.target,"e-row"))&&parseInt(e.getAttribute("aria-rowindex"),10)-1,!C.isNullOrUndefined(e))&&0<=e&&this.parent.allowPaging&&(this.parent.grid.getDataRows()[e].dataset.uid=this.parent.grid.contentModule.getRows()[e].uid)},E.prototype.getRowPosition=function(e){e.newRowPosition=this.parent.editSettings.newRowPosition,e.addRowIndex=this.addRowIndex,e.dataRowIndex=+this.prevAriaRowIndex},E.prototype.beforeStartEdit=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.trigger(ve,e)},E.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger(Ce,e))},E.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ge,this.crudAction),this.parent.off(Qe,this.beginEdit),this.parent.off(Ke,this.beginAdd),this.parent.off(We,this.recordDoubleClick),this.parent.off(Ze,this.batchCancel),this.parent.grid.off(ot,this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off(Xe,this.cellEdit),this.parent.off("actionBegin",this.editActionEvents),this.parent.off("actionComplete",this.editActionEvents),this.parent.grid.off("recordAdded",this.customCellSave),this.parent.grid.off(at,this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off(ht,this.beforeStartEdit),this.parent.grid.off(ct,this.beforeBatchCancel),this.parent.grid.off("dblclick",this.gridDblClick),this.parent.grid.off("reset-edit-props",this.resetIsOnBatch),this.parent.grid.off("get-row-position",this.getRowPosition))},E.prototype.destroy=function(){this.removeEventListener()},E.prototype.applyFormValidation=function(e){this.parent.grid.editModule.applyFormValidation(e)},E.prototype.editActionEvents=function(e){var e=w.getObject("editAction",e),t=w.getObject("name",e),i=this.parent,r=!C.isNullOrUndefined(i.dataSource)&&i.dataSource.adaptor;if(!C.isNullOrUndefined(r)&&(I(i)||r instanceof b.RemoteSaveAdaptor)&&"save"===e.requestType&&"add"===e.action&&("Child"===i.editSettings.newRowPosition||"Below"===i.editSettings.newRowPosition||"Above"===i.editSettings.newRowPosition))if("actionBegin"===t){r=C.isNullOrUndefined(e.row)||!Object.keys(e.row).length?this.selectedIndex:e.row.rowIndex-1,r=C.isNullOrUndefined(r)||-1===r?-1:i.getCurrentViewRecords()[parseInt(r.toString(),10)][i.getPrimaryKeyFieldNames()[0]];i.grid.query.addParams("relationalKey",r)}else if("actionComplete"===t)for(var n=i.grid.query.params.length,o=0;o<n;o++)"relationalKey"===i.grid.query.params[parseInt(o.toString(),10)].key&&i.grid.query.params.splice(o);this.parent.enableInfiniteScrolling&&"actionComplete"===t&&this.infiniteAddAction(e),"Batch"===this.parent.editSettings.mode&&"paging"===e.requestType&&this.parent.notify("batchPageAction",{})},E.prototype.infiniteAddAction=function(e){var t,i,r;("save"===e.requestType&&"add"===e.action||"delete"===e.requestType)&&("Top"!==this.parent.editSettings.newRowPosition&&-1!==this.selectedIndex&&"save"===e.requestType&&"add"===e.action&&(t=(e=this.parent.grid.getRowsObject()).splice(0,1)[0],r=this.addRowIndex,i=this.parent.getCurrentViewRecords(),"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(r+=v(i[r+1]).length),r="Below"===this.parent.editSettings.newRowPosition?r+1:r,e.splice(r,0,t),e=i.splice(0,1)[0],i.splice(r,0,e),this.updateInfiniteCurrentViewData(e,this.addRowIndex)),t=this.parent.grid.getRows(),i=this.parent.grid.getRowsObject(),(r=this.parent.infiniteScrollSettings.enableCache)||(w.resetRowIndex(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0),this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords())),!r)&&0<this.parent.getFrozenColumns()&&(w.resetRowIndex(this.parent.grid,i,t,0),this.updateIndex(this.parent.grid.dataSource,t,this.parent.getCurrentViewRecords()))},E.prototype.updateInfiniteCurrentViewData=function(e,t){var i=this,r=Math.ceil(t/this.parent.grid.pageSettings.pageSize),r=0<r?r:1,n=t-(r-1)*this.parent.pageSettings.pageSize,t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,o=(t[1].splice(0,1),t[parseInt(r.toString(),10)]);!C.isNullOrUndefined(this.addRowRecord)&&(o.filter(function(e,t){e.uniqueID===i.addRowRecord.uniqueID&&(n=t)}),this.addRowRecord.hasChildRecords&&this.addRowRecord.childRecords.length&&"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(n+=v(this.addRowRecord).length),n>=this.parent.pageSettings.pageSize&&(r+=1,o=t[parseInt(r.toString(),10)],n=0<=n-this.parent.pageSettings.pageSize?n-this.parent.pageSettings.pageSize:0),n="Below"===this.parent.editSettings.newRowPosition?n+1:n,o.splice(n,0,e),this.parent.grid.infiniteScrollModule.updateCurrentViewData()},E.prototype.recordDoubleClick=function(e){var t,i=e.target;C.isNullOrUndefined(i.closest("td.e-rowcell"))||this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit&&(t=this.parent.grid.getColumnByIndex(+i.closest("td.e-rowcell").getAttribute("aria-colindex")-1),"Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&t&&!t.isPrimaryKey&&this.parent.editSettings.allowEditing&&t.allowEditing&&!i.classList.contains("e-treegridexpand")&&!i.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick?(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization&&(i=w.parentsUntil(e.target,"e-row"),this.prevAriaRowIndex=i.getAttribute("aria-rowindex"),i.setAttribute("aria-rowindex",i.rowIndex+1+"")),this.updateGridEditMode("Batch")):"Cell"!==this.parent.editSettings.mode||t.allowEditing&&!t.isPrimaryKey||(this.isOnBatch=!0,this.updateGridEditMode("Batch")))},E.prototype.updateGridEditMode=function(e){this.parent.grid.setProperties({editSettings:{mode:e}},!0),w.getObject("updateEditObj",this.parent.grid.editModule).apply(this.parent.grid.editModule),this.parent.grid.isEdit=!1},E.prototype.resetIsOnBatch=function(){this.parent.enableVirtualization&&"Cell"===this.parent.editSettings.mode&&(this.isOnBatch=!1,this.updateGridEditMode("Normal"))},E.prototype.keyPressed=function(e){!this.isOnBatch&&"tab"!==e.action&&"shiftTab"!==e.action||(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.closeEdit()},E.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},E.prototype.cellEdit=function(e){var t=this,i="promise",r=e[i];delete e[i],this.parent.enableVirtualization&&!C.isNullOrUndefined(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("aria-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger(Xe,e,function(e){e.cancel||"Cell"!==t.parent.editSettings.mode?e.cancel&&"Cell"===t.parent.editSettings.mode&&(t.isOnBatch=!1,t.updateGridEditMode("Normal")):t.enableToolbarItems("edit"),C.isNullOrUndefined(r)||r.resolve(e)}),this.doubleClickTarget&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-summarycell"))?(e.cancel=!0,this.doubleClickTarget=null):("Cell"===this.parent.editSettings.mode&&("tab"===this.keyPress||"shiftTab"===this.keyPress?this.keyPress=null:"enter"===this.keyPress&&(e.cancel=!0,this.keyPress=null,C.setValue("isEditCollapse",!1,this.parent)),e.columnObject.allowEditing||(e.cancel=!0)),this.parent.enableVirtualization&&(this.parent.grid.contentModule.editedRowIndex=this.parent.grid.editModule.editModule.index))},E.prototype.enableToolbarItems=function(e){var t;C.isNullOrUndefined(this.parent.grid.toolbarModule)||(t=this.parent.element.id+"_gridcontrol_",this.parent.grid.toolbarModule.enableItems([t+"add",t+"edit",t+"delete"],"save"===e),this.parent.grid.toolbarModule.enableItems([t+"update",t+"cancel"],"edit"===e))},E.prototype.batchCancel=function(){var e,t;"Cell"===this.parent.editSettings.mode&&(e=C.getValue("editModule.cellDetails",this.parent.grid.editModule),C.isNullOrUndefined(this.editedRowIndex)||(e.rowIndex=this.editedRowIndex),t=this.parent.getCellFromIndex(e.rowIndex,this.parent.treeColumnIndex),this.parent.renderModule.cellRender({data:e.rowData,cell:t,column:this.parent.grid.getColumns()[this.parent.treeColumnIndex]}),this.updateGridEditMode("Normal"),this.isOnBatch=!1),"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchCancelAction",{})},E.prototype.customCellSave=function(e){R(this.parent)&&"Cell"===this.parent.editSettings.mode&&"edit"===e.action&&(this.updateCell(e,e.rowIndex),this.afterCellSave(e,e.row))},E.prototype.cellSave=function(i){var t,r,n,e,o=this;"Cell"===this.parent.editSettings.mode&&this.parent.element.querySelector("form")&&(i.cancel=!0,C.setValue("isEditCollapse",!0,this.parent),i.rowData[i.columnName]=i.value,t=(C.isNullOrUndefined(i.cell)?this.parent.grid.editModule.editModule.form.parentElement:i.cell).parentNode,r=this.parent.getPrimaryKeyFieldNames(),C.isNullOrUndefined(t)?this.parent.grid.getCurrentViewRecords().filter(function(e,t){e[r[0]]===i.rowData[r[0]]&&(n=t)}):n=(0<this.parent.getFrozenLeftColumnsCount()||0<this.parent.getFrozenRightColumnsCount()?(this.parent.getRows().indexOf(t),this.parent):-1===this.parent.getRows().indexOf(t)&&0<this.parent.getFrozenColumns()?this.parent.grid:this.parent).getRows().indexOf(t),C.extend(e={},i),e.cancel=!1,e.type="save",t=this.parent.grid.getRows()[t.rowIndex],this.parent.trigger(ve,e),e.cancel?this.parent.grid.isEdit=!0:(t.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),I(this.parent)||this.parent.dataSource instanceof b.DataManager&&this.parent.dataSource.adaptor instanceof b.RemoteSaveAdaptor?(I(this.parent)||this.parent.dataSource instanceof b.DataManager&&this.parent.dataSource.adaptor instanceof b.RemoteSaveAdaptor)&&(e=this.parent.grid.query,this.parent.isGantt&&this.parent.loadChildOnDemand?(this.updateCell(i,n),C.setValue("isEdit",!1,this.parent.grid),this.afterCellSave(i,t)):this.parent.grid.dataSource.update(r[0],i.rowData,e.fromTable,e,i.previousValue).then(function(e){C.isNullOrUndefined(e)||(i.rowData[i.columnName]=e[i.columnName]),o.updateCell(i,n),C.setValue("isEdit",!1,o.parent.grid),o.afterCellSave(i,t)})):R(this.parent)?(e={requestType:"save",data:i.rowData,action:"edit",row:t,rowIndex:n,rowData:i.rowData,columnName:i.columnName,filterChoiceCount:null,excelSearchOperator:null},this.parent.grid.getDataModule().eventPromise(e,this.parent.grid.query)):(this.updateCell(i,n),C.setValue("isEdit",!1,this.parent.grid),this.afterCellSave(i,t)))),this.parent.enableVirtualization&&(this.parent.grid.contentModule.virtualData={})},E.prototype.afterCellSave=function(e,t){this.parent.grid.aggregateModule&&this.parent.grid.aggregateModule.refresh(e.rowData),this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(e.columnName)]),this.parent.grid.editModule.formObj.destroy(),"tab"!==this.keyPress&&"shiftTab"!==this.keyPress&&(this.updateGridEditMode("Normal"),this.isOnBatch=!1),this.enableToolbarItems("save"),C.removeClass([t],["e-editedrow","e-batchrow"]),C.removeClass(t.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),hi({value:e.rowData,action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,e.columnName),t.rowIndex===this.parent.getCurrentViewRecords().length-1&&"enter"===this.keyPress&&(this.keyPress=null);t={type:"save",column:this.parent.getColumnByField(e.columnName),data:e.rowData,previousData:e.previousValue,row:t,target:e.cell};this.parent.aggregates.map(function(e){return!0===e.showChildSummary}).length&&this.parent.grid.refresh(),this.parent.trigger(Ce,t)},E.prototype.lastCellTab=function(){!this.parent.grid.isEdit&&this.isOnBatch&&"tab"===this.keyPress&&"Cell"===this.parent.editSettings.mode&&(this.parent.editSettings.allowNextRowEdit?this.enableToolbarItems("edit"):(this.updateGridEditMode("Normal"),this.isOnBatch=!1,this.keyPress=null))},E.prototype.updateCell=function(e,t){this.parent.grid.editModule.updateCell(t,e.columnName,e.rowData[e.columnName]),this.parent.grid.getRowsObject()[parseInt(t.toString(),10)].data=e.rowData},E.prototype.crudAction=function(e,t){hi(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,t,this.addRowRecord),this.parent.parentData=[];for(var i=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,r=0;r<i.length;r++){i[parseInt(r.toString(),10)].index=r;var n=this.parent.grid.getPrimaryKeyFieldNames()[0],n=(e.value[""+n]===i[parseInt(r.toString(),10)][""+n]&&"add"===e.action&&(i[parseInt(r.toString(),10)].level=this.internalProperties.level,i[parseInt(r.toString(),10)].taskData=this.internalProperties.taskData,i[parseInt(r.toString(),10)].uniqueID=this.internalProperties.uniqueID,C.isNullOrUndefined(this.internalProperties.parentItem)||(i[parseInt(r.toString(),10)].parentItem=this.internalProperties.parentItem,i[parseInt(r.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),i[parseInt(r.toString(),10)].childRecords=this.internalProperties.childRecords),C.setValue("uniqueIDCollection."+i[parseInt(r.toString(),10)].uniqueID+".index",r,this.parent),this.parent.dataSource.adaptor);(I(this.parent)||n instanceof b.RemoteSaveAdaptor)&&C.setValue("uniqueIDCollection."+i[parseInt(r.toString(),10)].uniqueID,i[parseInt(r.toString(),10)],this.parent),i[parseInt(r.toString(),10)].level||this.parent.parentData.push(i[parseInt(r.toString(),10)])}this.parent.enableInfiniteScrolling||"add"===e.action&&null!=this.previousNewRowPosition&&(this.parent.setProperties({editSettings:{newRowPosition:this.previousNewRowPosition}},!0),this.previousNewRowPosition=null)},E.prototype.updateIndex=function(e,t,i){for(var r=0;r<this.parent.getDataRows().length;r++){var n,o=i[parseInt(r.toString(),10)];C.isNullOrUndefined(o)||(c=C.getValue("uniqueIDCollection."+o.uniqueID+".index",this.parent),o.index=c,C.isNullOrUndefined(o.parentItem))||(n=C.getValue("uniqueIDCollection."+o.parentItem.uniqueID+".index",this.parent),o.parentItem.index=n)}var a=-1,s=this.parent.treeColumnIndex;if(0<this.parent.getFrozenColumns())for(var d=t[0].querySelectorAll(".e-rowcell"),l=0;l<d.length;l++)if(d[parseInt(l.toString(),10)].classList.contains("e-gridrowindex0level0")){s=l;break}for(var p=0;p<this.parent.getRows().length;p++){t[parseInt(p.toString(),10)].classList.contains("e-detailrow")||a++;var h=i[parseInt(a.toString(),10)];if(!C.isNullOrUndefined(h)){var c=h.index,u=h.level,g=t[parseInt(p.toString(),10)],f=(C.isNullOrUndefined(h.parentItem)||(c=C.getValue("uniqueIDCollection."+h.parentItem.uniqueID+".index",this.parent)),g.cells[parseInt(s.toString(),10)]);if(!C.isNullOrUndefined(f)){for(l=0;l<f.classList.length;l++){var m=f.classList[parseInt(l.toString(),10)],y=m.match(/e-gridrowindex/i),S=m.match(/e-griddetailrowindex/i);null!=y&&C.removeClass([f],m),null!=S&&C.removeClass([f],m)}t[parseInt(p.toString(),10)].classList.contains("e-detailrow")?C.addClass([f],"e-griddetailrowindex"+c+"level"+u):C.addClass([f],"e-gridrowindex"+c+"level"+u)}}}},E.prototype.beginAdd=function(){var e=this.addRowIndex,t=this.parent.grid.getCurrentViewRecords(),i=("Batch"===this.parent.editSettings.mode&&(e=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex(),1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)&&(t=this.batchEditModule.getBatchRecords()),this.parent.grid.getDataRows()),r=i.length?+i[0].getAttribute("aria-rowindex")-1:0,n=i.length?+i[i.length-1].getAttribute("aria-rowindex")-1:0,r=this.selectedIndex>=r&&this.selectedIndex<=n,n=this.parent.enableVirtualization&&-1<this.addRowIndex&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode&&("Above"===this.parent.editSettings.newRowPosition?a="before":("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(-1<this.selectedIndex||n)&&r&&(a="after",!C.isNullOrUndefined(t[parseInt(e.toString(),10)]))&&t[parseInt(e.toString(),10)].expanded&&("Batch"===this.parent.editSettings.mode&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)?(e+=v(t[parseInt(e.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition&&(e+=this.batchEditModule.getBatchChildCount())):this.parent.enableVirtualization||(e+=v(t[parseInt(e.toString(),10)]).length)),(-1<this.selectedIndex||n)&&r&&(e||"Child"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition))){e>=i.length-1&&(e=i.length-2);var t="rows",r=this.parent.grid.contentModule[t][0],o=document.activeElement,a=(i[e+1][""+a](i[0]),C.setValue("batchIndex",e+1,this.batchEditModule),"Above"===this.parent.editSettings.newRowPosition?e:e+1);if("Batch"===this.parent.editSettings.mode&&(this.parent.grid.contentModule[t].splice(0,1),this.parent.grid.contentModule[t].splice(a,0,r)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var s=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),d=0;d<s.length;d++)s[parseInt(d.toString(),10)].remove();C.setValue("errorRules",[],this.parent.grid.editModule.formObj)}n&&(this.prevAriaRowIndex="-1"),this.parent.enableVirtualization&&!this.parent.enableVirtualization||(this.isScrollByFocus=!0,o.focus()),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}if("Batch"!==this.parent.editSettings.mode||C.isNullOrUndefined(this.addRowIndex)||-1===this.addRowIndex||this.isAddedMultipleRowsByMethod||!this.isAddedRowByMethod||this.isAddedRowByContextMenu){if("Batch"===this.parent.editSettings.mode&&this.isAddedMultipleRowsByMethod&&("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)){e=this.multipleRowIndex,this.selectedIndex=this.multipleRowIndex;p=void 0;if((l=this.updatedRecords.addedRecords).length)for(d=0;d<l.length;d++){h={action:"add",data:p=C.isNullOrUndefined(l[parseInt(d.toString(),10)].uniqueID)?l[parseInt(d.toString(),10)]:p,index:e,seletedRow:0};this.beginAddEdit(h),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(h.data)}}}else{e=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();var l,p=void 0;if((l=this.parent.getBatchChanges().addedRecords).length)for(var d=0;d<l.length;d++)C.isNullOrUndefined(l[parseInt(d.toString(),10)].uniqueID)&&(p=l[parseInt(d.toString(),10)]);var h={action:"add",data:p,index:e,seletedRow:0};this.beginAddEdit(h),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(h.data)}},E.prototype.beginEdit=function(i){if(0!==this.parent.flatData.length||C.isNullOrUndefined(this.addRowRecord)||(this.addRowRecord=void 0),"refresh"===i.requestType&&this.isOnBatch)i.cancel=!0;else if("Cell"===this.parent.editSettings.mode&&"beginEdit"===i.requestType)i.cancel=!0;else if(this.doubleClickTarget&&"delete"!==i.requestType&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-frame")))i.cancel=!0,this.doubleClickTarget=null;else{if("delete"===i.requestType){var r=i.data;if(C.isNullOrUndefined(i.data[0].uniqueID))for(var n=this.parent.getPrimaryKeyFieldNames(),e=this,t=0;t<r.length;t++)!function(t){e.parent.flatData.filter(function(e){e[""+n[0]]===i.data[parseInt(t.toString(),10)][n[0]]&&(r[parseInt(t.toString(),10)]=e)})}(t);for(t=0;t<r.length;t++){this.deleteUniqueID(r[parseInt(t.toString(),10)].uniqueID);for(var o=v(r[parseInt(t.toString(),10)]),a=0;a<o.length;a++)this.deleteUniqueID(o[parseInt(a.toString(),10)].uniqueID);i.data=i.data.concat(o)}}var s,d;("add"===i.requestType||this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&((-1===this.parent.grid.selectedRowIndex&&this.isAddedRowByMethod||i.index!==this.parent.grid.selectedRowIndex)&&0!==i.index||(this.selectedIndex=this.parent.grid.selectedRowIndex),this.parent.enableVirtualization?(d='.e-row[aria-rowindex="'+(this.selectedIndex+1)+'"]',s=void 0,-1<this.selectedIndex&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),s=this.parent.getContent().querySelector(d),this.addRowIndex=s?s.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(d='.e-row[aria-rowindex="'+(this.prevAriaRowIndex+1)+'"]',s=this.parent.getContent().querySelector(d),this.addRowIndex=s?s.rowIndex:0):this.addRowIndex=0):this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?0!==i.index?this.addRowIndex=i.index:this.addRowIndex=this.parent.grid.selectedRowIndex:this.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,d=this.parent.getSelectedRecords()[0],(this.isAddedRowByMethod||this.isAddedRowByContextMenu&&-1!==this.parent.grid.selectedRowIndex)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.addRowRecord=this.parent.flatData[this.parent.grid.selectedRowIndex],this.parent.enableVirtualization&&this.isAddedRowByContextMenu&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex])):C.isNullOrUndefined(d)||(this.addRowRecord=d)),this.isAddedRowByMethod&&0!==i.index&&(this.addRowRecord=this.parent.flatData[i.index],this.addRowIndex=i.index),"Child"!==this.parent.editSettings.newRowPosition||!this.isIndexUndefined&&!this.isAddedRowByMethod||C.isNullOrUndefined(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0],this.isIndexUndefined=!1),C.isNullOrUndefined(this.addRowRecord)&&this.parent.getCurrentViewRecords().length>this.addRowIndex&&"save"===i.requestType&&0!==this.parent.getSelectedRecords().length&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex]),this.isAddedRowByMethod=!1,i=this.beginAddEdit(i)}},E.prototype.savePreviousRowPosition=function(){null===this.previousNewRowPosition&&(this.previousNewRowPosition=this.parent.editSettings.newRowPosition)},E.prototype.beginAddEdit=function(e){var t,i,r,n,o,a,s,d,l,p,h,c,u,g=e.data;if("add"===e.action&&(t=this.parent.grid.getPrimaryKeyFieldNames()[0],d=null,u=void(g.taskData=C.isNullOrUndefined(g.taskData)?C.extend({},e.data):g.taskData),u=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!C.isNullOrUndefined(this.addRowIndex)?this.batchEditModule.batchRecords:this.parent.grid.getCurrentViewRecords(),this.parent.enableVirtualization&&0!==e.index&&(this.addRowIndex=this.parent.flatData.indexOf(this.addRowRecord),this.selectedIndex=this.addRowIndex),l=this.addRowIndex,g.uniqueID=w.getUid(this.parent.element.id+"_data_"),C.setValue("uniqueIDCollection."+g.uniqueID,g,this.parent),o=n=r=i=void(c=0),a=this.parent.enableVirtualization&&-1<this.addRowIndex&&"-1"!==this.prevAriaRowIndex,s=(p=this.parent.getRows()).length?u.indexOf(u[0]):0,p=p.length?+p[p.length-1].getAttribute("aria-rowindex")-1:0,s=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=s&&this.selectedIndex<=p,u.length&&!C.isNullOrUndefined(l)&&(i=u[this.addRowIndex][this.parent.idMapping],o=u[this.addRowIndex][this.parent.parentIdMapping],u[this.addRowIndex].parentItem&&(r=u[this.addRowIndex].parentItem.uniqueID),n=u[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&u.length&&!C.isNullOrUndefined(l)&&(c=u[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition?(d="before",l=u[this.addRowIndex].index):"Below"===this.parent.editSettings.newRowPosition?(d="after",p=v(u[this.addRowIndex]).length,h=u[this.addRowIndex].index,l=0<p?h+p:h):"Child"===this.parent.editSettings.newRowPosition&&(d="after",(-1<this.selectedIndex||a)&&s&&(g.parentItem=C.extend({},u[this.addRowIndex]),g.parentUniqueID=g.parentItem.uniqueID,delete g.parentItem.childRecords,delete g.parentItem[this.parent.childMapping]),p=v(u[this.addRowIndex]).length,h=u[this.addRowIndex].index,0<=this.selectedIndex&&(g.level=c+1),l=0<p?h+p:h,this.isSelfReference)&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?g.taskData[this.parent.parentIdMapping]=g[this.parent.parentIdMapping]=i:g.taskData[this.parent.parentIdMapping]=g[this.parent.parentIdMapping]=null,C.isNullOrUndefined(g.parentItem)||O(t,g.parentItem,"add",this.parent,this.isSelfReference,g)),"Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((-1<this.selectedIndex||a)&&c&&s&&(g.parentUniqueID=r,g.parentItem=C.extend({},n),delete g.parentItem.childRecords,delete g.parentItem[this.parent.childMapping]),g.level=c,this.isSelfReference&&(g.taskData[this.parent.parentIdMapping]=g[this.parent.parentIdMapping]=o,C.isNullOrUndefined(g.parentItem)||O(t,g.parentItem,"add",this.parent,this.isSelfReference,g))),null!=d&&(-1<this.selectedIndex||a)&&s&&(e.index="before"===d?l:l+1),"Bottom"===this.parent.editSettings.newRowPosition)&&(c=0,u=this.parent.grid.dataSource instanceof b.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,e.index=u.length),C.isNullOrUndefined(g.level)&&(g.level=c),g.hasChildRecords=!1,g.childRecords=[],g.index=0),"add"===e.action&&(this.internalProperties={level:g.level,parentItem:g.parentItem,uniqueID:g.uniqueID,taskData:g.taskData,parentUniqueID:C.isNullOrUndefined(g.parentItem)?void 0:g.parentItem.uniqueID,childRecords:g.childRecords}),"delete"===e.requestType){var f=e.data,m=this.parent.getPrimaryKeyFieldNames();if(!C.isNullOrUndefined(m)&&0<m.length)for(var y=this,S=0;S<f.length;S++)!function(t){var e,i=f[parseInt(t.toString(),10)].parentItem;i&&(i=M(y.parent,i.uniqueID),!C.isNullOrUndefined(i))&&i.hasChildRecords&&(e=i.childRecords.findIndex(function(e){return f[parseInt(t.toString(),10)][m[0]]===e[m[0]]}),i.childRecords.splice(e,1))}(S)}return e},E.prototype.addRecord=function(e,t,i){var r,n,o,a;this.parent.editSettings.newRowPosition!==this.previousNewRowPosition&&null!==this.previousNewRowPosition||(this.previousNewRowPosition=this.parent.editSettings.newRowPosition),C.isNullOrUndefined(t)&&(this.isIndexUndefined=!0),!C.isNullOrUndefined(e)&&Array.isArray(e)?(r=[],n=this.parent.editSettings.mode,o=this.parent.grid.editSettings.mode,this.isSelfReference||C.isNullOrUndefined(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping)?Array.isArray(e)&&(r=e):r.push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),C.isNullOrUndefined(i)||this.parent.setProperties({editSettings:{newRowPosition:i}},!0),this.updatedRecords={addedRecords:r,changedRecords:[],deletedRecords:[]},"Above"!==i&&"Below"!==i||!this.isSelfReference||(this.isAddedMultipleRowsByMethod=!0,this.multipleRowIndex=t,this.addRowIndex=t,this.parent.notify(et,{updatedRecords:this.updatedRecords,index:t})),a=this.updatedRecords,this.parent.notify(nt,{updatedRecords:a,index:t}),this.parent.setProperties({editSettings:{mode:n}},!0),this.parent.grid.setProperties({editSettings:{mode:o}},!0),this.parent.refresh()):this.isSelfReference||C.isNullOrUndefined(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping)?(e&&(-1<t?(this.selectedIndex=t,this.addRowIndex=t):(this.selectedIndex=this.parent.selectedRowIndex,this.addRowIndex=this.parent.selectedRowIndex),i)&&this.parent.setProperties({editSettings:{newRowPosition:i}},!0),this.parent.grid.editModule.addRecord(e,t)):(n=this.parent.editSettings.mode,o=this.parent.grid.editSettings.mode,(r=[]).push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),C.isNullOrUndefined(i)||this.parent.setProperties({editSettings:{newRowPosition:i}},!0),this.updatedRecords={addedRecords:r,changedRecords:[],deletedRecords:[]},a=this.updatedRecords,this.parent.notify(nt,{updatedRecords:a,index:t}),this.parent.setProperties({editSettings:{mode:n}},!0),this.parent.grid.setProperties({editSettings:{mode:o}},!0),this.parent.refresh())},E.prototype.editFormValidate=function(){return this.parent.grid.editModule.editFormValidate()},E.prototype.destroyForm=function(){this.parent.grid.editModule.destroyForm()},E.prototype.contentready=function(e){C.isNullOrUndefined(e.args.requestType)||"delete"!==e.args.requestType.toString()&&"save"!==e.args.requestType.toString()&&("Batch"!==this.parent.editSettings.mode||"batchsave"!==e.args.requestType.toString())||(this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),(this.parent.frozenRows||this.parent.getFrozenColumns()||this.parent.frozenColumns)&&this.parent.grid.dataSource.length===this.parent.getDataRows().length&&this.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords()))},E.prototype.editCell=function(e,t){"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||("Batch"!==this.parent.editSettings.mode&&(this.isOnBatch=!0,this.updateGridEditMode("Batch")),this.parent.grid.editModule.editCell(e,t))},E.prototype.closeEdit=function(){this.parent.enableVirtualization&&"Batch"===this.parent.grid.editSettings.mode&&1<this.parent.grid.pageSettings.currentPage&&(this.editedRowIndex=this.parent.grid.editModule.editModule.cellDetails.rowIndex,this.parent.grid.editModule.editModule.cellDetails.rowIndex=parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule.cellDetails.rowIndex].getAttribute("aria-rowIndex"),10)-1),this.parent.grid.editModule.closeEdit()};var Ki=E;function E(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,this.isIndexUndefined=!1,this.isAddedMultipleRowsByMethod=!1,w.Grid.Inject(w.Edit),this.parent=e,this.isSelfReference=!C.isNullOrUndefined(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new Qi(this.parent),this.addEventListener()}Yi.prototype.getModuleName=function(){return"commandColumn"},Yi.prototype.destroy=function(){};var Wi=Yi;function Yi(e){w.Grid.Inject(w.CommandColumn),this.parent=e}N.prototype.getModuleName=function(){return"detailRow"},N.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.on("detaildataBound",this.detaildataBound,this),this.parent.grid.on("detail-indentcell-info",this.setIndentVisibility,this),this.parent.on("childRowExpand",this.childRowExpand,this),this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("actioncomplete",this.actioncomplete,this)},N.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.off("detaildataBound",this.detaildataBound),this.parent.off("childRowExpand",this.childRowExpand),this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("actioncomplete",this.actioncomplete),this.parent.grid.off("detail-indentcell-info",this.setIndentVisibility))},N.prototype.setIndentVisibility=function(e){e.visible=!1},N.prototype.dataBoundArg=function(){for(var e=this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)].getElementsByClassName("e-detailrowcollapse"),r=this.parent.grid.getRowObjectFromUID(e[parseInt(t.toString(),10)].getAttribute("data-Uid")),n=w.getObject("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(t.toString(),10)]);(C.isNullOrUndefined(n)||!C.isNullOrUndefined(n)&&y(this.parent,r.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(i[0])}},N.prototype.childRowExpand=function(e){e=e.row.getElementsByClassName("e-detailrowcollapse");C.isNullOrUndefined(e[0])||this.parent.grid.detailRowModule.expand(e[0])},N.prototype.rowExpandCollapse=function(e){if(!I(this.parent))for(var t=0;t<e.detailrows.length;t++)this.parent.toggleRowVisibility(e.detailrows[parseInt(t.toString(),10)],e.action)},N.prototype.detaildataBound=function(e){var t=e.data,i=e.detailElement.parentElement.previousSibling,r="e-gridrowindex"+(C.isNullOrUndefined(t.parentItem)?t:t.parentItem).index+"level"+t.level,t=i.querySelector("."+r).classList,i=[].slice.call(t).filter(function(e){return e===r}),t=i[0].length,i=i.toString().slice(6,t);C.addClass([e.detailElement.parentElement],"e-griddetail"+i)},N.prototype.actioncomplete=function(e){"beginEdit"!==e.requestType&&"add"!==e.requestType||(t=e.row.querySelectorAll(".e-editcell")[0].getAttribute("colSpan"),t=parseInt(t,10)-1,e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",t.toString()));for(var t,i=this.parent.grid.contentModule.getRows(),r=0;r<i.length;r++)i[parseInt(r.toString(),10)].cells[0].visible=!1;w.getObject("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},N.prototype.destroy=function(){this.removeEventListener()};var Ji=N;function N(e){w.Grid.Inject(w.DetailRow),this.parent=e,this.addEventListener()}Xi=function(e,t){return(Xi=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])}))(e,t)};var Xi,U,$i=function(e,t){function i(){this.constructor=e}Xi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Zi=(U=w.VirtualContentRenderer,$i(k,U),k.prototype.getModelGenerator=function(){return new Ni(this.parent)},k.prototype.getRowByIndex=function(t){var e;return this.parent.enableVirtualization&&this.parent.isFrozenGrid()?this.getRowCollection(t,!0):!(e=this.parent.getDataRows().find(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1===t}))&&this.parent.isEdit&&"Batch"===this.parent.editSettings.mode?null!=t?this.parent.getRows()[parseInt(t.toString(),10)]:void 0:e},k.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},k.prototype.getRowCollection=function(e,t,i,r){var n=parseInt(this.parent.getRows()[0].getAttribute(Dt),10)-1,o=this.parent.getDataRows(),a=(i?this.parent.getCurrentViewRecords():o)[e-n];return a=null==(a=this.parent.frozenRows&&1<this.parent.pageSettings.currentPage?i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:a:e<=this.parent.frozenRows?o[parseInt(e.toString(),10)]:o[e-n+this.parent.frozenRows]:a)&&null!=e&&"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&t?o[parseInt(e.toString(),10)]:a},k.prototype.addEventListener=function(){this.parent.on(st,this.virtualOtherAction,this),this.parent.on(pt,this.indexModifier,this)},k.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},k.prototype.indexModifier=function(e){var t,i=this.parent.getContent().querySelector(".e-content"),r=this.parent.pageSettings.pageSize;(this.recordAdded||"delete"===e.requestType&&this.endIndex>e.count-this.parent.pageSettings.pageSize)&&-1<this.startIndex&&-1<this.endIndex&&(this.endIndex>e.count-r?((t=(i=~~(i.scrollTop/this.parent.getRowHeight()))+this.parent.getRows().length)>e.count&&(t=i+(e.count-i)),this.startIndex=t-this.parent.getRows().length,this.endIndex=t):("Top"!==this.parent.root.editSettings.newRowPosition&&-1!==this.parent.root.editModule.selectedIndex||-1!==this.parent.root.editModule.selectedIndex)&&(this.startIndex+=1,this.endIndex+=1),this.recordAdded=!1),this.isDataSourceChanged&&(this.startIndex=0,this.endIndex=r-1),this.endIndex-this.startIndex!==r&&this.totalRecords>r&&this.endIndex===this.totalRecords?e.startIndex=this.endIndex-r:e.startIndex=this.startIndex,e.endIndex=this.endIndex},k.prototype.eventListener=function(e){var t=this;this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&R(this.parent)?U.prototype.eventListener.call(this,"on"):(this.parent[""+e]("data-ready",this.onDataReady,this),this.parent[""+e]("refresh-virtual-block",this.refreshContentRows,this),this.fn=function(){t.observers.observes(function(e){return t.scrollListeners(e)},t.onEnteredAction(),t.parent);var e=t.parent;e.root.enablePersistence&&e.root.scrollPosition&&(t.content.scrollTop=e.root.scrollPosition.top,e.root.enableColumnVirtualization&&(t.content.scrollLeft=e.root.scrollPosition.left),e={direction:"down",sentinel:t.observer.sentinelInfo.down,offset:e.root.scrollPosition,focusElement:e.element},t.scrollListeners(e)),t.parent.off("content-ready",t.fn)},this.parent.addEventListener("dataBound",this.dataBoundEvent.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelectedEvent.bind(this)),this.parent[""+e]("select-virtual-Row",this.toSelectVirtualRow,this),this.parent.on("content-ready",this.fn,this),this.parent.addEventListener(ve,this.handleActionBegin.bind(this)),this.parent.addEventListener(Ce,this.onActionComplete.bind(this)),this.parent[""+e]("virtual-scroll-edit-action-begin",this.beginEdit,this),this.parent[""+e]("virtual-scroll-add-action-begin",this.beginAdd,this),this.parent[""+e]("virtual-scroll-edit-success",this.virtualEditSuccess,this),this.parent[""+e]("edit-reset",this.resetIseditValue,this),this.parent[""+e]("get-virtual-data",this.getData,this),this.parent[""+e]("virtual-scroll-edit-cancel",this.cancelEdit,this),this.parent[""+e]("select-row-on-context-open",this.toSelectRowOnContextOpen,this),this.parent[""+e]("refresh-virtual-editform-cells",this.refreshCell,this),this.parent[""+e]("virtaul-cell-focus",this.cellFocus,this),this.parent[""+e]("virtual-scroll-edit",this.restoreEditState,this),this.parent[""+e]("set-virtual-page-query",this.SetVirtualPageQury,this))},k.prototype.cellFocus=function(e){U.prototype.virtualCellFocus.call(this,e)},k.prototype.onDataReady=function(e){var t,i;U.prototype.onDataReady.call(this,e),this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&R(this.parent)||(C.isNullOrUndefined(e.count)||(this.totalRecords=e.count,this.parent.isFrozenGrid()&&e.count<Object.keys(this.parent.dataSource).length&&(t=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length-1)+"px":"100%",i=this.parent.getRowHeight()*e.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize,C.getValue("virtualEle",this).setVirtualHeight(i,t)),this.parent.enableColumnVirtualization)||this.parent.isFrozenGrid()||C.getValue("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*e.count,"100%"),(!C.isNullOrUndefined(e.requestType)&&"collapseAll"===e.requestType.toString()||this.isDataSourceChanged&&(-1===this.startIndex||0===this.startIndex&&0===this.preStartIndex))&&(this.contents.scrollTop=0,this.isDataSourceChanged=!1))},k.prototype.renderTable=function(){U.prototype.renderTable.call(this),this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&R(this.parent)||(this.observers&&this.observers.disconnect(),C.getValue("observer",this).options.debounceEvent=!1,this.observers=new tr(C.getValue("observer",this).element,C.getValue("observer",this).options),this.contents=this.getPanel().firstChild)},k.prototype.getTranslateY=function(e,t,i,r){if(this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||R(this.parent)){if(this.isRemoteExpand)return this.isRemoteExpand=!1,this.preTranslate;this.preTranslate=U.prototype.getTranslateY.call(this,e,t,i,r)}return U.prototype.getTranslateY.call(this,e,t,i,r)},k.prototype.dataBoundEvent=function(){var e,t,i="initialRowTop";C.isNullOrUndefined(this.parent.getRows())||!this.parent.getRows().length||C.isNullOrUndefined(this.parent.getRowByIndex(0))||this[i]||(e=this.parent.getRowByIndex(0).getBoundingClientRect().top,t=this.parent.element.getBoundingClientRect().top,0<e?this[i]=this.parent.getRowByIndex(0).getBoundingClientRect().top-t:-1===this.parent.selectedRowIndex&&(this[i]=this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height)),U.prototype.dataBound.call(this)},k.prototype.rowSelectedEvent=function(e){U.prototype.rowSelected.call(this,e),this.parent.notify("virtualTransform",{requestType:"transformChange"})},k.prototype.toSelectVirtualRow=function(t){var e;!this.parent.isEdit&&(C.isNullOrUndefined(this.observer[e="containerRect"])&&(this.observer[e]=this.observers[e]),e=this.parent.clipboardModule.treeGridParent,C.isNullOrUndefined(e.editModule)||C.isNullOrUndefined(e.editModule.addRowIndex)||0!==t.selectedIndex)&&(!C.isNullOrUndefined(e.grid.sortModule)&&0<e.grid.sortModule.sortedColumns.length&&(e=e.dataModule.sortedData,!C.isNullOrUndefined(e))&&0<e.length&&(e=e.findIndex(function(e){return e.index===t.selectedIndex}),t.selectedIndex=e),U.prototype.selectVirtualRow.call(this,t))},k.prototype.refreshCell=function(e){e.cells=this.generateCells()},k.prototype.generateCells=function(){for(var e=[],t=0;t<this.parent.columns.length;t++)e.push(this.generateCell(this.parent.columns[parseInt(t.toString(),10)]));return e},k.prototype.getVirtualRowIndex=function(e){return C.isNullOrUndefined(this.prevInfo)?e:this.parent.getRowsObject()[0].index+e},k.prototype.generateCell=function(e,t,i,r,n,o){t={visible:e.visible,isDataCell:!C.isNullOrUndefined(e.field||e.template),isTemplate:!C.isNullOrUndefined(e.template),rowID:t,column:e,cellType:C.isNullOrUndefined(i)?w.CellType.Data:i,colSpan:r,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&C.getValue(e.field,o)};return(t.isDataCell||"checkbox"===t.column.type||t.commands)&&(t.index=n),new w.Cell(t)},k.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[aria-rowindex="'+(e.index+1)+'"]',t=this.parent.getContent().querySelector(t).rowIndex,t=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)];e.data=t},k.prototype.beginAdd=function(e){var t={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex},t=(this.parent.notify("get-row-position",t),this.rowPosition=t.newRowPosition,this.addRowIndex=t.addRowIndex,this.dataRowIndex=t.dataRowIndex,this.parent.getRows()),i=t.length?+t[0].getAttribute("aria-rowindex")-1:0,t=t.length?+t[t.length-1].getAttribute("aria-rowindex")-1:0,i=this.parent.selectedRowIndex>=i&&this.parent.selectedRowIndex<=t;"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.isAdd=!0),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.addRowIndex&&-1!==this.addRowIndex||-1!==this.parent.selectedRowIndex&&i)||U.prototype.addActionBegin.call(this,e)},k.prototype.restoreEditState=function(){U.prototype.restoreEdit.call(this)},k.prototype.SetVirtualPageQury=function(e){var t=[];this.prevInfo&&this.prevInfo.blockIndexes&&(t=w.getVisiblePage(this.prevInfo.blockIndexes)),"refresh"===this.requestType&&t.length&&(e.query.skip(this.parent.pageSettings.pageSize*(t[0]-1)),e.query.take(this.parent.pageSettings.pageSize*t.length),e.skipPage=!0)},k.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||U.prototype.resetIsedit.call(this)},k.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},k.prototype.cancelEdit=function(e){U.prototype.editCancel.call(this,e)},k.prototype.toSelectRowOnContextOpen=function(e){U.prototype.selectRowOnContextOpen.call(this,e)},k.prototype.restoreNewRow=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&!e.querySelector(".e-addedrow")&&(this.parent.isEdit=!1,this.parent.editModule.addRecord(null,this.parent.root.editModule.selectedIndex))},k.prototype.getData=function(e){U.prototype.getVirtualData.call(this,e)},k.prototype.handleActionBegin=function(e){U.prototype.actionBegin.call(this,e)},k.prototype.onActionComplete=function(e){var t;"add"===e.requestType&&(t={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex},this.parent.notify("get-row-position",t),this.rowPosition=t.newRowPosition,this.addRowIndex=t.addRowIndex,this.dataRowIndex=this.parent.root.editModule.selectedIndex);U.prototype.actionComplete.call(this,e)},k.prototype.onEnteredAction=function(){var p=this;return function(e,t,i,r,n,o){var a,s,d,l;p.parent.directVirtualRender||(a="preventEvent",!C.Browser.isIE||n||!o||p[a]||p.parent.enableVirtualMaskRow||p.parent.showSpinner(),p.parent.enableVirtualMaskRow&&!p[a]&&setTimeout(function(){p.parent.showMaskRow(t.axis),p.parent.notify("showGanttShimmer",{requestType:"showShimmer"})},0),n=p.content.getBoundingClientRect().height,o=p.prevInfo.offsets?p.prevInfo.offsets.top:null,a="X"===t.axis,d=p.getColumnOffset(a?p.vgenerator.getColumnIndexes()[0]-1:p.prevInfo.columnIndexes[0]-1),p.parent.isFrozenGrid()&&p.parent.enableColumnVirtualization&&p.currentInfo&&p.currentInfo.columnIndexes&&(l=p.currentInfo.columnIndexes[0]-1,s=0,p.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(s+=parseInt(e.width.toString(),10))}),l>p.parent.getVisibleFrozenLeftCount())&&(d-=s),a&&(l=Object.keys(p.vgenerator.cOffsets).length-p.prevInfo.columnIndexes.length,d=(l=p.vgenerator.cOffsets[l-1])<d?l:d),l=p.getTranslateY(r.top,n,a&&o===r.top?p.prevInfo:void 0,!0),p.parent.isFrozenGrid()&&!p.parent.enableVirtualMaskRow)||(p.parent.enableVirtualMaskRow?(n=r.top-p.translateY<0,l=Math.round(p.translateY)>l&&!n?Math.round(p.translateY):l,p.virtualEle.adjustTable(d,l)):p.virtualEle.adjustTable(d,p.translateY),p.parent.enableColumnVirtualization&&(p.header.virtualEle.adjustTable(d,0),p.parent.isFrozenGrid())&&p.parent.contentModule.resetStickyLeftPos(d))}},k.prototype.scrollListeners=function(e){this.scrollAfterEdit(),this.shouldPreventScrolling(e),this.parent.root.enablePersistence&&(this.parent.root.scrollPosition=e.offset);var t,i,r,n=e.sentinel,o=this.parent.getRowHeight(),a=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2),s=(C.isNullOrUndefined(this.parent.contentModule)||(t=this.parent.getContent().querySelector(".e-content")),a*o),d=e.offset.top-this.translateY<0&&"downArrow"!==this.activeKey,s=Math.ceil(e.offset.top-this.translateY)+o>=s,l="selectedRowIndex",p=this.parent.currentViewData,h="index";d&&"right"!==e.direction&&"left"!==e.direction&&!C.isNullOrUndefined(t)?(i=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),i=0<(i=Math.floor(t.scrollTop/o)+Math.ceil(i/o)-this.parent.pageSettings.pageSize)?i:0,!C.isNullOrUndefined(this[l])&&-1!==this[l]&&i!==this[l]&&this.parent.rowHeight*this.parent.pageSettings.pageSize<t.scrollTop&&!this.parent.allowRowDragAndDrop&&(i=this[l]),this.startIndex=i,this.endIndex=i+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords&&(i=this.totalRecords,r=this.endIndex%i,this.endIndex=i,this.startIndex=this.startIndex-r<0?0:this.startIndex-r),p.length&&p[0][h]>=this.parent.pageSettings.pageSize/2&&p[0][h]-this.startIndex<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule&&this.parent.selectionModule.isRowSelected&&(this.startIndex=p[0][h]-this.parent.pageSettings.pageSize/2,this.endIndex=this.startIndex+this.parent.pageSettings.pageSize),i=Math.ceil(e.offset.top/o),i%=this.parent.pageSettings.pageSize,(r=0)===(r=C.isNullOrUndefined(this.parent.getRows()[parseInt(i.toString(),10)])||C.isNullOrUndefined(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(i.toString(),10)])?r:+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(i.toString(),10)].querySelector("td").getAttribute("index"))?this.endIndex-this.startIndex<this.parent.pageSettings.pageSize?this.translateY=C.isNullOrUndefined(this.endIndex)?0:(this.endIndex-this.parent.pageSettings.pageSize)*(this.parent.rowHeight||this.parent.getRowHeight()):this.startIndex===this[l]?this.translateY=e.offset.top:this.translateY=0<e.offset.top-a*o?e.offset.top-a*o+o:0:(0<this.parent.getFrozenColumns()&&(e.offset.top=e.offset.top+80),this.translateY=0<e.offset.top-a*o?e.offset.top-a*o+10:0)):s&&"right"!==e.direction&&"left"!==e.direction&&!C.isNullOrUndefined(t)&&(p=~~(t.scrollTop/o),h=!(this[l]+this.parent.pageSettings.pageSize<this.totalRecords),(i=(p=C.isNullOrUndefined(this[l])||-1===this[l]||p===this[l]||h||this.parent.allowRowDragAndDrop?p:this[l])+this.parent.pageSettings.pageSize)>this.totalRecords&&(i=p+(this.totalRecords-p)),this.startIndex=!h||C.isNullOrUndefined(this[l])?i-this.parent.pageSettings.pageSize:p,this.endIndex=i,p+this.parent.pageSettings.pageSize>this.totalRecords&&this.endIndex-this.startIndex<this.parent.pageSettings.pageSize/2&&this.endIndex-p<this.parent.pageSettings.pageSize/2&&(this.startIndex=i-this.parent.pageSettings.pageSize/2),e.offset.top>o*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,t.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.totalRecords===this.endIndex&&(this.parent.isEdit?this.translateY=this.totalRecords*o-this.parent.pageSettings.pageSize*o+o:this.translateY=this.totalRecords*o-this.parent.pageSettings.pageSize*o):0<this.parent.getFrozenColumns()?this.translateY=e.offset.top-(2*o+this.parent.pageSettings.pageSize):this.translateY=e.offset.top),s&&"up"!==e.direction&&e.offset.top<o*this.totalRecords||d||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url?(r=this.currentInfo=C.getValue("getInfoFromView",this).apply(this,[e.direction,n,e.offset]),this.previousInfo=r,this.prevInfo&&I(this.parent.root)&&"model-changed"!==r.event&&("Y"===n.axis&&this.prevInfo.blockIndexes.toString()===r.blockIndexes.toString()||"X"===n.axis&&this.prevInfo.columnIndexes.toString()===r.columnIndexes.toString()||this.parent.isFrozenGrid()&&this.parent.getVisibleFrozenLeftCount()>=r.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(r.columnIndexes.toString()))?(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),C.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,"Y"===n.axis&&this.restoreEditState()):(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?r.columnIndexes:[]),a=(r.loadNext&&!r.loadSelf?r.nextInfo:r).page,this.parent.setProperties({pageSettings:{currentPage:a}},!0),this.requestType="virtualscroll","right"===e.direction||"left"===e.direction||I(this.parent.root)||(r.event="refresh-virtual-block"===r.event?"model-changed":r.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(n.axis),this.parent.addShimmerEffect(),this.parent.notify("showGanttShimmer",{requestType:"showShimmer"})),this.parent.notify(r.event,{requestType:"virtualscroll",virtualInfo:r,focusElement:e.focusElement}))):this.parent.enableVirtualMaskRow&&(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}))},k.prototype.shouldPreventScrolling=function(e){this.parent.element.querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&0!==e.offset.top&&this.parent.closeEdit()},k.prototype.appendContent=function(e,t,i){var r,n,o,a,s,d;this.parent.dataSource instanceof b.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||R(this.parent)||this.parent.isFrozenGrid()&&(void 0===i.requestType||!C.isNullOrUndefined(i.virtualInfo)&&("right"===i.virtualInfo.direction||"left"===i.virtualInfo.direction))?(C.getValue("isExpandCollapse",i)&&(this.isRemoteExpand=!0),U.prototype.appendContent.call(this,e,t,i),-1!==C.getValue("requestTypes",this).indexOf("isFrozen")&&(C.getValue("requestTypes",this).splice(C.getValue("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType)):(n=(r=i.virtualInfo.sentinelInfo&&"Y"===i.virtualInfo.sentinelInfo.axis&&C.getValue("currentInfo",this).page&&C.getValue("currentInfo",this).page!==i.virtualInfo.page?C.getValue("currentInfo",this):i.virtualInfo).columnIndexes[0]-1,o=this.getColumnOffset(n),a=void 0,this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(o,0),d=r.columnIndexes,a=this.getColumnOffset(d[d.length-1])-this.getColumnOffset(d[0]-1)+"",this.header.virtualEle.setWrapperWidth(a)),this.virtualEle.setWrapperWidth(a,C.Browser.isIE||"edge"===C.Browser.info.name),(e=this.parent.createElement("tbody")).appendChild(t),this.getTable().querySelector("tbody").replaceWith(e),"virtualscroll"===i.requestType&&"Y"===i.virtualInfo.sentinelInfo.axis&&(this.isExpandCollapse=!1),this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&(s=0,this.parent.getColumns().filter(function(e){e.visible&&(parseInt(e.width.toString(),10),"Left"===e.freeze)&&(s+=parseInt(e.width.toString(),10))}),d=r.columnIndexes,a=this.getColumnOffset(d[d.length-1])-this.getColumnOffset(d[0]-1)+"",n>this.parent.getVisibleFrozenLeftCount()&&(o-=s),this.resetStickyLeftPos(o,t)),this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,C.getValue("virtualEle",this).adjustTable(o,this.translateY),this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(o,0),this.parent.isFrozenGrid())&&this.resetStickyLeftPos(o)),C.setValue("prevInfo",this.previousInfo||r,this),"virtualscroll"===i.requestType&&"X"===i.virtualInfo.sentinelInfo.axis&&this.parent.notify(vt,{}),U.prototype.focusCell.call(this,i),this.isAdd&&!this.parent.getContent().querySelector(".e-content").querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.dataRowIndex>=this.startIndex?this.restoreNewRow():this.addRowIndex&&-1<this.addRowIndex&&(this.isAdd=!1,this.parent.isEdit=!1)),this.restoreEditState(),U.prototype.restoreAdd.call(this),U.prototype.ensureSelectedRowPosition.call(this))},k.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("data-ready",this.onDataReady),this.parent.off("content-ready",this.fn),this.parent.off("select-virtual-Row",this.toSelectVirtualRow),this.parent.off("dataBound",this.dataBoundEvent),this.parent.off("rowSelected",this.rowSelectedEvent),this.parent.off(st,this.virtualOtherAction),this.parent.off(pt,this.indexModifier),this.parent.off("virtual-scroll-edit-action-begin",this.beginEdit),this.parent.off("virtual-scroll-add-action-begin",this.beginAdd),this.parent.off("virtual-scroll-edit-success",this.virtualEditSuccess),this.parent.off("edit-reset",this.resetIseditValue),this.parent.off("get-virtual-data",this.getData),this.parent.off("virtual-scroll-edit-cancel",this.cancelEdit),this.parent.off("select-row-on-context-open",this.toSelectRowOnContextOpen),this.parent.off("refresh-virtual-editform-cells",this.refreshCell),this.parent.off("virtaul-cell-focus",this.cellFocus),this.parent.off("virtual-scroll-edit",this.restoreEditState),this.observers&&this.observers.disconnect())},k);function k(e,t){e=U.call(this,e,t)||this;return e.isExpandCollapse=!1,e.translateY=0,e.maxiPage=0,e.recordAdded=!1,e.startIndex=-1,e.endIndex=-1,e.preTranslate=0,e.isRemoteExpand=!1,e.isDataSourceChanged=!1,e.addEventListener(),e}er=w.InterSectionObserver,$i(ir,er),ir.prototype.observes=function(e,t,i){er.prototype.containerRect=C.getValue("options",this).container.getBoundingClientRect(),this.containerEl=C.getValue("options",this).container,this.containerScrollHandler=this.virtualScrollHandlers(e,t,i),C.EventHandler.add(this.containerEl,"scroll",this.containerScrollHandler,this),C.getValue("options",this).movableContainer&&(er.prototype.movableContainerRect=C.getValue("options",this).movableContainer.getBoundingClientRect(),this.movableContainerEl=C.getValue("options",this).movableContainer,this.movableScrollHandler=this.virtualScrollHandlers(e,t,i),C.EventHandler.add(this.movableContainerEl,"scroll",this.movableScrollHandler,this))},ir.prototype.disconnect=function(){this.containerEl&&this.containerScrollHandler&&(C.EventHandler.remove(this.containerEl,"scroll",this.containerScrollHandler),this.containerScrollHandler=null),this.movableContainerEl&&this.movableScrollHandler&&(C.EventHandler.remove(this.movableContainerEl,"scroll",this.movableScrollHandler),this.movableScrollHandler=null),this.containerEl=null,this.movableContainerEl=null},ir.prototype.clear=function(){this.lastPos=null},ir.prototype.virtualScrollHandlers=function(a,s,d){var l=this,e="chrome"===C.Browser.info.name?200:100,p="options",h="movableEle",c="fromWheel",u=C.debounce(a,e),g=C.debounce(a,50),f=(this[p].prevTop=this[p].prevLeft=0,"isScrollByFocus");return function(e){var t,i,r,n,o="keyPress";d&&d.root&&d.root.editModule&&d.root.editModule[o]&&(t=d.root.editModule[o]),d.isEdit&&d.root.editModule[f]||d.isEdit&&("tab"===t||"shiftTab"===t)?d.root.editModule[f]=!1:(o=(l[p].movableContainer?l[p].container:e.target).scrollTop,t=(l[p].movableContainer?l[p].scrollbar:e.target).scrollLeft,i=l[p].prevTop<o?"down":"up",i=l[p].prevLeft===t?i:l[p].prevLeft<t?"right":"left",l[p].prevTop=o,l[p].prevLeft=t,r=l.sentinelInfo[i],n=0,l.newPos=o,null!=l.lastPos&&(n=l.newPos-l.lastPos),l.lastPos=l.newPos,l.timer&&clearTimeout(l.timer),l.timer=setTimeout(l.clear,0),(100<n||n<-100)&&e&&e.preventDefault&&(e.returnValue=!1,e.preventDefault()),-1!==l[p].axes.indexOf(r.axis)&&(l.containerRect=l[p].container.getBoundingClientRect(),n=l.check(i),r.entered&&("X"===r.axis||d.enableVirtualMaskRow)&&(!l[h]||"right"!=i&&"left"!=i?s(l.element,r,i,{top:o,left:t},l[c],n):s(l[h],r,i,{top:o,left:t},l[c],n)),n&&(e=g,("X"===r.axis?e:d.dataSource instanceof b.DataManager&&void 0!==d.dataSource.dataSource.url&&!d.dataSource.dataSource.offline&&""!==d.dataSource.dataSource.url||R(d)||d.enableVirtualMaskRow?e=d.enableVirtualMaskRow?u:e:a)({direction:i,sentinel:r,offset:{top:o,left:t},focusElement:document.activeElement})),l[c]=!1))}};var er,tr=ir;function ir(){var e=null!==er&&er.apply(this,arguments)||this;return e.isWheeling=!1,e.newPos=0,e.lastPos=0,e.timer=0,e}rr=function(e,t){return(rr=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])}))(e,t)};var rr,$i=function(e,t){function i(){this.constructor=e}rr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},nr=(or.prototype.getModuleName=function(){return"virtualScroll"},or.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ve,this.collapseExpandVirtualchilds,this),this.parent.on(ze,this.virtualPageAction,this),this.parent.on(dt,this.destroy,this))},or.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ve,this.collapseExpandVirtualchilds),this.parent.off(ze,this.virtualPageAction),this.parent.off(dt,this.destroy))},or.prototype.collapseExpandVirtualchilds=function(t){this.parent.grid.notify(st,{isExpandCollapse:!0}),this.expandCollapseRec=t.record,t.record.expanded="collapse"!==t.action,this.parent.flatData.map(function(e){return e.expanded=(e.uniqueID===t.record.uniqueID&&e.expanded!==t.record.expanded?t.record:e).expanded});var e={result:this.parent.flatData,row:t.row,action:t.action,record:t.record,count:this.parent.flatData.length},i=(this.handleSelection(),C.getValue("isCollapseAll",this.parent)?"collapseAll":"refresh");C.getValue("grid.renderModule",this.parent).dataManagerSuccess(e,{requestType:i})},or.prototype.handleSelection=function(){"Cell"!==this.parent.selectionSettings.mode&&("Row"!==this.parent.selectionSettings.mode||this.parent.selectionSettings.persistSelection)||this.parent.grid.clearSelection(),C.getValue("isCollapseAll",this.parent)&&this.parent.selectionSettings.persistSelection&&0<this.parent.getSelectedRecords().length&&(this.prevSelectedRecord=this.parent.getSelectedRecords(),this.parent.grid.clearSelection())},or.prototype.virtualPageAction=function(e){var t,i,r,n=this,o=new b.DataManager(e.result),a=new b.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),a=o.executeLocal((new b.Query).where(a)),s="filtering"===e.actionArgs.requestType,d="Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode,s=s&&d?a:a.filter(function(e){return y(n.parent,e)}),d=(this.visualData=s,e.count=s.length,this.parent.grid.notify(lt,{data:s}),{startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType}),a=(this.parent.grid.notify(pt,d),d.startIndex),l=d.endIndex;e.count=s.length,-1===a&&-1===l?(i=new b.Query,t=this.parent.grid.pageSettings.pageSize,r=this.parent.grid.pageSettings.currentPage,i=i.skip(t*(r-1)).take(t),o.dataSource.json=s,e.result=o.executeLocal(i)):(("filtering"===(r=e.actionArgs.requestType)||"collapseAll"===r||"searching"===r||"refresh"===r&&C.getValue("isExpandAll",this.parent)||"refresh"===r&&this.parent.enableCollapseAll&&l>s.length&&C.isNullOrUndefined(this.expandCollapseRec))&&(a=0,l=this.parent.grid.pageSettings.pageSize,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify(st,{setTop:!0})),("save"===r&&e.actionArgs.index>=d.count-this.parent.grid.pageSettings.pageSize||"refresh"===r&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&(this.setEndIndexToGantt&&(this.ganttEndIndex=d.endIndex),!(d.endIndex+this.parent.pageSettings.pageSize>=d.count&&this.parent.root&&d.count!==this.ganttEndIndex&&this.parent.isAddedFromGantt)&&this.parent.isGantt&&this.parent.isAddedFromGantt||(a=d.startIndex+(d.count-d.endIndex),l=d.count,this.setEndIndexToGantt=!1),this.ganttEndIndex=l,this.parent.isAddedFromGantt=!1),t=this.parent.grid.contentModule.virtualEle.wrapper,o=w.getTransformValues(t).height,!C.isNullOrUndefined(this.expandCollapseRec)&&("virtualscroll"===e.actionArgs.requestType||"refresh"===e.actionArgs.requestType&&a!==this.prevstartIndex)&&a<this.parent.getRows().length&&l<=a+this.parent.getRows().length&&0===o&&(a=0),"save"===e.actionArgs.requestType&&a!==this.prevstartIndex&&a<this.parent.getRows().length&&l<=a+this.parent.getRows().length&&0===o&&(l=(a=0)+this.parent.grid.pageSettings.pageSize),C.isNullOrUndefined(this.expandCollapseRec)||(i=this.parent.grid.pageSettings.pageSize,r=s.indexOf(this.expandCollapseRec),s.slice(r,r+i).length<i&&0<=r&&0!==a?(r=s.length-i,(l=s.length)-a<i&&(a=r=0<r?r:0,s.indexOf(this.expandCollapseRec)>s.length-i/2)&&(d=a*this.parent.grid.getRowHeight(),this.parent.grid.contentModule.translateY=d,this.parent.grid.contentModule.virtualEle.adjustTable(0,d))):C.getValue("isCollapseAll",this.parent)&&(l=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(st,{setTop:!(a=0)}))),"collapseAll"!==this.prevrequestType||"virtualscroll"!==e.actionArgs.requestType||C.isNullOrUndefined(this.parent.idMapping)||0!==a||(l=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(st,{setTop:!(a=0)})),!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||C.isNullOrUndefined(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?a=0:this.parent.isExpandAll||0!==this.parent.grid.contentModule.translateY||(a=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,a=a<0?0:a,0===l&&0<s.length?e.result=s:e.result=s.slice(a,l),this.prevstartIndex=a,this.prevendIndex=l,this.prevrequestType=e.actionArgs.requestType),this.parent.notify("updateAction",e)},or.prototype.destroy=function(){this.removeEventListener()},or.prototype.updateSelection=function(e){if(e.isHeaderCheckboxClicked&&this.parent.grid.currentViewData.length!==this.parent.grid.selectionModule.selectedRowIndexes.length&&e.target.classList.contains("e-uncheck"))for(var t=0;t<this.parent.getRows().length;t++)this.parent.getRows()[parseInt(t.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&!this.parent.getRows()[parseInt(t.toString(),10)].querySelector(".e-checkbox-disabled")&&this.parent.grid.selectionModule.updateRowSelection(this.parent.getRows()[parseInt(t.toString(),10)],this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)].index)},or);function or(e){this.prevstartIndex=-1,this.setEndIndexToGantt=!0,this.prevendIndex=-1,this.prevSelectedRecord=[],this.parent=e,w.Grid.Inject(sr),this.addEventListener()}ar=w.VirtualScroll,$i(dr,ar),dr.prototype.getModuleName=function(){return"treeVirtualScroll"},dr.prototype.instantiateRenderers=function(){var e=C.getValue("parent",this),t=(C.getValue("parent",this).log(["limitation","virtual_height"],"virtualization"),C.getValue("locator",this).getService("rendererFactory"));e.enableColumnVirtualization&&C.getValue("addRenderer",t).apply(t,[w.RenderType.Header,new w.VirtualHeaderRenderer(C.getValue("parent",this),C.getValue("locator",this))]),C.getValue("addRenderer",t).apply(t,[w.RenderType.Content,new Zi(C.getValue("parent",this),C.getValue("locator",this))]),this.ensurePageSize()},dr.prototype.ensurePageSize=function(){var e=C.getValue("parent",this),t=e.getRowHeight();C.isNullOrUndefined(e.height)||"string"!=typeof e.height||-1===e.height.indexOf("%")||(e.element.style.height=e.height);var t=2*~~((e.height.toString().indexOf("%")<0?parseInt(e.height.toString(),10):e.element.getBoundingClientRect().height)/t),i=e.pageSettings.pageSize;e.setProperties({pageSettings:{pageSize:i<t?t:i}},!0)};var ar,sr=dr;function dr(e,t){e=ar.call(this,e,t)||this;return C.getValue("parent",e).off("initial-load",C.getValue("instantiateRenderer",e),e),C.getValue("parent",e).on("initial-load",e.instantiateRenderers,e),e}lr.prototype.addEventListener=function(){this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.grid.on("dblclick",this.dblClickHandler,this)},lr.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.grid.off("dblclick",this.dblClickHandler))},lr.prototype.rowExpandCollapse=function(t){var e,i=this.parent.getDataRows(),r=this.parent.getRows(),n=0<this.parent.getFrozenLeftColumnsCount()||0<this.parent.getFrozenRightColumnsCount();n&&(e=this.parent.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}));for(var o=t.detailrows.length?t.detailrows:i.filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}),a=0;a<o.length;a++){var s=o[parseInt(a.toString(),10)],d=this.parent.grid.getRowObjectFromUID(s.getAttribute("data-uid")).data,l=(!C.isNullOrUndefined(i)&&0<s.parentElement.firstElementChild.clientHeight&&(s.style.height=s.parentElement.firstElementChild.clientHeight+"px"),this.parent.toggleRowVisibility(s,t.action),n&&e.length&&this.parent.toggleRowVisibility(e[parseInt(a.toString(),10)],t.action),"e-childrow-hidden"===t.action?".e-treecolumn-container .e-treegridcollapse":".e-treecolumn-container .e-treegridexpand");if(r[parseInt(s.getAttribute("aria-rowindex"),10)-1].querySelector(l)){for(var p=[],h=0;h<i.length;h++)i[parseInt(h.toString(),10)].querySelector(".e-gridrowindex"+d.index+"level"+(d.level+1))&&p.push(i[parseInt(h.toString(),10)]);p.length&&(s=this.parent.getCurrentViewRecords()[p[0].rowIndex],this.rowExpandCollapse({detailrows:p,action:t.action,record:s}))}}},lr.prototype.dblClickHandler=function(e){w.parentsUntil(e.target,"e-rowcell")&&this.parent.grid.editSettings.allowEditOnDblClick&&"Cell"!==this.parent.editSettings.mode&&!e.target.classList.contains("e-treegridcollapse")&&!e.target.classList.contains("e-treegridexpand")&&this.parent.startEdit(w.parentsUntil(e.target,"e-row"))},lr.prototype.dataBoundArg=function(){this.parent.getColumns().filter(function(e){return e.showCheckbox}).length&&this.parent.freezeModule&&this.parent.initialRender&&C.addClass([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},lr.prototype.destroy=function(){this.removeEventListener()},lr.prototype.getModuleName=function(){return"freeze"};$i=lr;function lr(e){w.Grid.Inject(w.Freeze),this.parent=e,this.addEventListener()}hr.prototype.openColumnChooser=function(e,t){return this.parent.grid.columnChooserModule.openColumnChooser(e,t)},hr.prototype.destroy=function(){},hr.prototype.getModuleName=function(){return"ColumnChooser"};var pr=hr;function hr(e){w.Grid.Inject(w.ColumnChooser),this.parent=e}q.prototype.getModuleName=function(){return"infiniteScroll"},q.prototype.addEventListener=function(){this.parent.on(ze,this.infinitePageAction,this),this.parent.on("infinite-remote-expand",this.infiniteRemoteExpand,this),this.parent.grid.on("delete-complete",this.infiniteDeleteHandler,this),this.parent.grid.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.grid.on("infinite-crud-cancel",this.createRows,this),this.parent.grid.on("content-ready",this.contentready,this)},q.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("infinite-remote-expand",this.infiniteRemoteExpand),this.parent.grid.off("delete-complete",this.infiniteDeleteHandler),this.parent.grid.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off(ze,this.infinitePageAction),this.parent.grid.off("infinite-crud-cancel",this.createRows),this.parent.grid.off("content-ready",this.contentready))},q.prototype.infiniteRemoteExpand=function(e){for(var t=this.parent.grid.getRowsObject(),i=this.parent.grid.infiniteScrollModule.serviceLocator,r=new w.RowRenderer(i,null,this.parent.grid),n=this.parent.getRows(),o=e.index===n.length-1?"after":"before",a=this.parent.grid.getColumns(),s=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),d=[],l=0;l<s.length;l++)d.push(r.render(s[parseInt(l.toString(),10)],a));t.splice.apply(t,[e.index+1,0].concat(s));for(l=0;l<d.length;l++)("after"==o?n[e.index+l]:n[e.index+l+1])[o](d[parseInt(l.toString(),10)]),n.splice(e.index+1+l,0,d[parseInt(l.toString(),10)]);w.resetRowIndex(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},q.prototype.contentready=function(){var e;this.parent.infiniteScrollSettings.enableCache&&!C.isNullOrUndefined(this.parent.editModule)&&(this.parent.editModule[e="updateIndex"](this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),this.parent.getFrozenColumns())&&this.parent.editModule[e](this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords())},q.prototype.infinitePageAction=function(e){var t=new b.DataManager(e.result),i=new b.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),i=t.executeLocal((new b.Query).where(i)),r=C.getValue("actionArgs",e.actionArgs),n=C.getValue("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var o,a,s,d,l,n=!!n.some(function(e){return e===r.requestType})||!!this.parent.initialRender;this.visualData=i,e.count=i.length,C.getValue("isPrinting",e.actionArgs)?e.result=i:(l=new b.Query,(o=this.parent.infiniteScrollSettings.enableCache)&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks),n=n?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,d=this.parent.grid.pageSettings.currentPage,l=C.isNullOrUndefined(r)?l.page(d,n):(a=C.getValue("lastIndex",this.parent.grid.infiniteScrollModule),s=C.getValue("firstIndex",this.parent.grid.infiniteScrollModule),o||"delete"!==r.requestType?o&&"delete"===r.requestType||"save"===r.requestType&&"add"===r.action?(l=l.skip(s)).take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize):l.page(d,n):(s=a-r.data.length+1,d=r.data.length,l.skip(s).take(d))),t.dataSource.json=i,o||C.isNullOrUndefined(r)||"save"!==r.requestType||"add"!==r.action?e.result=t.executeLocal(l):e.result=[r.data]),this.parent.notify("updateAction",e)},q.prototype.infiniteEditHandler=function(e){var t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,i=Object.keys(t);if("delete"===e.e.requestType&&1<e.result.length)for(var r=1;r<e.result.length;r++)t[i[i.length-1]].push(e.result[parseInt(r.toString(),10)])},q.prototype.infiniteDeleteHandler=function(e){var t,i,r;"delete"===e.requestType&&(r=this.parent.grid.getRowsObject(),i=this.parent.getRows(),e=e.data instanceof Array?e.data:[e.data],t=this.parent.grid.getPrimaryKeyFieldNames()[0],this.removeRows(i,r,e,t,!0),0<this.parent.getFrozenColumns())&&(i=this.parent.grid.getRowsObject(),r=this.parent.grid.getRows(),this.removeRows(r,i,e,t))},q.prototype.removeRows=function(r,n,o,a,s){for(var d=this,e=0;e<o.length;e++)!function(i){n.filter(function(e,t){e.data[""+a]===o[parseInt(i.toString(),10)][""+a]&&(s&&(e=Math.ceil((t+1)/d.parent.grid.pageSettings.pageSize),d.parent.grid.infiniteScrollModule.resetInfiniteCurrentViewData(e,t)),n.splice(t,1),C.remove(r[parseInt(t.toString(),10)]),r.splice(t,1))})}(e)},q.prototype.createRows=function(e){var t,i=e.args.e,r=e.row,n=this.parent.grid.infiniteScrollModule.serviceLocator,o=new w.RowRenderer(n,null,this.parent.grid),a=this.parent.getCurrentViewRecords(),s=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows(),d=(e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-content"):(this.parent.grid.isFrozenGrid()?(e.isMovable,this.parent.grid):this.parent).getContent()).querySelector("tbody");this.parent.frozenRows&&(d=e.isFrozenRows&&"add"!==this.parent.grid.infiniteScrollModule.requestType||!e.isFrozenRows&&"add"===this.parent.grid.infiniteScrollModule.requestType?(this.parent.grid.isFrozenGrid()?!e.isMovable&&e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-header"):this.parent.grid.getHeaderContent():this.parent.getHeaderContent()).querySelector("tbody"):d);for(var l="addRowIndex",p=this.parent.editModule[l],h=0;h<r.length;h++){var c=o.render(r[parseInt(h.toString(),10)],this.parent.grid.getColumns());"save"===i.requestType&&"add"===i.action?-1!==C.getValue("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(t="after",p+=v(a[parseInt(p.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&--p,s[parseInt(p.toString(),10)][""+t](c)):"Above"===this.parent.editSettings.newRowPosition&&s[this.parent.editModule[l]][""+(t="before")](c):"Bottom"===this.parent.editSettings.newRowPosition?d.appendChild(c):d.insertBefore(c,d.firstElementChild):"delete"===i.requestType&&d.appendChild(c)}e.cancel=!0},q.prototype.destroy=function(){this.removeEventListener()};var cr=q;function q(e){this.parent=e,w.Grid.Inject(w.InfiniteScroll),this.addEventListener()}r.Aggregate=zi,r.AggregateColumn=Zt,r.AggregateRow=a,r.Column=F,r.ColumnChooser=pr,r.ColumnMenu=ji,r.CommandColumn=Wi,r.ContextMenu=Hi,r.DataManipulation=Kt,r.DetailRow=Ji,r.Edit=Ki,r.EditSettings=s,r.ExcelExport=ki,r.Filter=Oi,r.FilterSettings=J,r.Freeze=$i,r.InfiniteScroll=cr,r.InfiniteScrollSettings=ai,r.LoadingIndicator=Y,r.Logger=ce,r.Page=Ti,r.PageSettings=n,r.PdfExport=qi,r.Predicate=ee,r.Render=Gt,r.Reorder=e,r.Resize=gi,r.RowDD=h,r.RowDropSettings=Mi,r.SearchSettings=oe,r.Selection=qt,r.SelectionSettings=Lt,r.Sort=Fi,r.SortDescriptor=si,r.SortSettings=l,r.StackedColumn=z,r.Toolbar=Bi,r.TreeClipboard=Ot,r.TreeGrid=Si,r.TreeGridColumn=L,r.TreeVirtual=sr,r.TreeVirtualRowModelGenerator=Ni,r.VirtualScroll=nr,r.actionBegin=ve,r.actionComplete=Ce,r.actionFailure=Mt,r.ariaColIndex="aria-colindex",r.ariaRowIndex=Dt,r.autoCol=vt,r.batchAdd=et,r.batchCancel=Ze,r.batchDelete=$e,r.batchEditFormRendered="batcheditform-rendered",r.batchSave=nt,r.beforeBatchAdd=it,r.beforeBatchCancel=ct,r.beforeBatchDelete=tt,r.beforeBatchSave=rt,r.beforeCopy=_e,r.beforeDataBound=Re,r.beforeExcelExport=Ae,r.beforePaste=He,r.beforePdfExport=Ee,r.beforeStartEdit=ht,r.beginAdd=Ke,r.beginEdit=Qe,r.cellEdit=Xe,r.cellSave=Ye,r.cellSaved=Je,r.checkboxChange=Me,r.collapsed=qe,r.collapsing=Te,r.content="e-content",r.contextMenuClick=je,r.contextMenuOpen=Fe,r.crudAction=Ge,r.dataBound=we,r.dataListener=lt,r.dataStateChange=xe,r.destroy=dt,r.detailDataBound=ut,r.doubleTap=at,r.expanded=Ue,r.expanding=ke,r.extendArray=D,r.findChildrenRecords=v,r.findParentRecords=Nt,r.frozenContent=bt,r.frozenHeader="e-frozenheader",r.frozenLeft="frozen-left",r.frozenRight="frozen-right",r.getExpandStatus=y,r.getParentData=M,r.getPlainData=Ut,r.headerContent="e-headercontent",r.indexModifier=pt,r.isCheckboxcolumn=At,r.isCountRequired=R,r.isFilterChildHierarchy=Et,r.isHidden=kt,r.isOffline=x,r.isRemoteData=I,r.keyPressed=ot,r.leftRight="Left-Right",r.load=ye,r.localPagedExpandCollapse=Ve,r.movableContent=Ct,r.movableHeader="e-movableheader",r.pagingActions=ze,r.printGridInit=Le,r.queryCellInfo=Ie,r.recordDoubleClick=We,r.remoteExpand=Be,r.resizeStop=Ne,r.rowDataBound=Se,r.rowDeselected=Oe,r.rowDeselecting=xt,r.rowDrag=gt,r.rowDragStart=yt,r.rowDragStartHelper=ft,r.rowDrop=mt,r.rowDropped=Rt,r.rowSelected=De,r.rowSelecting=be,r.rowdraging=It,r.rowsAdd=St,r.rowsRemove=wt,r.savePreviousRowPosition="savePreviousRowPosition",r.table="e-table",r.toolbarClick=Pe,r.treeGridDetails=me,r.updateData="update-data",r.virtualActionArgs=st,r.virtualColumnIndex="virtualColumnIndex",Object.defineProperty(r,"__esModule",{value:!0})});
11
2
  //# sourceMappingURL=ej2-treegrid.umd.min.js.map