@syncfusion/ej2-navigations 34.2.2 → 34.2.3
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.
- package/dist/ej2-navigations.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js.map +1 -1
- package/dist/es6/ej2-navigations.es2015.js +121 -32
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +121 -32
- package/dist/es6/ej2-navigations.es5.js.map +1 -1
- package/dist/global/ej2-navigations.min.js +2 -2
- package/dist/global/ej2-navigations.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/common/menu-base.js +14 -6
- package/src/treeview/treeview-model.d.ts +1 -0
- package/src/treeview/treeview.d.ts +14 -1
- package/src/treeview/treeview.js +107 -26
- package/styles/bds-lite.css +3 -0
- package/styles/bds.css +3 -0
- package/styles/bootstrap-dark-lite.css +3 -0
- package/styles/bootstrap-dark.css +3 -0
- package/styles/bootstrap-lite.css +3 -0
- package/styles/bootstrap.css +3 -0
- package/styles/bootstrap4-lite.css +3 -0
- package/styles/bootstrap4.css +3 -0
- package/styles/bootstrap5-dark-lite.css +3 -0
- package/styles/bootstrap5-dark.css +3 -0
- package/styles/bootstrap5-lite.css +3 -0
- package/styles/bootstrap5.3-lite.css +3 -0
- package/styles/bootstrap5.3.css +3 -0
- package/styles/bootstrap5.css +3 -0
- package/styles/fabric-dark-lite.css +3 -0
- package/styles/fabric-dark.css +3 -0
- package/styles/fabric-lite.css +3 -0
- package/styles/fabric.css +3 -0
- package/styles/fluent-dark-lite.css +3 -0
- package/styles/fluent-dark.css +3 -0
- package/styles/fluent-lite.css +3 -0
- package/styles/fluent.css +3 -0
- package/styles/fluent2-lite.css +3 -0
- package/styles/fluent2.css +3 -0
- package/styles/highcontrast-light-lite.css +3 -0
- package/styles/highcontrast-light.css +3 -0
- package/styles/highcontrast-lite.css +3 -0
- package/styles/highcontrast.css +3 -0
- package/styles/material-dark-lite.css +3 -0
- package/styles/material-dark.css +3 -0
- package/styles/material-lite.css +3 -0
- package/styles/material.css +3 -0
- package/styles/material3-dark-lite.css +3 -0
- package/styles/material3-dark.css +3 -0
- package/styles/material3-lite.css +3 -0
- package/styles/material3.css +3 -0
- package/styles/tailwind-dark-lite.css +3 -0
- package/styles/tailwind-dark.css +3 -0
- package/styles/tailwind-lite.css +3 -0
- package/styles/tailwind.css +3 -0
- package/styles/tailwind3-lite.css +3 -0
- package/styles/tailwind3.css +3 -0
- package/styles/toolbar/_layout.scss +4 -0
- package/styles/toolbar/bds.css +3 -0
- package/styles/toolbar/bootstrap-dark.css +3 -0
- package/styles/toolbar/bootstrap.css +3 -0
- package/styles/toolbar/bootstrap4.css +3 -0
- package/styles/toolbar/bootstrap5-dark.css +3 -0
- package/styles/toolbar/bootstrap5.3.css +3 -0
- package/styles/toolbar/bootstrap5.css +3 -0
- package/styles/toolbar/fabric-dark.css +3 -0
- package/styles/toolbar/fabric.css +3 -0
- package/styles/toolbar/fluent-dark.css +3 -0
- package/styles/toolbar/fluent.css +3 -0
- package/styles/toolbar/fluent2.css +3 -0
- package/styles/toolbar/highcontrast-light.css +3 -0
- package/styles/toolbar/highcontrast.css +3 -0
- package/styles/toolbar/material-dark.css +3 -0
- package/styles/toolbar/material.css +3 -0
- package/styles/toolbar/material3-dark.css +3 -0
- package/styles/toolbar/material3.css +3 -0
- package/styles/toolbar/tailwind-dark.css +3 -0
- package/styles/toolbar/tailwind.css +3 -0
- package/styles/toolbar/tailwind3.css +3 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-navigations.umd.min.js
|
|
3
|
-
* version : 34.2.
|
|
3
|
+
* version : 34.2.3
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-notifications")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-lists","@syncfusion/ej2-popups","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-inputs","@syncfusion/ej2-notifications"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Lists,e.ej2Popups,e.ej2Buttons,e.ej2Data,e.ej2Inputs,e.ej2Notifications)}(this,function(a,N,O,U,R,x,B,V){"use strict";j=function(e,t){return(j=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 j,F,q=function(e,t){function i(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},W="e-rtl",_="e-overlay",z="e-nav-arrow",K="e-nav-right-arrow",X="e-nav-left-arrow",Y="e-scroll-nav",G="e-scroll-right-nav",Q="e-scroll-left-nav",J="e-scroll-device",Z="e-scroll-overlay",$="e-scroll-right-overlay",ee="e-scroll-left-overlay",te=(F=N.Component,q(t,F),t.prototype.preRender=function(){this.browser=N.Browser.info.name,this.resizeContext=this.resizeHandler.bind(this),this.browserCheck="mozilla"===this.browser,this.isDevice=N.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=N.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(W)},t.prototype.render=function(){this.touchModule=new N.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),N.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.element&&this.element.closest(".e-toolbar")&&window.addEventListener("resize",this.resizeContext),this.isDevice?(this.element.classList.add(J),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},t.prototype.setScrollState=function(){N.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},t.prototype.initialize=function(){for(var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"}),i=(t.setAttribute("tabindex","-1"),this.element),s=0,n=[].slice.call(i.children);s<n.length;s++){var r=n[s];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},t.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},t.prototype.getModuleName=function(){return"hScroll"},t.prototype.destroy=function(){var e=this.element,t=(e.style.display="",e.classList.remove("e-hscroll"),e.classList.remove(J),e.classList.remove(W),N.selectAll(".e-"+e.id+"_nav."+Y,e)),i=N.selectAll("."+Z,e);[].slice.call(i).forEach(function(e){N.detach(e)});for(var s=0,n=[].slice.call(this.scrollItems.children);s<n.length;s++){var r=n[s];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),N.detach(this.scrollEle),0<t.length&&(N.detach(t[0]),N.isNullOrUndefined(t[1])||N.detach(t[1])),N.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.element&&this.element.closest(".e-toolbar")&&window.removeEventListener("resize",this.resizeContext),this.resizeContext=null,this.touchModule.destroy(),this.touchModule=null,F.prototype.destroy.call(this)},t.prototype.disable=function(t){var e=N.selectAll(".e-scroll-nav:not(."+_+")",this.element);t?this.element.classList.add(_):this.element.classList.remove(_),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},t.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:Z+" "+$}),s="e-"+e.id.concat("_nav "+Y+" "+G),t=this.createElement("div",{id:t.concat("_right"),className:s}),s=this.createElement("div",{className:K+" "+z+" e-icons"}),s=(t.appendChild(s),this.createElement("div",{className:Z+" "+ee}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(s,e.firstChild),this.eventBinding([t])},t.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+Y+" "+G),s={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},i=this.createElement("div",{className:i,attrs:s}),s=(i.setAttribute("aria-disabled","false"),this.createElement("div",{className:K+" "+z+" e-icons"})),n="e-"+e.id.concat("_nav "+Y+" "+Q),t={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},n=this.createElement("div",{className:n+" "+_,attrs:t}),t=(n.setAttribute("aria-disabled","true"),this.createElement("div",{className:X+" "+z+" e-icons"}));n.appendChild(t),i.appendChild(s),e.appendChild(i),e.insertBefore(n,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),n.classList.add("e-ie-align")),this.eventBinding([i,n])},t.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},t.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},t.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new N.Touch(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),N.EventHandler.add(e,"click",t.clickEventHandler,t)})},t.prototype.repeatScroll=function(){clearInterval(this.timeout)},t.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,Y)?i.firstElementChild:i,s=10;this.timeout=window.setInterval(function(){t.eleScrolling(s,i,!0)},50)},t.prototype.contains=function(e,t){return e.classList.contains(t)},t.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains(Y)&&(n=t.querySelector("."+z).classList),this.contains(s,W)&&this.browserCheck&&(e=-e),!this.contains(s,W)||this.browserCheck||this.ieCheck?n.contains(K)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains(X)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},t.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},t.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Left"===t.swipeDirection?s.scrollLeft+=n*e:"Right"===t.swipeDirection&&(s.scrollLeft-=n*e),r-=.5,window.requestAnimationFrame(i))}var s=this.scrollEle,n=t.velocity<=1?t.distanceX/(10*t.velocity):t.distanceX/t.velocity,r=.5;i()},t.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e,this.enableRtl&&0<this.scrollEle.scrollLeft&&(this.scrollEle.scrollLeft=0)},t.prototype.frameScrollRequest=function(i,s,e){var n,r=this,l=10;e?this.scrollUpdating(i,s):(this.customStep||[].slice.call(N.selectAll("."+Z,this.element)).forEach(function(e){i-=e.offsetWidth}),(n=function(){var e,t=r.contains(r.element,W)&&r.browserCheck?(e=-i,-l):(e=i,l);e<l?window.cancelAnimationFrame(t):(r.scrollUpdating(t,s),i-=t,window.requestAnimationFrame(n))})())},t.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,W)&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},t.prototype.arrowDisabling=function(e,t){var i;this.isDevice?(i=(N.isNullOrUndefined(e)?t:e).querySelector("."+z),N.isNullOrUndefined(e)?N.classList(i,[K],[X]):N.classList(i,[X],[K])):e&&t&&(e.classList.add(_),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(_),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},t.prototype.resizeHandler=function(e){this.scrollHandler(e)},t.prototype.scrollHandler=function(e){var e=e.target,t=e.offsetWidth,i=(this.element,this.element.querySelector("."+Q)),s=this.element.querySelector("."+G),n=this.element.querySelector("."+ee),r=this.element.querySelector("."+$),l=e.scrollLeft;l<=0&&(l=-l),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(n=this.element.querySelector("."+$),r=this.element.querySelector("."+ee)),n.style.width=l<40?l+"px":"40px",e.scrollWidth-Math.ceil(t+l)<40?r.style.width=e.scrollWidth-Math.ceil(t+l)+"px":r.style.width="40px"),0===l?this.arrowDisabling(i,s):Math.ceil(t+l+.1)>=e.scrollWidth?this.arrowDisabling(s,i):(n=this.element.querySelector("."+Y+"."+_))&&(n.classList.remove(_),n.setAttribute("aria-disabled","false"),n.setAttribute("tabindex","0"))},t.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(W):this.element.classList.remove(W)}},e([N.Property(null)],t.prototype,"scrollStep",void 0),e([N.NotifyPropertyChanges],t));function t(e,t){return F.call(this,e,t)||this}ie=function(e,t){return(ie=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 ie,se,q=function(e,t){function i(){this.constructor=e}ie(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},ne="e-rtl",re="e-overlay",le="e-nav-arrow",oe="e-nav-up-arrow",ae="e-nav-down-arrow",de="e-scroll-nav",he="e-scroll-up-nav",ce="e-scroll-down-nav",pe="e-scroll-device",ue="e-scroll-overlay",me="e-scroll-up-overlay",fe="e-scroll-down-overlay",ge=(se=N.Component,q(i,se),i.prototype.preRender=function(){this.browser=N.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=N.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=N.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(ne)},i.prototype.render=function(){this.touchModule=new N.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),N.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(pe),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),N.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){N.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){for(var e=N.createElement("div",{className:"e-vscroll-content"}),t=N.createElement("div",{className:"e-vscroll-bar"}),i=(t.setAttribute("tabindex","-1"),this.element),s=0,n=[].slice.call(i.children);s<n.length;s++){var r=n[s];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflow="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var e=this.element,t=(e.style.display="",N.removeClass([this.element],["e-vscroll",pe,ne]),N.selectAll(".e-"+e.id+"_nav."+de,e)),i=N.selectAll("."+ue,e);[].slice.call(i).forEach(function(e){N.detach(e)});for(var s=0,n=[].slice.call(this.scrollItems.children);s<n.length;s++){var r=n[s];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),N.detach(this.scrollEle),0<t.length&&(N.detach(t[0]),N.isNullOrUndefined(t[1])||N.detach(t[1])),N.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,se.prototype.destroy.call(this)},i.prototype.disable=function(t){var e=N.selectAll(".e-scroll-nav:not(."+re+")",this.element);t?this.element.classList.add(re):this.element.classList.remove(re),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},i.prototype.createOverlayElement=function(e){var t=e.id.concat("_nav"),i=N.createElement("div",{className:ue+" "+fe}),s="e-"+e.id.concat("_nav "+de+" "+ce),t=N.createElement("div",{id:t.concat("down"),className:s}),s=N.createElement("div",{className:ae+" "+le+" e-icons"}),s=(t.appendChild(s),N.createElement("div",{className:ue+" "+me}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(s,e.firstChild),this.eventBinding([t])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+de+" "+ce),i=N.createElement("div",{id:t.concat("_down"),className:i}),s=(i.setAttribute("aria-disabled","false"),N.createElement("div",{className:ae+" "+le+" e-icons"})),n="e-"+e.id.concat("_nav "+de+" "+he),t=N.createElement("div",{id:t.concat("_up"),className:n+" "+re}),n=(t.setAttribute("aria-disabled","true"),N.createElement("div",{className:oe+" "+le+" e-icons"}));t.appendChild(n),i.appendChild(s),i.setAttribute("tabindex","0"),e.appendChild(i),e.insertBefore(t,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),t.classList.add("e-ie-align")),this.eventBinding([i,t])},i.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new N.Touch(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),N.EventHandler.add(e,"click",t.clickEventHandler,t)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,de)?i.firstElementChild:i,s=10;this.timeout=window.setInterval(function(){t.eleScrolling(s,i,!0)},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;(s=s.contains(de)?t.querySelector("."+le).classList:s).contains(ae)?this.frameScrollRequest(e,"add",i):s.contains(oe)&&this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,0<e.deltaY?"add":"",!1)},i.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Up"===t.swipeDirection?s.scrollTop+=n*e:"Down"===t.swipeDirection&&(s.scrollTop-=n*e),r-=.02,window.requestAnimationFrame(i))}var s=this.scrollEle,n=t.velocity<=1?t.distanceY/(10*t.velocity):t.distanceY/t.velocity,r=.5;i()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(t,e,i){var s,n=this,r=10;i?this.scrollUpdating(t,e):(this.customStep||[].slice.call(N.selectAll("."+ue,this.element)).forEach(function(e){t-=e.offsetHeight}),(s=function(){t<r?window.cancelAnimationFrame(r):(n.scrollUpdating(r,e),t-=r,window.requestAnimationFrame(s))})())},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+i:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-i)},i.prototype.arrowDisabling=function(e,t){var i;this.isDevice?(i=(N.isNullOrUndefined(e)?t:e).querySelector("."+le),N.isNullOrUndefined(e)?N.classList(i,[ae],[oe]):N.classList(i,[oe],[ae])):(e.classList.add(re),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(re),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var e=e.target,t=e.offsetHeight,i=this.element.querySelector("."+he),s=this.element.querySelector("."+ce),n=this.element.querySelector("."+me),r=this.element.querySelector("."+fe),l=e.scrollTop;l<=0&&(l=-l),this.isDevice&&(n.style.height=l<40?l+"px":"40px",e.scrollHeight-Math.ceil(t+l)<40?r.style.height=e.scrollHeight-Math.ceil(t+l)+"px":r.style.height="40px"),0===l?this.arrowDisabling(i,s):Math.ceil(t+l+.1)>=e.scrollHeight?this.arrowDisabling(s,i):(n=this.element.querySelector("."+de+"."+re))&&(n.classList.remove(re),n.setAttribute("aria-disabled","false"),n.setAttribute("tabindex","0"))},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(ne):this.element.classList.remove(ne)}},e([N.Property(null)],i.prototype,"scrollStep",void 0),e([N.NotifyPropertyChanges],i));function i(e,t){return se.call(this,e,t)||this}function ve(e,t,i,s,n,r){var l,o=t.parentElement,a="vscroll"===s?(l=r||t.getBoundingClientRect().height,i.getBoundingClientRect().height):(l=t.getBoundingClientRect().width,i.getBoundingClientRect().width);return l<a?ye(e,t,i,s,n,r):o&&(o=o.getBoundingClientRect().width)<l&&"hscroll"===s?(t.style.maxWidth=(a=o)+"px",ye(e,t,i,s,n,r)):i}function ye(e,t,i,s,n,r){e=e("div",{className:"e-menu-"+s});return t.appendChild(e),e.appendChild(i),r?(e.style.overflow="hidden",e.style.height=r+"px"):(e.style.maxHeight=t.style.maxHeight,t.style.overflow="hidden"),"vscroll"===s?new ge({enableRtl:n},e).scrollStep=N.select(".e-"+s+"-bar",t).offsetHeight/2:new te({enableRtl:n},e).scrollStep=N.select(".e-"+s+"-bar",t).offsetWidth,e}function be(e,t,i){var s;e&&((s=N.select(".e-menu-parent",t))?i&&i!==s||(e.destroy(),t.parentElement.appendChild(s),N.detach(t)):(e.destroy(),N.detach(t)))}Ce=function(e,t){return(Ce=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 Ce,Se,q=function(e,t){function i(){this.constructor=e}Ce(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Ie="enter",xe="escape",g="e-focused",Ee="e-menu-header",v="e-selected",Ne="e-separator",Oe="uparrow",we="downarrow",ke="leftarrow",Le="rightarrow",Ae="home",Te="end",De="tab",Pe="e-caret",Me="e-menu-item",He="e-disabled",Ue="e-menu-hide",Re="e-icons",Be="e-rtl",Ve="e-menu-popup",je=(Se=N.ChildProperty,q(Fe,Se),e([N.Property("id")],Fe.prototype,"itemId",void 0),e([N.Property("parentId")],Fe.prototype,"parentId",void 0),e([N.Property("text")],Fe.prototype,"text",void 0),e([N.Property("iconCss")],Fe.prototype,"iconCss",void 0),e([N.Property("url")],Fe.prototype,"url",void 0),e([N.Property("separator")],Fe.prototype,"separator",void 0),e([N.Property("items")],Fe.prototype,"children",void 0),Fe);function Fe(){return null!==Se&&Se.apply(this,arguments)||this}qe=N.ChildProperty,q(_e,qe),e([N.Property(null)],_e.prototype,"iconCss",void 0),e([N.Property("")],_e.prototype,"id",void 0),e([N.Property(!1)],_e.prototype,"separator",void 0),e([N.Collection([],_e)],_e.prototype,"items",void 0),e([N.Property("")],_e.prototype,"text",void 0),e([N.Property("")],_e.prototype,"url",void 0),e([N.Property()],_e.prototype,"htmlAttributes",void 0);var qe,We=_e;function _e(){return null!==qe&&qe.apply(this,arguments)||this}ze=N.ChildProperty,q(Xe,ze),e([N.Property("SlideDown")],Xe.prototype,"effect",void 0),e([N.Property(400)],Xe.prototype,"duration",void 0),e([N.Property("ease")],Xe.prototype,"easing",void 0);var ze,Ke=Xe;function Xe(){return null!==ze&&ze.apply(this,arguments)||this}Ye=N.Component,q(s,Ye),s.prototype.preRender=function(){if(this.isMenu||(i=void 0,"EJS-CONTEXTMENU"===this.element.tagName?(i=this.createElement("ul",{id:N.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()}),t=N.getValue("ej2_instances",this.element),N.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=i,N.setValue("ej2_instances",t,this.element)):(i=this.createElement("ul",{id:N.getUniqueID(this.getModuleName())}),N.append([].slice.call(this.element.cloneNode(!0).children),i),(t=this.element.nextElementSibling)?this.element.parentElement.insertBefore(i,t):this.element.parentElement.appendChild(i),this.clonedElement=i),this.clonedElement.style.display="none"),"EJS-MENU"===this.element.tagName){for(var e=this.element,t=N.getValue("ej2_instances",e),i=this.createElement("ul"),s=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),n=0,r=e.attributes.length;n<r;n++)i.setAttribute(e.attributes[n].nodeName,e.attributes[n].nodeValue);e.parentNode.insertBefore(s,e),N.detach(e),e=i,s.appendChild(e),N.setValue("ej2_instances",t,e),this.clonedElement=s,this.element=e,this.element.id||(this.element.id=N.getUniqueID(this.getModuleName()))}},s.prototype.render=function(){var e=this,t=(this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete(),this.getWrapper());this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){ve(e.createElement,t,e.element,"hscroll",e.enableRtl)})},s.prototype.enableTouchScroll=function(r){var l=0;this.touchStartFn=function(e){l=e.touches[0].clientY},this.touchMoveFn=function(e){var t=e.touches[0].clientY,i=l-t,s=0===r.scrollTop,n=r.scrollTop+r.clientHeight===r.scrollHeight;(s&&i<0||n&&0<i)&&e.preventDefault(),l=t},r.addEventListener("touchstart",this.touchStartFn,{passive:!1}),r.addEventListener("touchmove",this.touchMoveFn,{passive:!1})},s.prototype.touchOutsideHandler=function(e){e=e.target;N.closest(e,".e-"+this.getModuleName()+"-wrapper")||this.closeMenu()},s.prototype.initialize=function(){var e=this.getWrapper();e||(e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.isMenu?this.element.parentElement.insertBefore(e,this.element):this.getAppendToElement().appendChild(e)),this.cssClass&&N.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&e.classList.add(Be),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick,N.isNullOrUndefined(this.animation)&&(this.animation=new N.Animation({}))},s.prototype.renderItems=function(){this.items.length||(e=O.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}}),this.setProperties({items:e},!0),N.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="");var e=this.createItems(this.items);N.append(Array.prototype.slice.call(e.children),this.element),this.element.classList.add("e-menu-parent"),this.isMenu?(!this.hamburgerMode&&this.element.classList.contains("e-vertical")&&this.setBlankIconStyle(this.element),this.enableScrolling&&(e=this.getWrapper(),this.element.classList.contains("e-vertical")?ve(this.createElement,e,this.element,"vscroll",this.enableRtl):ve(this.createElement,e,this.element,"hscroll",this.enableRtl))):(this.element.parentElement.setAttribute("role","dialog"),this.element.parentElement.setAttribute("aria-label","context menu"))},s.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var t=void 0,i=N.selectAll(this.target),s=0,n=i.length;s<n;s++)t=i[s],this.isMenu?N.EventHandler.add(t,"click",this.menuHeaderClickHandler,this):N.Browser.isIos?new N.Touch(t,{tapHold:this.touchHandler.bind(this)}):(this.delegateContextMenuHandler=this.cmenuHandler.bind(this),N.EventHandler.add(t,"contextmenu",this.delegateContextMenuHandler,this));if(this.targetElement=t,!this.isMenu){N.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this),this.scrollParents=U.getScrollableParent(this.targetElement).slice(),this.delegateParentScrollHandler=this.scrollHandler.bind(this);for(var r=0,l=this.scrollParents;r<l.length;r++){var o=l[r];N.EventHandler.add(o,"scroll",this.delegateParentScrollHandler,this)}}}N.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),this.delegateDomKeyHandler=this.domKeyHandler.bind(this),N.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),N.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this),N.EventHandler.add(document,"keydown",this.delegateDomKeyHandler,this),this.isMenu)||this.target||(this.delegateScrollHandler=this.scrollHandler.bind(this),N.EventHandler.add(document,"scroll",this.delegateScrollHandler,this)),this.delegateClickHandler=this.clickHandler.bind(this),N.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=N.rippleEffect(e,{selector:"."+Me}),!this.isMenu&&this.enableScrolling&&(this.enableTouchScroll(e),this.delegateTouchOutsideHandler=this.touchOutsideHandler.bind(this),document.addEventListener("touchstart",this.delegateTouchOutsideHandler,{passive:!0}))},s.prototype.wireKeyboardEvent=function(e){var t={downarrow:we,uparrow:Oe,enter:Ie,leftarrow:ke,rightarrow:Le,escape:xe};this.isMenu&&(t.home=Ae,t.end=Te,t.tab=De),new N.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:t})},s.prototype.mouseDownHandler=function(e){N.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||N.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},s.prototype.keyHandler=function(e){38!==e.keyCode&&40!==e.keyCode||e.target&&(e.target.classList.contains("e-contextmenu")||e.target.classList.contains("e-menu-item"))&&e.preventDefault()},s.prototype.domKeyHandler=function(e){27===e.keyCode&&(this.isMenuVisible()&&e.stopImmediatePropagation(),e.action=xe,this.leftEscKeyHandler(e));var t=e.key?"ArrowDown"===e.key:40===e.keyCode,i=e.key?"ArrowUp"===e.key:38===e.keyCode;(t||i)&&(i=document.activeElement)&&(N.closest(i,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||N.closest(i,".e-menu-item")||N.closest(i,".e-menu-parent"))&&e.preventDefault(),t&&N.closest(this.element,".e-popup-open")&&!N.closest(document.activeElement,"#"+this.element.id)&&(i=document.activeElement)&&"true"===i.getAttribute("aria-expanded")&&(e=this.element,t=N.select(".e-menu-item",e))&&(e.focus(),t.classList.add("e-focused"),this.skipNextArrowDown=!0)},s.prototype.keyBoardHandler=function(e){if(e.action===we&&this.skipNextArrowDown)this.skipNextArrowDown=!1;else{var t="",i=e.target,s=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&i.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([g,v],[N.closest(i,".e-"+this.getModuleName()+"-wrapper")]),this.isKBDAction=!0,s)switch(e.action){case Le:t=Le,e.action=we;break;case ke:t=ke,e.action=Oe;break;case we:t=we,e.action=Le;break;case Oe:t=Oe,e.action=""}else if(this.enableRtl)switch(e.action){case ke:s=!0,t=ke,e.action=Le;break;case Le:s=!0,t=Le,e.action=ke}switch(e.action){case we:case Oe:case Te:case Ae:case De:this.upDownKeyHandler(e);break;case Le:this.rightEnterKeyHandler(e);break;case ke:this.leftEscKeyHandler(e);break;case Ie:this.hamburgerMode&&"SPAN"===i.tagName&&i.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e)}this.isAnimationNone&&(this.isKBDAction=!1),s&&(e.action=t)}},s.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i=e.action===we||e.action===Ae||e.action===De?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,g),n=(n&&(e.action!==Te&&e.action!==Ae&&(s=this.getIdx(t,n)),n.classList.remove(g),e.action!==Te)&&e.action!==Ae&&(e.action===we?s++:s--,s===(e.action===we?t.childElementCount:-1))&&(s=i),t.children[s]),s=this.isValidLI(n,s,e.action);t.children[s].classList.add(g),t.children[s].focus(),N.closest(this.element,".e-popup")&&!t.children[s].querySelector('[tabindex], span[tabindex], a, button, [tabindex]:not([tabindex="-1"])')&&t.focus()},s.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx(),n=i===we||i===Ae||i===De?0:s.childElementCount-1;return(e.classList.contains(Ne)||e.classList.contains(He)||e.classList.contains(Ue))&&(i===we&&t===s.childElementCount-1||i===Oe&&0===t?t=n:i===we||i===Le||"tab"===i&&e.classList.contains(Ne)?t++:t--),t=(e=s.children[t])&&(e.classList.contains(Ne)||e.classList.contains(He)||e.classList.contains(Ue))?this.isValidLI(e,t,i):t},s.prototype.getUlByNavIdx=function(e){var t,i,s=this;return void 0===e&&(e=this.navIdx.length),this.isMenu?(t=[this.getWrapper()].concat([].slice.call(N.selectAll("."+Ve)))[e],i=[],N.selectAll("."+Ve).forEach(function(e){(s.element.id===e.id.split("-")[2]||e.id.split("-")[2]+"-"+e.id.split("-")[3])&&i.push(e)}),t=[this.getWrapper()].concat([].slice.call(i))[e],N.isNullOrUndefined(t)?null:N.select(".e-menu-parent",t)):this.getAppendToElement().contains(this.element)||0!==e?this.getWrapper().children[e]:null},s.prototype.rightEnterKeyHandler=function(e){var t=this.getUlByNavIdx(),i=this.getLIByClass(t,g);if(i){var t=this.getIdx(t,i),s=this.navIdx.concat(t),n=this.getItem(s);if(n.items.length)this.navIdx.push(t),this.keyType="right",this.action=e.action,this.openMenu(i,n,-1,-1,e);else if(e.action===Ie){this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([v],[this.getWrapper()]):i.classList.remove(g),i.classList.add(v),this.trigger("select",{element:i,item:n,event:e});s=i.querySelector(".e-menu-url");if(n.url&&s)switch(s.getAttribute("target")){case"_blank":window.open(n.url,"_blank");break;case"_parent":window.parent.location.href=n.url;break;default:window.location.href=n.url}this.closeMenu(null,e);t=this.getLIByClass(this.getUlByNavIdx(),v);t&&(t.classList.add(g),t.focus())}}},s.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):e.action===xe&&this.closeMenu(null,e)},s.prototype.scrollHandler=function(e){this.closeMenu(null,e)},s.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},s.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&(this.openMenu(null,null,this.pageY,this.pageX,e),this.isCmenuOpened=!0),this.isCMenu=!1)},s.prototype.closeMenu=function(o,a,d){var e,h,c,t,p,i,s,n,u,m,f=this;void 0===o&&(o=0),void 0===a&&(a=null),this.isMenuVisible()&&(e=void 0,c=this.getWrapper(),t=void 0,i=this.getPopups(),s=!1,n=this.isMenu?i.length+1:c.childElementCount,u=this.isMenu&&1!==n?N.select(".e-ul",i[n-2]):N.selectAll(".e-menu-parent",c)[n-1],this.isMenu&&u.classList.contains("e-menu")&&((e=this.getLIByClass(u,v))&&e.classList.remove(v),s=!0),s||(m=a&&a.target&&this.getLI(a.target),this.cli=m||u.children[0],h=this.navIdx.length?this.getItem(this.navIdx):null,p=(h||this).items,t={element:u,parentItem:h,items:p,event:a,cancel:!1,isFocused:!0},this.trigger("beforeClose",t,function(e){var t,i,s,n="",r=!e.cancel,l=((r||f.isCMenu)&&(f.isMenu?(t=N.closest(u,"."+Ve),f.hamburgerMode&&(t.parentElement.style.minHeight="",N.closest(u,".e-menu-item").setAttribute("aria-expanded","false")),f.unWireKeyboardEvent(t),be(N.getInstance(t.children[0],ge),t.children[0]),(l=N.getInstance(t,U.Popup)).hide(),n=t.id,l.destroy(),N.detach(t)):(f.isContextMenuClosed=!1,f.toggleAnimation(u,!1)),f.trigger("onClose",{element:u,parentItem:h,items:p}),f.navIdx.pop(),0===f.navIdx.length&&a&&"keyup"===a.type&&(f.showSubMenu=!1),f.isMenu||(N.EventHandler.remove(u,"keydown",f.keyHandler),"right"===f.keyType&&(f.keyType=""))),f.updateReactTemplate(),f.getWrapper()&&f.getUlByNavIdx()),n=(f.isCMenu&&(f.canOpen(a.target)&&f.openMenu(null,null,f.pageY,f.pageX,a),f.isCMenu=!1),f.isMenu&&l&&n.length?(t=new RegExp("(.*)-ej2menu-"+f.element.id+"-popup").exec(n)[1],i=l.querySelector('[id="'+t+'"]'),s=m&&l.querySelector('[id="'+m.id+'"]')):l&&(i=l.querySelector(".e-menu-item.e-selected"),s=m&&l.querySelector('[id="'+m.id+'"]')),m&&m.querySelectorAll(".e-menu-item"));r&&f.hamburgerMode&&o&&!n.length?f.afterCloseMenu(a):r&&!f.hamburgerMode&&i&&!s&&"left"!==f.keyType&&(f.navIdx.length||!f.isMenu&&0===f.navIdx.length)?(t=a&&a.target.classList&&(a.target.classList.contains("e-vscroll")||a.target.classList.contains("e-scroll-nav"))?N.closest(a.target,".e-menu-wrapper"):null)?(t=t.querySelector(".e-menu-item"),(f.showItemOnClick||t&&f.getIndex(t.id,!0).length<=f.navIdx.length)&&f.closeMenu(f.navIdx[f.navIdx.length-1],a,!0)):a&&a.target.classList&&a.target.classList.contains("e-nav-arrow")||f.closeMenu(f.navIdx[f.navIdx.length-1],a):r&&!d&&!o&&(f.hamburgerMode&&f.navIdx.length||1===f.navIdx.length&&m&&l!==m.parentElement)||r&&N.isNullOrUndefined(o)&&f.navIdx.length?f.closeMenu(null,a):!r||f.isMenu||o||0!==f.navIdx.length||f.isMenusClosed||f.isCmenuHover?r&&f.isMenu&&a&&a.target&&0!==f.navIdx.length&&N.closest(a.target,".e-menu-parent.e-control")?f.closeMenu(0,a):r&&!f.isMenu&&N.selectAll(".e-menu-parent",c)[o-1]&&3===a.which?f.closeMenu(null,a):(!r||"right"!==f.keyType&&"click"!==f.keyType?(n=f.getUlByNavIdx(),(i=f.getLIByClass(n,v))&&(i.setAttribute("aria-expanded","false"),i.classList.remove(v),e.isFocused&&m||"left"===f.keyType)&&(i.classList.add(g),a.target&&a.target.classList.contains("e-edit-template")||i.focus()),!r&&f.hamburgerMode&&m&&"false"===m.getAttribute("aria-expanded")&&"true"===m.getAttribute("aria-haspopup")&&(N.closest(m,".e-menu-parent.e-control")?f.navIdx=[]:f.navIdx.pop(),f.navIdx.push(f.cliIdx),s=f.getItem(f.navIdx),m.setAttribute("aria-expanded","true"),f.openMenu(m,s,-1,-1,a))):f.afterCloseMenu(a),f.navIdx.length<1&&("Hover"!==f.showSubMenuOn&&"Click"!==f.showSubMenuOn||(f.showItemOnClick=f.defaultOption,f.showSubMenuOn="Auto"))):(f.isMenusClosed=!0,f.closeMenu(0,a)),f.removeStateWrapper()})))},s.prototype.updateReactTemplate=function(){var e;this.isReact&&this.template&&0===this.navIdx.length&&(e=void 0,this.portals&&(e=this.portals.splice(0,this.items.length)),this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates())},s.prototype.getMenuItemModel=function(e,t){if(N.isNullOrUndefined(e))return null;N.isNullOrUndefined(t)&&(t=0);t=this.getFields(t);return{text:e[t.text],id:e[t.id],items:e[t.child],separator:e[t.separator],iconCss:e[t.iconCss],url:e[t.url]}},s.prototype.getPopups=function(){var t=this,i=[];return[].slice.call(document.querySelectorAll("."+Ve)).forEach(function(e){!N.isNullOrUndefined(e.querySelector("."+Me))&&t.getIndex(e.querySelector("."+Me).id,!0).length&&i.push(e)}),i},s.prototype.isMenuVisible=function(){return 0<this.navIdx.length||this.element.classList.contains("e-contextmenu")&&N.isVisible(this.element).valueOf()},s.prototype.canOpen=function(e){var t=!0;if(this.filter)for(var t=!1,i=this.filter.split(" "),s=0,n=i.length;s<n;s++)if(N.closest(e,"."+i[s])){t=!0;break}return t},s.prototype.openMenu=function(e,t,i,s,n,r){var l,o=this,a=(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=null),void 0===r&&(r=this.targetElement),this.getWrapper()),d=(this.lItem=e,""!==this.element.id?this.element.id:"menu");this.isMenusClosed=!1,N.isNullOrUndefined(i)&&(i=-1),N.isNullOrUndefined(s)&&(s=-1),e?(this.uList=this.createItems(t[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&N.Browser.isDevice&&(a.lastChild.style.display="none",l={text:t[this.getField("text")].toString(),iconCss:Re+" e-previous"},this.template&&(t.iconCss=(t.iconCss||"")+Re+" e-previous"),l=new We(this.items[0],"items",this.template?t:l,!0),(l=this.createItems([l]).children[0]).classList.add(Ee),this.uList.insertBefore(l,this.uList.children[0])),this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+Ve,id:e.id+"-ej2menu-"+d+"-popup"}),this.popupWrapper.setAttribute("role","navigation"),this.popupWrapper.setAttribute("aria-label",t.text+"-menu-popup"),(this.hamburgerMode?(i=e.offsetHeight,e):this.getAppendToElement()).appendChild(this.popupWrapper),this.isNestedOrVertical=this.element.classList.contains("e-vertical")||1!==this.navIdx.length,this.popupObj=this.generatePopup(this.popupWrapper,this.uList,e,this.isNestedOrVertical),this.template&&this.renderReactTemplates(),this.hamburgerMode?this.calculateIndentSize(this.uList,e):(this.cssClass&&N.addClass([this.popupWrapper],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,t,n,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){o.triggerBeforeOpen(e,o.uList,t,n,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,a.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){o.triggerBeforeOpen(e,o.uList,t,n,i,s,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,t,n,i,s,"none"))):(this.uList=this.element,this.uList.style.zIndex=U.getZindexPartial(r||this.element).toString(),N.isNullOrUndefined(n)?((l=document.createEvent("MouseEvents")).initEvent("click",!0,!1),(d=this.copyObject(l,{})).target=d.srcElement=r,d.currentTarget=r,this.triggerBeforeOpen(e,this.uList,t,d,i,s,"none")):this.triggerBeforeOpen(e,this.uList,t,n,i,s,"none"))},s.prototype.copyObject=function(e,t){for(var i in e)t[""+i]=e[""+i];return t},s.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),i=parseInt(i.textIndent,10),s=(this.navIdx.length<2&&!t.classList.contains("e-blankicon")?i*=2:i+=i/4,e.style.textIndent=i+"px",e.querySelectorAll(".e-blankicon"));if(s&&s.length)for(var t=e.querySelector(".e-menu-icon"),e=getComputedStyle(t),n=parseInt(e.marginRight,10)+t.offsetWidth+i,r=0;r<s.length;r++)s[r].style.textIndent=n+"px"},s.prototype.generatePopup=function(e,t,i,s){var n=this,r=new U.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:i,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:s||this.enableRtl?"none":"flip",Y:"fit"},position:s&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:t,open:function(){var e=N.select(".e-menu-vscroll",r.element),e=(e&&(e.style.height="inherit",e.style.maxHeight=""),N.select(".e-ul",r.element));r.element.style.maxHeight="",e.focus(),n.triggerOpen(e)}});return r},s.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var t=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),i=this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(this.title):this.title,i=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:i}),s=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});t.appendChild(i),t.appendChild(s),e.insertBefore(t,this.element)},s.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},s.prototype.closeHamburgerMenu=function(t){var i=this,e={element:this.element,parentItem:null,event:t,items:this.items,cancel:!1};this.trigger("beforeClose",e,function(e){e.cancel||(i.closeMenu(null,t),i.element.classList.add("e-hide-menu"),i.trigger("onClose",{element:i.element,parentItem:null,items:i.items}))})},s.prototype.callFit=function(e,t,i,s,n){return U.fit(e,null,{X:t,Y:i},{top:s,left:n})},s.prototype.triggerBeforeOpen=function(s,n,r,l,e,t,i){var o,a=this,d=s?r[this.getField("children",this.navIdx.length-1)]:this.items,h=i;this.trigger("beforeOpen",{element:n,items:d,parentItem:r,event:l,cancel:!1,top:e,left:t,showSubMenuOn:"Auto"},function(e){switch(h){case"menu":a.hamburgerMode||("Auto"!==e.showSubMenuOn&&(a.showItemOnClick=!a.defaultOption,a.showSubMenuOn=e.showSubMenuOn),a.top=e.top,a.left=e.left),a.popupWrapper.style.display="block",a.hamburgerMode||(a.popupWrapper.style.maxHeight=a.popupWrapper.getBoundingClientRect().height+"px",a.enableScrolling&&ve(a.createElement,a.popupWrapper,a.uList,"vscroll",a.enableRtl),a.checkScrollOffset(l)),a.hamburgerMode||a.left||a.top?(a.popupObj.collision={X:"none",Y:"none"},a.popupWrapper.style.display=""):(a.popupObj.refreshPosition(a.lItem,!0),a.left=parseInt(a.popupWrapper.style.left,10),a.top=parseInt(a.popupWrapper.style.top,10),a.enableRtl&&(a.left=a.isNestedOrVertical?a.left-a.popupWrapper.offsetWidth-a.lItem.parentElement.offsetWidth+2:a.left-a.popupWrapper.offsetWidth+a.lItem.offsetWidth),a.template&&(a.isReact||a.isAngular)?requestAnimationFrame(function(){a.collision(),a.popupWrapper.style.display=""}):(a.collision(),a.popupWrapper.style.display=""));break;case"none":a.top=e.top,a.left=e.left,a.isContextMenuClosed=!0,o=e.element,a.enableScrolling&&a.isCMenu&&o&&o.parentElement&&(o.style.height=o.parentElement.style.height);break;case"hamburger":e.cancel||(a.element.classList.remove("e-hide-menu"),a.triggerOpen(a.element))}var t,i;"hamburger"!==h&&(e.cancel?(a.isMenu?(a.popupObj.destroy(),N.detach(a.popupWrapper)):-1<n.className.indexOf("e-ul")&&N.detach(n),a.navIdx.pop()):a.isMenu?a.hamburgerMode?(a.popupWrapper.style.top=a.top+"px",a.popupWrapper.style.left="0px",a.toggleAnimation(a.popupWrapper)):(a.setBlankIconStyle(a.popupWrapper),a.wireKeyboardEvent(a.popupWrapper),N.rippleEffect(a.popupWrapper,{selector:"."+Me}),a.popupWrapper.style.left=a.left+"px",a.popupWrapper.style.top=a.top+"px",t="None"!==a.animationSettings.effect?{name:a.animationSettings.effect,duration:a.animationSettings.duration,timingFunction:a.animationSettings.easing}:null,a.popupObj.show(t,a.lItem),N.Browser.isDevice&&(a.popupWrapper.style.left=a.left+"px")):(a.setBlankIconStyle(a.uList),a.setPosition(a.lItem,a.uList,a.top,a.left),a.toggleAnimation(a.uList))),"right"===a.keyType&&(t=a.getUlByNavIdx(),s.classList.remove(g),a.isMenu&&1===a.navIdx.length&&a.removeLIStateByClass([v],[a.getWrapper()]),s.classList.add(v),a.action===Ie&&a.trigger("select",{element:s,item:r,event:l}),s.focus(),t=a.getUlByNavIdx(),i=a.isValidLI(t.children[0],0,a.action),t.children[i].classList.add(g),t.children[i].focus())})},s.prototype.collision=function(){var e,t=U.isCollide(this.popupWrapper,null,this.left,this.top);(this.isNestedOrVertical||this.enableRtl)&&(-1<t.indexOf("right")||-1<t.indexOf("left"))&&(this.popupObj.collision.X="none",e=N.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth,this.left=this.enableRtl?U.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-e+2),(-1<(t=U.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")||-1<t.indexOf("right"))&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},s.prototype.setBlankIconStyle=function(e){var t,i,s,n,r=[].slice.call(e.getElementsByClassName("e-blankicon"));r.length&&(e=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)"))&&(i=e.querySelector(".e-menu-icon"))&&(t=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},i=getComputedStyle(i),s=parseInt(i.fontSize,10),n=(s=parseInt(i.width,10)&&parseInt(i.width,10)>s?parseInt(i.width,10):s)+parseInt(i[t.margin],10)+parseInt(getComputedStyle(e)[t.padding],10)+"px",r.forEach(function(e){e.style[t.padding]=n}))},s.prototype.checkScrollOffset=function(e){var t,i=this.getWrapper();i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length&&(e=N.isNullOrUndefined(e)?this.element:N.closest(e.target,"."+Me),(i=N.select(".e-hscroll-bar",i)).scrollLeft>e.offsetLeft&&(i.scrollLeft-=i.scrollLeft-e.offsetLeft),(t=i.scrollLeft+i.offsetWidth)<(e=e.offsetLeft+e.offsetWidth))&&(i.scrollLeft+=e-t)},s.prototype.setPosition=function(e,t,i,s,n){void 0===n&&(n=!1);this.toggleVisiblity(t),t===this.element||-1<s&&-1<i?(-1<(l=U.isCollide(t,null,s,i)).indexOf("right")&&(s-=t.offsetWidth),-1<l.indexOf("bottom")&&(i=(o=this.callFit(t,!1,!0,i,s)).top-20)<0&&-1<(r=pageYOffset+document.documentElement.clientHeight-t.getBoundingClientRect().height)&&(i=r),-1<(l=U.isCollide(t,null,s,i)).indexOf("left")&&(s=(o=this.callFit(t,!0,!1,i,s)).left)):N.Browser.isDevice?s=!this.isMenu&&this.enableScrolling?(r=document.querySelector(".e-menu-vscroll"),i=Number(r.style.top.replace("px","")),Number(r.style.left.replace("px",""))):(i=Number(this.element.style.top.replace("px","")),Number(this.element.style.left.replace("px",""))):(r=this.enableRtl?"left":"right",i=(o=U.calculatePosition(e,r,"top")).top,s=o.left,(r=-1<(l=U.isCollide(t,null,this.enableRtl?s-t.offsetWidth:s,i)).indexOf("left")||-1<l.indexOf("right"))&&(s=(o=U.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||r)&&(s=this.enableRtl&&r?s:s-t.offsetWidth),-1<l.indexOf("bottom")&&(this.isMenu||!this.enableScrolling)&&(i=(o=this.callFit(t,!1,!0,i,s)).top)),this.toggleVisiblity(t,!1),(this.isCMenu||this.isOpenCalled)&&this.enableScrolling&&t&&(t.style.height="",t.style.top="",t.style.left="",t.style.width="",t.style.position="");var r,l,o,e=N.closest(this.element,".e-"+this.getModuleName()+"-wrapper");!this.isMenu&&this.enableScrolling&&t&&e&&0<e.offsetHeight?(r=N.closest(t,".e-menu-vscroll"),t.style.display="block",r&&be(N.getInstance(r,ge),r),l=Math.ceil(this.getMenuWidth(t,t.offsetWidth,this.enableRtl)),o=ve(this.createElement,e,t,"vscroll",this.enableRtl,e.offsetHeight),i=this.callFit(o,!1,!0,i,s).top,Object.assign(o.style,{top:i+"px",left:s+"px",width:l+"px",position:"absolute",display:n?"block":"none"})):(t.style.top=i+"px",t.style.left=s+"px")},s.prototype.getMenuWidth=function(e,t,i){e=e.getElementsByClassName(Pe)[0];return e&&(t+=parseInt(getComputedStyle(e)[i?"marginRight":"marginLeft"],10)),t<120?120:t},s.prototype.toggleVisiblity=function(e,t){e.style.visibility=(t=void 0===t?!0:t)?"hidden":"",e.style.display=t?"block":"none"},s.prototype.createItems=function(e){var i=this,s=this.navIdx?this.navIdx.length:0,t=this.getFields(s),n=this.hasField(e,this.getField("iconCss",s)),r={showIcon:n,moduleName:"menu",fields:t,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[t.id]]||(e.curData[e.fields[t.id]]=N.getUniqueID("menuitem")),N.isNullOrUndefined(e.curData.htmlAttributes)&&Object.defineProperty(e.curData,"htmlAttributes",{value:{},writable:!0,enumerable:!0,configurable:!0}),N.Browser.isIE?(e.curData.htmlAttributes.role||(e.curData.htmlAttributes.role="menuitem"),e.curData.htmlAttributes.tabindex||(e.curData.htmlAttributes.tabindex="-1")):Object.assign(e.curData.htmlAttributes,{role:e.curData.htmlAttributes.role||"menuitem",tabindex:e.curData.htmlAttributes.tabindex||"-1"}),!i.isMenu||e.curData[i.getField("separator",s)]||e.curData.htmlAttributes["aria-label"]||(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]||e.curData[e.fields.id]),""===e.curData[e.fields[t.iconCss]]&&(e.curData[e.fields[t.iconCss]]=null)},itemCreated:function(e){e.curData[i.getField("separator",s)]&&(e.item.classList.add(Ne),e.curData.htmlAttributes.role||e.item.setAttribute("role","separator"),e.curData.htmlAttributes.ariaLabel||e.item.setAttribute("aria-label","separator")),!n||e.curData[e.fields.iconCss]||e.curData[i.getField("separator",s)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length&&(t=i.createElement("span",{className:Re+" "+Pe}),e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),e.item.classList.add("e-menu-caret-icon")),i.template&&(e.item.setAttribute("id",e.curData[e.fields.id].toString()),e.item.removeAttribute("data-uid"),e.item.classList.contains("e-level-1")&&e.item.classList.remove("e-level-1"),e.item.classList.contains("e-has-child")&&e.item.classList.remove("e-has-child"),e.item.removeAttribute("aria-level"));var t={item:e.curData,element:e.item};i.trigger("beforeItemRender",t)}},e=(this.setProperties({items:this.items},!0),this.isMenu&&(r.templateID=this.element.id+"Template"),O.ListBase.createList(this.createElement,e,r,!this.template,this));return e.setAttribute("tabindex","0"),this.isMenu?e.setAttribute("role","menu"):e.setAttribute("role","menubar"),e},s.prototype.moverHandler=function(e){var t=e.target,i=(this.liTrgt=t,this.isMenu||(this.isCmenuHover=!0),this.getLI(t)),s=i?N.closest(i,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),n=this.getWrapper(),r=new RegExp("-ej2menu-(.*)-popup"),l=!1;if(s){if((""!==s.id?r.exec(s.id)[1]:s.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([g,v],[this.getWrapper()]),!this.navIdx.length)return;l=!0}i&&N.closest(i,".e-"+this.getModuleName()+"-wrapper")&&!l?(this.removeLIStateByClass([g],this.isMenu?[s].concat(this.getPopups()):[s]),this.removeLIStateByClass([g],this.isMenu?[n].concat(this.getPopups()):[n]),i.classList.add(g),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!l&&this.removeLIStateByClass([g],[s].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||t.parentElement===s||N.closest(t,".e-"+this.getModuleName()+"-popup")||i&&this.getIndex(i.id,!0).length||"Hover"===this.showSubMenuOn?l&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([g],[s]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1),this.isMenu||(this.isCmenuHover=!1)}},s.prototype.removeStateWrapper=function(){var e;this.liTrgt&&(e=N.closest(this.liTrgt,".e-menu-vscroll"),"DIV"===this.liTrgt.tagName)&&e&&this.removeLIStateByClass([g,v],[e])},s.prototype.removeLIStateByClass=function(e,i){for(var s,t=0;t<i.length;t++)!function(t){e.forEach(function(e){(s=N.select("."+e,i[t]))&&s.classList.remove(e)})}(t)},s.prototype.getField=function(e,t){void 0===t&&(t=0);e=this.fields[""+e];return"string"==typeof e?e:(e[t]||e[e.length-1]).toString()},s.prototype.getFields=function(e){return{id:this.getField("itemId",e=void 0===e?0:e),iconCss:this.getField("iconCss",e),text:this.getField("text",e),url:this.getField("url",e),child:this.getField("children",e),separator:this.getField("separator",e)}},s.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},s.prototype.menuHeaderClickHandler=function(e){var t=N.closest(e.target,".e-menu-wrapper");t&&t.querySelector("ul.e-menu-parent").id!==this.element.id||(-1<this.element.className.indexOf("e-hide-menu")?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},s.prototype.clickHandler=function(e){this.isTapHold=this.isTapHold&&!1;var t,i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),r=new RegExp("-ej2menu-(.*)-popup"),l=n?N.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,o=n&&l&&(this.isMenu?0<this.getIndex(n.id,!0).length:i.firstElementChild.id===l.firstElementChild.id);if(N.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([g],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&l&&this.isMenu){var r=l.id?r.exec(l.id)[1]:l.querySelector(".e-menu-parent").id;if(this.element.id!==r)return}o&&"click"===e.type&&!n.classList.contains(Ee)&&(this.setLISelected(n),l=this.getIndex(n.id,!0),r=this.getItem(l),this.trigger("select",{element:n,item:r,event:e})),o&&("mouseover"===e.type||N.Browser.isDevice||this.showItemOnClick)?(l=void 0,n.classList.contains(Ee)?(l=i.children[this.navIdx.length-1],this.toggleAnimation(l),(t=this.getLIByClass(l,v))&&t.classList.remove(v),(r=this.enableScrolling&&!this.isMenu?N.closest(n.parentElement,".e-menu-vscroll"):null)&&be(N.getInstance(r,ge),r),N.detach(n.parentNode),this.navIdx.pop()):n.classList.contains(Ne)||(this.showSubMenu=!0,o=n.parentNode,N.isNullOrUndefined(o))||(this.cliIdx=this.getIdx(o,n),!this.isMenu&&N.Browser.isDevice||(l=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),N.closest(o,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,o),this.navIdx[l]===this.cliIdx&&(this.showSubMenu=!1),l===this.navIdx.length)||"mouseover"===e.type&&!this.showSubMenu||((t=this.getLIByClass(o,v))&&t.classList.remove(v),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!0)),this.closeMenu(l+1,e),this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!1))),this.isClosed||this.afterCloseMenu(e),this.isClosed=!1)):"DIV"===s.tagName&&N.closest(s,".e-menu-vscroll")&&(this.navIdx.length||!this.isMenu&&this.enableScrolling&&0===this.navIdx.length)?(r=this.isMenu?N.closest(s,"."+Ve):N.closest(s,".e-menu-vscroll"),(o=this.isMenu?Array.prototype.indexOf.call(this.getPopups(),r)+1:this.getIdx(i,N.select("ul.e-menu-parent",r)))<this.navIdx.length&&(this.closeMenu(o+1,e),r)&&this.removeLIStateByClass([g,v],[r])):this.isMenu&&this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):"UL"===s.tagName&&(this.isMenu?!s.parentElement.classList.contains("e-menu-wrapper")||this.getIndex(s.querySelector("."+Me).id,!0).length:s.parentElement===i)||(n||N.isNullOrUndefined(i)||this.removeLIStateByClass([v],[i]),(!this.isAnimationNone&&!n||n&&!n.querySelector("."+Pe))&&(navigator.platform.toUpperCase().indexOf("MAC")<0||0<=navigator.platform.toUpperCase().indexOf("MAC")&&!e.ctrlKey)&&this.closeMenu(null,e))},s.prototype.afterCloseMenu=function(e){var t,i,s;N.isNullOrUndefined(e)||(this.showSubMenu&&(t=this.showItemOnClick&&0===this.navIdx.length?N.closest(e.target,".e-menu-parent.e-control"):N.closest(this.element,".e-menu-parent.e-control"),i=this.navIdx.concat(this.cliIdx),(s=this.getItem(i))&&s[this.getField("children",i.length-1)]&&s[this.getField("children",i.length-1)].length?(("mouseover"===e.type||N.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&t||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,s,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!t)&&(i=this.getUlByNavIdx(),s=this.getLIByClass(i,v))&&(s.setAttribute("aria-expanded","false"),s.classList.remove(v)),this.keyType="")},s.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,v);t&&t.classList.remove(v),this.isMenu||e.classList.remove(g),e.classList.add(v)},s.prototype.getLIByClass=function(e,t){if(e&&e.children)for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},s.prototype.getItemIndex=function(e,t){e="string"==typeof e?e:e.id;return this.getIndex(e,!1!==t)},s.prototype.setItem=function(e,t,i){t=i?t||e.id:t||e.text,t=this.getIndex(t,i),i=this.getItem(t);Object.assign(i,e)},s.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},s.prototype.getItems=function(e){for(var t=this.items,i=0;i<e.length;i++)t=t[e[i]][this.getField("children",i)];return t},s.prototype.setItems=function(e,t){var i=this.getItems(t);i.splice(0,i.length);for(var s=0;s<e.length;s++)i.splice(s,0,e[s])},s.prototype.getIdx=function(e,t,i){void 0===i&&(i=!0);var s=!this.isMenu&&this.enableScrolling&&N.select(".e-menu-vscroll",e)?N.selectAll(".e-menu-parent",e):Array.from(e.children),s=Array.prototype.indexOf.call(s,t);return i&&e.children[0].classList.contains(Ee)&&s--,s},s.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:N.closest(e,"li.e-menu-item")},s.prototype.updateItemsByNavIdx=function(){for(var e=this.items,t=0,i=0;i<this.navIdx.length&&(e=e[i].items);i++){t++;var s=this.getUlByNavIdx(t);if(!s)break;this.updateItem(s,e)}},s.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},s.prototype.onPropertyChanged=function(d,h){for(var c=this,p=this.getWrapper(),u=this,e=0,t=Object.keys(d);e<t.length;e++)!function(e){switch(e){case"cssClass":h.cssClass&&N.removeClass([p],h.cssClass.split(" ")),d.cssClass&&N.addClass([p],d.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":u.enableRtl?p.classList.add(Be):p.classList.remove(Be);break;case"showItemOnClick":u.unWireEvents(),u.showItemOnClick=d.showItemOnClick,u.wireEvents();break;case"enableScrolling":var t,i;d.enableScrolling?(u.element.classList.contains("e-vertical")?ve(u.createElement,p,u.element,"vscroll",u.enableRtl):ve(u.createElement,p,u.element,"hscroll",u.enableRtl),u.getPopups().forEach(function(e){t=N.select(".e-ul",e),ve(c.createElement,e,t,"vscroll",c.enableRtl)})):(i=p.children[0],u.element.classList.contains("e-vertical")||!u.isMenu?be(N.getInstance(i,ge),i):be(N.getInstance(i,te),i),p.style.overflow="",p.appendChild(u.element),u.getPopups().forEach(function(e){i=e.children[0],be(N.getInstance(i,ge),i),e.style.overflow=""}));break;case"items":var s,n,r=void 0;if(u.isReact&&u.template&&u.clearTemplate(["template"]),Object.keys(h.items).length)for(var l=Object.keys(d.items),o=0;o<l.length;o++)(r=u.getChangedItemIndex(d,[],Number(l[o]))).length<=u.getWrapper().children.length&&(s=r.pop(),n=u.getItems(r),u.insertAfter([n[s]],n[s].text),u.removeItem(n,r,s),u.setItems(n,r)),r.length=0;else{if(u.updateItem(u.element,u.items),u.enableScrolling&&u.element.parentElement.classList.contains("e-custom-scroll")&&(u.element.classList.contains("e-vertical")?ve(u.createElement,p,u.element,"vscroll",u.enableRtl):ve(u.createElement,p,u.element,"hscroll",u.enableRtl)),u.enableScrolling&&u.element.classList.contains("e-contextmenu")&&(u.isCMenu=!0,u.setPosition(u.lItem,u.uList,u.top,u.left,!0),u.isCMenu=!1),!u.hamburgerMode)for(var o=1,a=p.childElementCount;o<a;o++)N.detach(p.lastElementChild);u.navIdx=[]}}}(t[e])},s.prototype.updateItem=function(t,e){var i;N.isBlazor()&&!this.isMenu?t=this.removeChildElement(t):(this.enableScrolling&&(i=this.getWrapper().children[0],this.element.classList.contains("e-vertical")?be(N.getInstance(i,ge),i):be(N.getInstance(i,te),i)),t.innerHTML=""),[].slice.call(this.createItems(e).children).forEach(function(e){t.appendChild(e)})},s.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();return"items"===s?(e=e.items[i],(i=Object.keys(e.items).pop())&&this.getChangedItemIndex(e,t,Number(i))):"isParentArray"===s&&1<t.length&&t.pop(),t},s.prototype.removeItem=function(e,t,i){e.splice(i,1);var s,e=this.getWrapper().children;t.length<e.length&&(this.enableScrolling&&!e[t.length].classList.contains("e-menu-parent")?(s=e[t.length].querySelector(".e-menu-parent"),N.detach(s.children[i])):N.detach(e[t.length].children[i]))},s.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var t=this.getWrapper();if(e){for(var i,s=void 0,n=N.selectAll(e),r=0,l=n.length;r<l;r++)i=n[r],this.isMenu?N.EventHandler.remove(i,"click",this.menuHeaderClickHandler):N.Browser.isIos?(s=N.getInstance(i,N.Touch))&&s.destroy():this.delegateContextMenuHandler&&(N.EventHandler.remove(i,"contextmenu",this.delegateContextMenuHandler),this.delegateContextMenuHandler=null);if(!this.isMenu&&(N.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler),this.scrollParents)){for(var o=0,a=this.scrollParents;o<a.length;o++){var d=a[o];N.EventHandler.remove(d,"scroll",this.delegateParentScrollHandler)}this.delegateParentScrollHandler=null,this.scrollParents.length=0,this.scrollParents=null}}N.Browser.isDevice||(this.delegateMoverHandler&&(N.EventHandler.remove(this.isMenu?document:t,"mouseover",this.delegateMoverHandler),this.delegateMoverHandler=null),this.delegateMouseDownHandler&&(N.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler),this.delegateMouseDownHandler=null),this.delegateDomKeyHandler&&(N.EventHandler.remove(document,"keydown",this.delegateDomKeyHandler),this.delegateDomKeyHandler=null),this.isMenu)||this.target||this.delegateScrollHandler&&(N.EventHandler.remove(document,"scroll",this.delegateScrollHandler),this.delegateScrollHandler=null),this.delegateClickHandler&&(N.EventHandler.remove(document,"click",this.delegateClickHandler),this.delegateClickHandler=null),this.unWireKeyboardEvent(t),this.rippleFn(),!this.isMenu&&this.enableScrolling&&(t.removeEventListener("touchstart",this.touchStartFn),t.removeEventListener("touchmove",this.touchMoveFn),this.delegateTouchOutsideHandler)&&(document.removeEventListener("touchstart",this.delegateTouchOutsideHandler),this.delegateTouchOutsideHandler=null)},s.prototype.unWireKeyboardEvent=function(e){e=N.getInstance(e,N.KeyboardEvents);e&&e.destroy()},s.prototype.toggleAnimation=function(e,t){var i,s,n=this,r=(void 0===t&&(t=!0),this.getWrapper()),r=(r&&r.querySelectorAll(".e-menu-parent").forEach(function(e){N.Animation.stop(e)}),this.enableScrolling&&!this.isMenu&&N.closest(e,".e-menu-vscroll")?N.closest(e,".e-menu-vscroll"):e);N.Animation.stop(r),"None"!==this.animationSettings.effect&&t?(r.style.maxHeight="",this.animation.animate(r,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){n.hamburgerMode?(s=e.element.parentElement,e.element.style.position="absolute",s&&(i=s.offsetHeight),e.element.style.maxHeight=e.element.offsetHeight+"px",s&&(s.style.maxHeight="")):(e.element.style.display="block",e.element.style.maxHeight=e.element.getBoundingClientRect().height+"px")},progress:function(e){n.hamburgerMode&&s&&(s.style.minHeight=i+e.element.offsetHeight+"px")},end:function(e){n.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",s&&(s.style.minHeight=""),e.element.style.top="0px",e.element.children[0].focus(),n.triggerOpen(e.element.children[0])):n.end(e.element,t),n.isKBDAction=!1}})):(this.hamburgerMode&&e&&(e.style.top="0px"),this.isAnimationNone="None"===this.animationSettings.effect,this.end(e,t))},s.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,t={element:e,parentItem:t,items:(t||this).items};this.trigger("onOpen",t),this.isMenu||N.EventHandler.add(e,"keydown",this.keyHandler,this)},s.prototype.end=function(e,t){var i;t&&this.isContextMenuClosed?((this.isMenu||!N.Browser.isDevice||!this.isMenu&&this.isAnimationNone&&N.Browser.isDevice)&&(e.style.display="block"),e.style.maxHeight="",(i=this.enableScrolling&&!this.isMenu?N.closest(e,".e-menu-vscroll"):null)&&(i.style.display="block"),this.triggerOpen(e),e.querySelector("."+g)&&this.isKBDAction?e.querySelector("."+g).focus():(t=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1],this.currentTarget&&(this.currentTarget.classList.contains("e-numerictextbox")||this.currentTarget.classList.contains("e-textbox")||"INPUT"===this.currentTarget.tagName)||(t&&this.isKBDAction?t.querySelector("."+v):this.element).focus())):((i=this.enableScrolling&&!this.isMenu?N.closest(e,".e-menu-vscroll"):null)&&be(N.getInstance(i,ge),i),e===this.element?((t=this.getLIByClass(this.element,g))&&t.classList.remove(g),(i=this.getLIByClass(this.element,v))&&i.classList.remove(v),e.style.display="none",this.isAnimationNone=!1):N.detach(e))},s.prototype.getAppendToElement=function(){if(this.isAngular){var e=this.element.closest(".cdk-overlay-pane"),t=this.element.closest("[popover]");if(e&&t)return e}return document.body},s.prototype.getPersistData=function(){return""},s.prototype.getWrapper=function(){return N.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},s.prototype.getIndex=function(e,t,i,s,n,r){void 0===s&&(s=[]),void 0===r&&(r=0),r=(n=void 0===n?!1:n)?r+1:0;for(var l=0,o=(i=void 0===i?this.items:i).length;l<o;l++){var a=i[l],d=t?a[this.getField("itemId",r)]:a[this.getField("text",r)];if((a.htmlAttributes&&"id"in a.htmlAttributes?a.htmlAttributes.id:d)===e){s.push(l);break}if(a[this.getField("children",r)]&&a[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,a[this.getField("children",r)],s,!0,r))[s.length-1]){s.unshift(l);break}l!==o-1&&s.pop()}else l===o-1&&s.push(-1)}return n||-1!==s[0]?s:[]},s.prototype.enableItems=function(e,t,i){void 0===t&&(t=!0);for(var s,n=He,r=0;r<e.length;r++){if(s=this.getIndex(e[r],i),this.navIdx.length){if(1!==s.length){for(var l=!1,o=0,a=s.length-1;o<a;o++)if(s[o]!==this.navIdx[o]){l=!0;break}if(l)continue}}else if(1!==s.length)continue;var d,h=s.pop();(d=this.getUlByNavIdx(s.length))&&!N.isNullOrUndefined(h)&&(t?this.isMenu?(d.children[h].classList.remove(n),d.children[h].removeAttribute("aria-disabled")):(N.Browser.isDevice&&!d.classList.contains("e-contextmenu")?d.children[h+1]:(this.enableScrolling&&!d.classList.contains("e-menu-parent")?d.querySelector(".e-menu-parent"):d).children[h]).classList.remove(n):this.isMenu?(d.children[h].classList.add(n),d.children[h].setAttribute("aria-disabled","true")):(N.Browser.isDevice&&!d.classList.contains("e-contextmenu")?d.children[h+1]:(this.enableScrolling&&!d.classList.contains("e-menu-parent")?d.querySelector(".e-menu-parent"):d).children[h]).classList.add(n))}},s.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},s.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},s.prototype.showHideItems=function(e,t,i){for(var s=0;s<e.length;s++){var n=(l=this.getIndex(e[s],i)).pop(),r=this.getUlByNavIdx(l.length),l=this.getItems(l);r&&(this.enableScrolling&&!r.classList.contains("e-menu-parent")&&(r=r.querySelector(".e-menu-parent")),l=i?r.children[n].id:l[n].text.toString(),t&&l===e[s]?r.children[n].classList.add(Ue):t||l!==e[s]||r.children[n].classList.remove(Ue))}},s.prototype.removeItems=function(e,t){for(var i,s,n,r=0;r<e.length;r++)i=(s=this.getIndex(e[r],t)).pop(),n=this.getItems(s),N.isNullOrUndefined(i)||this.removeItem(n,s,i)},s.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},s.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},s.prototype.insertItems=function(e,t,i,s){void 0===s&&(s=!0);for(var n=0;n<e.length;n++){r=(l=this.getIndex(t,i)).pop(),o=this.getItems(l),(a=new We(o[0],"items",e[n],!0)).parentObj=o[0].parentObj,o.splice(s?r+1:r,0,a);var r,l,o,a=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);!N.isNullOrUndefined(r)&&l.length<a.length&&(r=s?r+1:r,o=this.createItems(o).children[r],l=a=this.isMenu?N.select(".e-menu-parent",a[l.length]):a[l.length],(l=this.enableScrolling&&!l.classList.contains("e-menu-parent")?l.querySelector(".e-menu-parent"):l).insertBefore(o,l.children[r]),n!==e.length-1||this.isMenu||"block"!==l.style.display||(this.enableScrolling?(this.setPosition(null,l,parseFloat(a.style.top),parseFloat(a.style.left)),(o=N.closest(l,".e-vscroll"))&&(o.style.display="block")):(this.setPosition(null,l,parseFloat(l.style.top),parseFloat(l.style.left)),l.style.display="block")))}},s.prototype.removeAttributes=function(){var t=this;["top","left","display","z-index"].forEach(function(e){t.element.style.removeProperty(e)}),["role","tabindex","class","style"].forEach(function(e){"class"===e&&t.element.classList.contains("e-menu-parent")&&t.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(e)&&t.element.getAttribute(e)||t.element.removeAttribute(e),t.isMenu&&"class"===e&&t.element.classList.contains("e-vertical")&&t.element.classList.remove("e-vertical")})},s.prototype.destroy=function(){var e,t=this.getWrapper();t&&(this.unWireEvents(),this.delegateClickHandler=null,this.delegateMoverHandler=null,this.delegateMouseDownHandler=null,this.delegateDomKeyHandler=null,this.delegateScrollHandler=null,this.delegateTouchOutsideHandler=null,this.delegateParentScrollHandler=null,this.delegateContextMenuHandler&&(N.EventHandler.remove(this.targetElement,"contextmenu",this.delegateContextMenuHandler),this.delegateContextMenuHandler=null),this.isMenu?(this.closeMenu(),N.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),t.parentNode.insertBefore(this.element,t)):(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName?(N.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement):(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)&&((e=this.clonedElement.nextElementSibling)&&e!==t?this.clonedElement.parentElement.insertBefore(this.element,e):this.clonedElement.parentElement.appendChild(this.element),N.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",N.append([].slice.call(this.clonedElement.children),this.element),N.detach(this.clonedElement),this.removeAttributes()))),this.clonedElement=null,this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.currentTarget=null,this.targetElement=null,this.animation&&(this.animation.destroy(),this.animation=null),this.isMenu||this.isCmenuOpened||!this.element||(e=N.getValue("ej2_instances",this.element))&&Array.isArray(e)&&(e.length=0,N.setValue("ej2_instances",e,this.element)),N.detach(t),this.uList&&!document.body.contains(this.uList)&&(e=N.getValue("ej2_instances",this.uList))&&Array.isArray(e)&&(e.length=0,N.setValue("ej2_instances",e,this.uList)),Ye.prototype.destroy.call(this),this.template)&&this.clearTemplate(["template"]),this.rippleFn=null},e([N.Event()],s.prototype,"beforeItemRender",void 0),e([N.Event()],s.prototype,"beforeOpen",void 0),e([N.Event()],s.prototype,"onOpen",void 0),e([N.Event()],s.prototype,"beforeClose",void 0),e([N.Event()],s.prototype,"onClose",void 0),e([N.Event()],s.prototype,"select",void 0),e([N.Event()],s.prototype,"created",void 0),e([N.Property("")],s.prototype,"cssClass",void 0),e([N.Property(0)],s.prototype,"hoverDelay",void 0),e([N.Property(!1)],s.prototype,"showItemOnClick",void 0),e([N.Property("")],s.prototype,"target",void 0),e([N.Property("")],s.prototype,"filter",void 0),e([N.Property(null)],s.prototype,"template",void 0),e([N.Property(!1)],s.prototype,"enableScrolling",void 0),e([N.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),e([N.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},je)],s.prototype,"fields",void 0),e([N.Collection([],We)],s.prototype,"items",void 0),e([N.Complex({duration:400,easing:"ease",effect:"SlideDown"},Ke)],s.prototype,"animationSettings",void 0);var Ye,q=e([N.NotifyPropertyChanges],s);function s(e,t){e=Ye.call(this,e,t)||this;return e.navIdx=[],e.animation=new N.Animation({}),e.isTapHold=!1,e.tempItem=[],e.showSubMenuOn="Auto",e.isOpenCalled=!1,e.isAnimationNone=!1,e.isKBDAction=!1,e.skipNextArrowDown=!1,e.isCmenuOpened=!1,e}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)};var Ge,Qe,e=function(e,t){function i(){this.constructor=e}Ge(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Je="e-vertical",m="e-toolbar-items",y="e-toolbar-item",Ze="e-rtl",b="e-separator",$e="e-popup-up-icon",et="e-popup-down-icon",tt="e-popup-open",it="e-template",st="e-overlay",nt="e-toolbar-text",rt="e-popup-text",lt="e-overflow-show",ot="e-overflow-hide",at="e-hor-nav",dt="e-scroll-nav",ht="e-toolbar-center",ct="e-tbar-pos",pt="e-hscroll-bar",ut="e-toolbar-pop",mt="e-toolbar-popup",ft="e-nav-active",gt="e-ignore",vt="e-popup-alone",yt="e-hidden",bt="e-toolbar-multirow",Ct="e-multirow-pos",St="e-multirow-separator",It="e-extended-separator",xt="e-extended-toolbar",Et="e-toolbar-extended",Nt="e-tbar-extended",Ot=(Qe=N.ChildProperty,e(wt,Qe),n([N.Property("")],wt.prototype,"id",void 0),n([N.Property("")],wt.prototype,"text",void 0),n([N.Property("auto")],wt.prototype,"width",void 0),n([N.Property("")],wt.prototype,"cssClass",void 0),n([N.Property(!1)],wt.prototype,"showAlwaysInPopup",void 0),n([N.Property(!1)],wt.prototype,"disabled",void 0),n([N.Property("")],wt.prototype,"prefixIcon",void 0),n([N.Property("")],wt.prototype,"suffixIcon",void 0),n([N.Property(!0)],wt.prototype,"visible",void 0),n([N.Property("None")],wt.prototype,"overflow",void 0),n([N.Property("")],wt.prototype,"template",void 0),n([N.Property("Button")],wt.prototype,"type",void 0),n([N.Property("Both")],wt.prototype,"showTextOn",void 0),n([N.Property(null)],wt.prototype,"htmlAttributes",void 0),n([N.Property("")],wt.prototype,"tooltipText",void 0),n([N.Property("Left")],wt.prototype,"align",void 0),n([N.Event()],wt.prototype,"click",void 0),n([N.Property(-1)],wt.prototype,"tabIndex",void 0),wt);function wt(){return null!==Qe&&Qe.apply(this,arguments)||this}kt=N.Component,e(r,kt),r.prototype.destroy=function(){var t=this,e=((this.isReact||this.isAngular)&&this.clearTemplate(),this.element.querySelectorAll(".e-control.e-btn"));for([].slice.call(e).forEach(function(e){N.isNullOrUndefined(e)||N.isNullOrUndefined(e.ej2_instances)||N.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){N.isNullOrUndefined(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),N.detach(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&N.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","role"].forEach(function(e){return t.element.removeAttribute(e)}),kt.prototype.destroy.call(this)},r.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains(Je),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,Ze)},r.prototype.wireEvents=function(){N.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),window.addEventListener("orientationchange",this.orientationChangeContext),this.allowKeyboard&&this.wireKeyboardEvent()},r.prototype.wireKeyboardEvent=function(){this.keyModule=new N.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),N.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.updateTabIndex("0")},r.prototype.updateTabIndex=function(e){var t,i=this.element.querySelector("."+y+":not(."+st+" ):not(."+b+" ):not(."+yt+" )");N.isNullOrUndefined(i)||N.isNullOrUndefined(i.firstElementChild)||(t=i.firstElementChild.getAttribute("data-tabindex"))&&"-1"===t&&"INPUT"!==i.firstElementChild.tagName&&i.firstElementChild.setAttribute("tabindex",e)},r.prototype.unwireKeyboardEvent=function(){this.keyModule&&(N.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},r.prototype.docKeyDown=function(e){var t;"INPUT"!==e.target.tagName&&(t=!N.isNullOrUndefined(this.popObj)&&N.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode,9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&t&&this.popObj.hide({name:"FadeOut",duration:100}),40!==e.keyCode&&38!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||e.preventDefault())},r.prototype.unwireEvents=function(){N.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),window.removeEventListener("orientationchange",this.orientationChangeContext),document.removeEventListener("scroll",this.clickEvent),document.removeEventListener("click",this.scrollEvent),this.scrollEvent=null,this.clickEvent=null},r.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},r.prototype.docEvent=function(e){e=N.closest(e.target,".e-popup");this.popupTriggeredByToolbar?this.popupTriggeredByToolbar=!1:this.popObj&&N.isVisible(this.popObj.element)&&!e&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},r.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,ct),this.scrollModule.destroy(),this.scrollModule=null)},r.prototype.destroyItems=function(){var e,t=this;this.element&&[].slice.call(this.element.querySelectorAll("."+y)).forEach(function(e){N.EventHandler.remove(e,"click",t.itemClick),N.detach(e)}),this.tbarAlign&&((e=this.element.querySelector("."+m))&&(e.children&&[].slice.call(e.children).forEach(function(e){N.detach(e)}),this.remove(e,ct)),this.tbarAlign=!1),this.clearProperty()},r.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,Ze),this.destroyScroll()),this.remove(this.element,Nt),this.remove(this.element,xt);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,bt),this.popObj&&this.popupRefresh(this.popObj.element,!0)},r.prototype.add=function(e,t){e.classList.add(t)},r.prototype.remove=function(e,t){e.classList.remove(t)},r.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},r.prototype.clstElement=function(e,t){e=e&&this.popObj&&N.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+y):this.element===t||e?this.element.querySelector("."+y+":not(."+st+" ):not(."+b+" ):not(."+yt+" )"):N.closest(t,"."+y);return e},r.prototype.getNextFocusableItem=function(e,t){var i,s=Array.from(this.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-separator):not(.e-hidden)")),n=s.indexOf(e);if(n<0)return null;switch(t){case"moveRight":case"moveDown":case"tab":i=(n+1)%s.length;break;case"moveLeft":case"moveUp":i=(n-1+s.length)%s.length;break;case"home":i=0;break;case"end":i=s.length-1;break;default:i=n}return 0<=i&&i<s.length?s[parseInt(i.toString(),10)]:null},r.prototype.keyHandling=function(e,t,i,s,n){var r,l,o,a,d=this.popObj,h=this.element,c={name:"FadeOut",duration:100},p="moveUp"===t.action?"previous":"next";switch(t.action){case"moveRight":this.isVertical||(h===i?this.elementFocus(e):s||this.eleFocus(e,"next"));break;case"moveLeft":this.isVertical||s||this.eleFocus(e,"previous");break;case"home":case"end":e&&(l=N.closest(e,".e-popup"),r=this.element.querySelector("."+Et),(l="Extended"===this.overflowMode&&r&&r.classList.contains("e-popup-open")?"end"===t.action?r:null:l)?N.isVisible(this.popObj.element)&&(o=[].slice.call(l.children),a="home"===t.action?this.focusFirstVisibleEle(o):this.focusLastVisibleEle(o)):(o=this.element.querySelectorAll("."+m+" ."+y+":not(."+b+")"),a="home"===t.action?this.focusFirstVisibleEle(o):this.focusLastVisibleEle(o)),a)&&this.elementFocus(a);break;case"moveUp":case"moveDown":this.isVertical?"moveUp"===t.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next"):d&&N.closest(i,".e-popup")?(r=d.element,"previous"==p&&r.firstElementChild===e?(l=this.focusLastVisibleEle([].slice.call(r.children)))&&this.elementFocus(l):"next"==p&&r.lastElementChild===e?(o=this.focusFirstVisibleEle([].slice.call(r.children)))&&this.elementFocus(o):this.eleFocus(e,p)):"moveDown"===t.action&&d&&N.isVisible(d.element)&&(this.eleContains(e)?this.eleFocus(e,p):this.elementFocus(e));break;case"tab":n||s||(a=e.firstElementChild,h===i&&(this.activeEle||(this.activeEleRemove(a),a)).focus());break;case"popupClose":d&&"Extended"!==this.overflowMode&&d.hide(c);break;case"popupOpen":s&&(d&&!N.isVisible(d.element)?(d.element.style.top=h.offsetHeight+"px",d.show({name:"FadeIn",duration:100})):d.hide(c))}},r.prototype.keyActionHandler=function(t){var i,s,n,e,r,l=this,o=t.target;("home"!==t.action&&"end"!==t.action&&"moveRight"!==t.action&&"moveLeft"!==t.action&&"moveUp"!==t.action&&"moveDown"!==t.action||"INPUT"!==o.tagName&&"TEXTAREA"!==o.tagName&&!this.element.classList.contains(st))&&(t.preventDefault(),i=o.classList.contains(at),s=o.classList.contains(dt),(n=this.clstElement(i,o))||s)&&(r=this.getNextFocusableItem(e=n,t.action),this.trigger("keyDown",{originalEvent:t,currentItem:e,nextItem:r,cancel:!1},function(e){e.cancel||l.keyHandling(n,t,o,i,s)}))},r.prototype.disable=function(e){var t=this.element;e?t.classList.add(st):t.classList.remove(st),this.activeEle&&this.activeEle.setAttribute("tabindex",this.activeEle.getAttribute("data-tabindex")),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(N.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),t.querySelector("#"+t.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},r.prototype.eleContains=function(e){return e.classList.contains(b)||e.classList.contains(st)||e.getAttribute("disabled")||e.classList.contains(yt)||!N.isVisible(e)||!e.classList.contains(y)},r.prototype.focusFirstVisibleEle=function(e){for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(b)&&!i.classList.contains(yt)&&!i.classList.contains(st))return i;t++}},r.prototype.focusLastVisibleEle=function(e){for(var t=e.length-1;0<=t;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(b)&&!i.classList.contains(yt)&&!i.classList.contains(st))return i;t--}},r.prototype.eleFocus=function(e,t){var i,s=Object(e)[t+"ElementSibling"];s?this.eleContains(s)?this.eleFocus(s,t):this.elementFocus(s):this.tbarAlign?(s=Object(e.parentElement)[t+"ElementSibling"],N.isNullOrUndefined(s)||0!==s.children.length||(s=Object(s)[t+"ElementSibling"]),!N.isNullOrUndefined(s)&&0<s.children.length&&("next"===t?(i=s.querySelector("."+y),this.eleContains(i)?this.eleFocus(i,t):(i.firstElementChild.focus(),this.activeEleSwitch(i))):(i=s.lastElementChild,this.eleContains(i)?this.eleFocus(i,t):this.elementFocus(i)))):N.isNullOrUndefined(e)||(s=this.element.querySelectorAll("."+m+" ."+y+":not(."+b+"):not(."+st+"):not(."+yt+")"),"next"===t&&s?this.elementFocus(s[0]):"previous"===t&&s&&this.elementFocus(s[s.length-1]))},r.prototype.clickHandler=function(e){var t,i=this,s=e.target,n=this.element,r=!N.isNullOrUndefined(N.closest(s,"."+ut)),l=s.classList,o=N.closest(s,"."+at),s=((N.closest(s,"."+et)||o)&&(this.popupTriggeredByToolbar=!0),o=o||s,((l=n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!l.contains(at)?l:s.querySelector(".e-icons").classList).contains($e)||l.contains(et))&&this.popupClickHandler(n,o,Ze),N.closest(e.target,"."+y));(N.isNullOrUndefined(s)||s.classList.contains(st))&&!o.classList.contains(at)||(l={originalEvent:e,item:t=s?this.items[this.tbarEle.indexOf(s)]:t},(t&&!N.isNullOrUndefined(t.click)&&"object"==typeof t.click?!N.isNullOrUndefined(t.click.observers)&&0<t.click.observers.length:!N.isNullOrUndefined(t)&&!N.isNullOrUndefined(t.click))&&this.trigger("items["+this.tbarEle.indexOf(s)+"].click",l),l.cancel)||this.trigger("clicked",l,function(e){!N.isNullOrUndefined(i.popObj)&&r&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})},r.prototype.popupClickHandler=function(e,t,i){var s=this.popObj;N.isVisible(s.element)?(t.classList.remove(ft),s.hide({name:"FadeOut",duration:100})):(e.classList.contains(i)&&(s.enableRtl=!0,s.position={X:"left",Y:"top"}),0!==s.offsetX||e.classList.contains(i)||(s.enableRtl=!1,s.position={X:"right",Y:"top"}),"Extended"===this.overflowMode&&(s.element.style.minHeight="0px",s.width=this.getToolbarPopupWidth(this.element)),s.dataBind(),s.refreshPosition(),s.element.style.top=this.getElementOffsetY()+"px",t.classList.add(ft),s.show({name:"FadeIn",duration:100}))},r.prototype.getToolbarPopupWidth=function(e){e=window.getComputedStyle(e);return parseFloat(e.width)+2*parseFloat(e.borderRightWidth)},r.prototype.render=function(){var e=this;this.initialize(),this.clickEvent=this.docEvent.bind(this),this.scrollEvent=this.docEvent.bind(this),this.renderControl(),this.wireEvents(),this.renderComplete(),this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow()})},r.prototype.initialize=function(){var e=N.formatUnit(this.width),t=N.formatUnit(this.height),t=("msie"===N.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||N.setStyleAttribute(this.element,{height:t}),N.setStyleAttribute(this.element,{width:e}),{role:"toolbar","aria-disabled":"false","aria-orientation":this.isVertical?"vertical":"horizontal"});N.attributes(this.element,t),this.cssClass&&N.addClass([this.element],this.cssClass.split(" "))},r.prototype.renderControl=function(){var e=this.element;this.trgtEle=0<e.children.length?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},r.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&1<this.popObj.element.childElementCount&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},r.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[parseInt(n.toString(),10)],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[parseInt(n.toString(),10)],t,n),((s=t.querySelector(".e-toolbar-"+e[parseInt(n.toString(),10)].align.toLowerCase()))?(e[parseInt(n.toString(),10)].showAlwaysInPopup&&"Show"!==e[parseInt(n.toString(),10)].overflow||this.tbarAlgEle[(e[parseInt(n.toString(),10)].align+"s").toLowerCase()].push(i),s):t).appendChild(i);this.isReact&&(this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates())},r.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(Je),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(Je),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),N.setStyleAttribute(this.element,{height:N.formatUnit(this.height),width:N.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},r.prototype.initScroll=function(e,t){!this.scrollModule&&this.checkOverflow(e,t[0])&&(this.tbarAlign&&this.element.querySelector("."+m+" ."+ht).removeAttribute("style"),this.isVertical?this.scrollModule=new ge({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]):this.scrollModule=new te({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]),this.cssClass&&N.addClass([t[0]],this.cssClass.split(" ")),(e=this.scrollModule.element.querySelector("."+pt+", .e-vscroll-bar"))&&e.removeAttribute("tabindex"),this.remove(this.scrollModule.element,ct),N.setStyleAttribute(this.element,{overflow:"hidden"}))},r.prototype.itemWidthCal=function(e){var t,i=this,s=0;return[].slice.call(N.selectAll("."+y,e)).forEach(function(e){N.isVisible(e)&&(t=window.getComputedStyle(e),s=(s=(s+=i.isVertical?e.offsetHeight:e.offsetWidth)+parseFloat(i.isVertical?t.marginTop:t.marginRight))+parseFloat(i.isVertical?t.marginBottom:t.marginLeft))}),s},r.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},r.prototype.checkOverflow=function(e,t){var i,s,n;return!(N.isNullOrUndefined(e)||N.isNullOrUndefined(t)||!N.isVisible(e)||(i=this.isVertical?e.offsetHeight:e.offsetWidth,s=this.isVertical?t.offsetHeight:t.offsetWidth,(this.tbarAlign||this.scrollModule||i===s)&&(s=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(t):t)),t=e.querySelector("."+at),e=e.querySelector("."+dt),n=0,t?n=this.isVertical?t.offsetHeight:t.offsetWidth:e&&(n=this.isVertical?2*e.offsetHeight:2*e.offsetWidth),s<=i&&e))&&i-n<s},r.prototype.refreshOverflow=function(){this.resize()},r.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,ct),this.itemPositioning())},r.prototype.renderOverflowMode=function(){var e=this.element,t=e.querySelector("."+m),i=0<this.popupPriCount;if(e&&0<e.children.length)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===N.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":N.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(m)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,t)||i)&&this.setOverflowAttributes(e),this.toolbarAlign(t);break;case"MultiRow":this.add(t,bt),this.checkOverflow(e,t)&&this.tbarAlign&&(this.removePositioning(),this.add(t,Ct)),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==N.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,xt),(this.checkOverflow(e,t)||i)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(t)}},r.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(N.selectAll("."+m+" ."+y,e)));N.attributes(this.element.querySelector("."+at),{tabindex:"0",role:"button","aria-haspopup":"true","aria-label":"overflow"})},r.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+b)),i=e.querySelector("."+St),e=e.querySelector("."+It),i="MultiRow"===this.overflowMode?i:e;null!==i&&("MultiRow"===this.overflowMode?i.classList.remove(St):"Extended"===this.overflowMode&&i.classList.remove(It));for(var s=0;s<=t.length-1;s++)t[parseInt(s.toString(),10)].offsetLeft<30&&0!==t[parseInt(s.toString(),10)].offsetLeft&&("MultiRow"===this.overflowMode?t[parseInt(s.toString(),10)].classList.add(St):"Extended"===this.overflowMode&&t[parseInt(s.toString(),10)].classList.add(It))},r.prototype.createPopupEle=function(e,t){var i=e.querySelector("."+at),s=this.isVertical,i=(i||this.createPopupIcon(e),i=e.querySelector("."+at),s?i.offsetHeight:i.offsetWidth),s=(s?e.offsetHeight:e.offsetWidth)-i;this.element.classList.remove("e-rtl"),N.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,t,s,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},r.prototype.pushingPoppedEle=function(i,s,n,r,l){for(var o,e=i.element,t=[].slice.call(N.selectAll("."+mt,e.querySelector("."+m))),a=(N.selectAll("."+lt,n),0),d=0,h=(t.forEach(function(e,t){o=N.selectAll("."+lt,n),e.classList.contains(lt)&&0<o.length?(i.tbResize&&o.length>t?n.insertBefore(e,o[parseInt(t.toString(),10)]):n.insertBefore(e,n.children[o.length]),++d):e.classList.contains(lt)||i.tbResize&&e.classList.contains(ot)&&0<n.children.length&&0===o.length?(n.insertBefore(e,n.firstChild),++d):e.classList.contains(ot)?s.push(e):i.tbResize?(n.insertBefore(e,n.childNodes[a+d]),++a):(t=Array.prototype.slice.call(n.children).slice(t).find(function(e){return!e.classList.contains(vt)}),n.insertBefore(e,t||null)),e.classList.contains(b)?N.setStyleAttribute(e,{display:"",height:l+"px"}):N.setStyleAttribute(e,{display:"",height:r+"px"})}),s.forEach(function(e){n.appendChild(e)}),N.selectAll("."+y,e.querySelector("."+m))),c=h.length-1;0<=c;c--){var p=h[parseInt(c.toString(),10)];if(!p.classList.contains(b)||"Extended"===this.overflowMode)break;N.setStyleAttribute(p,{display:"none"})}},r.prototype.createPopup=function(){var e,t,i,s=this.element,n=("Extended"===this.overflowMode&&(e=s.querySelector("."+b),e="auto"===s.style.height||""===s.style.height?null:e&&e.offsetHeight),s.querySelector("."+y+":not(."+b+"):not(."+mt+")")),n="auto"===s.style.height||""===s.style.height?null:n&&n.offsetHeight;i=N.select("#"+s.id+"_popup."+ut,s)?N.select("#"+s.id+"_popup."+ut,s):(i=this.createElement("div",{id:s.id+"_popup",className:ut+" "+Et}),t=this.createElement("div",{id:s.id+"_popup",className:ut}),"Extended"===this.overflowMode?i:t),this.pushingPoppedEle(this,[],i,n,e),this.popupInit(s,i)},r.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},r.prototype.popupInit=function(e,t){var i;this.popObj?"Extended"!==this.overflowMode&&(i=this.popObj.element,N.setStyleAttribute(i,{maxHeight:"",display:"block"}),N.setStyleAttribute(i,{maxHeight:i.offsetHeight+"px",display:""})):(e.appendChild(t),this.cssClass&&N.addClass([t],this.cssClass.split(" ")),N.setStyleAttribute(this.element,{overflow:""}),i=new U.Popup(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}}),"Extended"===this.overflowMode&&(i.width=this.getToolbarPopupWidth(this.element),i.offsetX=0),i.appendTo(t),document.addEventListener("scroll",this.clickEvent),document.addEventListener("click",this.scrollEvent),"Extended"!==this.overflowMode&&(i.element.style.maxHeight=i.element.offsetHeight+"px"),this.isVertical&&(i.element.style.visibility="hidden"),this.isExtendedOpen?((e=this.element.querySelector("."+at)).classList.add(ft),N.classList(e.firstElementChild,[$e],[et]),this.element.querySelector("."+Et).classList.add(tt)):i.hide(),this.popObj=i)},r.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,Nt):this.remove(this.element,Nt))},r.prototype.popupOpen=function(e){var t=this.popObj,i=(this.isVertical||(t.offsetY=this.getElementOffsetY(),t.dataBind()),this.popObj.element),s=this.popObj.element.parentElement,n=s.querySelector("."+at),r=(n.setAttribute("aria-expanded","true"),"Extended"===this.overflowMode?t.element.style.minHeight="":(N.setStyleAttribute(t.element,{height:"auto",maxHeight:""}),t.element.style.maxHeight=t.element.offsetHeight+"px"),i.offsetTop+i.offsetHeight+U.calculatePosition(s).top),l=n.firstElementChild,n=(n.classList.add(ft),N.classList(l,[$e],[et]),this.tbarPopupHandler(!0),N.isNullOrUndefined(window.scrollY)?0:window.scrollY);if(!this.isVertical&&window.innerHeight+n<r&&this.element.offsetTop<i.offsetHeight){var o=i.offsetHeight-(r-window.innerHeight-n+5);t.height=o+"px";for(var a=0;a<=i.childElementCount;a++){var d=i.children[parseInt(a.toString(),10)];if(d.offsetTop+d.offsetHeight>o){o=d.offsetTop;break}}"Extended"!==this.overflowMode&&N.setStyleAttribute(t.element,{maxHeight:o+"px"})}else this.isVertical&&"Extended"!==this.overflowMode&&(l=this.element.getBoundingClientRect(),N.setStyleAttribute(t.element,{maxHeight:l.top+this.element.offsetHeight+"px",bottom:0,visibility:""}));t&&((r=i.getBoundingClientRect()).right>document.documentElement.clientWidth&&r.width>s.getBoundingClientRect().width&&(t.collision={Y:"none"},t.dataBind()),t.refreshPosition())},r.prototype.popupClose=function(e){var t=this.element.querySelector("."+at),i=(t.setAttribute("aria-expanded","false"),t.firstElementChild);t.classList.remove(ft),N.classList(i,[et],[$e]),this.tbarPopupHandler(!1)},r.prototype.checkPriority=function(e,t,i,s){for(var n,r,l=0<this.popupPriCount,o=i,a=0,d=0,h=0,c=function(t,e){var i=!1;return e.forEach(function(e){t.classList.contains(e)&&(i=!0)}),i},p=t.length-1;0<=p;p--){var u,m=void 0,f=window.getComputedStyle(t[parseInt(p.toString(),10)]),f=(this.isVertical?(m=parseFloat(f.marginTop),m+=parseFloat(f.marginBottom)):(m=parseFloat(f.marginRight),m+=parseFloat(f.marginLeft)),t[parseInt(p.toString(),10)]===this.tbarEle[0]),f=(f&&(this.tbarEleMrgn=m),n=this.isVertical?t[parseInt(p.toString(),10)].offsetHeight:t[parseInt(p.toString(),10)].offsetWidth,f?n+m:n);c(t[parseInt(p.toString(),10)],[vt])&&l&&(t[parseInt(p.toString(),10)].classList.add(mt),this.isVertical?N.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minHeight:f+"px"}):N.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minWidth:f+"px"}),h++),(this.isVertical?t[parseInt(p.toString(),10)].offsetTop+t[parseInt(p.toString(),10)].offsetHeight+m>i:t[parseInt(p.toString(),10)].offsetLeft+t[parseInt(p.toString(),10)].offsetWidth+m>i)&&(t[parseInt(p.toString(),10)].classList.contains(b)?"Extended"===this.overflowMode?(c(u=t[parseInt(p.toString(),10)],[b,gt])&&(t[parseInt(p.toString(),10)].classList.add(mt),h++),d++):"Popup"===this.overflowMode&&(0<a&&d===h&&c(u=t[p+d+(a-1)],[b,gt])&&N.setStyleAttribute(u,{display:"none"}),a++,h=d=0):d++,t[parseInt(p.toString(),10)].classList.contains(lt)&&s||c(t[parseInt(p.toString(),10)],[b,gt])?i-=(this.isVertical?t[parseInt(p.toString(),10)].offsetHeight:t[parseInt(p.toString(),10)].offsetWidth)+m:(t[parseInt(p.toString(),10)].classList.add(mt),this.isVertical?N.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minHeight:f+"px"}):N.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minWidth:f+"px"}),h++))}s&&(r=N.selectAll("."+y+":not(."+mt+")",this.element),this.checkPriority(e,r,o,!1))},r.prototype.createPopupIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-hor-nav"),i="Extended"===this.overflowMode?i+" e-expended-nav":i,t=this.createElement("div",{id:t,className:i}),i=("msie"!==N.Browser.info.name&&"edge"!==N.Browser.info.name||t.classList.add("e-ie-align"),this.createElement("div",{className:et+" e-icons"}));t.appendChild(i),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),e.appendChild(t)},r.prototype.tbarPriRef=function(e,t,i,s,n,r,l,o,a){function d(e,t){return e.classList.contains(t)}var h,c,p,u=this.popObj.element,u=N.selectAll("."+mt+":not(."+lt+")",u).length;0===N.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length?(h=e.children[t-(t-i)-1],c=!N.isNullOrUndefined(h)&&d(h,gt),!N.isNullOrUndefined(h)&&d(h,b)&&!N.isVisible(h)||c?(h.style.display="unset",c=h.offsetWidth+2*parseFloat(window.getComputedStyle(h).marginRight),p=h.previousElementSibling,r+c<l||n?(e.insertBefore(s,e.children[t+o-(t-i)]),N.isNullOrUndefined(p)||(p.style.display="")):(N.setStyleAttribute(s,a),p.classList.contains(b)&&(p.style.display="none")),h.style.display=""):e.insertBefore(s,e.children[t+o-(t-i)])):e.insertBefore(s,e.children[t+o-u])},r.prototype.popupRefresh=function(e,t){var i,s=this,n=this.element,r=this.isVertical,l=n.querySelector("."+m),o=n.querySelector("."+at);N.isNullOrUndefined(o)||(l.removeAttribute("style"),e.style.display="block",n=r?n.offsetHeight-(o.offsetHeight+l.offsetHeight):n.offsetWidth-(o.offsetWidth+l.offsetWidth),i=0,[].slice.call(e.children).forEach(function(e){i+=s.popupEleWidth(e),N.setStyleAttribute(e,{position:""})}),n+(r?o.offsetHeight:o.offsetWidth)>i&&0===this.popupPriCount&&(t=!0),this.popupEleRefresh(n,e,t),e.style.display="",0===e.children.length&&o&&this.popObj&&(N.detach(o),this.popObj.destroy(),N.detach(this.popObj.element),this.popObj=null))},r.prototype.ignoreEleFetch=function(t,i){var e=[].slice.call(i.querySelectorAll("."+gt)),s=[],n=0;return 0<e.length?(e.forEach(function(e){s.push([].slice.call(i.children).indexOf(e))}),s.forEach(function(e){e<=t&&n++}),n):0},r.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild),s=(t.firstElementChild.style.removeProperty("Position"),e.offsetWidth-e.querySelector("."+at).offsetWidth),e=e.querySelector("."+m).offsetWidth;return t.style.removeProperty("display"),i+e<s},r.prototype.popupEleWidth=function(e){e.style.position="absolute";var t,i=window.getComputedStyle(e),i=this.isVertical?e.offsetHeight:e.offsetWidth+parseFloat(i.marginLeft)+parseFloat(i.marginRight),s=e.querySelector(".e-tbar-btn-text");return(e.classList.contains("e-tbtn-align")||e.classList.contains(rt))&&(t=e.children[0],!N.isNullOrUndefined(s)&&e.classList.contains(rt)?s.style.display="none":!N.isNullOrUndefined(s)&&e.classList.contains(nt)&&(s.style.display="block"),t.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),t.style.minWidth="",t.style.minHeight="",N.isNullOrUndefined(s)||(s.style.display="")),i},r.prototype.popupEleRefresh=function(r,e,l){for(var o,a,d=0<this.popupPriCount,h=this.tbarEle,c=this.element.querySelector("."+m),p=0,u=this,t=0,i=[].slice.call(e.children);t<i.length&&"break"!==function(e){var t,i,s,n;return e.classList.contains(vt)&&d&&!l?"continue":(t=u.popupEleWidth(e),e===u.tbarEle[0]&&(t+=u.tbarEleMrgn),e.style.position="",t<r||l?(i={minWidth:e.style.minWidth,height:e.style.height,minHeight:e.style.minHeight},N.setStyleAttribute(e,{minWidth:"",height:"",minHeight:""}),e.classList.contains(ot)||e.classList.remove(mt),a=u.tbarEle.indexOf(e),u.tbarAlign&&(s=u.items[parseInt(a.toString(),10)].align,a=u.tbarAlgEle[(s+"s").toLowerCase()].indexOf(e),h=u.tbarAlgEle[(s+"s").toLowerCase()],c=u.element.querySelector("."+m+" .e-toolbar-"+s.toLowerCase())),n=0,"Extended"!==u.overflowMode&&h.slice(0,a).forEach(function(e){(e.classList.contains(lt)||e.classList.contains(b))&&(e.classList.contains(b)&&(e.style.display="",r-=e.offsetWidth),n++)}),p=u.ignoreEleFetch(a,c),e.classList.contains(lt)?u.tbarPriRef(c,a,n,e,l,t,r,p,i):0===a?c.insertBefore(e,c.firstChild):(o=N.selectAll("."+lt,u.popObj.element).length,c.insertBefore(e,c.children[a+p-o])),r-=e.offsetWidth,void(e.style.height="")):"break")}(i[t]);t++);this.checkOverflow(this.element,this.element.getElementsByClassName(m)[0])&&!l&&this.renderOverflowMode()},r.prototype.removePositioning=function(){var e=this.element.querySelector("."+m);!N.isNullOrUndefined(e)&&e.classList.contains(ct)&&(this.remove(e,ct),(e=[].slice.call(e.childNodes))[1].removeAttribute("style"),e[2].removeAttribute("style"))},r.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+m);this.add(e,ct),this.itemPositioning()},r.prototype.itemPositioning=function(){var e,t,i,s=this.element.querySelector("."+m);N.isNullOrUndefined(s)||!s.classList.contains(ct)||(t=this.element.querySelector("."+at),e=this.scrollModule?(e=this.isVertical?"e-vscroll-content":"e-hscroll-content",[].slice.call(s.querySelector("."+e).children)):[].slice.call(s.childNodes),s=this.isVertical?e[0].offsetHeight+e[2].offsetHeight:e[0].offsetWidth+e[2].offsetWidth,i=this.isVertical?this.element.offsetHeight:this.element.offsetWidth,t&&(i-=this.isVertical?t.offsetHeight:t.offsetWidth,t=(this.isVertical?t.offsetHeight:t.offsetWidth)+"px",e[2].removeAttribute("style"),this.isVertical?this.enableRtl?e[2].style.top=t:e[2].style.bottom=t:this.enableRtl?e[2].style.left=t:e[2].style.right=t),i<=s)||(t=(i-s-(this.isVertical?e[1].offsetHeight:e[1].offsetWidth))/2,e[1].removeAttribute("style"),i=(this.isVertical?e[0].offsetHeight:e[0].offsetWidth)+t+"px",this.isVertical?this.enableRtl?e[1].style.marginBottom=i:e[1].style.marginTop=i:this.enableRtl?e[1].style.marginRight=i:e[1].style.marginLeft=i)},r.prototype.tbarItemAlign=function(e,t,i){var s,n,r=this;e.showAlwaysInPopup&&"Show"!==e.overflow||((s=[]).push(this.createElement("div",{className:"e-toolbar-left",attrs:{role:"group"}})),s.push(this.createElement("div",{className:ht,attrs:{role:"group"}})),s.push(this.createElement("div",{className:"e-toolbar-right",attrs:{role:"group"}})),0===i&&"Left"!==e.align?(s.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,ct)):"Left"!==e.align&&(i=t.childNodes,n=s[0],[].slice.call(i).forEach(function(e){r.tbarAlgEle.lefts.push(e),n.appendChild(e)}),t.appendChild(n),t.appendChild(s[1]),t.appendChild(s[2]),this.tbarAlign=!0,this.add(t,ct)))},r.prototype.ctrlTemplate=function(){var t=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,m),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach(function(e){"DIV"===e.tagName&&(t.tbarEle.push(e),N.isNullOrUndefined(e.firstElementChild)||e.firstElementChild.setAttribute("aria-disabled","false"),t.add(e,y))})},r.prototype.renderItems=function(){var e,t=this.element,i=this.items;null!=this.trgtEle?this.ctrlTemplate():t&&0<i.length&&(e=void 0,e=(e=t&&0<t.children.length?t.querySelector("."+m):e)||this.createElement("div",{className:m}),this.itemsAlign(i,e),t.appendChild(e))},r.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[parseInt(n.toString(),10)])?this.add(t,e[""+i]):t.setAttribute(i,e[""+i])},r.prototype.enableItems=function(e,t){function i(e,t){e?(t.classList.remove(st),N.isNullOrUndefined(t.firstElementChild)||(t.firstElementChild.setAttribute("aria-disabled","false"),n.updateTabIndex("0"))):(t.classList.add(st),N.isNullOrUndefined(t.firstElementChild)||(t.firstElementChild.setAttribute("aria-disabled","true"),t.firstElementChild.setAttribute("tabindex","-1"),n.updateTabIndex("0")))}var s,n=this,r=e,l=r.length;N.isNullOrUndefined(t)&&(t=!0);if(!N.isNullOrUndefined(l)&&1<=l){for(var o=0,a=[].slice.call(r);o<l;o++){var d=a[parseInt(o.toString(),10)];if("number"==typeof d){if(s=this.getElementByIndex(d),N.isNullOrUndefined(s))return;r[parseInt(o.toString(),10)]=s}else s=d;i(t,s)}t?N.removeClass(r,st):N.addClass(r,st)}else{if("number"==typeof r){if(s=this.getElementByIndex(r),N.isNullOrUndefined(s))return}else s=e;i(t,s)}},r.prototype.getElementByIndex=function(e){return this.tbarEle[parseInt(e.toString(),10)]?this.tbarEle[parseInt(e.toString(),10)]:null},r.prototype.addItems=function(e,t){this.extendedOpen();var i,s=this.element.querySelector("."+m);if(N.isNullOrUndefined(s))this.itemsRerender(e);else{var n,r="Left";N.isNullOrUndefined(t)&&(t=0),e.forEach(function(e){N.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==r||(r=e.align)});for(var l=0,o=e;l<o.length;l++){var a,d,h=o[l];N.isNullOrUndefined(h.type)&&(h.type="Button"),i=N.selectAll("."+y,this.element),h.align=r,n=this.renderSubComponent(h,t),this.tbarEle.length>=t&&0<=i.length&&(N.isNullOrUndefined(this.scrollModule)&&this.destroyMode(),a="L"===h.align[0]?0:"C"===h.align[0]?1:2,d=void 0,this.tbarAlign||"Left"===r?this.tbarAlign?((d=N.closest(i[0],"."+m).children[parseInt(a.toString(),10)]).insertBefore(n,d.children[parseInt(t.toString(),10)]),this.tbarAlgEle[(h.align+"s").toLowerCase()].splice(t,0,n),this.refreshPositioning()):0===i.length?(i=N.selectAll("."+m,this.element))[0].appendChild(n):i[0].parentNode.insertBefore(n,i[parseInt(t.toString(),10)]):(this.tbarItemAlign(h,s,1),this.tbarAlign=!0,(d=N.closest(i[0],"."+m).children[parseInt(a.toString(),10)]).appendChild(n),this.tbarAlgEle[(h.align+"s").toLowerCase()].push(n),this.refreshPositioning()),this.items.splice(t,0,h),h.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(t,0,n),t++,this.offsetWid=s.offsetWidth)}s.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},r.prototype.removeItems=function(e){var t=e,i=[].slice.call(N.selectAll("."+y,this.element));if("number"==typeof t)l=parseInt(e.toString(),10),this.removeItemByIndex(l,i);else if(t&&1<t.length)for(var s=0,n=[].slice.call(t);s<n.length;s++){var r=n[s],l=this.tbarEle.indexOf(r);this.removeItemByIndex(l,i),i=N.selectAll("."+y,this.element)}else{r=t&&t.length&&1===t.length?t[0]:e;l=i.indexOf(r),this.removeItemByIndex(l,i)}this.resize()},r.prototype.removeItemByIndex=function(e,t){var i,s;this.tbarEle[parseInt(e.toString(),10)]&&t[parseInt(e.toString(),10)]&&(i=this.tbarEle.indexOf(t[parseInt(e.toString(),10)]),this.tbarAlign&&(s=this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].indexOf(this.tbarEle[parseInt(i.toString(),10)]),this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].splice(parseInt(s.toString(),10),1)),this.isReact&&this.clearToolbarTemplate(t[parseInt(e.toString(),10)]),s=t[parseInt(e.toString(),10)].querySelector(".e-control.e-btn"),N.isNullOrUndefined(s)||N.isNullOrUndefined(s.ej2_instances[0])||s.ej2_instances[0].isDestroyed||s.ej2_instances[0].destroy(),N.EventHandler.remove(t[parseInt(e.toString(),10)],"click",this.itemClick),N.detach(t[parseInt(e.toString(),10)]),this.items.splice(i,1),this.tbarEle.splice(i,1))},r.prototype.templateRender=function(e,t,i,s){var n=i.type,r=e;if("object"==typeof e&&(a="function"==typeof r.appendTo),"string"!=typeof e&&a)"Input"===n&&(l=this.createElement("input"),i.id?l.id=i.id:l.id=N.getUniqueID("tbr-ipt"),t.appendChild(l),r.appendTo(l));else{var l,o,a=void 0,n=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i),i="string"==typeof e?e.trim():e;try{"object"!=typeof e||N.isNullOrUndefined(e.tagName)?"string"==typeof e&&n.test(i)?t.innerHTML=i:document.querySelectorAll(i).length?(o=(l=document.querySelector(i)).outerHTML.trim(),t.appendChild(l),l.style.display="",N.isNullOrUndefined(o)||this.tempId.push(i)):a=N.compile(i):t.appendChild(e)}catch(e){a=N.compile(i)}r=void 0;N.isNullOrUndefined(a)||(r=a({},this,"template",this.element.id+s+"_template",this.isStringTemplate,void 0,void 0,this.root)),!N.isNullOrUndefined(r)&&0<r.length&&[].slice.call(r).forEach(function(e){N.isNullOrUndefined(e.tagName)||(e.style.display=""),t.appendChild(e)})}this.add(t,it);n=t.firstElementChild;N.isNullOrUndefined(n)||(n.setAttribute("tabindex",N.isNullOrUndefined(n.getAttribute("tabIndex"))?"-1":this.getDataTabindex(n)),n.setAttribute("data-tabindex",N.isNullOrUndefined(n.getAttribute("tabIndex"))?"-1":this.getDataTabindex(n))),this.tbarEle.push(t)},r.prototype.buttonRendering=function(e,t){var i,s,n=this.createElement("button",{className:"e-tbar-btn"}),r=(n.setAttribute("type","button"),e.text),l=(e.id?n.id=e.id:n.id=N.getUniqueID("e-tbr-btn"),this.createElement("span",{className:"e-tbar-btn-text"})),r=(r?(l.innerHTML=this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(r):r,n.appendChild(l),n.classList.add("e-tbtn-txt")):this.add(t,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(s=e.prefixIcon&&e.suffixIcon||e.prefixIcon?(i=e.prefixIcon+" e-icons","Left"):(i=e.suffixIcon+" e-icons","Right")),new R.Button({iconCss:i,iconPosition:s}));return r.createElement=this.createElement,r.appendTo(n),e.width&&N.setStyleAttribute(n,{width:N.formatUnit(e.width)}),n},r.prototype.renderSubComponent=function(e,t){var i,s=this.createElement("div",{className:y}),n=this.createElement("div",{innerHTML:this.enableHtmlSanitizer&&!N.isNullOrUndefined(e.tooltipText)?N.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,s),e.tooltipText&&s.setAttribute("title",n.textContent),e.cssClass&&(s.className=s.className+" "+e.cssClass),e.template)this.templateRender(e.template,s,e,t);else switch(e.type){case"Button":(i=this.buttonRendering(e,s)).setAttribute("tabindex",N.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("data-tabindex",N.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("aria-label",e.text||e.tooltipText),i.setAttribute("aria-disabled","false"),s.appendChild(i),N.EventHandler.add(s,"click",this.itemClick,this);break;case"Separator":this.add(s,b)}return e.showTextOn&&("Toolbar"===(n=e.showTextOn)?(this.add(s,nt),this.add(s,"e-tbtn-align")):"Overflow"===n&&this.add(s,rt)),e.overflow&&("Show"===(t=e.overflow)?this.add(s,lt):"Hide"!==t||s.classList.contains(b)||this.add(s,ot)),"Show"!==e.overflow&&e.showAlwaysInPopup&&!s.classList.contains(b)&&(this.add(s,vt),this.popupPriCount++),e.disabled&&this.add(s,st),!1===e.visible&&this.add(s,yt),s},r.prototype.getDataTabindex=function(e){return N.isNullOrUndefined(e.getAttribute("data-tabindex"))?"-1":e.getAttribute("data-tabindex")},r.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},r.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},r.prototype.activeEleRemove=function(e){var t,i=this.element.querySelector("."+y+":not(."+st+" ):not(."+b+" ):not(."+yt+" )");N.isNullOrUndefined(this.activeEle)||(this.activeEle.setAttribute("tabindex",this.getDataTabindex(this.activeEle)),i&&i.removeAttribute("tabindex"),i=this.activeEle),this.activeEle=e,"-1"===this.getDataTabindex(this.activeEle)&&(N.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains(it)?(!N.isNullOrUndefined(this.element.querySelector(".e-hor-nav"))&&this.element.querySelector(".e-hor-nav").classList.contains("e-nav-active")?(this.updateTabIndex("0"),t="-1"===this.getDataTabindex(i)?"0":this.getDataTabindex(i),i.setAttribute("tabindex",t)):this.updateTabIndex("-1"),e.removeAttribute("tabindex")):(i=parseInt(this.getDataTabindex(this.activeEle),10)+1,this.activeEle.setAttribute("tabindex",i.toString())))},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.getModuleName=function(){return"toolbar"},r.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},r.prototype.resize=function(){var e,t=this.element,i=(this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide(),this.checkOverflow(t,t.getElementsByClassName(m)[0]));i||(this.destroyScroll(),e=t.querySelector("."+m),N.isNullOrUndefined(e))||(this.remove(e,Ct),this.tbarAlign&&this.add(e,ct)),i&&this.scrollModule&&this.offsetWid===t.offsetWidth||((this.offsetWid>t.offsetWidth||i)&&this.renderOverflowMode(),this.popObj&&("Extended"===this.overflowMode&&(this.popObj.width=this.getToolbarPopupWidth(this.element)),this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign)&&this.refreshPositioning(),this.element.querySelector("."+pt)&&(this.scrollStep=this.element.querySelector("."+pt).offsetWidth),this.offsetWid=t.offsetWidth,this.tbResize=!1,this.separator())},r.prototype.orientationChange=function(){var e=this;setTimeout(function(){e.resize()},500)},r.prototype.extendedOpen=function(){var e=this.element.querySelector("."+Et);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains(tt))},r.prototype.updateHideEleTabIndex=function(e,t,i,s,n){i&&(s=n.indexOf(e));for(var r=n[++s];r;){if(!this.eleContains(r)){var l=r.firstElementChild.getAttribute("data-tabindex");t&&"-1"===l?r.firstElementChild.setAttribute("tabindex","0"):l!==r.firstElementChild.getAttribute("tabindex")&&r.firstElementChild.setAttribute("tabindex",l);break}r=n[++s]}},r.prototype.clearToolbarTemplate=function(e){if(this.registeredTemplate&&this.registeredTemplate.template)for(var t=this.registeredTemplate,i=0;i<t.template.length;i++){var s=t.template[parseInt(i.toString(),10)].rootNodes[0],n=N.closest(s,"."+y);if(!N.isNullOrUndefined(n)&&n===e){this.clearTemplate(["template"],[t.template[parseInt(i.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var r=this.portals,i=0;i<r.length;i++){var l=r[parseInt(i.toString(),10)],n=N.closest(l.containerInfo,"."+y);if(!N.isNullOrUndefined(n)&&n===e){this.clearTemplate(["template"],i);break}}},r.prototype.onPropertyChanged=function(e,t){var i=this.element;this.extendedOpen();for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"items":if(e.items instanceof Array&&t.items instanceof Array)this.itemsRerender(e.items);else for(var r=Object.keys(e.items),l=0;l<r.length;l++){var o=parseInt(Object.keys(e.items)[parseInt(l.toString(),10)],10),a=Object.keys(e.items[parseInt(o.toString(),10)])[0],d=Object(e.items[parseInt(o.toString(),10)])[""+a];if(this.tbarAlign||"align"===a){this.refresh(),this.trigger("created");break}var h="overflow"===a&&0!==this.popupPriCount,a=(("showAlwaysInPopup"===a&&!d||this.items[parseInt(o.toString(),10)].showAlwaysInPopup&&h)&&--this.popupPriCount,N.isNullOrUndefined(this.scrollModule)&&this.destroyMode(),[].slice.call(N.selectAll("."+m+" ."+y,i)));this.isReact&&this.items[parseInt(o.toString(),10)].template&&this.clearToolbarTemplate(a[parseInt(o.toString(),10)]),this.element.closest(".e-richtexteditor")&&(d=a[parseInt(o.toString(),10)].querySelector(".e-control.e-btn"),N.isNullOrUndefined(d)||N.isNullOrUndefined(d.ej2_instances[0])||d.ej2_instances[0].isDestroyed||d.ej2_instances[0].destroy()),N.EventHandler.remove(a[parseInt(o.toString(),10)],"click",this.itemClick),N.detach(a[parseInt(o.toString(),10)]),this.tbarEle.splice(o,1),this.addItems([this.items[parseInt(o.toString(),10)]],o),this.items.splice(o,1),this.items[parseInt(o.toString(),10)].template&&this.tbarEle.splice(this.items.length,1)}break;case"width":N.setStyleAttribute(i,{width:N.formatUnit(e.width)}),this.refreshOverflow();break;case"height":N.setStyleAttribute(this.element,{height:N.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(i,Ze),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(i,Ze):this.remove(i,Ze),N.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,Ze):this.remove(this.scrollModule.element,Ze)),N.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,Ze):this.remove(this.popObj.element,Ze)),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":t.cssClass&&N.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&N.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}},r.prototype.hideItem=function(e,t){var i,s,n="object"==typeof e,r=e;!n&&N.isNullOrUndefined(r)||(i=[].slice.call(N.selectAll("."+y,this.element)),n?s=e:this.tbarEle[parseInt(r.toString(),10)]&&(s=[].slice.call(N.selectAll("."+y,this.element))[parseInt(r.toString(),10)]),s&&(t?(s.classList.add(yt),s.classList.contains(b)||!N.isNullOrUndefined(s.firstElementChild.getAttribute("tabindex"))&&"-1"===s.firstElementChild.getAttribute("tabindex")||this.updateHideEleTabIndex(s,t,n,r,i)):(s.classList.remove(yt),s.classList.contains(b)||this.updateHideEleTabIndex(s,t,n,r,i)),this.refreshOverflow()))},n([N.Collection([],Ot)],r.prototype,"items",void 0),n([N.Property("auto")],r.prototype,"width",void 0),n([N.Property("auto")],r.prototype,"height",void 0),n([N.Property("")],r.prototype,"cssClass",void 0),n([N.Property("Scrollable")],r.prototype,"overflowMode",void 0),n([N.Property()],r.prototype,"scrollStep",void 0),n([N.Property(!0)],r.prototype,"enableCollision",void 0),n([N.Property(!0)],r.prototype,"enableHtmlSanitizer",void 0),n([N.Property(!0)],r.prototype,"allowKeyboard",void 0),n([N.Event()],r.prototype,"clicked",void 0),n([N.Event()],r.prototype,"created",void 0),n([N.Event()],r.prototype,"destroyed",void 0),n([N.Event()],r.prototype,"beforeCreate",void 0),n([N.Event()],r.prototype,"keyDown",void 0);var kt,Lt=n([N.NotifyPropertyChanges],r);function r(e,t){e=kt.call(this,e,t)||this;return e.resizeContext=e.resize.bind(e),e.orientationChangeContext=e.orientationChange.bind(e),e.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},e}At=function(e,t){return(At=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 At,Tt,e=function(e,t){function i(){this.constructor=e}At(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Dt="e-acrdn-root",Pt="e-acrdn-ctrl",Mt="e-accordion",Ht="e-acrdn-item",Ut="e-item-focus",Rt="e-focused",Bt="e-hide",Vt="e-acrdn-header",jt="e-acrdn-header-content",Ft="e-acrdn-panel",qt="e-acrdn-content",Wt="e-toggle-icon",_t="e-expand-icon",zt="e-rtl",Kt="e-content-hide",Xt="e-select",Yt="e-selected",Gt="e-active",Qt="e-overlay",Jt="e-toggle-animation",Zt="e-expand-state",$t="e-accordion-container",ei=(Tt=N.ChildProperty,e(ti,Tt),n([N.Property("SlideDown")],ti.prototype,"effect",void 0),n([N.Property(400)],ti.prototype,"duration",void 0),n([N.Property("linear")],ti.prototype,"easing",void 0),ti);function ti(){return null!==Tt&&Tt.apply(this,arguments)||this}ii=N.ChildProperty,e(ni,ii),n([N.Complex({effect:"SlideUp",duration:400,easing:"linear"},ei)],ni.prototype,"collapse",void 0),n([N.Complex({effect:"SlideDown",duration:400,easing:"linear"},ei)],ni.prototype,"expand",void 0);var ii,si=ni;function ni(){return null!==ii&&ii.apply(this,arguments)||this}ri=N.ChildProperty,e(oi,ri),n([N.Property(null)],oi.prototype,"content",void 0),n([N.Property(null)],oi.prototype,"header",void 0),n([N.Property(null)],oi.prototype,"cssClass",void 0),n([N.Property(null)],oi.prototype,"iconCss",void 0),n([N.Property(!1)],oi.prototype,"expanded",void 0),n([N.Property(!0)],oi.prototype,"visible",void 0),n([N.Property(!1)],oi.prototype,"disabled",void 0),n([N.Property()],oi.prototype,"id",void 0);var ri,li=oi;function oi(){return null!==ri&&ri.apply(this,arguments)||this}ai=N.Component,e(l,ai),l.prototype.destroy=function(){(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var t=this.element;if(ai.prototype.destroy.call(this),this.unWireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(t.children).forEach(function(e){t.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)t.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}t.classList.remove(Dt),t.classList.remove(Pt),t.removeAttribute("style"),this.element.removeAttribute("data-ripple"),!this.isNested&&N.isRippleEnabled&&this.removeRippleEffect()},l.prototype.preRender=function(){var e=N.closest(this.element,"."+Ft);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains(Mt)&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add(Dt),this.enableRtl&&this.add(this.element,zt),this.element.classList.add(Pt)},l.prototype.add=function(e,t){e.classList.add(t)},l.prototype.remove=function(e,t){e.classList.remove(t)},l.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},l.prototype.initialize=function(){var e=N.formatUnit(this.width),t=N.formatUnit(this.height);N.setStyleAttribute(this.element,{width:e,height:t}),N.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),!N.isNullOrUndefined(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices)},l.prototype.renderControl=function(){this.trgtEle=0<this.element.children.length?N.select("div",this.element):null,this.renderItems(),this.initItemExpand()},l.prototype.wireFocusEvents=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Ht));e<t.length;e++){var i=t[e],s=i.querySelector("."+Vt);0<i.childElementCount&&s&&(N.EventHandler.clearEvents(s),N.EventHandler.add(s,"focus",this.focusIn,this),N.EventHandler.add(s,"blur",this.focusOut,this))}},l.prototype.unWireEvents=function(){N.EventHandler.remove(this.element,"click",this.clickHandler),N.EventHandler.remove(this.element,"keydown",this.keyDownHandler),N.EventHandler.remove(document,"keydown",this.keyDownHandler),N.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),N.isNullOrUndefined(this.keyModule)||this.keyModule.destroy();for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Vt));e<t.length;e++){var i=t[e];N.EventHandler.clearEvents(i)}},l.prototype.wireEvents=function(){N.EventHandler.add(this.element,"click",this.clickHandler,this),N.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),N.EventHandler.add(document,"keydown",this.keyDownHandler,this),N.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=N.rippleEffect(this.element,{selector:"."+Vt})),this.isNested||(this.keyModule=new N.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},l.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?N.compile(document.querySelector(t).innerHTML.trim()):N.compile(t)}catch(e){return N.compile(t)}},l.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},l.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},l.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},l.prototype.getItemTemplate=function(){return this.itemTemplateFn},l.prototype.focusIn=function(e){e=e.target.parentElement;e.classList.add(Ut),this.isKeyboardNavigation&&(e.classList.add(Rt),this.isKeyboardNavigation=!1)},l.prototype.focusOut=function(e){e=e.target.parentElement;e.classList.remove(Ut),e.classList.remove(Rt)},l.prototype.keyDownHandler=function(e){"Tab"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key||(this.isKeyboardNavigation=!0)},l.prototype.mouseDownHandler=function(e){this.isKeyboardNavigation=!1,e.target.parentElement.classList.remove(Rt)},l.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e=N.select("."+$t,this.element),t=(e||this.element).children,i=[];[].slice.call(t).forEach(function(e){i.push({header:0<e.childElementCount&&e.children[0]?e.children[0]:"",content:1<e.childElementCount&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),e&&this.element.removeChild(e),this.setProperties({items:i},!0)},l.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:Wt}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},l.prototype.initItemExpand=function(){var e=this.initExpand.length;if(0!==e){if("Single"===this.expandMode)this.expandItem(!0,this.initExpand[e-1]);else for(var t=0;t<e;t++)this.expandItem(!0,this.initExpand[parseInt(t.toString(),10)]);this.isReact&&this.renderReactTemplates()}},l.prototype.renderItems=function(){var i,s,e,n=this,r=this.element;N.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),!N.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length?this.dataSource.forEach(function(e,t){s=n.renderInnerItem(e,t),r.appendChild(s),0<s.childElementCount&&(N.EventHandler.add(s.querySelector("."+Vt),"focus",n.focusIn,n),N.EventHandler.add(s.querySelector("."+Vt),"blur",n.focusOut,n))}):(e=this.items,r&&0<e.length&&e.forEach(function(e,t){i=n.renderInnerItem(e,t),r.appendChild(i),0<i.childElementCount&&(N.EventHandler.add(i.querySelector("."+Vt),"focus",n.focusIn,n),N.EventHandler.add(i.querySelector("."+Vt),"blur",n.focusOut,n))})),this.isReact&&this.renderReactTemplates()},l.prototype.clickHandler=function(e){var t,i,s,n,r,l,o=e.target,a=this.getItems(),d={};N.closest(o,"."+Mt)===this.element&&(o.classList.add("e-target"),i=N.closest(o,"."+Ht),s=N.closest(o,"."+Vt),n=N.closest(o,"."+Ft),i&&(N.isNullOrUndefined(s)||N.isNullOrUndefined(n))&&(s=i.children[0],n=i.children[1]),s&&(t=N.select("."+Wt,s)),s?r=N.closest(s,"."+Ht):n&&(r=N.closest(n,"."+Ht)),l=this.getIndexByItem(i),r&&(d.item=a[this.getIndexByItem(r)]),d.originalEvent=e,!N.isNullOrUndefined(t)&&i.childElementCount<=1&&(N.isNullOrUndefined(n)||!N.isNullOrUndefined(N.select("."+Vt+" ."+Wt,r)))&&(i.appendChild(this.contentRendering(l)),this.ariaAttrUpdate(i)),this.afterContentRender(o,d,i,s,n,r),this.isReact)&&this.renderReactTemplates()},l.prototype.afterContentRender=function(o,e,a,d,h,c){var p=this,u=[];this.trigger("clicked",e,function(e){if(!e.cancel){var e=h&&!N.isNullOrUndefined(N.select(".e-target",h)),t=h&&!N.isNullOrUndefined(N.select("."+Mt,h))&&N.isNullOrUndefined(N.closest(o,".e-acrdn-panel .e-accordion")),i=h&&N.isNullOrUndefined(N.select("."+Mt,h))||!(N.closest(o,"."+Mt)===p.element),e=e&&(t||i);if(o.classList.remove("e-target"),!(o.classList.contains(Ft)||o.classList.contains(qt)||e)){t=p.element.querySelector("."+$t),i=(t||p.element).children,e=([].slice.call(i).forEach(function(e){e.classList.contains(Gt)&&u.push(e)}),[].slice.call(p.element.querySelectorAll("."+Ht+" [e-animate]")));if(0<e.length)for(var s=0,n=e;s<n.length;s++){var r=n[s];u.push(r.parentElement)}var l,t=-1!==u.indexOf(c)&&"true"===h.getAttribute("e-animate");N.isNullOrUndefined(a)||N.isNullOrUndefined(d)||(i=N.select("."+Ft,a),e=N.closest(a,"."+Dt).querySelector("."+Zt),N.isNullOrUndefined(i))||(l=e===a,!N.isVisible(i)||t&&!c.classList.contains(Yt)?(0<u.length&&"Single"===p.expandMode&&!t&&u.forEach(function(e){p.collapse(N.select("."+Ft,e)),e.classList.remove(Zt)}),p.expand(i)):p.collapse(i),N.isNullOrUndefined(e))||l||e.classList.remove(Zt)}}})},l.prototype.eleMoveFocus=function(e,t,i){var s,n=N.closest(i,"."+Ht);i===t?s=("moveUp"===e?i.lastElementChild:i).querySelector("."+Vt):i.classList.contains(Vt)&&(n="moveUp"===e?n.previousElementSibling:n.nextElementSibling)&&(s=N.select("."+Vt,n)),s&&s.focus()},l.prototype.keyActionHandler=function(e){var t=e.target,i=N.closest(e.target,Vt);if(!N.isNullOrUndefined(i)||t.classList.contains(Mt)||t.classList.contains(Vt)){var s,n=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,n,t);break;case"space":case"enter":s=t.nextElementSibling,(N.isNullOrUndefined(s)||!s.classList.contains(Ft)||"true"!==s.getAttribute("e-animate"))&&t.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?n.firstElementChild:n.lastElementChild).children[0].focus(),e.preventDefault()}}},l.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:Vt,id:N.getUniqueID("acrdn_header")});return N.attributes(e,{tabindex:"0",role:"button","aria-disabled":"false","aria-expanded":"false"}),e},l.prototype.renderInnerItem=function(e,t){var i,s,n=this.createElement("div",{className:Ht,id:e.id||N.getUniqueID("acrdn_item")}),r=(this.headerTemplate?(s=this.headerEleGenerate(),r=this.createElement("div",{className:jt}),s.appendChild(r),N.append(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),r),n.appendChild(s),s.appendChild(this.toggleIconGenerate()),this.add(n,Xt)):e.header&&this.angularnativeCondiCheck(e,"header")&&(i=e.header,this.enableHtmlSanitizer&&"string"==typeof e.header&&(i=N.SanitizeHtmlHelper.sanitize(e.header)),s=this.headerEleGenerate(),r=this.createElement("div",{className:jt}),s.appendChild(r),s.appendChild(this.fetchElement(r,i,t)),n.appendChild(s)),N.select("."+Vt,n));return!e.expanded||N.isNullOrUndefined(t)||this.enablePersistence||-1===this.initExpand.indexOf(t)&&this.initExpand.push(t),e.cssClass&&N.addClass([n],e.cssClass.split(" ")),e.disabled&&N.addClass([n],Qt),!1===e.visible&&N.addClass([n],Bt),e.iconCss&&(i=this.createElement("div",{className:"e-acrdn-header-icon"}),s=this.createElement("span",{className:e.iconCss+" e-icons"}),i.appendChild(s),N.isNullOrUndefined(r)?((r=this.headerEleGenerate()).appendChild(i),n.appendChild(r)):r.insertBefore(i,r.childNodes[0])),e.content&&this.angularnativeCondiCheck(e,"content")&&!this.headerTemplate&&(t=this.toggleIconGenerate(),N.isNullOrUndefined(r)&&(r=this.headerEleGenerate(),n.appendChild(r)),r.appendChild(t),this.add(n,Xt)),n},l.prototype.angularnativeCondiCheck=function(e,t){t="content"===t?e.content:e.header;return!(this.isAngular&&!N.isNullOrUndefined(t.elementRef)&&(e=t.elementRef.nativeElement.data,!N.isNullOrUndefined(e))&&""!==e&&-1!==e.indexOf("bindings=")&&(e=JSON.parse(t.elementRef.nativeElement.data.replace("bindings=","")),!N.isNullOrUndefined(e))&&"false"===e["ng-reflect-ng-if"])},l.prototype.fetchElement=function(t,i,e){var s,n,r,l;try{document.querySelectorAll(i).length&&"Button"!==i?(n=(r=document.querySelector(i)).outerHTML.trim(),t.appendChild(r),r.style.display=""):s=N.compile(i)}catch(e){"string"==typeof i?t.innerHTML=this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(i):i:i instanceof HTMLElement?(t.appendChild(i),this.trgtEle&&(t.firstElementChild.style.display="")):s=N.compile(i)}return N.isNullOrUndefined(s)||(this.isReact&&this.renderReactTemplates(),l=r=void 0,t.classList.contains(jt)?(r=this.element.id+e+"_header",l="header"):t.classList.contains(qt)&&(r=this.element.id+e+"_content",l="content"),l=s({},this,l,r,this.isStringTemplate)),N.isNullOrUndefined(l)||!(0<l.length)||N.isNullOrUndefined(l[0].tagName)&&1===l.length?0===t.childElementCount&&(t.innerHTML=this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(i):i):[].slice.call(l).forEach(function(e){N.isNullOrUndefined(e.tagName)||(e.style.display=""),t.appendChild(e)}),N.isNullOrUndefined(n)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),t},l.prototype.ariaAttrUpdate=function(e){var t=N.select("."+Vt,e),e=N.select("."+Ft,e);t.setAttribute("aria-controls",e.id),e.setAttribute("aria-labelledby",t.id),e.setAttribute("role","region")},l.prototype.contentRendering=function(e){var t,i=this.createElement("div",{className:Ft+" "+Kt,id:N.getUniqueID("acrdn_panel")}),s=(N.attributes(i,{"aria-hidden":"true"}),this.createElement("div",{className:qt}));return!N.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length?(this.isReact&&this.renderReactTemplates(),N.isNullOrUndefined(this.getItemTemplate())?i.appendChild(this.fetchElement(s,this.dataSource[parseInt(e.toString(),10)].content,e)):(N.append(this.getItemTemplate()(this.dataSource[parseInt(e.toString(),10)],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s))):(t=this.items[parseInt(e.toString(),10)].content,this.enableHtmlSanitizer&&"string"==typeof t&&(t=N.SanitizeHtmlHelper.sanitize(t)),i.appendChild(this.fetchElement(s,t,e))),i},l.prototype.expand=function(t){var i,s,n,r=this,e=this.getItems(),l=N.closest(t,"."+Ht);N.isNullOrUndefined(t)||N.isVisible(t)&&"true"!==t.getAttribute("e-animate")||l.classList.contains(Qt)||(i=N.closest(l,"."+Dt).querySelector("."+Zt),s={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},n=N.select("."+Wt,l).firstElementChild,e={element:l,item:e[this.getIndexByItem(l)],index:this.getIndexByItem(l),content:l.querySelector("."+Ft),isExpanded:!0},this.trigger("expanding",e,function(e){e.cancel||(n.classList.add(Jt),r.expandedItemsPush(l),N.isNullOrUndefined(i)||i.classList.remove(Zt),l.classList.add(Zt),"None"===s.name&&"Enable"!==N.animationMode||"Disable"===N.animationMode?(r.expandProgress("begin",n,t,l,e),r.expandProgress("end",n,t,l,e)):r.expandAnimation(s.name,n,t,l,s,e))}))},l.prototype.expandAnimation=function(e,t,i,s,n,r){var l,o=this;"None"===e&&"Enable"===N.animationMode&&(n.name=e="SlideDown"),this.lastActiveItemId=s.id,"SlideDown"===e?(n.begin=function(){o.expandProgress("begin",t,i,s,r),i.style.position="absolute",l=s.offsetHeight,i.style.maxHeight=i.offsetHeight+"px",s.style.maxHeight=""},n.progress=function(){s.style.minHeight=l+i.offsetHeight+"px"},n.end=function(){N.setStyleAttribute(i,{position:"",maxHeight:""}),s.style.minHeight="",o.expandProgress("end",t,i,s,r)}):(n.begin=function(){o.expandProgress("begin",t,i,s,r)},n.end=function(){o.expandProgress("end",t,i,s,r)}),new N.Animation(n).animate(i)},l.prototype.expandProgress=function(e,t,i,s,n){this.remove(i,Kt),this.add(s,Yt),this.add(t,_t),"end"===e&&(this.add(s,Gt),i.setAttribute("aria-hidden","false"),N.attributes(i.previousElementSibling,{"aria-expanded":"true"}),t.classList.remove(Jt),this.trigger("expanded",n))},l.prototype.expandedItemsPush=function(e){var t,e=this.getIndexByItem(e);-1===this.expandedIndices.indexOf(e)&&((t=[].slice.call(this.expandedIndices)).push(e),this.setProperties({expandedIndices:t},!0))},l.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},l.prototype.getItemElements=function(){var t=[],e=this.element.children;return[].slice.call(e).forEach(function(e){e.classList.contains(Ht)&&t.push(e)}),t},l.prototype.expandedItemsPop=function(e){var e=this.getIndexByItem(e),t=[].slice.call(this.expandedIndices);t.splice(t.indexOf(e),1),this.setProperties({expandedIndices:t},!0)},l.prototype.collapse=function(t){var i,s,n,e,r=this;N.isNullOrUndefined(t)||(e=this.getItems(),i=N.closest(t,"."+Ht),N.isVisible(t)&&!i.classList.contains(Qt)&&(s={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},n=N.select("."+Wt,i).firstElementChild,e={element:i,item:e[this.getIndexByItem(i)],index:this.getIndexByItem(i),content:i.querySelector("."+Ft),isExpanded:!1},this.trigger("expanding",e,function(e){e.cancel||(r.expandedItemsPop(i),i.classList.remove(Zt),n.classList.add(Jt),"None"===s.name&&"Enable"!==N.animationMode||"Disable"===N.animationMode?(r.collapseProgress("begin",n,t,i,e),r.collapseProgress("end",n,t,i,e)):r.collapseAnimation(s.name,t,i,n,s,e))})))},l.prototype.collapseAnimation=function(e,t,i,s,n,r){var l,o,a,d,h=this;"None"===e&&"Enable"===N.animationMode&&(n.name=e="SlideUp"),this.lastActiveItemId=i.id,"SlideUp"===e?(n.begin=function(){a=i.offsetHeight,i.style.minHeight=a+"px",t.style.position="absolute",l=i.offsetHeight,o=t.offsetHeight,t.style.maxHeight=o+"px",h.collapseProgress("begin",s,t,i,r)},n.progress=function(){(d=l-(o-t.offsetHeight))<a&&(i.style.minHeight=d+"px")},n.end=function(){t.style.display="none",h.collapseProgress("end",s,t,i,r),i.style.minHeight="",N.setStyleAttribute(t,{position:"",maxHeight:"",display:""})}):(n.begin=function(){h.collapseProgress("begin",s,t,i,r)},n.end=function(){h.collapseProgress("end",s,t,i,r)}),new N.Animation(n).animate(t)},l.prototype.collapseProgress=function(e,t,i,s,n){this.remove(t,_t),this.remove(s,Yt),"end"===e&&(this.add(i,Kt),t.classList.remove(Jt),this.remove(s,Gt),i.setAttribute("aria-hidden","true"),N.attributes(i.previousElementSibling,{"aria-expanded":"false"}),this.trigger("expanded",n))},l.prototype.getModuleName=function(){return"accordion"},l.prototype.getItems=function(){var e=this.itemTemplate&&this.headerTemplate?this.dataSource:this.items;return e},l.prototype.addItem=function(e,s){var n=this,r=this.element,l=this.getItemElements(),o=this.getItems();N.isNullOrUndefined(s)&&(s=o.length),r.childElementCount>=s&&(e instanceof Array?e:[e]).forEach(function(e,t){var t=s+t,i=(o.splice(t,0,e),n.renderInnerItem(e,t));r.childElementCount===t?r.appendChild(i):r.insertBefore(i,l[parseInt(t.toString(),10)]),N.EventHandler.add(i.querySelector("."+Vt),"focus",n.focusIn,n),N.EventHandler.add(i.querySelector("."+Vt),"blur",n.focusOut,n),n.expandedIndices=[],n.expandedItemRefresh(),e&&e.expanded&&n.expandItem(!0,t)}),this.isReact&&this.renderReactTemplates()},l.prototype.expandedItemRefresh=function(){var t=this,e=this.getItemElements();[].slice.call(e).forEach(function(e){e.classList.contains(Yt)&&t.expandedItemsPush(e)})},l.prototype.removeItem=function(e){(this.isReact||this.isAngular)&&(i=N.selectAll("."+Ht,this.element)[parseInt(e.toString(),10)],t=N.select("."+jt,i),i=N.select("."+qt,i),this.clearAccordionTemplate(t,0<this.dataSource.length?"headerTemplate":"header",jt),this.clearAccordionTemplate(i,0<this.dataSource.length?"itemTemplate":"content",qt));var t=this.getItemElements()[parseInt(e.toString(),10)],i=this.getItems();N.isNullOrUndefined(t)||(this.restoreContent(e),N.detach(t),i.splice(e,1),this.expandedIndices=[],this.expandedItemRefresh())},l.prototype.select=function(e){e=this.getItemElements()[parseInt(e.toString(),10)];N.isNullOrUndefined(e)||N.isNullOrUndefined(N.select("."+Vt,e))||e.children[0].focus()},l.prototype.hideItem=function(e,t){e=this.getItemElements()[parseInt(e.toString(),10)];N.isNullOrUndefined(e)||((t=N.isNullOrUndefined(t)?!0:t)?this.add(e,Bt):this.remove(e,Bt))},l.prototype.enableItem=function(e,t){var i,s=this.getItemElements()[parseInt(e.toString(),10)];N.isNullOrUndefined(s)||(i=s.firstElementChild,t?(this.remove(s,Qt),N.attributes(i,{tabindex:"0","aria-disabled":"false"}),i.focus()):(s.classList.contains(Gt)&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,i)),this.add(s,Qt),i.setAttribute("aria-disabled","true"),i.removeAttribute("tabindex")))},l.prototype.expandItem=function(t,e){var i,s,n,r=this,l=this.getItemElements();N.isNullOrUndefined(e)?"Single"===this.expandMode&&t?(n=l[l.length-1],this.itemExpand(t,n,this.getIndexByItem(n))):(i=N.select("#"+this.lastActiveItemId,this.element),[].slice.call(l).forEach(function(e){r.itemExpand(t,e,r.getIndexByItem(e)),e.classList.remove(Zt)}),(s=N.select("."+Zt,this.element))&&s.classList.remove(Zt),i&&i.classList.add(Zt)):(n=l[parseInt(e.toString(),10)],N.isNullOrUndefined(n)||!n.classList.contains(Xt)||n.classList.contains(Gt)&&t||("Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(t,n,e)))},l.prototype.itemExpand=function(e,t,i){var s=t.children[1];t.classList.contains(Qt)||(N.isNullOrUndefined(s)&&e?(s=this.contentRendering(i),t.appendChild(s),this.ariaAttrUpdate(t),this.expand(s)):N.isNullOrUndefined(s)||(e?this.expand(s):this.collapse(s)),this.isReact&&this.renderReactTemplates())},l.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+Ht)).forEach(function(e){var t=N.select("."+Vt,e);t&&N.EventHandler.clearEvents(t),N.detach(e)})},l.prototype.restoreContent=function(e){var t=N.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+Ht)[parseInt(e.toString(),10)];this.templateEle.forEach(function(e){N.isNullOrUndefined(t.querySelector(e))||(document.body.appendChild(t.querySelector(e)).style.display="none")})},l.prototype.updateItem=function(e,t){var i,s,n;N.isNullOrUndefined(e)||(i=(s=this.getItems())[parseInt(t.toString(),10)],s.splice(t,1),this.restoreContent(t),s=N.select("."+jt,e),n=N.select("."+qt,e),(this.isReact||this.isAngular)&&(this.clearAccordionTemplate(s,"header",jt),this.clearAccordionTemplate(n,"content",qt)),N.detach(e),this.addItem(i,t))},l.prototype.setTemplate=function(e,t,i){this.fetchElement(t,e,i),this.isReact&&this.renderReactTemplates()},l.prototype.clearAccordionTemplate=function(e,t,i){if(this.registeredTemplate&&this.registeredTemplate[""+t])for(var s=this.registeredTemplate,n=0;n<s[""+t].length;n++){var r=s[""+t][parseInt(n.toString(),10)].rootNodes[0],l=N.closest(r,"."+i);if(!N.isNullOrUndefined(l)&&l===e||N.isNullOrUndefined(r.parentNode)){this.clearTemplate([t],[s[""+t][parseInt(n.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var o=this.portals,n=0;n<o.length;n++){var a=o[parseInt(n.toString(),10)],l=N.closest(a.containerInfo,"."+i);if(!N.isNullOrUndefined(l)&&l===e){this.clearTemplate([t],n);break}}},l.prototype.getPersistData=function(){return this.addOnPersist(["expandedIndices"])},l.prototype.onPropertyChanged=function(e,t){for(var i=this.element,s=!1,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"items":if(e.items instanceof Array&&t.items instanceof Array)s=!0;else for(var l=Object.keys(e.items),o=0;o<l.length;o++)for(var a=parseInt(Object.keys(e.items)[parseInt(o.toString(),10)],10),d=Object.keys(e.items[parseInt(a.toString(),10)]),h=0;h<d.length;h++){var c=N.selectAll("."+Ht,this.element)[parseInt(a.toString(),10)],p=Object(t.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]],u=Object(e.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]],m=d[parseInt(h.toString(),10)],f=N.select("."+qt,c);("header"===m||"iconCss"===m||"expanded"===m||"content"===m&&""===p)&&this.updateItem(c,a),"cssClass"!==d[parseInt(h.toString(),10)]||N.isNullOrUndefined(c)||(p&&N.removeClass([c],p.split(" ")),u&&N.addClass([c],u.split(" "))),"visible"!==d[parseInt(h.toString(),10)]||N.isNullOrUndefined(c)||(!1===Object(e.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]]?c.classList.add(Bt):c.classList.remove(Bt)),"disabled"!==d[parseInt(h.toString(),10)]||N.isNullOrUndefined(c)||this.enableItem(a,!u),d.indexOf("header")<0&&"content"===d[parseInt(h.toString(),10)]&&!N.isNullOrUndefined(c)&&2===c.children.length&&("function"==typeof u?((this.isAngular||this.isReact)&&this.clearAccordionTemplate(f,d[parseInt(h.toString(),10)],qt),(m=c.querySelector("."+qt)).innerHTML="",this.setTemplate(u,m,a)):(c.classList.contains(Yt)&&this.expandItem(!1,a),N.detach(c.querySelector("."+Ft))))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),s=!0;break;case"headerTemplate":this.initializeHeaderTemplate(),s=!0;break;case"itemTemplate":this.initializeItemTemplate(),s=!0;break;case"enableRtl":e.enableRtl?this.add(i,zt):this.remove(i,zt);break;case"height":N.setStyleAttribute(this.element,{height:N.formatUnit(e.height)});break;case"width":N.setStyleAttribute(this.element,{width:N.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode&&!N.isNullOrUndefined(this.expandedIndices)&&1<this.expandedIndices.length&&this.expandItem(!1)}s&&(this.initExpand=[],!N.isNullOrUndefined(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},n([N.Collection([],li)],l.prototype,"items",void 0),n([N.Property([])],l.prototype,"dataSource",void 0),n([N.Property()],l.prototype,"itemTemplate",void 0),n([N.Property()],l.prototype,"headerTemplate",void 0),n([N.Property("100%")],l.prototype,"width",void 0),n([N.Property("auto")],l.prototype,"height",void 0),n([N.Property([])],l.prototype,"expandedIndices",void 0),n([N.Property("Multiple")],l.prototype,"expandMode",void 0),n([N.Property(!0)],l.prototype,"enableHtmlSanitizer",void 0),n([N.Complex({},si)],l.prototype,"animation",void 0),n([N.Event()],l.prototype,"clicked",void 0),n([N.Event()],l.prototype,"expanding",void 0),n([N.Event()],l.prototype,"expanded",void 0),n([N.Event()],l.prototype,"created",void 0),n([N.Event()],l.prototype,"destroyed",void 0);var ai,e=n([N.NotifyPropertyChanges],l);function l(e,t){e=ai.call(this,e,t)||this;return e.isKeyboardNavigation=!1,e.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},e}di=function(e,t){return(di=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 di,hi,n=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},ci="e-contextmenu-template",n=(function(e,t){function i(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(pi,hi=q),pi.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||N.getUniqueID("ej2-contextmenu"),hi.prototype.preRender.call(this)},pi.prototype.initialize=function(){this.template=this.itemTemplate||null,this.addTemplateClass(),hi.prototype.initialize.call(this),N.attributes(this.element,{role:"menu",tabindex:"0"}),this.element.style.zIndex=U.getZindexPartial(this.element).toString()},pi.prototype.open=function(e,t,i){this.isOpenCalled=!0,hi.prototype.openMenu.call(this,null,null,e,t,null,i),this.isOpenCalled=!1},pi.prototype.close=function(){hi.prototype.closeMenu.call(this)},pi.prototype.addTemplateClass=function(){(!N.isNullOrUndefined(this.itemTemplate)&&"function"==typeof this.itemTemplate||"string"==typeof this.itemTemplate&&""!==this.itemTemplate)&&N.addClass([this.element],ci)},pi.prototype.onPropertyChanged=function(e,t){hi.prototype.onPropertyChanged.call(this,e,t);for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"filter":this.close(),this.filter=e.filter;break;case"target":this.unWireEvents(t.target),this.wireEvents();break;case"itemTemplate":this.itemTemplate=e.itemTemplate,N.removeClass([this.element],ci),this.addTemplateClass(),this.refresh()}},pi.prototype.getModuleName=function(){return"contextmenu"},n([N.Property("")],pi.prototype,"target",void 0),n([N.Property("")],pi.prototype,"filter",void 0),n([N.Collection([],We)],pi.prototype,"items",void 0),n([N.Property(null)],pi.prototype,"itemTemplate",void 0),n([N.Property(!1)],pi.prototype,"enableScrolling",void 0),n([N.NotifyPropertyChanges],pi));function pi(e,t){return hi.call(this,e,t)||this}ui=function(e,t){return(ui=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 ui,mi,fi=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},gi="e-vertical",vi="e-hamburger",q=(function(e,t){function i(){this.constructor=e}ui(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(yi,mi=q),yi.prototype.getModuleName=function(){return"menu"},yi.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||N.getUniqueID("ej2-menu"),this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}this.updateMenuItems(this.items),mi.prototype.preRender.call(this)},yi.prototype.initialize=function(){mi.prototype.initialize.call(this),N.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(gi),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(gi),this.element.setAttribute("aria-orientation","vertical")):N.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add(vi),"Horizontal"===this.orientation)&&this.element.classList.add("e-hide-menu")},yi.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},yi.prototype.onPropertyChanged=function(e,t){for(var i=this,s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"orientation":"Vertical"===e.orientation?(this.element.classList.add(gi),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(gi),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(gi),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(gi),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(t.items).length||this.updateMenuItems(e.items);break;case"hamburgerMode":this.element.previousElementSibling||mi.prototype.createHeaderContainer.call(this),e.hamburgerMode?(this.element.parentElement.classList.add(vi),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[i.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove(vi),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(gi),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(gi):this.element.previousElementSibling.classList.remove(gi),this.element.classList[e.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(e.title=this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(e.title):e.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=e.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(t.target),this.wireEvents(),"Horizontal"===this.orientation)&&(e.target?this.element.previousElementSibling.classList.add(gi):(this.element.previousElementSibling||mi.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(gi)),this.element.classList.add("e-hide-menu"));break;case"template":this.template=e.template,this.refresh()}mi.prototype.onPropertyChanged.call(this,e,t)},yi.prototype.createMenuItems=function(e){var t,i,s=this.items,n=this.getField("parentId");if(e[""+n]){for(t=this.getIndex(e[""+n].toString(),!0),i=0;i<t.length;i++)s[t[i]].items||(s[t[i]].items=[]),s=s[t[i]].items;s.push(e)}else this.items.push(e)},yi.prototype.open=function(){mi.prototype.openHamburgerMenu.call(this)},yi.prototype.close=function(){mi.prototype.closeHamburgerMenu.call(this)},fi([N.Property("Horizontal")],yi.prototype,"orientation",void 0),fi([N.Property("")],yi.prototype,"target",void 0),fi([N.Property(null)],yi.prototype,"template",void 0),fi([N.Property(!1)],yi.prototype,"enableScrolling",void 0),fi([N.Property(!1)],yi.prototype,"hamburgerMode",void 0),fi([N.Property("Menu")],yi.prototype,"title",void 0),fi([N.Property(!0)],yi.prototype,"enableHtmlSanitizer",void 0),fi([N.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},je)],yi.prototype,"fields",void 0),fi([N.NotifyPropertyChanges],yi));function yi(e,t){e=mi.call(this,e,t)||this;return e.tempItems=[],e}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,Ci,fi=function(e,t){function i(){this.constructor=e}bi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},o=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Si="e-tab",Ii="e-tab-header",C="e-content",xi="e-nested",Ei="e-item",Ni="e-template",Oi="e-rtl",d="e-active",wi="e-disable",S="e-hidden",ki="e-focused",Li="e-icons",Ai="e-icon",Ti="e-icon-tab",Di="e-close-icon",Pi="e-close-show",Mi="e-tab-text",Hi="e-indicator",Ui="e-tab-wrap",Ri="e-text-wrap",Bi="e-tab-icon",Vi="e-toolbar-items",I="e-toolbar-item",ji="e-toolbar-pop",Fi="e-toolbar-popup",qi="e-hor-nav",Wi="e-progress",_i="e-overlay",zi="e-vertical-tab",Ki="e-vertical",Xi="e-vertical-left",Yi="e-vertical-right",Gi="e-horizontal-bottom",Qi="e-fill-mode",Ji="tabitem_",Zi="e-reorder-active-item",$i=(Ci=N.ChildProperty,fi(es,Ci),o([N.Property("SlideLeftIn")],es.prototype,"effect",void 0),o([N.Property(600)],es.prototype,"duration",void 0),o([N.Property("ease")],es.prototype,"easing",void 0),es);function es(){return null!==Ci&&Ci.apply(this,arguments)||this}ts=N.ChildProperty,fi(ss,ts),o([N.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},$i)],ss.prototype,"previous",void 0),o([N.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},$i)],ss.prototype,"next",void 0);var ts,is=ss;function ss(){return null!==ts&&ts.apply(this,arguments)||this}ns=N.ChildProperty,fi(ls,ns),o([N.Property("")],ls.prototype,"text",void 0),o([N.Property("")],ls.prototype,"iconCss",void 0),o([N.Property("left")],ls.prototype,"iconPosition",void 0);var ns,rs=ls;function ls(){return null!==ns&&ns.apply(this,arguments)||this}os=N.ChildProperty,fi(ds,os),o([N.Complex({},rs)],ds.prototype,"header",void 0),o([N.Property(null)],ds.prototype,"headerTemplate",void 0),o([N.Property("")],ds.prototype,"content",void 0),o([N.Property("")],ds.prototype,"cssClass",void 0),o([N.Property(!1)],ds.prototype,"disabled",void 0),o([N.Property(!0)],ds.prototype,"visible",void 0),o([N.Property()],ds.prototype,"id",void 0),o([N.Property(-1)],ds.prototype,"tabIndex",void 0);var os,as=ds;function ds(){return null!==os&&os.apply(this,arguments)||this}hs=N.Component,fi(h,hs),h.prototype.destroy=function(){if((this.isReact||this.isAngular)&&this.clearTemplate(),N.isNullOrUndefined(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),this.element.removeAttribute("aria-disabled"),this.expTemplateContent(),this.isTemplate){var e=N.select(".e-tab > ."+C,this.element);this.element.classList.remove(Ni),N.isNullOrUndefined(e)||(e.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)N.remove(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&0<this.draggableItems.length){for(var t=0;t<this.draggableItems.length;t++)this.draggableItems[t].destroy(),this.draggableItems[t]=null;this.draggableItems=[]}hs.prototype.destroy.call(this),this.trigger("destroyed")},h.prototype.refresh=function(){this.isReact&&this.clearTemplate(),hs.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},h.prototype.refreshOverflow=function(){N.isNullOrUndefined(this.tbObj)||(this.tbObj.refreshOverflow(),this.updatePopupIconAriaLabel())},h.prototype.preRender=function(){var e=N.closest(this.element,"."+C),e=(this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwiped=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=N.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" ."+Ii:this.dragArea),N.isNullOrUndefined(e)||(e.parentElement.classList.add(xi),this.isNested=!0),N.Browser.info.name),e="msie"===e?"e-ie":"edge"===e?"e-edge":"safari"===e?"e-safari":"";N.setStyleAttribute(this.element,{width:N.formatUnit(this.width),height:N.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),N.attributes(this.element,{"aria-disabled":"false"}),this.setCssClass(this.element,e,!0),this.updatePopAnimationConfig()},h.prototype.render=function(){var e=this;this.btnCls=this.createElement("span",{className:Li+" "+Di,attrs:{title:this.title}}),this.tabId=0<this.element.id.length?"-"+this.element.id:N.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1,this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow(),e.selectingContent(e.selectedItem,e.isInteracted),e.refreshActiveBorder()}),this.isAngular&&this.registeredTemplate&&!N.isNullOrUndefined(this.registeredTemplate.headerTemplate)&&setTimeout(function(){e.refreshOverflow(),e.refreshActiveBorder()},5)},h.prototype.renderContainer=function(){var e=this.element;this.items.forEach(function(e,t){N.isNullOrUndefined(e.id)&&!N.isNullOrUndefined(e.setProperties)&&e.setProperties({id:Ji+t.toString()},!0)}),0<this.items.length&&0===e.children.length?(e.appendChild(this.createElement("div",{className:C})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:Ii})),this.isTemplate=!1):0<this.element.children.length&&(this.isTemplate=!0,e.classList.add(Ni),e=e.querySelector("."+Ii))&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,e),N.isNullOrUndefined(N.select("."+Ii,this.element))||N.isNullOrUndefined(N.select("."+C,this.element))||(this.renderHeader(),this.tbItems=N.select("."+Ii+" ."+Vi,this.element),N.isNullOrUndefined(this.tbItems)||N.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),0<N.selectAll("."+I,this.element).length&&(this.tbItems=N.select("."+Ii+" ."+Vi,this.element),this.bdrLine=this.createElement("div",{className:Hi+" "+S+" e-ignore"}),e=N.select("."+this.scrCntClass,this.tbItems),N.isNullOrUndefined(e)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):e.insertBefore(this.bdrLine,e.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)),this.setRTL(this.enableRtl))},h.prototype.renderHeader=function(){var n=this,e=this.headerPlacement,t=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){1<this.element.children.length&&this.element.children[1].classList.contains(Ii)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var r,i=this.hdrEle.children.length,s=[],l=0;l<i;l++)s.push(this.hdrEle.children.item(l));0<i&&(r=this.createElement("div",{className:"e-items"}),this.hdrEle.appendChild(r),s.forEach(function(e,t){n.lastIndex=t;var i={className:Ei,id:Ei+n.tabId+"_"+t},s=n.createElement("span",{className:Mi,attrs:{role:"presentation"}}).outerHTML,s=n.createElement("div",{className:Ri,innerHTML:s+n.btnCls.outerHTML}).outerHTML,s=n.createElement("div",{className:Ui,innerHTML:s,attrs:{role:"tab",tabIndex:"-1","aria-selected":"false","aria-controls":C+n.tabId+"_"+t,"aria-disabled":"false"}});s.querySelector("."+Mi).appendChild(e),r.appendChild(n.createElement("div",i)),N.selectAll("."+Ei,r)[t].appendChild(s)}))}else t=this.parseObject(this.items,0);this.tbObj=new Lt({width:"Left"===e||"Right"===e?"auto":"100%",height:"Left"===e||"Right"===e?"100%":"auto",overflowMode:this.overflowMode,items:0!==t.length?t:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),N.attributes(this.hdrEle,{role:"tablist"}),N.isNullOrUndefined(this.element.getAttribute("aria-label"))?N.isNullOrUndefined(this.element.getAttribute("aria-labelledby"))||(this.hdrEle.setAttribute("aria-labelledby",this.element.getAttribute("aria-labelledby")),this.element.removeAttribute("aria-labelledby")):(this.hdrEle.setAttribute("aria-label",this.element.getAttribute("aria-label")),this.element.removeAttribute("aria-label")),this.updatePopupIconAriaLabel(),this.setCloseButton(this.showCloseButton);e=this.tbObj.element.querySelector("."+Vi);N.isNullOrUndefined(e)||!N.isNullOrUndefined(e.id)&&""!==e.id||(e.id=this.element.id+"_tab_header_items")},h.prototype.updatePopupIconAriaLabel=function(){var e,t;N.isNullOrUndefined(this.hdrEle)||N.isNullOrUndefined(this.tbObj)||"Popup"!==this.tbObj.overflowMode||(e=this.hdrEle.querySelector("."+qi),N.isNullOrUndefined(e))||(t=(window.getComputedStyle(e,"::before").getPropertyValue("content")||"").trim().replace(/^['"]|['"]$/g,"").replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\"),e.setAttribute("aria-label",t&&"none"!==t&&"normal"!==t?t:"overflow"))},h.prototype.createContentElement=function(e){var t=this.createElement("div",{id:C+this.tabId+"_"+e,className:Ei,attrs:{role:"tabpanel","aria-labelledby":Ei+this.tabId+"_"+e}});return(-1!==["Dynamic","Demand"].indexOf(this.loadOn)||"Init"===this.loadOn&&e===this.selectedItem)&&N.addClass([t],d),t},h.prototype.renderContent=function(){this.cntEle=N.select("."+C,this.element);var e=N.selectAll("."+I,this.element);if(this.isTemplate){this.cnt=0<this.cntEle.children.length?this.cntEle.innerHTML:"";for(var t=this.cntEle.children,i=0;i<e.length;i++)t.length-1>=i&&(N.addClass([t.item(i)],Ei),N.attributes(t.item(i),{role:"tabpanel","aria-labelledby":Ei+this.tabId+"_"+i}),t.item(i).id=C+this.tabId+"_"+i)}else if(0<N.selectAll("."+I,this.element).length)if("Init"===this.loadOn)for(i=0;i<this.itemIndexArray.length;i++)this.itemIndexArray[i]&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[i]))));else"Dynamic"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(0<this.selectedItem?this.selectedItem:Number(this.extIndex(this.itemIndexArray[0]))))},h.prototype.reRenderItems=function(){this.renderContainer(),N.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents()},h.prototype.parseObject=function(e,h){var c,p=this,u=Array.prototype.slice.call(N.selectAll(".e-tab-header ."+I,this.element)),m=this.lastIndex,f=(!this.isReplace&&0<u.length&&(m=this.getMaxIndicesFromItems(u)),[]),g=[];return e.forEach(function(e,t){var i,s,n,r,l,o,a=N.isNullOrUndefined(e.header)||N.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,d=N.isNullOrUndefined(e.header)||N.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;N.isNullOrUndefined(e.headerTemplate)&&(N.isNullOrUndefined(e.header)||N.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===d)?g.push(t):("string"==typeof(l=e.headerTemplate||e.header.text)&&p.enableHtmlSanitizer&&(l=N.SanitizeHtmlHelper.sanitize(l)),p.isReplace&&!N.isNullOrUndefined(p.tbId)&&""!==p.tbId?(i=parseInt(p.tbId.substring(p.tbId.lastIndexOf("_")+1),10),p.tbId=""):i=h+t,p.lastIndex=0===u.length?t:p.isReplace?i:m+1+t,i=e.disabled?" "+wi+" "+_i:"",s=!1===e.visible?" "+S:"",c=p.createElement("div",{className:Mi,attrs:{role:"presentation"}}),n=l instanceof Object?l.outerHTML:l,n=!N.isNullOrUndefined(n)&&""!==n,N.isNullOrUndefined(l.tagName)?p.headerTextCompile(c,l,t):c.appendChild(l),o=p.createElement("span",{className:Li+" "+Bi+" "+Ai+"-"+a+" "+d}),(r=p.createElement("div",{className:Ri})).appendChild(c),""!==l&&void 0!==l&&""!==d?("left"===a||"top"===a?r.insertBefore(o,r.firstElementChild):r.appendChild(o),p.isIconAlone=!1):(""===d?c:o)===o&&(N.detach(c),r.appendChild(o),p.isIconAlone=!0),l=N.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),o=e.disabled?{role:"tab","aria-disabled":"true"}:{tabIndex:l,"data-tabindex":l,role:"tab","aria-selected":"false","aria-disabled":"false"},r.appendChild(p.btnCls.cloneNode(!0)),(l=p.createElement("div",{className:Ui,attrs:o})).appendChild(r),p.itemIndexArray instanceof Array&&p.itemIndexArray.splice(h+t,0,Ei+p.tabId+"_"+p.lastIndex),(o={htmlAttributes:{id:Ei+p.tabId+"_"+p.lastIndex,"data-id":e.id},template:l}).cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+i+" "+s+" "+(""!==d?"e-i"+a:"")+" "+(n?"":Ai),"top"!==a&&"bottom"!==a||p.element.classList.add("e-vertical-icon"),f.push(o),t++)}),this.isAdd||g.forEach(function(e){p.items.splice(e,1)}),this.isIconAlone?this.element.classList.add(Ti):this.element.classList.remove(Ti),f},h.prototype.removeActiveClass=function(){var e=this.getTabHeader();e&&(e=N.selectAll("."+I+"."+d,e),[].slice.call(e).forEach(function(e){return e.classList.remove(d)}),[].slice.call(e).forEach(function(e){return e.firstElementChild.setAttribute("aria-selected","false")}))},h.prototype.checkPopupOverflow=function(e){this.tbPop=N.select("."+ji,this.element);var t=N.select(".e-hor-nav",this.element),i=N.select("."+Vi,this.element),s=i.lastChild,n=!1;return(n=!this.isVertical()&&(this.enableRtl&&t.offsetLeft+t.offsetWidth>i.offsetLeft||!this.enableRtl&&t.offsetLeft<i.offsetWidth)||this.isVertical()&&t.offsetTop<s.offsetTop+s.offsetHeight?!0:n)&&!N.isNullOrUndefined(e)&&(e.classList.add(Fi),this.tbPop.insertBefore(e,N.selectAll("."+Fi,this.tbPop)[0])),n},h.prototype.popupHandler=function(e){var t=e.querySelector(".e-ripple-element"),t=(N.isNullOrUndefined(t)||(t.outerHTML="",e.querySelector("."+Ui).classList.remove("e-ripple")),this.tbItem=N.selectAll("."+Vi+" ."+I,this.hdrEle),this.tbItem[this.tbItem.length-1]);if(0<=this.tbItem.length){if(e.classList.remove(Fi),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(t))for(var i=0;i<this.tbItems.children.length;i++){var s=(s=this.tbItems.lastChild.previousElementSibling)&&s.classList.contains(Hi)?s.previousElementSibling:s;if(!this.checkPopupOverflow(s||e))break}this.isPopup=!0}t=N.selectAll("."+I,this.tbItems).length;return 0<t?t-1:this.getEleIndex(e)},h.prototype.setCloseButton=function(e){var t=N.select("."+Ii,this.element);!0===e?t.classList.add(Pi):t.classList.remove(Pi),this.refreshOverflow(),this.refreshActiveTabBorder()},h.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains(Oi);e=this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null;return e},h.prototype.triggerPrevAnimation=function(e,t){var i=this,t=this.prevCtnAnimation(t,this.selectedItem);N.isNullOrUndefined(t)?e.classList.remove(d):(t.begin=function(){N.setStyleAttribute(e,{position:"absolute"}),e.classList.add(Wi),e.classList.add("e-view")},t.end=function(){e.style.display="none",e.classList.remove(d),e.classList.remove(Wi),e.classList.remove("e-view"),N.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||i.isTemplate||N.detach(e)},new N.Animation(t).animate(e))},h.prototype.triggerAnimation=function(e,t){var i,s,n,r=this,l=this.prevIndex,o=([].slice.call(this.element.querySelector("."+C).children).forEach(function(e){e.id===r.prevActiveEle&&(i=e)}),this.tbItem[l]),a=this.getTrgContent(this.cntEle,this.extIndex(e)),o=(N.isNullOrUndefined(i)&&!N.isNullOrUndefined(o)&&(e=this.extIndex(o.id),i=this.getTrgContent(this.cntEle,e)),N.isNullOrUndefined(a)||(this.prevActiveEle=a.id),N.isNullOrUndefined(this.animation)||N.isNullOrUndefined(this.animation.next.effect)||N.isNullOrUndefined(this.animation.previous.effect)||"None"===this.animation.previous.effect||"None"===this.animation.next.effect);this.initRender||!1===t||o?i&&i!==a&&i.classList.remove(d):(s=N.select("."+C,this.element),this.prevIndex>this.selectedItem&&!this.isPopup?n={name:"None"===(e=this.animation.previous.effect)?"":"SlideLeftIn"!==e?e:"SlideLeftIn",duration:0===this.animation.previous.duration&&"Enable"===N.animationMode?600:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem)&&(n={name:"None"===(t=this.animation.next.effect)?"":"SlideRightIn"!==t?t:"SlideRightIn",duration:0===this.animation.next.duration&&"Enable"===N.animationMode?600:this.animation.next.duration,timingFunction:this.animation.next.easing}),n.progress=function(){s.classList.add(Wi),r.setActiveBorder()},n.end=function(){s.classList.remove(Wi),a.classList.add(d)},this.initRender||N.isNullOrUndefined(i)||this.triggerPrevAnimation(i,l),this.isPopup=!1,""===n.name?a.classList.add(d):new N.Animation(n).animate(a))},h.prototype.keyPressed=function(e){var t=N.closest(e,"."+Ii+" ."+I),i=this.getEleIndex(t);!N.isNullOrUndefined(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():N.isNullOrUndefined(t)||!1!==t.classList.contains(d)||(this.selectTab(i,null,!0),N.isNullOrUndefined(this.popEle))||this.popObj.hide(this.hide)},h.prototype.getTabHeader=function(){var e;if(!N.isNullOrUndefined(this.element))return 0<(e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(Ii)})).length?e[0]:(e=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0])?[].slice.call(e.children).filter(function(e){return e.classList.contains(Ii)})[0]:void 0},h.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(N.selectAll("."+I,this.getTabHeader()),e)},h.prototype.extIndex=function(e){return e.replace(Ei+this.tabId+"_","")},h.prototype.getMaxIndicesFromItems=function(e){var t=this,i=[];return e.forEach(function(e){i.push(t.getIndexFromEle(e.id))}),Math.max.apply(Math,i)},h.prototype.expTemplateContent=function(){var t=this;this.templateEle.forEach(function(e){N.isNullOrUndefined(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")})},h.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.compileElement(s,t,"content",i),0!==s.childNodes.length&&e.appendChild(s),this.isReact&&this.renderReactTemplates()},h.prototype.compileElement=function(t,e,i,s){var n,r,l=this.heightAdjustMode,o=i;"string"==typeof e?(e=e.trim(),this.isVue?n=N.compile(this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(e):e):t.innerHTML=this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(e):e):n=N.compile(e),N.isNullOrUndefined(n)||(r=n({},this,i)),!N.isNullOrUndefined(n)&&0<r.length&&[].slice.call(r).forEach(function(e){"content"===o&&"Fill"===l&&e.style&&(e.style.height="100%"),t.appendChild(e)})},h.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},h.prototype.getContent=function(e,t,i,s){var n,r;"string"==typeof(t=N.isNullOrUndefined(t)?"":t)||N.isNullOrUndefined(t.innerHTML)?("."===(t="string"==typeof t&&this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(t):t)[0]||"#"===t[0])&&document.querySelectorAll(t).length?(r=(n=document.querySelector(t)).outerHTML.trim(),"clone"===i?e.appendChild(n.cloneNode(!0)):(e.appendChild(n),n.style.display="")):this.templateCompile(e,t,s):e.appendChild(t),N.isNullOrUndefined(r)||-1===this.templateEle.indexOf(t.toString())&&this.templateEle.push(t.toString())},h.prototype.getTrgContent=function(e,t){e=this.element.classList.contains(xi)?N.select("."+xi+"> ."+C+" > #"+C+this.tabId+"_"+t,this.element):this.findEle(e.children,C+this.tabId+"_"+t);return e},h.prototype.findEle=function(e,t){for(var i,s=0;s<e.length;s++)if(e[s].id===t){i=e[s];break}return i},h.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},h.prototype.addVerticalClass=function(){var e;this.isVertical()&&(e="Left"===this.headerPlacement?Xi:Yi,N.addClass([this.hdrEle],[Ki,e]),this.element.classList.contains(xi)?N.addClass([this.hdrEle],[zi,e]):N.addClass([this.element],[zi,e])),"Bottom"===this.headerPlacement&&N.addClass([this.hdrEle],[Gi])},h.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},h.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var e=this.hdrEle.querySelector("."+d),t=!!this.hdrEle.classList.contains(Ki);N.removeClass([this.element],[zi]),N.removeClass([this.hdrEle],[Ki,Xi,Yi]),t!==this.isVertical()&&(this.changeToolbarOrientation(),!N.isNullOrUndefined(e))&&e.classList.contains(Fi)&&this.popupHandler(e),this.addVerticalClass(),this.setActiveBorder(),this.focusItem()},h.prototype.focusItem=function(){var e=N.select(" #"+Ei+this.tabId+"_"+this.selectedItem,this.hdrEle);N.isNullOrUndefined(e)||e.firstElementChild.focus()},h.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},h.prototype.setOrientation=function(e,t){var i=Array.prototype.indexOf.call(this.element.children,t),s=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+C));"Bottom"===e&&i<s?this.element.appendChild(t):(N.removeClass([t],[Gi]),this.element.insertBefore(t,N.select("."+C,this.element)))},h.prototype.setCssClass=function(e,t,i){if(""!==t&&!N.isNullOrUndefined(t))for(var s=t.split(" "),n=0;n<s.length;n++)i?e.classList.add(s[n]):e.classList.remove(s[n])},h.prototype.loadContentInitMode=function(e){if(e&&"Init"===this.loadOn)for(var t=0;t<this.items.length;t++)this.cntEle.children.item(t)&&this.getContent(this.cntEle.children.item(t),this.items[t].content,"render",t)},h.prototype.loadContentElement=function(){var e;this.isTemplate||(e=this.cntEle.children.item(0),this.loadContentInitMode(e))},h.prototype.setContentHeight=function(e){if(this.element.classList.contains(Qi)&&N.removeClass([this.element],[Qi]),!N.isNullOrUndefined(this.cntEle)){var t=this.getTabHeader();if("None"===this.heightAdjustMode)this.loadContentElement(),"auto"===this.height||this.isVertical()||N.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-t.offsetHeight+"px"});else if("Fill"===this.heightAdjustMode)N.addClass([this.element],[Qi]),N.setStyleAttribute(this.element,{height:"100%"}),this.loadContentElement(),this.cntEle.style.height="calc(100% - "+this.hdrEle.offsetHeight+"px)";else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var i=N.selectAll("."+C+" > ."+Ei,this.element),s=0;s<i.length;s++)i[s].style.display="block",i[s].style.visibility="visible",this.maxHeight=Math.max(this.maxHeight,this.getHeight(i[s])),i[s].style.removeProperty("display"),i[s].style.removeProperty("visibility");else{this.cntEle=N.select("."+C,this.element),!0===e&&"Demand"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[0]))));for(var n=this.cntEle.children.item(0),s=0;s<this.items.length;s++)for(this.getContent(n,this.items[s].content,"clone",s),this.maxHeight=Math.max(this.maxHeight,this.getHeight(n));n.firstChild;)n.removeChild(n.firstChild);(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(["content"]),this.templateEle=[],"Demand"===this.loadOn&&this.getContent(n,this.items[0].content,"render",0),this.loadContentInitMode(n),this.prevIndex!==this.selectedItem&&n.classList.remove(d)}N.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else this.loadContentElement(),N.setStyleAttribute(this.cntEle,{height:"auto"})}},h.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},h.prototype.setActiveBorder=function(){var e,t,i=this.getTabHeader(),s=N.select("."+I+"."+d,i);N.isNullOrUndefined(s)||(this.reorderActiveTab?i&&i.classList.remove(Zi):(s.classList.contains(Fi)&&!this.bdrLine.classList.contains(S)&&this.bdrLine.classList.add(S),i&&!i.classList.contains(Zi)&&i.classList.add(Zi)),e=N.closest(s,"."+Si),this.element!==e)||(this.tbItems=N.select("."+Vi,i),e=N.select("."+Hi,i),i=N.select("."+Vi+" ."+this.scrCntClass,i),this.isVertical()?(N.setStyleAttribute(e,{left:"",right:""}),0!==(N.isNullOrUndefined(i)?this.tbItems:i).offsetHeight?N.setStyleAttribute(e,{top:s.offsetTop+"px",height:s.offsetHeight+"px"}):N.setStyleAttribute(e,{top:0,height:0})):("MultiRow"===this.overflowMode?(t="Bottom"===this.headerPlacement?s.offsetTop:s.offsetHeight+s.offsetTop,N.setStyleAttribute(e,{top:t+"px",height:""})):N.setStyleAttribute(e,{top:"",height:""}),0!==(t=(N.isNullOrUndefined(i)?this.tbItems:i).offsetWidth)?N.setStyleAttribute(e,{left:s.offsetLeft+"px",right:t-(s.offsetLeft+s.offsetWidth)+"px"}):N.setStyleAttribute(e,{left:"auto",right:"auto"})),N.isNullOrUndefined(this.bdrLine))||s.classList.contains(Fi)||this.bdrLine.classList.remove(S)},h.prototype.setActive=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1),this.tbItem=N.selectAll("."+I,this.getTabHeader());var s=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length||!N.isNullOrUndefined(s)&&s.classList.contains(wi)))if(0<=e&&!t&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),s.classList.contains(d))this.setActiveBorder();else{this.isTemplate||N.attributes(s.firstElementChild,{"aria-controls":C+this.tabId+"_"+this.extIndex(s.id)});var n=s.id,r=(this.removeActiveClass(),s.classList.add(d),s.firstElementChild.setAttribute("aria-selected","true"),Number(this.extIndex(n)));if(N.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle=C+this.tabId+"_"+r),this.isTemplate)0<N.select("."+C,this.element).children.length&&(r=this.findEle(N.select("."+C,this.element).children,C+this.tabId+"_"+r),N.isNullOrUndefined(r)||r.classList.add(d),this.triggerAnimation(n,this.enableAnimation));else{for(this.cntEle=N.select(".e-tab > ."+C,this.element);"Dynamic"===this.loadOn&&this.cntEle.firstElementChild;)this.cntEle.removeChild(this.cntEle.firstElementChild);var l,o,r=this.getTrgContent(this.cntEle,this.extIndex(n));N.isNullOrUndefined(r)?(this.cntEle.appendChild(this.createElement("div",{id:C+this.tabId+"_"+this.extIndex(n),className:Ei+" "+d,attrs:{role:"tabpanel","aria-labelledby":Ei+this.tabId+"_"+this.extIndex(n)}})),l=this.getTrgContent(this.cntEle,this.extIndex(n)),o=Array.prototype.indexOf.call(this.itemIndexArray,n),this.getContent(l,this.items[o].content,"render",o)):r.classList.add(d),this.triggerAnimation(n,this.enableAnimation)}this.setActiveBorder(),this.refreshItemVisibility(s),this.initRender||t||(l={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:s,selectedIndex:e,selectedContent:N.select("#"+C+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:i,preventFocus:!1},this.trigger("selected",l,function(e){e.preventFocus||s.firstElementChild.focus()}))}},h.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=N.select("."+Vi,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},h.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,Oi,e),this.refreshActiveBorder()},h.prototype.refreshActiveBorder=function(){N.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(S),this.setActiveBorder()},h.prototype.showPopup=function(e){var t=N.select(".e-popup.e-toolbar-pop",this.hdrEle);t&&t.classList.contains("e-popup-close")&&((t=t&&t.ej2_instances[0]).position.X="Left"===this.headerPlacement||this.element.classList.contains(Oi)?"left":"right",t.dataBind(),t.show(e))},h.prototype.bindDraggable=function(e){var t=this;if(e&&0<this.draggableItems.length){for(var i=0;i<this.draggableItems.length;i++)this.draggableItems[i].destroy(),this.draggableItems[i]=null;this.draggableItems=[]}this.allowDragAndDrop&&(e=this.element.querySelector("."+Ii))&&Array.prototype.slice.call(e.querySelectorAll("."+I)).forEach(function(e){t.initializeDrag(e)})},h.prototype.bindSwipeEvents=function(){"None"!==this.swipeMode&&(this.touchModule=new N.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},h.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),N.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),N.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),N.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents(),this.keyModule=new N.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new N.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},h.prototype.unWireEvents=function(){N.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),N.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),N.isNullOrUndefined(this.cntEle)||N.isNullOrUndefined(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),N.EventHandler.remove(this.element,"mouseover",this.hoverHandler),N.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove(Oi),this.element.classList.remove(ki)},h.prototype.clickHandler=function(e){this.element.classList.remove(ki);var t=e.originalEvent.target,i=N.closest(t,"."+I),s=this.getEleIndex(i);t.classList.contains(Di)?this.removeTab(s):this.isVertical()&&N.closest(t,"."+qi)?this.showPopup(this.show):(this.isPopup=!1,N.isNullOrUndefined(i)||s===this.selectedItem||this.selectTab(s,e.originalEvent,!0))},h.prototype.swipeHandler=function(e){if(!(e.velocity<3&&N.isNullOrUndefined(e.originalEvent.changedTouches)||"Touch"===this.swipeMode&&("mouseup"===e.originalEvent.type||"mouseleave"===e.originalEvent.type)||"Mouse"===this.swipeMode&&"touchend"===e.originalEvent.type||"None"===this.swipeMode)){this.isNested&&this.element.setAttribute("data-swipe","true");var t=this.element.querySelector('[data-swipe="true"]');if(t)t.removeAttribute("data-swipe");else{if(this.isSwiped=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var i=this.selectedItem-1;0<=i;i--)if(!this.tbItem[i].classList.contains(S)){this.selectTab(i,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==N.selectAll("."+I,this.element).length-1)for(var s=this.selectedItem+1;s<this.tbItem.length;s++)if(!this.tbItem[s].classList.contains(S)){this.selectTab(s,null,!0);break}this.isSwiped=!1}}},h.prototype.spaceKeyDown=function(e){var t;(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which)&&(t=N.closest(e.target,"."+Ii),N.isNullOrUndefined(t)||e.preventDefault())},h.prototype.keyHandler=function(e){if(!this.element.classList.contains(wi)){this.element.classList.add(ki);var t=e.target;if(t&&t.isConnected){var i,s=this.getTabHeader(),n=N.select("."+d,s),r=(this.popEle=N.select("."+ji,s),N.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]),N.closest(document.activeElement,"."+I)),l=N.closest(t,"."+I);switch(e.action){case"space":case"enter":t.parentElement&&t.parentElement.classList.contains(wi)||("enter"===e.action&&t.classList.contains("e-hor-nav")?this.showPopup(this.show):this.keyPressed(t));break;case"tab":case"shiftTab":t.classList.contains(Ui)&&!1===N.closest(t,"."+I).classList.contains(d)&&t.setAttribute("tabindex",t.getAttribute("data-tabindex")),this.popObj&&N.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),N.isNullOrUndefined(n)||"-1"!==n.children.item(0).getAttribute("tabindex")||n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":N.isNullOrUndefined(r)||this.refreshItemVisibility(r);break;case"openPopup":!N.isNullOrUndefined(e.target)&&e.target.classList.contains(Ui)&&e.preventDefault(),!N.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":!0!==this.showCloseButton||N.isNullOrUndefined(l)||(i=l.nextSibling,!N.isNullOrUndefined(i)&&i.classList.contains(I)&&i.firstElementChild.focus(),this.removeTab(this.getEleIndex(l))),this.setActiveBorder()}}}},h.prototype.refreshItemVisibility=function(e){var t,i,s,n,r=N.select("."+this.scrCntClass,this.tbItems);this.isVertical()||N.isNullOrUndefined(r)||(i=(t=(r=N.select(".e-hscroll-bar",this.tbItems)).scrollLeft)+r.offsetWidth,s=e.offsetLeft,n=e.offsetWidth,e=e.offsetLeft+e.offsetWidth,t<s&&i<e?r.scrollLeft=t+(n-(i-s)):s<t&&e<i&&(r.scrollLeft=t-(n-(e-t))))},h.prototype.getIndexFromEle=function(e){return parseInt(e.substring(e.lastIndexOf("_")+1),10)},h.prototype.hoverHandler=function(e){e=e.target;!N.isNullOrUndefined(e.classList)&&e.classList.contains(Di)&&e.setAttribute("title",new N.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},h.prototype.evalOnPropertyChangeItems=function(e,t){var i=this;if(e.items instanceof Array&&t.items instanceof Array)if(this.lastIndex=0,N.isNullOrUndefined(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),0<this.templateEle.length&&this.expTemplateContent(),this.templateEle=[];for(var s=N.select(".e-tab > ."+C,this.element);s.firstElementChild;)N.detach(s.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else{for(var n=Object.keys(e.items),r=0;r<n.length;r++)for(var l=parseInt(Object.keys(e.items)[r],10),o=Object.keys(e.items[l]),a=0;a<o.length;a++){var d,h,c=Object(t.items[l])[o[a]],p=Object(e.items[l])[o[a]],u=this.element.querySelectorAll("."+I)[l],m=void 0,m=u&&!N.isNullOrUndefined(u.id)&&""!==u.id?this.getIndexFromEle(u.id):l,f=N.select("."+Vi+" #"+Ei+this.tabId+"_"+m,this.element),m=N.select("."+C+" #"+C+this.tabId+"_"+m,this.element);"header"!==o[a]&&"headerTemplate"!==o[a]||(h=N.isNullOrUndefined(this.items[l].header)||N.isNullOrUndefined(this.items[l].header.iconCss)?"":this.items[l].header.iconCss,d=this.items[l].headerTemplate||this.items[l].header.text,"headerTemplate"===o[a]&&this.clearTabTemplate(f,o[a],I),""===d&&""===h?this.removeTab(l):(this.tbId=u.id,(d=[]).push(this.items[l]),this.items.splice(l,1),this.itemIndexArray.splice(l,1),this.tbObj.items.splice(l,1),h=f.classList.contains(S),N.detach(f),this.isReplace=!0,this.addTab(d,l),h&&this.hideTab(l),this.isReplace=!1)),"content"!==o[a]||N.isNullOrUndefined(m)||(("string"==typeof p||N.isNullOrUndefined(p.innerHTML))&&("."===p[0]||"#"===p[0])&&p.length?(u=document.querySelector(p),m.appendChild(u),u.style.display=""):""===p&&"#"===c[0]?(document.body.appendChild(this.element.querySelector(c)).style.display="none",m.innerHTML=p):this.isAngular||this.isReact?(this.clearTabTemplate(m,o[a],Ei),m.innerHTML="",this.templateCompile(m,p,l)):"function"!=typeof p&&(m.innerHTML=p)),"cssClass"===o[a]&&(N.isNullOrUndefined(f)||(N.isNullOrUndefined(c)||""===c||f.classList.remove(c),N.isNullOrUndefined(p))||""===p||f.classList.add(p),N.isNullOrUndefined(m)||(N.isNullOrUndefined(c)||""===c||m.classList.remove(c),N.isNullOrUndefined(p))||""===p||m.classList.add(p)),"disabled"===o[a]&&this.enableTab(l,!0!==p),"visible"===o[a]&&this.hideTab(l,!0!==p)}this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){i.refreshActiveTabBorder()})}},h.prototype.clearTabTemplate=function(e,t,i){if(this.clearTemplates)if(this.registeredTemplate&&this.registeredTemplate[t])for(var s=this.registeredTemplate,n=0;n<s[t].length;n++){var r=s[t][n].rootNodes[0],l=N.closest(r,"."+i);if(!N.isNullOrUndefined(l)&&l===e){this.clearTemplate([t],[s[t][n]]);break}}else if(this.portals&&0<this.portals.length)for(var o=this.portals,n=0;n<o.length;n++){var a=o[n],l=N.closest(a.containerInfo,"."+i);if(!N.isNullOrUndefined(l)&&l===e){this.clearTemplate([t],n);break}}},h.prototype.initializeDrag=function(e){var l=this,e=new N.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+I,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var t,i,s,n=l.getEleIndex(l.dragItem),r={draggedItem:l.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+I),clonedElement:l.cloneElement,index:n};(N.isNullOrUndefined(e.target.closest("."+Si))||e.target.closest("."+Si).isEqualNode(l.element)||l.dragArea==="."+Ii)&&(e.target.closest(l.dragArea)||"Popup"===l.overflowMode?(document.body.style.cursor="",l.dragItem.querySelector("."+Ui).style.visibility="hidden",l.cloneElement.classList.contains(S)&&N.removeClass([l.cloneElement],S)):(document.body.style.cursor="not-allowed",N.addClass([l.cloneElement],S),l.dragItem.classList.contains(S)&&N.removeClass([l.dragItem],S),l.dragItem.querySelector("."+Ui).style.visibility="visible"),"Scrollable"!==l.overflowMode||N.isNullOrUndefined(l.element.querySelector(".e-hscroll"))||(t=l.element.querySelector(".e-scroll-right-nav"),s=l.element.querySelector(".e-scroll-left-nav"),i=l.element.querySelector(".e-hscroll-bar"),!N.isNullOrUndefined(t)&&Math.abs(t.offsetWidth/2+t.offsetLeft)>l.cloneElement.offsetLeft+l.cloneElement.offsetWidth&&(i.scrollLeft-=10),!N.isNullOrUndefined(s)&&Math.abs(s.offsetLeft+s.offsetWidth-l.cloneElement.offsetLeft)>s.offsetWidth/2&&(i.scrollLeft+=10)),l.cloneElement.style.pointerEvents="none",t=N.closest(e.target,"."+I+".e-draggable"),s=0,"Scrollable"!==l.overflowMode||N.isNullOrUndefined(l.element.querySelector(".e-hscroll"))||(s=l.element.querySelector(".e-hscroll-content").offsetWidth),null!=t&&!t.isSameNode(l.dragItem)&&t.closest("."+Si).isSameNode(l.dragItem.closest("."+Si))&&((i=l.getEleIndex(t))<n&&Math.abs(t.offsetLeft+t.offsetWidth-l.cloneElement.offsetLeft)>t.offsetWidth/2&&l.dragAction(t,n,i),n<i)&&Math.abs(t.offsetWidth/2)+t.offsetLeft-s<l.cloneElement.offsetLeft+l.cloneElement.offsetWidth&&l.dragAction(t,n,i),l.droppedIndex=l.getEleIndex(l.dragItem)),l.trigger("dragging",r)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(e)},h.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),N.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+Ii).classList.contains(Pi)&&N.addClass([this.cloneElement],Pi),N.removeClass([this.cloneElement.querySelector("."+Ui)],"e-ripple"),N.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||N.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},h.prototype.itemDragStart=function(t){var i=this,e=(this.draggingItems=this.items.map(function(e){return e}),this.dragItem=t.element,{draggedItem:t.element,event:t.event,target:t.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1});this.trigger("onDragStart",e,function(e){e.cancel?(e=t.element.ej2_instances[0],N.isNullOrUndefined(e)||e.intDestroy(t.event),N.detach(i.cloneElement)):(i.removeActiveClass(),N.addClass([i.tbItems.querySelector("."+Hi)],S),i.dragItem.querySelector("."+Ui).style.visibility="hidden")})},h.prototype.dragAction=function(e,t,i){var s,n;0<this.items.length&&(s=this.draggingItems[t],this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)),"MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),i<t&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e):"Extended"===this.overflowMode?e.isSameNode(e.parentElement.lastChild)?(n=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(e.parentElement.lastChild,n.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)):(s=e.parentElement.lastChild,e.isSameNode(s)?(n=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(s,n.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))),t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e.nextElementSibling):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},h.prototype.itemDragStop=function(e){var t=this,e=(N.detach(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+Ui).style.visibility="visible",document.body.style.cursor="",{draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1});this.trigger("dragged",e,function(e){e.cancel?t.refresh():0<t.items.length&&0<t.draggingItems.length?(t.items=t.draggingItems,t.selectedItem=N.isNullOrUndefined(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.refresh()):(t.dragItem.querySelector("."+Ui).style.visibility="",N.removeClass([t.tbItems.querySelector("."+Hi)],S),t.droppedIndex=N.isNullOrUndefined(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.selectTab(t.droppedIndex,null,!0))}),this.dragItem=null,this.droppedIndex=null},h.prototype.enableTab=function(e,t){var i=N.selectAll("."+I,this.element)[e];N.isNullOrUndefined(i)||(!0===t?(i.classList.remove(wi,_i),i.firstElementChild.setAttribute("tabindex",i.firstElementChild.getAttribute("data-tabindex"))):(i.classList.add(wi,_i),i.firstElementChild.removeAttribute("tabindex"),i.classList.contains(d)&&this.select(e+1)),N.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!t,this.dataBind()),i.firstElementChild.setAttribute("aria-disabled",!0===t?"false":"true"))},h.prototype.addTab=function(t,i){var s=this,e={addedItems:t,cancel:!1};if(this.isReplace)this.addingTabContent(t,i),this.updatePopupIconAriaLabel();else{for(var n=0,r=t;n<r.length;n++){var l=r[n];l.disabled=l.disabled||!1,l.visible=l.visible||!0}t&&0!==t.length&&this.element&&this.element.classList.contains(S)&&this.element.classList.remove(S),this.trigger("adding",e,function(e){e.cancel||(s.addingTabContent(t,i),s.updatePopupIconAriaLabel())})}this.isReact&&this.renderReactTemplates()},h.prototype.addingTabContent=function(e,n){var t,i,r,l,o,a=this,d=0;this.hdrEle=N.select("."+Ii,this.element),N.isNullOrUndefined(this.hdrEle)?(this.items=e,this.reRenderItems(),this.bindDraggable()):(0!==(i=(t=Array.from(N.selectAll(".e-tab-header ."+I,this.element))).length)&&(d=this.getMaxIndicesFromItems(t)+1),i<(n=N.isNullOrUndefined(n)?i-1:n)||n<0||isNaN(n)||(0!==i||N.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),N.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(S),this.tbItems=N.select("."+Vi,this.getTabHeader()),this.isAdd=!0,r=this.parseObject(e,n),this.isAdd=!1,l=0,e.forEach(function(e,t){var i,s;o=e.headerTemplate||e.header.text,N.isNullOrUndefined(e.headerTemplate||e.header)||N.isNullOrUndefined(o)||0===o.length&&!N.isNullOrUndefined(e.header)&&N.isNullOrUndefined(e.header.iconCss)||(r[t]&&(N.isNullOrUndefined(e.id)&&(e.id=Ei+a.tabId+"_"+Ji+(d+t).toString()),r[t].htmlAttributes["data-id"]=e.id),a.items.splice(n+l,0,e),l++),N.isNullOrUndefined(e.header)||N.isNullOrUndefined(e.header.text)||!a.isTemplate&&"Init"!==a.loadOn||(i=d+t,s=a.createElement("div",{id:C+a.tabId+"_"+i,className:Ei,attrs:{role:"tabpanel","aria-labelledby":Ei+"_"+i}}),a.cntEle.insertBefore(s,a.cntEle.children[n+t]),s=a.getTrgContent(a.cntEle,i.toString()),a.getContent(s,e.content,"render",n))}),this.tbObj.addItems(r,n),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===n?this.select(n):(this.setActiveBorder(),this.tbItem=N.selectAll("."+I,this.getTabHeader())),this.bindDraggable()))},h.prototype.removeTab=function(i){var e,s=this,n=N.selectAll("."+I,this.hdrEle)[i];N.isNullOrUndefined(n)||(e={removedItem:n,removedIndex:i,cancel:!1},this.trigger("removing",e,function(e){var t;e.cancel||(t=N.select("#"+Ei+s.tabId+"_"+s.extIndex(n.id),N.select("."+Vi,s.hdrEle)),N.isNullOrUndefined(t)||s.clearTabTemplate(t,"headerTemplate",I),s.tbObj.removeItems(i),s.allowDragAndDrop&&i!==Array.prototype.indexOf.call(s.itemIndexArray,n.id)&&(i=Array.prototype.indexOf.call(s.itemIndexArray,n.id)),t=s.itemIndexArray.indexOf(n.id),s.items.splice(t,1),s.itemIndexArray.splice(t,1),s.refreshActiveBorder(),t=N.select("#"+C+s.tabId+"_"+s.extIndex(n.id),N.select("."+C,s.element)),N.isNullOrUndefined(t)||(s.clearTabTemplate(t,"content",Ei),N.detach(t)),s.trigger("removed",e),s.draggableItems&&0<s.draggableItems.length&&(s.draggableItems[i].destroy(),s.draggableItems[i]=null,s.draggableItems.splice(i,1)),n.classList.contains(d)?(i=i>N.selectAll("."+I+":not(."+Fi+")",s.element).length-1?i-1:i,s.enableAnimation=!1,s.tbItem=N.selectAll("."+I,s.getTabHeader()),i=s.getSelectingTabIndex(i),i=!isNaN(i)&&0<=i&&s.tbItem.length>i?i:0,(t=s.tbItem[i])&&(t.classList.contains(S)&&t.classList.remove(S),e=t.firstElementChild)&&e.hasAttribute("aria-hidden")&&e.removeAttribute("aria-hidden"),s.selectedItem=i,s.select(i)):i!==s.selectedItem&&(i<s.selectedItem&&(i=s.itemIndexArray.indexOf(s.tbItem[s.selectedItem].id),s.setProperties({selectedItem:-1<i?i:s.selectedItem},!0),s.prevIndex=s.selectedItem),s.tbItem=N.selectAll("."+I,s.getTabHeader())),0===N.selectAll("."+I,s.element).length&&(t=N.select("."+C,s.element),N.detach(s.hdrEle),N.detach(t)),s.enableAnimation=!0)}))},h.prototype.hideTab=function(e,t){0<=e&&e<this.tbItem.length&&(s=this.tbItem[e].getAttribute("id"));var i,s=this.element.querySelector('[id="'+s+'"]');if(!N.isNullOrUndefined(s)){if(N.isNullOrUndefined(t)&&(t=!0),this.bdrLine.classList.add(S),!0===t)if(s.classList.add(S),0!==(i=N.selectAll("."+I+":not(."+S+")",this.tbItems)).length&&s.classList.contains(d)){if(0!==e)for(var n=e-1;0<=n;n--){if(!this.tbItem[n].classList.contains(S)){this.select(n);break}if(0===n)for(var r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(S)){this.select(r);break}}else for(r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(S)){this.select(r);break}}else 0===i.length&&this.element.classList.add(S);else this.element.classList.remove(S),i=N.selectAll("."+I+":not(."+S+")",this.tbItems),s.classList.remove(S),0===i.length&&this.select(e);this.setActiveBorder(),N.isNullOrUndefined(this.items[e])||(this.items[e].visible=!t,this.dataBind()),N.isNullOrUndefined(s.firstElementChild)||s.firstElementChild.setAttribute("aria-hidden",""+t),"Popup"===this.overflowMode&&this.refreshOverflow()}},h.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),this.isInteracted=i=void 0===i?!1:i,this.select(e,t)},h.prototype.select=function(t,e){var i=this,s=this.getTabHeader(),s=(this.tbItems=N.select("."+Vi,s),this.tbItem=N.selectAll("."+I,s),this.content=N.select("."+C,this.element),this.prevItem=this.tbItem[this.prevIndex],N.isNullOrUndefined(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id),this.tbItem[t]),e=(N.isNullOrUndefined(s)?this.selectedID="0":this.selectingID=this.extIndex(s.id),N.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains(wi)||this.prevItem.children.item(0).setAttribute("tabindex",this.prevItem.firstElementChild.getAttribute("tabindex")),{event:e,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:N.isNullOrUndefined(this.content)?null:N.select("#"+C+this.tabId+"_"+this.selectedID,this.content),selectingItem:s,selectingIndex:t,selectingContent:N.isNullOrUndefined(this.content)?null:N.select("#"+C+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:this.isInteracted,cancel:!1});this.initRender?this.selectingContent(t,this.isInteracted):this.trigger("selecting",e,function(e){e.cancel||i.selectingContent(t,i.isInteracted)}),this.isInteracted=!1},h.prototype.getSelectingTabIndex=function(e){if(!N.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains(wi)||this.tbItem[e].classList.contains(S)))for(var t=e+1;t<this.items.length;t++){if(!1===this.items[t].disabled&&!0===this.items[t].visible){e=t;break}e=0}return e},h.prototype.selectingContent=function(e,t){var i;"number"==typeof e?(e=this.getSelectingTabIndex(e),this.tbItem.length>e&&0<=e&&!isNaN(e)?(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(Fi)&&this.reorderActiveTab?(this.setActive(this.popupHandler(this.tbItem[e]),null,t),!N.isNullOrUndefined(this.items)&&0<this.items.length&&this.allowDragAndDrop&&(this.tbItem=N.selectAll("."+Vi+" ."+I,this.hdrEle),i=this.items[e],this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,i),i=this.itemIndexArray[e],this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,i))):this.setActive(e,null,t)):this.setActive(0,null,t)):e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,t)},h.prototype.getItemIndex=function(e){var t;this.tbItem=N.selectAll("."+I,this.getTabHeader());for(var i=0;i<this.tbItem.length;i++)if(e===this.tbItem[i].getAttribute("data-id")){t=i;break}return t},h.prototype.disable=function(e){this.setCssClass(this.element,wi,e),this.element.setAttribute("aria-disabled",""+e)},h.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},h.prototype.getModuleName=function(){return"tab"},h.prototype.onPropertyChanged=function(e,t){for(var i=this,s=0,n=Object.keys(e).sort(function(e,t){return"items"===e?-1:"items"===t?1:0});s<n.length;s++)switch(n[s]){case"width":N.setStyleAttribute(this.element,{width:N.formatUnit(e.width)});break;case"height":N.setStyleAttribute(this.element,{height:N.formatUnit(e.height)}),this.setContentHeight(!1);break;case"cssClass":var r=this.element.querySelector("."+Ii);""===t.cssClass||N.isNullOrUndefined(t.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),N.isNullOrUndefined(r)||this.setCssClass(r,e.cssClass,!0)):(this.setCssClass(this.element,t.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),N.isNullOrUndefined(r)||(this.setCssClass(r,t.cssClass,!1),this.setCssClass(r,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,t);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=t.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder(),this.updatePopupIconAriaLabel();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable(!0);break;case"swipeMode":this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.bindSwipeEvents();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=i.dragArea}),this.refresh())}},h.prototype.refreshActiveTab=function(){var e,t,i,s,n,r,l,o,a;this.isReact&&this.isTemplate&&this.clearTemplate(),this.isTemplate?(e=this.element.querySelector("."+Vi),o=this.element.querySelector("."+I+"."+d),t=this.getIndexFromEle(o.id),n=o.innerText,s=(r=this.element.querySelector("."+C).querySelector("."+d).children[0]).innerHTML,N.detach(o),N.detach(r),r={className:I+" "+Ni+" "+d,id:Ei+this.tabId+"_"+t},n=this.createElement("span",{className:Mi,innerHTML:n,attrs:{role:"presentation"}}).outerHTML,n=this.createElement("div",{className:Ri,innerHTML:n+this.btnCls.outerHTML}).outerHTML,o=o.firstElementChild.getAttribute("data-tabindex"),n=this.createElement("div",{className:Ui,innerHTML:n,attrs:{tabIndex:o,"data-tabindex":o,role:"tab","aria-controls":C+this.tabId+"_"+t,"aria-selected":"true","aria-disabled":"false"}}),e.insertBefore(this.createElement("div",r),e.children[t+1]),this.element.querySelector("."+I+"."+d).appendChild(n),r=this.createElement("div",{innerHTML:s}),this.element.querySelector("."+C).querySelector("."+d).appendChild(r)):this.element.querySelector("."+I+"."+d)&&(N.detach(this.element.querySelector("."+I+"."+d).children[0]),N.detach(this.element.querySelector("."+C).querySelector("."+d).children[0]),e=this.items[this.selectedItem],t=N.isNullOrUndefined(e.header)||N.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,n=N.isNullOrUndefined(e.header)||N.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss,s=e.headerTemplate||e.header.text,a=this.createElement("div",{className:Mi,attrs:{role:"presentation"}}),N.isNullOrUndefined(s.tagName)?this.headerTextCompile(a,s,this.selectedItem):a.appendChild(s),l=this.createElement("span",{className:Li+" "+Bi+" "+Ai+"-"+t+" "+n}),(i=this.createElement("div",{className:Ri})).appendChild(a),""!==s&&void 0!==s&&""!==n?("left"===t||"top"===t?i.insertBefore(l,i.firstElementChild):i.appendChild(l),this.isIconAlone=!1):(""===n?a:l)===l&&(N.detach(a),i.appendChild(l),this.isIconAlone=!0),o=N.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),s=e.disabled?{}:{tabIndex:o,"data-tabindex":o,role:"tab","aria-selected":"true","aria-disabled":"false"},i.appendChild(this.btnCls.cloneNode(!0)),(n=this.createElement("div",{className:Ui,attrs:s})).appendChild(i),"top"!==t&&"bottom"!==t||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+I+"."+d).appendChild(n),r=this.createElement("div"),a=void 0,"string"==typeof(l=e.content)||N.isNullOrUndefined(l.innerHTML)?("."===(l="string"==typeof l&&this.enableHtmlSanitizer?N.SanitizeHtmlHelper.sanitize(l):l)[0]||"#"===l[0])&&document.querySelectorAll(l).length?(a=(o=document.querySelector(l)).outerHTML.trim(),r.appendChild(o),o.style.display=""):this.compileElement(r,l,"content",this.selectedItem):r.appendChild(l),N.isNullOrUndefined(a)||-1===this.templateEle.indexOf(l.toString())&&this.templateEle.push(l.toString()),this.element.querySelector(".e-item."+d).appendChild(r)),this.isReact&&this.renderReactTemplates()},h.prototype.refreshActiveTabBorder=function(){"None"===this.heightAdjustMode&&"auto"!==this.height&&this.cntEle&&!this.isVertical()&&(e=this.getTabHeader(),N.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-e.offsetHeight+"px"}));var e=N.select("."+I+"."+Fi+"."+d,this.element);!N.isNullOrUndefined(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder(),this.updatePopupIconAriaLabel()},o([N.Collection([],as)],h.prototype,"items",void 0),o([N.Property("100%")],h.prototype,"width",void 0),o([N.Property("Both")],h.prototype,"swipeMode",void 0),o([N.Property("auto")],h.prototype,"height",void 0),o([N.Property("")],h.prototype,"cssClass",void 0),o([N.Property(0)],h.prototype,"selectedItem",void 0),o([N.Property("Top")],h.prototype,"headerPlacement",void 0),o([N.Property("Content")],h.prototype,"heightAdjustMode",void 0),o([N.Property("Scrollable")],h.prototype,"overflowMode",void 0),o([N.Property("Demand")],h.prototype,"loadOn",void 0),o([N.Property(!1)],h.prototype,"enablePersistence",void 0),o([N.Property(!0)],h.prototype,"enableHtmlSanitizer",void 0),o([N.Property(!1)],h.prototype,"showCloseButton",void 0),o([N.Property(!0)],h.prototype,"reorderActiveTab",void 0),o([N.Property()],h.prototype,"scrollStep",void 0),o([N.Property()],h.prototype,"dragArea",void 0),o([N.Property(!1)],h.prototype,"allowDragAndDrop",void 0),o([N.Property(!0)],h.prototype,"clearTemplates",void 0),o([N.Complex({},is)],h.prototype,"animation",void 0),o([N.Event()],h.prototype,"created",void 0),o([N.Event()],h.prototype,"adding",void 0),o([N.Event()],h.prototype,"added",void 0),o([N.Event()],h.prototype,"selecting",void 0),o([N.Event()],h.prototype,"selected",void 0),o([N.Event()],h.prototype,"removing",void 0),o([N.Event()],h.prototype,"removed",void 0),o([N.Event()],h.prototype,"onDragStart",void 0),o([N.Event()],h.prototype,"dragging",void 0),o([N.Event()],h.prototype,"dragged",void 0),o([N.Event()],h.prototype,"destroyed",void 0);var hs,fi=o([N.NotifyPropertyChanges],h);function h(e,t){e=hs.call(this,e,t)||this;return e.show={},e.hide={},e.maxHeight=0,e.title="Close",e.isInteracted=!1,e.lastIndex=0,e.isAdd=!1,e.isIconAlone=!1,e.draggableItems=[],e.resizeContext=e.refreshActiveTabBorder.bind(e),e.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},e}cs=function(e,t){return(cs=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 cs,ps,o=function(e,t){function i(){this.constructor=e}cs(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},c=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},us="e-treeview",ms="e-control",u="e-icon-collapsible",E="e-icon-expandable",w="e-list-item",fs="e-list-text",k="e-list-parent",gs="e-hover",vs="e-active",ys="e-icons-spinner",bs="e-process",L="e-icons",Cs="e-text-content",Ss="e-input",Is="e-input-group",xs="e-tree-input",Es="e-editing",Ns="e-interaction",Os="e-droppable",ws="e-dragging",ks="e-sibling",Ls="e-drop-in",As="e-drop-next",Ts="e-drop-out",Ds="e-no-drop",Ps="e-fullrow",Ms="e-selected",Hs="e-expanded",Us="e-node-collapsed",Rs="e-disable",Bs="e-check",Vs="e-stop",js="e-treeview-checkbox",Fs="e-frame",qs="e-ripple",Ws="e-node-focus",_s="e-focused",zs="e-list-img",Ks="e-has-child",Xs="e-animation-active",Ys="e-disabled",Gs="e-prevent",Qs="e-virtualization",Js={treeRole:"group",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},Zs=(ps=N.ChildProperty,o($s,ps),c([N.Property("child")],$s.prototype,"child",void 0),c([N.Property([])],$s.prototype,"dataSource",void 0),c([N.Property("expanded")],$s.prototype,"expanded",void 0),c([N.Property("hasChildren")],$s.prototype,"hasChildren",void 0),c([N.Property("htmlAttributes")],$s.prototype,"htmlAttributes",void 0),c([N.Property("iconCss")],$s.prototype,"iconCss",void 0),c([N.Property("id")],$s.prototype,"id",void 0),c([N.Property("imageUrl")],$s.prototype,"imageUrl",void 0),c([N.Property("isChecked")],$s.prototype,"isChecked",void 0),c([N.Property("parentID")],$s.prototype,"parentID",void 0),c([N.Property(null)],$s.prototype,"query",void 0),c([N.Property("selectable")],$s.prototype,"selectable",void 0),c([N.Property("selected")],$s.prototype,"selected",void 0),c([N.Property(null)],$s.prototype,"tableName",void 0),c([N.Property("text")],$s.prototype,"text",void 0),c([N.Property("tooltip")],$s.prototype,"tooltip",void 0),c([N.Property("navigateUrl")],$s.prototype,"navigateUrl",void 0),$s);function $s(){return null!==ps&&ps.apply(this,arguments)||this}en=N.ChildProperty,o(sn,en),c([N.Property("SlideDown")],sn.prototype,"effect",void 0),c([N.Property(400)],sn.prototype,"duration",void 0),c([N.Property("linear")],sn.prototype,"easing",void 0);var en,tn=sn;function sn(){return null!==en&&en.apply(this,arguments)||this}nn=N.ChildProperty,o(ln,nn),c([N.Complex({effect:"SlideUp",duration:400,easing:"linear"},tn)],ln.prototype,"collapse",void 0),c([N.Complex({effect:"SlideDown",duration:400,easing:"linear"},tn)],ln.prototype,"expand",void 0);var nn,rn=ln;function ln(){return null!==nn&&nn.apply(this,arguments)||this}on=N.Component,o(p,on),(an=p).prototype.getModuleName=function(){return"treeview"},p.prototype.preRender=function(){var t=this;this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",ctrlA:"ctrl+A",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",shiftSpace:"shift+space",ctrlSpace:"ctrl+space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:E,ariaAttributes:Js,expandIconPosition:"Left",itemCreated:function(e){t.beforeNodeCreate(e)},enableHtmlSanitizer:this.enableHtmlSanitizer,disableHtmlEncode:this.disableHtmlEncode,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new N.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource)),N.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),N.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),N.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},p.prototype.getPersistData=function(){return this.addOnPersist(["selectedNodes","checkedNodes","expandedNodes"])},p.prototype.render=function(){this.initialRender=!0,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.initialRender=!1,this.renderComplete()},p.prototype.initialize=function(){this.element.setAttribute("role","tree"),!N.isNullOrUndefined(this.fields.dataSource)&&Array.isArray(this.fields.dataSource)&&0!==this.fields.dataSource.length&&this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},p.prototype.setDisabledMode=function(){this.disabled?(this.element.classList.add(Ys),this.element.setAttribute("aria-disabled","true")):(this.element.classList.remove(Ys),this.element.setAttribute("aria-disabled","false"))},p.prototype.setEnableRtl=function(){(this.enableRtl?N.addClass:N.removeClass)([this.element],"e-rtl")},p.prototype.setRipple=function(){this.rippleFn=N.rippleEffect(this.element,{selector:".e-fullrow,.e-text-content",ignore:"."+Cs+" > ."+L+",."+Is+",."+Ss+", ."+js});var e={selector:"."+Cs+" > ."+L,isCenterRipple:!0};this.rippleIconFn=N.rippleEffect(this.element,e)},p.prototype.setFullRow=function(e){(e?N.addClass:N.removeClass)([this.element],"e-fullrow-wrap")},p.prototype.setMultiSelect=function(e){e?this.element.setAttribute("aria-multiselectable","true"):this.element.setAttribute("aria-multiselectable","false")},p.prototype.templateComplier=function(t){if(t){this.hasTemplate=!0,this.element.classList.add(Ns);try{return"function"!=typeof t&&document.querySelectorAll(t).length?N.compile(document.querySelector(t).innerHTML.trim()):N.compile(t)}catch(e){return N.compile(t)}}this.element.classList.remove(Ns)},p.prototype.setDataBinding=function(t){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof x.DataManager?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof x.DataManager&&i.isOffline&&(i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),i.renderItems(!0),0!==i.treeList.length||i.isLoaded||i.finalize())}).catch(function(e){i.trigger("actionFailure",{error:e})}):this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function(e){i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),t&&(i.changeDataSource=!0),i.renderItems(!0),i.changeDataSource=!1,0!==i.treeList.length||i.isLoaded||i.finalize()}).catch(function(e){i.trigger("actionFailure",{error:e})})):(this.treeList.pop(),N.isNullOrUndefined(this.fields.dataSource)?this.rootData=this.treeData=[]:(this.treeData=JSON.parse(JSON.stringify(this.fields.dataSource)),this.setRootData()),this.isNumberTypeId=this.getType(),this.renderItems(!1)),0!==this.treeList.length||this.isLoaded||this.finalize()},p.prototype.getQuery=function(e,t){void 0===t&&(t=null);var i=[];if(e.query)s=e.query.clone();else{for(var s=new x.Query,n=this.getActualProperties(e),r=0,l=Object.keys(n);r<l.length;r++){var o=l[r];"dataSource"!==o&&"tableName"!==o&&"child"!==o&&e[""+o]&&"url"!==o&&-1===i.indexOf(e[""+o])&&i.push(e[""+o])}s.select(i),Object.prototype.hasOwnProperty.call(n,"tableName")&&s.from(e.tableName)}return O.ListBase.addSorting(this.sortOrder,e.text,s),N.isNullOrUndefined(t)||N.isNullOrUndefined(e.parentID)||s.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(t):t),s},p.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof N.getValue(this.fields.id,this.treeData[0])},p.prototype.setRootData=function(){var e;this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType?(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID),e=this.getChildNodes(this.treeData,void 0,!0),N.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e):this.rootData=this.treeData},p.prototype.isChildObject=function(){return"object"==typeof this.fields.child},p.prototype.renderItems=function(e){if(this.enableVirtualization&&!N.isNullOrUndefined(this.height))this.ulElement=this.createElement("ul",{className:k+" e-ul",attrs:{role:"group"}}),this.element.appendChild(this.ulElement);else{this.listBaseOption.ariaAttributes.level=1;var t=this.getSortedData(this.rootData),i=(this.ulElement=O.ListBase.createList(this.createElement,e?this.rootData:t,this.listBaseOption),this.element.appendChild(this.ulElement),this.ulElement.querySelectorAll(".e-list-item"));if(!1===this.loadOnDemand)for(var s=0;s<i.length;)this.renderChildNodes(i[parseInt(s.toString(),10)],!0,null,!0),s++;(1===N.selectAll("."+k,this.element).length&&i&&0!==i.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()}},p.prototype.updateCheckedStateFromDS=function(){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var e=this.fields,t=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.isChecked,"equal",!0,!1)),i=0;i<t.length;i++){var s=t[parseInt(i.toString(),10)][this.fields.id]?t[parseInt(i.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(s)||this.isLoaded||this.checkDisabledState(s,t[i]),t[parseInt(i.toString(),10)][this.fields.hasChildren])for(var s=t[parseInt(i.toString(),10)][this.fields.id],n=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.parentID,"equal",s,!1)),r=0;r<n.length;r++){var l=n[parseInt(r.toString(),10)][this.fields.id]?n[parseInt(r.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(l)&&this.autoCheck&&this.checkDisabledState(l,n[r])}}for(i=0;i<this.checkedNodes.length;i++)for(var o=this.fields,a=new x.DataManager(this.treeData).executeLocal((new x.Query).where(o.id,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0)),d=(a[0]&&this.autoCheck&&(this.getCheckedNodeDetails(o,a),this.checkIndeterminateState(a[0])),0<a.length&&(c=a[0][this.fields.id]?a[0][this.fields.id].toString():null,-1<this.checkedNodes.indexOf(c))&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c),new x.DataManager(this.treeData).executeLocal((new x.Query).where(o.parentID,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0))),h=0;h<d.length;h++){var c=d[parseInt(h.toString(),10)][this.fields.id]?d[parseInt(h.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(c)&&this.autoCheck&&this.checkDisabledState(c,d[h]),-1<this.checkedNodes.indexOf(c)&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c)}}else if(2===this.dataType||this.fields.dataSource instanceof x.DataManager&&this.isOffline){for(h=0;h<this.treeData.length;h++){var p=this.treeData[parseInt(h.toString(),10)][this.fields.id]?this.treeData[parseInt(h.toString(),10)][this.fields.id].toString():"",p=(this.treeData[parseInt(h.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(p)&&this.checkDisabledState(p,this.treeData[h]),-1<this.checkedNodes.indexOf(p)&&-1===this.validNodes.indexOf(p)&&this.validNodes.push(p),N.getValue(this.fields.child.toString(),this.treeData[parseInt(h.toString(),10)]));p&&this.updateChildCheckState(p,this.treeData[parseInt(h.toString(),10)])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},p.prototype.getCheckedNodeDetails=function(e,t){var i=t[0][this.fields.parentID]?t[0][this.fields.parentID].toString():null,s=0,n=this.element.querySelector('[data-uid="'+t[0][this.fields.id]+'"]'),t=this.element.querySelector('[data-uid="'+t[0][this.fields.parentID]+'"]');if(n||t)t&&!N.select("."+Bs,t)&&this.changeState(t,"indeterminate",null,!0,!0);else{-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i);for(var r=this.getChildNodes(this.treeData,i),l=0;l<r.length;l++){var o=r[parseInt(l.toString(),10)][this.fields.id]?r[parseInt(l.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(o)&&s++,s===r.length&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i)}n=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.id,"equal",i,!0));this.getCheckedNodeDetails(e,n)}},p.prototype.updateParentCheckState=function(){var i,e=N.selectAll("."+Vs,this.element),t=this.treeData;this.element.classList.contains("e-filtering")&&(t=this.DDTTreeData);for(var s=0;s<e.length;s++){var n=N.closest(e[parseInt(s.toString(),10)],"."+w),r=n.getAttribute("data-uid").toString(),l=void 0,o=(this.element.classList.contains("e-filtering")&&(l=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("parentID","equal",r,!0))),i=1===this.dataType?new x.DataManager(t).executeLocal((new x.Query).where(this.fields.parentID,"equal",r,!0)):this.getChildNodes(t,r),0);if(i){for(var a=this,d=0;d<i.length;d++)!function(e){var t=i[parseInt(e.toString(),10)][a.fields.id].toString();(-1!==a.checkedNodes.indexOf(t)||a.element.classList.contains("e-filtering")&&-1!==l.findIndex(function(e){return e.id===t}))&&o++}(d);o===i.length?(r=n.getAttribute("data-uid"),-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r),this.changeState(n,"check",null,!0,!0)):0===o&&0===this.checkedNodes.length&&0===e.length&&this.changeState(n,"uncheck",null,!0,!0)}}},p.prototype.checkIndeterminateState=function(e){var t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]');t?"true"!==t.getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0):2===this.dataType&&-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())},p.prototype.updateChildCheckState=function(e,t){for(var i=0,s=t[this.fields.id]?t[this.fields.id].toString():"",n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",r=(e[parseInt(n.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]),-1!==this.checkedNodes.indexOf(s)&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkDisabledState(r,e[n]),-1!==this.checkedNodes.indexOf(r)&&this.autoCheck&&i++,-1<this.checkedNodes.indexOf(r)&&-1===this.validNodes.indexOf(r)&&this.validNodes.push(r),N.getValue(this.fields.child.toString(),e[parseInt(n.toString(),10)]));r&&r.length&&(-1===this.parentCheckData.indexOf(t)&&this.parentCheckData.push(t),this.updateChildCheckState(r,e[parseInt(n.toString(),10)])),i===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(s)&&this.checkDisabledState(s,t)}if(0!==i&&this.autoCheck){this.checkIndeterminateState(t);for(var l=0;l<this.parentCheckData.length;l++)t!==this.parentCheckData[parseInt(l.toString(),10)]&&this.parentCheckData[parseInt(l.toString(),10)]&&this.checkIndeterminateState(this.parentCheckData[parseInt(l.toString(),10)])}this.parentCheckData=[]},p.prototype.beforeNodeCreate=function(e){this.showCheckBox&&((t=R.createCheckBox(this.createElement,!0,{cssClass:this.touchClass})).classList.add(js),s=N.select("div."+E+", div."+u,e.item),i=e.item.getAttribute("data-uid"),e.item.childNodes[0].insertBefore(t,e.item.childNodes[0].childNodes[N.isNullOrUndefined(s)?0:1]),s=N.getValue(e.fields.isChecked,e.curData),!(-1<this.checkedNodes.indexOf(i))&&(N.isNullOrUndefined(s)||"true"!==s.toString())?e.item.setAttribute("aria-checked","false"):(N.select("."+Fs,t).classList.add(Bs),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item)),i=N.select("."+Fs,t),N.EventHandler.add(i,"mousedown",this.frameMouseHandler,this),N.EventHandler.add(i,"mouseup",this.frameMouseHandler,this),N.EventHandler.add(i,"mouseleave",this.frameMouseHandler,this)),this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains(Ms)&&e.item.setAttribute("aria-selected","false");var t,i,s=e.fields,s=(this.addActionClass(e,s.selected,Ms),this.addActionClass(e,s.expanded,Hs),e.item.setAttribute("tabindex","-1"),N.EventHandler.add(e.item,"focus",this.focusIn,this),N.isNullOrUndefined(this.nodeTemplateFn)||(t=e.item.querySelector("."+fs),i=e.item.getAttribute("data-uid"),t.innerHTML="",this.renderNodeTemplate(e.curData,t,i)),{node:e.item,nodeData:e.curData,text:e.text});this.isRefreshed||(this.trigger("drawNode",s),!1===e.curData[this.fields.selectable]&&(e.item.classList.add(Gs),e.item.firstElementChild.style.cursor="not-allowed"))},p.prototype.frameMouseHandler=function(e){var t=N.select(".e-ripple-container",e.target.parentElement);R.rippleMouseHandler(e,t)},p.prototype.addActionClass=function(e,t,i){var s=e.curData,t=N.getValue(t,s);N.isNullOrUndefined(t)||"false"===t.toString()||e.item.classList.add(i)},p.prototype.getDataType=function(e,t){if(this.fields.dataSource instanceof x.DataManager){for(var i=0;i<e.length;i++)if(this.isOffline){if("string"==typeof t.child&&N.isNullOrUndefined(N.getValue(t.child,e[parseInt(i.toString(),10)]))&&!N.isNullOrUndefined(N.getValue(t.parentID,e[parseInt(i.toString(),10)])))return 1}else if("string"==typeof t.child&&N.isNullOrUndefined(N.getValue(t.child,e[parseInt(i.toString(),10)])))return 1;return 2}for(var i=0,s=e.length;i<s;i++){if("string"==typeof t.child&&(!N.isNullOrUndefined(N.getValue(t.child,e[parseInt(i.toString(),10)]))||Object.prototype.hasOwnProperty.call(e[parseInt(i.toString(),10)],t.child)))return 2;if(this.isChildObject())return 2;if(!N.isNullOrUndefined(N.getValue(t.parentID,e[parseInt(i.toString(),10)]))||!N.isNullOrUndefined(N.getValue(t.hasChildren,e[parseInt(i.toString(),10)])))return 1}return 1},p.prototype.getGroupedData=function(e,t){for(var t=(new x.Query).group(t),i=O.ListBase.getDataSource(e,t),s=[],n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)].items;s.push(r)}return s},p.prototype.getSortedData=function(e){return e=e&&"None"!==this.sortOrder?O.ListBase.getDataSource(e,O.ListBase.addSorting(this.sortOrder,this.fields.text)):e},p.prototype.finalizeNode=function(e,t,i){var s=this;if(t||this.updateAttributes(e),!i){var n=N.selectAll("."+Hs,e);if(!this.loadOnDemand&&this.fields.dataSource instanceof x.DataManager&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[s.fields.expanded]}).length||this.isInitalExpand),!this.isInitalExpand)for(var r=0;r<n.length;r++)this.renderChildNodes(n[parseInt(r.toString(),10)]);N.removeClass(n,Hs)}t||this.updateList(),this.isLoaded&&this.updateCheckedProp()},p.prototype.updateAttributes=function(e){for(var t=N.selectAll("."+zs,e),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].setAttribute("alt",zs);if(this.isLoaded){for(var s=N.selectAll("."+Ms,e),n=0;n<s.length;n++){this.selectNode(s[parseInt(n.toString(),10)],null);break}N.removeClass(s,Ms)}for(var r=N.selectAll("."+w+":not(."+Hs+")",e),l=0;l<r.length;l++){var o=N.select("div."+L,r[parseInt(l.toString(),10)]);o&&o.classList.contains(E)&&this.disableExpandAttr(r[parseInt(l.toString(),10)])}},p.prototype.updateCheckedProp=function(){var e;this.showCheckBox&&(e=[].concat([],this.checkedNodes),this.setProperties({checkedNodes:e},!0))},p.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=N.selectAll("li",this.element),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].classList.contains(w)&&(N.select("."+k,e[parseInt(t.toString(),10)])?this.ensureParentCheckState(e[parseInt(t.toString(),10)]):this.ensureChildCheckState(e[parseInt(t.toString(),10)]));else for(var i=N.selectAll("."+Vs,this.element),t=0;t<i.length;t++)i[parseInt(t.toString(),10)].classList.remove(Vs)},p.prototype.ensureParentCheckState=function(e){var t,i,s,n,r,l,o,a,d,h,c,p,u,m=this;N.isNullOrUndefined(e)||e.classList.contains(us)||((o=e).classList.contains(w)&&(o=N.select("."+k,e)),a=N.selectAll("."+js+" ."+Bs,o),t=N.selectAll("."+Vs,o),o=N.selectAll(this.checkDisabledChildren?"."+w:"."+w+":not(."+Rs+")",o),i=e.getElementsByClassName(js)[0],d=o.length,a=a.length,h=[],c=[],s=e.getAttribute("data-uid"),r=!(n=!0),u=this.getAllChildNodes(this.DDTTreeData,s),l=0,o.forEach(function(e){e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")?r=!0:n=!1)}),o=!1,this.element.classList.contains("e-filtering")&&(a=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("parentID","equal",s,!0)).length,0<(p=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("hasChildren","equal",!0,!0))).length&&r&&(this.OldCheckedData.some(function(e){return e.id===s})||-1!==this.parentNodeCheck.indexOf(s))&&(a=p.length,o=!0),d=(1===this.dataType?new x.DataManager(this.DDTTreeData).executeLocal((new x.Query).where(this.fields.parentID,"equal",s,!0)):this.getChildNodes(this.DDTTreeData,s)).length,u.forEach(function(e){var t=String(e[m.fields.id]);-1===m.checkedNodes.indexOf(t)&&!m.OldCheckedData.some(function(e){return e.parentID===t})||l++})),!this.autoCheck||!this.showCheckBox||this.fields.dataSource instanceof x.DataManager||(h=this.getSelectedChildNodeDetails(s),c=new x.DataManager(this.checkActionNodes).executeLocal((new x.Query).where("parentID","equal",s,!0))),0===d&&0===a)||(d===a||o&&0<d&&(c.length===h.length||c.length!==h.length)&&0!==c.length&&0!==h.length&&n&&this.autoCheck&&this.showCheckBox?this.changeState(i,"check",null,!0,!0):0<a&&!o&&this.autoCheck&&this.showCheckBox||0<a||0<t.length||0<l?this.changeState(i,"indeterminate",null,!0,!0):0===a&&this.changeState(i,"uncheck",null,!0,!0),p=N.closest(e,"."+k),N.isNullOrUndefined(p))||(u=N.closest(p,"."+w),this.ensureParentCheckState(u))},p.prototype.getSelectedChildNodeDetails=function(i){function t(e){var t;return!N.isNullOrUndefined(n)&&n in e&&Array.isArray(e[n])?(t=e[r],!N.isNullOrUndefined(t)&&t.toString()===i):(t=e[l],!N.isNullOrUndefined(t)&&t.toString()===i)}var s=this,n="string"==typeof this.fields.child?this.fields.child:null,r=this.fields.id,l=this.fields.parentID;this.nodeIndex||(this.nodeIndex=new Map,this.buildNodeIndex(this.treeData));return this.checkedNodes.map(function(e){return s.nodeIndex.get(e)}).filter(function(e){return(e&&"object"==typeof e&&n in e||2!==s.dataType&&"object"==typeof e&&(l in e||n in e))&&t(e)})},p.prototype.buildNodeIndex=function(e){var i=this,s="string"==typeof this.fields.child?this.fields.child:null;e.forEach(function(e){var t=N.getValue(i.fields.id,e);null!=t&&(i.nodeIndex||(i.nodeIndex=new Map),i.nodeIndex.set(t.toString(),e)),s&&(t=N.getValue(s,e),Array.isArray(t))&&i.buildNodeIndex(t)})},p.prototype.getAllChildNodes=function(e,t){var i,s,n,r,l;return!N.isNullOrUndefined(e)&&!N.isNullOrUndefined(t)&&Array.isArray(e)?1===this.dataType?(i=this.fields.parentID,s=t.toString(),e.filter(function(e){e=N.getValue(i,e);return!N.isNullOrUndefined(e)&&e.toString()===s})):2===this.dataType&&(n=this.fields.id,r=this.fields.child.toString(),l=t.toString(),t=e.find(function(e){e=N.getValue(n,e);return!N.isNullOrUndefined(e)&&e.toString()===l}))&&(e=N.getValue(r,t),Array.isArray(e))?e:[]:[]},p.prototype.ensureChildCheckState=function(e,t,i){var s=this;if(!N.isNullOrUndefined(e)){var n=N.select("."+k,e),r=void 0;if(!N.isNullOrUndefined(n)){var l=Array.from(n.querySelectorAll("li")),r=N.selectAll("."+js,n);this.isFilter&&(r=Array.from(r).filter(function(e){e=e.closest("li").getAttribute("data-uid");return null!==e&&-1!==s.checkedNodes.indexOf(e)}),l=Array.from(l).filter(function(e){e=e.getAttribute("data-uid");return null!==e&&-1!==s.checkedNodes.indexOf(e)}),0===r.length)&&(r=N.selectAll("."+js,n),l=Array.from(n.querySelectorAll("li")));for(var o=e.getElementsByClassName(Fs)[0].classList.contains(Bs),a=e.getElementsByClassName(Fs)[0].classList.contains(Vs),d=void 0,h=0;h<r.length;h++){var c,p=l[parseInt(h.toString(),10)].getAttribute("data-uid");N.isNullOrUndefined(this.currentLoadData)||N.isNullOrUndefined(N.getValue(this.fields.isChecked,this.currentLoadData[parseInt(h.toString(),10)]))?(c=r[parseInt(h.toString(),10)].getElementsByClassName(Fs)[0].classList.contains(Bs),o||c&&!this.isLoaded||-1!==this.checkedNodes.indexOf(p)&&this.isLoaded&&(a||o)?d="check":l[parseInt(h.toString(),10)].classList.contains(Ks)&&!N.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(o||a)&&-1!==this.parentNodeCheck.indexOf(p)||1===this.dataType&&!N.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(o||a)&&-1!==this.parentNodeCheck.indexOf(p)?(d="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)):d="uncheck"):(d=N.getValue(this.fields.isChecked,this.currentLoadData[parseInt(h.toString(),10)])?"check":"uncheck","uncheck"===(d=-1!==this.ele?o?"check":"uncheck":d)&&!N.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(p)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1),d="indeterminate")),this.changeState(r[parseInt(h.toString(),10)],d,t,!0,!0)}}this.autoCheck&&this.isLoaded&&!i&&this.updateParentCheckState()}},p.prototype.doCheckBoxAction=function(e,t){var i=this;if(N.isNullOrUndefined(e)){var s=N.selectAll("."+js,this.element);if(this.loadOnDemand)for(var n=0;n<s.length;n++){l=N.closest(s[parseInt(n.toString(),10)],"."+w);this.updateFieldChecked(s[parseInt(n.toString(),10)],t),this.changeState(s[parseInt(n.toString(),10)],t?"check":"uncheck",null,null,null,t),this.updateOldCheckedData([this.getNodeData(l)])}else for(n=0;n<s.length;n++){l=N.closest(s[parseInt(n.toString(),10)],"."+w);this.updateFieldChecked(s[parseInt(n.toString(),10)],t),this.changeState(s[parseInt(n.toString(),10)],t?"check":"uncheck"),this.updateOldCheckedData([this.getNodeData(l)])}}else{1<e.length&&this.autoCheck&&(this.isBatchMode=!0,this.batchParentNode=new Set),e.reverse();for(var r=e.length-1;0<=r;r--){var l=this.getElement(e[parseInt(r.toString(),10)]);if(N.isNullOrUndefined(l)){if(""!==(p=e[r-e.length]?e[r-e.length].toString():e[parseInt(r.toString(),10)]?e[parseInt(r.toString(),10)].toString():null)&&t&&p)this.setValidCheckedNode(p,e),this.dynamicCheckState(p,t);else if(-1!==this.checkedNodes.indexOf(p)&&""!==p&&!t){this.checkedNodes.splice(this.checkedNodes.indexOf(p),1);var o=this.getChildNodes(this.treeData,p);if(o){for(var a=0;a<o.length;a++){var d=o[parseInt(a.toString(),10)][this.fields.id]?o[parseInt(a.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&(this.checkedNodes.splice(this.checkedNodes.indexOf(d),1),d=this.element.querySelector('[data-uid="'+d+'"]'))&&this.changeState(d,"uncheck",null)}-1!==this.parentNodeCheck.indexOf(p)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)}p&&this.dynamicCheckState(p,t),this.updateField(this.treeData,this.fields,p,"isChecked",null)}}else{var h=N.select("."+k+" ."+js,l);this.validateCheckNode(h,!t,l,null)}}this.isBatchMode&&this.autoCheck&&(this.isBatchMode=!1,Array.from(this.batchParentNode).forEach(function(e){e=i.getElement(e);e&&i.ensureParentCheckState(e)}),this.batchParentNode.clear())}if(e)for(var c=0;c<e.length-1;c++){var p=e[parseInt(c.toString(),10)]?e[parseInt(c.toString(),10)].toString():"";t||this.updateField(this.treeData,this.fields,p,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},p.prototype.updateFieldChecked=function(e,t){var e=N.closest(e,"."+w),i=e.getAttribute("data-uid");"true"!==this.getNodeData(e).isChecked||t||this.updateField(this.treeData,this.fields,i,"isChecked",null)},p.prototype.dynamicCheckState=function(e,t){if(1===this.dataType){var i=0,s=new x.DataManager(this.treeData).executeLocal((new x.Query).where(this.fields.id,"equal",e,!0));if(s[0]){var n=s[0][this.fields.id]?s[0][this.fields.id].toString():null,s=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null,r=this.element.querySelector('[data-uid="'+s+'"]'),l=this.element.querySelector('[data-uid="'+n+'"]'),o=this.getChildNodes(this.treeData,s);if(o)for(var a=0;a<o.length;a++){var d=o[parseInt(a.toString(),10)][this.fields.id]?o[parseInt(a.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&i++}-1!==this.checkedNodes.indexOf(e)&&r&&n===e&&this.autoCheck?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&l&&n===e&&!t?this.changeState(l,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&l&&n===e&&t?this.changeState(l,"check",null):-1===this.checkedNodes.indexOf(e)&&!l&&r&&n===e&&this.autoCheck&&0!==i?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!l&&r&&n===e&&this.autoCheck&&0===i?this.changeState(r,"uncheck",null):l||r||n!==e||!this.autoCheck||this.updateIndeterminate(e,t)}}else if(2===this.dataType||this.fields.dataSource instanceof x.DataManager&&this.isOffline)for(n=void 0,r=void 0,a=0;a<this.treeData.length;a++){n=this.treeData[parseInt(a.toString(),10)][this.fields.id]?this.treeData[parseInt(a.toString(),10)][this.fields.id].toString():"",h=(r=this.element.querySelector('[data-uid="'+n+'"]'))?N.select("."+Bs,r):null,-1===this.checkedNodes.indexOf(n)&&r&&h&&!t&&this.changeState(r,"uncheck",null);var h=N.getValue(this.fields.child.toString(),this.treeData[parseInt(a.toString(),10)]);h&&this.updateChildIndeterminate(h,n,e,t,n)}},p.prototype.updateIndeterminate=function(e,t){var i,e=this.getTreeData(e),s=0,n=(1===this.dataType&&(i=e[0][this.fields.parentID]?e[0][this.fields.parentID].toString():null),this.getChildNodes(this.treeData,i));if(n)for(var r=0;r<n.length;r++){var l=n[parseInt(r.toString(),10)][this.fields.id]?n[parseInt(r.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(l)&&s++}e=this.element.querySelector('[data-uid="'+i+'"]');e&&t||!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0!==s?this.changeState(e,"indeterminate",null):!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0===s?this.changeState(e,"uncheck",null):e||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?(t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)||!t&&-1!==this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)&&0!==s)&&this.parentNodeCheck.push(i):this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i),1),this.updateIndeterminate(i,t),-1===this.checkedNodes.indexOf(i))||t||this.checkedNodes.splice(this.checkedNodes.indexOf(i),1)},p.prototype.updateChildIndeterminate=function(e,t,i,s,n){for(var r=0,l=0;l<e.length;l++){var o=e[parseInt(l.toString(),10)][this.fields.id]?e[parseInt(l.toString(),10)][this.fields.id].toString():"",a=(-1!==this.checkedNodes.indexOf(o)&&r++,this.element.querySelector('[data-uid="'+t+'"]')),d=a?N.select("."+Vs,a):null,h=a?N.select("."+Bs,a):null,c=this.element.querySelector('[data-uid="'+o+'"]'),p=c?N.select("."+Bs,c):null,h=(-1!==this.checkedNodes.indexOf(i)&&a&&o===i&&this.autoCheck?this.changeState(a,"indeterminate",null):-1!==this.checkedNodes.indexOf(i)||!a||c||o!==i||s?-1===this.checkedNodes.indexOf(i)&&c&&o===i&&!s?this.changeState(c,"uncheck",null):-1===this.checkedNodes.indexOf(i)&&d&&o===i&&this.autoCheck&&0===r&&!s?d.classList.remove(Vs):-1===this.checkedNodes.indexOf(i)&&!c&&h&&o===i&&0===r?this.changeState(a,"uncheck",null):-1===this.checkedNodes.indexOf(o)&&c&&p&&0===r?this.changeState(c,"uncheck",null):(!c&&!a&&o===i||-1!==this.parentNodeCheck.indexOf(t)&&this.autoCheck)&&(d=this.element.querySelector('[data-uid="'+n+'"]'),s&&0!==r?this.changeState(d,"indeterminate",null):s&&r===e.length&&-1===this.checkedNodes.indexOf(t)?this.checkDisabledState(t):s||0!==r||-1===this.parentNodeCheck.indexOf(t)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(t)),-1===this.parentNodeCheck.indexOf(t))&&this.parentNodeCheck.push(t):!this.autoCheck&&0!==r?this.changeState(a,"indeterminate",null):this.changeState(a,"uncheck",null),N.getValue(this.fields.child.toString(),e[parseInt(l.toString(),10)]));h&&this.updateChildIndeterminate(h,o,i,s,n)}},p.prototype.changeState=function(t,i,s,n,r,l){var e,o=this,a=N.closest(t,"."+w);!this.checkDisabledChildren&&a&&(a.classList.contains(Rs)||this.disableNode&&-1!==this.disableNode.indexOf(a.getAttribute("data-uid")))||(t===a&&(t=N.select("."+js,a)),n?this.nodeCheckAction(t,i,a,e,s,n,r,l):(this.checkActionNodes=[],e=this.getCheckEvent(a,i,s),this.trigger("nodeChecking",e,function(e){e.cancel||o.nodeCheckAction(t,i,a,e,s,n,r,l)})))},p.prototype.nodeCheckAction=function(e,t,i,s,n,r,l,o){var a,e=e.getElementsByClassName(Fs)[0];"check"!==t||e.classList.contains(Bs)?"uncheck"===t&&(e.classList.contains(Bs)||e.classList.contains(Vs))?(N.removeClass([e],[Bs,Vs]),this.removeCheck(i),a="false"):"indeterminate"===t&&this.autoCheck&&(e.classList.remove(Bs),e.classList.add(Vs),this.removeCheck(i,!0),a="mixed"):(e.classList.remove(Vs),e.classList.add(Bs),this.addCheck(i),a="true"),N.isNullOrUndefined(a="check"===t?"true":"uncheck"===t?"false":a)||i.setAttribute("aria-checked",a),l&&(e=[].concat([],this.checkActionNodes),s=this.getCheckEvent(i,t,n),N.isUndefined(r))&&(s.data=e),void 0!==o&&this.ensureStateChange(i,o),r||N.isNullOrUndefined(a)||(i.setAttribute("aria-checked",a),s.data[0].checked=a,this.trigger("nodeChecked",s),this.checkActionNodes=[])},p.prototype.addCheck=function(e){var t,e=e.getAttribute("data-uid");N.isNullOrUndefined(e)||-1!==this.checkedNodes.indexOf(e)||this.checkDisabledState(e),this.enableVirtualization&&(this.virtualIndeterminateNodesSet.delete(e),t=this.virtualNodeMap.get(e),!N.isNullOrUndefined(t))&&-1<t&&(this.virtualFlatNodes[parseInt(t.toString(),10)].isChecked=!0,this.autoCheck)&&this.virtualFlatNodes[parseInt(t.toString(),10)].hasChildren&&this.setVirtualChildCheckState(e,!0)},p.prototype.removeCheck=function(e,t){var e=e.getAttribute("data-uid"),i=this.checkedNodes.indexOf(e);-1<i&&this.checkedNodes.splice(i,1),this.enableVirtualization&&(i=this.virtualNodeMap.get(e),!N.isNullOrUndefined(i))&&-1<i&&(t?(this.virtualFlatNodes[parseInt(i.toString(),10)].isChecked="indeterminate",this.virtualIndeterminateNodesSet.add(e)):(this.virtualIndeterminateNodesSet.delete(e),this.virtualCheckedNodesSet.delete(e),this.virtualFlatNodes[parseInt(i.toString(),10)].isChecked=!1,this.treeData[parseInt(e.toString(),10)-1].isChecked=!1,this.autoCheck&&this.virtualFlatNodes[parseInt(i.toString(),10)].hasChildren&&this.setVirtualChildCheckState(e,!1)))},p.prototype.setVirtualChildCheckState=function(e,t){if(this.virtualFlatNodes&&0!==this.virtualFlatNodes.length){for(var i=0;i<this.virtualFlatNodes.length;i++){var s=this.virtualFlatNodes[parseInt(i.toString(),10)];s.parentId===e&&((s.isChecked=t)?(this.virtualCheckedNodesSet.add(s.id),this.checkedNodes&&-1===this.checkedNodes.indexOf(s.id)&&this.checkedNodes.push(s.id)):(this.virtualCheckedNodesSet.delete(s.id),-1!==(r=this.checkedNodes?this.checkedNodes.indexOf(s.id):-1)&&this.checkedNodes.splice(r,1)),s.hasChildren)&&this.setVirtualChildCheckState(s.id,t)}var n=this.getChildNodes(this.treeData,e);if(n)for(i=0;i<n.length;i++){var r,l=n[parseInt(i.toString(),10)][this.fields.id]?n[parseInt(i.toString(),10)][this.fields.id].toString():null;!l||this.virtualNodeMap&&this.virtualNodeMap.has(l)||(this.updateField(this.treeData,this.fields,l,this.fields.isChecked,t),t?this.checkedNodes&&-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l):-1!==(r=this.checkedNodes?this.checkedNodes.indexOf(l):-1)&&this.checkedNodes.splice(r,1),this.setVirtualChildCheckState(l,t))}}},p.prototype.getCheckEvent=function(e,t,i){this.checkActionNodes.push(this.getNodeData(e));var s=this.checkActionNodes;return{action:t,cancel:!1,isInteracted:!N.isNullOrUndefined(i),node:e,data:s}},p.prototype.finalize=function(){var e=N.select("."+k,this.element);N.isNullOrUndefined(e)||(e.setAttribute("role",Js.treeRole),this.setMultiSelect(this.allowMultiSelection),this.setNodeFocusable(),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&Object.prototype.hasOwnProperty.call(this.rootData[0],this.fields.parentID),this.doExpandAction())},p.prototype.setTextWrap=function(){(this.allowTextWrap?N.addClass:N.removeClass)([this.element],"e-text-wrap"),N.Browser.isIE&&(this.allowTextWrap?N.addClass:N.removeClass)([this.element],"e-ie-wrap")},p.prototype.updateWrap=function(e){if(this.fullRowSelect){var t=e?N.selectAll("."+w,e):this.liList;if(t)for(var i=t.length,s=0;s<i;s++)this.calculateWrap(t[parseInt(s.toString(),10)])}},p.prototype.calculateWrap=function(e){e=N.select("."+Ps,e);e&&e.nextElementSibling&&(e.style.height=this.allowTextWrap?e.nextElementSibling.offsetHeight+"px":"")},p.prototype.doExpandAction=function(){var t=this,e=this.expandedNodes;if(!this.loadOnDemand&&this.fields.dataSource instanceof x.DataManager&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[t.fields.expanded]}).length||this.isInitalExpand),this.isInitalExpand&&0<e.length)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof x.DataManager)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var s,n=this.escapeHashInUid(e[parseInt(i.toString(),10)]),n=N.select('[data-uid="'+n+'"]',this.element);N.isNullOrUndefined(n)?e[parseInt(i.toString(),10)]&&-1===this.expandChildren.indexOf(e[parseInt(i.toString(),10)])&&this.expandChildren.push(e[parseInt(i.toString(),10)].toString()):(s=N.select("."+E,N.select("."+Cs,n)),N.isNullOrUndefined(s)||this.expandAction(n,s,null))}this.afterFinalized()}else this.afterFinalized()},p.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){t.index++,t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()}),0<this.index&&(this.index=0)},p.prototype.expandCallback=function(e,t){var i,e=this.escapeHashInUid(e),e=N.select('[data-uid="'+e+'"]',this.element);N.isNullOrUndefined(e)||(i=N.select("."+E,N.select("."+Cs,e)),N.isNullOrUndefined(i))||this.expandAction(e,i,null,!1,t),t()},p.prototype.afterFinalized=function(){var e;this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,this.isLoaded&&!this.isFieldChange||this.isNodeDropped||(e={data:this.treeData},this.trigger("dataBound",e)),this.isLoaded=!0,this.isNodeDropped=!1,this.enableVirtualization&&!N.isNullOrUndefined(this.height)&&this.initVirtualization()},p.prototype.doSelectionAction=function(){var e=N.selectAll("."+Ms,this.element),t=this.selectedNodes;if(0<t.length){this.setProperties({selectedNodes:[]},!0);for(var i=0;i<t.length;i++){var s=this.escapeHashInUid(t[parseInt(i.toString(),10)]),s=N.select('[data-uid="'+s+'"]',this.element);if(s&&!s.classList.contains("e-active")?this.selectNode(s,null,!0):this.selectedNodes.push(t[parseInt(i.toString(),10)]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);N.removeClass(e,Ms)},p.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[parseInt(t.toString(),10)].classList.contains("e-disable")||this.selectNode(e[parseInt(t.toString(),10)],null,!0),this.allowMultiSelection);t++);},p.prototype.clickHandler=function(e){var t=N.Browser.isDevice&&e.originalEvent.changedTouches&&!N.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;if(N.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),t&&!this.dragStartAction){var i=t.classList,s=N.closest(t,"."+w);if(s&&(!s.classList.contains(Gs)||i.contains(E)||i.contains(u))){if(3!==e.originalEvent.which){var n=N.select(".e-ripple-element",s),r=N.select("."+L,s),l=(this.removeHover(),this.setFocusElement(s),i.contains(E)||i.contains(u));if(this.showCheckBox&&!s.classList.contains("e-disable")&&!l){var o,l=this.checkOnClick?N.select("."+js,s):N.closest(t,"."+js);if(!N.isNullOrUndefined(l))return o=N.select("."+Fs,l),this.validateCheckNode(l,o.classList.contains(Bs),s,e.originalEvent),void this.triggerClickEvent(e.originalEvent,s)}i.contains(E)?this.expandAction(s,t,e):i.contains(u)?this.collapseNode(s,t,e):n&&r?r.classList.contains(qs)&&r.classList.contains(E)?this.expandAction(s,r,e):r.classList.contains(qs)&&r.classList.contains(u)?this.collapseNode(s,r,e):i.contains(k)||i.contains(w)||this.toggleSelect(s,e.originalEvent,!1):i.contains(k)||i.contains(w)||this.toggleSelect(s,e.originalEvent,!1)}3===e.originalEvent.which&&(this.isRightClick=!0),this.triggerClickEvent(e.originalEvent,s)}}},p.prototype.nodeCheckedEvent=function(e,t,i){e=this.getCheckEvent(e,t?"uncheck":"check",i);e.data=e.data.splice(0,e.data.length-1),this.trigger("nodeChecked",e)},p.prototype.updateOldCheckedData=function(e){var t,i=this,e=new x.DataManager(e),s=e.executeLocal((new x.Query).where("isChecked","equal","true",!0)),n=e.executeLocal((new x.Query).where("isChecked","equal","false",!0));if(0<n.length&&-1!==(t=this.OldCheckedData.findIndex(function(e){return e.id===n[0].id})))return this.OldCheckedData.splice(t,1),void(0<(e=this.OldCheckedData.filter(function(e){return e.parentID===n[0].id})).length&&e.forEach(function(t){var e=i.OldCheckedData.findIndex(function(e){return e.id===t.id});-1!==e&&i.OldCheckedData.splice(e,1)}));0<s.length&&-1===(t=this.OldCheckedData.findIndex(function(e){return e.id===s[0].id}))&&this.OldCheckedData.push(s[0])},p.prototype.triggerClickEvent=function(e,t){this.trigger("nodeClicked",{event:e,node:t})},p.prototype.expandNode=function(i,t,e,s){var n,r,l,o,a,d,h=this;this.enableVirtualization&&!N.isNullOrUndefined(this.height)?(n=i?i.getAttribute("data-uid"):null)&&this.handleVirtualExpand(n,s):(this.renderReactTemplates(),t.classList.contains(ys)&&this.hideSpinner(t),this.initialRender||t.classList.add("interaction"),!0!==e||!0===e&&i.classList.contains("e-expanded")?!0!==this.preventExpand&&(N.removeClass([t],E),N.addClass([t],u),l=r=0,o=N.select("."+k,i),a=i,this.isAnimate&&!this.isRefreshed?(this.setHeight(a,o),d=N.select("."+w+"."+vs,i),this.aniObj.animate(o,{name:this.animation.expand.effect,duration:0===this.animation.expand.duration&&"Enable"===N.animationMode?400:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(){a.style.overflow="hidden",!N.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.add(Xs),r=a.offsetHeight;var e=window.getComputedStyle(a),t=parseFloat(e.paddingTop),e=parseFloat(e.paddingBottom);l=N.select("."+Cs,i).offsetHeight+e+t},progress:function(e){e.element.style.display="block",h.animateHeight(e,r,l)},end:function(e){e.element.style.display="block",!N.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.remove(Xs),h.expandedNode(a,o,t)}})):this.expandedNode(a,o,t)):(N.select("."+k,i).style.display="none",this.fields.dataSource instanceof x.DataManager==!0&&(this.preventExpand=!1)),this.initialRender&&t.classList.add("interaction"))},p.prototype.expandedNode=function(e,t,i){t.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",N.removeClass([i],bs),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.expandArgs.isInteracted=this.isInteracted,this.trigger("nodeExpanded",this.expandArgs)),this.isHiddenItem&&this.collapseAll([this.getNodeData(e).id])},p.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),N.removeClass([e],Us);e=e.getAttribute("data-uid");N.isNullOrUndefined(e)||-1!==this.expandedNodes.indexOf(e)||this.expandedNodes.push(e)},p.prototype.collapseNode=function(i,s,n){var e,t,r=this;s.classList.contains(bs)||(N.addClass([s],bs),this.isLoaded?(e=this.getExpandEvent(i,n),this.isInteracted=e.isInteracted,this.trigger("nodeCollapsing",e,function(e){var t;e.cancel?N.removeClass([s],bs):(t=n&&void 0!==n.action,r.nodeCollapseAction(i,s,e,t))})):(t=n&&void 0!==n.action,this.nodeCollapseAction(i,s,e,t)))},p.prototype.nodeCollapseAction=function(e,t,i,s){var n,r,l,o,a,d,h=this;this.enableVirtualization&&!N.isNullOrUndefined(this.height)?(n=e?e.getAttribute("data-uid"):null)&&this.handleVirtualCollapse(n,s):(N.removeClass([t],u),N.addClass([t],E),l=r=0,o=N.select("."+k,e),a=e,d=N.select("."+w+"."+vs,e),this.isAnimate?this.aniObj.animate(o,{name:this.animation.collapse.effect,duration:0===this.animation.collapse.duration&&"Enable"===N.animationMode?400:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(){a.style.overflow="hidden",!N.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.add(Xs),r=N.select("."+Cs,e).offsetHeight,l=a.offsetHeight},progress:function(e){h.animateHeight(e,r,l)},end:function(e){e.element.style.display="none",!N.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.remove(Xs),h.collapsedNode(a,o,t,i)}}):this.collapsedNode(a,o,t,i))},p.prototype.collapsedNode=function(e,t,i,s){t.style.display="none",e.style.overflow="",e.style.height="",N.removeClass([i],bs),this.removeExpand(e),this.isLoaded&&((s=this.getExpandEvent(e,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",s))},p.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);t=this.expandedNodes.indexOf(e.getAttribute("data-uid"));-1<t&&this.expandedNodes.splice(t,1)},p.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),N.addClass([e],Us)},p.prototype.setHeight=function(e,t){t.style.display="block",t.style.visibility="hidden",e.style.height=e.offsetHeight+"px",t.style.display="none",t.style.visibility=""},p.prototype.animateHeight=function(e,t,i){var s;N.isNullOrUndefined(e.element.parentElement)||(s=(e.duration-e.timeStamp)/e.duration,e.element.parentElement.style.height=(i-t)*s+t+"px")},p.prototype.renderChildNodes=function(t,i,s,n,e){var r,l,o,a=this,d=N.select("div."+L,t);N.isNullOrUndefined(d)||(this.showSpinner(d),this.fields.dataSource instanceof x.DataManager?(l=this.parents(t,"."+k).length,o=this.getChildFields(this.fields,l,1),N.isNullOrUndefined(o)||N.isNullOrUndefined(o.dataSource)?(N.detach(d),this.removeExpand(t,!0)):(this.treeList.push("false"),this.fields.dataSource instanceof x.DataManager&&this.isOffline?(this.treeList.pop(),r=this.getChildNodes(this.treeData,t.getAttribute("data-uid")),this.loadChild(r,o,d,t,i,s,n)):o.dataSource.executeQuery(this.getQuery(o,t.getAttribute("data-uid"))).then(function(e){a.treeList.pop(),r=e.result,1===a.dataType&&(a.dataType=2),a.loadChild(r,o,d,t,i,s,n)}).catch(function(e){a.trigger("actionFailure",{error:e})}))):(r=this.getChildNodes(this.treeData,t.getAttribute("data-uid"),!1,parseFloat(t.getAttribute("aria-level"))+1),this.currentLoadData=this.getSortedData(r),N.isNullOrUndefined(r)||0===r.length?(N.detach(d),d.classList.contains(ys)&&this.hideSpinner(d),this.removeExpand(t,!0)):(this.listBaseOption.ariaAttributes.level=parseFloat(t.getAttribute("aria-level"))+1,t.appendChild(O.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(t,d,n),this.setSelectionForChildNodes(r),this.ensureCheckNode(t,e),this.finalizeNode(t,e,i),this.disableTreeNodes(r),this.renderSubChild(t,i,n,e))))},p.prototype.loadChild=function(e,t,i,s,n,r,l){this.currentLoadData=e,N.isNullOrUndefined(e)||0===e.length?(N.detach(i),this.removeExpand(s,!0)):(this.updateListProp(t),this.fields.dataSource instanceof x.DataManager&&!this.isOffline&&(t=s.getAttribute("data-uid"),t=this.getNodeObject(t),N.setValue("child",e,t)),this.listBaseOption.ariaAttributes.level=parseFloat(s.getAttribute("aria-level"))+1,s.appendChild(O.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(s,i,l),this.setSelectionForChildNodes(e),this.ensureCheckNode(s),this.finalizeNode(s),this.disableTreeNodes(e),this.renderSubChild(s,n,l)),r&&r(),n&&this.expandedNodes.push(s.getAttribute("data-uid")),0!==this.treeList.length||this.isLoaded||this.finalize()},p.prototype.disableTreeNodes=function(e){if(!N.isNullOrUndefined(this.disableNode)&&0!==this.disableNode.length)for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},p.prototype.setSelectionForChildNodes=function(e){if(!N.isNullOrUndefined(this.selectedNodes)&&0!==this.selectedNodes.length)for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},p.prototype.ensureCheckNode=function(e,t){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck)&&(this.ensureChildCheckState(e,null,t),t&&!N.select("."+Bs,this.element)&&!N.select("."+Vs,this.element)||this.ensureParentCheckState(e)),this.currentLoadData=null},p.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},p.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},p.prototype.getChildMapper=function(e){return"string"==typeof e.child||N.isNullOrUndefined(e.child)?e:e.child},p.prototype.getChildNodes=function(e,t,i,s){var n,r=this;if(void 0===i&&(i=!1),!N.isNullOrUndefined(e)){if(1===this.dataType)return this.getChildGroup(this.groupedData,t,i);if("string"==typeof this.fields.child)return this.findChildNodes(e,this.fields.id,t)||this.findNestedChildNodes(e,t,s)||[];if(this.isChildObject()){for(var l=N.isNullOrUndefined(s)?this.fields.child:this.fields,o=1;o<s&&!N.isNullOrUndefined(l.child);)l=l.child,o++;this.updateListProp(l);i=e.findIndex(function(e){return N.getValue(r.fields.id,e)&&N.getValue(r.fields.id,e).toString()===t});if(-1!==i)return N.getValue("child",e[parseInt(i.toString(),10)]);if(-1===i)for(var a=0,d=e.length;a<d;a++){var h=N.getValue("child",e[parseInt(a.toString(),10)]),c=N.isNullOrUndefined(h)?-1:h.findIndex(function(e){return N.getValue(r.fields.child.id,e)&&N.getValue(r.fields.child.id,e).toString()===t});if(-1!==c)return N.getValue("child",h[parseInt(c.toString(),10)]);if(!N.isNullOrUndefined(h)&&void 0!==(n=this.getChildNodes(h,t,!1,s)))break}}}return n},p.prototype.findChildNodes=function(e,t,i){var s=e.findIndex(function(e){e=N.getValue(t,e);return e&&e.toString()===i});return-1!==s?N.getValue(this.fields.child,e[s]):null},p.prototype.findNestedChildNodes=function(e,t,i){for(var s=0,n=e;s<n.length;s++){var r=n[s],r=N.getValue(this.fields.child,r);if(!N.isNullOrUndefined(r)){var l=this.findChildNodes(r,this.fields.id,t);if(l)return l;l=this.getChildNodes(r,t,!1,i);if(l&&0<l.length)return l}}},p.prototype.getChildGroup=function(e,t,i){var s=[];if(!N.isNullOrUndefined(e))for(var n=0,r=e.length;n<r;n++)if(N.isNullOrUndefined(e[parseInt(n.toString(),10)][0])||N.isNullOrUndefined(N.getValue(this.fields.parentID,e[parseInt(n.toString(),10)][0]))){if(i)return e[parseInt(n.toString(),10)]}else if(N.getValue(this.fields.parentID,e[parseInt(n.toString(),10)][0]).toString()===t)return e[parseInt(n.toString(),10)];return s},p.prototype.renderSubChild=function(e,t,i,s){if(t)for(var n=N.selectAll("."+E,e),r=0,l=n.length;r<l;r++){var o=n[parseInt(r.toString(),10)];e.querySelector(".e-icons")!==n[parseInt(r.toString(),10)]&&(o=N.closest(o,"."+w),this.expandArgs=this.getExpandEvent(o,null),!0!==i&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(o,t,null,i,s))}},p.prototype.toggleSelect=function(e,t,i){e.classList.contains("e-disable")||(this.allowMultiSelection&&(t&&t.ctrlKey||i)&&this.isActive(e)?this.unselectNode(e,t):this.selectNode(e,t,i))},p.prototype.isActive=function(e){return!!e.classList.contains(vs)},p.prototype.selectNode=function(t,i,s){var e,n,r=this;N.isNullOrUndefined(t)||!this.allowMultiSelection&&this.isActive(t)&&!N.isNullOrUndefined(i)?((this.element.closest(".e-ddt")?this.checkOnClick&&this.showCheckBox:this.checkOnClick)&&(e=N.select(" ."+Fs,t),!N.isNullOrUndefined(e)&&e.classList.contains(Bs)?N.addClass([t],vs):N.removeClass([t],vs)),this.setFocusElement(t)):this.isLoaded?(n=this.getSelectEvent(t,"select",i),this.trigger("nodeSelecting",n,function(e){e.cancel||e.node.classList.contains(Gs)||r.nodeSelectAction(t,i,e,s)})):this.nodeSelectAction(t,i,n,s)},p.prototype.nodeSelectAction=function(e,t,i,s){if(this.allowMultiSelection&&(s||t&&(t.ctrlKey||t.metaKey))||this.removeSelectAll(),this.allowMultiSelection&&t&&t.shiftKey){this.startNode||(this.startNode=e);var s=this.liList.indexOf(this.startNode),n=this.liList.indexOf(e);n<s&&(t=s,s=n,n=t);for(var r=s;r<=n;r++){var l=this.liList[parseInt(r.toString(),10)];N.isVisible(l)&&!l.classList.contains("e-disable")&&this.addSelect(l)}}else this.startNode=e,this.addSelect(e);this.isLoaded&&(i.nodeData=this.getNodeData(e),this.trigger("nodeSelected",i),this.isRightClick=!1),this.isRightClick=!1},p.prototype.unselectNode=function(t,e){var i,s=this;this.isLoaded?(i=this.getSelectEvent(t,"un-select",e),this.trigger("nodeSelecting",i,function(e){e.cancel||s.nodeUnselectAction(t,e)})):this.nodeUnselectAction(t,i)},p.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},p.prototype.setFocusElement=function(e){var t;N.isNullOrUndefined(e)||((t=this.getFocusedNode())&&(N.removeClass([t],Ws),N.removeClass([t],_s),t.setAttribute("tabindex","-1")),N.addClass([e],Ws),e.setAttribute("tabindex","0"),N.EventHandler.add(e,"blur",this.focusOut,this),this.updateIdAttr(t,e),this.enableVirtualization&&(this.virtualFocusedId=e.getAttribute("data-uid")))},p.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),N.addClass([e],vs);e=e.getAttribute("data-uid");N.isNullOrUndefined(e)||-1!==this.selectedNodes.indexOf(e)||this.selectedNodes.push(e)},p.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),N.removeClass([e],vs);e=this.selectedNodes.indexOf(e.getAttribute("data-uid"));-1<e&&this.selectedNodes.splice(e,1)},p.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+vs),t=0,i=e;t<i.length;t++){var s=i[t];this.allowMultiSelection?s.setAttribute("aria-selected","false"):s.removeAttribute("aria-selected")}N.removeClass(e,vs),this.setProperties({selectedNodes:[]},!0)},p.prototype.getSelectEvent=function(e,t,i){var s=this.getNodeData(e);return{action:t,cancel:!1,isInteracted:!N.isNullOrUndefined(i),node:e,nodeData:s}},p.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?N.Browser.isDevice?"Click":"DblClick":this.expandOn},p.prototype.expandHandler=function(e){var t=N.Browser.isDevice&&e.originalEvent.changedTouches&&!N.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;!t||t.classList.contains(Ss)||t.classList.contains(us)||t.classList.contains(k)||t.classList.contains(w)||t.classList.contains(L)||this.showCheckBox&&N.closest(t,"."+js)||this.expandCollapseAction(N.closest(t,"."+w),e)},p.prototype.expandCollapseAction=function(e,t){var i,s;this.enableVirtualization&&!N.isNullOrUndefined(this.height)&&e.classList.contains(Es)||(i=N.select("div."+L,e))&&!i.classList.contains(bs)&&((s=i.classList).contains(E)?this.expandAction(e,i,t):s.contains(u)&&this.collapseNode(e,i,t))},p.prototype.expandAction=function(t,i,s,n,r,l){var e,o=this;i.classList.contains(bs)||(N.addClass([i],bs),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(t,s),this.isInteracted=this.expandArgs.isInteracted,this.trigger("nodeExpanding",this.expandArgs,function(e){e.cancel?N.removeClass([i],bs):(e=s&&void 0!==s.action,o.nodeExpandAction(t,i,n,r,l,e))})):(e=s&&void 0!==s.action,this.nodeExpandAction(t,i,n,r,l,e)))},p.prototype.nodeExpandAction=function(e,t,i,s,n,r){if(this.enableVirtualization&&!N.isNullOrUndefined(this.height))this.expandNode(e,t,void 0,r);else{r=N.select("."+k,e);if(r&&"UL"===r.nodeName)this.expandNode(e,t);else if(this.isFirstRender=!0,this.renderChildNodes(e,i,s,null,n),!N.isNullOrUndefined(this.expandChildren)&&0!==this.expandChildren.length)for(var l=N.selectAll("."+w,e),o=0;o<l.length;o++){var a,d=this.getId(l[parseInt(o.toString(),10)]);-1!==this.expandChildren.indexOf(d)&&void 0!==this.expandChildren&&(a=N.select("."+E,N.select("."+Cs,l[parseInt(o.toString(),10)])),N.isNullOrUndefined(a)||this.expandAction(l[parseInt(o.toString(),10)],a,null),this.expandChildren.splice(this.expandChildren.indexOf(d),1))}}},p.prototype.keyActionHandler=function(i){var s=this,e=i.target,n=this.getFocusedNode();e&&e.classList.contains(Ss)?(e=e,"enter"===i.action?e.blur():"escape"===i.action&&(e.value=this.oldText,e.blur())):(i.preventDefault(),e={cancel:!1,event:i,node:n},this.trigger("keyPress",e,function(e){if(!e.cancel)switch(i.action){case"space":s.showCheckBox?s.checkNode(i):s.toggleSelect(n,i);break;case"moveRight":s.openNode(!s.enableRtl,i);break;case"moveLeft":s.openNode(!!s.enableRtl,i);break;case"shiftDown":s.shiftKeySelect(!0,i);break;case"moveDown":case"ctrlDown":case"csDown":s.navigateNode(!0);break;case"shiftUp":s.shiftKeySelect(!1,i);break;case"moveUp":case"ctrlUp":case"csUp":s.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":s.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":s.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":case"shiftSpace":case"ctrlSpace":s.toggleSelect(n,i);break;case"f2":s.allowEditing&&!n.classList.contains("e-disable")&&s.createTextbox(n);break;case"ctrlA":var t;s.allowMultiSelection&&(t=N.selectAll("."+w+":not(."+vs+")",s.element),s.selectGivenNodes(t))}}))},p.prototype.navigateToFocus=function(e){var t,i,s,n;this.enableVirtualization&&!N.isNullOrUndefined(this.height)?(t=this.getFocusedNode())&&(t=t.getAttribute("data-uid"))&&this.ensureVirtualNodeVisible(t):(i=(t=this.getFocusedNode().querySelector("."+Cs)).getBoundingClientRect(),s=this.getScrollParent(this.element),N.isNullOrUndefined(s)||(n=s.getBoundingClientRect(),i.bottom>n.bottom?s.scrollTop+=i.bottom-n.bottom:i.top<n.top&&(s.scrollTop-=n.top-i.top)),this.isVisibleInViewport(t)||t.scrollIntoView(e))},p.prototype.isVisibleInViewport=function(e){e=e.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},p.prototype.getScrollParent=function(e){return N.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},p.prototype.shiftKeySelect=function(e,t){var i;this.allowMultiSelection?(i=this.getFocusedNode(),i=e?this.getNextNode(i):this.getPrevNode(i),this.removeHover(),this.setFocusElement(i),this.toggleSelect(i,t,!1),this.navigateToFocus(!e)):this.navigateNode(e)},p.prototype.checkNode=function(e){var t=this.getFocusedNode(),i=N.select("."+js,t),s=N.select(" ."+Fs,i).classList.contains(Bs);t.classList.contains("e-disable")||0===t.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(i,s,t,e)},p.prototype.validateCheckNode=function(t,i,s,n){var e,r=this,l=N.closest(t,"."+w);l&&l.classList.contains(Gs)&&this.showCheckBox?n&&n.preventDefault&&n.preventDefault():(this.checkActionNodes=[],N.isNullOrUndefined(e=i?"false":"true")||l.setAttribute("aria-checked",e),e=this.getCheckEvent(l,i?"uncheck":"check",n),this.trigger("nodeChecking",e,function(e){e.cancel||r.nodeCheckingAction(t,i,s,e,n)}))},p.prototype.nodeCheckingAction=function(e,t,i,s,n){var r,l;-1===this.checkedElement.indexOf(i.getAttribute("data-uid"))&&(this.checkedElement.push(i.getAttribute("data-uid")),this.autoCheck)&&(null!==(r=this.getChildNodes(this.treeData,i.getAttribute("data-uid")))?this.allCheckNode(r,this.checkedElement,null,null,!1):r=null),this.changeState(e,t?"uncheck":"check",n,!0),this.updateActiveClass(i,t),this.autoCheck&&(this.ensureChildCheckState(i),this.updateOldCheckedData([this.getNodeData(i)]),r=N.closest(N.closest(i,"."+k),"."+w),l=void(this.isBatchMode?(l=N.isNullOrUndefined(r)?null:r.getAttribute("data-uid"))&&this.batchParentNode.add(l):this.ensureParentCheckState(r)),"check"===s.action?l=!0:"uncheck"===s.action&&(l=!1),this.ensureStateChange(i,l)),this.nodeCheckedEvent(e,t,n)},p.prototype.updateActiveClass=function(e,t){this.showCheckBox&&this.checkOnClick&&("check"===t||!1===t?(this.removeSelectAll(),N.addClass([e],vs)):"uncheck"!==t&&"indeterminate"!==t&&!0!==t||N.removeClass([e],vs))},p.prototype.ensureStateChange=function(e,t){var i=this,s=N.select("."+k,e),n=e.getAttribute("data-uid"),r=this.fields;if(1===this.dataType&&this.autoCheck){var l=new x.DataManager(this.treeData).executeLocal((new x.Query).where(r.parentID,"equal",n,!0)),e=l.filter(function(e){return-1!==i.checkedNodes.indexOf(e[r.id].toString())},this);-1!==this.checkedNodes.indexOf(n)&&e.length!==l.length&&this.isFilter&&0<e.length&&(l=e);for(var o=0;o<l.length;o++){var a,d=l[parseInt(o.toString(),10)][this.fields.id]?l[parseInt(o.toString(),10)][this.fields.id].toString():null,h=l[parseInt(o.toString(),10)][this.fields.isChecked]?l[parseInt(o.toString(),10)][this.fields.isChecked].toString():null;-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(d)?(this.checkDisabledState(d,l[o]),a=this.getChildNodes(this.treeData,d),this.getChildItems(a,t),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)):-1===this.checkedNodes.indexOf(n)&&null===s&&-1!==this.checkedNodes.indexOf(d)?(this.checkedNodes.splice(this.checkedNodes.indexOf(d),1),"true"===h&&this.updateField(this.treeData,this.fields,d,"isChecked",null),(-1===this.checkedNodes.indexOf(n)&&null===s||-1!==this.parentNodeCheck.indexOf(d))&&(h=this.getChildNodes(this.treeData,d),this.getChildItems(h,t),-1!==this.parentNodeCheck.indexOf(d))&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)):(a=this.getChildNodes(this.treeData,d),this.getChildItems(a,t))}}else if(1!==this.dataType||this.autoCheck)(a=this.getChildNodes(this.treeData,n))&&(0<(e=a.filter(function(e){e=String(e[Object.keys(e)[0]]);return-1!==i.checkedNodes.indexOf(e)})).length&&a.length&&this.isFilter&&(a=e),this.childStateChange(a,n,s,t));else if(t)for(o=0;o<this.treeData.length;o++){var c=this.treeData[parseInt(o.toString(),10)][this.fields.id]?this.treeData[parseInt(o.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(c)&&this.checkDisabledState(c,this.treeData[o])}else{for(var p=new x.DataManager(this.treeData).executeLocal((new x.Query).where(r.isChecked,"equal",!0,!1)),o=0;o<p.length;o++){var u=p[parseInt(o.toString(),10)][this.fields.id]?p[parseInt(o.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(u)&&this.checkedNodes.splice(this.checkedNodes.indexOf(u),1),this.updateField(this.treeData,this.fields,u,"isChecked",null)}this.checkedNodes=[]}},p.prototype.checkDisabledState=function(e,t){var i,s=this.checkDisabledChildren;s||(i=!0,this.loadOnDemand&&this.fields.htmlAttributes&&(t=N.isNullOrUndefined(t)?t:this.getNodeObject(e),N.isNullOrUndefined(t)||(t=t[this.fields.htmlAttributes])&&!N.isNullOrUndefined(t.class)&&-1!==t.class.indexOf(Rs)&&(i=!1)),s=(t=N.select('[data-uid="'+e+'"]',this.element))?!t.classList.contains(Rs):-1===this.disableNode.indexOf(e)&&i),s&&this.checkedNodes.push(e)},p.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,n=e[parseInt(i.toString(),10)][this.fields.isChecked]?e[parseInt(i.toString(),10)][this.fields.isChecked].toString():null,n=(-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkDisabledState(s,e[i]),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null),this.getChildNodes(this.treeData,s));0<n.length&&this.getChildItems(n,t)}},p.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",l=e[parseInt(n.toString(),10)][this.fields.isChecked]?e[parseInt(n.toString(),10)][this.fields.isChecked].toString():null,l=(this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkDisabledState(r,e[n]),-1!==this.parentNodeCheck.indexOf(r)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(r),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(r)||s||(this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),"true"===l&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[])),this.getChildNodes([e[parseInt(n.toString(),10)]],r));l&&this.childStateChange(l,t,i,s)}},p.prototype.allCheckNode=function(e,t,i,s,n){if(e)for(var r=0;r<e.length;r++){var l,o=N.getValue(this.fields.id,e[parseInt(r.toString(),10)]),a=this.element.querySelector('[data-uid="'+o+'"]'),a=(!1===n||-1!==this.checkedElement.indexOf(o.toString())||(null!==a||N.isNullOrUndefined(e[parseInt(r.toString(),10)][this.fields.isChecked])||-1!==t.indexOf(o.toString()))&&0!==s&&2!==i||(!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?t.push(o.toString()):s=null,s=!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?0:null),-1===t.indexOf(o.toString())&&N.isNullOrUndefined(i)&&t.push(o.toString()),N.getValue(this.fields.child.toString(),e[parseInt(r.toString(),10)]));(!0===N.getValue(this.fields.hasChildren,e[parseInt(r.toString(),10)])||a)&&(o=N.getValue(this.fields.id,e[parseInt(r.toString(),10)]),l=void 0,l=1===this.dataType?this.getChildNodes(this.treeData,o.toString()):a)&&(N.isNullOrUndefined(n)?this.allCheckNode(l,t,i,s):this.allCheckNode(l,t,i,s,n),s=null),s=null}},p.prototype.openNode=function(e,t){var i=this.getFocusedNode(),s=N.select("div."+L,i);e?s&&(s.classList.contains(E)?this.expandAction(i,s,t):this.focusNextNode(i,!0)):s&&s.classList.contains(u)?this.collapseNode(i,s,t):(e=N.closest(N.closest(i,"."+k),"."+w))&&!e.classList.contains("e-disable")&&(this.setFocus(i,e),this.navigateToFocus(!0))},p.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},p.prototype.navigateRootNode=function(e){var t=this.getFocusedNode(),i=e?this.getRootNode():this.getEndNode();i.classList.contains("e-disable")||(this.setFocus(t,i),this.navigateToFocus(e))},p.prototype.getFocusedNode=function(){var e,t,i=N.select("."+w+'[tabindex="0"]',this.element);return N.isNullOrUndefined(i)||"mixed"!==(t=i.getAttribute("aria-checked"))&&"false"!==t||(this.isFilter=!1),N.isNullOrUndefined(i)&&(e=N.select("."+w,this.element)),N.isNullOrUndefined(i)?N.isNullOrUndefined(e)?this.element.firstElementChild:e:i},p.prototype.focusNextNode=function(e,t){if(this.enableVirtualization&&!N.isNullOrUndefined(this.height)){var i=e?e.getAttribute("data-uid"):null,s=-1,n=(N.isNullOrUndefined(i)||(n=this.virtualNodeMap.get(i),s=N.isNullOrUndefined(n)?-1:n),t?s+1:s-1);if(!(n<0||n>=this.virtualFlatNodes.length)){for(var s=this.virtualFlatNodes[parseInt(n.toString(),10)].id,r=(this.virtualFocusedId=s,this.element.querySelectorAll("."+w+"."+Ws)),l=0;l<r.length;l++)r[parseInt(l.toString(),10)].classList.remove(Ws),r[parseInt(l.toString(),10)].classList.remove(_s),r[parseInt(l.toString(),10)].setAttribute("tabindex","-1");this.ensureVirtualNodeVisible(s);n=i?this.getElement(i):e,i=this.getElement(s);N.isNullOrUndefined(i)||this.setFocus(N.isNullOrUndefined(n)?i:n,i)}}else{s=t?this.getNextNode(e):this.getPrevNode(e);this.setFocus(e,s),this.navigateToFocus(!t),s.classList.contains("e-disable")&&(n=s.lastChild,null==s.previousSibling&&s.classList.contains("e-level-1")?this.focusNextNode(s,!0):null==s.nextSibling&&s.classList.contains("e-node-collapsed")||null==s.nextSibling&&n.classList.contains(Cs)?this.focusNextNode(s,!1):this.focusNextNode(s,t))}},p.prototype.getNextNode=function(e){var t,i=this.liList.indexOf(e);do{if(i++,t=this.liList[parseInt(i.toString(),10)],N.isNullOrUndefined(t))return e}while(!N.isVisible(t));return t},p.prototype.getPrevNode=function(e){var t,i=this.liList.indexOf(e);do{if(i--,t=this.liList[parseInt(i.toString(),10)],N.isNullOrUndefined(t))return e}while(!N.isVisible(t));return t},p.prototype.getRootNode=function(){for(var e,t=0;e=this.liList[parseInt(t.toString(),10)],t++,!N.isVisible(e););return e},p.prototype.getEndNode=function(){for(var e,t=this.liList.length-1;e=this.liList[parseInt(t.toString(),10)],t--,!N.isVisible(e););return e},p.prototype.setFocus=function(e,t){N.removeClass([e],Ws),N.removeClass([e],_s),e.setAttribute("tabindex","-1"),t.classList.contains("e-disable")||(N.addClass([t],Ws),N.addClass([t],_s),t.setAttribute("tabindex","0"),this.enableVirtualization&&!N.isNullOrUndefined(this.height)?t.focus({preventScroll:!0}):t.focus(),t.focus(),N.EventHandler.add(t,"blur",this.focusOut,this),this.updateIdAttr(e,t))},p.prototype.updateIdAttr=function(e,t){this.element.removeAttribute("aria-activedescendant"),e&&e.removeAttribute("id"),t.setAttribute("id",this.element.id+"_active"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active")},p.prototype.focusIn=function(){var e,t=this.getFocusedNode();t&&(e=document.activeElement,this.enableVirtualization&&e===t&&"0"===e.getAttribute("tabindex")&&e.classList.contains(Ws)?this.isKeyboardFocus&&!e.classList.contains(_s)&&N.addClass([e],_s):this.mouseDownStatus?this.isKeyboardFocus&&!t.classList.contains("e-disable")&&N.addClass([t],_s):(t.classList.contains("e-disable")?(t.setAttribute("tabindex","-1"),this.navigateNode(!0)):(t.setAttribute("tabindex","0"),N.addClass([t],Ws),this.isKeyboardFocus&&N.addClass([t],_s),N.EventHandler.add(t,"blur",this.focusOut,this)),this.mouseDownStatus=!1),this.isKeyboardFocus=!1)},p.prototype.focusOut=function(e){var t=this.getFocusedNode();e.target===t&&(N.removeClass([t],Ws),N.removeClass([t],_s),N.EventHandler.remove(t,"blur",this.focusOut),this.enableVirtualization)&&(this.virtualFocusedId=null)},p.prototype.onMouseOver=function(e){var t;N.Browser.isDevice||(t=(e=e.target).classList,!(e=N.closest(e,"."+w))||t.contains(k)||t.contains(w)?this.removeHover():e&&!e.classList.contains("e-disable")&&this.setHover(e))},p.prototype.setHover=function(e){e.classList.contains(gs)||e.classList.contains(Gs)||(this.removeHover(),N.addClass([e],gs))},p.prototype.onMouseLeave=function(){this.removeHover()},p.prototype.removeHover=function(){var e=N.selectAll("."+gs,this.element);e&&e.length&&N.removeClass(e,gs)},p.prototype.getNodeData=function(e,t,i){var s,n,r,l,o,a,d;return!N.isNullOrUndefined(e)&&e.classList.contains(w)&&!N.isNullOrUndefined(N.closest(e,"."+ms))&&N.closest(e,"."+ms).classList.contains(us)?(s=e.getAttribute("data-uid"),t=this.getText(e,t,i),i=(i=N.closest(e.parentNode,"."+w))?i.getAttribute("data-uid"):null,n=e.classList.contains(vs),r=!e.classList.contains(Gs),l="true"===e.getAttribute("aria-expanded"),o=null!==e.getAttribute("aria-expanded")||null!=(N.select("."+E,e)||N.select("."+u,e)),a=null,d=N.select("."+js,e),{id:s,text:t,parentID:i,selected:n,selectable:r,expanded:l,isChecked:a=this.showCheckBox&&d?e.getAttribute("aria-checked"):a,hasChildren:o}):{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},p.prototype.getText=function(e,t,i){var s;return t?(t=N.isNullOrUndefined(i)?this.getNodeObject(e.getAttribute("data-uid")):i,s=parseFloat(e.getAttribute("aria-level")),s=this.getFields(this.fields,s,1),N.isNullOrUndefined(i)?N.getValue(s.text,t):i.text):N.select("."+fs,e).textContent},p.prototype.getExpandEvent=function(e,t){var i=this.getNodeData(e);return{cancel:!1,isInteracted:!N.isNullOrUndefined(t),node:e,nodeData:i,event:t}},p.prototype.renderNodeTemplate=function(e,t,i){e=this.nodeTemplateFn(e,this,"nodeTemplate"+i,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,t,this.root);e&&(e=Array.prototype.slice.call(e),N.append(e,t))},p.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},p.prototype.reRenderNodes=function(){this.updateListProp(this.fields),N.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",N.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},p.prototype.setCssClass=function(e,t){N.isNullOrUndefined(e)||""===e||N.removeClass([this.element],e.split(" ")),N.isNullOrUndefined(t)||""===t||N.addClass([this.element],t.split(" "))},p.prototype.editingHandler=function(e){var e=e.target;!e||e.classList.contains(us)||e.classList.contains(k)||e.classList.contains(w)||e.classList.contains(L)||e.classList.contains(Ss)||e.classList.contains(Is)||(e=N.closest(e,"."+w),this.createTextbox(e))},p.prototype.createTextbox=function(i){var s=this,e=N.select("."+xs,this.element),n=(e&&e.blur(),N.select("."+fs,i)),e=(this.updateOldText(i),this.createElement("input",{className:xs,attrs:{value:this.oldText}})),r=this.getEditEvent(i,null,e.outerHTML);this.trigger("nodeEditing",r,function(e){var t;e.cancel||(t=n.offsetWidth+5+"px",N.addClass([i],Es),N.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(i),s.isReact?setTimeout(function(){s.renderTextBox(r,n,t)},5):s.renderTextBox(r,n,t))})},p.prototype.renderTextBox=function(e,t,i){t.innerHTML=e.innerHtml;e=N.select("."+xs,t),this.inputObj=B.Input.createInput({element:e,properties:{enableRtl:this.enableRtl}},this.createElement),this.inputObj.container.style.width=i,e.focus(),t=e;t.setSelectionRange(0,t.value.length),this.wireInputEvents(e)},p.prototype.updateOldText=function(e){var t=e.getAttribute("data-uid"),t=(this.editData=this.getNodeObject(t),parseFloat(e.getAttribute("aria-level")));this.editFields=this.getFields(this.fields,t,1),this.oldText=N.getValue(this.editFields.text,this.editData)},p.prototype.inputFocusOut=function(e){var t,i,s;N.select("."+xs,this.element)&&(t=(e=e.target).value,i=N.closest(e,"."+fs),s=N.closest(e,"."+w),N.detach(this.inputObj.container),B.Input.destroy({element:e,properties:this.properties}),this.fields.dataSource instanceof x.DataManager&&!this.isOffline?this.crudOperation("update",null,s,t,null,null,!0):this.appendNewText(s,i,t,!0),N.EventHandler.remove(e,"blur",this.inputFocusOut),this.inputObj=null,N.detach(e))},p.prototype.appendNewText=function(t,i,s,n){var r=this,e=this.getEditEvent(t,s,null);this.trigger("nodeEdited",e,function(e){s=e.cancel?e.oldText:e.newText,r.updateText(t,i,s,n),e.oldText!==s&&r.triggerEvent("nodeEdited",[r.getNode(t)])})},p.prototype.updateText=function(e,t,i,s){var n,r=N.setValue(this.editFields.text,i,this.editData);N.isNullOrUndefined(this.nodeTemplateFn)?t[O.ListBase.getDomSetter(this.listBaseOption)]=O.ListBase.getSanitizedText(i,this.listBaseOption):(t.innerText="",n=e.getAttribute("data-uid"),this.renderNodeTemplate(r,t,n),this.renderReactTemplates()),this.enableVirtualization&&(r=e.getAttribute("data-uid"),t=this.virtualNodeMap?this.virtualNodeMap.get(r):void 0,!N.isNullOrUndefined(t))&&-1<t&&(this.virtualFlatNodes[parseInt(t.toString(),10)].text=i),s&&(N.removeClass([e],Es),e.focus(),N.EventHandler.add(e,"blur",this.focusOut,this),N.addClass([e],Ws)),this.allowTextWrap&&this.calculateWrap(e)},p.prototype.getElement=function(e){return N.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?N.getElement(e):null},p.prototype.getId=function(e){return N.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?N.getElement(e).getAttribute("data-uid"):null},p.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},p.prototype.getNodeObject=function(e){if(!N.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var t=0,i=this.treeData.length;t<i;t++){var s=N.getValue(this.fields.id,this.treeData[parseInt(t.toString(),10)]);if(!N.isNullOrUndefined(this.treeData[parseInt(t.toString(),10)])&&!N.isNullOrUndefined(s)&&s.toString()===e)return this.treeData[parseInt(t.toString(),10)]}}},p.prototype.getChildNodeObject=function(e,t,i){if(!N.isNullOrUndefined(e))for(var s=0,n=e.length;s<n;s++){var r=N.getValue(t.id,e[parseInt(s.toString(),10)]);if(e[parseInt(s.toString(),10)]&&r&&r.toString()===i)return e[parseInt(s.toString(),10)];if("string"!=typeof t.child||N.isNullOrUndefined(N.getValue(t.child,e[parseInt(s.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!N.isNullOrUndefined(N.getValue("child",e[parseInt(s.toString(),10)]))){if(void 0!==(l=this.getChildNodeObject(N.getValue("child",e[parseInt(s.toString(),10)]),this.getChildMapper(t),i)))break}else if(this.isChildObject()){o=N.getValue("child",e[parseInt(s.toString(),10)]);if(void 0!==(l=this.getChildNodeObject(o,this.getChildMapper(t),i)))break}}else{var l,o=N.getValue(t.child,e[parseInt(s.toString(),10)]);if(void 0!==(l=this.getChildNodeObject(o,this.getChildMapper(t),i)))break}}return l},p.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},p.prototype.initializeDrag=function(){var s,n=this;this.dragObj=new N.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+Cs,enableTapHold:!0,tapHoldThreshold:100,helper:function(e){n.dragTarget=e.sender.target;var t=N.closest(n.dragTarget,"."+us),i=N.closest(n.dragTarget,"."+Cs);return n.dragLi=N.closest(n.dragTarget,"."+w),n.fullRowSelect&&!i&&n.dragTarget.classList.contains(Ps)&&(i=n.dragTarget.nextElementSibling),!(!(n.dragTarget&&e.element.isSameNode(t)&&i)||n.dragTarget.classList.contains(us)||n.dragTarget.classList.contains(k)||n.dragTarget.classList.contains(w)||n.dragLi.classList.contains("e-disable"))&&(e=i.cloneNode(!0),N.isNullOrUndefined(N.select("div."+L,e))&&(t=n.createElement("div",{className:L+" "+E}),e.insertBefore(t,e.children[0])),i="e-drag-item "+us+" "+n.cssClass+" "+(n.enableRtl?"e-rtl":""),(s=n.createElement("div",{className:i})).appendChild(e),1<(t=n.selectedNodes.length)&&n.allowMultiSelection&&n.dragLi.classList.contains(vs)&&(i=n.createElement("span",{className:"e-drop-count",innerHTML:""+t}),s.appendChild(i)),n.getAppendToElement().appendChild(s),document.body.style.cursor="",n.dragData=n.getNodeData(n.dragLi),s)},dragStart:function(t){N.addClass([n.element],ws);var e,i=N.closest(t.target,".e-list-item"),i=(i&&(e=parseInt(i.getAttribute("aria-level"),10)),n.getDragEvent(t.event,n,null,t.target,null,s,e));i.draggedNode.classList.contains(Es)?(n.dragObj.intDestroy(t.event),n.dragCancelAction(s)):n.trigger("nodeDragStart",i,function(e){e.cancel?(n.dragObj.intDestroy(t.event),n.dragCancelAction(s)):n.dragStartAction=!0})},drag:function(e){n.dragObj.setProperties({cursorAt:{top:!N.isNullOrUndefined(e.event.targetTouches)||N.Browser.isDevice?60:-20}}),n.dragAction(e,s)},dragStop:function(t){var i,e,s;t.target?(N.removeClass([n.element],ws),t.target.classList.contains("e-sibling")||n.removeVirtualEle(),i=t.target,s=N.closest(i,"."+Os),i&&s||(N.detach(t.helper),document.body.style.cursor=""),(s=N.closest(i,".e-list-item"))&&(e=parseInt(s.getAttribute("aria-level"),10)),(s=n.getDragEvent(t.event,n,i,i,null,t.helper,e)).preventTargetExpand=!1,n.trigger("nodeDragStop",s,function(e){n.dragParent=e.draggedParentNode,n.preventExpand=e.preventTargetExpand,e.cancel&&(t.helper.parentNode&&N.detach(t.helper),document.body.style.cursor="",i.classList.contains("e-sibling"))&&n.removeVirtualEle(),n.dragStartAction=!1})):(t.helper&&t.helper.parentNode&&N.detach(t.helper),document.body.style.cursor="",N.removeClass([n.element],ws),n.dragStartAction=!1)}}),this.dropObj=new N.Droppable(this.element,{out:function(e){e.target&&!N.isNullOrUndefined(e)&&!e.target.classList.contains(ks)&&n.dropObj.dragData.default&&n.dropObj.dragData.default.helper.classList.contains(us)&&(document.body.style.cursor="not-allowed")},over:function(){document.body.style.cursor=""},drop:function(e){n.dropAction(e),n.removeVirtualEle()}})},p.prototype.dragCancelAction=function(e){N.detach(e),N.removeClass([this.element],ws),this.dragStartAction=!1},p.prototype.getAppendToElement=function(){if(this.isAngular){var e=this.element.closest(".cdk-overlay-pane"),t=this.element.closest("[popover]");if(e&&t)return e}return document.body},p.prototype.getOffsetX=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientX-t.getBoundingClientRect().left:e.offsetX},p.prototype.getOffsetY=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientY-t.getBoundingClientRect().top:e.offsetY},p.prototype.dragAction=function(e,t){var i,s,n,r,l,o,a,d,h,c,p;e.target&&(p=N.closest(e.target,"."+Os),h=N.closest(e.target,"."+Cs),i=N.select("div."+L,t),N.removeClass([i],[Ls,As,Ts,Ds]),this.isDropIn=!1,this.removeVirtualEle(),document.body.style.cursor="",r=e.target.classList,n=e.event,s=this.getOffsetY(n,e.target),n=this.getOffsetX(n,e.target),this.fullRowSelect&&!h&&!N.isNullOrUndefined(r)&&r.contains(Ps)&&(h=e.target.nextElementSibling),p?(r=N.closest(e.target,"."+w),l=N.closest(e.target,"."+js),o=N.closest(e.target,"."+u),a=N.closest(e.target,"."+E),!p.classList.contains(us)||h&&!r.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,r)?this.hasTemplate&&r?(p=N.select(this.fullRowSelect?"."+Ps:"."+Cs,r),e&&!a&&!o&&s<7&&!l||a&&s<5||o&&n<3?(d=this.fullRowSelect?1:0,this.appendIndicator(r,i,d)):e&&!a&&!o&&!l&&p&&s>p.offsetHeight-10||a&&19<s||o&&19<n?(d=this.fullRowSelect?2:1,this.appendIndicator(r,i,d)):(N.addClass([i],Ls),this.isDropIn=!0)):r&&e&&!a&&!o&&s<7&&!l||a&&s<5||o&&n<3?(d=this.fullRowSelect?1:0,this.appendIndicator(r,i,d)):r&&e&&!a&&!o&&0<e.target.offsetHeight&&s>e.target.offsetHeight-10&&!l||a&&19<s||o&&19<n?(d=this.fullRowSelect?2:1,this.appendIndicator(r,i,d)):(N.addClass([i],Ls),this.isDropIn=!0):"LI"!==e.target.nodeName||r.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,r)?e.target.classList.contains(ks)?N.addClass([i],As):N.addClass([i],Ts):(N.addClass([i],As),this.renderVirtualEle(e))):(N.addClass([i],Ds),document.body.style.cursor="not-allowed"),(h=N.closest(e.target,".e-list-item"))&&(c=parseInt(h.getAttribute("aria-level"),10)),(p=this.getDragEvent(e.event,this,e.target,e.target,null,t,c)).dropIndicator&&N.removeClass([i],p.dropIndicator),this.trigger("nodeDragging",p),p.dropIndicator)&&N.addClass([i],p.dropIndicator)},p.prototype.appendIndicator=function(e,t,i){N.addClass([t],As);t=this.createElement("div",{className:ks});e.insertBefore(t,e.children[parseInt(i.toString(),10)])},p.prototype.dropAction=function(e){for(var t,i=e.event,s=this.getOffsetY(i,e.target),n=e.target,i=!1,r=[],l=[],o=e.dragData.draggable,a=0;a<o.ej2_instances.length;a++)if(o.ej2_instances[parseInt(a.toString(),10)]instanceof an){t=o.ej2_instances[parseInt(a.toString(),10)];break}if(t&&t.dragTarget){var d=t.dragTarget,d=N.closest(d,"."+w),h=N.closest(n,"."+w);if(l.push(d),null==h&&n.classList.contains(us)&&(h=n.firstElementChild),N.detach(e.droppedElement),document.body.style.cursor="",!h||h.isSameNode(d)||this.isDescendant(d,h))return void(this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1));if(t.allowMultiSelection&&d.classList.contains(vs)){var c=N.selectAll("."+vs,t.element),l=c;if(e.target.offsetHeight<=33&&s>e.target.offsetHeight-10&&6<s)for(a=c.length-1;0<=a;a--)h.isSameNode(c[parseInt(a.toString(),10)])||this.isDescendant(c[parseInt(a.toString(),10)],h)||this.appendNode(n,c[parseInt(a.toString(),10)],h,e,t,s);else for(a=0;a<c.length;a++)h.isSameNode(c[parseInt(a.toString(),10)])||this.isDescendant(c[parseInt(a.toString(),10)],h)||this.appendNode(n,c[parseInt(a.toString(),10)],h,e,t,s)}else this.appendNode(n,d,h,e,t,s);d=parseInt(d.getAttribute("aria-level"),10),i=!0}this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1);for(var p=N.isNullOrUndefined(t)?null:t.dragData,a=0;a<l.length;a++)r.push(this.getNodeData(this.getElement(l[parseInt(a.toString(),10)]),!0,p));this.trigger("nodeDropped",this.getDragEvent(e.event,t,n,e.target,e.dragData.draggedElement,null,d,i)),t.element.id!==this.element.id&&(t.triggerEvent("nodeDropped",r),this.isNodeDropped=!0,this.fields.dataSource=this.treeData),this.triggerEvent("nodeDropped",r)},p.prototype.appendNode=function(e,t,i,s,n,r){var l=N.closest(e,"."+js),o=N.closest(s.target,"."+u),a=N.closest(s.target,"."+E);t.classList.contains("e-disable")||l||!(a&&s.event.offsetY<5||o&&s.event.offsetX<3||a&&19<s.event.offsetY||o&&19<s.event.offsetX||!a&&!o)?this.dropAsChildNode(t,i,n,null,s,r,!0,e):"LI"===e.nodeName?this.dropAsSiblingNode(t,i,s,n):e.firstElementChild&&e.classList.contains(us)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(t,i,s,n):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(t,i,s,n):this.dropAsChildNode(t,i,n,null,s,r,null,e),this.showCheckBox&&this.ensureIndeterminate()},p.prototype.dropAsSiblingNode=function(e,t,i,s){var n,r,l=N.closest(t,"."+k),o=N.closest(e,"."+k),a=N.closest(o,"."+w);0<i.target.offsetHeight&&i.event.offsetY>i.target.offsetHeight-2?n=!1:i.event.offsetY<2?n=!0:(i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible"))&&(i.event.offsetY<5||i.event.offsetX<3?n=!0:(15<i.event.offsetY||17<i.event.offsetX)&&(n=!1)),i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible")?(r=i.target.closest("li"),l.insertBefore(e,n?r:r.nextElementSibling)):l.insertBefore(e,n?i.target:i.target.nextElementSibling),this.moveData(e,t,l,n,s),this.updateElement(o,a),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},p.prototype.dropAsChildNode=function(e,t,i,s,n,r,l,o){var a,d=N.closest(e,"."+k),h=N.closest(d,"."+w),c=N.closest(t,"."+k);n&&n.target&&(a=N.select(this.fullRowSelect?"."+Ps:"."+Cs,t)),n&&(r<7&&!o.classList.contains("e-sibling")||o.classList.contains("e-sibling")&&!t.lastChild.classList.contains("e-sibling"))&&!l?(c.insertBefore(e,t),this.moveData(e,t,c,!0,i)):n&&0<n.target.offsetHeight&&r>n.target.offsetHeight-10&&!l&&!this.hasTemplate||this.hasTemplate&&a&&r>a.offsetHeight-10&&!l?(c.insertBefore(e,t.nextElementSibling),this.moveData(e,t,c,!1,i)):(o=this.expandParent(t),n=N.isNullOrUndefined(s)?null:o.childNodes[parseInt(s.toString(),10)],o.insertBefore(e,n),this.moveData(e,n,o,!0,i)),this.updateElement(d,h),this.updateAriaLevel(e),i.element.id===this.element.id?this.updateList():(i.updateInstance(),this.updateInstance())},p.prototype.moveData=function(e,t,i,s,n){var i=N.closest(i,"."+w),e=this.getId(e),r=n.updateChildField(n.treeData,n.fields,e,null,null,!0),t=this.getId(t),t=t?this.getDataPos(this.treeData,this.fields,t):null,i=this.getId(i);if(1===this.dataType){this.updateField(this.treeData,this.fields,i,"hasChildren",!0);var l,o=N.isNullOrUndefined(t)?this.treeData.length:s?t:t+1;if(N.isNullOrUndefined(i)&&!this.hasPid?delete r[0][this.fields.parentID]:(l=this.isNumberTypeId?parseFloat(i):i,N.setValue(this.fields.parentID,l,r[0])),this.treeData.splice(o,0,r[0]),n.element.id!==this.element.id){var a=n.removeChildNodes(e);o++;for(var d=0,h=a.length;d<h;d++)this.treeData.splice(o,0,a[parseInt(d.toString(),10)]),o++;n.groupedData=n.getGroupedData(n.treeData,n.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,i,r,s?t:t+1)},p.prototype.expandParent=function(e){var t,i=N.select("div."+E+", div."+u,e),s=(i&&i.classList.contains(E)&&!0!==this.preventExpand&&this.expandAction(e,i,null),N.select("."+k,e)),n=(!0===this.preventExpand&&!s&&i&&this.renderChildNodes(e),s=N.select("."+k,e),!N.isNullOrUndefined(s)&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(s.style.display="none"),N.isNullOrUndefined(s)||!1!==this.preventExpand||(s.style.display="block"),N.isNullOrUndefined(s)&&!0===this.preventExpand&&(N.isNullOrUndefined(i)&&O.ListBase.generateIcon(this.createElement,e,E,this.listBaseOption),(t=N.select("div."+E+", div."+u,e))&&t.classList.add("e-icon-expandable"),s=O.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(s),t?N.removeClass([t],u):O.ListBase.generateIcon(this.createElement,e,E,this.listBaseOption),e.setAttribute("aria-expanded","false"),s.style.display="none"),N.isNullOrUndefined(s)&&(n=this.expandArgs,(N.isNullOrUndefined(n)||n&&"nodeExpanding"!==n.name)&&this.trigger("nodeExpanding",this.getExpandEvent(e,null)),N.isNullOrUndefined(i)&&O.ListBase.generateIcon(this.createElement,e,u,this.listBaseOption),(t=N.select("div."+E+", div."+u,e))||(O.ListBase.generateIcon(this.createElement,e,u,this.listBaseOption),t=N.select("div."+L,e)),N.removeClass([t],E),s=O.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(s),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))),N.select("div."+u,e));return!N.isNullOrUndefined(s)&&n&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(N.removeClass([n],u),e.setAttribute("aria-expanded","false"),N.addClass([n],E)),s},p.prototype.updateElement=function(e,t){var i;t&&0===e.childElementCount&&(i=N.select("div."+L,t),N.detach(e),N.detach(i),e=this.getId(t),this.updateField(this.treeData,this.fields,e,"hasChildren",!1),this.removeExpand(t,!0))},p.prototype.updateAriaLevel=function(e){var t=this.parents(e,"."+k).length;e.setAttribute("aria-level",""+t),this.updateChildAriaLevel(N.select("."+k,e),t+1)},p.prototype.updateChildAriaLevel=function(e,t){if(!N.isNullOrUndefined(e))for(var i=e.childNodes,s=0,n=i.length;s<n;s++){var r=i[parseInt(s.toString(),10)];r.setAttribute("aria-level",""+t),this.updateChildAriaLevel(N.select("."+k,r),t+1)}},p.prototype.renderVirtualEle=function(e){var t=e.event,t=this.getOffsetY(t,e.target),t=(t>e.target.offsetHeight-2?i=!1:t<2&&(i=!0),this.createElement("div",{className:ks})),i=this.fullRowSelect?i?1:2:i?0:1;e.target.insertBefore(t,e.target.children[parseInt(i.toString(),10)])},p.prototype.removeVirtualEle=function(){var e=N.select("."+ks);e&&N.detach(e)},p.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},p.prototype.getDragEvent=function(e,t,i,s,n,r,l,o){var a=i?N.closest(i,"."+w):null,d=a?this.getNodeData(a):null,h=t?t.dragLi:n,n=t?t.dragData:null,c=i?this.parents(i,"."+w):null,p=t.dragLi.parentElement,u=t.dragLi?N.closest(p,"."+w):null,m=null,f=null,g=[As,Ls,Ts,Ds],v=null,y=!0===o?h:a,b=y?N.closest(y,".e-list-parent"):null,C=0,S=null,u=t.dragLi&&null===u?N.closest(p,"."+us):u;if(u=!0===o?this.dragParent:u,r)for(;C<4;){if(N.select("."+L,r).classList.contains(g[parseInt(C.toString(),10)])){v=g[parseInt(C.toString(),10)];break}C++}if(b){for(var I=0,C=0;C<b.childElementCount;C++){if(I=!0!==o&&b.children[parseInt(C.toString(),10)]===h&&a!==h?++I:I,!0!==o&&b.children[parseInt(C.toString(),10)].classList.contains("e-hover")){f=23<=e.offsetY?C+1:C;break}if(b.children[parseInt(C.toString(),10)]===y){e.offsetY,f=C;break}}f=0!==I?--f:f,S=this.isDropIn?"Inside":e.offsetY<7?"Before":"After"}return i&&(m=0===c.length?null:i.classList.contains(w)?c[0]:c[1]),a===h&&(m=a),i&&s.offsetHeight<=33&&e.offsetY<s.offsetHeight-10&&6<e.offsetY&&(m=a,!0!==o)&&(l=++l,f=(t=m?N.select(".e-list-parent",m):null)?t.children.length:0,this.fields.dataSource instanceof x.DataManager||null!==t||!m||(f=(p=m.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,m.getAttribute("data-uid").toString()):null)?p.length:0)),{cancel:!1,clonedNode:r,event:e,draggedNode:h,draggedNodeData:n,droppedNode:a,droppedNodeData:d,dropIndex:f,dropLevel:l,draggedParentNode:u,dropTarget:m,dropIndicator:v,target:s,position:S}},p.prototype.addFullRow=function(e){var t=this.liList.length;if(e)for(var i=0;i<t;i++)this.createFullRow(this.liList[parseInt(i.toString(),10)]);else for(i=0;i<t;i++){var s=N.select("."+Ps,this.liList[parseInt(i.toString(),10)]);N.detach(s)}},p.prototype.createFullRow=function(e){var t=this.createElement("div",{className:Ps});e.insertBefore(t,e.childNodes[0])},p.prototype.addMultiSelect=function(e){if(e)for(var t=0,i=N.selectAll("."+w+':not([aria-selected="true"])',this.element);t<i.length;t++)i[t].setAttribute("aria-selected","false");else for(var s=0,n=N.selectAll("."+w+'[aria-selected="false"]',this.element);s<n.length;s++)n[s].removeAttribute("aria-selected")},p.prototype.collapseByLevel=function(e,t,i,s){if(s=N.isNullOrUndefined(s)?1:s,0<t&&!N.isNullOrUndefined(e))for(var n=this.getVisibleNodes(i,e.childNodes),r=0,l=n.length;r<l;r++){var o=n[parseInt(r.toString(),10)],a=N.select("."+u,N.select("."+Cs,o));t<=s&&!N.isNullOrUndefined(a)&&this.collapseNode(o,a,null),this.collapseByLevel(N.select("."+k,o),t,i,s+1)}},p.prototype.collapseAllNodes=function(e){for(var t=this.getVisibleNodes(e,N.selectAll("."+u,this.element)),i=0,s=t.length;i<s;i++){var n=t[parseInt(i.toString(),10)],r=N.closest(n,"."+w);this.collapseNode(r,n,null)}},p.prototype.expandByLevel=function(e,t,i){if(0<t&&!N.isNullOrUndefined(e))for(var s=this.getVisibleNodes(i,e.childNodes),n=0,r=s.length;n<r;n++){var l=s[parseInt(n.toString(),10)],o=N.select("."+E,N.select("."+Cs,l));N.isNullOrUndefined(o)||this.expandAction(l,o,null),this.expandByLevel(N.select("."+k,l),t-1,i)}},p.prototype.expandAllNodes=function(e){for(var t=0,i=this.getVisibleNodes(e,N.selectAll("."+E,this.element));t<i.length;t++){var s=i[t],n=N.closest(s,"."+w);this.expandAction(n,s,null,!0,null,!0)}},p.prototype.getVisibleNodes=function(e,t){var i=Array.prototype.slice.call(t);if(e)for(var s=0;s<i.length;s++)N.isVisible(i[parseInt(s.toString(),10)])||(i.splice(s,1),s--);return i},p.prototype.removeNode=function(e){var t=N.closest(e,"."+k),i=N.closest(t,"."+w);N.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),N.detach(e),this.updateElement(t,i),this.removeData(e)},p.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},p.prototype.updateList=function(){this.liList=Array.prototype.slice.call(N.selectAll("."+w,this.element))},p.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=N.selectAll("."+vs,this.element);this.selectGivenNodes(e)},p.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=N.selectAll('[aria-expanded="true"]',this.element),t=0,i=e.length;t<i;t++)this.addExpand(e[parseInt(t.toString(),10)])},p.prototype.removeData=function(e){var t,i,s,n;1===this.dataType?(t=new x.DataManager(this.treeData),n=this.getId(e),i={},s=this.isNumberTypeId?parseFloat(n):n,i[this.fields.id]=s,t.remove(this.fields.id,i),this.removeChildNodes(n)):(n=this.getId(e),this.updateChildField(this.treeData,this.fields,n,null,null,!0))},p.prototype.removeChildNodes=function(e){for(var t=this.getChildGroup(this.groupedData,e,!1),i=[],s=0,n=t.length;s<n;s++){var r=new x.DataManager(this.treeData),l=N.getValue(this.fields.id,t[parseInt(s.toString(),10)]).toString(),o={},a=this.isNumberTypeId?parseFloat(l):l,a=(o[this.fields.id]=a,r.remove(this.fields.id,o));i.push(a[0]),this.removeChildNodes(l)}return i},p.prototype.doGivenAction=function(e,t,i){for(var s=0,n=e.length;s<n;s++){var r,l=this.getElement(e[parseInt(s.toString(),10)]);N.isNullOrUndefined(l)||(r=N.select("."+t,N.select("."+Cs,l)),N.isNullOrUndefined(r))||(i?this.expandAction(l,r,null):this.collapseNode(l,r,null))}},p.prototype.addGivenNodes=function(e,t,i,s,n){if(0!==e.length){var r,l,o=this.getSortedData(e),a=t?parseFloat(t.getAttribute("aria-level"))+1:1,d=(s&&this.updateMapper(a),O.ListBase.createListItemFromJson(this.createElement,o,this.listBaseOption,a)),h=this.getId(t),c=(N.isNullOrUndefined(t)||(r=N.select("div."+L,t)),1===this.dataType&&r&&r.classList.contains(E)&&this.preventExpand&&!N.isNullOrUndefined(this.element.offsetParent)&&!this.element.offsetParent.parentElement.classList.contains("e-filemanager")&&(this.preventExpand=!0),1!==this.dataType&&(this.addChildData(this.treeData,this.fields,h,e,i),this.isFirstRender=!1),l=n||(t?this.expandParent(t):N.select("."+k,this.element)),N.isNullOrUndefined(i)?null:l.childNodes[parseInt(i.toString(),10)]);if(!this.isFirstRender||1===this.dataType){s=this.expandArgs;if(c||"None"===this.sortOrder){for(var p=0;p<d.length;p++)l.insertBefore(d[parseInt(p.toString(),10)],c);1!==this.dataType||N.isNullOrUndefined(t)||this.preventExpand||N.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=N.select("div."+L,t))&&u.classList.contains(E)&&(N.isNullOrUndefined(s)||"nodeExpanding"!==s.name)&&this.expandAction(t,u,null))}if(!c&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder))if(0===l.childNodes.length){for(var u,p=0;p<d.length;p++)l.insertBefore(d[parseInt(p.toString(),10)],c);1!==this.dataType||N.isNullOrUndefined(t)||this.preventExpand||N.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=N.select("div."+L,t))&&u.classList.contains(E)&&(N.isNullOrUndefined(s)||"nodeExpanding"!==s.name)&&this.expandAction(t,u,null))}else for(var m=l.childNodes,p=0;p<d.length;p++)for(var f=0;f<m.length;f++){if("Ascending"===this.sortOrder?m[parseInt(f.toString(),10)].textContent.toUpperCase()>d[parseInt(p.toString(),10)].innerText.toUpperCase():m[parseInt(f.toString(),10)].textContent.toUpperCase()<d[parseInt(p.toString(),10)].innerText.toUpperCase()){l.insertBefore(d[parseInt(p.toString(),10)],m[parseInt(f.toString(),10)]);break}l.insertBefore(d[parseInt(p.toString(),10)],m[m.length])}}if(1===this.dataType){this.updateField(this.treeData,this.fields,h,"hasChildren",!0);for(var g,o=this.getId(c),v=N.isNullOrUndefined(o)?this.treeData.length:this.getDataPos(this.treeData,this.fields,o),f=0;f<e.length;f++)N.isNullOrUndefined(h)||(g=this.isNumberTypeId?parseFloat(h):h,N.setValue(this.fields.parentID,g,e[parseInt(f.toString(),10)])),this.treeData.splice(v,0,e[parseInt(f.toString(),10)]),v++}this.finalizeNode(l)}},p.prototype.updateMapper=function(e){e=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(e)},p.prototype.updateListProp=function(e){e=this.getActualProperties(e);this.listBaseOption.fields=e,this.listBaseOption.fields.url=Object.prototype.hasOwnProperty.call(e,"navigateUrl")?e.navigateUrl:"navigateUrl"},p.prototype.getDataPos=function(e,t,i){for(var s=null,n=0,r=e.length;n<r;n++){var l=N.getValue(t.id,e[parseInt(n.toString(),10)]);if(e[parseInt(n.toString(),10)]&&l&&l.toString()===i)return n;if("string"!=typeof t.child||N.isNullOrUndefined(N.getValue(t.child,e[parseInt(n.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!N.isNullOrUndefined(N.getValue("child",e[parseInt(n.toString(),10)]))){l=N.getValue("child",e[parseInt(n.toString(),10)]);if(null!==(s=this.getDataPos(l,this.getChildMapper(t),i)))break}}else{l=N.getValue(t.child,e[parseInt(n.toString(),10)]);if(null!==(s=this.getDataPos(l,this.getChildMapper(t),i)))break}}return s},p.prototype.addChildData=function(e,t,i,s,n){if(N.isNullOrUndefined(i)){n=N.isNullOrUndefined(n)?e.length:n;for(var r=0,l=s.length;r<l;r++)e.splice(n,0,s[parseInt(r.toString(),10)]),n++}else for(var o=0,a=e.length;o<a;o++){var d=N.getValue(t.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&d&&d.toString()===i){if("string"==typeof t.child&&Object.prototype.hasOwnProperty.call(e[parseInt(o.toString(),10)],t.child)&&null!==e[parseInt(o.toString(),10)][t.child]||this.fields.dataSource instanceof x.DataManager&&Object.prototype.hasOwnProperty.call(e[parseInt(o.toString(),10)],"child")){var h="string"==typeof t.child?t.child:"child",c=N.getValue(h,e[parseInt(o.toString(),10)]);N.isNullOrUndefined(c)&&(c=[]),n=N.isNullOrUndefined(n)?c.length:n;for(r=0,l=s.length;r<l;r++)c.splice(n,0,s[parseInt(r.toString(),10)]),n++}else{h="string"==typeof t.child?t.child:"child";e[parseInt(o.toString(),10)][""+h]=s}return!0}if("string"!=typeof t.child||N.isNullOrUndefined(N.getValue(t.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!N.isNullOrUndefined(N.getValue("child",e[parseInt(o.toString(),10)]))){c=N.getValue("child",e[parseInt(o.toString(),10)]);if(void 0!==(p=this.addChildData(c,this.getChildMapper(t),i,s,n)))break}}else{var p,d=N.getValue(t.child,e[parseInt(o.toString(),10)]);if(void 0!==(p=this.addChildData(d,this.getChildMapper(t),i,s,n)))break}}return p},p.prototype.doDisableAction=function(e){var e=this.nodeType(e),t=this.checkValidId(e);this.validArr=[];for(var i=0,s=t.length;i<s;i++){var n=t[parseInt(i.toString(),10)][this.fields.id].toString(),n=(n&&-1===this.disableNode.indexOf(n)&&this.disableNode.push(n),this.getElement(n));n&&(n.setAttribute("aria-disabled","true"),N.addClass([n],Rs))}},p.prototype.doEnableAction=function(e){for(var t=this.nodeType(e),i=0,s=t.length;i<s;i++){var n=this.getElement(t[parseInt(i.toString(),10)]),r=t[parseInt(i.toString(),10)];r&&-1!==this.disableNode.indexOf(r)&&this.disableNode.splice(this.disableNode.indexOf(r),1),n&&(n.removeAttribute("aria-disabled"),N.removeClass([n],Rs))}},p.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[parseInt(i.toString(),10)]?n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].toString():null:"object"==typeof e[parseInt(i.toString(),10)]&&(n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].getAttribute("data-uid").toString():null),-1===t.indexOf(n)&&t.push(n)}return t},p.prototype.checkValidId=function(t){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(e){return-1!==t.indexOf(e[i.fields.id]?e[i.fields.id].toString():null)});else if(2===this.dataType)for(var e=0;e<this.treeData.length;e++){var s=this.treeData[parseInt(e.toString(),10)][this.fields.id]?this.treeData[parseInt(e.toString(),10)][this.fields.id].toString():null,s=(-1!==t.indexOf(s)&&this.validArr.push(this.treeData[parseInt(e.toString(),10)]),N.getValue(this.fields.child.toString(),this.treeData[parseInt(e.toString(),10)]));s&&this.filterNestedChild(s,t)}return this.validArr},p.prototype.filterNestedChild=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,s=(-1!==t.indexOf(s)&&this.validArr.push(e[parseInt(i.toString(),10)]),N.getValue(this.fields.child.toString(),e[parseInt(i.toString(),10)]));s&&this.filterNestedChild(s,t)}},p.prototype.setTouchClass=function(){var e=N.closest(this.element,".e-bigger");this.touchClass=N.isNullOrUndefined(e)?"":"e-small"},p.prototype.updatePersistProp=function(){this.removeField(this.treeData,this.fields,["selected","expanded"]);for(var e=this.selectedNodes,t=0,i=e.length;t<i;t++)this.updateField(this.treeData,this.fields,e[parseInt(t.toString(),10)],"selected",!0);for(var s=this.expandedNodes,n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[parseInt(n.toString(),10)],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var l=this.checkedNodes,o=0,r=l.length;o<r;o++)this.updateField(this.treeData,this.fields,l[parseInt(o.toString(),10)],"isChecked",!0)}},p.prototype.removeField=function(e,t,i){if(!N.isNullOrUndefined(e)&&!N.isNullOrUndefined(t))for(var s=0,n=e.length;s<n;s++){for(var r=0;r<i.length;r++){var l=this.getMapperProp(t,i[parseInt(r.toString(),10)]);N.isNullOrUndefined(e[parseInt(s.toString(),10)][""+l])||delete e[parseInt(s.toString(),10)][""+l]}"string"!=typeof t.child||N.isNullOrUndefined(N.getValue(t.child,e[parseInt(s.toString(),10)]))?this.fields.dataSource instanceof x.DataManager&&!N.isNullOrUndefined(N.getValue("child",e[parseInt(s.toString(),10)]))&&this.removeField(N.getValue("child",e[parseInt(s.toString(),10)]),this.getChildMapper(t),i):this.removeField(N.getValue(t.child,e[parseInt(s.toString(),10)]),this.getChildMapper(t),i)}},p.prototype.getMapperProp=function(e,t){switch(t){case"selected":return N.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return N.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return N.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return N.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return t}},p.prototype.updateField=function(e,t,i,s,n){var r;N.isNullOrUndefined(i)||(1===this.dataType?(r=this.isNumberTypeId?parseFloat(i):i,r=new x.DataManager(this.treeData).executeLocal((new x.Query).where(t.id,"equal",r,!1)),N.setValue(this.getMapperProp(t,s),n,r[0])):this.updateChildField(e,t,i,s,n))},p.prototype.updateChildField=function(e,t,i,s,n,r){if(!N.isNullOrUndefined(e))for(var l=0,o=e.length;l<o;l++){var a=N.getValue(t.id,e[parseInt(l.toString(),10)]);if(e[parseInt(l.toString(),10)]&&!N.isNullOrUndefined(a)&&a.toString()===i)return d=r?e.splice(l,1):(N.setValue(this.getMapperProp(t,s),n,e[parseInt(l.toString(),10)]),[]);if("string"!=typeof t.child||N.isNullOrUndefined(N.getValue(t.child,e[parseInt(l.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!N.isNullOrUndefined(N.getValue("child",e[parseInt(l.toString(),10)]))){a=N.getValue("child",e[parseInt(l.toString(),10)]);if(void 0!==(d=this.updateChildField(a,this.getChildMapper(t),i,s,n,r)))break}}else{var d,a=N.getValue(t.child,e[parseInt(l.toString(),10)]);if(void 0!==(d=this.updateChildField(a,this.getChildMapper(t),i,s,n,r)))break}}return d},p.prototype.triggerEvent=function(e,t){if(this.renderReactTemplates(),"addNodes"===e){for(var i=[],s=0;s<t.length;s++)i.push(this.getNode(this.getElement(N.isNullOrUndefined(t[parseInt(s.toString(),10)][this.fields.id])?N.getValue(this.fields.id,t[parseInt(s.toString(),10)]).toString():null)));t=i}e={data:this.treeData,action:e,nodeData:t};this.trigger("dataSourceChanged",e)},p.prototype.wireInputEvents=function(e){N.EventHandler.add(e,"blur",this.inputFocusOut,this)},p.prototype.wireEditingEvents=function(e){var t=this;e&&!this.disabled?this.touchEditObj=new N.Touch(this.element,{tap:function(e){t.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),t.editingHandler(e.originalEvent))}}):this.touchEditObj&&this.touchEditObj.destroy()},p.prototype.wireClickEvent=function(e){var t=this;e?this.touchClickObj=new N.Touch(this.element,{tap:function(e){t.clickHandler(e)}}):this.touchClickObj&&this.touchClickObj.destroy()},p.prototype.wireExpandOnEvent=function(e){var t=this;e?this.touchExpandObj=new N.Touch(this.element,{tap:function(e){("Click"===t.expandOnType||"DblClick"===t.expandOnType&&t.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&t.expandHandler(e)}}):this.touchExpandObj&&this.touchExpandObj.destroy()},p.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,this.isKeyboardFocus=!1,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&N.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},p.prototype.keyDownHandler=function(e){"Tab"!==e.key&&9!==e.keyCode||(this.isKeyboardFocus=!0,this.enableVirtualization&&(this.virtualSkipNextScrollRender=!0)),"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&40!==e.keyCode&&38!==e.keyCode&&"ArrowRight"!==e.key&&"ArrowLeft"!==e.key&&39!==e.keyCode&&37!==e.keyCode||this.enableVirtualization&&(this.virtualSkipNextScrollRender=!0)},p.prototype.preventContextMenu=function(e){e.preventDefault()},p.prototype.wireEvents=function(){N.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),N.EventHandler.add(document,"keydown",this.keyDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),N.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),N.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new N.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},p.prototype.unWireEvents=function(){N.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),N.EventHandler.remove(document,"keydown",this.keyDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),N.EventHandler.remove(this.element,"mouseover",this.onMouseOver),N.EventHandler.remove(this.element,"mouseout",this.onMouseLeave);for(var e=N.selectAll("."+w,this.element),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],i=(N.EventHandler.remove(i,"focus",this.focusIn),N.EventHandler.remove(i,"blur",this.focusOut),N.select("."+Fs,i));i&&(N.EventHandler.remove(i,"mousedown",this.frameMouseHandler),N.EventHandler.remove(i,"mouseup",this.frameMouseHandler),N.EventHandler.remove(i,"mouseleave",this.frameMouseHandler))}this.disabled||this.keyboardModule.destroy()},p.prototype.parents=function(e,t){for(var i=[],s=e.parentNode;!N.isNullOrUndefined(s);)N.matches(s,t)&&i.push(s),s=s.parentNode;return i},p.prototype.isDoubleTapped=function(e){var t,i=e.originalEvent.target;return i&&e.tapCount&&(1===e.tapCount?this.firstTap=N.closest(i,"."+w):2===e.tapCount&&(t=N.closest(i,"."+w))),this.firstTap===t},p.prototype.isDescendant=function(e,t){for(var i=t.parentNode;!N.isNullOrUndefined(i);){if(i===e)return!0;i=i.parentNode}return!1},p.prototype.showSpinner=function(e){N.addClass([e],ys),U.createSpinner({target:e,width:N.Browser.isDevice?16:14},this.createElement),U.showSpinner(e)},p.prototype.hideSpinner=function(e){U.hideSpinner(e),e.innerHTML="",N.removeClass([e],ys)},p.prototype.setCheckedNodes=function(e){1<(e=JSON.parse(JSON.stringify(e))).length&&"function"==typeof this.nodeChecked&&0<this.nodeChecked.length&&(this.isFilter=!0),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),0<e.length&&this.checkAll(e)},p.prototype.setValidCheckedNode=function(e,t){if(void 0===t&&(t=[]),1===this.dataType){var i=this.fields,i=new x.DataManager(this.treeData).executeLocal((new x.Query).where(i.id,"equal",e,!0));if(i[0]&&(this.setChildCheckState(i,e,i[0],t),this.autoCheck)){for(var i=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,s=this.getChildNodes(this.treeData,i),n=0,r=0;r<s.length;r++){var l=s[parseInt(r.toString(),10)][this.fields.id].toString();-1!==this.checkedNodes.indexOf(l)&&n++}n===s.length&&-1===this.checkedNodes.indexOf(i)&&i&&this.checkDisabledState(i)}}else if(2===this.dataType)for(var o=0;o<this.treeData.length;o++){if((this.treeData[parseInt(o.toString(),10)][this.fields.id]?this.treeData[parseInt(o.toString(),10)][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkDisabledState(e);break}var a=N.getValue(this.fields.child.toString(),this.treeData[parseInt(o.toString(),10)]);a&&this.setChildCheckState(a,e,this.treeData[parseInt(o.toString(),10)],t)}},p.prototype.setChildCheckState=function(e,t,i,s){void 0===s&&(s=[]);var n,r=0;if(1===this.dataType){i&&(n=i[this.fields.id]?i[this.fields.id].toString():null);for(var l=0;l<e.length;l++){var o=e[parseInt(l.toString(),10)][this.fields.id]?e[parseInt(l.toString(),10)][this.fields.id].toString():null,a=(i&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(o)&&this.checkDisabledState(o,e[l]),o===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),this.getChildNodes(this.treeData,o)),d=1===s.length&&s[0]===o;a.length!==t.length&&!d||this.setChildCheckState(a,t,i)}}else{i&&(n=i[this.fields.id]?i[this.fields.id].toString():"");for(l=0;l<e.length;l++){var h=e[parseInt(l.toString(),10)][this.fields.id]?e[parseInt(l.toString(),10)][this.fields.id].toString():"",d=1===[t].length&&0===s.length;i&&n&&this.autoCheck&&(-1===this.checkedNodes.indexOf(n)||-1!==this.checkedNodes.indexOf(h)||h!==t&&!d||this.checkDisabledState(h,e[l])),h===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),(a=N.getValue(this.fields.child.toString(),e[parseInt(l.toString(),10)]))&&this.setChildCheckState(a,t,e[parseInt(l.toString(),10)]),-1!==this.checkedNodes.indexOf(h)&&this.autoCheck&&r++,r===e.length&&-1===this.checkedNodes.indexOf(n)&&this.autoCheck&&this.checkDisabledState(n,i)}}},p.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[parseInt(t.toString(),10)],e)},p.prototype.updatePosition=function(e,t,i,s){if(1===this.dataType){var n=this.getDataPos(this.treeData,this.fields,e);if(this.treeData.splice(n,1,t),i){this.removeChildNodes(e);for(var r=0;r<s.length;r++)this.treeData.splice(n,0,s[parseInt(r.toString(),10)]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},p.prototype.updateChildPosition=function(e,t,i,s,n){for(var r=0,l=e.length;r<l;r++){var o=N.getValue(t.id,e[parseInt(r.toString(),10)]);if(e[parseInt(r.toString(),10)]&&o&&o.toString()===i)return e[parseInt(r.toString(),10)]=s[0],!0;if("string"!=typeof t.child||N.isNullOrUndefined(N.getValue(t.child,e[parseInt(r.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!N.isNullOrUndefined(N.getValue("child",e[parseInt(r.toString(),10)]))){o=N.getValue("child",e[parseInt(r.toString(),10)]);if(void 0!==(a=this.updateChildPosition(o,this.getChildMapper(t),i,s,n)))break}}else{var a,o=N.getValue(t.child,e[parseInt(r.toString(),10)]);if(void 0!==(a=this.updateChildPosition(o,this.getChildMapper(t),i,s,n)))break}}return a},p.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},p.prototype.crudOperation=function(e,t,i,s,n,r,l){var o,a=this,d=this.fields.dataSource,h=[],c=this.getQuery(this.fields),p=this.fields.id,u={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];t?m=this.nodeType(t):i&&("string"==typeof i?m[0]=i.toString():"object"==typeof i&&(m[0]=i.getAttribute("data-uid").toString()));for(var f=0,g=m.length;f<g;f++){var v=this.getElement(m[parseInt(f.toString(),10)]);N.isNullOrUndefined(v)||(v=this.getNodeObject(m[parseInt(f.toString(),10)]),h.push(v))}switch(e){case"delete":(o=1===t.length?d.remove(p,h[0],c.fromTable,c):(u.deletedRecords=h,d.saveChanges(u,p,c.fromTable,c))).then(function(){return a.deleteSuccess(m)}).catch(function(e){return a.dmFailure(e)});break;case"update":h[0][this.fields.text]=s,(o=d.update(p,h[0],c.fromTable,c)).then(function(){return a.editSucess(i,s,l)}).catch(function(e){return a.dmFailure(e,i,l)});break;case"insert":if(1===n.length)o=d.insert(n[0],c.fromTable,c);else{for(var y=[],f=0,g=n.length;f<g;f++)y.push(n[parseInt(f.toString(),10)]);u.addedRecords=y,o=d.saveChanges(u,p,c.fromTable,c)}o.then(function(){var e=a.getElement(i);a.addSuccess(n,e,r),a.preventExpand=!1}).catch(function(e){return a.dmFailure(e)})}},p.prototype.deleteSuccess=function(e){for(var t,i=[],s=0,n=e.length;s<n;s++){var r=this.getElement(e[parseInt(s.toString(),10)]);i.push(this.getNode(r)),N.isNullOrUndefined(r)||this.removeNode(r)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.enableVirtualization&&!N.isNullOrUndefined(this.height)&&(this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap(),t=this.getVirtualWindow(),this.virtualStartIndex=t.startIndex,this.virtualEndIndex=t.endIndex,this.renderVirtualItems()),this.triggerEvent("removeNode",i)},p.prototype.editSucess=function(e,t,i){var e=this.getElement(e),s=N.select("."+fs,e);this.appendNewText(e,s,t,i)},p.prototype.addSuccess=function(e,t,i){var s,n=this,r=t?t.querySelector("."+L):null;t&&r&&r.classList.contains(E)&&null===t.querySelector("."+k)?this.renderChildNodes(t,null,function(){s=t.querySelector("."+k),n.addGivenNodes(e,t,i,!0,s),n.triggerEvent("addNodes",e)}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent("addNodes",e))},p.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},p.prototype.updatePreviousText=function(e,t){var e=this.getElement(e),i=N.select("."+fs,e);this.updateText(e,i,this.oldText,t)},p.prototype.getHierarchicalParentId=function(t,e,i){var s=this;if(-1===e.findIndex(function(e){return e[s.fields.id]&&e[s.fields.id].toString()===t}))for(var n=0;n<e.length;n++){var r=N.getValue(this.fields.child.toString(),e[parseInt(n.toString(),10)]);if(!N.isNullOrUndefined(r)){if(-1!==r.findIndex(function(e){return e[s.fields.id]&&e[s.fields.id].toString()===t})){i.push(e[parseInt(n.toString(),10)][this.fields.id].toString()),this.getHierarchicalParentId(e[parseInt(n.toString(),10)][this.fields.id].toString(),this.treeData,i);break}this.getHierarchicalParentId(t,r,i)}}return i},p.prototype.parseHeightToPixels=function(){var e=this.height;return N.isNullOrUndefined(e)?0:"number"==typeof e?e:(e=parseFloat(e),isNaN(e)?0:e)},p.prototype.measureVirtualItemHeight=function(){var e=N.select("."+w,this.element);return e&&0<e.offsetHeight?e.offsetHeight:this.virtualItemHeight},p.prototype.rebuildVirtualCheckCache=function(){if(this.virtualExpandedNodesSet.clear(),this.virtualCheckedNodesSet.clear(),this.virtualSelectedNodesSet.clear(),this.expandedNodes&&Array.isArray(this.expandedNodes))for(var e=0;e<this.expandedNodes.length;e++)this.virtualExpandedNodesSet.add(this.expandedNodes[e]);if(this.checkedNodes&&Array.isArray(this.checkedNodes))for(e=0;e<this.checkedNodes.length;e++)this.virtualCheckedNodesSet.add(this.checkedNodes[e]);if(this.selectedNodes&&Array.isArray(this.selectedNodes))for(e=0;e<this.selectedNodes.length;e++)this.virtualSelectedNodesSet.add(this.selectedNodes[e])},p.prototype.flattenVisibleNodes=function(){this.rebuildVirtualCheckCache();var e,t=[];return 1===this.dataType?(e=[],(e=this.groupedData?this.getChildGroup(this.groupedData,null,!0):e)&&0!==e.length||(e=this.rootData),e=this.getSortedData(e),this.flattenNodeRecursive(e,1,null,t)):(e=this.getSortedData(this.rootData),this.flattenNodeRecursive(e,1,null,t)),t},p.prototype.flattenNodeRecursive=function(e,t,i,s){if(e&&0!==e.length)for(var n=this.fields.child.toString(),r=this.fields.expanded,l=this.fields.isChecked,o=this.fields.iconCss,a=this.fields.imageUrl,d=this.fields.id,h=this.fields.text,c="None"!==this.sortOrder,p=1===this.dataType,u=this.enableVirtualization,m=0;m<e.length;m++){var f,g=e[m],v=N.isNullOrUndefined(g[d])?"":g[d].toString(),y=N.isNullOrUndefined(g[h])?"":g[h].toString(),b=this.virtualExpandedNodesSet.has(v),C=!b&&!0===N.getValue(r,g),b=b||C,C=(C&&v&&(this.expandedNodes.push(v),this.virtualExpandedNodesSet.add(v)),!1),S=(p?this.groupedData&&(f=this.getChildGroup(this.groupedData,v,!1),C=!N.isNullOrUndefined(f)&&0<f.length):(f=N.getValue(n,g),C=!N.isNullOrUndefined(f)&&Array.isArray(f)&&0<f.length),u&&v&&l&&!this.virtualCheckedNodesSet.has(v)&&(S=N.getValue(l,g),N.isNullOrUndefined(S)||"true"!==S.toString()||(this.virtualCheckedNodesSet.add(v),this.checkedNodes&&-1===this.checkedNodes.indexOf(v)&&this.checkedNodes.push(v))),this.virtualSelectedNodesSet.has(v)),I=u&&this.virtualIndeterminateNodesSet.has(v)?"indeterminate":this.virtualCheckedNodesSet.has(v),x=g[o],x=N.isNullOrUndefined(x)?"":x.toString(),E=g[a],E=N.isNullOrUndefined(E)?"":E.toString();s.push({id:v,text:y,level:t,parentId:i,hasChildren:C,isExpanded:b,isSelected:S,isChecked:I,isDisabled:!1,iconCss:x,imageUrl:E,rawData:g}),b&&C&&(y=[],p?this.groupedData&&(y=this.getChildGroup(this.groupedData,v,!1),c)&&(y=O.ListBase.getDataSource(y,O.ListBase.addSorting(this.sortOrder,this.fields.text))):(I=N.getValue(n,g),!N.isNullOrUndefined(I)&&Array.isArray(I)&&(y=I,c)&&(y=O.ListBase.getDataSource(y,O.ListBase.addSorting(this.sortOrder,this.fields.text)))),this.flattenNodeRecursive(y,t+1,v,s))}},p.prototype.hasChildRecords=function(e){var t;return 1===this.dataType?!!this.groupedData&&(t=e[this.fields.id],!N.isNullOrUndefined(t))&&(t=this.getChildGroup(this.groupedData,t.toString(),!1),!N.isNullOrUndefined(t))&&0<t.length:(t=this.fields.child.toString(),t=N.getValue(t,e),!N.isNullOrUndefined(t)&&Array.isArray(t)&&0<t.length)},p.prototype.rebuildVirtualNodeMap=function(){this.virtualNodeMap.clear();for(var e=0;e<this.virtualFlatNodes.length;e++)this.virtualNodeMap.set(this.virtualFlatNodes[parseInt(e.toString(),10)].id,e)},p.prototype.getVirtualWindow=function(e){var t,i,s,n=this.virtualFlatNodes.length;return 0===n?{startIndex:0,endIndex:0}:(e=void 0!==e?e:this.element.scrollTop,t=this.virtualItemHeight,i=this.virtualViewportHeight,s=Math.floor(e/t)-this.virtualOverscanCount,e=Math.ceil((e+i)/t)+this.virtualOverscanCount,{startIndex:Math.max(0,s),endIndex:Math.min(n,e)})},p.prototype.getVirtualWindowAt=function(e){return this.getVirtualWindow(e)},p.prototype.getVirtualPadding=function(){var e=this.virtualFlatNodes.length,t=this.virtualItemHeight,i=this.virtualStartIndex,s=this.virtualEndIndex;return{paddingTop:i*t,paddingBottom:Math.max(0,(e-s)*t)}},p.prototype.renderVirtualItems=function(){if(this.ulElement){for(var e=this.ulElement,t=this.virtualFocusedId||null,i=e.querySelectorAll(":scope > li"),s=i.length-1;0<=s;s--)e.removeChild(i[parseInt(s.toString(),10)]);var n=new Map,r=this.virtualItemHeight,l=0;if(this.virtualStartIndex<this.virtualFlatNodes.length){var o=this.virtualFlatNodes[this.virtualStartIndex];if(o.parentId){for(var a=[],d=o.parentId;d;){var h=this.virtualNodeMap.get(d);if(N.isNullOrUndefined(h)||!(h<this.virtualStartIndex))break;var c=this.virtualFlatNodes[parseInt(h.toString(),10)];a.unshift(c),d=c.parentId}for(var p=0;p<a.length;p++){var u,c=a[parseInt(p.toString(),10)],m=this.createVirtualListItem(c,!1),f=e;c.parentId&&n.has(c.parentId)&&((u=n.get(c.parentId)).childUl||(u.childUl=this.createElement("ul",{className:k+" e-ul",attrs:{role:"group"}}),u.li.appendChild(u.childUl)),f=u.childUl),f.appendChild(m),n.set(c.id,{li:m,childUl:null}),l++}}}for(var o=this.virtualFlatNodes.length,g=this.virtualStartIndex,v=this.virtualEndIndex,y=Math.max(0,g*r-l*r),b=(e.style.paddingTop=y+"px",e.style.paddingBottom=Math.max(0,(o-v)*r)+"px",[]),s=g;s<v;s++){var C,S=this.virtualFlatNodes[parseInt(s.toString(),10)],I=this.createVirtualListItem(S,s===g),f=e;S.parentId&&n.has(S.parentId)&&((C=n.get(S.parentId)).childUl||(C.childUl=this.createElement("ul",{className:k+" e-ul",attrs:{role:"group"}}),C.li.appendChild(C.childUl)),f=C.childUl),f.appendChild(I),b.push(I),S.isExpanded&&S.hasChildren&&n.set(S.id,{li:I,childUl:null})}for(var x=!1,E=0;E<b.length;E++)if((I=b[parseInt(E.toString(),10)]).classList.contains(vs)){I.setAttribute("tabindex","0"),N.addClass([I],Ws),x=!0;break}if(!x&&t)for(E=0;E<b.length;E++)if((I=b[parseInt(E.toString(),10)]).getAttribute("data-uid")===t){I.setAttribute("tabindex","0"),N.addClass([I],Ws),N.addClass([I],_s),N.EventHandler.add(I,"blur",this.focusOut,this),I.focus({preventScroll:!0}),x=!0;break}!x&&0<b.length&&b[0].setAttribute("tabindex","0");for(E=0;E<b.length;E++)"0"!==(I=b[parseInt(E.toString(),10)]).getAttribute("tabindex")&&I.setAttribute("tabindex","-1");this.liList=b}},p.prototype.createVirtualListItem=function(e,t){var i,s=this.createElement("li",{className:w}),n=(s.classList.add("e-level-"+e.level),s.setAttribute("data-uid",e.id),s.setAttribute("aria-level",e.level.toString()),s.setAttribute("role","treeitem"),s.setAttribute("tabindex","-1"),this.fullRowSelect&&(n=this.createElement("div",{className:Ps}),s.appendChild(n)),this.createElement("div",{className:Cs})),r=(e.hasChildren&&(i=this.createElement("div",{className:L+" "+(e.isExpanded?u:E)}),n.appendChild(i)),this.showCheckBox&&(i=R.createCheckBox(this.createElement,!1,{checked:!0===e.isChecked,cssClass:js}),"indeterminate"===e.isChecked&&(r=i.querySelector("."+Fs))&&r.classList.add(Vs),n.appendChild(i)),e.iconCss&&(r=this.createElement("span",{className:L+" "+e.iconCss}),n.appendChild(r)),e.imageUrl&&((i=document.createElement("img")).src=e.imageUrl,i.classList.add(zs),n.appendChild(i)),this.createElement("span",{className:"e-list-text",innerHTML:e.text}));return n.appendChild(r),s.appendChild(n),e.isExpanded?(s.classList.add(Hs),s.setAttribute("aria-expanded","true")):e.hasChildren&&(s.classList.add(Us),s.setAttribute("aria-expanded","false")),e.isSelected&&(s.classList.add(vs),s.setAttribute("aria-selected","true")),e.isDisabled&&(s.classList.add(Ys),s.setAttribute("aria-disabled","true")),e.hasChildren&&s.classList.add(Ks),N.EventHandler.add(s,"focus",this.focusIn,this),s},p.prototype.initVirtualization=function(){N.addClass([this.element],Qs);var e=this.parseHeightToPixels();0<e&&(this.element.style.height=e+"px",this.element.style.overflowY="auto"),this.ulElement||(this.ulElement=N.select("."+k,this.element)),this.ulElement&&(this.ulElement.style.position="relative",this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap(),this.virtualViewportHeight=0<e?e:this.element.offsetHeight,0<this.virtualFlatNodes.length&&(e=this.createVirtualListItem(this.virtualFlatNodes[0],!0),this.ulElement.appendChild(e),this.virtualItemHeight=0<e.offsetHeight?e.offsetHeight:this.virtualItemHeight,this.ulElement.removeChild(e)),e=this.getVirtualWindow(),this.virtualStartIndex=e.startIndex,this.virtualEndIndex=e.endIndex,this.renderVirtualItems(),this.wireVirtualScrollEvents())},p.prototype.wireVirtualScrollEvents=function(){this.unwireVirtualScrollEvents(),this.virtualScrollBound=this.onVirtualScroll.bind(this),this.element.addEventListener("scroll",this.virtualScrollBound,{passive:!0})},p.prototype.unwireVirtualScrollEvents=function(){this.virtualScrollBound&&(this.element.removeEventListener("scroll",this.virtualScrollBound),this.virtualScrollBound=null),null!==this.virtualScrollRAF&&(cancelAnimationFrame(this.virtualScrollRAF),this.virtualScrollRAF=null)},p.prototype.onVirtualScroll=function(){var e,t,i=this;null!==this.virtualScrollRAF&&cancelAnimationFrame(this.virtualScrollRAF),this.virtualSkipNextScrollRender?(this.virtualSkipNextScrollRender=!1,this.virtualPrevScrollTop=this.element.scrollTop):(e=this.element.scrollTop,t=Math.abs(e-this.virtualPrevScrollTop),2*this.virtualViewportHeight<t&&this.showVirtualMask(e),this.virtualScrollRAF=requestAnimationFrame(function(){i.virtualScrollRAF=null,i.virtualPrevScrollTop=i.element.scrollTop;var e=i.getVirtualWindow();i.virtualStartIndex=e.startIndex,i.virtualEndIndex=e.endIndex,i.renderVirtualItems(),setTimeout(function(){i.hideVirtualMask(),i.updateMaskPosition()},200)}))},p.prototype.createVirtualMask=function(){if(!this.virtualMaskElement){for(var e=this.element.getBoundingClientRect(),t=this.element.offsetWidth-this.element.clientWidth,i=this.createElement("div",{className:"e-mask-parent",styles:"position:fixed;top:"+e.top+"px;left:"+e.left+"px;width:"+(e.width-t)+"px;height:"+e.height+"px;z-index:10;overflow:hidden;background:#fff;pointer-events:none;display:none;"}),s=Math.ceil(this.virtualViewportHeight/this.virtualItemHeight)+1,n=0;n<s;n++){var r=this.createElement("div",{className:"e-mask-item",styles:"display:flex;align-items:center;height:"+this.virtualItemHeight+"px;padding:0 12px;gap:8px;"}),l=this.createElement("span"),o=(l.style.flex="1",l.style.height="14px",r.appendChild(l),new V.Skeleton({shape:"Text",width:"80%",height:"14px",cssClass:"e-virtual-skel-text"}));o.appendTo(l),this.skeletonInstances.push(o),i.appendChild(r)}this.virtualMaskElement=i,this.element.appendChild(i)}},p.prototype.updateMaskPosition=function(){var e,t;this.virtualMaskElement&&(e=this.element.getBoundingClientRect(),t=this.element.offsetWidth-this.element.clientWidth,this.virtualMaskElement.style.top=e.top+"px",this.virtualMaskElement.style.left=e.left+"px",this.virtualMaskElement.style.width=e.width-t+"px",this.virtualMaskElement.style.height=e.height+"px")},p.prototype.destroyVirtualMask=function(){for(var e=this.skeletonInstances.length-1;0<=e;e--)this.skeletonInstances[parseInt(e.toString(),10)].destroy();this.skeletonInstances=[],this.virtualMaskElement&&(this.virtualMaskElement.parentElement&&this.virtualMaskElement.parentElement.removeChild(this.virtualMaskElement),this.virtualMaskElement=null)},p.prototype.showVirtualMask=function(e){this.virtualMaskElement||this.createVirtualMask(),this.virtualMaskElement&&(this.updateMaskPosition(),this.virtualMaskElement.style.display="block",this.ulElement)&&(this.ulElement.style.visibility="hidden")},p.prototype.hideVirtualMask=function(){this.virtualMaskElement&&(this.virtualMaskElement.style.display="none",this.ulElement)&&(this.ulElement.style.visibility="")},p.prototype.ensureVirtualNodeVisible=function(e){e=this.virtualNodeMap.get(e);if(!N.isNullOrUndefined(e)){var t=this.virtualItemHeight,i=this.virtualViewportHeight,e=e*t,t=e+t,s=this.element.scrollTop,n=s+i;if(e<s)this.element.scrollTop=e;else{if(!(n<t))return;this.element.scrollTop=t-i}s=this.getVirtualWindow();this.virtualStartIndex=s.startIndex,this.virtualEndIndex=s.endIndex,this.renderVirtualItems()}},p.prototype.handleVirtualExpand=function(t,e){null!==this.virtualScrollRAF&&(cancelAnimationFrame(this.virtualScrollRAF),this.virtualScrollRAF=null),-1===this.expandedNodes.indexOf(t)&&this.expandedNodes.push(t),this.virtualExpandedNodesSet&&this.virtualExpandedNodesSet.add(t),this.rootData&&(this.rootData.find(function(e){return e.id===parseInt(t,10)}).isExpanded=!0),this.virtualFocusedId=e?t:null,this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap();var i,e=this.element.scrollTop,e=this.getVirtualWindowAt(e),e=(this.virtualStartIndex=e.startIndex,this.virtualEndIndex=e.endIndex,this.virtualSkipNextScrollRender=!0,this.renderVirtualItems(),this.getElement(t));e&&((i=N.select("."+L,e))&&N.removeClass([i],bs),e.focus({preventScroll:!0})),this.isLoaded&&(i=this.getElement(t))&&((e=this.getExpandEvent(i,null)).isInteracted=this.isInteracted,this.trigger("nodeExpanded",e))},p.prototype.handleVirtualCollapse=function(t,e){null!==this.virtualScrollRAF&&(cancelAnimationFrame(this.virtualScrollRAF),this.virtualScrollRAF=null);var i=this.expandedNodes.indexOf(t),i=(-1!==i&&this.expandedNodes.splice(i,1),this.virtualExpandedNodesSet&&this.virtualExpandedNodesSet.delete(t),this.rootData&&(this.rootData.find(function(e){return e.id===parseInt(t,10)}).isExpanded=!1),this.virtualFocusedId=e?t:null,this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap(),this.element.scrollTop),e=this.getVirtualWindowAt(i),i=(this.virtualStartIndex=e.startIndex,this.virtualEndIndex=e.endIndex,this.virtualSkipNextScrollRender=!0,this.renderVirtualItems(),this.getElement(t));i&&((e=N.select("."+L,i))&&N.removeClass([e],bs),i.focus({preventScroll:!0})),this.isLoaded&&(e=this.getElement(t))&&((i=this.getExpandEvent(e,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",i))},p.prototype.updateVirtualNodeSelection=function(e,t){e=this.virtualNodeMap.get(e);N.isNullOrUndefined(e)||(this.virtualFlatNodes[parseInt(e.toString(),10)].isSelected=t,this.renderVirtualItems())},p.prototype.updateVirtualNodeCheckState=function(e,t){var i=this.virtualNodeMap.get(e);N.isNullOrUndefined(i)||(this.virtualFlatNodes[parseInt(i.toString(),10)].isChecked="check"===t||"indeterminate"===t&&"indeterminate","indeterminate"===t?this.virtualIndeterminateNodesSet.add(e):this.virtualIndeterminateNodesSet.delete(e),this.renderVirtualItems())},p.prototype.onPropertyChanged=function(e,t){for(var i,s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"allowDragAndDrop":this.setDragAndDrop(this.allowDragAndDrop);break;case"dragArea":this.allowDragAndDrop&&(this.dragObj.dragArea=this.dragArea);break;case"allowEditing":this.wireEditingEvents(this.allowEditing);break;case"allowMultiSelection":1<this.selectedNodes.length&&(i=this.getElement(this.selectedNodes[0]),this.isLoaded=!1,this.removeSelectAll(),this.selectNode(i,null),this.isLoaded=!0),this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":JSON.stringify(t.checkedNodes)!==JSON.stringify(e.checkedNodes)&&this.showCheckBox&&(this.checkedNodes=t.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(t.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:N.isNullOrUndefined(e.expandedNodes)?[]:e.expandedNodes},!0),this.doExpandAction(),this.isInitalExpand=!1,this.isAnimate=!0;break;case"expandOn":this.wireExpandOnEvent(!1),this.setExpandOnType(),"None"===this.expandOnType||this.disabled||this.wireExpandOnEvent(!0);break;case"disabled":this.setDisabledMode(),this.dynamicState();break;case"fields":this.isAnimate=!1,this.isFieldChange=!0,this.initialRender=!0,this.isReact&&(!this.isReact||this.fields.dataSource instanceof x.DataManager)||(this.element.classList.contains("e-filtering")||(this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource))),this.reRenderNodes()),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var r=this.element.querySelectorAll("li"),l=0;l<r.length;)"true"!==r[parseInt(l.toString(),10)].getAttribute("aria-expanded")&&this.renderChildNodes(r[parseInt(l.toString(),10)],!0,null,!0),l++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"checkDisabledChildren":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes();break;case"enableVirtualization":this.enableVirtualization?N.isNullOrUndefined(this.height)||this.initVirtualization():(this.unwireVirtualScrollEvents(),this.destroyVirtualMask(),N.removeClass([this.element],Qs),this.element.style.height="",this.element.style.overflowY="",this.reRenderNodes());break;case"height":this.enableVirtualization?(this.unwireVirtualScrollEvents(),this.initVirtualization()):(i=this.parseHeightToPixels(),this.element.style.height=0<i?i+"px":"")}},p.prototype.destroy=function(){this.enableVirtualization&&(this.unwireVirtualScrollEvents(),this.destroyVirtualMask(),this.virtualFlatNodes=[],this.virtualNodeMap.clear()),this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.ulElement=null,this.liList=null,this.startNode=null,this.firstTap=null,this.expandArgs=null,this.dragLi=null,this.dragTarget=null,this.dragParent=null,this.dragObj=null,this.dropObj=null,this.inputObj=null,this.touchEditObj=null,this.touchExpandObj=null,this.touchClickObj=null,on.prototype.destroy.call(this)},p.prototype.addNodes=function(e,t,i,s){if(!N.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var n=this.getElement(t);if(this.preventExpand=s,this.fields.dataSource instanceof x.DataManager)this.isOffline?this.addSuccess(e,n,i):this.crudOperation("insert",null,t,null,e,i,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,n,i);else{if(n)this.addGivenNodes(e,n,i);else{e=this.getSortedData(e);for(var r=0;r<e.length;r++){var l=N.getValue(this.fields.parentID,e[parseInt(r.toString(),10)]),n=l&&this.getElement(l.toString());!N.isNullOrUndefined(l)&&N.isNullOrUndefined(n)&&(this.isHiddenItem=!0,this.preventExpand=!1,this.ensureVisible(l),this.preventExpand=s,this.isHiddenItem=!1,n=this.getElement(l.toString())),this.addGivenNodes([e[parseInt(r.toString(),10)]],n,i)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}var t=N.select("."+w+'[tabindex="0"]',this.element);N.isNullOrUndefined(t)&&this.setNodeFocusable(),this.enableVirtualization&&!N.isNullOrUndefined(this.height)?(this.setRootData(),this.rebuildVirtualCheckCache(),this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap(),t=this.getVirtualWindow(),this.virtualStartIndex=t.startIndex,this.virtualEndIndex=t.endIndex,this.renderVirtualItems()):(this.updateCheckedStateFromDS(),this.showCheckBox&&n&&this.autoCheck&&this.ensureParentCheckState(n)),this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1,this.triggerEvent("addNodes",e))}},p.prototype.beginEdit=function(e){e=this.getElement(e);N.isNullOrUndefined(e)||this.disabled||this.createTextbox(e)},p.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},p.prototype.collapseAll=function(e,t,i){var s,n=this;this.enableVirtualization&&!N.isNullOrUndefined(this.height)&&(this.virtualExpandedNodesSet.clear(),this.setProperties({expandedNodes:[]},!0),(s=function(e){if(e)for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],i=(i.isExpanded=!1,N.getValue(n.fields.child.toString(),i));i&&Array.isArray(i)&&s(i)}})(this.treeData)),N.isNullOrUndefined(e)?0<t?this.collapseByLevel(N.select("."+k,this.element),t,i):this.collapseAllNodes(i):this.doGivenAction(e,u,!1)},p.prototype.disableNodes=function(e){N.isNullOrUndefined(e)||this.doDisableAction(e)},p.prototype.enableNodes=function(e){N.isNullOrUndefined(e)||this.doEnableAction(e)},p.prototype.ensureVisible=function(e){var t=[];if(1===this.dataType)for(var i=this.getTreeData(e);0!==i.length&&!N.isNullOrUndefined(i[0][this.fields.parentID]);)t.push(i[0][this.fields.parentID].toString()),i=this.getTreeData(i[0][this.fields.parentID].toString());else 2===this.dataType&&(t=this.getHierarchicalParentId(e,this.treeData,t));this.expandAll(t.reverse(),null,null,this.isHiddenItem);var s=this.getElement(e);N.isNullOrUndefined(s)||("object"==typeof e&&(e=this.parents(s,"."+w),this.expandAll(e)),setTimeout(function(){s.scrollIntoView({behavior:"smooth"})},450))},p.prototype.expandAll=function(e,t,i,s){if(this.isAnimate=!s,this.enableVirtualization&&!N.isNullOrUndefined(this.height)){var n=[],r=this.fields.id,l=(this.fields.child.toString(),this.dataType,this.treeData);if(l)for(var o=0;o<l.length;o++){var a=l[parseInt(o.toString(),10)],d=N.getValue(r,a);a.hasChild&&(n.push(d),a.isExpanded=!0)}for(var h=0;h<n.length;h++){var c=n[parseInt(h.toString(),10)];this.virtualExpandedNodesSet.has(c)||this.virtualExpandedNodesSet.add(c)}this.setProperties({expandedNodes:n},!0)}N.isNullOrUndefined(e)?0<t?this.expandByLevel(N.select("."+k,this.element),t,i):(this.expandAllNodes(i),this.loadOnDemand&&!this.element.classList.contains("e-filtering")||(this.updateAttributes(this.element),this.updateList())):this.doGivenAction(e,E,!0),this.isAnimate=!0},p.prototype.getAllCheckedNodes=function(){return this.checkedNodes},p.prototype.getDisabledNodes=function(){return this.disableNode},p.prototype.getNode=function(e){e=this.getElement(e);return this.getNodeData(e,!0)},p.prototype.getTreeData=function(e){var e=this.getId(e);return this.updatePersistProp(),N.isNullOrUndefined(e)?this.treeData:(e=this.getNodeObject(e),N.isNullOrUndefined(e)?[]:[e])},p.prototype.moveNodes=function(e,t,i,s){if(!N.isNullOrUndefined(e)&&0!==e.length){var n=this.getElement(t),r=[];N.isNullOrUndefined(n)&&(this.isHiddenItem=!0,this.ensureVisible(t),this.isHiddenItem=!1,n=this.getElement(t));for(var l=0;l<e.length;l++){var o=this.getElement(e[parseInt(l.toString(),10)]);r.push(this.getNode(o)),N.isNullOrUndefined(o)||n.isSameNode(o)||this.isDescendant(o,n)||(this.preventExpand=s,this.dropAsChildNode(o,n,this,i,null,null,null,n))}this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent("moveNodes",r)}},p.prototype.refreshNode=function(e,t){if(!N.isNullOrUndefined(e)&&!N.isNullOrUndefined(t)){var i,s,n,r,l,o,a=!1,d=(1===this.dataType&&1<t.length?a=!0:2===this.dataType&&1===t.length&&(d=N.getValue(this.fields.child.toString(),t[0]),N.isNullOrUndefined(d)||(a=!0)),this.getElement(e)),h=d?d.getAttribute("data-uid"):e?e.toString():null;if(this.refreshData=this.getNodeObject(h),t=JSON.parse(JSON.stringify(t)),1===this.dataType&&a){for(var c=0;c<t.length;c++)if(N.isNullOrUndefined(t[parseInt(c.toString(),10)][this.fields.parentID])){s=t[parseInt(c.toString(),10)],t.splice(c,1);break}i=N.extend({},this.refreshData,s)}else i=N.extend({},this.refreshData,t[0]);N.isNullOrUndefined(d)?this.updatePosition(h,i,a,t):(this.isRefreshed=!0,o=parseFloat(d.getAttribute("aria-level")),o=O.ListBase.createListItemFromJson(this.createElement,[i],this.listBaseOption,o),l=N.select("."+k,d),n=N.getValue(this.fields.child.toString(),i),a&&l||a&&!N.isNullOrUndefined(n)?(n=d.parentElement,r=Array.prototype.indexOf.call(n.childNodes,d),N.remove(d),n.insertBefore(o[0],n.childNodes[parseInt(r.toString(),10)]),this.updatePosition(h,i,a,t),a&&l&&this.expandAll([h])):(n=N.select("."+Cs,d),r=N.select("."+Cs,o[0]),l=N.select("div."+L,n),o=N.select("div."+L,r),l&&o&&(o.classList.contains(E)&&l.classList.contains(u)?(N.removeClass([o],E),N.addClass([o],u)):o.classList.contains(u)&&l.classList.contains(E)?(N.removeClass([o],u),N.addClass([o],E)):l.classList.contains("interaction")&&N.addClass([o],"interaction")),N.remove(n),(l=N.select("."+Ps,d)).parentNode.insertBefore(r,l.nextSibling),this.updatePosition(h,i,a,t)),d=this.getElement(e),i[this.fields.tooltip]&&d.setAttribute("title",i[this.fields.tooltip]),Object.prototype.hasOwnProperty.call(i,this.fields.htmlAttributes)&&i[this.fields.htmlAttributes]&&(N.merge(o={},i[this.fields.htmlAttributes]),o.class?(N.addClass([d],o.class.split(" ")),delete o.class):N.attributes(d,o)),-1!==this.selectedNodes.indexOf(h)&&(d.setAttribute("aria-selected","true"),N.addClass([d],vs)),this.isRefreshed=!1,this.triggerEvent("refreshNode",[this.getNode(d)]))}},p.prototype.removeNodes=function(e){N.isNullOrUndefined(e)||(this.fields.dataSource instanceof x.DataManager&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},p.prototype.updateNode=function(t,i){var s,n,e,r=this;N.isNullOrUndefined(t)||N.isNullOrUndefined(i)||!this.allowEditing||(s=this.getElement(t),N.isNullOrUndefined(s))||(n=N.select("."+fs,s),this.updateOldText(s),e=this.getEditEvent(s,null,null),this.trigger("nodeEditing",e,function(e){e.cancel||(r.fields.dataSource instanceof x.DataManager&&!r.isOffline?r.crudOperation("update",null,t,i,null,null,!1):r.appendNewText(s,n,i,!1))}))},p.prototype.uncheckAll=function(e){this.showCheckBox&&0<this.checkedNodes.length&&this.doCheckBoxAction(e,!1)},p.prototype.setNodeFocusable=function(){var e=N.select("."+w,this.element);e&&(e.setAttribute("tabindex","0"),this.updateIdAttr(null,e))},c([N.Property(!(p.prototype.escapeHashInUid=function(e){return!N.isNullOrUndefined(e)&&"string"==typeof e?e.replace(/[#:.[\]!~^$*() ]/g,"\\$&"):e}))],p.prototype,"allowDragAndDrop",void 0),c([N.Property(!1)],p.prototype,"allowEditing",void 0),c([N.Property(!1)],p.prototype,"allowMultiSelection",void 0),c([N.Property(!1)],p.prototype,"allowTextWrap",void 0),c([N.Property(!1)],p.prototype,"enableVirtualization",void 0),c([N.Property()],p.prototype,"height",void 0),c([N.Complex({},rn)],p.prototype,"animation",void 0),c([N.Property()],p.prototype,"checkedNodes",void 0),c([N.Property(!0)],p.prototype,"checkDisabledChildren",void 0),c([N.Property("")],p.prototype,"cssClass",void 0),c([N.Property(!1)],p.prototype,"disabled",void 0),c([N.Property(null)],p.prototype,"dragArea",void 0),c([N.Property(!0)],p.prototype,"enableHtmlSanitizer",void 0),c([N.Property(!0)],p.prototype,"disableHtmlEncode",void 0),c([N.Property(!1)],p.prototype,"enablePersistence",void 0),c([N.Property()],p.prototype,"expandedNodes",void 0),c([N.Property("Auto")],p.prototype,"expandOn",void 0),c([N.Complex({},Zs)],p.prototype,"fields",void 0),c([N.Property(!0)],p.prototype,"fullRowSelect",void 0),c([N.Property(!0)],p.prototype,"loadOnDemand",void 0),c([N.Property()],p.prototype,"locale",void 0),c([N.Property()],p.prototype,"nodeTemplate",void 0),c([N.Property()],p.prototype,"selectedNodes",void 0),c([N.Property("None")],p.prototype,"sortOrder",void 0),c([N.Property(!1)],p.prototype,"showCheckBox",void 0),c([N.Property(!1)],p.prototype,"checkOnClick",void 0),c([N.Property(!0)],p.prototype,"autoCheck",void 0),c([N.Property(!1)],p.prototype,"fullRowNavigable",void 0),c([N.Event()],p.prototype,"actionFailure",void 0),c([N.Event()],p.prototype,"created",void 0),c([N.Event()],p.prototype,"dataBound",void 0),c([N.Event()],p.prototype,"dataSourceChanged",void 0),c([N.Event()],p.prototype,"drawNode",void 0),c([N.Event()],p.prototype,"destroyed",void 0),c([N.Event()],p.prototype,"keyPress",void 0),c([N.Event()],p.prototype,"nodeChecked",void 0),c([N.Event()],p.prototype,"nodeChecking",void 0),c([N.Event()],p.prototype,"nodeClicked",void 0),c([N.Event()],p.prototype,"nodeCollapsed",void 0),c([N.Event()],p.prototype,"nodeCollapsing",void 0),c([N.Event()],p.prototype,"nodeDragging",void 0),c([N.Event()],p.prototype,"nodeDragStart",void 0),c([N.Event()],p.prototype,"nodeDragStop",void 0),c([N.Event()],p.prototype,"nodeDropped",void 0),c([N.Event()],p.prototype,"nodeEdited",void 0),c([N.Event()],p.prototype,"nodeEditing",void 0),c([N.Event()],p.prototype,"nodeExpanded",void 0),c([N.Event()],p.prototype,"nodeExpanding",void 0),c([N.Event()],p.prototype,"nodeSelected",void 0),c([N.Event()],p.prototype,"nodeSelecting",void 0);var on,an,o=an=c([N.NotifyPropertyChanges],p);function p(e,t){e=on.call(this,e,t)||this;return e.isRefreshed=!1,e.preventExpand=!1,e.checkedElement=[],e.disableNode=[],e.validArr=[],e.validNodes=[],e.expandChildren=[],e.isFieldChange=!1,e.changeDataSource=!1,e.hasTemplate=!1,e.isFirstRender=!1,e.batchParentNode=new Set,e.isNodeDropped=!1,e.isInteracted=!1,e.isRightClick=!1,e.mouseDownStatus=!1,e.isKeyboardFocus=!1,e.isDropIn=!1,e.OldCheckedData=[],e.isHiddenItem=!1,e.virtualFlatNodes=[],e.virtualNodeMap=new Map,e.virtualExpandedNodesSet=new Set,e.virtualCheckedNodesSet=new Set,e.virtualIndeterminateNodesSet=new Set,e.virtualSelectedNodesSet=new Set,e.virtualItemHeight=40,e.virtualViewportHeight=0,e.virtualPrevScrollTop=0,e.virtualStartIndex=0,e.virtualEndIndex=0,e.virtualOverscanCount=3,e.virtualScrollRAF=null,e.virtualMaskElement=null,e.virtualScrollBound=null,e.skeletonInstances=[],e.virtualTreeDirty=!1,e.virtualFocusedId=null,e.virtualSkipNextScrollRender=!1,e}dn=function(e,t){return(dn=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 dn,hn,c=function(e,t){function i(){this.constructor=e}dn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},f=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},cn="e-sidebar",pn="e-dock",un="e-close",mn="e-open",fn="e-transition",gn="e-sidebar-overlay",vn="e-right",yn="e-left",bn="e-over",Cn="e-push",Sn="e-slide",In="e-visibility",xn="e-disable-animation",En="e-sidebar-context",Nn="e-sidebar-absolute",c=(hn=N.Component,c(A,hn),A.prototype.preRender=function(){this.setWidth()},A.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},A.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),N.Browser.isDevice&&(this.windowWidth=window.innerWidth)},A.prototype.setEnableRTL=function(){(this.enableRtl?N.addClass:N.removeClass)([this.element],"e-rtl")},A.prototype.setTarget=function(){this.targetEle=this.element.nextElementSibling,this.sidebarEleCopy=this.element.cloneNode(!0),"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),this.target&&(this.target.insertBefore(this.element,this.target.children[0]),N.addClass([this.element],Nn),N.addClass([this.target],En),this.targetEle=this.getTargetElement())},A.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!N.isNullOrUndefined(e)&&e.classList.contains(cn);)e=e.nextElementSibling;return e},A.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?(document.addEventListener("mousedown",this.documentClickContext),document.addEventListener("touchstart",this.documentClickContext)):(document.removeEventListener("mousedown",this.documentClickContext),document.removeEventListener("touchstart",this.documentClickContext))},A.prototype.setWidth=function(){this.enableDock&&"Left"===this.position||this.enableDock&&"Right"===this.position?N.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||N.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},A.prototype.setDimension=function(e){return e="number"==typeof e?N.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:N.formatUnit(e):"100%"},A.prototype.setZindex=function(){N.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},A.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&N.addClass([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");N.isNullOrUndefined(e||this.targetEle)||N.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):null,this.enableDock||"Auto"===this.type||N.addClass([this.element],[In]),N.removeClass([this.element],[mn,un,vn,yn,Sn,Cn,bn]),this.element.classList.add(cn),N.addClass([this.element],"Right"===this.position?vn:yn),this.enableDock&&N.addClass([this.element],pn),N.isNullOrUndefined(this.tabIndex)||this.element.setAttribute("tabindex",this.tabIndex),"Auto"===this.type&&!N.Browser.isDevice&&this.checkMediaQuery()?this.show():this.isOpen||N.addClass([this.element],[un,xn])},A.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(un)||e||this.hide()},A.prototype.transitionEnd=function(e){this.setDock(),N.isNullOrUndefined(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,N.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},A.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e&&!N.isNullOrUndefined(this.defaultBackdropDiv)?(N.removeClass([this.defaultBackdropDiv],gn),this.defaultBackdropDiv.remove(),this.defaultBackdropDiv=null):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},A.prototype.hide=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!N.isNullOrUndefined(e),event:e||null};this.trigger("close",e,function(e){e.cancel?t.preventClose=!0:t.element.classList.contains(un)||(t.element.classList.contains(mn)&&!t.animate&&t.triggerChange(),N.addClass([t.element],un),N.removeClass([t.element],mn),N.setStyleAttribute(t.element,{width:N.formatUnit(t.enableDock?t.dockSize:t.width)}),t.setType(t.type),e=document.querySelector(".e-main-content")||t.targetEle,!t.enableDock&&e&&(e.style.transform="translateX(0px)",e.style["Left"===t.position?"marginLeft":"marginRight"]="0px"),t.destroyBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.remove("e-sidebar-overflow"),t.setProperties({isOpen:!1},!0),t.enableDock&&setTimeout(function(){return t.setTimeOut()},50),N.EventHandler.add(t.element,"transitionend",t.transitionEnd,t),t.preventClose=!1)})},A.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(mn)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(un)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize)):"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width)},A.prototype.show=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!N.isNullOrUndefined(e),event:e||null};this.trigger("open",e,function(e){e.cancel||(N.removeClass([t.element],[In,xn]),t.element.classList.contains(mn))||(t.element.classList.contains(un)&&!t.animate&&t.triggerChange(),N.addClass([t.element],[mn,fn]),N.setStyleAttribute(t.element,{transform:""}),N.removeClass([t.element],un),N.setStyleAttribute(t.element,{width:N.formatUnit(t.width)}),t.setType(t.type),t.targetEle&&!t.targetEle.querySelector(".e-sidebar-overlay")&&t.createBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.add("e-sidebar-overflow"),t.setProperties({isOpen:!0},!0),N.EventHandler.add(t.element,"transitionend",t.transitionEnd,t))})},A.prototype.setAnimation=function(){this.animate?N.removeClass([this.element],xn):N.addClass([this.element],xn)},A.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},A.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?N.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&N.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(un)&&this.enableDock&&N.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},A.prototype.createBackDrop=function(){var e,t;this.target&&this.showBackdrop&&this.getState()?(e=this.target,t=document.querySelector(".e-main-content")||this.targetEle,this.defaultBackdropDiv=this.createElement("div"),N.addClass([this.defaultBackdropDiv],gn),N.setStyleAttribute(this.defaultBackdropDiv,{height:e.style.height}),t.appendChild(this.defaultBackdropDiv)):this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className=gn,this.modal.style.display="block",document.body.appendChild(this.modal))},A.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},A.prototype.getModuleName=function(){return"sidebar"},A.prototype.toggle=function(){this.element.classList.contains(mn)?this.hide():this.show()},A.prototype.getState=function(){return!!this.element.classList.contains(mn)},A.prototype.setMediaQuery=function(){this.mediaQuery&&(("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery):this.mediaQuery).matches&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide())},A.prototype.checkMediaQuery=function(){return!!N.isNullOrUndefined(this.mediaQuery)||("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery):this.mediaQuery).matches},A.prototype.resize=function(){N.isNullOrUndefined(this.width)||"auto"===this.width||"string"!=typeof this.width||this.width.includes("px")||this.setType(this.type),"Auto"===this.type&&(N.Browser.isDevice?N.addClass([this.element],bn):N.addClass([this.element],Cn)),this.setMediaQuery(),N.Browser.isDevice&&(this.windowWidth=window.innerWidth)},A.prototype.documentclickHandler=function(e){N.closest(e.target,".e-control."+cn)||this.hide(e)},A.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&50<=e.distanceX&&.5<=e.velocity?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection||this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide(e.originalEvent):!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&50<=e.distanceX&&.5<=e.velocity&&this.show()},A.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new N.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new N.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},A.prototype.wireEvents=function(){this.setEnableGestures(),N.EventHandler.add(window,"resize",this.resizeHandler)},A.prototype.unWireEvents=function(){N.EventHandler.remove(window,"resize",this.resizeHandler),N.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),N.EventHandler.remove(this.element,"transitionend",this.transitionEnd),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},A.prototype.onPropertyChanged=function(e,t){for(var i=document.querySelector(".e-main-content")||this.targetEle,s=this.isServerRendered,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"isOpen":this.isOpen?this.show():this.hide();break;case"width":this.setWidth(),this.getState()||this.setDock();break;case"animate":this.setAnimation();break;case"type":this.checkType(!1),N.removeClass([this.element],[In]),this.preventClose||this.addClass(),N.addClass([this.element],"Auto"===this.type?N.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]),this.setType(this.type);break;case"position":this.element.style.transform="",this.setDock(),i&&(i.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(N.removeClass([this.element],yn),N.addClass([this.element],vn)):(N.removeClass([this.element],vn),N.addClass([this.element],yn)),this.setType(this.type);break;case"showBackdrop":this.showBackdrop?this.createBackDrop():this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null);break;case"target":"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),N.isNullOrUndefined(this.target)&&(N.removeClass([this.element],Nn),N.removeClass([t.target],En),N.setStyleAttribute(i,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,hn.prototype.refresh.call(this),this.isServerRendered=s;break;case"closeOnDocumentClick":this.setCloseOnDocumentClick();break;case"enableDock":this.getState()||this.setDock(),this.enableDock?N.addClass([this.element],pn):N.removeClass([this.element],pn),!this.isOpen&&i&&(this.enableDock||(this.element.style.transform=i.style.transform=""),i.style["Left"===this.position?"marginLeft":"marginRight"]=this.enableDock?this.setDimension(this.dockSize):"0px");break;case"zIndex":this.setZindex();break;case"mediaQuery":this.setMediaQuery();break;case"enableGestures":this.setEnableGestures();break;case"enableRtl":this.setEnableRTL()}},A.prototype.setType=function(e){var t=this.element.getBoundingClientRect().width,i=(this.setZindex(),document.querySelector(".e-main-content")||this.targetEle),s=(i&&(i.style.transform="translateX(0px)",N.Browser.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(i.style["Left"===this.position?"marginLeft":"marginRight"]="0px")),this.position,t+"px"),n="Left"===this.position?t:-t;switch(N.removeClass([this.element],[Cn,bn,Sn]),e){case"Push":N.addClass([this.element],[Cn]),i&&(this.enableDock||this.element.classList.contains(mn))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=s);break;case"Slide":N.addClass([this.element],[Sn]),i&&(this.enableDock||this.element.classList.contains(mn))&&(i.style.transform="translateX("+n+"px)");break;case"Over":N.addClass([this.element],[bn]),this.enableDock&&(this.element.classList.contains(un)||this.isOpen)&&i&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":N.addClass([this.element],[fn]),N.Browser.isDevice?i&&this.enableDock&&!this.getState()?(i.style["Left"===this.position?"marginLeft":"marginRight"]=s,N.addClass([this.element],Cn)):N.addClass([this.element],bn):(N.addClass([this.element],Cn),i&&(this.enableDock||this.element.classList.contains(mn))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=s)),this.createBackDrop()}},A.prototype.destroy=function(){hn.prototype.destroy.call(this),this.target&&0===(t=this.target).querySelectorAll("."+cn+"."+Nn).length&&N.removeClass([t],En),this.destroyBackDrop(),this.element&&(N.removeClass([this.element],[mn,un,Cn,Sn,bn,yn,vn,fn,xn]),N.removeClass([this.element],Nn),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",N.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var e,t=document.querySelector(".e-main-content")||this.targetEle;N.isNullOrUndefined(t)||(e=!1,e=this.target?0<this.target.querySelectorAll("."+cn+"."+mn).length:e)||(t.style.margin="",t.style.transform=""),this.unWireEvents()},f([N.Property("auto")],A.prototype,"dockSize",void 0),f([N.Property(null)],A.prototype,"mediaQuery",void 0),f([N.Property(!1)],A.prototype,"enableDock",void 0),f([N.Property("en-US")],A.prototype,"locale",void 0),f([N.Property(!1)],A.prototype,"enablePersistence",void 0),f([N.Property(!0)],A.prototype,"enableGestures",void 0),f([N.Property(!1)],A.prototype,"isOpen",void 0),f([N.Property(!1)],A.prototype,"enableRtl",void 0),f([N.Property(!0)],A.prototype,"animate",void 0),f([N.Property("auto")],A.prototype,"height",void 0),f([N.Property(!1)],A.prototype,"closeOnDocumentClick",void 0),f([N.Property("Left")],A.prototype,"position",void 0),f([N.Property(null)],A.prototype,"target",void 0),f([N.Property(!1)],A.prototype,"showBackdrop",void 0),f([N.Property("Auto")],A.prototype,"type",void 0),f([N.Property("auto")],A.prototype,"width",void 0),f([N.Property(1e3)],A.prototype,"zIndex",void 0),f([N.Event()],A.prototype,"created",void 0),f([N.Event()],A.prototype,"close",void 0),f([N.Event()],A.prototype,"open",void 0),f([N.Event()],A.prototype,"change",void 0),f([N.Event()],A.prototype,"destroyed",void 0),f([N.NotifyPropertyChanges],A));function A(e,t){e=hn.call(this,e,t)||this;return e.documentClickContext=e.documentclickHandler.bind(e),e.resizeHandler=e.resize.bind(e),e.preventClose=!1,e}On=function(e,t){return(On=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 On,wn,f=function(e,t){function i(){this.constructor=e}On(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},kn=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Ln="e-icon-right",An="e-breadcrumb-text",Tn="e-breadcrumb-icon",Dn="e-breadcrumb-menu",Pn="e-breadcrumb-item",Mn="e-breadcrumb-popup",Hn="e-breadcrumb-wrap-mode",Un="e-breadcrumb-scroll-mode",Rn="tabindex",Bn="e-disabled",Vn="aria-disabled",jn=".",Fn=((Fn=a.BreadcrumbOverflowMode||(a.BreadcrumbOverflowMode={})).Hidden="Hidden",Fn.Collapsed="Collapsed",Fn.Menu="Menu",Fn.Wrap="Wrap",Fn.Scroll="Scroll",Fn.None="None",wn=N.ChildProperty,f(qn,wn),kn([N.Property("")],qn.prototype,"text",void 0),kn([N.Property("")],qn.prototype,"id",void 0),kn([N.Property("")],qn.prototype,"url",void 0),kn([N.Property(null)],qn.prototype,"iconCss",void 0),kn([N.Property(!1)],qn.prototype,"disabled",void 0),qn);function qn(){return null!==wn&&wn.apply(this,arguments)||this}Wn=N.Component,f(T,Wn),T.prototype.preRender=function(){},T.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},T.prototype.initialize=function(){this._maxItems=this.maxItems,N.isNullOrUndefined(this.element.getAttribute("aria-label"))&&this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&N.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add(Bn),this.element.setAttribute(Vn,"true")),"Wrap"===this.overflowMode?this.element.classList.add(Hn):"Scroll"===this.overflowMode&&this.element.classList.add(Un),this.initItems(),this.initPvtProps()},T.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&0<this._maxItems&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(0<=this._maxItems?(this.startIndex=1<this._maxItems?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},T.prototype.getEndIndex=function(){var i,s=this;return this.activeItem?this.items.forEach(function(e,t){e.url!==s.activeItem&&e.text!==s.activeItem||(i=t)}):i=this.items.length-1,i},T.prototype.initItems=function(){if(!this.items.length){var e,t=void 0,i=void 0,s=[];i=(this.url?(t=(e=new URL(this.url,window.location.origin)).origin+"/",e):(t=window.location.origin+"/",window.location)).href.split(t)[1].split("/"),s.push({iconCss:"e-icons e-home",url:t});for(var n=0;n<i.length;n++)i[n]&&(s.push({text:i[n],url:t+i[n]}),t+=i[n]+"/");this.setProperties({items:s},!0)}},T.prototype.renderItems=function(e){var t,i,n=this,r=this.element.classList.contains(Ln),s=e.length;if(s){for(var l,o,a=void 0,d=0,h=void 0,c=2*s-1,p=!1,u=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),m=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),f=this.hasField(e,"iconCss"),g="Collapsed"===this.overflowMode&&0<this._maxItems&&s>this._maxItems&&!this.isExpanded,v="Hidden"===this.overflowMode&&0<this._maxItems,y=("Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML=""),{moduleName:this.getModuleName(),showIcon:f,itemNavigable:!0,itemCreated:function(e){var t=e.curData.isLastItem,i=(t&&e.item.children.length&&!n.itemTemplate&&(delete e.curData.isLastItem,o||n.enableActiveItemNavigation||(e.item.innerHTML=n.createElement("span",{className:An,innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||n.itemTemplate||e.item.classList.add("e-icon-item"),v&&e.item.setAttribute("item-index",d.toString()),{item:N.extend({},e.curData.properties||e.curData),element:e.item,cancel:!1}),s=(n.trigger("beforeItemRender",i),p=i.cancel,r||i.element.classList.contains(Ln));s&&e.curData.iconCss&&!n.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector(jn+Tn)),i.item.disabled&&(e.item.setAttribute(Vn,"true"),e.item.classList.add(Bn)),i.item.id&&e.item.setAttribute("id",i.item.id),(i.item.disabled||n.disabled)&&e.item.children.length&&!n.itemTemplate&&e.item.children[0].setAttribute(Rn,"-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),t&&!n.enableActiveItemNavigation||i.item.disabled||n.disabled||(e.item.children[0].setAttribute(Rn,"0"),N.EventHandler.add(e.item.children[0],"keydown",n.keyDownHandler,n))),e.item.removeAttribute("role"),t?(e.item.setAttribute("data-active-item",""),e.item.setAttribute("aria-current","page")):e.item.removeAttribute("aria-current"),n.itemTemplate||n.beforeItemRenderChanges(e.curData,i.item,e.item,s)}}),b=0;b<c;b%2&&d++,b++)if(l=this.activeItem&&(this.activeItem===e[d].url||this.activeItem===e[d].text),!(g&&1<b&&b<c-2)&&(!v||!(d<this.startIndex||d>this.endIndex)||b%2&&d===this.startIndex-1||0===d)){b%2?(h=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),this.separatorTemplate&&"/"===this.separatorTemplate||N.isNullOrUndefined(this.separatorTemplate)?y.template=N.initializeCSPTemplate(function(){return"/"}):y.template=this.separatorTemplate,i=!(y.itemClass="e-breadcrumb-separator"),t=[{previousItem:e[d],nextItem:e[d+1]}]):(y.itemClass="",i=!this.itemTemplate||(y.template=this.itemTemplate,!1),(t=[N.extend({},e[d].properties||e[d])])[0].url||this.itemTemplate||(t=[N.extend({},t[0],{isEmptyUrl:!0,url:"#"})]),a=(v||"Menu"===this.overflowMode)&&d===this.endIndex,(b!==c-1&&!a||this.itemTemplate)&&!l||(t[0].isLastItem=!0));var C=u,S=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(d>=this.startIndex&&d<=S&&(!(b%2)||d!==S)&&this.endIndex>=this._maxItems&&0<this._maxItems||0===this._maxItems)){if(b%2)continue;C=this.popupUl,a&&(o=!0)}else"Wrap"===this.overflowMode&&(C=0===b?m:h);var S=O.ListBase.createList(this.createElement,t,y,i,this).childNodes;if(p){if(v||g||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(d,1),this.initPvtProps(),this.reRenderItems();b!==c-1&&!a||N.remove(C.lastElementChild)}else N.append(S,C);if("Wrap"===this.overflowMode&&0!==b&&b%2==0&&u.appendChild(h),g&&1===b&&(S=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}}),N.EventHandler.add(S,"keyup",this.expandHandler,this),u.appendChild(S)),"Menu"===this.overflowMode&&this.startIndex===b&&this.endIndex>=this._maxItems&&0<=this._maxItems&&(C=this.getMenuElement(),N.EventHandler.add(C,"keyup",this.keyDownHandler,this),u.appendChild(C)),l||a)break;p&&b++}this.isReact&&(this.renderReactTemplates(),setTimeout(function(){n.calculateMaxItems()},5)),"Wrap"===this.overflowMode&&this.element.appendChild(m),this.element.appendChild(u),this.isReact||this.calculateMaxItems()}},T.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e,t,i=this.element.offsetWidth,s=[].slice.call(this.element.children[0].children).reverse(),n="Menu"===this.overflowMode?0:s[s.length-1].offsetWidth+(s[s.length-2]?s[s.length-2].offsetWidth:0);"Menu"===this.overflowMode&&(t=this.getMenuElement(),this.element.appendChild(t),n+=t.offsetWidth,N.remove(t));for(var r=0;r<s.length-2;r++){if(i<n){if(e=Math.ceil((r-1)/2)+("Menu"===this.overflowMode&&r<=2?0:1),(this.maxItems>e&&!(-1<this.maxItems&&-1===e)||-1===this.maxItems)&&this._maxItems!==e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===r&&i<(n+=s[s.length-1].offsetWidth+s[s.length-2].offsetWidth))return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&s[r].classList.contains(Dn)||(n+=s[r].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&0<this._maxItems){i=0;if((s=this.element.querySelectorAll(jn+Pn)).length>this._maxItems+this._maxItems-1){for(r="Wrap"===this.overflowMode?1:0;r<this._maxItems+this._maxItems-1;r++)i+=s[r].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},T.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},T.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},T.prototype.beforeItemRenderChanges=function(e,t,i,s){var n,r=i.querySelector(".e-anchor-wrap");t.text!==e.text&&r&&r.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=t.text)}),t.iconCss!==e.iconCss&&r&&((n=i.querySelector(jn+Tn))?t.iconCss?(N.removeClass([n],e.iconCss.split(" ")),N.addClass([n],t.iconCss.split(" "))):N.remove(n):t.iconCss&&(n=this.createElement("span",{className:Tn+" "+t.iconCss}),s?N.append([n],r):r.insertBefore(n,r.childNodes[0]))),t.url!==e.url&&this.enableNavigation&&(s=i.querySelector("a."+An))&&(t.url?s.setAttribute("href",t.url):s.removeAttribute("href"))},T.prototype.reRenderItems=function(){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&this.popupObj.element.querySelector(".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,N.detach(this.popupObj.element)),this.element.innerHTML="",this.renderItems(this.items)},T.prototype.clickHandler=function(e){var t=N.closest(e.target,jn+Pn+":not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),t&&(N.closest(e.target,jn+An)||this.itemTemplate)){var i=void 0,i=("Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll(jn+Pn)):[].slice.call(t.parentElement.children)).indexOf(t),t=("Menu"===this.overflowMode?N.closest(e.target,jn+Mn)?(i+=this.startIndex,this.endIndex=i,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector(jn+Dn)?i>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector(jn+Dn))?(i+=2*this.popupUl.childElementCount-2,i=Math.floor(i/2),this.endIndex=i):this.startIndex=this.endIndex=i:(i=Math.floor(i/2),this.startIndex=this.endIndex=i):i=Math.floor(i/2),"Hidden"===this.overflowMode&&0<this._maxItems&&0!==this.endIndex&&(i=parseInt(t.getAttribute("item-index"),10),1<this.startIndex&&(this.startIndex-=this.endIndex-i),this.endIndex=i),{element:t,item:this.items[i],event:e,cancel:!1});if(this.trigger("itemClick",t),t.cancel)return;this.items[i]&&(this.activeItem=this.items[i].url||this.items[i].text),this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(Dn)&&!this.isPopupCreated&&this.renderPopup()},T.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:Mn+" "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.isPopupCreated=!0,this.popupObj=new U.Popup(t,{content:this.popupUl,relateTo:this.element.querySelector(jn+Dn),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl&&e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},T.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!N.closest(e.target,jn+Dn)&&!N.closest(e.target,".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,N.detach(this.popupObj.element))},T.prototype.resize=function(e){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},T.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},T.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},T.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},T.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"enableActiveItemNavigation":this.reRenderItems();break;case"items":case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===t.overflowMode?this.element.classList.remove(Hn):"Wrap"===e.overflowMode&&this.element.classList.add(Hn),"Scroll"===t.overflowMode?this.element.classList.remove(Un):"Scroll"===e.overflowMode&&this.element.classList.add(Un);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":t.cssClass&&N.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&N.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" ")),(t.cssClass&&-1<t.cssClass.indexOf(Ln)&&!(e.cssClass&&-1<e.cssClass.indexOf(Ln))||!(t.cssClass&&-1<t.cssClass.indexOf(Ln))&&e.cssClass&&-1<e.cssClass.indexOf(Ln))&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle(Bn),this.element.setAttribute(Vn,e.disabled+"")}},T.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),N.EventHandler.add(document,"click",this.delegateClickHanlder,this),N.EventHandler.add(this.element,"click",this.clickHandler,this),this.resizeHandler=this.resize.bind(this),window.addEventListener("resize",this.resizeHandler)},T.prototype.popupWireEvents=function(){N.EventHandler.add(this.popupObj.element,"click",this.clickHandler,this),N.EventHandler.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},T.prototype.unWireEvents=function(){N.EventHandler.remove(document,"click",this.delegateClickHanlder),N.EventHandler.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null,this.popupObj&&(N.EventHandler.remove(this.popupObj.element,"click",this.clickHandler),N.EventHandler.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},T.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},T.prototype.getModuleName=function(){return"breadcrumb"},T.prototype.destroy=function(){var t=this,e=(this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&(this.popupObj.destroy(),this.isPopupCreated=!1,N.detach(this.popupObj.element)),[]),i=["aria-label"];this.cssClass&&e.concat(this.cssClass.split(" ")),this.enableRtl&&e.push("e-rtl"),this.disabled&&(e.push(Bn),i.push(Vn)),"Wrap"===this.overflowMode?e.push(Hn):"Scroll"===this.overflowMode&&e.push(Un),this.unWireEvents(),this.element.innerHTML="",N.removeClass([this.element],e),i.forEach(function(e){t.element.removeAttribute(e)}),Wn.prototype.destroy.call(this)},kn([N.Property("")],T.prototype,"url",void 0),kn([N.Collection([],Fn)],T.prototype,"items",void 0),kn([N.Property("")],T.prototype,"activeItem",void 0),kn([N.Property(-1)],T.prototype,"maxItems",void 0),kn([N.Property("Menu")],T.prototype,"overflowMode",void 0),kn([N.Property("")],T.prototype,"cssClass",void 0),kn([N.Property(null)],T.prototype,"itemTemplate",void 0),kn([N.Property("/")],T.prototype,"separatorTemplate",void 0),kn([N.Property(!0)],T.prototype,"enableNavigation",void 0),kn([N.Property(!1)],T.prototype,"enableActiveItemNavigation",void 0),kn([N.Property(!1)],T.prototype,"disabled",void 0),kn([N.Property("")],T.prototype,"locale",void 0),kn([N.Event()],T.prototype,"beforeItemRender",void 0),kn([N.Event()],T.prototype,"itemClick",void 0),kn([N.Event()],T.prototype,"created",void 0);var Wn,f=kn([N.NotifyPropertyChanges],T);function T(e,t){e=Wn.call(this,e,t)||this;return e.isPopupCreated=!1,e}_n=function(e,t){return(_n=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 _n,zn,kn=function(e,t){function i(){this.constructor=e}_n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},D=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Kn="e-carousel",Xn="e-active",Yn="e-rtl",Gn="e-partial",Qn="e-swipe",Jn="e-carousel-slide-container",Zn="e-carousel-items",$n="e-carousel-item",er="e-previous",tr="e-carousel-navigators",ir="e-carousel-indicators",sr="e-indicator-bars",nr="e-indicator-bar",rr="e-indicator",lr="e-icons",or="e-play-pause",ar="e-play-icon",dr="e-pause-icon",hr="e-previous-button",cr="e-next-button",pr="e-play-button",ur="e-round",mr="e-hover-arrows",fr="e-carousel-hover",gr="e-template",vr="e-carousel-slide-animation",yr="e-carousel-fade-animation",br="e-carousel-custom-animation",Cr="e-carousel-animation-none",Sr="e-prev",Ir="e-next",xr="e-transition-start",Er="e-transition-end",Nr=((Nr=a.CarouselSwipeMode||(a.CarouselSwipeMode={}))[Nr.Touch=1]="Touch",Nr[Nr.Mouse=2]="Mouse",zn=N.ChildProperty,kn(Or,zn),D([N.Property()],Or.prototype,"cssClass",void 0),D([N.Property()],Or.prototype,"interval",void 0),D([N.Property()],Or.prototype,"template",void 0),D([N.Property()],Or.prototype,"htmlAttributes",void 0),Or);function Or(){return null!==zn&&zn.apply(this,arguments)||this}wr=N.Component,kn(P,wr),P.prototype.getModuleName=function(){return Kn.replace("e-","")},P.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},P.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};this.localeObj=new N.L10n(this.getModuleName(),{nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"},this.locale)},P.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},P.prototype.onPropertyChanged=function(e,t){for(var i,s=0,n=Object.keys(e);s<n.length;s++){var r,l=n[s];switch(l){case"animationEffect":this.applyAnimation();break;case"cssClass":N.classList(this.element,[e.cssClass],[t.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,t.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":N.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":this.element.querySelector("."+Zn)&&this.renderTouchActions();break;case"loop":this.loop&&N.isNullOrUndefined(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex),!this.partialVisible&&this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||this.reRenderSlides();break;case"allowKeyboardInteraction":this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),e.allowKeyboardInteraction&&this.renderKeyboardActions();break;case"enableRtl":(r=[].slice.call(this.element.querySelectorAll("."+hr+",\n ."+cr+", ."+pr))).push(this.element),this.enableRtl?N.addClass(r,Yn):N.removeClass(r,Yn),!this.partialVisible&&this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||(r=this.loop?this.getNumOfItems():0,o=this.itemsContainer.firstElementChild.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(o,this.selectedIndex+r));break;case"buttonsVisibility":if(i=this.element.querySelector("."+tr))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),N.remove(i);break;case"VisibleOnHover":N.addClass([].slice.call(i.childNodes),mr);break;case"Visible":N.removeClass([].slice.call(i.childNodes),mr)}else this.renderNavigators(),this.renderPlayButton();break;case"width":N.setStyleAttribute(this.element,{width:N.formatUnit(this.width)});break;case"height":N.setStyleAttribute(this.element,{height:N.formatUnit(this.height)});break;case"autoPlay":this.showPlayButton&&N.isNullOrUndefined(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":case"indicatorsType":(i=this.element.querySelector("."+ir))&&(this.resetTemplates(["indicatorsTemplate"]),N.remove(i)),this.renderIndicators();break;case"showPlayButton":i=this.element.querySelector("."+or),!this.showPlayButton&&i&&(N.remove(i),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":var o="dataSource"===l?this.dataSource:this.items;!N.isNullOrUndefined(o)&&0<o.length&&this.selectedIndex>=o.length&&(this.setActiveSlide(o.length-1,"Previous"),this.autoSlide()),this.reRenderSlides(),this.reRenderIndicators();break;case"partialVisible":this.partialVisible?N.addClass([this.element],Gn):N.removeClass([this.element],Gn),this.reRenderSlides();break;case"swipeMode":N.EventHandler.remove(this.element,"mousedown touchstart",this.swipeStart),N.EventHandler.remove(this.element,"mousemove touchmove",this.swiping),N.EventHandler.remove(this.element,"mouseup touchend",this.swipStop),this.swipeModehandlers(),this.reRenderSlides()}}},P.prototype.reRenderSlides=function(){var e=this.element.querySelector("."+Zn);e&&(this.resetTemplates(["itemTemplate"]),N.remove(e)),this.renderSlides()},P.prototype.reRenderIndicators=function(){var e=this.element.querySelector("."+ir);e&&(this.resetTemplates(["indicatorsTemplate"]),N.remove(e)),this.renderIndicators()},P.prototype.initialize=function(){var e=[];e.push(Kn),this.cssClass&&e.push(this.cssClass),this.enableRtl&&e.push(Yn),this.partialVisible&&e.push(Gn),this.swipeMode!==(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)&&e.push(Qn),N.addClass([this.element],e),N.setStyleAttribute(this.element,{width:N.formatUnit(this.width),height:N.formatUnit(this.height)}),N.attributes(this.element,{role:"group","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),N.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},P.prototype.renderSlides=function(){var i=this,e=this.element.querySelector("."+Jn),e=(e||(e=this.createElement("div",{className:Jn,attrs:{tabindex:"0",role:"tabpanel"}}),this.element.appendChild(e)),this.itemsContainer=this.createElement("div",{className:Zn,attrs:{"aria-live":this.autoPlay?"off":"polite"}}),e.appendChild(this.itemsContainer),this.getNumOfItems()),t=(0<e&&this.loop&&(0<this.items.length?this.items.slice(-e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!N.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(-e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),0<this.items.length?(this.slideItems=this.items,this.items.forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer)})):!N.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer)})),0<e&&this.loop&&(0<this.items.length?this.items.slice(0,e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!N.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(0,e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),this.renderTemplates(),this.itemsContainer.style.setProperty("--carousel-items-count",""+this.itemsContainer.children.length),N.isNullOrUndefined(this.itemsContainer.firstElementChild)?0:this.itemsContainer.firstElementChild.clientWidth),e=(this.itemsContainer.style.transitionProperty="none",this.loop?e:0);this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},P.prototype.getTranslateX=function(e,t){return void 0===t&&(t=1),this.enableRtl?"translateX("+e*t+"px)":"translateX("+-e*t+"px)"},P.prototype.renderSlide=function(e,t,i,s,n){void 0===n&&(n=!1);var r=this.createElement("div",{id:N.getUniqueID("carousel_item"),className:$n+" "+(e.cssClass||"")+" "+(this.selectedIndex!==i||n?"":Xn),attrs:{"aria-hidden":this.selectedIndex!==i||n?"true":"false","data-index":i.toString(),role:"group","aria-roledescription":"slide"}}),i=(n&&r.classList.add("e-cloned"),this.selectedIndex===i&&!n||r.setAttribute("inert","true"),N.isNullOrUndefined(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,r),this.element.id+"_template"),n=this.templateParser(t)(e,this,"itemTemplate",i,!1);N.append(n,r),s.appendChild(r)},P.prototype.renderNavigators=function(){var e;"Hidden"!==this.buttonsVisibility&&(e=this.createElement("div",{className:tr}),this.element.querySelector("."+Jn).insertAdjacentElement("afterend",e),!N.isNullOrUndefined(this.slideItems)&&1<this.slideItems.length&&(this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next")),this.renderTemplates())},P.prototype.renderNavigatorButton=function(e){var t,i,s=this.createElement("div",{className:("Previous"===e?er:"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?mr:"")});"Previous"===e&&this.previousButtonTemplate?(N.addClass([s],gr),i=this.element.id+"_previousButtonTemplate",t=this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",i,!1),N.append(t,s)):"Next"===e&&this.nextButtonTemplate?(N.addClass([s],gr),i=this.element.id+"_nextButtonTemplate",t=this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",i,!1),N.append(t,s)):(i=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide"),type:"button"}}),new R.Button({cssClass:"e-flat "+ur+" "+("Previous"===e?hr:cr),iconCss:lr+" "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(i),s.appendChild(i)),this.element.querySelector("."+tr).appendChild(s),N.EventHandler.add(s,"click",this.navigatorClickHandler,this)},P.prototype.renderPlayButton=function(){var e,t,i,s;N.isNullOrUndefined(this.slideItems)||"Hidden"===this.buttonsVisibility||!this.showPlayButton||this.slideItems.length<=1||(e=this.createElement("div",{className:or+" "+("VisibleOnHover"===this.buttonsVisibility?mr:"")}),this.playButtonTemplate?(N.addClass([e],gr),t=this.element.id+"_playButtonTemplate",t=this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",t,!1),N.append(t,e)):(t=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"),type:"button"}}),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=new R.Button({cssClass:"e-flat "+ur+" "+pr,iconCss:lr+" "+(this.autoPlay&&!s?dr:ar),isToggle:!0,enableRtl:this.enableRtl}),s&&(this.setProperties({autoPlay:!1},!0),t.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),this.itemsContainer.setAttribute("aria-live","polite")),i.appendTo(t),e.appendChild(t)),(s=this.element.querySelector("."+tr)).insertBefore(e,s.lastElementChild),this.renderTemplates(),N.EventHandler.add(e,"click",this.playButtonClickHandler,this))},P.prototype.renderIndicators=function(){var s=this;if(this.showIndicators&&!N.isNullOrUndefined(this.indicatorsType)){var e,t="e-default",t=(this.indicatorsTemplate||(t="e-"+this.indicatorsType.toLowerCase()),this.createElement("div",{className:ir+" "+t})),n=this.createElement("div",{className:sr});if(t.appendChild(n),this.slideItems)switch(this.indicatorsType){case"Fraction":this.indicatorsTemplate?this.renderIndicatorTemplate(n,this.selectedIndex+1):n.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?this.renderIndicatorTemplate(n,this.selectedIndex+1):((e=this.createElement("div",{className:nr})).style.setProperty("--carousel-items-current",""+(this.selectedIndex+1)),e.style.setProperty("--carousel-items-count",""+this.slideItems.length),n.appendChild(e));break;case"Default":case"Dynamic":this.slideItems.forEach(function(e,t){var i=s.createElement("div",{className:nr+" "+(s.selectedIndex===t?Xn:s.selectedIndex-1===t?Sr:s.selectedIndex+1===t?Ir:""),attrs:{"data-index":t.toString(),"aria-current":s.selectedIndex===t?"true":"false"}});i.style.setProperty("--carousel-items-current",""+s.selectedIndex),s.indicatorsTemplate?s.renderIndicatorTemplate(i,t):"Default"===s.indicatorsType&&(t=s.createElement("button",{className:rr,attrs:{type:"button","aria-label":s.localeObj.getConstant("slide")+" "+(t+1)+" "+s.localeObj.getConstant("of")+" "+s.slideItems.length}}),i.appendChild(t),t.appendChild(s.createElement("div",{})),new R.Button({cssClass:"e-flat e-small"}).appendTo(t)),n.appendChild(i),"Default"===s.indicatorsType&&N.EventHandler.add(i,"click",s.indicatorClickHandler,s)})}this.element.appendChild(t)}},P.prototype.renderIndicatorTemplate=function(e,t){void 0===t&&(t=0),N.addClass([e],gr);var i=this.element.id+"_indicatorsTemplate",t=this.templateParser(this.indicatorsTemplate)({index:t,selectedIndex:this.selectedIndex},this,"indicatorsTemplate",i,!1);N.append(t,e)},P.prototype.renderKeyboardActions=function(){this.allowKeyboardInteraction&&(this.keyModule=new N.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}))},P.prototype.renderTouchActions=function(){this.touchModule=new N.Touch(this.element,{swipe:this.swipeHandler.bind(this)})},P.prototype.applyAnimation=function(){switch(N.removeClass([this.element],[br,yr,vr,Cr]),this.animationEffect){case"Slide":N.addClass([this.element],vr);break;case"Fade":N.addClass([this.element],yr);break;case"None":N.addClass([this.element],Cr);break;case"Custom":N.addClass([this.element],br)}},P.prototype.autoSlide=function(){N.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||(this.resetSlideInterval(),this.applySlideInterval())},P.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+$n+"."+Xn)||this.element.querySelector("."+ir+" ."+Xn);N.isNullOrUndefined(e)||(e=parseInt(e.dataset.index,10),this.loop||e!==this.slideItems.length-1?(e=(e+1)%this.slideItems.length,this.element.classList.contains(fr)||this.setActiveSlide(e,"Next"),this.autoSlide()):this.resetSlideInterval())},P.prototype.applySlideInterval=function(){var e,t=this;this.autoPlay&&!this.element.classList.contains(fr)&&(e=this.interval,0<this.items.length&&!N.isNullOrUndefined(this.items[this.selectedIndex||0].interval)&&(e=this.items[this.selectedIndex||0].interval),this.autoSlideInterval=setInterval(function(){return t.autoSlideChange()},e))},P.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},P.prototype.getSlideIndex=function(e){var t=this.selectedIndex||0;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},P.prototype.setActiveSlide=function(s,n,r){var l,o,e,t,a=this;void 0===r&&(r=!1),0<this.element.querySelectorAll("."+$n+"."+Sr+",."+$n+"."+Ir).length||(s=N.isNullOrUndefined(s)?0:s,l=[].slice.call(this.element.querySelectorAll("."+$n+":not(.e-cloned)")),t=this.element.querySelector("."+$n+"."+Xn),N.isNullOrUndefined(t)&&this.showIndicators?(e=this.element.querySelector("."+nr+"."+Xn),e=parseInt(e.dataset.index,10),N.addClass([l[parseInt(e.toString(),10)]],Xn)):N.isNullOrUndefined(t)?N.addClass([l[parseInt(s.toString(),10)]],Xn):(o=parseInt(t.dataset.index,10),e=l[parseInt(s.toString(),10)],t={currentIndex:o,nextIndex:s,currentSlide:t,nextSlide:e,slideDirection:n,isSwiped:r,cancel:!1},this.trigger("slideChanging",t,function(e){var t,i;e.cancel||(a.setProperties({selectedIndex:s},!0),N.attributes(e.currentSlide,{"aria-hidden":"true"}),e.currentSlide.setAttribute("inert","true"),N.attributes(e.nextSlide,{"aria-hidden":"false"}),e.nextSlide.removeAttribute("inert"),a.refreshIndicators(o,s),a.slideChangedEventArgs={currentIndex:e.nextIndex,previousIndex:e.currentIndex,currentSlide:e.nextSlide,previousSlide:e.currentSlide,slideDirection:n,isSwiped:r},t=l[parseInt(s.toString(),10)].clientWidth,i=a.getNumOfItems(),a.isSwipe||(a.itemsContainer.style.transitionDuration="0.6s"),a.isSwipe=!1,"Fade"===a.animationEffect?a.itemsContainer.classList.add("e-fade-in-out"):a.itemsContainer.style.transitionProperty="transform",a.loop?0===a.slideChangedEventArgs.currentIndex&&"Next"===a.slideChangedEventArgs.slideDirection?a.itemsContainer.style.transform=a.getTranslateX(t,l.length+i):a.slideChangedEventArgs.currentIndex===a.slideItems.length-1&&"Previous"===a.slideChangedEventArgs.slideDirection?a.itemsContainer.style.transform=a.partialVisible?a.getTranslateX(t):"translateX(0px)":a.itemsContainer.style.transform=a.getTranslateX(t,s+i):a.itemsContainer.style.transform=a.getTranslateX(t,s),"Slide"===a.animationEffect?"Previous"===n?(N.addClass([e.nextSlide],Sr),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),N.addClass([e.currentSlide,e.nextSlide],Er)):(N.addClass([e.nextSlide],Ir),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),N.addClass([e.currentSlide,e.nextSlide],xr)):"Fade"===a.animationEffect?(N.removeClass([e.currentSlide],Xn),N.addClass([e.nextSlide],Xn)):"Custom"===a.animationEffect?"Previous"===n?(N.addClass([e.nextSlide],Ir),N.addClass([e.currentSlide],Sr)):(N.addClass([e.currentSlide],Sr),N.addClass([e.nextSlide],Ir)):a.onTransitionEnd(),a.handleNavigatorsActions(s))})))},P.prototype.onTransitionEnd=function(){var e,t=this,i=(N.removeClass(this.element.querySelectorAll("."+Zn),"e-fade-in-out"),this.getNumOfItems());this.slideChangedEventArgs&&(this.itemsContainer.style.transitionProperty="none",this.loop&&(0===this.slideChangedEventArgs.currentIndex&&"Next"===this.slideChangedEventArgs.slideDirection||this.slideChangedEventArgs.currentIndex===this.slideItems.length-1&&"Previous"===this.slideChangedEventArgs.slideDirection)&&(e=this.slideChangedEventArgs.currentSlide.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(e,this.slideChangedEventArgs.currentIndex+i)),N.addClass([this.slideChangedEventArgs.currentSlide],Xn),N.removeClass([this.slideChangedEventArgs.previousSlide],Xn),this.trigger("slideChanged",this.slideChangedEventArgs,function(){N.removeClass(t.element.querySelectorAll("."+$n),[Sr,Ir,xr,Er]),t.slideChangedEventArgs=null}))},P.prototype.refreshIndicators=function(e,t){var i=this,s=this.element.querySelector("."+sr);if(!N.isNullOrUndefined(s)){var n=[].slice.call(s.childNodes);switch(this.indicatorsType){case"Default":case"Dynamic":N.attributes(n[parseInt(e.toString(),10)],{"aria-current":"false"}),N.attributes(n[parseInt(t.toString(),10)],{"aria-current":"true"}),N.removeClass(n,[Xn,Sr,Ir]),N.addClass([n[parseInt(t.toString(),10)]],Xn),n[t-1]&&N.addClass([n[t-1]],Sr),n[t+1]&&N.addClass([n[t+1]],Ir),n.forEach(function(e){return e.style.setProperty("--carousel-items-current",""+i.selectedIndex)});break;case"Fraction":this.indicatorsTemplate?(0<s.children.length&&s.removeChild(s.firstElementChild),this.renderIndicatorTemplate(s,t+1)):s.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?(0<s.children.length&&s.removeChild(s.firstElementChild),this.renderIndicatorTemplate(s,t+1)):s.firstElementChild.style.setProperty("--carousel-items-current",""+(this.selectedIndex+1))}}},P.prototype.setHtmlAttributes=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"class"===n?N.addClass([t],e[""+n]):t.setAttribute(n,e[""+n])}},P.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?N.compile(document.querySelector(t).innerHTML.trim()):N.compile(t)}catch(e){return N.compile(t)}},P.prototype.getNavigatorState=function(e,t){e=e.querySelector("."+(t?hr:cr));return!!e&&N.getInstance(e,R.Button).disabled},P.prototype.navigatorClickHandler=function(e){var e=e.currentTarget;this.getNavigatorState(e,e.classList.contains(er))||(e=e.classList.contains(er)?"Previous":"Next",this.setActiveSlide(this.getSlideIndex(e),e),this.autoSlide())},P.prototype.indicatorClickHandler=function(e){e=N.closest(e.target,"."+nr),e=parseInt(e.dataset.index,10);this.selectedIndex!==e&&(this.setActiveSlide(e,this.selectedIndex>e?"Previous":"Next"),this.autoSlide())},P.prototype.playButtonClickHandler=function(e,t){void 0===t&&(t=!1);var i,s=this.element.querySelector("."+pr);s&&(i=N.getInstance(s,R.Button),t||this.setProperties({autoPlay:!this.autoPlay},!0),s.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),i.iconCss=lr+" "+(this.autoPlay?dr:ar),i.dataBind(),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide())},P.prototype.keyHandler=function(e){if(this.allowKeyboardInteraction){var t,i,s=!1,n=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&n.classList.contains(rr)?n.click():n.classList.contains(Kn)||n.classList.contains(pr)?this.playButtonClickHandler(e):n.classList.contains(cr)?this.next():n.classList.contains(hr)&&this.prev();break;case"end":i=this.slideItems.length-1,t="Next",s=!0;break;case"home":t="Previous",s=!(i=0);break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&N.isNullOrUndefined(this.indicatorsTemplate)&&this.element.focus(),t="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",i=this.getSlideIndex(t),s=!this.isSuspendSlideTransition(i,t)}s&&(this.setActiveSlide(i,t),this.autoSlide())}},P.prototype.swipeHandler=function(e){var t;this.element.classList.contains(fr)||N.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||(t=e.startEvents?e.startEvents.toString():null)&&(this.swipeMode===a.CarouselSwipeMode.Mouse&&t.includes("Touch")||this.swipeMode===a.CarouselSwipeMode.Touch&&t.includes("Mouse"))||(t="Right"===e.swipeDirection?"Previous":"Next",e=this.getSlideIndex(t),this.isSuspendSlideTransition(e,t))||(this.setActiveSlide(e,t,!0),this.autoSlide())},P.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},P.prototype.handleNavigatorsActions=function(e){var t,i,s,n;"Hidden"!==this.buttonsVisibility&&(this.showPlayButton&&(t=this.element.querySelector("."+pr),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=N.isNullOrUndefined(this.playButtonTemplate)&&t&&s,i=N.isNullOrUndefined(this.playButtonTemplate)&&t&&!s?!t.classList.contains(Xn):i)&&(this.setProperties({autoPlay:!s},!0),t.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),(n=N.getInstance(t,R.Button)).iconCss=lr+" "+(this.autoPlay?dr:ar),n.dataBind()),(i=this.element.querySelector("."+hr))&&N.isNullOrUndefined(this.previousButtonTemplate)&&((n=N.getInstance(i,R.Button)).disabled=!this.loop&&0===e,n.dataBind()),s=this.element.querySelector("."+cr))&&N.isNullOrUndefined(this.nextButtonTemplate)&&((n=N.getInstance(s,R.Button)).disabled=!this.loop&&e===this.slideItems.length-1,n.dataBind())},P.prototype.onHoverActions=function(e){var t=this.element.querySelector("."+tr);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&t&&N.removeClass([].slice.call(t.childNodes),mr),this.pauseOnHover&&N.addClass([this.element],fr);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&t&&N.addClass([].slice.call(t.childNodes),mr),N.removeClass([this.element],fr),this.isSwipe&&this.swipStop()}this.autoSlide()},P.prototype.onFocusActions=function(e){switch(e.type){case"focusin":N.addClass([this.element],fr);break;case"focusout":N.removeClass([this.element],fr)}this.autoSlide()},P.prototype.destroyButtons=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<t.length;e++){var i=t[e],i=N.getInstance(i,R.Button);i&&i.destroy()}},P.prototype.getNumOfItems=function(){return this.partialVisible?2:1},P.prototype.getTranslateValue=function(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0},P.prototype.swipeStart=function(e){this.timeStampStart||(this.timeStampStart=Date.now()),e.preventDefault(),this.isSwipe=!1,this.itemsContainer.classList.add("e-swipe-start"),this.prevPageX=(e.touches?e.touches[0]:e).pageX,this.initialTranslate=this.getTranslateValue(this.itemsContainer)},P.prototype.swiping=function(e){this.itemsContainer.classList.contains("e-swipe-start")&&(this.isSwipe=!0,e.preventDefault(),e=(e.touches?e.touches[0]:e).pageX,e=this.prevPageX-e,!this.loop&&(this.enableRtl&&(0===this.selectedIndex&&0<e||this.selectedIndex===this.itemsContainer.childElementCount-1&&e<0)||!this.enableRtl&&(0===this.selectedIndex&&e<0||this.selectedIndex===this.itemsContainer.childElementCount-1&&0<e))||(this.itemsContainer.style.transform="translateX("+(this.initialTranslate+(this.enableRtl?e:-e))+"px)"))},P.prototype.swipStop=function(){var e=Date.now()-this.timeStampStart,t=(t=this.getTranslateValue(this.itemsContainer)-this.initialTranslate)<0?-1*t:t;this.isSwipe&&(i=t*(N.Browser.isDevice?6:1.66),this.itemsContainer.style.transitionDuration=(N.Browser.isDevice?t:i)/e/10+"s");var t=this.itemsContainer.firstElementChild.clientWidth/2,i=(this.itemsContainer.classList.remove("e-swipe-start"),this.getTranslateValue(this.itemsContainer));i-this.initialTranslate<-t?this.swipeNavigation(!this.enableRtl):i-this.initialTranslate>t?this.swipeNavigation(this.enableRtl):(this.itemsContainer.style.transform="translateX("+this.initialTranslate+"px)","Fade"===this.animationEffect&&this.itemsContainer.classList.add("e-fade-in-out"))},P.prototype.swipeNavigation=function(e){e?this.next():this.prev()},P.prototype.swipeModehandlers=function(){(this.swipeMode&a.CarouselSwipeMode.Touch)===a.CarouselSwipeMode.Touch&&(N.EventHandler.add(this.itemsContainer,"touchstart",this.swipeStart,this),N.EventHandler.add(this.itemsContainer,"touchmove",this.swiping,this),N.EventHandler.add(this.itemsContainer,"touchend",this.swipStop,this)),(this.swipeMode&a.CarouselSwipeMode.Mouse)===a.CarouselSwipeMode.Mouse&&(N.EventHandler.add(this.itemsContainer,"mousedown",this.swipeStart,this),N.EventHandler.add(this.itemsContainer,"mousemove",this.swiping,this),N.EventHandler.add(this.itemsContainer,"mouseup",this.swipStop,this)),0===this.swipeMode&&(this.swipeMode&a.CarouselSwipeMode.Mouse&a.CarouselSwipeMode.Touch)==(a.CarouselSwipeMode.Mouse&a.CarouselSwipeMode.Touch)&&(N.EventHandler.add(this.itemsContainer,"mousedown touchstart",this.swipeStart,this),N.EventHandler.add(this.itemsContainer,"mousemove touchmove",this.swiping,this),N.EventHandler.add(this.itemsContainer,"mouseup touchend",this.swipStop,this))},P.prototype.resizeHandler=function(){var e,t;this.itemsContainer&&this.itemsContainer.firstElementChild&&(e=this.getNumOfItems(),t=this.itemsContainer.firstElementChild.clientWidth,this.loop?this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e):this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex))},P.prototype.wireEvents=function(){"Custom"!==this.animationEffect&&this.swipeModehandlers(),N.EventHandler.add(this.element,"focusin focusout",this.onFocusActions,this),N.EventHandler.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),N.EventHandler.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),N.EventHandler.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this),N.EventHandler.add(window,"resize",this.resizeHandler,this)},P.prototype.unWireEvents=function(){var t=this;[].slice.call(this.element.querySelectorAll("."+nr)).forEach(function(e){N.EventHandler.remove(e,"click",t.indicatorClickHandler)});[].slice.call(this.element.querySelectorAll("."+er+",.e-next")).forEach(function(e){N.EventHandler.remove(e,"click",t.navigatorClickHandler)});var e=this.element.querySelector("."+or);e&&N.EventHandler.remove(e,"click",this.playButtonClickHandler),N.EventHandler.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),N.EventHandler.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),N.EventHandler.clearEvents(this.element),N.EventHandler.clearEvents(this.itemsContainer),N.EventHandler.remove(window,"resize",this.resizeHandler)},P.prototype.prev=function(){var e;!this.loop&&0===this.selectedIndex||(e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1,this.setActiveSlide(e,"Previous"),this.autoSlide())},P.prototype.next=function(){var e;!this.loop&&this.selectedIndex===this.slideItems.length-1||(e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1,this.setActiveSlide(e,"Next"),this.autoSlide())},P.prototype.play=function(){var e=this.element.querySelector("."+ar);this.showPlayButton&&e&&(N.classList(e,[dr],[ar]),this.element.querySelector("."+pr).setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))),this.setProperties({autoPlay:!0},!0),this.itemsContainer.setAttribute("aria-live","off"),this.applySlideInterval()},P.prototype.pause=function(){var e=this.element.querySelector("."+dr);this.showPlayButton&&e&&(this.element.querySelector("."+pr).setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),N.classList(e,[ar],[dr])),this.setProperties({autoPlay:!1},!0),this.itemsContainer.setAttribute("aria-live","off"),this.resetSlideInterval()},P.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},P.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},P.prototype.destroy=function(){var t=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(e){t.element.removeChild(e)}),N.removeClass([this.element],[Kn,this.cssClass,Yn,Qn]),["role","style"].forEach(function(e){t.element.removeAttribute(e)}),this.itemsContainer=null,wr.prototype.destroy.call(this)},D([N.Collection([],Nr)],P.prototype,"items",void 0),D([N.Property("Slide")],P.prototype,"animationEffect",void 0),D([N.Property()],P.prototype,"previousButtonTemplate",void 0),D([N.Property()],P.prototype,"nextButtonTemplate",void 0),D([N.Property()],P.prototype,"indicatorsTemplate",void 0),D([N.Property()],P.prototype,"playButtonTemplate",void 0),D([N.Property()],P.prototype,"cssClass",void 0),D([N.Property([])],P.prototype,"dataSource",void 0),D([N.Property()],P.prototype,"itemTemplate",void 0),D([N.Property(0)],P.prototype,"selectedIndex",void 0),D([N.Property("100%")],P.prototype,"width",void 0),D([N.Property("100%")],P.prototype,"height",void 0),D([N.Property(5e3)],P.prototype,"interval",void 0),D([N.Property(!0)],P.prototype,"autoPlay",void 0),D([N.Property(!0)],P.prototype,"pauseOnHover",void 0),D([N.Property(!0)],P.prototype,"loop",void 0),D([N.Property(!1)],P.prototype,"showPlayButton",void 0),D([N.Property(!0)],P.prototype,"enableTouchSwipe",void 0),D([N.Property(!0)],P.prototype,"allowKeyboardInteraction",void 0),D([N.Property(!0)],P.prototype,"showIndicators",void 0),D([N.Property("Default")],P.prototype,"indicatorsType",void 0),D([N.Property("Visible")],P.prototype,"buttonsVisibility",void 0),D([N.Property(!1)],P.prototype,"partialVisible",void 0),D([N.Property(a.CarouselSwipeMode.Touch)],P.prototype,"swipeMode",void 0),D([N.Property()],P.prototype,"htmlAttributes",void 0),D([N.Event()],P.prototype,"slideChanging",void 0),D([N.Event()],P.prototype,"slideChanged",void 0);var wr,kn=D([N.NotifyPropertyChanges],P);function P(e,t){e=wr.call(this,e,t)||this;return e.isSwipe=!1,e}kr=function(e,t){return(kr=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 kr,Lr,D=function(e,t){function i(){this.constructor=e}kr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ar=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Tr="e-appbar",Dr="e-horizontal-bottom",Pr="e-sticky",Mr="e-prominent",Hr="e-dense",Ur="e-rtl",Rr="e-light",Br="e-primary",Vr="e-inherit",D=(Lr=N.Component,D(jr,Lr),jr.prototype.destroy=function(){Lr.prototype.destroy.call(this),this.element.classList.remove(Tr),this.element.removeAttribute("style"),this.element.removeAttribute("role")},jr.prototype.getModuleName=function(){return"appbar"},jr.prototype.getPersistData=function(){return this.addOnPersist([])},jr.prototype.preRender=function(){},jr.prototype.render=function(){this.element.classList.add(Tr),"HEADER"!==this.element.tagName&&this.element.setAttribute("role","banner"),this.cssClass&&N.addClass([this.element],this.cssClass.split(" ")),"Bottom"===this.position&&this.element.classList.add(Dr),this.isSticky&&this.element.classList.add(Pr),this.enableRtl&&this.element.classList.add(Ur),this.setHeightMode(),this.setColorMode(),N.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},jr.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"mode":N.removeClass([this.element],[Hr,Mr]),this.setHeightMode();break;case"position":"Bottom"===this.position?N.addClass([this.element],Dr):N.removeClass([this.element],Dr);break;case"cssClass":t.cssClass&&N.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&N.addClass([this.element],e.cssClass.split(" "));break;case"isSticky":this.isSticky?N.addClass([this.element],Pr):N.removeClass([this.element],Pr);break;case"htmlAttributes":if(!N.isNullOrUndefined(this.htmlAttributes)){if(!N.isNullOrUndefined(t.htmlAttributes))for(var n=0,r=Object.keys(t.htmlAttributes);n<r.length;n++){var l=r[n];"class"===l?N.removeClass([this.element],t.htmlAttributes[""+l]):this.element.removeAttribute(l)}this.setHtmlAttributes(e.htmlAttributes,this.element)}break;case"colorMode":N.removeClass([this.element],["e-dark",Br,Vr,Rr]),this.setColorMode();break;case"enableRtl":this.enableRtl?N.addClass([this.element],Ur):N.removeClass([this.element],Ur)}},jr.prototype.setHtmlAttributes=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"class"===n?N.addClass([t],e[""+n]):t.setAttribute(n,e[""+n])}},jr.prototype.setHeightMode=function(){"Prominent"===this.mode?this.element.classList.add(Mr):"Dense"===this.mode&&this.element.classList.add(Hr)},jr.prototype.setColorMode=function(){switch(this.colorMode){case"Light":this.element.classList.add(Rr);break;case"Dark":this.element.classList.add("e-dark");break;case"Primary":this.element.classList.add(Br);break;case"Inherit":this.element.classList.add(Vr)}},Ar([N.Property("Regular")],jr.prototype,"mode",void 0),Ar([N.Property("Top")],jr.prototype,"position",void 0),Ar([N.Property()],jr.prototype,"cssClass",void 0),Ar([N.Property(!1)],jr.prototype,"isSticky",void 0),Ar([N.Property()],jr.prototype,"htmlAttributes",void 0),Ar([N.Property("Light")],jr.prototype,"colorMode",void 0),Ar([N.Event()],jr.prototype,"created",void 0),Ar([N.Event()],jr.prototype,"destroyed",void 0),Ar([N.NotifyPropertyChanges],jr));function jr(e,t){return Lr.call(this,e,t)||this}Fr=function(e,t){return(Fr=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 Fr,qr,Ar=function(e,t){function i(){this.constructor=e}Fr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Wr="--progress-position",_r="e-vertical",zr="e-horizontal",Kr="e-stepper-steps",Xr=((Xr=a.StepStatus||(a.StepStatus={})).NotStarted="NotStarted",Xr.InProgress="InProgress",Xr.Completed="Completed",qr=N.ChildProperty,Ar(Yr,qr),M([N.Property("")],Yr.prototype,"cssClass",void 0),M([N.Property(!1)],Yr.prototype,"disabled",void 0),M([N.Property("")],Yr.prototype,"iconCss",void 0),M([N.Property(null)],Yr.prototype,"isValid",void 0),M([N.Property("")],Yr.prototype,"label",void 0),M([N.Property(!1)],Yr.prototype,"optional",void 0),M([N.Property(a.StepStatus.NotStarted)],Yr.prototype,"status",void 0),M([N.Property("")],Yr.prototype,"text",void 0),Yr);function Yr(){return null!==qr&&qr.apply(this,arguments)||this}(Qr=a.StepperOrientation||(a.StepperOrientation={})).Horizontal="Horizontal",Qr.Vertical="Vertical";Gr=N.Component,Ar(Jr,Gr),Jr.prototype.preRender=function(){},Jr.prototype.getModuleName=function(){return"stepperBase"},Jr.prototype.getPersistData=function(){return this.addOnPersist([])},Jr.prototype.render=function(){},Jr.prototype.updateOrientaion=function(e){(e.classList.contains(zr)||e.classList.contains(_r))&&e.classList.remove(zr,_r),N.isNullOrUndefined(this.orientation)||e.classList.add("e-"+this.orientation.toLocaleLowerCase())},Jr.prototype.renderProgressBar=function(e){this.progressStep=this.createElement("div",{className:"e-stepper-progressbar"}),this.progressbar=this.createElement("div",{className:"e-progressbar-value"});var t,i=e.querySelector("li").querySelector(".e-step-label-container");this.progressStep.appendChild(this.progressbar),e.prepend(this.progressStep),this.progressbar.style.setProperty("--progress-value","0%"),e.classList.contains(_r)&&(e.classList.contains("e-label-bottom")||e.classList.contains("e-label-top")?(t=e.querySelector("."+Kr),this.progressStep.style.setProperty(Wr,t.offsetWidth/2+"px")):this.progressStep.style.setProperty(Wr,this.progressBarPosition/2-1+"px")),i&&i.classList.contains("e-label-before")&&this.progressStep.style.setProperty(Wr,this.progressBarPosition-1+5+"px"),e.classList.contains(zr)&&this.setProgressPosition(e)},Jr.prototype.setProgressPosition=function(e,t){var i=e.querySelector(".e-step-container"),s=i.firstElementChild,i=(!0!==t&&(t=0,t=e.classList.contains("e-label-before")?i.offsetParent.offsetHeight-s.offsetHeight/2-1:s.offsetHeight/2,this.progressStep.style.setProperty("--progress-top-position",t+"px")),e.querySelector("."+Kr).lastChild.firstChild);e.classList.contains("e-rtl")?(t=s.offsetLeft+s.offsetWidth-e.querySelector("."+Kr).offsetWidth,this.progressStep.style.setProperty("--progress-left-position",Math.abs(t)+"px"),this.progressStep.style.setProperty("--progress-bar-width",Math.abs(i.offsetLeft-s.offsetLeft)+"px")):(this.progressStep.style.setProperty("--progress-left-position",s.offsetLeft+1+"px"),this.progressStep.style.setProperty("--progress-bar-width",i.offsetWidth+i.offsetLeft-2-(s.offsetLeft+2)+"px"))},Jr.prototype.onPropertyChanged=function(e,t){},M([N.Collection([],Xr)],Jr.prototype,"steps",void 0),M([N.Property("")],Jr.prototype,"cssClass",void 0),M([N.Property(!1)],Jr.prototype,"readOnly",void 0),M([N.Property(a.StepperOrientation.Horizontal)],Jr.prototype,"orientation",void 0),M([N.Event()],Jr.prototype,"created",void 0);var Gr,Qr=M([N.NotifyPropertyChanges],Jr);function Jr(e,t){return Gr.call(this,e,t)||this}Zr=function(e,t){return(Zr=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 Zr,$r,Ar=function(e,t){function i(){this.constructor=e}Zr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},el="e-indicator",tl="e-step-text-container",il="e-step-selected",sl="e-step-inprogress",nl="e-step-notstarted",rl="e-step-focus",ll="e-step-completed",ol="e-step-disabled",al="e-stepper-readonly",dl="--progress-value",hl="e-rtl",cl="e-step-template",pl="e-label-after",ul="e-label-before",ml="e-vertical",fl="e-horizontal",gl="e-step-item",vl="e-step-text",yl="e-text",bl="e-step-label",Cl="e-label",Sl="e-step-type-indicator",Il="e-step-type-label",xl="e-step-indicator",El="e-stepper-tooltip",Nl="e-linear",Ol=($r=N.ChildProperty,Ar(wl,$r),M([N.Property(!0)],wl.prototype,"enable",void 0),M([N.Property(2e3)],wl.prototype,"duration",void 0),M([N.Property(0)],wl.prototype,"delay",void 0),wl);function wl(){return null!==$r&&$r.apply(this,arguments)||this}(Ll=a.StepLabelPosition||(a.StepLabelPosition={})).Top="Top",Ll.Bottom="Bottom",Ll.Start="Start",Ll.End="End",(Ll=a.StepType||(a.StepType={})).Default="Default",Ll.Label="Label",Ll.Indicator="Indicator";Ar(H,kl=Qr),H.prototype.preRender=function(){this.element.id||(this.element.id=N.getUniqueID("e-"+this.getModuleName()));this.l10n=new N.L10n("stepper",{optional:"Optional"},this.locale),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space",enter:"enter",home:"home",end:"end",tab:"tab",shiftTab:"shift+tab",escape:"escape"},this.tooltipOpen=!1},H.prototype.getModuleName=function(){return"stepper"},H.prototype.render=function(){this.initialize(),this.navigationHandler(this.activeStep,null,!1),this.updateStepperStatus(!0)},H.prototype.initialize=function(){this.element.setAttribute("aria-label",this.element.id),this.updatePosition(),this.stepperItemList=this.createElement("ol",{className:"e-stepper-steps"}),this.updateOrientaion(this.element),this.updateStepType(),this.element.appendChild(this.stepperItemList),this.cssClass&&N.addClass([this.element],this.cssClass.trim().split(" ")),this.readOnly&&this.element.classList.add(al),this.enableRtl&&this.element.classList.add(hl),this.wireEvents(),this.updateTemplateFunction(),this.renderItems(),0<this.steps.length&&(this.initiateProgressBar(),this.checkValidStep(),this.updateAnimation(),this.updateTooltip(),this.wireKeyboardEvent())},H.prototype.initiateProgressBar=function(){var e=this;1<this.steps.length&&(this.isAngular&&this.template?setTimeout(function(){e.renderProgressBar(e.element)}):this.renderProgressBar(this.element))},H.prototype.updatePosition=function(){this.progressBarPosition=this.beforeLabelWidth=this.textEleWidth=0},H.prototype.renderDefault=function(e){e=this.steps[parseInt(e.toString(),10)];return!e.iconCss&&!e.text&&!e.label},H.prototype.updateAnimation=function(){var e=this.element.querySelector(".e-progressbar-value");this.animation.enable?0<=this.animation.delay&&e&&e.style.setProperty("--delay",this.animation.delay+"ms"):e&&(e.style.setProperty("--delay","0ms"),e.style.setProperty("--duration","0ms"))},H.prototype.updateStepType=function(){var e;N.isNullOrUndefined(this.stepType)||(e=this.stepType.toLowerCase(),-1!==["indicator","label","default"].indexOf(e)&&("default"!==e&&this.element.classList.add("e-step-type-"+e),"indicator"!==e&&"label"!==e||!this.labelContainer||this.clearLabelPosition()))},H.prototype.wireEvents=function(){this.windowEventHandlers={},this.windowEventHandlers.resize=this.updateResize.bind(this),this.windowEventHandlers.click=this.updateStepFocus.bind(this),N.EventHandler.add(window,"resize",this.windowEventHandlers.resize),N.EventHandler.add(window,"click",this.windowEventHandlers.click)},H.prototype.unWireEvents=function(){N.EventHandler.remove(window,"resize",this.windowEventHandlers&&this.windowEventHandlers.resize),N.EventHandler.remove(window,"click",this.windowEventHandlers&&this.windowEventHandlers.click),this.windowEventHandlers&&(this.windowEventHandlers.resize=null,this.windowEventHandlers.click=null,this.windowEventHandlers=null)},H.prototype.updateResize=function(){this.stepperItemList&&this.progressbar&&this.element.classList.contains(fl)&&this.setProgressPosition(this.element,!0),this.navigateToStep(this.activeStep,null,null,!1,!1)},H.prototype.updateStepFocus=function(){var e;this.isKeyNavFocus&&(this.isKeyNavFocus=!1,e=this.element.querySelector("."+rl))&&(e.classList.remove(rl),this.element.classList.remove("e-steps-focus"))},H.prototype.updateStepperStatus=function(e){for(var t=0;t<this.steps.length;t++){var i=this.steps[parseInt(t.toString(),10)],s=i.status.toLowerCase();if(e&&0===this.activeStep&&0===t&&(l=this.isProtectedOnChange,this.isProtectedOnChange=!0,i.status=a.StepStatus.InProgress,this.isProtectedOnChange=l),i&&"notstarted"!==s&&t===this.activeStep)for(var n=0;n<this.steps.length;n++){var r=this.stepperItemElements[parseInt(n.toString(),10)],l=(r.classList.remove(il,sl,ll,nl),this.isProtectedOnChange);this.isProtectedOnChange=!0,"completed"===s?this.updateStatusClass(n,t,r):this.updateStatusClass(n,t,r,!0),this.isProtectedOnChange=l}else i&&"notstarted"!==s&&t!==this.activeStep&&this.navigationHandler(this.activeStep,null,!0)}},H.prototype.updateStatusClass=function(e,t,i,s){var n=this.steps[parseInt(e.toString(),10)];e<t?(i.classList.add(ll),n.status=a.StepStatus.Completed):e===t?i.classList.add(s?sl:ll,il):i.classList.add(nl)},H.prototype.renderItems=function(){for(var t=this,e=this.element.classList.contains(fl),i=this.element.classList.contains(ml),s=N.isNullOrUndefined(this.labelPosition)?"":this.labelPosition.toLowerCase(),n=0;n<this.steps.length;n++){this.stepperItemContainer=this.createElement("li",{className:"e-step-container"});var r,l,o,a=this.createElement("span",{className:"e-step"}),d=this.steps[parseInt(n.toString(),10)],h=!!d.label,c=!!d.text,p=this.element.classList.contains(Sl),c=(this.stepperItemContainer.classList[0===n?"add":"remove"](il,sl),this.stepperItemContainer.classList[0!==n?"add":"remove"](nl),e&&this.stepperItemContainer.style.setProperty("--max-width",100/this.steps.length+"%"),this.renderDefault(n)&&(N.isNullOrUndefined(this.template)||""===this.template)?((r=!this.element.classList.contains("e-step-type-default")&&"indicator"===this.stepType.toLowerCase())&&a.classList.add("e-icons",xl),r||null!=d.isValid||(a.classList.add("e-step-content"),a.innerHTML=(n+1).toString()),this.stepperItemContainer.appendChild(a)):!N.isNullOrUndefined(this.template)&&""!==this.template||(r=!0,!(d.iconCss||!d.iconCss&&c&&h)||(c||h)&&this.element.classList.contains(Il)||(d.iconCss?(o=d.iconCss.trim().split(" "),(l=a.classList).add.apply(l,[el].concat(o)),this.stepperItemContainer.classList.add(gl)):!d.iconCss&&c&&h&&(a.classList.add(el),a.innerHTML=d.text,this.stepperItemContainer.classList.add(gl)),this.stepperItemContainer.appendChild(a),(e&&("start"===s||"end"===s)&&h||i&&("top"===s||"bottom"===s)&&h)&&!p&&(this.element.classList.add("e-label-"+s),this.createTextLabelElement(d.label),r=!1)),!c||d.iconCss&&p||!r||d.iconCss&&h||(!d.iconCss&&p||(!d.iconCss||this.element.classList.contains(Il))&&!h?(d.iconCss||h||this.element.classList.add("e-step-type-indicator"),this.checkValidState(d,a),h=!1):(h||this.createTextLabelElement(d.text),h&&this.element.classList.contains(Il)&&(this.createElement("span",{className:yl}).innerText=d.label),c=!h)),!h)||d.iconCss&&p||!r||(d.iconCss||c||!p?(!this.element.classList.contains(Il)||!c||this.element.classList.contains(Il)&&h)&&(this.createTextLabelElement(d.label,!0),this.updateLabelPosition(),(d.iconCss||c||this.stepperItemContainer.classList.contains(gl))&&!this.element.classList.contains(Il)||(this.stepperItemContainer.classList.add("e-step-label-only"),null!==d.isValid&&(l=this.createElement("span",{className:"e-step-validation-icon e-icons"}),this.labelContainer.appendChild(l)))):this.checkValidState(d,a,!0)),d.optional&&(o=this.createElement("span",{className:"e-step-label-optional"}),this.l10n.setLocale(this.locale),p=this.l10n.getConstant("optional"),o.innerText=p,(h&&this.labelContainer&&(this.element.classList.contains(pl)&&!this.stepperItemContainer.classList.contains("e-step-label-only")||e&&this.element.classList.contains(ul)&&!this.stepperItemContainer.classList.contains("e-step-label-only"))||i&&this.element.classList.contains(ul)?this.labelContainer:this.stepperItemContainer).appendChild(o),null!==d.isValid)&&this.stepperItemContainer.classList.add(d.isValid?"e-step-valid":"e-step-error"),d.cssClass&&N.addClass([this.stepperItemContainer],d.cssClass.trim().split(" ")),d.disabled&&(this.stepperItemContainer.classList[d.disabled?"add":"remove"](ol),N.attributes(this.stepperItemContainer,{tabindex:"-1","aria-disabled":"true"})),null!==d.isValid&&(d.isValid?this.stepperItemContainer.classList.add("e-step-valid"):this.stepperItemContainer.classList.add("e-step-error")),this.renderItemContent(n,!1),this.stepperItemContainer.classList.contains(sl)?N.attributes(this.stepperItemContainer,{tabindex:"0","aria-current":"true"}):N.attributes(this.stepperItemContainer,{tabindex:"-1"}),this.wireItemsEvents(this.stepperItemContainer,n),this.stepperItemElements.push(this.stepperItemContainer),{element:this.stepperItemContainer,index:n});this.trigger("beforeStepRender",c,function(e){t.stepperItemList.appendChild(e.element)}),i&&(this.isAngular&&this.template?setTimeout(function(){t.calculateProgressBarPosition()}):this.calculateProgressBarPosition())}if(i&&this.element.classList.contains(ul))for(var u=this.stepperItemList.querySelectorAll("."+Cl),m=0;m<u.length;m++)u[parseInt(m.toString(),10)].style.setProperty("--label-width",this.beforeLabelWidth+5+"px")},H.prototype.createTextLabelElement=function(e,t){var i=this.createElement("span",{className:(t=void 0===t?!1:t)?Cl:tl+" "+yl});i.innerText=e,(t?(this.labelContainer=this.createElement("span",{className:"e-step-label-container"}),this.labelContainer):this.stepperItemContainer).appendChild(i),this.stepperItemContainer.classList.add(t?bl:vl)},H.prototype.calculateProgressBarPosition=function(){var e=!!this.element.classList.contains(ul),t=this.stepperItemContainer.classList.contains(gl)&&!this.stepperItemContainer.classList.contains(vl)&&!this.stepperItemContainer.classList.contains(bl),i=this.stepperItemContainer.querySelector("."+tl);i&&(this.textEleWidth=this.textEleWidth<i.offsetWidth?i.offsetWidth:this.textEleWidth),e?(i=this.stepperItemContainer.querySelector("."+Cl).offsetWidth+15,this.beforeLabelWidth=Math.max(this.beforeLabelWidth,i),e=this.element.querySelector("ol").lastChild.querySelector("."+el),i=this.stepperItemContainer.querySelector("."+tl),e||i?(e=this.beforeLabelWidth+(this.stepperItemContainer.querySelector("."+el)||i).offsetWidth/2,this.progressBarPosition=Math.max(this.progressBarPosition,e)):this.progressBarPosition=Math.max(this.progressBarPosition,this.beforeLabelWidth/2)):(i=this.element.querySelector("ol").lastChild,e=(t?this.stepperItemContainer:i.firstChild).offsetWidth,this.progressBarPosition=Math.max(this.progressBarPosition,e))},H.prototype.checkValidState=function(e,t,i){null==e.isValid?(t.classList.add("e-step-content"),t.innerHTML=i?e.label:e.label||e.text,this.stepperItemContainer.appendChild(t)):(t.classList.add(el),this.stepperItemContainer.appendChild(t),this.stepperItemContainer.classList.add(gl))},H.prototype.updateCurrentLabel=function(){var e=this.labelPosition.toLowerCase();return this.element.classList.contains(fl)?"top"===e?"before":"bottom"===e?"after":e:"start"===e?"before":"end"===e?"after":e},H.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.labelContainer.classList.add("e-label-"+this.updateCurrentLabel()),"start"===this.labelPosition.toLowerCase()&&"vertical"===this.orientation.toLowerCase()&&this.stepperItemContainer.firstChild?this.stepperItemContainer.firstChild.before(this.labelContainer):this.stepperItemContainer.appendChild(this.labelContainer),this.element.classList.add("e-label-"+this.updateCurrentLabel())},H.prototype.clearLabelPosition=function(){var e=this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);e&&(N.removeClass([this.labelContainer],e),N.removeClass([this.element],e))},H.prototype.checkValidStep=function(){for(var a=this.element.classList.contains(Sl),d=this,e=0;e<this.steps.length;e++)!function(e){var t,i,s,n,r,l=d.steps[parseInt(e.toString(),10)],o=d.stepperItemElements[parseInt(e.toString(),10)];null!==l.isValid&&(r=void 0,a&&!l.iconCss?r=o.querySelector("."+el):t=o.querySelector("."+el),!r&&a&&d.renderDefault(e)&&(r=o.querySelector("."+xl)),i=o.querySelector(".e-step-validation-icon"),l=l.iconCss.trim().split(" "),n=(s=o.classList.contains("e-step-valid"))?"e-check":"e-circle-info",r&&(r.classList.remove(xl),""!==r.innerHTML&&(r.innerHTML=""),r.classList.add("e-icons",n,el)),d.renderDefault(e)&&!a&&o.querySelector(".e-step").classList.add("e-icons",n,el),t&&(""!==t.innerHTML?t.innerHTML="":0<l.length&&l.forEach(function(e){t.classList.remove(e)}),t.classList.add("e-icons",n)),i)&&(i.classList.add(s?"e-circle-check":"e-circle-info"),d.element.classList.contains(ml))&&(r=o.querySelector("."+Cl),l=(e=o.querySelector("."+yl))?e.offsetWidth+e.getBoundingClientRect().left:r.offsetWidth+r.getBoundingClientRect().left,o.querySelector(".e-step-validation-icon").style.setProperty("--icon-position",l+20+"px"))}(e)},H.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new U.Tooltip({target:".e-step-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?El+" "+this.cssClass:El,position:"TopCenter"}),this.tooltipObj.appendTo(this.stepperItemList)):N.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},H.prototype.wireItemsEvents=function(e,t){N.EventHandler.add(e,"click",this.linearModeHandler.bind(this,e,t),this),N.EventHandler.add(e,"mouseover",this.openStepperTooltip.bind(this,t),this),N.EventHandler.add(e,"mouseleave",this.closeStepperTooltip,this)},H.prototype.unWireItemsEvents=function(){for(var e=0;e<this.steps.length;e++){var t=this.stepperItemElements[parseInt(e.toString(),10)];N.EventHandler.remove(t,"click",this.linearModeHandler.bind(this,t,e)),N.EventHandler.remove(t,"mouseover",this.openStepperTooltip.bind(this,e)),N.EventHandler.remove(t,"mouseleave",this.closeStepperTooltip)}},H.prototype.linearModeHandler=function(e,t,i){var s;this.linear&&(s=t-this.activeStep,1!==Math.abs(s))||this.stepClickHandler(t,i,e)},H.prototype.openStepperTooltip=function(e){var t=this.steps[parseInt(e.toString(),10)];this.showTooltip&&(t.label||t.text)&&!this.tooltipOpen&&(this.updateTooltipContent(e),this.tooltipObj.open(this.stepperItemElements[parseInt(e.toString(),10)]),"label"!==this.stepType.toLocaleLowerCase()&&("indicator"===this.stepType.toLocaleLowerCase()||""!==t.label&&""!==t.iconCss||null===t.label&&""===t.iconCss&&""!==t.text)&&(e="inprogress"===t.status.toLowerCase()?El+" e-step-inprogress-tip "+(this.cssClass||""):El+" "+(this.cssClass||""),this.tooltipObj.setProperties({cssClass:e.trim()})),this.tooltipOpen=!0)},H.prototype.closeStepperTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},H.prototype.updateTooltipContent=function(e){var t,i,s;this.showTooltip&&(this.isReact&&this.clearTemplate(["stepperTooltipTemplate"]),t=void 0,e=this.steps[parseInt(e.toString(),10)],this.tooltipTemplate?(t=this.createElement("span",{className:"e-stepper-tooltip-content"}),i=this.getTemplateFunction(this.tooltipTemplate),N.append(i({value:e},this,"stepperTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),t),this.tooltipObj.setProperties({content:t},!0)):(s=e.label||e.text,this.tooltipObj.setProperties({content:N.initializeCSPTemplate(function(){return s})},!0)),this.renderReactTemplates())},H.prototype.stepClickHandler=function(e,t,i){var s={element:i,event:t,previousStep:this.activeStep,activeStep:e};this.trigger("stepClick",s),this.navigateToStep(e,t,i,!0)},H.prototype.updateTemplateFunction=function(){this.templateFunction=this.template?this.getTemplateFunction(this.template):null},H.prototype.renderItemContent=function(e,t){var i,s=this.stepperItemList.querySelectorAll("li");t&&this.removeItemContent(s[parseInt(e.toString(),10)]),this.template&&((t?s[parseInt(e.toString(),10)]:this.stepperItemContainer).classList.add(cl),i=this.steps[parseInt(e.toString(),10)],N.append(this.templateFunction({step:i,currentStep:e},this,"stepperTemplate",this.element.id+"_stepperTemplate",this.isStringTemplate),t?s[parseInt(e.toString(),10)]:this.stepperItemContainer)),this.renderReactTemplates()},H.prototype.removeItemContent=function(e){e.classList.remove(cl);for(var t=e.firstElementChild,i=0;i<e.childElementCount;i++)t.remove()},H.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["stepperTemplate"]);for(var e=0;e<this.steps.length;e++)this.renderItemContent(e,!0)},H.prototype.getTemplateFunction=function(t){if("string"!=typeof t)return N.compile(t);var i="";try{var e=N.select(t),i=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return N.compile(i)},H.prototype.navigateToStep=function(t,i,s,n,e){var r,l=this,o={element:s,event:i,isInteracted:n,previousStep:this.activeStep,activeStep:t,cancel:!1};!1!==e?(r=this.activeStep,this.trigger("stepChanging",o,function(e){e.cancel||(l.navigationHandler(t),e={element:s,event:i,isInteracted:n,previousStep:r,activeStep:l.activeStep},l.trigger("stepChanged",e))})):this.navigationHandler(t)},H.prototype.navigationHandler=function(e,t,i){e!==this.activeStep&&this.progressbar&&(this.progressbar.style.transitionDuration=this.animation.duration+"ms"),e=Math.min(e,this.steps.length-1);var s=this.stepperItemElements.length,s=(0<=e&&e<s-1&&(e=this.stepperItemElements[parseInt(e.toString(),10)].classList.contains(ol)?this.activeStep:e),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.activeStep=parseInt(e.toString(),10),this.isProtectedOnChange=s;for(var n=0;n<this.steps.length;n++){var r=this.stepperItemElements[parseInt(n.toString(),10)],l=this.steps[parseInt(n.toString(),10)],o=(r.classList.remove(il,sl,ll,nl),n===this.activeStep&&r.classList.add(il),0<=this.activeStep&&this.progressbar?this.element.classList.contains(fl)?this.calculateProgressbarPos():this.progressbar.style.setProperty(dl,100/(this.steps.length-1)*e+"%"):this.activeStep<0&&this.progressbar&&this.progressbar.style.setProperty(dl,"0%"),n===this.activeStep?r.classList.add(sl):0<this.activeStep&&n<this.activeStep?r.classList.add(ll):r.classList.add(nl),r.classList.contains(sl)?N.attributes(r,{tabindex:"0","aria-current":"true"}):N.attributes(r,{tabindex:"-1","aria-current":"false"}),this.isProtectedOnChange);!(this.isProtectedOnChange=!0)!==i&&(n<this.activeStep||this.steps.length-1===this.activeStep&&"completed"===l.status.toLowerCase()?l.status=a.StepStatus.Completed:n===this.activeStep?l.status=a.StepStatus.InProgress:n>this.activeStep&&(l.status=a.StepStatus.NotStarted),t&&this.activeStep===n&&(l.status=t),"completed"===l.status.toLowerCase()&&(r.classList.remove(il,sl,nl),r.classList.add(ll)),"notstarted"===l.status.toLowerCase())&&(r.classList.remove(il,sl,ll),r.classList.add(nl)),this.isProtectedOnChange=o,this.updateIndicatorStatus(n,r)}this.updateStepInteractions(),this.progressbar&&(this.progressbar.style.transitionDuration="0ms")},H.prototype.calculateProgressbarPos=function(){var e,i,s,t,n,r=this;(this.element.classList.contains(ul)||this.element.classList.contains(pl))&&!this.element.classList.contains(Sl)&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(gl)?(n=this.element.querySelector(".e-stepper-progressbar"),t=this.stepperItemElements[parseInt(this.activeStep.toString(),10)].firstChild,e=0===this.activeStep?0:(t.offsetLeft-n.offsetLeft+t.offsetWidth/2)/n.offsetWidth*100,this.element.classList.contains(hl)&&(e=(n.getBoundingClientRect().right-t.getBoundingClientRect().right+t.offsetWidth/2)/n.offsetWidth*100),this.progressbar.style.setProperty(dl,e+"%")):(s=i=0,this.stepperItemElements.forEach(function(e,t){e=e.offsetWidth;i+=e,t<=r.activeStep&&(s+=t===r.activeStep&&0!==t?e/2:e)}),t=(this.stepperItemList.offsetWidth-i)/(this.stepperItemElements.length-1),n=(s+t*this.activeStep)/this.stepperItemList.offsetWidth*100,this.progressbar.style.setProperty(dl,n+"%"))},H.prototype.updateIndicatorStatus=function(e,t){this.renderDefault(e)&&this.element.classList.contains(Sl)&&!t.classList.contains("e-step-valid")&&!t.classList.contains("e-step-error")&&(t.classList.contains(ll)?(t.firstChild.classList.remove("e-icons","e-step-indicator"),t.firstChild.classList.add(el,"e-icons","e-check")):(t.classList.contains(sl)||t.classList.contains(nl))&&(t.firstChild.classList.remove(el,"e-icons","e-check"),t.firstChild.classList.add("e-icons","e-step-indicator")))},H.prototype.updateStepInteractions=function(){var i=this;this.element.classList.toggle(Nl,this.linear),this.stepperItemElements.forEach(function(e,t){e.classList.toggle("e-previous",t===i.activeStep-1),e.classList.toggle("e-next",t===i.activeStep+1)})},H.prototype.removeItemElements=function(){for(var e=0;e<this.stepperItemElements.length;e++)N.remove(this.stepperItemElements[parseInt(e.toString(),10)]);this.stepperItemElements=[]},H.prototype.nextStep=function(){this.activeStep!==this.steps.length-1&&this.navigateToStep(this.activeStep+1,null,null,!1)},H.prototype.previousStep=function(){0<this.activeStep&&this.navigateToStep(this.activeStep-1,null,null,!1)},H.prototype.reset=function(){var e;0===this.activeStep?this.updateStepInteractions():(e=!!this.stepperItemElements[0].classList.contains(ol),this.navigateToStep(e?-1:0,null,null,!1))},H.prototype.refreshProgressbar=function(){this.stepperItemList&&this.progressbar&&this.setProgressPosition(this.element),this.navigateToStep(this.activeStep,null,null,!1,!1)},H.prototype.updateElementClassArray=function(){N.removeClass([this.element],[hl,al,"e-steps-focus",pl,ul,"e-label-top","e-label-bottom","e-label-start","e-label-end",Sl,Il,ml,fl,Nl])},H.prototype.destroy=function(){kl.prototype.destroy.call(this),this.unWireEvents(),this.unWireItemsEvents(),this.removeItemElements(),this.clearTemplate(),this.stepperItemList&&N.remove(this.stepperItemList),this.stepperItemList=null,this.progressStep&&N.remove(this.progressStep),this.progressStep=null,this.progressbar=null,this.progressBarPosition=null,this.stepperItemContainer=null,this.textContainer=null,this.labelContainer=null,this.updateElementClassArray(),this.element.removeAttribute("aria-label"),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),this.keyboardModuleStepper&&this.keyboardModuleStepper.destroy(),this.keyboardModuleStepper=null},H.prototype.wireKeyboardEvent=function(){this.keyboardModuleStepper=new N.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},H.prototype.keyActionHandler=function(e){if(!this.readOnly)switch(e.action){case"uparrow":case"downarrow":case"leftarrow":case"rightarrow":case"tab":case"shiftTab":this.handleNavigation(this.enableRtl&&this.element.classList.contains(fl)?"leftarrow"===e.action||"tab"===e.action||"uparrow"===e.action:"rightarrow"===e.action||"tab"===e.action||"downarrow"===e.action,e);break;case"space":case"enter":case"escape":this.handleNavigation(null,e);break;case"home":case"end":this.handleNavigation(null,e,this.enableRtl)}},H.prototype.handleNavigation=function(e,t,i){this.isKeyNavFocus=!0,this.element.classList.add("e-steps-focus");var s=(s=this.element.querySelector("."+rl))||this.element.querySelector("."+il),n=Array.prototype.slice.call(this.stepperItemList.children),r=n.indexOf(s);if("tab"===t.action||"shiftTab"===t.action||"downarrow"===t.action||"uparrow"===t.action||"space"===t.action||"home"===t.action||"end"===t.action)if("tab"===t.action&&r===n.length-1||"shiftTab"===t.action&&0===r){if(s.classList.contains(rl))return void this.updateStepFocus()}else t.preventDefault();if("escape"===t.action&&(n[parseInt(r.toString(),10)].classList.remove(rl),this.element.classList.remove("e-steps-focus")),"space"!==t.action&&"enter"!==t.action){for(var s=r,r=e?r+1:r-1;0<=r&&r<n.length&&n[parseInt(r.toString(),10)].classList.contains(ol);)r=e?r+1:r-1;r=r<0?0:r>n.length-1?n.length-1:r,n[parseInt(s.toString(),10)].classList.contains(rl)&&n[parseInt(s.toString(),10)].classList.remove(rl),0<=(r="home"!==t.action&&"end"!==t.action?r:"home"===t.action?i?n.length-1:0:i?0:n.length-1)&&r<n.length&&n[parseInt(r.toString(),10)].classList.add(rl)}else"space"!==t.action&&"enter"!==t.action||(s=!1,this.linear&&(i=this.activeStep-r,1!==Math.abs(i))||(this.navigateToStep(r,null,null,!0),s=!0),s&&(this.updateStepFocus(),this.stepperItemElements[r].focus()))},H.prototype.renderStepperItems=function(e,t){this.updateElementClassArray(),this.removeItemElements(),this.element.querySelector(".e-stepper-progressbar").remove(),e&&this.updatePosition(),t&&this.updateStepType(),this.readOnly&&!this.element.classList.contains(al)&&this.element.classList.add(al),this.enableRtl&&!this.element.classList.contains(hl)&&this.element.classList.add(hl),this.updateOrientaion(this.element),this.renderItems(),this.renderProgressBar(this.element),this.checkValidStep(),this.updateAnimation(),this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},H.prototype.updateDynamicSteps=function(e,t){if(e instanceof Array&&t instanceof Array)this.renderStepperItems(!0,!0);else for(var i=Object.keys(e),s=0;s<i.length;s++)for(var n=parseInt(Object.keys(e)[s],10),r=Object.keys(e[n]).length,l=0;l<r;l++){var o=Object.keys(e[n])[l];"status"===o?this.activeStep===n?this.navigationHandler(n,e[n].status):this.steps[n].status=t[n].status:(this.removeItemElements(),this.renderItems(),this.updateStepperStatus()),"label"===o&&(this.steps[n].iconCss||this.steps[n].text)&&"default"===this.stepType.toLowerCase()&&this.refreshProgressbar(),this.updateStepInteractions(),this.checkValidStep()}},H.prototype.updateDynamicActiveStep=function(e,t){this.activeStep=e>this.steps.length-1||e<-1?t:this.activeStep,0<=this.activeStep&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(ol)&&(this.activeStep=t),this.linear?(e=t-this.activeStep,1===Math.abs(e)&&this.navigateToStep(this.activeStep,null,null,!0)):this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},H.prototype.updateDynamicCssClass=function(e,t){t&&N.removeClass([this.element],t.trim().split(" ")),e&&N.addClass([this.element],e.trim().split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?El+" "+this.cssClass:El})},H.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"steps":this.updateDynamicSteps(e.steps,t.steps);break;case"orientation":this.updateOrientaion(this.element),this.renderStepperItems(!0);break;case"activeStep":this.updateDynamicActiveStep(e.activeStep,t.activeStep);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"](hl);break;case"readOnly":this.element.classList[this.readOnly?"add":"remove"](al);break;case"cssClass":this.updateDynamicCssClass(e.cssClass,t.cssClass);break;case"labelPosition":this.renderStepperItems(!0);break;case"showTooltip":this.updateTooltip();break;case"stepType":this.renderStepperItems(!0,!0);break;case"template":this.updateTemplateFunction(),this.updateContent();break;case"animation":this.updateAnimation();break;case"linear":this.updateStepInteractions()}},M([N.Property(0)],H.prototype,"activeStep",void 0),M([N.Complex({},Ol)],H.prototype,"animation",void 0),M([N.Property(!1)],H.prototype,"linear",void 0),M([N.Property(!1)],H.prototype,"showTooltip",void 0),M([N.Property("")],H.prototype,"template",void 0),M([N.Property("")],H.prototype,"tooltipTemplate",void 0),M([N.Property(a.StepLabelPosition.Bottom)],H.prototype,"labelPosition",void 0),M([N.Property(a.StepType.Default)],H.prototype,"stepType",void 0),M([N.Event()],H.prototype,"stepChanged",void 0),M([N.Event()],H.prototype,"stepChanging",void 0),M([N.Event()],H.prototype,"stepClick",void 0),M([N.Event()],H.prototype,"beforeStepRender",void 0);var kl,Ll=M([N.NotifyPropertyChanges],H);function H(e,t){e=kl.call(this,e,t)||this;return e.stepperItemElements=[],e}a.Accordion=e,a.AccordionActionSettings=ei,a.AccordionAnimationSettings=si,a.AccordionItem=li,a.ActionSettings=tn,a.AppBar=D,a.Breadcrumb=f,a.BreadcrumbItem=Fn,a.Carousel=kn,a.CarouselItem=Nr,a.ContextMenu=n,a.FieldSettings=je,a.FieldsSettings=Zs,a.HScroll=te,a.Header=rs,a.Item=Ot,a.Menu=q,a.MenuAnimationSettings=Ke,a.MenuItem=We,a.NodeAnimationSettings=rn,a.Sidebar=c,a.Step=Xr,a.Stepper=Ll,a.StepperAnimationSettings=Ol,a.StepperBase=Qr,a.Tab=fi,a.TabActionSettings=$i,a.TabAnimationSettings=is,a.TabItem=as,a.Toolbar=Lt,a.TreeView=o,a.VScroll=ge,a.addScrolling=ve,a.destroyScroll=be,Object.defineProperty(a,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-notifications")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-lists","@syncfusion/ej2-popups","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-inputs","@syncfusion/ej2-notifications"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Lists,e.ej2Popups,e.ej2Buttons,e.ej2Data,e.ej2Inputs,e.ej2Notifications)}(this,function(a,w,k,U,R,x,B,V){"use strict";j=function(e,t){return(j=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 j,F,q=function(e,t){function i(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},W="e-rtl",_="e-overlay",z="e-nav-arrow",K="e-nav-right-arrow",X="e-nav-left-arrow",Y="e-scroll-nav",G="e-scroll-right-nav",Q="e-scroll-left-nav",J="e-scroll-device",Z="e-scroll-overlay",$="e-scroll-right-overlay",ee="e-scroll-left-overlay",te=(F=w.Component,q(t,F),t.prototype.preRender=function(){this.browser=w.Browser.info.name,this.resizeContext=this.resizeHandler.bind(this),this.browserCheck="mozilla"===this.browser,this.isDevice=w.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=w.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(W)},t.prototype.render=function(){this.touchModule=new w.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),w.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.element&&this.element.closest(".e-toolbar")&&window.addEventListener("resize",this.resizeContext),this.isDevice?(this.element.classList.add(J),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},t.prototype.setScrollState=function(){w.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},t.prototype.initialize=function(){for(var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"}),i=(t.setAttribute("tabindex","-1"),this.element),s=0,n=[].slice.call(i.children);s<n.length;s++){var r=n[s];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},t.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},t.prototype.getModuleName=function(){return"hScroll"},t.prototype.destroy=function(){var e=this.element,t=(e.style.display="",e.classList.remove("e-hscroll"),e.classList.remove(J),e.classList.remove(W),w.selectAll(".e-"+e.id+"_nav."+Y,e)),i=w.selectAll("."+Z,e);[].slice.call(i).forEach(function(e){w.detach(e)});for(var s=0,n=[].slice.call(this.scrollItems.children);s<n.length;s++){var r=n[s];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),w.detach(this.scrollEle),0<t.length&&(w.detach(t[0]),w.isNullOrUndefined(t[1])||w.detach(t[1])),w.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.element&&this.element.closest(".e-toolbar")&&window.removeEventListener("resize",this.resizeContext),this.resizeContext=null,this.touchModule.destroy(),this.touchModule=null,F.prototype.destroy.call(this)},t.prototype.disable=function(t){var e=w.selectAll(".e-scroll-nav:not(."+_+")",this.element);t?this.element.classList.add(_):this.element.classList.remove(_),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},t.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:Z+" "+$}),s="e-"+e.id.concat("_nav "+Y+" "+G),t=this.createElement("div",{id:t.concat("_right"),className:s}),s=this.createElement("div",{className:K+" "+z+" e-icons"}),s=(t.appendChild(s),this.createElement("div",{className:Z+" "+ee}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(s,e.firstChild),this.eventBinding([t])},t.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+Y+" "+G),s={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},i=this.createElement("div",{className:i,attrs:s}),s=(i.setAttribute("aria-disabled","false"),this.createElement("div",{className:K+" "+z+" e-icons"})),n="e-"+e.id.concat("_nav "+Y+" "+Q),t={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},n=this.createElement("div",{className:n+" "+_,attrs:t}),t=(n.setAttribute("aria-disabled","true"),this.createElement("div",{className:X+" "+z+" e-icons"}));n.appendChild(t),i.appendChild(s),e.appendChild(i),e.insertBefore(n,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),n.classList.add("e-ie-align")),this.eventBinding([i,n])},t.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},t.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},t.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new w.Touch(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),w.EventHandler.add(e,"click",t.clickEventHandler,t)})},t.prototype.repeatScroll=function(){clearInterval(this.timeout)},t.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,Y)?i.firstElementChild:i,s=10;this.timeout=window.setInterval(function(){t.eleScrolling(s,i,!0)},50)},t.prototype.contains=function(e,t){return e.classList.contains(t)},t.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains(Y)&&(n=t.querySelector("."+z).classList),this.contains(s,W)&&this.browserCheck&&(e=-e),!this.contains(s,W)||this.browserCheck||this.ieCheck?n.contains(K)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains(X)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},t.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},t.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Left"===t.swipeDirection?s.scrollLeft+=n*e:"Right"===t.swipeDirection&&(s.scrollLeft-=n*e),r-=.5,window.requestAnimationFrame(i))}var s=this.scrollEle,n=t.velocity<=1?t.distanceX/(10*t.velocity):t.distanceX/t.velocity,r=.5;i()},t.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e,this.enableRtl&&0<this.scrollEle.scrollLeft&&(this.scrollEle.scrollLeft=0)},t.prototype.frameScrollRequest=function(i,s,e){var n,r=this,l=10;e?this.scrollUpdating(i,s):(this.customStep||[].slice.call(w.selectAll("."+Z,this.element)).forEach(function(e){i-=e.offsetWidth}),(n=function(){var e,t=r.contains(r.element,W)&&r.browserCheck?(e=-i,-l):(e=i,l);e<l?window.cancelAnimationFrame(t):(r.scrollUpdating(t,s),i-=t,window.requestAnimationFrame(n))})())},t.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,W)&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},t.prototype.arrowDisabling=function(e,t){var i;this.isDevice?(i=(w.isNullOrUndefined(e)?t:e).querySelector("."+z),w.isNullOrUndefined(e)?w.classList(i,[K],[X]):w.classList(i,[X],[K])):e&&t&&(e.classList.add(_),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(_),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},t.prototype.resizeHandler=function(e){this.scrollHandler(e)},t.prototype.scrollHandler=function(e){var e=e.target,t=e.offsetWidth,i=(this.element,this.element.querySelector("."+Q)),s=this.element.querySelector("."+G),n=this.element.querySelector("."+ee),r=this.element.querySelector("."+$),l=e.scrollLeft;l<=0&&(l=-l),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(n=this.element.querySelector("."+$),r=this.element.querySelector("."+ee)),n.style.width=l<40?l+"px":"40px",e.scrollWidth-Math.ceil(t+l)<40?r.style.width=e.scrollWidth-Math.ceil(t+l)+"px":r.style.width="40px"),0===l?this.arrowDisabling(i,s):Math.ceil(t+l+.1)>=e.scrollWidth?this.arrowDisabling(s,i):(n=this.element.querySelector("."+Y+"."+_))&&(n.classList.remove(_),n.setAttribute("aria-disabled","false"),n.setAttribute("tabindex","0"))},t.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(W):this.element.classList.remove(W)}},e([w.Property(null)],t.prototype,"scrollStep",void 0),e([w.NotifyPropertyChanges],t));function t(e,t){return F.call(this,e,t)||this}ie=function(e,t){return(ie=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 ie,se,q=function(e,t){function i(){this.constructor=e}ie(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},ne="e-rtl",re="e-overlay",le="e-nav-arrow",oe="e-nav-up-arrow",ae="e-nav-down-arrow",de="e-scroll-nav",he="e-scroll-up-nav",ce="e-scroll-down-nav",pe="e-scroll-device",ue="e-scroll-overlay",me="e-scroll-up-overlay",fe="e-scroll-down-overlay",ge=(se=w.Component,q(i,se),i.prototype.preRender=function(){this.browser=w.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=w.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=w.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(ne)},i.prototype.render=function(){this.touchModule=new w.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),w.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(pe),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),w.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){w.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){for(var e=w.createElement("div",{className:"e-vscroll-content"}),t=w.createElement("div",{className:"e-vscroll-bar"}),i=(t.setAttribute("tabindex","-1"),this.element),s=0,n=[].slice.call(i.children);s<n.length;s++){var r=n[s];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflow="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var e=this.element,t=(e.style.display="",w.removeClass([this.element],["e-vscroll",pe,ne]),w.selectAll(".e-"+e.id+"_nav."+de,e)),i=w.selectAll("."+ue,e);[].slice.call(i).forEach(function(e){w.detach(e)});for(var s=0,n=[].slice.call(this.scrollItems.children);s<n.length;s++){var r=n[s];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),w.detach(this.scrollEle),0<t.length&&(w.detach(t[0]),w.isNullOrUndefined(t[1])||w.detach(t[1])),w.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,se.prototype.destroy.call(this)},i.prototype.disable=function(t){var e=w.selectAll(".e-scroll-nav:not(."+re+")",this.element);t?this.element.classList.add(re):this.element.classList.remove(re),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},i.prototype.createOverlayElement=function(e){var t=e.id.concat("_nav"),i=w.createElement("div",{className:ue+" "+fe}),s="e-"+e.id.concat("_nav "+de+" "+ce),t=w.createElement("div",{id:t.concat("down"),className:s}),s=w.createElement("div",{className:ae+" "+le+" e-icons"}),s=(t.appendChild(s),w.createElement("div",{className:ue+" "+me}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(s,e.firstChild),this.eventBinding([t])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+de+" "+ce),i=w.createElement("div",{id:t.concat("_down"),className:i}),s=(i.setAttribute("aria-disabled","false"),w.createElement("div",{className:ae+" "+le+" e-icons"})),n="e-"+e.id.concat("_nav "+de+" "+he),t=w.createElement("div",{id:t.concat("_up"),className:n+" "+re}),n=(t.setAttribute("aria-disabled","true"),w.createElement("div",{className:oe+" "+le+" e-icons"}));t.appendChild(n),i.appendChild(s),i.setAttribute("tabindex","0"),e.appendChild(i),e.insertBefore(t,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),t.classList.add("e-ie-align")),this.eventBinding([i,t])},i.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new w.Touch(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),w.EventHandler.add(e,"click",t.clickEventHandler,t)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,de)?i.firstElementChild:i,s=10;this.timeout=window.setInterval(function(){t.eleScrolling(s,i,!0)},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;(s=s.contains(de)?t.querySelector("."+le).classList:s).contains(ae)?this.frameScrollRequest(e,"add",i):s.contains(oe)&&this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,0<e.deltaY?"add":"",!1)},i.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Up"===t.swipeDirection?s.scrollTop+=n*e:"Down"===t.swipeDirection&&(s.scrollTop-=n*e),r-=.02,window.requestAnimationFrame(i))}var s=this.scrollEle,n=t.velocity<=1?t.distanceY/(10*t.velocity):t.distanceY/t.velocity,r=.5;i()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(t,e,i){var s,n=this,r=10;i?this.scrollUpdating(t,e):(this.customStep||[].slice.call(w.selectAll("."+ue,this.element)).forEach(function(e){t-=e.offsetHeight}),(s=function(){t<r?window.cancelAnimationFrame(r):(n.scrollUpdating(r,e),t-=r,window.requestAnimationFrame(s))})())},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+i:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-i)},i.prototype.arrowDisabling=function(e,t){var i;this.isDevice?(i=(w.isNullOrUndefined(e)?t:e).querySelector("."+le),w.isNullOrUndefined(e)?w.classList(i,[ae],[oe]):w.classList(i,[oe],[ae])):(e.classList.add(re),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(re),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var e=e.target,t=e.offsetHeight,i=this.element.querySelector("."+he),s=this.element.querySelector("."+ce),n=this.element.querySelector("."+me),r=this.element.querySelector("."+fe),l=e.scrollTop;l<=0&&(l=-l),this.isDevice&&(n.style.height=l<40?l+"px":"40px",e.scrollHeight-Math.ceil(t+l)<40?r.style.height=e.scrollHeight-Math.ceil(t+l)+"px":r.style.height="40px"),0===l?this.arrowDisabling(i,s):Math.ceil(t+l+.1)>=e.scrollHeight?this.arrowDisabling(s,i):(n=this.element.querySelector("."+de+"."+re))&&(n.classList.remove(re),n.setAttribute("aria-disabled","false"),n.setAttribute("tabindex","0"))},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(ne):this.element.classList.remove(ne)}},e([w.Property(null)],i.prototype,"scrollStep",void 0),e([w.NotifyPropertyChanges],i));function i(e,t){return se.call(this,e,t)||this}function ve(e,t,i,s,n,r){var l,o=t.parentElement,a="vscroll"===s?(l=r||t.getBoundingClientRect().height,i.getBoundingClientRect().height):(l=t.getBoundingClientRect().width,i.getBoundingClientRect().width);return l<a?ye(e,t,i,s,n,r):o&&(o=o.getBoundingClientRect().width)<l&&"hscroll"===s?(t.style.maxWidth=(a=o)+"px",ye(e,t,i,s,n,r)):i}function ye(e,t,i,s,n,r){e=e("div",{className:"e-menu-"+s});return t.appendChild(e),e.appendChild(i),r?(e.style.overflow="hidden",e.style.height=r+"px"):(e.style.maxHeight=t.style.maxHeight,t.style.overflow="hidden"),"vscroll"===s?new ge({enableRtl:n},e).scrollStep=w.select(".e-"+s+"-bar",t).offsetHeight/2:new te({enableRtl:n},e).scrollStep=w.select(".e-"+s+"-bar",t).offsetWidth,e}function be(e,t,i){var s;e&&((s=w.select(".e-menu-parent",t))?i&&i!==s||(e.destroy(),t.parentElement.appendChild(s),w.detach(t)):(e.destroy(),w.detach(t)))}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)};var Se,Ce,q=function(e,t){function i(){this.constructor=e}Se(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Ie="enter",xe="escape",g="e-focused",Ee="e-menu-header",v="e-selected",Ne="e-separator",Oe="uparrow",we="downarrow",ke="leftarrow",Le="rightarrow",Ae="home",Te="end",De="tab",Pe="e-caret",Me="e-menu-item",He="e-disabled",Ue="e-menu-hide",Re="e-icons",Be="e-rtl",Ve="e-menu-popup",je=(Ce=w.ChildProperty,q(Fe,Ce),e([w.Property("id")],Fe.prototype,"itemId",void 0),e([w.Property("parentId")],Fe.prototype,"parentId",void 0),e([w.Property("text")],Fe.prototype,"text",void 0),e([w.Property("iconCss")],Fe.prototype,"iconCss",void 0),e([w.Property("url")],Fe.prototype,"url",void 0),e([w.Property("separator")],Fe.prototype,"separator",void 0),e([w.Property("items")],Fe.prototype,"children",void 0),Fe);function Fe(){return null!==Ce&&Ce.apply(this,arguments)||this}qe=w.ChildProperty,q(_e,qe),e([w.Property(null)],_e.prototype,"iconCss",void 0),e([w.Property("")],_e.prototype,"id",void 0),e([w.Property(!1)],_e.prototype,"separator",void 0),e([w.Collection([],_e)],_e.prototype,"items",void 0),e([w.Property("")],_e.prototype,"text",void 0),e([w.Property("")],_e.prototype,"url",void 0),e([w.Property()],_e.prototype,"htmlAttributes",void 0);var qe,We=_e;function _e(){return null!==qe&&qe.apply(this,arguments)||this}ze=w.ChildProperty,q(Xe,ze),e([w.Property("SlideDown")],Xe.prototype,"effect",void 0),e([w.Property(400)],Xe.prototype,"duration",void 0),e([w.Property("ease")],Xe.prototype,"easing",void 0);var ze,Ke=Xe;function Xe(){return null!==ze&&ze.apply(this,arguments)||this}Ye=w.Component,q(s,Ye),s.prototype.preRender=function(){if(this.isMenu||(i=void 0,"EJS-CONTEXTMENU"===this.element.tagName?(i=this.createElement("ul",{id:w.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()}),t=w.getValue("ej2_instances",this.element),w.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=i,w.setValue("ej2_instances",t,this.element)):(i=this.createElement("ul",{id:w.getUniqueID(this.getModuleName())}),w.append([].slice.call(this.element.cloneNode(!0).children),i),(t=this.element.nextElementSibling)?this.element.parentElement.insertBefore(i,t):this.element.parentElement.appendChild(i),this.clonedElement=i),this.clonedElement.style.display="none"),"EJS-MENU"===this.element.tagName){for(var e=this.element,t=w.getValue("ej2_instances",e),i=this.createElement("ul"),s=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),n=0,r=e.attributes.length;n<r;n++)i.setAttribute(e.attributes[n].nodeName,e.attributes[n].nodeValue);e.parentNode.insertBefore(s,e),w.detach(e),e=i,s.appendChild(e),w.setValue("ej2_instances",t,e),this.clonedElement=s,this.element=e,this.element.id||(this.element.id=w.getUniqueID(this.getModuleName()))}},s.prototype.render=function(){var e=this,t=(this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete(),this.getWrapper());this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){ve(e.createElement,t,e.element,"hscroll",e.enableRtl)})},s.prototype.enableTouchScroll=function(r){var l=0;this.touchStartFn=function(e){l=e.touches[0].clientY},this.touchMoveFn=function(e){var t=e.touches[0].clientY,i=l-t,s=0===r.scrollTop,n=r.scrollTop+r.clientHeight===r.scrollHeight;(s&&i<0||n&&0<i)&&e.preventDefault(),l=t},r.addEventListener("touchstart",this.touchStartFn,{passive:!1}),r.addEventListener("touchmove",this.touchMoveFn,{passive:!1})},s.prototype.touchOutsideHandler=function(e){e=e.target;w.closest(e,".e-"+this.getModuleName()+"-wrapper")||this.closeMenu()},s.prototype.initialize=function(){var e=this.getWrapper();e||(e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.isMenu?this.element.parentElement.insertBefore(e,this.element):this.getAppendToElement().appendChild(e)),this.cssClass&&w.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&e.classList.add(Be),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick,w.isNullOrUndefined(this.animation)&&(this.animation=new w.Animation({}))},s.prototype.renderItems=function(){this.items.length||(e=k.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}}),this.setProperties({items:e},!0),w.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="");var e=this.createItems(this.items);w.append(Array.prototype.slice.call(e.children),this.element),this.element.classList.add("e-menu-parent"),this.isMenu?(!this.hamburgerMode&&this.element.classList.contains("e-vertical")&&this.setBlankIconStyle(this.element),this.enableScrolling&&(e=this.getWrapper(),this.element.classList.contains("e-vertical")?ve(this.createElement,e,this.element,"vscroll",this.enableRtl):ve(this.createElement,e,this.element,"hscroll",this.enableRtl))):(this.element.parentElement.setAttribute("role","dialog"),this.element.parentElement.setAttribute("aria-label","context menu"))},s.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var t=void 0,i=w.selectAll(this.target),s=0,n=i.length;s<n;s++)t=i[s],this.isMenu?w.EventHandler.add(t,"click",this.menuHeaderClickHandler,this):w.Browser.isIos?new w.Touch(t,{tapHold:this.touchHandler.bind(this)}):(this.delegateContextMenuHandler=this.cmenuHandler.bind(this),w.EventHandler.add(t,"contextmenu",this.delegateContextMenuHandler,this));if(this.targetElement=t,!this.isMenu){w.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this),this.scrollParents=U.getScrollableParent(this.targetElement).slice(),this.delegateParentScrollHandler=this.scrollHandler.bind(this);for(var r=0,l=this.scrollParents;r<l.length;r++){var o=l[r];w.EventHandler.add(o,"scroll",this.delegateParentScrollHandler,this)}}}w.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),this.delegateDomKeyHandler=this.domKeyHandler.bind(this),w.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),w.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this),w.EventHandler.add(document,"keydown",this.delegateDomKeyHandler,this),this.isMenu)||this.target||(this.delegateScrollHandler=this.scrollHandler.bind(this),w.EventHandler.add(document,"scroll",this.delegateScrollHandler,this)),this.delegateClickHandler=this.clickHandler.bind(this),w.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=w.rippleEffect(e,{selector:"."+Me}),!this.isMenu&&this.enableScrolling&&(this.enableTouchScroll(e),this.delegateTouchOutsideHandler=this.touchOutsideHandler.bind(this),document.addEventListener("touchstart",this.delegateTouchOutsideHandler,{passive:!0}))},s.prototype.wireKeyboardEvent=function(e){var t={downarrow:we,uparrow:Oe,enter:Ie,leftarrow:ke,rightarrow:Le,escape:xe};this.isMenu&&(t.home=Ae,t.end=Te,t.tab=De),new w.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:t})},s.prototype.mouseDownHandler=function(e){w.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||w.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},s.prototype.keyHandler=function(e){38!==e.keyCode&&40!==e.keyCode||e.target&&(e.target.classList.contains("e-contextmenu")||e.target.classList.contains("e-menu-item"))&&e.preventDefault()},s.prototype.domKeyHandler=function(e){27===e.keyCode&&(this.isMenuVisible()&&e.stopImmediatePropagation(),e.action=xe,this.leftEscKeyHandler(e));var t=e.key?"ArrowDown"===e.key:40===e.keyCode,i=e.key?"ArrowUp"===e.key:38===e.keyCode;(t||i)&&(i=document.activeElement)&&(w.closest(i,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||w.closest(i,".e-menu-item")||w.closest(i,".e-menu-parent"))&&e.preventDefault(),t&&w.closest(this.element,".e-popup-open")&&!w.closest(document.activeElement,"#"+this.element.id)&&(i=document.activeElement)&&(e="INPUT"===i.tagName||"TEXTAREA"===i.tagName||"true"===i.contentEditable,"true"===i.getAttribute("aria-expanded"))&&!e&&(t=this.element,i=w.select(".e-menu-item",t))&&(t.focus(),i.classList.add("e-focused"),this.skipNextArrowDown=!0)},s.prototype.keyBoardHandler=function(e){if(e.action===we&&this.skipNextArrowDown)this.skipNextArrowDown=!1;else{var t="",i=e.target,s=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&i.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([g,v],[w.closest(i,".e-"+this.getModuleName()+"-wrapper")]),this.isKBDAction=!0,s)switch(e.action){case Le:t=Le,e.action=we;break;case ke:t=ke,e.action=Oe;break;case we:t=we,e.action=Le;break;case Oe:t=Oe,e.action=""}else if(this.enableRtl)switch(e.action){case ke:s=!0,t=ke,e.action=Le;break;case Le:s=!0,t=Le,e.action=ke}switch(e.action){case we:case Oe:case Te:case Ae:case De:this.upDownKeyHandler(e);break;case Le:this.rightEnterKeyHandler(e);break;case ke:this.leftEscKeyHandler(e);break;case Ie:this.hamburgerMode&&"SPAN"===i.tagName&&i.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e)}this.isAnimationNone&&(this.isKBDAction=!1),s&&(e.action=t)}},s.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i=e.action===we||e.action===Ae||e.action===De?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,g),n=(n&&(e.action!==Te&&e.action!==Ae&&(s=this.getIdx(t,n)),n.classList.remove(g),e.action!==Te)&&e.action!==Ae&&(e.action===we?s++:s--,s===(e.action===we?t.childElementCount:-1))&&(s=i),t.children[s]),s=this.isValidLI(n,s,e.action),i=(t.children[s].classList.add(g),t.children[s]);(w.closest(this.element,".e-popup")&&(n=i.querySelector('[tabindex], span[tabindex], a, button, [tabindex]:not([tabindex="-1"])'),e=this.element.id.includes("_cf_menu")&&this.element.parentElement.classList.contains("e-cf-menu"),n)&&!e?n:i).focus()},s.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx(),n=i===we||i===Ae||i===De?0:s.childElementCount-1;return(e.classList.contains(Ne)||e.classList.contains(He)||e.classList.contains(Ue))&&(i===we&&t===s.childElementCount-1||i===Oe&&0===t?t=n:i===we||i===Le||"tab"===i&&e.classList.contains(Ne)?t++:t--),t=(e=s.children[t])&&(e.classList.contains(Ne)||e.classList.contains(He)||e.classList.contains(Ue))?this.isValidLI(e,t,i):t},s.prototype.getUlByNavIdx=function(e){var t,i,s=this;return void 0===e&&(e=this.navIdx.length),this.isMenu?(t=[this.getWrapper()].concat([].slice.call(w.selectAll("."+Ve)))[e],i=[],w.selectAll("."+Ve).forEach(function(e){(s.element.id===e.id.split("-")[2]||e.id.split("-")[2]+"-"+e.id.split("-")[3])&&i.push(e)}),t=[this.getWrapper()].concat([].slice.call(i))[e],w.isNullOrUndefined(t)?null:w.select(".e-menu-parent",t)):this.getAppendToElement().contains(this.element)||0!==e?this.getWrapper().children[e]:null},s.prototype.rightEnterKeyHandler=function(e){var t=this.getUlByNavIdx(),i=this.getLIByClass(t,g);if(i){var t=this.getIdx(t,i),s=this.navIdx.concat(t),n=this.getItem(s);if(n.items.length)this.navIdx.push(t),this.keyType="right",this.action=e.action,this.openMenu(i,n,-1,-1,e);else if(e.action===Ie){this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([v],[this.getWrapper()]):i.classList.remove(g),i.classList.add(v),this.trigger("select",{element:i,item:n,event:e});s=i.querySelector(".e-menu-url");if(n.url&&s)switch(s.getAttribute("target")){case"_blank":window.open(n.url,"_blank");break;case"_parent":window.parent.location.href=n.url;break;default:window.location.href=n.url}this.closeMenu(null,e);t=this.getLIByClass(this.getUlByNavIdx(),v);t&&(t.classList.add(g),t.focus())}}},s.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):e.action===xe&&this.closeMenu(null,e)},s.prototype.scrollHandler=function(e){this.closeMenu(null,e)},s.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},s.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&(this.openMenu(null,null,this.pageY,this.pageX,e),this.isCmenuOpened=!0),this.isCMenu=!1)},s.prototype.closeMenu=function(o,a,d){var e,h,c,t,p,i,s,n,u,m,f=this;void 0===o&&(o=0),void 0===a&&(a=null),this.isMenuVisible()&&(e=void 0,c=this.getWrapper(),t=void 0,i=this.getPopups(),s=!1,n=this.isMenu?i.length+1:c.childElementCount,u=this.isMenu&&1!==n?w.select(".e-ul",i[n-2]):w.selectAll(".e-menu-parent",c)[n-1],this.isMenu&&u.classList.contains("e-menu")&&((e=this.getLIByClass(u,v))&&e.classList.remove(v),s=!0),s||(m=a&&a.target&&this.getLI(a.target),this.cli=m||u.children[0],h=this.navIdx.length?this.getItem(this.navIdx):null,p=(h||this).items,t={element:u,parentItem:h,items:p,event:a,cancel:!1,isFocused:!0},this.trigger("beforeClose",t,function(e){var t,i,s,n="",r=!e.cancel,l=((r||f.isCMenu)&&(f.isMenu?(t=w.closest(u,"."+Ve),f.hamburgerMode&&(t.parentElement.style.minHeight="",w.closest(u,".e-menu-item").setAttribute("aria-expanded","false")),f.unWireKeyboardEvent(t),be(w.getInstance(t.children[0],ge),t.children[0]),(l=w.getInstance(t,U.Popup)).hide(),n=t.id,l.destroy(),w.detach(t)):(f.isContextMenuClosed=!1,f.toggleAnimation(u,!1)),f.trigger("onClose",{element:u,parentItem:h,items:p}),f.navIdx.pop(),0===f.navIdx.length&&a&&"keyup"===a.type&&(f.showSubMenu=!1),f.isMenu||(w.EventHandler.remove(u,"keydown",f.keyHandler),"right"===f.keyType&&(f.keyType=""))),f.updateReactTemplate(),f.getWrapper()&&f.getUlByNavIdx()),n=(f.isCMenu&&(f.canOpen(a.target)&&f.openMenu(null,null,f.pageY,f.pageX,a),f.isCMenu=!1),f.isMenu&&l&&n.length?(t=new RegExp("(.*)-ej2menu-"+f.element.id+"-popup").exec(n)[1],i=l.querySelector('[id="'+t+'"]'),s=m&&l.querySelector('[id="'+m.id+'"]')):l&&(i=l.querySelector(".e-menu-item.e-selected"),s=m&&l.querySelector('[id="'+m.id+'"]')),m&&m.querySelectorAll(".e-menu-item"));r&&f.hamburgerMode&&o&&!n.length?f.afterCloseMenu(a):r&&!f.hamburgerMode&&i&&!s&&"left"!==f.keyType&&(f.navIdx.length||!f.isMenu&&0===f.navIdx.length)?(t=a&&a.target.classList&&(a.target.classList.contains("e-vscroll")||a.target.classList.contains("e-scroll-nav"))?w.closest(a.target,".e-menu-wrapper"):null)?(t=t.querySelector(".e-menu-item"),(f.showItemOnClick||t&&f.getIndex(t.id,!0).length<=f.navIdx.length)&&f.closeMenu(f.navIdx[f.navIdx.length-1],a,!0)):a&&a.target.classList&&a.target.classList.contains("e-nav-arrow")||f.closeMenu(f.navIdx[f.navIdx.length-1],a):r&&!d&&!o&&(f.hamburgerMode&&f.navIdx.length||1===f.navIdx.length&&m&&l!==m.parentElement)||r&&w.isNullOrUndefined(o)&&f.navIdx.length?f.closeMenu(null,a):!r||f.isMenu||o||0!==f.navIdx.length||f.isMenusClosed||f.isCmenuHover?r&&f.isMenu&&a&&a.target&&0!==f.navIdx.length&&w.closest(a.target,".e-menu-parent.e-control")?f.closeMenu(0,a):r&&!f.isMenu&&w.selectAll(".e-menu-parent",c)[o-1]&&3===a.which?f.closeMenu(null,a):(!r||"right"!==f.keyType&&"click"!==f.keyType?(n=f.getUlByNavIdx(),(i=f.getLIByClass(n,v))&&(i.setAttribute("aria-expanded","false"),i.classList.remove(v),e.isFocused&&m||"left"===f.keyType)&&(i.classList.add(g),a.target&&a.target.classList.contains("e-edit-template")||i.focus()),!r&&f.hamburgerMode&&m&&"false"===m.getAttribute("aria-expanded")&&"true"===m.getAttribute("aria-haspopup")&&(w.closest(m,".e-menu-parent.e-control")?f.navIdx=[]:f.navIdx.pop(),f.navIdx.push(f.cliIdx),s=f.getItem(f.navIdx),m.setAttribute("aria-expanded","true"),f.openMenu(m,s,-1,-1,a))):f.afterCloseMenu(a),f.navIdx.length<1&&("Hover"!==f.showSubMenuOn&&"Click"!==f.showSubMenuOn||(f.showItemOnClick=f.defaultOption,f.showSubMenuOn="Auto"))):(f.isMenusClosed=!0,f.closeMenu(0,a)),f.removeStateWrapper()})))},s.prototype.updateReactTemplate=function(){var e;this.isReact&&this.template&&0===this.navIdx.length&&(e=void 0,this.portals&&(e=this.portals.splice(0,this.items.length)),this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates())},s.prototype.getMenuItemModel=function(e,t){if(w.isNullOrUndefined(e))return null;w.isNullOrUndefined(t)&&(t=0);t=this.getFields(t);return{text:e[t.text],id:e[t.id],items:e[t.child],separator:e[t.separator],iconCss:e[t.iconCss],url:e[t.url]}},s.prototype.getPopups=function(){var t=this,i=[];return[].slice.call(document.querySelectorAll("."+Ve)).forEach(function(e){!w.isNullOrUndefined(e.querySelector("."+Me))&&t.getIndex(e.querySelector("."+Me).id,!0).length&&i.push(e)}),i},s.prototype.isMenuVisible=function(){return 0<this.navIdx.length||this.element.classList.contains("e-contextmenu")&&w.isVisible(this.element).valueOf()},s.prototype.canOpen=function(e){var t=!0;if(this.filter)for(var t=!1,i=this.filter.split(" "),s=0,n=i.length;s<n;s++)if(w.closest(e,"."+i[s])){t=!0;break}return t},s.prototype.openMenu=function(e,t,i,s,n,r){var l,o=this,a=(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=null),void 0===r&&(r=this.targetElement),this.getWrapper()),d=(this.lItem=e,""!==this.element.id?this.element.id:"menu");this.isMenusClosed=!1,w.isNullOrUndefined(i)&&(i=-1),w.isNullOrUndefined(s)&&(s=-1),e?(this.uList=this.createItems(t[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&w.Browser.isDevice&&(a.lastChild.style.display="none",l={text:t[this.getField("text")].toString(),iconCss:Re+" e-previous"},this.template&&(t.iconCss=(t.iconCss||"")+Re+" e-previous"),l=new We(this.items[0],"items",this.template?t:l,!0),(l=this.createItems([l]).children[0]).classList.add(Ee),this.uList.insertBefore(l,this.uList.children[0])),this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+Ve,id:e.id+"-ej2menu-"+d+"-popup"}),this.popupWrapper.setAttribute("role","navigation"),this.popupWrapper.setAttribute("aria-label",t.text+"-menu-popup"),(this.hamburgerMode?(i=e.offsetHeight,e):this.getAppendToElement()).appendChild(this.popupWrapper),this.isNestedOrVertical=this.element.classList.contains("e-vertical")||1!==this.navIdx.length,this.popupObj=this.generatePopup(this.popupWrapper,this.uList,e,this.isNestedOrVertical),this.template&&this.renderReactTemplates(),this.hamburgerMode?this.calculateIndentSize(this.uList,e):(this.cssClass&&w.addClass([this.popupWrapper],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,t,n,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){o.triggerBeforeOpen(e,o.uList,t,n,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,a.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){o.triggerBeforeOpen(e,o.uList,t,n,i,s,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,t,n,i,s,"none"))):(this.uList=this.element,this.uList.style.zIndex=U.getZindexPartial(r||this.element).toString(),w.isNullOrUndefined(n)?((l=document.createEvent("MouseEvents")).initEvent("click",!0,!1),(d=this.copyObject(l,{})).target=d.srcElement=r,d.currentTarget=r,this.triggerBeforeOpen(e,this.uList,t,d,i,s,"none")):this.triggerBeforeOpen(e,this.uList,t,n,i,s,"none"))},s.prototype.copyObject=function(e,t){for(var i in e)t[""+i]=e[""+i];return t},s.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),i=parseInt(i.textIndent,10),s=(this.navIdx.length<2&&!t.classList.contains("e-blankicon")?i*=2:i+=i/4,e.style.textIndent=i+"px",e.querySelectorAll(".e-blankicon"));if(s&&s.length)for(var t=e.querySelector(".e-menu-icon"),e=getComputedStyle(t),n=parseInt(e.marginRight,10)+t.offsetWidth+i,r=0;r<s.length;r++)s[r].style.textIndent=n+"px"},s.prototype.generatePopup=function(e,t,i,s){var n=this,r=new U.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:i,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:s||this.enableRtl?"none":"flip",Y:"fit"},position:s&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:t,open:function(){var e=w.select(".e-menu-vscroll",r.element),e=(e&&(e.style.height="inherit",e.style.maxHeight=""),w.select(".e-ul",r.element));r.element.style.maxHeight="",e.focus(),n.triggerOpen(e)}});return r},s.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var t=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),i=this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(this.title):this.title,i=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:i}),s=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});t.appendChild(i),t.appendChild(s),e.insertBefore(t,this.element)},s.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},s.prototype.closeHamburgerMenu=function(t){var i=this,e={element:this.element,parentItem:null,event:t,items:this.items,cancel:!1};this.trigger("beforeClose",e,function(e){e.cancel||(i.closeMenu(null,t),i.element.classList.add("e-hide-menu"),i.trigger("onClose",{element:i.element,parentItem:null,items:i.items}))})},s.prototype.callFit=function(e,t,i,s,n){return U.fit(e,null,{X:t,Y:i},{top:s,left:n})},s.prototype.triggerBeforeOpen=function(s,n,r,l,e,t,i){var o,a=this,d=s?r[this.getField("children",this.navIdx.length-1)]:this.items,h=i;this.trigger("beforeOpen",{element:n,items:d,parentItem:r,event:l,cancel:!1,top:e,left:t,showSubMenuOn:"Auto"},function(e){switch(h){case"menu":a.hamburgerMode||("Auto"!==e.showSubMenuOn&&(a.showItemOnClick=!a.defaultOption,a.showSubMenuOn=e.showSubMenuOn),a.top=e.top,a.left=e.left),a.popupWrapper.style.display="block",a.hamburgerMode||(a.popupWrapper.style.maxHeight=a.popupWrapper.getBoundingClientRect().height+"px",a.enableScrolling&&ve(a.createElement,a.popupWrapper,a.uList,"vscroll",a.enableRtl),a.checkScrollOffset(l)),a.hamburgerMode||a.left||a.top?(a.popupObj.collision={X:"none",Y:"none"},a.popupWrapper.style.display=""):(a.popupObj.refreshPosition(a.lItem,!0),a.left=parseInt(a.popupWrapper.style.left,10),a.top=parseInt(a.popupWrapper.style.top,10),a.enableRtl&&(a.left=a.isNestedOrVertical?a.left-a.popupWrapper.offsetWidth-a.lItem.parentElement.offsetWidth+2:a.left-a.popupWrapper.offsetWidth+a.lItem.offsetWidth),a.template&&(a.isReact||a.isAngular)?requestAnimationFrame(function(){a.collision(),a.popupWrapper.style.display=""}):(a.collision(),a.popupWrapper.style.display=""));break;case"none":a.top=e.top,a.left=e.left,a.isContextMenuClosed=!0,o=e.element,a.enableScrolling&&a.isCMenu&&o&&o.parentElement&&(o.style.height=o.parentElement.style.height);break;case"hamburger":e.cancel||(a.element.classList.remove("e-hide-menu"),a.triggerOpen(a.element))}var t,i;"hamburger"!==h&&(e.cancel?(a.isMenu?(a.popupObj.destroy(),w.detach(a.popupWrapper)):-1<n.className.indexOf("e-ul")&&w.detach(n),a.navIdx.pop()):a.isMenu?a.hamburgerMode?(a.popupWrapper.style.top=a.top+"px",a.popupWrapper.style.left="0px",a.toggleAnimation(a.popupWrapper)):(a.setBlankIconStyle(a.popupWrapper),a.wireKeyboardEvent(a.popupWrapper),w.rippleEffect(a.popupWrapper,{selector:"."+Me}),a.popupWrapper.style.left=a.left+"px",a.popupWrapper.style.top=a.top+"px",t="None"!==a.animationSettings.effect?{name:a.animationSettings.effect,duration:a.animationSettings.duration,timingFunction:a.animationSettings.easing}:null,a.popupObj.show(t,a.lItem),w.Browser.isDevice&&(a.popupWrapper.style.left=a.left+"px")):(a.setBlankIconStyle(a.uList),a.setPosition(a.lItem,a.uList,a.top,a.left),a.toggleAnimation(a.uList))),"right"===a.keyType&&(t=a.getUlByNavIdx(),s.classList.remove(g),a.isMenu&&1===a.navIdx.length&&a.removeLIStateByClass([v],[a.getWrapper()]),s.classList.add(v),a.action===Ie&&a.trigger("select",{element:s,item:r,event:l}),s.focus(),t=a.getUlByNavIdx(),i=a.isValidLI(t.children[0],0,a.action),t.children[i].classList.add(g),t.children[i].focus())})},s.prototype.collision=function(){var e,t=U.isCollide(this.popupWrapper,null,this.left,this.top);(this.isNestedOrVertical||this.enableRtl)&&(-1<t.indexOf("right")||-1<t.indexOf("left"))&&(this.popupObj.collision.X="none",e=w.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth,this.left=this.enableRtl?U.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-e+2),(-1<(t=U.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")||-1<t.indexOf("right"))&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},s.prototype.setBlankIconStyle=function(e){var t,i,s,n,r=[].slice.call(e.getElementsByClassName("e-blankicon"));r.length&&(e=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)"))&&(i=e.querySelector(".e-menu-icon"))&&(t=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},i=getComputedStyle(i),s=parseInt(i.fontSize,10),n=(s=parseInt(i.width,10)&&parseInt(i.width,10)>s?parseInt(i.width,10):s)+parseInt(i[t.margin],10)+parseInt(getComputedStyle(e)[t.padding],10)+"px",r.forEach(function(e){e.style[t.padding]=n}))},s.prototype.checkScrollOffset=function(e){var t,i=this.getWrapper();i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length&&(e=w.isNullOrUndefined(e)?this.element:w.closest(e.target,"."+Me),(i=w.select(".e-hscroll-bar",i)).scrollLeft>e.offsetLeft&&(i.scrollLeft-=i.scrollLeft-e.offsetLeft),(t=i.scrollLeft+i.offsetWidth)<(e=e.offsetLeft+e.offsetWidth))&&(i.scrollLeft+=e-t)},s.prototype.setPosition=function(e,t,i,s,n){void 0===n&&(n=!1);this.toggleVisiblity(t),t===this.element||-1<s&&-1<i?(-1<(l=U.isCollide(t,null,s,i)).indexOf("right")&&(s-=t.offsetWidth),-1<l.indexOf("bottom")&&(i=(o=this.callFit(t,!1,!0,i,s)).top-20)<0&&-1<(r=pageYOffset+document.documentElement.clientHeight-t.getBoundingClientRect().height)&&(i=r),-1<(l=U.isCollide(t,null,s,i)).indexOf("left")&&(s=(o=this.callFit(t,!0,!1,i,s)).left)):w.Browser.isDevice?s=!this.isMenu&&this.enableScrolling?(r=document.querySelector(".e-menu-vscroll"),i=Number(r.style.top.replace("px","")),Number(r.style.left.replace("px",""))):(i=Number(this.element.style.top.replace("px","")),Number(this.element.style.left.replace("px",""))):(r=this.enableRtl?"left":"right",i=(o=U.calculatePosition(e,r,"top")).top,s=o.left,(r=-1<(l=U.isCollide(t,null,this.enableRtl?s-t.offsetWidth:s,i)).indexOf("left")||-1<l.indexOf("right"))&&(s=(o=U.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||r)&&(s=this.enableRtl&&r?s:s-t.offsetWidth),-1<l.indexOf("bottom")&&(this.isMenu||!this.enableScrolling)&&(i=(o=this.callFit(t,!1,!0,i,s)).top)),this.toggleVisiblity(t,!1),(this.isCMenu||this.isOpenCalled)&&this.enableScrolling&&t&&(t.style.height="",t.style.top="",t.style.left="",t.style.width="",t.style.position="");var r,l,o,e=w.closest(this.element,".e-"+this.getModuleName()+"-wrapper");!this.isMenu&&this.enableScrolling&&t&&e&&0<e.offsetHeight?(r=w.closest(t,".e-menu-vscroll"),t.style.display="block",r&&be(w.getInstance(r,ge),r),l=Math.ceil(this.getMenuWidth(t,t.offsetWidth,this.enableRtl)),o=ve(this.createElement,e,t,"vscroll",this.enableRtl,e.offsetHeight),i=this.callFit(o,!1,!0,i,s).top,Object.assign(o.style,{top:i+"px",left:s+"px",width:l+"px",position:"absolute",display:n?"block":"none"})):(t.style.top=i+"px",t.style.left=s+"px")},s.prototype.getMenuWidth=function(e,t,i){e=e.getElementsByClassName(Pe)[0];return e&&(t+=parseInt(getComputedStyle(e)[i?"marginRight":"marginLeft"],10)),t<120?120:t},s.prototype.toggleVisiblity=function(e,t){e.style.visibility=(t=void 0===t?!0:t)?"hidden":"",e.style.display=t?"block":"none"},s.prototype.createItems=function(e){var i=this,s=this.navIdx?this.navIdx.length:0,t=this.getFields(s),n=this.hasField(e,this.getField("iconCss",s)),r={showIcon:n,moduleName:"menu",fields:t,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[t.id]]||(e.curData[e.fields[t.id]]=w.getUniqueID("menuitem")),w.isNullOrUndefined(e.curData.htmlAttributes)&&Object.defineProperty(e.curData,"htmlAttributes",{value:{},writable:!0,enumerable:!0,configurable:!0}),w.Browser.isIE?(e.curData.htmlAttributes.role||(e.curData.htmlAttributes.role="menuitem"),e.curData.htmlAttributes.tabindex||(e.curData.htmlAttributes.tabindex="-1")):Object.assign(e.curData.htmlAttributes,{role:e.curData.htmlAttributes.role||"menuitem",tabindex:e.curData.htmlAttributes.tabindex||"-1"}),!i.isMenu||e.curData[i.getField("separator",s)]||e.curData.htmlAttributes["aria-label"]||(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]||e.curData[e.fields.id]),""===e.curData[e.fields[t.iconCss]]&&(e.curData[e.fields[t.iconCss]]=null)},itemCreated:function(e){e.curData[i.getField("separator",s)]&&(e.item.classList.add(Ne),e.curData.htmlAttributes.role||e.item.setAttribute("role","separator"),e.curData.htmlAttributes.ariaLabel||e.item.setAttribute("aria-label","separator")),!n||e.curData[e.fields.iconCss]||e.curData[i.getField("separator",s)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length&&(t=i.createElement("span",{className:Re+" "+Pe}),e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),e.item.classList.add("e-menu-caret-icon")),i.template&&(e.item.setAttribute("id",e.curData[e.fields.id].toString()),e.item.removeAttribute("data-uid"),e.item.classList.contains("e-level-1")&&e.item.classList.remove("e-level-1"),e.item.classList.contains("e-has-child")&&e.item.classList.remove("e-has-child"),e.item.removeAttribute("aria-level"));var t={item:e.curData,element:e.item};i.trigger("beforeItemRender",t)}},e=(this.setProperties({items:this.items},!0),this.isMenu&&(r.templateID=this.element.id+"Template"),k.ListBase.createList(this.createElement,e,r,!this.template,this));return e.setAttribute("tabindex","0"),this.isMenu?e.setAttribute("role","menu"):e.setAttribute("role","menubar"),e},s.prototype.moverHandler=function(e){var t=e.target,i=(this.liTrgt=t,this.isMenu||(this.isCmenuHover=!0),this.getLI(t)),s=i?w.closest(i,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),n=this.getWrapper(),r=new RegExp("-ej2menu-(.*)-popup"),l=!1;if(s){if((""!==s.id?r.exec(s.id)[1]:s.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([g,v],[this.getWrapper()]),!this.navIdx.length)return;l=!0}i&&w.closest(i,".e-"+this.getModuleName()+"-wrapper")&&!l?(this.removeLIStateByClass([g],this.isMenu?[s].concat(this.getPopups()):[s]),this.removeLIStateByClass([g],this.isMenu?[n].concat(this.getPopups()):[n]),i.classList.add(g),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!l&&this.removeLIStateByClass([g],[s].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||t.parentElement===s||w.closest(t,".e-"+this.getModuleName()+"-popup")||i&&this.getIndex(i.id,!0).length||"Hover"===this.showSubMenuOn?l&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([g],[s]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1),this.isMenu||(this.isCmenuHover=!1)}},s.prototype.removeStateWrapper=function(){var e;this.liTrgt&&(e=w.closest(this.liTrgt,".e-menu-vscroll"),"DIV"===this.liTrgt.tagName)&&e&&this.removeLIStateByClass([g,v],[e])},s.prototype.removeLIStateByClass=function(e,i){for(var s,t=0;t<i.length;t++)!function(t){e.forEach(function(e){(s=w.select("."+e,i[t]))&&s.classList.remove(e)})}(t)},s.prototype.getField=function(e,t){void 0===t&&(t=0);e=this.fields[""+e];return"string"==typeof e?e:(e[t]||e[e.length-1]).toString()},s.prototype.getFields=function(e){return{id:this.getField("itemId",e=void 0===e?0:e),iconCss:this.getField("iconCss",e),text:this.getField("text",e),url:this.getField("url",e),child:this.getField("children",e),separator:this.getField("separator",e)}},s.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},s.prototype.menuHeaderClickHandler=function(e){var t=w.closest(e.target,".e-menu-wrapper");t&&t.querySelector("ul.e-menu-parent").id!==this.element.id||(-1<this.element.className.indexOf("e-hide-menu")?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},s.prototype.clickHandler=function(e){this.isTapHold=this.isTapHold&&!1;var t,i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),r=new RegExp("-ej2menu-(.*)-popup"),l=n?w.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,o=n&&l&&(this.isMenu?0<this.getIndex(n.id,!0).length:i.firstElementChild.id===l.firstElementChild.id);if(w.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([g],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&l&&this.isMenu){var r=l.id?r.exec(l.id)[1]:l.querySelector(".e-menu-parent").id;if(this.element.id!==r)return}o&&"click"===e.type&&!n.classList.contains(Ee)&&(this.setLISelected(n),l=this.getIndex(n.id,!0),r=this.getItem(l),this.trigger("select",{element:n,item:r,event:e})),o&&("mouseover"===e.type||w.Browser.isDevice||this.showItemOnClick)?(l=void 0,n.classList.contains(Ee)?(l=i.children[this.navIdx.length-1],this.toggleAnimation(l),(t=this.getLIByClass(l,v))&&t.classList.remove(v),(r=this.enableScrolling&&!this.isMenu?w.closest(n.parentElement,".e-menu-vscroll"):null)&&be(w.getInstance(r,ge),r),w.detach(n.parentNode),this.navIdx.pop()):n.classList.contains(Ne)||(this.showSubMenu=!0,o=n.parentNode,w.isNullOrUndefined(o))||(this.cliIdx=this.getIdx(o,n),!this.isMenu&&w.Browser.isDevice||(l=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),w.closest(o,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,o),this.navIdx[l]===this.cliIdx&&(this.showSubMenu=!1),l===this.navIdx.length)||"mouseover"===e.type&&!this.showSubMenu||((t=this.getLIByClass(o,v))&&t.classList.remove(v),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!0)),this.closeMenu(l+1,e),this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!1))),this.isClosed||this.afterCloseMenu(e),this.isClosed=!1)):"DIV"===s.tagName&&w.closest(s,".e-menu-vscroll")&&(this.navIdx.length||!this.isMenu&&this.enableScrolling&&0===this.navIdx.length)?(r=this.isMenu?w.closest(s,"."+Ve):w.closest(s,".e-menu-vscroll"),(o=this.isMenu?Array.prototype.indexOf.call(this.getPopups(),r)+1:this.getIdx(i,w.select("ul.e-menu-parent",r)))<this.navIdx.length&&(this.closeMenu(o+1,e),r)&&this.removeLIStateByClass([g,v],[r])):this.isMenu&&this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):"UL"===s.tagName&&(this.isMenu?!s.parentElement.classList.contains("e-menu-wrapper")||this.getIndex(s.querySelector("."+Me).id,!0).length:s.parentElement===i)||(n||w.isNullOrUndefined(i)||this.removeLIStateByClass([v],[i]),(!this.isAnimationNone&&!n||n&&!n.querySelector("."+Pe))&&(navigator.platform.toUpperCase().indexOf("MAC")<0||0<=navigator.platform.toUpperCase().indexOf("MAC")&&!e.ctrlKey)&&this.closeMenu(null,e))},s.prototype.afterCloseMenu=function(e){var t,i,s;w.isNullOrUndefined(e)||(this.showSubMenu&&(t=this.showItemOnClick&&0===this.navIdx.length?w.closest(e.target,".e-menu-parent.e-control"):w.closest(this.element,".e-menu-parent.e-control"),i=this.navIdx.concat(this.cliIdx),(s=this.getItem(i))&&s[this.getField("children",i.length-1)]&&s[this.getField("children",i.length-1)].length?(("mouseover"===e.type||w.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&t||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,s,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!t)&&(i=this.getUlByNavIdx(),s=this.getLIByClass(i,v))&&(s.setAttribute("aria-expanded","false"),s.classList.remove(v)),this.keyType="")},s.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,v);t&&t.classList.remove(v),this.isMenu||e.classList.remove(g),e.classList.add(v)},s.prototype.getLIByClass=function(e,t){if(e&&e.children)for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},s.prototype.getItemIndex=function(e,t){e="string"==typeof e?e:e.id;return this.getIndex(e,!1!==t)},s.prototype.setItem=function(e,t,i){t=i?t||e.id:t||e.text,t=this.getIndex(t,i),i=this.getItem(t);Object.assign(i,e)},s.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},s.prototype.getItems=function(e){for(var t=this.items,i=0;i<e.length;i++)t=t[e[i]][this.getField("children",i)];return t},s.prototype.setItems=function(e,t){var i=this.getItems(t);i.splice(0,i.length);for(var s=0;s<e.length;s++)i.splice(s,0,e[s])},s.prototype.getIdx=function(e,t,i){void 0===i&&(i=!0);var s=!this.isMenu&&this.enableScrolling&&w.select(".e-menu-vscroll",e)?w.selectAll(".e-menu-parent",e):Array.from(e.children),s=Array.prototype.indexOf.call(s,t);return i&&e.children[0].classList.contains(Ee)&&s--,s},s.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:w.closest(e,"li.e-menu-item")},s.prototype.updateItemsByNavIdx=function(){for(var e=this.items,t=0,i=0;i<this.navIdx.length&&(e=e[i].items);i++){t++;var s=this.getUlByNavIdx(t);if(!s)break;this.updateItem(s,e)}},s.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},s.prototype.onPropertyChanged=function(d,h){for(var c=this,p=this.getWrapper(),u=this,e=0,t=Object.keys(d);e<t.length;e++)!function(e){switch(e){case"cssClass":h.cssClass&&w.removeClass([p],h.cssClass.split(" ")),d.cssClass&&w.addClass([p],d.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":u.enableRtl?p.classList.add(Be):p.classList.remove(Be);break;case"showItemOnClick":u.unWireEvents(),u.showItemOnClick=d.showItemOnClick,u.wireEvents();break;case"enableScrolling":var t,i;d.enableScrolling?(u.element.classList.contains("e-vertical")?ve(u.createElement,p,u.element,"vscroll",u.enableRtl):ve(u.createElement,p,u.element,"hscroll",u.enableRtl),u.getPopups().forEach(function(e){t=w.select(".e-ul",e),ve(c.createElement,e,t,"vscroll",c.enableRtl)})):(i=p.children[0],u.element.classList.contains("e-vertical")||!u.isMenu?be(w.getInstance(i,ge),i):be(w.getInstance(i,te),i),p.style.overflow="",p.appendChild(u.element),u.getPopups().forEach(function(e){i=e.children[0],be(w.getInstance(i,ge),i),e.style.overflow=""}));break;case"items":var s,n,r=void 0;if(u.isReact&&u.template&&u.clearTemplate(["template"]),Object.keys(h.items).length)for(var l=Object.keys(d.items),o=0;o<l.length;o++)(r=u.getChangedItemIndex(d,[],Number(l[o]))).length<=u.getWrapper().children.length&&(s=r.pop(),n=u.getItems(r),u.insertAfter([n[s]],n[s].text),u.removeItem(n,r,s),u.setItems(n,r)),r.length=0;else{if(u.updateItem(u.element,u.items),u.enableScrolling&&u.element.parentElement.classList.contains("e-custom-scroll")&&(u.element.classList.contains("e-vertical")?ve(u.createElement,p,u.element,"vscroll",u.enableRtl):ve(u.createElement,p,u.element,"hscroll",u.enableRtl)),u.enableScrolling&&u.element.classList.contains("e-contextmenu")&&(u.isCMenu=!0,u.setPosition(u.lItem,u.uList,u.top,u.left,!0),u.isCMenu=!1),!u.hamburgerMode)for(var o=1,a=p.childElementCount;o<a;o++)w.detach(p.lastElementChild);u.navIdx=[]}}}(t[e])},s.prototype.updateItem=function(t,e){var i;w.isBlazor()&&!this.isMenu?t=this.removeChildElement(t):(this.enableScrolling&&(i=this.getWrapper().children[0],this.element.classList.contains("e-vertical")?be(w.getInstance(i,ge),i):be(w.getInstance(i,te),i)),t.innerHTML=""),[].slice.call(this.createItems(e).children).forEach(function(e){t.appendChild(e)})},s.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();return"items"===s?(e=e.items[i],(i=Object.keys(e.items).pop())&&this.getChangedItemIndex(e,t,Number(i))):"isParentArray"===s&&1<t.length&&t.pop(),t},s.prototype.removeItem=function(e,t,i){e.splice(i,1);var s,e=this.getWrapper().children;t.length<e.length&&(this.enableScrolling&&!e[t.length].classList.contains("e-menu-parent")?(s=e[t.length].querySelector(".e-menu-parent"),w.detach(s.children[i])):w.detach(e[t.length].children[i]))},s.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var t=this.getWrapper();if(e){for(var i,s=void 0,n=w.selectAll(e),r=0,l=n.length;r<l;r++)i=n[r],this.isMenu?w.EventHandler.remove(i,"click",this.menuHeaderClickHandler):w.Browser.isIos?(s=w.getInstance(i,w.Touch))&&s.destroy():this.delegateContextMenuHandler&&(w.EventHandler.remove(i,"contextmenu",this.delegateContextMenuHandler),this.delegateContextMenuHandler=null);if(!this.isMenu&&(w.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler),this.scrollParents)){for(var o=0,a=this.scrollParents;o<a.length;o++){var d=a[o];w.EventHandler.remove(d,"scroll",this.delegateParentScrollHandler)}this.delegateParentScrollHandler=null,this.scrollParents.length=0,this.scrollParents=null}}w.Browser.isDevice||(this.delegateMoverHandler&&(w.EventHandler.remove(this.isMenu?document:t,"mouseover",this.delegateMoverHandler),this.delegateMoverHandler=null),this.delegateMouseDownHandler&&(w.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler),this.delegateMouseDownHandler=null),this.delegateDomKeyHandler&&(w.EventHandler.remove(document,"keydown",this.delegateDomKeyHandler),this.delegateDomKeyHandler=null),this.isMenu)||this.target||this.delegateScrollHandler&&(w.EventHandler.remove(document,"scroll",this.delegateScrollHandler),this.delegateScrollHandler=null),this.delegateClickHandler&&(w.EventHandler.remove(document,"click",this.delegateClickHandler),this.delegateClickHandler=null),this.unWireKeyboardEvent(t),this.rippleFn(),!this.isMenu&&this.enableScrolling&&(t.removeEventListener("touchstart",this.touchStartFn),t.removeEventListener("touchmove",this.touchMoveFn),this.delegateTouchOutsideHandler)&&(document.removeEventListener("touchstart",this.delegateTouchOutsideHandler),this.delegateTouchOutsideHandler=null)},s.prototype.unWireKeyboardEvent=function(e){e=w.getInstance(e,w.KeyboardEvents);e&&e.destroy()},s.prototype.toggleAnimation=function(e,t){var i,s,n=this,r=(void 0===t&&(t=!0),this.getWrapper()),r=(r&&r.querySelectorAll(".e-menu-parent").forEach(function(e){w.Animation.stop(e)}),this.enableScrolling&&!this.isMenu&&w.closest(e,".e-menu-vscroll")?w.closest(e,".e-menu-vscroll"):e);w.Animation.stop(r),"None"!==this.animationSettings.effect&&t?(r.style.maxHeight="",this.animation.animate(r,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){n.hamburgerMode?(s=e.element.parentElement,e.element.style.position="absolute",s&&(i=s.offsetHeight),e.element.style.maxHeight=e.element.offsetHeight+"px",s&&(s.style.maxHeight="")):(e.element.style.display="block",e.element.style.maxHeight=e.element.getBoundingClientRect().height+"px")},progress:function(e){n.hamburgerMode&&s&&(s.style.minHeight=i+e.element.offsetHeight+"px")},end:function(e){n.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",s&&(s.style.minHeight=""),e.element.style.top="0px",e.element.children[0].focus(),n.triggerOpen(e.element.children[0])):n.end(e.element,t),n.isKBDAction=!1}})):(this.hamburgerMode&&e&&(e.style.top="0px"),this.isAnimationNone="None"===this.animationSettings.effect,this.end(e,t))},s.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,t={element:e,parentItem:t,items:(t||this).items};this.trigger("onOpen",t),this.isMenu||w.EventHandler.add(e,"keydown",this.keyHandler,this)},s.prototype.end=function(e,t){var i;t&&this.isContextMenuClosed?((this.isMenu||!w.Browser.isDevice||!this.isMenu&&this.isAnimationNone&&w.Browser.isDevice)&&(e.style.display="block"),e.style.maxHeight="",(i=this.enableScrolling&&!this.isMenu?w.closest(e,".e-menu-vscroll"):null)&&(i.style.display="block"),this.triggerOpen(e),e.querySelector("."+g)&&this.isKBDAction?e.querySelector("."+g).focus():(t=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1],this.currentTarget&&(this.currentTarget.classList.contains("e-numerictextbox")||this.currentTarget.classList.contains("e-textbox")||"INPUT"===this.currentTarget.tagName)||(t&&this.isKBDAction?t.querySelector("."+v):this.element).focus())):((i=this.enableScrolling&&!this.isMenu?w.closest(e,".e-menu-vscroll"):null)&&be(w.getInstance(i,ge),i),e===this.element?((t=this.getLIByClass(this.element,g))&&t.classList.remove(g),(i=this.getLIByClass(this.element,v))&&i.classList.remove(v),e.style.display="none",this.isAnimationNone=!1):w.detach(e))},s.prototype.getAppendToElement=function(){if(this.isAngular){var e=this.element.closest(".cdk-overlay-pane"),t=this.element.closest("[popover]");if(e&&t)return e}return document.body},s.prototype.getPersistData=function(){return""},s.prototype.getWrapper=function(){return w.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},s.prototype.getIndex=function(e,t,i,s,n,r){void 0===s&&(s=[]),void 0===r&&(r=0),r=(n=void 0===n?!1:n)?r+1:0;for(var l=0,o=(i=void 0===i?this.items:i).length;l<o;l++){var a=i[l],d=t?a[this.getField("itemId",r)]:a[this.getField("text",r)];if((a.htmlAttributes&&"id"in a.htmlAttributes?a.htmlAttributes.id:d)===e){s.push(l);break}if(a[this.getField("children",r)]&&a[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,a[this.getField("children",r)],s,!0,r))[s.length-1]){s.unshift(l);break}l!==o-1&&s.pop()}else l===o-1&&s.push(-1)}return n||-1!==s[0]?s:[]},s.prototype.enableItems=function(e,t,i){void 0===t&&(t=!0);for(var s,n=He,r=0;r<e.length;r++){if(s=this.getIndex(e[r],i),this.navIdx.length){if(1!==s.length){for(var l=!1,o=0,a=s.length-1;o<a;o++)if(s[o]!==this.navIdx[o]){l=!0;break}if(l)continue}}else if(1!==s.length)continue;var d,h=s.pop();(d=this.getUlByNavIdx(s.length))&&!w.isNullOrUndefined(h)&&(t?this.isMenu?(d.children[h].classList.remove(n),d.children[h].removeAttribute("aria-disabled")):(w.Browser.isDevice&&!d.classList.contains("e-contextmenu")?d.children[h+1]:(this.enableScrolling&&!d.classList.contains("e-menu-parent")?d.querySelector(".e-menu-parent"):d).children[h]).classList.remove(n):this.isMenu?(d.children[h].classList.add(n),d.children[h].setAttribute("aria-disabled","true")):(w.Browser.isDevice&&!d.classList.contains("e-contextmenu")?d.children[h+1]:(this.enableScrolling&&!d.classList.contains("e-menu-parent")?d.querySelector(".e-menu-parent"):d).children[h]).classList.add(n))}},s.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},s.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},s.prototype.showHideItems=function(e,t,i){for(var s=0;s<e.length;s++){var n=(l=this.getIndex(e[s],i)).pop(),r=this.getUlByNavIdx(l.length),l=this.getItems(l);r&&(this.enableScrolling&&!r.classList.contains("e-menu-parent")&&(r=r.querySelector(".e-menu-parent")),l=i?r.children[n].id:l[n].text.toString(),t&&l===e[s]?r.children[n].classList.add(Ue):t||l!==e[s]||r.children[n].classList.remove(Ue))}},s.prototype.removeItems=function(e,t){for(var i,s,n,r=0;r<e.length;r++)i=(s=this.getIndex(e[r],t)).pop(),n=this.getItems(s),w.isNullOrUndefined(i)||this.removeItem(n,s,i)},s.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},s.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},s.prototype.insertItems=function(e,t,i,s){void 0===s&&(s=!0);for(var n=0;n<e.length;n++){r=(l=this.getIndex(t,i)).pop(),o=this.getItems(l),(a=new We(o[0],"items",e[n],!0)).parentObj=o[0].parentObj,o.splice(s?r+1:r,0,a);var r,l,o,a=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);!w.isNullOrUndefined(r)&&l.length<a.length&&(r=s?r+1:r,o=this.createItems(o).children[r],l=a=this.isMenu?w.select(".e-menu-parent",a[l.length]):a[l.length],(l=this.enableScrolling&&!l.classList.contains("e-menu-parent")?l.querySelector(".e-menu-parent"):l).insertBefore(o,l.children[r]),n!==e.length-1||this.isMenu||"block"!==l.style.display||(this.enableScrolling?(this.setPosition(null,l,parseFloat(a.style.top),parseFloat(a.style.left)),(o=w.closest(l,".e-vscroll"))&&(o.style.display="block")):(this.setPosition(null,l,parseFloat(l.style.top),parseFloat(l.style.left)),l.style.display="block")))}},s.prototype.removeAttributes=function(){var t=this;["top","left","display","z-index"].forEach(function(e){t.element.style.removeProperty(e)}),["role","tabindex","class","style"].forEach(function(e){"class"===e&&t.element.classList.contains("e-menu-parent")&&t.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(e)&&t.element.getAttribute(e)||t.element.removeAttribute(e),t.isMenu&&"class"===e&&t.element.classList.contains("e-vertical")&&t.element.classList.remove("e-vertical")})},s.prototype.destroy=function(){var e,t=this.getWrapper();t&&(this.unWireEvents(),this.delegateClickHandler=null,this.delegateMoverHandler=null,this.delegateMouseDownHandler=null,this.delegateDomKeyHandler=null,this.delegateScrollHandler=null,this.delegateTouchOutsideHandler=null,this.delegateParentScrollHandler=null,this.delegateContextMenuHandler&&(w.EventHandler.remove(this.targetElement,"contextmenu",this.delegateContextMenuHandler),this.delegateContextMenuHandler=null),this.isMenu?(this.closeMenu(),w.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),t.parentNode.insertBefore(this.element,t)):(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName?(w.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement):(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)&&((e=this.clonedElement.nextElementSibling)&&e!==t?this.clonedElement.parentElement.insertBefore(this.element,e):this.clonedElement.parentElement.appendChild(this.element),w.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",w.append([].slice.call(this.clonedElement.children),this.element),w.detach(this.clonedElement),this.removeAttributes()))),this.clonedElement=null,this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.currentTarget=null,this.targetElement=null,this.animation&&(this.animation.destroy(),this.animation=null),this.isMenu||this.isCmenuOpened||!this.element||(e=w.getValue("ej2_instances",this.element))&&Array.isArray(e)&&(e.length=0,w.setValue("ej2_instances",e,this.element)),w.detach(t),this.uList&&!document.body.contains(this.uList)&&(e=w.getValue("ej2_instances",this.uList))&&Array.isArray(e)&&(e.length=0,w.setValue("ej2_instances",e,this.uList)),Ye.prototype.destroy.call(this),this.template)&&this.clearTemplate(["template"]),this.rippleFn=null},e([w.Event()],s.prototype,"beforeItemRender",void 0),e([w.Event()],s.prototype,"beforeOpen",void 0),e([w.Event()],s.prototype,"onOpen",void 0),e([w.Event()],s.prototype,"beforeClose",void 0),e([w.Event()],s.prototype,"onClose",void 0),e([w.Event()],s.prototype,"select",void 0),e([w.Event()],s.prototype,"created",void 0),e([w.Property("")],s.prototype,"cssClass",void 0),e([w.Property(0)],s.prototype,"hoverDelay",void 0),e([w.Property(!1)],s.prototype,"showItemOnClick",void 0),e([w.Property("")],s.prototype,"target",void 0),e([w.Property("")],s.prototype,"filter",void 0),e([w.Property(null)],s.prototype,"template",void 0),e([w.Property(!1)],s.prototype,"enableScrolling",void 0),e([w.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),e([w.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},je)],s.prototype,"fields",void 0),e([w.Collection([],We)],s.prototype,"items",void 0),e([w.Complex({duration:400,easing:"ease",effect:"SlideDown"},Ke)],s.prototype,"animationSettings",void 0);var Ye,q=e([w.NotifyPropertyChanges],s);function s(e,t){e=Ye.call(this,e,t)||this;return e.navIdx=[],e.animation=new w.Animation({}),e.isTapHold=!1,e.tempItem=[],e.showSubMenuOn="Auto",e.isOpenCalled=!1,e.isAnimationNone=!1,e.isKBDAction=!1,e.skipNextArrowDown=!1,e.isCmenuOpened=!1,e}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)};var Ge,Qe,e=function(e,t){function i(){this.constructor=e}Ge(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Je="e-vertical",m="e-toolbar-items",y="e-toolbar-item",Ze="e-rtl",b="e-separator",$e="e-popup-up-icon",et="e-popup-down-icon",tt="e-popup-open",it="e-template",st="e-overlay",nt="e-toolbar-text",rt="e-popup-text",lt="e-overflow-show",ot="e-overflow-hide",at="e-hor-nav",dt="e-scroll-nav",ht="e-toolbar-center",ct="e-tbar-pos",pt="e-hscroll-bar",ut="e-toolbar-pop",mt="e-toolbar-popup",ft="e-nav-active",gt="e-ignore",vt="e-popup-alone",yt="e-hidden",bt="e-toolbar-multirow",St="e-multirow-pos",Ct="e-multirow-separator",It="e-extended-separator",xt="e-extended-toolbar",Et="e-toolbar-extended",Nt="e-tbar-extended",Ot=(Qe=w.ChildProperty,e(wt,Qe),n([w.Property("")],wt.prototype,"id",void 0),n([w.Property("")],wt.prototype,"text",void 0),n([w.Property("auto")],wt.prototype,"width",void 0),n([w.Property("")],wt.prototype,"cssClass",void 0),n([w.Property(!1)],wt.prototype,"showAlwaysInPopup",void 0),n([w.Property(!1)],wt.prototype,"disabled",void 0),n([w.Property("")],wt.prototype,"prefixIcon",void 0),n([w.Property("")],wt.prototype,"suffixIcon",void 0),n([w.Property(!0)],wt.prototype,"visible",void 0),n([w.Property("None")],wt.prototype,"overflow",void 0),n([w.Property("")],wt.prototype,"template",void 0),n([w.Property("Button")],wt.prototype,"type",void 0),n([w.Property("Both")],wt.prototype,"showTextOn",void 0),n([w.Property(null)],wt.prototype,"htmlAttributes",void 0),n([w.Property("")],wt.prototype,"tooltipText",void 0),n([w.Property("Left")],wt.prototype,"align",void 0),n([w.Event()],wt.prototype,"click",void 0),n([w.Property(-1)],wt.prototype,"tabIndex",void 0),wt);function wt(){return null!==Qe&&Qe.apply(this,arguments)||this}kt=w.Component,e(r,kt),r.prototype.destroy=function(){var t=this,e=((this.isReact||this.isAngular)&&this.clearTemplate(),this.element.querySelectorAll(".e-control.e-btn"));for([].slice.call(e).forEach(function(e){w.isNullOrUndefined(e)||w.isNullOrUndefined(e.ej2_instances)||w.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){w.isNullOrUndefined(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),w.detach(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&w.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","role"].forEach(function(e){return t.element.removeAttribute(e)}),kt.prototype.destroy.call(this)},r.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains(Je),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,Ze)},r.prototype.wireEvents=function(){w.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),window.addEventListener("orientationchange",this.orientationChangeContext),this.allowKeyboard&&this.wireKeyboardEvent()},r.prototype.wireKeyboardEvent=function(){this.keyModule=new w.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),w.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.updateTabIndex("0")},r.prototype.updateTabIndex=function(e){var t,i=this.element.querySelector("."+y+":not(."+st+" ):not(."+b+" ):not(."+yt+" )");w.isNullOrUndefined(i)||w.isNullOrUndefined(i.firstElementChild)||(t=i.firstElementChild.getAttribute("data-tabindex"))&&"-1"===t&&"INPUT"!==i.firstElementChild.tagName&&i.firstElementChild.setAttribute("tabindex",e)},r.prototype.unwireKeyboardEvent=function(){this.keyModule&&(w.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},r.prototype.docKeyDown=function(e){var t;"INPUT"!==e.target.tagName&&(t=!w.isNullOrUndefined(this.popObj)&&w.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode,9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&t&&this.popObj.hide({name:"FadeOut",duration:100}),40!==e.keyCode&&38!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||e.preventDefault())},r.prototype.unwireEvents=function(){w.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),window.removeEventListener("orientationchange",this.orientationChangeContext),document.removeEventListener("scroll",this.clickEvent),document.removeEventListener("click",this.scrollEvent),this.scrollEvent=null,this.clickEvent=null},r.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},r.prototype.docEvent=function(e){e=w.closest(e.target,".e-popup");this.popupTriggeredByToolbar?this.popupTriggeredByToolbar=!1:this.popObj&&w.isVisible(this.popObj.element)&&!e&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},r.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,ct),this.scrollModule.destroy(),this.scrollModule=null)},r.prototype.destroyItems=function(){var e,t=this;this.element&&[].slice.call(this.element.querySelectorAll("."+y)).forEach(function(e){w.EventHandler.remove(e,"click",t.itemClick),w.detach(e)}),this.tbarAlign&&((e=this.element.querySelector("."+m))&&(e.children&&[].slice.call(e.children).forEach(function(e){w.detach(e)}),this.remove(e,ct)),this.tbarAlign=!1),this.clearProperty()},r.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,Ze),this.destroyScroll()),this.remove(this.element,Nt),this.remove(this.element,xt);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,bt),this.popObj&&this.popupRefresh(this.popObj.element,!0)},r.prototype.add=function(e,t){e.classList.add(t)},r.prototype.remove=function(e,t){e.classList.remove(t)},r.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},r.prototype.clstElement=function(e,t){e=e&&this.popObj&&w.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+y):this.element===t||e?this.element.querySelector("."+y+":not(."+st+" ):not(."+b+" ):not(."+yt+" )"):w.closest(t,"."+y);return e},r.prototype.getNextFocusableItem=function(e,t){var i,s=Array.from(this.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-separator):not(.e-hidden)")),n=s.indexOf(e);if(n<0)return null;switch(t){case"moveRight":case"moveDown":case"tab":i=(n+1)%s.length;break;case"moveLeft":case"moveUp":i=(n-1+s.length)%s.length;break;case"home":i=0;break;case"end":i=s.length-1;break;default:i=n}return 0<=i&&i<s.length?s[parseInt(i.toString(),10)]:null},r.prototype.keyHandling=function(e,t,i,s,n){var r,l,o,a,d=this.popObj,h=this.element,c={name:"FadeOut",duration:100},p="moveUp"===t.action?"previous":"next";switch(t.action){case"moveRight":this.isVertical||(h===i?this.elementFocus(e):s||this.eleFocus(e,"next"));break;case"moveLeft":this.isVertical||s||this.eleFocus(e,"previous");break;case"home":case"end":e&&(l=w.closest(e,".e-popup"),r=this.element.querySelector("."+Et),(l="Extended"===this.overflowMode&&r&&r.classList.contains("e-popup-open")?"end"===t.action?r:null:l)?w.isVisible(this.popObj.element)&&(o=[].slice.call(l.children),a="home"===t.action?this.focusFirstVisibleEle(o):this.focusLastVisibleEle(o)):(o=this.element.querySelectorAll("."+m+" ."+y+":not(."+b+")"),a="home"===t.action?this.focusFirstVisibleEle(o):this.focusLastVisibleEle(o)),a)&&this.elementFocus(a);break;case"moveUp":case"moveDown":this.isVertical?"moveUp"===t.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next"):d&&w.closest(i,".e-popup")?(r=d.element,"previous"==p&&r.firstElementChild===e?(l=this.focusLastVisibleEle([].slice.call(r.children)))&&this.elementFocus(l):"next"==p&&r.lastElementChild===e?(o=this.focusFirstVisibleEle([].slice.call(r.children)))&&this.elementFocus(o):this.eleFocus(e,p)):"moveDown"===t.action&&d&&w.isVisible(d.element)&&(this.eleContains(e)?this.eleFocus(e,p):this.elementFocus(e));break;case"tab":n||s||(a=e.firstElementChild,h===i&&(this.activeEle||(this.activeEleRemove(a),a)).focus());break;case"popupClose":d&&"Extended"!==this.overflowMode&&d.hide(c);break;case"popupOpen":s&&(d&&!w.isVisible(d.element)?(d.element.style.top=h.offsetHeight+"px",d.show({name:"FadeIn",duration:100})):d.hide(c))}},r.prototype.keyActionHandler=function(t){var i,s,n,e,r,l=this,o=t.target;("home"!==t.action&&"end"!==t.action&&"moveRight"!==t.action&&"moveLeft"!==t.action&&"moveUp"!==t.action&&"moveDown"!==t.action||"INPUT"!==o.tagName&&"TEXTAREA"!==o.tagName&&!this.element.classList.contains(st))&&(t.preventDefault(),i=o.classList.contains(at),s=o.classList.contains(dt),(n=this.clstElement(i,o))||s)&&(r=this.getNextFocusableItem(e=n,t.action),this.trigger("keyDown",{originalEvent:t,currentItem:e,nextItem:r,cancel:!1},function(e){e.cancel||l.keyHandling(n,t,o,i,s)}))},r.prototype.disable=function(e){var t=this.element;e?t.classList.add(st):t.classList.remove(st),this.activeEle&&this.activeEle.setAttribute("tabindex",this.activeEle.getAttribute("data-tabindex")),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(w.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),t.querySelector("#"+t.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},r.prototype.eleContains=function(e){return e.classList.contains(b)||e.classList.contains(st)||e.getAttribute("disabled")||e.classList.contains(yt)||!w.isVisible(e)||!e.classList.contains(y)},r.prototype.focusFirstVisibleEle=function(e){for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(b)&&!i.classList.contains(yt)&&!i.classList.contains(st))return i;t++}},r.prototype.focusLastVisibleEle=function(e){for(var t=e.length-1;0<=t;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(b)&&!i.classList.contains(yt)&&!i.classList.contains(st))return i;t--}},r.prototype.eleFocus=function(e,t){var i,s=Object(e)[t+"ElementSibling"];s?this.eleContains(s)?this.eleFocus(s,t):this.elementFocus(s):this.tbarAlign?(s=Object(e.parentElement)[t+"ElementSibling"],w.isNullOrUndefined(s)||0!==s.children.length||(s=Object(s)[t+"ElementSibling"]),!w.isNullOrUndefined(s)&&0<s.children.length&&("next"===t?(i=s.querySelector("."+y),this.eleContains(i)?this.eleFocus(i,t):(i.firstElementChild.focus(),this.activeEleSwitch(i))):(i=s.lastElementChild,this.eleContains(i)?this.eleFocus(i,t):this.elementFocus(i)))):w.isNullOrUndefined(e)||(s=this.element.querySelectorAll("."+m+" ."+y+":not(."+b+"):not(."+st+"):not(."+yt+")"),"next"===t&&s?this.elementFocus(s[0]):"previous"===t&&s&&this.elementFocus(s[s.length-1]))},r.prototype.clickHandler=function(e){var t,i=this,s=e.target,n=this.element,r=!w.isNullOrUndefined(w.closest(s,"."+ut)),l=s.classList,o=w.closest(s,"."+at),s=((w.closest(s,"."+et)||o)&&(this.popupTriggeredByToolbar=!0),o=o||s,((l=n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!l.contains(at)?l:s.querySelector(".e-icons").classList).contains($e)||l.contains(et))&&this.popupClickHandler(n,o,Ze),w.closest(e.target,"."+y));(w.isNullOrUndefined(s)||s.classList.contains(st))&&!o.classList.contains(at)||(l={originalEvent:e,item:t=s?this.items[this.tbarEle.indexOf(s)]:t},(t&&!w.isNullOrUndefined(t.click)&&"object"==typeof t.click?!w.isNullOrUndefined(t.click.observers)&&0<t.click.observers.length:!w.isNullOrUndefined(t)&&!w.isNullOrUndefined(t.click))&&this.trigger("items["+this.tbarEle.indexOf(s)+"].click",l),l.cancel)||this.trigger("clicked",l,function(e){!w.isNullOrUndefined(i.popObj)&&r&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})},r.prototype.popupClickHandler=function(e,t,i){var s=this.popObj;w.isVisible(s.element)?(t.classList.remove(ft),s.hide({name:"FadeOut",duration:100})):(e.classList.contains(i)&&(s.enableRtl=!0,s.position={X:"left",Y:"top"}),0!==s.offsetX||e.classList.contains(i)||(s.enableRtl=!1,s.position={X:"right",Y:"top"}),"Extended"===this.overflowMode&&(s.element.style.minHeight="0px",s.width=this.getToolbarPopupWidth(this.element)),s.dataBind(),s.refreshPosition(),s.element.style.top=this.getElementOffsetY()+"px",t.classList.add(ft),s.show({name:"FadeIn",duration:100}))},r.prototype.getToolbarPopupWidth=function(e){e=window.getComputedStyle(e);return parseFloat(e.width)+2*parseFloat(e.borderRightWidth)},r.prototype.render=function(){var e=this;this.initialize(),this.clickEvent=this.docEvent.bind(this),this.scrollEvent=this.docEvent.bind(this),this.renderControl(),this.wireEvents(),this.renderComplete(),this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow()})},r.prototype.initialize=function(){var e=w.formatUnit(this.width),t=w.formatUnit(this.height),t=("msie"===w.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||w.setStyleAttribute(this.element,{height:t}),w.setStyleAttribute(this.element,{width:e}),{role:"toolbar","aria-disabled":"false","aria-orientation":this.isVertical?"vertical":"horizontal"});w.attributes(this.element,t),this.cssClass&&w.addClass([this.element],this.cssClass.split(" "))},r.prototype.renderControl=function(){var e=this.element;this.trgtEle=0<e.children.length?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},r.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&1<this.popObj.element.childElementCount&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},r.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[parseInt(n.toString(),10)],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[parseInt(n.toString(),10)],t,n),((s=t.querySelector(".e-toolbar-"+e[parseInt(n.toString(),10)].align.toLowerCase()))?(e[parseInt(n.toString(),10)].showAlwaysInPopup&&"Show"!==e[parseInt(n.toString(),10)].overflow||this.tbarAlgEle[(e[parseInt(n.toString(),10)].align+"s").toLowerCase()].push(i),s):t).appendChild(i);this.isReact&&(this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates())},r.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(Je),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(Je),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),w.setStyleAttribute(this.element,{height:w.formatUnit(this.height),width:w.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},r.prototype.initScroll=function(e,t){!this.scrollModule&&this.checkOverflow(e,t[0])&&(this.tbarAlign&&this.element.querySelector("."+m+" ."+ht).removeAttribute("style"),this.isVertical?this.scrollModule=new ge({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]):this.scrollModule=new te({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]),this.cssClass&&w.addClass([t[0]],this.cssClass.split(" ")),(e=this.scrollModule.element.querySelector("."+pt+", .e-vscroll-bar"))&&e.removeAttribute("tabindex"),this.remove(this.scrollModule.element,ct),w.setStyleAttribute(this.element,{overflow:"hidden"}))},r.prototype.itemWidthCal=function(e){var t,i=this,s=0;return[].slice.call(w.selectAll("."+y,e)).forEach(function(e){w.isVisible(e)&&(t=window.getComputedStyle(e),s=(s=(s+=i.isVertical?e.offsetHeight:e.offsetWidth)+parseFloat(i.isVertical?t.marginTop:t.marginRight))+parseFloat(i.isVertical?t.marginBottom:t.marginLeft))}),s},r.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},r.prototype.checkOverflow=function(e,t){var i,s,n;return!(w.isNullOrUndefined(e)||w.isNullOrUndefined(t)||!w.isVisible(e)||(i=this.isVertical?e.offsetHeight:e.offsetWidth,s=this.isVertical?t.offsetHeight:t.offsetWidth,(this.tbarAlign||this.scrollModule||i===s)&&(s=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(t):t)),t=e.querySelector("."+at),e=e.querySelector("."+dt),n=0,t?n=this.isVertical?t.offsetHeight:t.offsetWidth:e&&(n=this.isVertical?2*e.offsetHeight:2*e.offsetWidth),s<=i&&e))&&i-n<s},r.prototype.refreshOverflow=function(){this.resize()},r.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,ct),this.itemPositioning())},r.prototype.renderOverflowMode=function(){var e=this.element,t=e.querySelector("."+m),i=0<this.popupPriCount;if(e&&0<e.children.length)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===w.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":w.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(m)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,t)||i)&&this.setOverflowAttributes(e),this.toolbarAlign(t);break;case"MultiRow":this.add(t,bt),this.checkOverflow(e,t)&&this.tbarAlign&&(this.removePositioning(),this.add(t,St)),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==w.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,xt),(this.checkOverflow(e,t)||i)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(t)}},r.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(w.selectAll("."+m+" ."+y,e)));w.attributes(this.element.querySelector("."+at),{tabindex:"0",role:"button","aria-haspopup":"true","aria-label":"overflow"})},r.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+b)),i=e.querySelector("."+Ct),e=e.querySelector("."+It),i="MultiRow"===this.overflowMode?i:e;null!==i&&("MultiRow"===this.overflowMode?i.classList.remove(Ct):"Extended"===this.overflowMode&&i.classList.remove(It));for(var s=0;s<=t.length-1;s++)t[parseInt(s.toString(),10)].offsetLeft<30&&0!==t[parseInt(s.toString(),10)].offsetLeft&&("MultiRow"===this.overflowMode?t[parseInt(s.toString(),10)].classList.add(Ct):"Extended"===this.overflowMode&&t[parseInt(s.toString(),10)].classList.add(It))},r.prototype.createPopupEle=function(e,t){var i=e.querySelector("."+at),s=this.isVertical,i=(i||this.createPopupIcon(e),i=e.querySelector("."+at),s?i.offsetHeight:i.offsetWidth),s=(s?e.offsetHeight:e.offsetWidth)-i;this.element.classList.remove("e-rtl"),w.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,t,s,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},r.prototype.pushingPoppedEle=function(i,s,n,r,l){for(var o,e=i.element,t=[].slice.call(w.selectAll("."+mt,e.querySelector("."+m))),a=(w.selectAll("."+lt,n),0),d=0,h=(t.forEach(function(e,t){o=w.selectAll("."+lt,n),e.classList.contains(lt)&&0<o.length?(i.tbResize&&o.length>t?n.insertBefore(e,o[parseInt(t.toString(),10)]):n.insertBefore(e,n.children[o.length]),++d):e.classList.contains(lt)||i.tbResize&&e.classList.contains(ot)&&0<n.children.length&&0===o.length?(n.insertBefore(e,n.firstChild),++d):e.classList.contains(ot)?s.push(e):i.tbResize?(n.insertBefore(e,n.childNodes[a+d]),++a):(t=Array.prototype.slice.call(n.children).slice(t).find(function(e){return!e.classList.contains(vt)}),n.insertBefore(e,t||null)),e.classList.contains(b)?w.setStyleAttribute(e,{display:"",height:l+"px"}):w.setStyleAttribute(e,{display:"",height:r+"px"})}),s.forEach(function(e){n.appendChild(e)}),w.selectAll("."+y,e.querySelector("."+m))),c=h.length-1;0<=c;c--){var p=h[parseInt(c.toString(),10)];if(!p.classList.contains(b)||"Extended"===this.overflowMode)break;w.setStyleAttribute(p,{display:"none"})}},r.prototype.createPopup=function(){var e,t,i,s=this.element,n=("Extended"===this.overflowMode&&(e=s.querySelector("."+b),e="auto"===s.style.height||""===s.style.height?null:e&&e.offsetHeight),s.querySelector("."+y+":not(."+b+"):not(."+mt+")")),n="auto"===s.style.height||""===s.style.height?null:n&&n.offsetHeight;i=w.select("#"+s.id+"_popup."+ut,s)?w.select("#"+s.id+"_popup."+ut,s):(i=this.createElement("div",{id:s.id+"_popup",className:ut+" "+Et}),t=this.createElement("div",{id:s.id+"_popup",className:ut}),"Extended"===this.overflowMode?i:t),this.pushingPoppedEle(this,[],i,n,e),this.popupInit(s,i)},r.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},r.prototype.popupInit=function(e,t){var i;this.popObj?"Extended"!==this.overflowMode&&(i=this.popObj.element,w.setStyleAttribute(i,{maxHeight:"",display:"block"}),w.setStyleAttribute(i,{maxHeight:i.offsetHeight+"px",display:""})):(e.appendChild(t),this.cssClass&&w.addClass([t],this.cssClass.split(" ")),w.setStyleAttribute(this.element,{overflow:""}),i=new U.Popup(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}}),"Extended"===this.overflowMode&&(i.width=this.getToolbarPopupWidth(this.element),i.offsetX=0),i.appendTo(t),document.addEventListener("scroll",this.clickEvent),document.addEventListener("click",this.scrollEvent),"Extended"!==this.overflowMode&&(i.element.style.maxHeight=i.element.offsetHeight+"px"),this.isVertical&&(i.element.style.visibility="hidden"),this.isExtendedOpen?((e=this.element.querySelector("."+at)).classList.add(ft),w.classList(e.firstElementChild,[$e],[et]),this.element.querySelector("."+Et).classList.add(tt)):i.hide(),this.popObj=i)},r.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,Nt):this.remove(this.element,Nt))},r.prototype.popupOpen=function(e){var t=this.popObj,i=(this.isVertical||(t.offsetY=this.getElementOffsetY(),t.dataBind()),this.popObj.element),s=this.popObj.element.parentElement,n=s.querySelector("."+at),r=(n.setAttribute("aria-expanded","true"),"Extended"===this.overflowMode?t.element.style.minHeight="":(w.setStyleAttribute(t.element,{height:"auto",maxHeight:""}),t.element.style.maxHeight=t.element.offsetHeight+"px"),i.offsetTop+i.offsetHeight+U.calculatePosition(s).top),l=n.firstElementChild,n=(n.classList.add(ft),w.classList(l,[$e],[et]),this.tbarPopupHandler(!0),w.isNullOrUndefined(window.scrollY)?0:window.scrollY);if(!this.isVertical&&window.innerHeight+n<r&&this.element.offsetTop<i.offsetHeight){var o=i.offsetHeight-(r-window.innerHeight-n+5);t.height=o+"px";for(var a=0;a<=i.childElementCount;a++){var d=i.children[parseInt(a.toString(),10)];if(d.offsetTop+d.offsetHeight>o){o=d.offsetTop;break}}"Extended"!==this.overflowMode&&w.setStyleAttribute(t.element,{maxHeight:o+"px"})}else this.isVertical&&"Extended"!==this.overflowMode&&(l=this.element.getBoundingClientRect(),w.setStyleAttribute(t.element,{maxHeight:l.top+this.element.offsetHeight+"px",bottom:0,visibility:""}));t&&((r=i.getBoundingClientRect()).right>document.documentElement.clientWidth&&r.width>s.getBoundingClientRect().width&&(t.collision={Y:"none"},t.dataBind()),t.refreshPosition())},r.prototype.popupClose=function(e){var t=this.element.querySelector("."+at),i=(t.setAttribute("aria-expanded","false"),t.firstElementChild);t.classList.remove(ft),w.classList(i,[et],[$e]),this.tbarPopupHandler(!1)},r.prototype.checkPriority=function(e,t,i,s){for(var n,r,l=0<this.popupPriCount,o=i,a=0,d=0,h=0,c=function(t,e){var i=!1;return e.forEach(function(e){t.classList.contains(e)&&(i=!0)}),i},p=t.length-1;0<=p;p--){var u,m=void 0,f=window.getComputedStyle(t[parseInt(p.toString(),10)]),f=(this.isVertical?(m=parseFloat(f.marginTop),m+=parseFloat(f.marginBottom)):(m=parseFloat(f.marginRight),m+=parseFloat(f.marginLeft)),t[parseInt(p.toString(),10)]===this.tbarEle[0]),f=(f&&(this.tbarEleMrgn=m),n=this.isVertical?t[parseInt(p.toString(),10)].offsetHeight:t[parseInt(p.toString(),10)].offsetWidth,f?n+m:n);c(t[parseInt(p.toString(),10)],[vt])&&l&&(t[parseInt(p.toString(),10)].classList.add(mt),this.isVertical?w.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minHeight:f+"px"}):w.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minWidth:f+"px"}),h++),(this.isVertical?t[parseInt(p.toString(),10)].offsetTop+t[parseInt(p.toString(),10)].offsetHeight+m>i:t[parseInt(p.toString(),10)].offsetLeft+t[parseInt(p.toString(),10)].offsetWidth+m>i)&&(t[parseInt(p.toString(),10)].classList.contains(b)?"Extended"===this.overflowMode?(c(u=t[parseInt(p.toString(),10)],[b,gt])&&(t[parseInt(p.toString(),10)].classList.add(mt),h++),d++):"Popup"===this.overflowMode&&(0<a&&d===h&&c(u=t[p+d+(a-1)],[b,gt])&&w.setStyleAttribute(u,{display:"none"}),a++,h=d=0):d++,t[parseInt(p.toString(),10)].classList.contains(lt)&&s||c(t[parseInt(p.toString(),10)],[b,gt])?i-=(this.isVertical?t[parseInt(p.toString(),10)].offsetHeight:t[parseInt(p.toString(),10)].offsetWidth)+m:(t[parseInt(p.toString(),10)].classList.add(mt),this.isVertical?w.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minHeight:f+"px"}):w.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minWidth:f+"px"}),h++))}s&&(r=w.selectAll("."+y+":not(."+mt+")",this.element),this.checkPriority(e,r,o,!1))},r.prototype.createPopupIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-hor-nav"),i="Extended"===this.overflowMode?i+" e-expended-nav":i,t=this.createElement("div",{id:t,className:i}),i=("msie"!==w.Browser.info.name&&"edge"!==w.Browser.info.name||t.classList.add("e-ie-align"),this.createElement("div",{className:et+" e-icons"}));t.appendChild(i),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),e.appendChild(t)},r.prototype.tbarPriRef=function(e,t,i,s,n,r,l,o,a){function d(e,t){return e.classList.contains(t)}var h,c,p,u=this.popObj.element,u=w.selectAll("."+mt+":not(."+lt+")",u).length;0===w.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length?(h=e.children[t-(t-i)-1],c=!w.isNullOrUndefined(h)&&d(h,gt),!w.isNullOrUndefined(h)&&d(h,b)&&!w.isVisible(h)||c?(h.style.display="unset",c=h.offsetWidth+2*parseFloat(window.getComputedStyle(h).marginRight),p=h.previousElementSibling,r+c<l||n?(e.insertBefore(s,e.children[t+o-(t-i)]),w.isNullOrUndefined(p)||(p.style.display="")):(w.setStyleAttribute(s,a),p.classList.contains(b)&&(p.style.display="none")),h.style.display=""):e.insertBefore(s,e.children[t+o-(t-i)])):e.insertBefore(s,e.children[t+o-u])},r.prototype.popupRefresh=function(e,t){var i,s=this,n=this.element,r=this.isVertical,l=n.querySelector("."+m),o=n.querySelector("."+at);w.isNullOrUndefined(o)||(l.removeAttribute("style"),e.style.display="block",n=r?n.offsetHeight-(o.offsetHeight+l.offsetHeight):n.offsetWidth-(o.offsetWidth+l.offsetWidth),i=0,[].slice.call(e.children).forEach(function(e){i+=s.popupEleWidth(e),w.setStyleAttribute(e,{position:""})}),n+(r?o.offsetHeight:o.offsetWidth)>i&&0===this.popupPriCount&&(t=!0),this.popupEleRefresh(n,e,t),e.style.display="",0===e.children.length&&o&&this.popObj&&(w.detach(o),this.popObj.destroy(),w.detach(this.popObj.element),this.popObj=null))},r.prototype.ignoreEleFetch=function(t,i){var e=[].slice.call(i.querySelectorAll("."+gt)),s=[],n=0;return 0<e.length?(e.forEach(function(e){s.push([].slice.call(i.children).indexOf(e))}),s.forEach(function(e){e<=t&&n++}),n):0},r.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild),s=(t.firstElementChild.style.removeProperty("Position"),e.offsetWidth-e.querySelector("."+at).offsetWidth),e=e.querySelector("."+m).offsetWidth;return t.style.removeProperty("display"),i+e<s},r.prototype.popupEleWidth=function(e){e.style.position="absolute";var t,i=window.getComputedStyle(e),i=this.isVertical?e.offsetHeight:e.offsetWidth+parseFloat(i.marginLeft)+parseFloat(i.marginRight),s=e.querySelector(".e-tbar-btn-text");return(e.classList.contains("e-tbtn-align")||e.classList.contains(rt))&&(t=e.children[0],!w.isNullOrUndefined(s)&&e.classList.contains(rt)?s.style.display="none":!w.isNullOrUndefined(s)&&e.classList.contains(nt)&&(s.style.display="block"),t.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),t.style.minWidth="",t.style.minHeight="",w.isNullOrUndefined(s)||(s.style.display="")),i},r.prototype.popupEleRefresh=function(r,e,l){for(var o,a,d=0<this.popupPriCount,h=this.tbarEle,c=this.element.querySelector("."+m),p=0,u=this,t=0,i=[].slice.call(e.children);t<i.length&&"break"!==function(e){var t,i,s,n;return e.classList.contains(vt)&&d&&!l?"continue":(t=u.popupEleWidth(e),e===u.tbarEle[0]&&(t+=u.tbarEleMrgn),e.style.position="",t<r||l?(i={minWidth:e.style.minWidth,height:e.style.height,minHeight:e.style.minHeight},w.setStyleAttribute(e,{minWidth:"",height:"",minHeight:""}),e.classList.contains(ot)||e.classList.remove(mt),a=u.tbarEle.indexOf(e),u.tbarAlign&&(s=u.items[parseInt(a.toString(),10)].align,a=u.tbarAlgEle[(s+"s").toLowerCase()].indexOf(e),h=u.tbarAlgEle[(s+"s").toLowerCase()],c=u.element.querySelector("."+m+" .e-toolbar-"+s.toLowerCase())),n=0,"Extended"!==u.overflowMode&&h.slice(0,a).forEach(function(e){(e.classList.contains(lt)||e.classList.contains(b))&&(e.classList.contains(b)&&(e.style.display="",r-=e.offsetWidth),n++)}),p=u.ignoreEleFetch(a,c),e.classList.contains(lt)?u.tbarPriRef(c,a,n,e,l,t,r,p,i):0===a?c.insertBefore(e,c.firstChild):(o=w.selectAll("."+lt,u.popObj.element).length,c.insertBefore(e,c.children[a+p-o])),r-=e.offsetWidth,void(e.style.height="")):"break")}(i[t]);t++);this.checkOverflow(this.element,this.element.getElementsByClassName(m)[0])&&!l&&this.renderOverflowMode()},r.prototype.removePositioning=function(){var e=this.element.querySelector("."+m);!w.isNullOrUndefined(e)&&e.classList.contains(ct)&&(this.remove(e,ct),(e=[].slice.call(e.childNodes))[1].removeAttribute("style"),e[2].removeAttribute("style"))},r.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+m);this.add(e,ct),this.itemPositioning()},r.prototype.itemPositioning=function(){var e,t,i,s=this.element.querySelector("."+m);w.isNullOrUndefined(s)||!s.classList.contains(ct)||(t=this.element.querySelector("."+at),e=this.scrollModule?(e=this.isVertical?"e-vscroll-content":"e-hscroll-content",[].slice.call(s.querySelector("."+e).children)):[].slice.call(s.childNodes),s=this.isVertical?e[0].offsetHeight+e[2].offsetHeight:e[0].offsetWidth+e[2].offsetWidth,i=this.isVertical?this.element.offsetHeight:this.element.offsetWidth,t&&(i-=this.isVertical?t.offsetHeight:t.offsetWidth,t=(this.isVertical?t.offsetHeight:t.offsetWidth)+"px",e[2].removeAttribute("style"),this.isVertical?this.enableRtl?e[2].style.top=t:e[2].style.bottom=t:this.enableRtl?e[2].style.left=t:e[2].style.right=t),i<=s)||(t=(i-s-(this.isVertical?e[1].offsetHeight:e[1].offsetWidth))/2,e[1].removeAttribute("style"),i=(this.isVertical?e[0].offsetHeight:e[0].offsetWidth)+t+"px",this.isVertical?this.enableRtl?e[1].style.marginBottom=i:e[1].style.marginTop=i:this.enableRtl?e[1].style.marginRight=i:e[1].style.marginLeft=i)},r.prototype.tbarItemAlign=function(e,t,i){var s,n,r=this;e.showAlwaysInPopup&&"Show"!==e.overflow||((s=[]).push(this.createElement("div",{className:"e-toolbar-left",attrs:{role:"group"}})),s.push(this.createElement("div",{className:ht,attrs:{role:"group"}})),s.push(this.createElement("div",{className:"e-toolbar-right",attrs:{role:"group"}})),0===i&&"Left"!==e.align?(s.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,ct)):"Left"!==e.align&&(i=t.childNodes,n=s[0],[].slice.call(i).forEach(function(e){r.tbarAlgEle.lefts.push(e),n.appendChild(e)}),t.appendChild(n),t.appendChild(s[1]),t.appendChild(s[2]),this.tbarAlign=!0,this.add(t,ct)))},r.prototype.ctrlTemplate=function(){var t=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,m),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach(function(e){"DIV"===e.tagName&&(t.tbarEle.push(e),w.isNullOrUndefined(e.firstElementChild)||e.firstElementChild.setAttribute("aria-disabled","false"),t.add(e,y))})},r.prototype.renderItems=function(){var e,t=this.element,i=this.items;null!=this.trgtEle?this.ctrlTemplate():t&&0<i.length&&(e=void 0,e=(e=t&&0<t.children.length?t.querySelector("."+m):e)||this.createElement("div",{className:m}),this.itemsAlign(i,e),t.appendChild(e))},r.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[parseInt(n.toString(),10)])?this.add(t,e[""+i]):t.setAttribute(i,e[""+i])},r.prototype.enableItems=function(e,t){function i(e,t){e?(t.classList.remove(st),w.isNullOrUndefined(t.firstElementChild)||(t.firstElementChild.setAttribute("aria-disabled","false"),n.updateTabIndex("0"))):(t.classList.add(st),w.isNullOrUndefined(t.firstElementChild)||(t.firstElementChild.setAttribute("aria-disabled","true"),t.firstElementChild.setAttribute("tabindex","-1"),n.updateTabIndex("0")))}var s,n=this,r=e,l=r.length;w.isNullOrUndefined(t)&&(t=!0);if(!w.isNullOrUndefined(l)&&1<=l){for(var o=0,a=[].slice.call(r);o<l;o++){var d=a[parseInt(o.toString(),10)];if("number"==typeof d){if(s=this.getElementByIndex(d),w.isNullOrUndefined(s))return;r[parseInt(o.toString(),10)]=s}else s=d;i(t,s)}t?w.removeClass(r,st):w.addClass(r,st)}else{if("number"==typeof r){if(s=this.getElementByIndex(r),w.isNullOrUndefined(s))return}else s=e;i(t,s)}},r.prototype.getElementByIndex=function(e){return this.tbarEle[parseInt(e.toString(),10)]?this.tbarEle[parseInt(e.toString(),10)]:null},r.prototype.addItems=function(e,t){this.extendedOpen();var i,s=this.element.querySelector("."+m);if(w.isNullOrUndefined(s))this.itemsRerender(e);else{var n,r="Left";w.isNullOrUndefined(t)&&(t=0),e.forEach(function(e){w.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==r||(r=e.align)});for(var l=0,o=e;l<o.length;l++){var a,d,h=o[l];w.isNullOrUndefined(h.type)&&(h.type="Button"),i=w.selectAll("."+y,this.element),h.align=r,n=this.renderSubComponent(h,t),this.tbarEle.length>=t&&0<=i.length&&(w.isNullOrUndefined(this.scrollModule)&&this.destroyMode(),a="L"===h.align[0]?0:"C"===h.align[0]?1:2,d=void 0,this.tbarAlign||"Left"===r?this.tbarAlign?((d=w.closest(i[0],"."+m).children[parseInt(a.toString(),10)]).insertBefore(n,d.children[parseInt(t.toString(),10)]),this.tbarAlgEle[(h.align+"s").toLowerCase()].splice(t,0,n),this.refreshPositioning()):0===i.length?(i=w.selectAll("."+m,this.element))[0].appendChild(n):i[0].parentNode.insertBefore(n,i[parseInt(t.toString(),10)]):(this.tbarItemAlign(h,s,1),this.tbarAlign=!0,(d=w.closest(i[0],"."+m).children[parseInt(a.toString(),10)]).appendChild(n),this.tbarAlgEle[(h.align+"s").toLowerCase()].push(n),this.refreshPositioning()),this.items.splice(t,0,h),h.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(t,0,n),t++,this.offsetWid=s.offsetWidth)}s.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},r.prototype.removeItems=function(e){var t=e,i=[].slice.call(w.selectAll("."+y,this.element));if("number"==typeof t)l=parseInt(e.toString(),10),this.removeItemByIndex(l,i);else if(t&&1<t.length)for(var s=0,n=[].slice.call(t);s<n.length;s++){var r=n[s],l=this.tbarEle.indexOf(r);this.removeItemByIndex(l,i),i=w.selectAll("."+y,this.element)}else{r=t&&t.length&&1===t.length?t[0]:e;l=i.indexOf(r),this.removeItemByIndex(l,i)}this.resize()},r.prototype.removeItemByIndex=function(e,t){var i,s;this.tbarEle[parseInt(e.toString(),10)]&&t[parseInt(e.toString(),10)]&&(i=this.tbarEle.indexOf(t[parseInt(e.toString(),10)]),this.tbarAlign&&(s=this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].indexOf(this.tbarEle[parseInt(i.toString(),10)]),this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].splice(parseInt(s.toString(),10),1)),this.isReact&&this.clearToolbarTemplate(t[parseInt(e.toString(),10)]),s=t[parseInt(e.toString(),10)].querySelector(".e-control.e-btn"),w.isNullOrUndefined(s)||w.isNullOrUndefined(s.ej2_instances[0])||s.ej2_instances[0].isDestroyed||s.ej2_instances[0].destroy(),w.EventHandler.remove(t[parseInt(e.toString(),10)],"click",this.itemClick),w.detach(t[parseInt(e.toString(),10)]),this.items.splice(i,1),this.tbarEle.splice(i,1))},r.prototype.templateRender=function(e,t,i,s){var n=i.type,r=e;if("object"==typeof e&&(a="function"==typeof r.appendTo),"string"!=typeof e&&a)"Input"===n&&(l=this.createElement("input"),i.id?l.id=i.id:l.id=w.getUniqueID("tbr-ipt"),t.appendChild(l),r.appendTo(l));else{var l,o,a=void 0,n=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i),i="string"==typeof e?e.trim():e;try{"object"!=typeof e||w.isNullOrUndefined(e.tagName)?"string"==typeof e&&n.test(i)?t.innerHTML=i:document.querySelectorAll(i).length?(o=(l=document.querySelector(i)).outerHTML.trim(),t.appendChild(l),l.style.display="",w.isNullOrUndefined(o)||this.tempId.push(i)):a=w.compile(i):t.appendChild(e)}catch(e){a=w.compile(i)}r=void 0;w.isNullOrUndefined(a)||(r=a({},this,"template",this.element.id+s+"_template",this.isStringTemplate,void 0,void 0,this.root)),!w.isNullOrUndefined(r)&&0<r.length&&[].slice.call(r).forEach(function(e){w.isNullOrUndefined(e.tagName)||(e.style.display=""),t.appendChild(e)})}this.add(t,it);n=t.firstElementChild;w.isNullOrUndefined(n)||(n.setAttribute("tabindex",w.isNullOrUndefined(n.getAttribute("tabIndex"))?"-1":this.getDataTabindex(n)),n.setAttribute("data-tabindex",w.isNullOrUndefined(n.getAttribute("tabIndex"))?"-1":this.getDataTabindex(n))),this.tbarEle.push(t)},r.prototype.buttonRendering=function(e,t){var i,s,n=this.createElement("button",{className:"e-tbar-btn"}),r=(n.setAttribute("type","button"),e.text),l=(e.id?n.id=e.id:n.id=w.getUniqueID("e-tbr-btn"),this.createElement("span",{className:"e-tbar-btn-text"})),r=(r?(l.innerHTML=this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(r):r,n.appendChild(l),n.classList.add("e-tbtn-txt")):this.add(t,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(s=e.prefixIcon&&e.suffixIcon||e.prefixIcon?(i=e.prefixIcon+" e-icons","Left"):(i=e.suffixIcon+" e-icons","Right")),new R.Button({iconCss:i,iconPosition:s}));return r.createElement=this.createElement,r.appendTo(n),e.width&&w.setStyleAttribute(n,{width:w.formatUnit(e.width)}),n},r.prototype.renderSubComponent=function(e,t){var i,s=this.createElement("div",{className:y}),n=this.createElement("div",{innerHTML:this.enableHtmlSanitizer&&!w.isNullOrUndefined(e.tooltipText)?w.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,s),e.tooltipText&&s.setAttribute("title",n.textContent),e.cssClass&&(s.className=s.className+" "+e.cssClass),e.template)this.templateRender(e.template,s,e,t);else switch(e.type){case"Button":(i=this.buttonRendering(e,s)).setAttribute("tabindex",w.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("data-tabindex",w.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("aria-label",e.text||e.tooltipText),i.setAttribute("aria-disabled","false"),s.appendChild(i),w.EventHandler.add(s,"click",this.itemClick,this);break;case"Separator":this.add(s,b)}return e.showTextOn&&("Toolbar"===(n=e.showTextOn)?(this.add(s,nt),this.add(s,"e-tbtn-align")):"Overflow"===n&&this.add(s,rt)),e.overflow&&("Show"===(t=e.overflow)?this.add(s,lt):"Hide"!==t||s.classList.contains(b)||this.add(s,ot)),"Show"!==e.overflow&&e.showAlwaysInPopup&&!s.classList.contains(b)&&(this.add(s,vt),this.popupPriCount++),e.disabled&&this.add(s,st),!1===e.visible&&this.add(s,yt),s},r.prototype.getDataTabindex=function(e){return w.isNullOrUndefined(e.getAttribute("data-tabindex"))?"-1":e.getAttribute("data-tabindex")},r.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},r.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},r.prototype.activeEleRemove=function(e){var t,i=this.element.querySelector("."+y+":not(."+st+" ):not(."+b+" ):not(."+yt+" )");w.isNullOrUndefined(this.activeEle)||(this.activeEle.setAttribute("tabindex",this.getDataTabindex(this.activeEle)),i&&i.removeAttribute("tabindex"),i=this.activeEle),this.activeEle=e,"-1"===this.getDataTabindex(this.activeEle)&&(w.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains(it)?(!w.isNullOrUndefined(this.element.querySelector(".e-hor-nav"))&&this.element.querySelector(".e-hor-nav").classList.contains("e-nav-active")?(this.updateTabIndex("0"),t="-1"===this.getDataTabindex(i)?"0":this.getDataTabindex(i),i.setAttribute("tabindex",t)):this.updateTabIndex("-1"),e.removeAttribute("tabindex")):(i=parseInt(this.getDataTabindex(this.activeEle),10)+1,this.activeEle.setAttribute("tabindex",i.toString())))},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.getModuleName=function(){return"toolbar"},r.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},r.prototype.resize=function(){var e,t=this.element,i=(this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide(),this.checkOverflow(t,t.getElementsByClassName(m)[0]));i||(this.destroyScroll(),e=t.querySelector("."+m),w.isNullOrUndefined(e))||(this.remove(e,St),this.tbarAlign&&this.add(e,ct)),i&&this.scrollModule&&this.offsetWid===t.offsetWidth||((this.offsetWid>t.offsetWidth||i)&&this.renderOverflowMode(),this.popObj&&("Extended"===this.overflowMode&&(this.popObj.width=this.getToolbarPopupWidth(this.element)),this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign)&&this.refreshPositioning(),this.element.querySelector("."+pt)&&(this.scrollStep=this.element.querySelector("."+pt).offsetWidth),this.offsetWid=t.offsetWidth,this.tbResize=!1,this.separator())},r.prototype.orientationChange=function(){var e=this;setTimeout(function(){e.resize()},500)},r.prototype.extendedOpen=function(){var e=this.element.querySelector("."+Et);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains(tt))},r.prototype.updateHideEleTabIndex=function(e,t,i,s,n){i&&(s=n.indexOf(e));for(var r=n[++s];r;){if(!this.eleContains(r)){var l=r.firstElementChild.getAttribute("data-tabindex");t&&"-1"===l?r.firstElementChild.setAttribute("tabindex","0"):l!==r.firstElementChild.getAttribute("tabindex")&&r.firstElementChild.setAttribute("tabindex",l);break}r=n[++s]}},r.prototype.clearToolbarTemplate=function(e){if(this.registeredTemplate&&this.registeredTemplate.template)for(var t=this.registeredTemplate,i=0;i<t.template.length;i++){var s=t.template[parseInt(i.toString(),10)].rootNodes[0],n=w.closest(s,"."+y);if(!w.isNullOrUndefined(n)&&n===e){this.clearTemplate(["template"],[t.template[parseInt(i.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var r=this.portals,i=0;i<r.length;i++){var l=r[parseInt(i.toString(),10)],n=w.closest(l.containerInfo,"."+y);if(!w.isNullOrUndefined(n)&&n===e){this.clearTemplate(["template"],i);break}}},r.prototype.onPropertyChanged=function(e,t){var i=this.element;this.extendedOpen();for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"items":if(e.items instanceof Array&&t.items instanceof Array)this.itemsRerender(e.items);else for(var r=Object.keys(e.items),l=0;l<r.length;l++){var o=parseInt(Object.keys(e.items)[parseInt(l.toString(),10)],10),a=Object.keys(e.items[parseInt(o.toString(),10)])[0],d=Object(e.items[parseInt(o.toString(),10)])[""+a];if(this.tbarAlign||"align"===a){this.refresh(),this.trigger("created");break}var h="overflow"===a&&0!==this.popupPriCount,a=(("showAlwaysInPopup"===a&&!d||this.items[parseInt(o.toString(),10)].showAlwaysInPopup&&h)&&--this.popupPriCount,w.isNullOrUndefined(this.scrollModule)&&this.destroyMode(),[].slice.call(w.selectAll("."+m+" ."+y,i)));this.isReact&&this.items[parseInt(o.toString(),10)].template&&this.clearToolbarTemplate(a[parseInt(o.toString(),10)]),this.element.closest(".e-richtexteditor")&&(d=a[parseInt(o.toString(),10)].querySelector(".e-control.e-btn"),w.isNullOrUndefined(d)||w.isNullOrUndefined(d.ej2_instances[0])||d.ej2_instances[0].isDestroyed||d.ej2_instances[0].destroy()),w.EventHandler.remove(a[parseInt(o.toString(),10)],"click",this.itemClick),w.detach(a[parseInt(o.toString(),10)]),this.tbarEle.splice(o,1),this.addItems([this.items[parseInt(o.toString(),10)]],o),this.items.splice(o,1),this.items[parseInt(o.toString(),10)].template&&this.tbarEle.splice(this.items.length,1)}break;case"width":w.setStyleAttribute(i,{width:w.formatUnit(e.width)}),this.refreshOverflow();break;case"height":w.setStyleAttribute(this.element,{height:w.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(i,Ze),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(i,Ze):this.remove(i,Ze),w.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,Ze):this.remove(this.scrollModule.element,Ze)),w.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,Ze):this.remove(this.popObj.element,Ze)),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":t.cssClass&&w.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&w.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}},r.prototype.hideItem=function(e,t){var i,s,n="object"==typeof e,r=e;!n&&w.isNullOrUndefined(r)||(i=[].slice.call(w.selectAll("."+y,this.element)),n?s=e:this.tbarEle[parseInt(r.toString(),10)]&&(s=[].slice.call(w.selectAll("."+y,this.element))[parseInt(r.toString(),10)]),s&&(t?(s.classList.add(yt),s.classList.contains(b)||!w.isNullOrUndefined(s.firstElementChild.getAttribute("tabindex"))&&"-1"===s.firstElementChild.getAttribute("tabindex")||this.updateHideEleTabIndex(s,t,n,r,i)):(s.classList.remove(yt),s.classList.contains(b)||this.updateHideEleTabIndex(s,t,n,r,i)),this.refreshOverflow()))},n([w.Collection([],Ot)],r.prototype,"items",void 0),n([w.Property("auto")],r.prototype,"width",void 0),n([w.Property("auto")],r.prototype,"height",void 0),n([w.Property("")],r.prototype,"cssClass",void 0),n([w.Property("Scrollable")],r.prototype,"overflowMode",void 0),n([w.Property()],r.prototype,"scrollStep",void 0),n([w.Property(!0)],r.prototype,"enableCollision",void 0),n([w.Property(!0)],r.prototype,"enableHtmlSanitizer",void 0),n([w.Property(!0)],r.prototype,"allowKeyboard",void 0),n([w.Event()],r.prototype,"clicked",void 0),n([w.Event()],r.prototype,"created",void 0),n([w.Event()],r.prototype,"destroyed",void 0),n([w.Event()],r.prototype,"beforeCreate",void 0),n([w.Event()],r.prototype,"keyDown",void 0);var kt,Lt=n([w.NotifyPropertyChanges],r);function r(e,t){e=kt.call(this,e,t)||this;return e.resizeContext=e.resize.bind(e),e.orientationChangeContext=e.orientationChange.bind(e),e.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},e}At=function(e,t){return(At=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 At,Tt,e=function(e,t){function i(){this.constructor=e}At(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Dt="e-acrdn-root",Pt="e-acrdn-ctrl",Mt="e-accordion",Ht="e-acrdn-item",Ut="e-item-focus",Rt="e-focused",Bt="e-hide",Vt="e-acrdn-header",jt="e-acrdn-header-content",Ft="e-acrdn-panel",qt="e-acrdn-content",Wt="e-toggle-icon",_t="e-expand-icon",zt="e-rtl",Kt="e-content-hide",Xt="e-select",Yt="e-selected",Gt="e-active",Qt="e-overlay",Jt="e-toggle-animation",Zt="e-expand-state",$t="e-accordion-container",ei=(Tt=w.ChildProperty,e(ti,Tt),n([w.Property("SlideDown")],ti.prototype,"effect",void 0),n([w.Property(400)],ti.prototype,"duration",void 0),n([w.Property("linear")],ti.prototype,"easing",void 0),ti);function ti(){return null!==Tt&&Tt.apply(this,arguments)||this}ii=w.ChildProperty,e(ni,ii),n([w.Complex({effect:"SlideUp",duration:400,easing:"linear"},ei)],ni.prototype,"collapse",void 0),n([w.Complex({effect:"SlideDown",duration:400,easing:"linear"},ei)],ni.prototype,"expand",void 0);var ii,si=ni;function ni(){return null!==ii&&ii.apply(this,arguments)||this}ri=w.ChildProperty,e(oi,ri),n([w.Property(null)],oi.prototype,"content",void 0),n([w.Property(null)],oi.prototype,"header",void 0),n([w.Property(null)],oi.prototype,"cssClass",void 0),n([w.Property(null)],oi.prototype,"iconCss",void 0),n([w.Property(!1)],oi.prototype,"expanded",void 0),n([w.Property(!0)],oi.prototype,"visible",void 0),n([w.Property(!1)],oi.prototype,"disabled",void 0),n([w.Property()],oi.prototype,"id",void 0);var ri,li=oi;function oi(){return null!==ri&&ri.apply(this,arguments)||this}ai=w.Component,e(l,ai),l.prototype.destroy=function(){(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var t=this.element;if(ai.prototype.destroy.call(this),this.unWireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(t.children).forEach(function(e){t.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)t.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}t.classList.remove(Dt),t.classList.remove(Pt),t.removeAttribute("style"),this.element.removeAttribute("data-ripple"),!this.isNested&&w.isRippleEnabled&&this.removeRippleEffect()},l.prototype.preRender=function(){var e=w.closest(this.element,"."+Ft);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains(Mt)&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add(Dt),this.enableRtl&&this.add(this.element,zt),this.element.classList.add(Pt)},l.prototype.add=function(e,t){e.classList.add(t)},l.prototype.remove=function(e,t){e.classList.remove(t)},l.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},l.prototype.initialize=function(){var e=w.formatUnit(this.width),t=w.formatUnit(this.height);w.setStyleAttribute(this.element,{width:e,height:t}),w.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),!w.isNullOrUndefined(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices)},l.prototype.renderControl=function(){this.trgtEle=0<this.element.children.length?w.select("div",this.element):null,this.renderItems(),this.initItemExpand()},l.prototype.wireFocusEvents=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Ht));e<t.length;e++){var i=t[e],s=i.querySelector("."+Vt);0<i.childElementCount&&s&&(w.EventHandler.clearEvents(s),w.EventHandler.add(s,"focus",this.focusIn,this),w.EventHandler.add(s,"blur",this.focusOut,this))}},l.prototype.unWireEvents=function(){w.EventHandler.remove(this.element,"click",this.clickHandler),w.EventHandler.remove(this.element,"keydown",this.keyDownHandler),w.EventHandler.remove(document,"keydown",this.keyDownHandler),w.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),w.isNullOrUndefined(this.keyModule)||this.keyModule.destroy();for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Vt));e<t.length;e++){var i=t[e];w.EventHandler.clearEvents(i)}},l.prototype.wireEvents=function(){w.EventHandler.add(this.element,"click",this.clickHandler,this),w.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),w.EventHandler.add(document,"keydown",this.keyDownHandler,this),w.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=w.rippleEffect(this.element,{selector:"."+Vt})),this.isNested||(this.keyModule=new w.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},l.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?w.compile(document.querySelector(t).innerHTML.trim()):w.compile(t)}catch(e){return w.compile(t)}},l.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},l.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},l.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},l.prototype.getItemTemplate=function(){return this.itemTemplateFn},l.prototype.focusIn=function(e){e=e.target.parentElement;e.classList.add(Ut),this.isKeyboardNavigation&&(e.classList.add(Rt),this.isKeyboardNavigation=!1)},l.prototype.focusOut=function(e){e=e.target.parentElement;e.classList.remove(Ut),e.classList.remove(Rt)},l.prototype.keyDownHandler=function(e){"Tab"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key||(this.isKeyboardNavigation=!0)},l.prototype.mouseDownHandler=function(e){this.isKeyboardNavigation=!1,e.target.parentElement.classList.remove(Rt)},l.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e=w.select("."+$t,this.element),t=(e||this.element).children,i=[];[].slice.call(t).forEach(function(e){i.push({header:0<e.childElementCount&&e.children[0]?e.children[0]:"",content:1<e.childElementCount&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),e&&this.element.removeChild(e),this.setProperties({items:i},!0)},l.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:Wt}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},l.prototype.initItemExpand=function(){var e=this.initExpand.length;if(0!==e){if("Single"===this.expandMode)this.expandItem(!0,this.initExpand[e-1]);else for(var t=0;t<e;t++)this.expandItem(!0,this.initExpand[parseInt(t.toString(),10)]);this.isReact&&this.renderReactTemplates()}},l.prototype.renderItems=function(){var i,s,e,n=this,r=this.element;w.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),!w.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length?this.dataSource.forEach(function(e,t){s=n.renderInnerItem(e,t),r.appendChild(s),0<s.childElementCount&&(w.EventHandler.add(s.querySelector("."+Vt),"focus",n.focusIn,n),w.EventHandler.add(s.querySelector("."+Vt),"blur",n.focusOut,n))}):(e=this.items,r&&0<e.length&&e.forEach(function(e,t){i=n.renderInnerItem(e,t),r.appendChild(i),0<i.childElementCount&&(w.EventHandler.add(i.querySelector("."+Vt),"focus",n.focusIn,n),w.EventHandler.add(i.querySelector("."+Vt),"blur",n.focusOut,n))})),this.isReact&&this.renderReactTemplates()},l.prototype.clickHandler=function(e){var t,i,s,n,r,l,o=e.target,a=this.getItems(),d={};w.closest(o,"."+Mt)===this.element&&(o.classList.add("e-target"),i=w.closest(o,"."+Ht),s=w.closest(o,"."+Vt),n=w.closest(o,"."+Ft),i&&(w.isNullOrUndefined(s)||w.isNullOrUndefined(n))&&(s=i.children[0],n=i.children[1]),s&&(t=w.select("."+Wt,s)),s?r=w.closest(s,"."+Ht):n&&(r=w.closest(n,"."+Ht)),l=this.getIndexByItem(i),r&&(d.item=a[this.getIndexByItem(r)]),d.originalEvent=e,!w.isNullOrUndefined(t)&&i.childElementCount<=1&&(w.isNullOrUndefined(n)||!w.isNullOrUndefined(w.select("."+Vt+" ."+Wt,r)))&&(i.appendChild(this.contentRendering(l)),this.ariaAttrUpdate(i)),this.afterContentRender(o,d,i,s,n,r),this.isReact)&&this.renderReactTemplates()},l.prototype.afterContentRender=function(o,e,a,d,h,c){var p=this,u=[];this.trigger("clicked",e,function(e){if(!e.cancel){var e=h&&!w.isNullOrUndefined(w.select(".e-target",h)),t=h&&!w.isNullOrUndefined(w.select("."+Mt,h))&&w.isNullOrUndefined(w.closest(o,".e-acrdn-panel .e-accordion")),i=h&&w.isNullOrUndefined(w.select("."+Mt,h))||!(w.closest(o,"."+Mt)===p.element),e=e&&(t||i);if(o.classList.remove("e-target"),!(o.classList.contains(Ft)||o.classList.contains(qt)||e)){t=p.element.querySelector("."+$t),i=(t||p.element).children,e=([].slice.call(i).forEach(function(e){e.classList.contains(Gt)&&u.push(e)}),[].slice.call(p.element.querySelectorAll("."+Ht+" [e-animate]")));if(0<e.length)for(var s=0,n=e;s<n.length;s++){var r=n[s];u.push(r.parentElement)}var l,t=-1!==u.indexOf(c)&&"true"===h.getAttribute("e-animate");w.isNullOrUndefined(a)||w.isNullOrUndefined(d)||(i=w.select("."+Ft,a),e=w.closest(a,"."+Dt).querySelector("."+Zt),w.isNullOrUndefined(i))||(l=e===a,!w.isVisible(i)||t&&!c.classList.contains(Yt)?(0<u.length&&"Single"===p.expandMode&&!t&&u.forEach(function(e){p.collapse(w.select("."+Ft,e)),e.classList.remove(Zt)}),p.expand(i)):p.collapse(i),w.isNullOrUndefined(e))||l||e.classList.remove(Zt)}}})},l.prototype.eleMoveFocus=function(e,t,i){var s,n=w.closest(i,"."+Ht);i===t?s=("moveUp"===e?i.lastElementChild:i).querySelector("."+Vt):i.classList.contains(Vt)&&(n="moveUp"===e?n.previousElementSibling:n.nextElementSibling)&&(s=w.select("."+Vt,n)),s&&s.focus()},l.prototype.keyActionHandler=function(e){var t=e.target,i=w.closest(e.target,Vt);if(!w.isNullOrUndefined(i)||t.classList.contains(Mt)||t.classList.contains(Vt)){var s,n=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,n,t);break;case"space":case"enter":s=t.nextElementSibling,(w.isNullOrUndefined(s)||!s.classList.contains(Ft)||"true"!==s.getAttribute("e-animate"))&&t.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?n.firstElementChild:n.lastElementChild).children[0].focus(),e.preventDefault()}}},l.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:Vt,id:w.getUniqueID("acrdn_header")});return w.attributes(e,{tabindex:"0",role:"button","aria-disabled":"false","aria-expanded":"false"}),e},l.prototype.renderInnerItem=function(e,t){var i,s,n=this.createElement("div",{className:Ht,id:e.id||w.getUniqueID("acrdn_item")}),r=(this.headerTemplate?(s=this.headerEleGenerate(),r=this.createElement("div",{className:jt}),s.appendChild(r),w.append(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),r),n.appendChild(s),s.appendChild(this.toggleIconGenerate()),this.add(n,Xt)):e.header&&this.angularnativeCondiCheck(e,"header")&&(i=e.header,this.enableHtmlSanitizer&&"string"==typeof e.header&&(i=w.SanitizeHtmlHelper.sanitize(e.header)),s=this.headerEleGenerate(),r=this.createElement("div",{className:jt}),s.appendChild(r),s.appendChild(this.fetchElement(r,i,t)),n.appendChild(s)),w.select("."+Vt,n));return!e.expanded||w.isNullOrUndefined(t)||this.enablePersistence||-1===this.initExpand.indexOf(t)&&this.initExpand.push(t),e.cssClass&&w.addClass([n],e.cssClass.split(" ")),e.disabled&&w.addClass([n],Qt),!1===e.visible&&w.addClass([n],Bt),e.iconCss&&(i=this.createElement("div",{className:"e-acrdn-header-icon"}),s=this.createElement("span",{className:e.iconCss+" e-icons"}),i.appendChild(s),w.isNullOrUndefined(r)?((r=this.headerEleGenerate()).appendChild(i),n.appendChild(r)):r.insertBefore(i,r.childNodes[0])),e.content&&this.angularnativeCondiCheck(e,"content")&&!this.headerTemplate&&(t=this.toggleIconGenerate(),w.isNullOrUndefined(r)&&(r=this.headerEleGenerate(),n.appendChild(r)),r.appendChild(t),this.add(n,Xt)),n},l.prototype.angularnativeCondiCheck=function(e,t){t="content"===t?e.content:e.header;return!(this.isAngular&&!w.isNullOrUndefined(t.elementRef)&&(e=t.elementRef.nativeElement.data,!w.isNullOrUndefined(e))&&""!==e&&-1!==e.indexOf("bindings=")&&(e=JSON.parse(t.elementRef.nativeElement.data.replace("bindings=","")),!w.isNullOrUndefined(e))&&"false"===e["ng-reflect-ng-if"])},l.prototype.fetchElement=function(t,i,e){var s,n,r,l;try{document.querySelectorAll(i).length&&"Button"!==i?(n=(r=document.querySelector(i)).outerHTML.trim(),t.appendChild(r),r.style.display=""):s=w.compile(i)}catch(e){"string"==typeof i?t.innerHTML=this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(i):i:i instanceof HTMLElement?(t.appendChild(i),this.trgtEle&&(t.firstElementChild.style.display="")):s=w.compile(i)}return w.isNullOrUndefined(s)||(this.isReact&&this.renderReactTemplates(),l=r=void 0,t.classList.contains(jt)?(r=this.element.id+e+"_header",l="header"):t.classList.contains(qt)&&(r=this.element.id+e+"_content",l="content"),l=s({},this,l,r,this.isStringTemplate)),w.isNullOrUndefined(l)||!(0<l.length)||w.isNullOrUndefined(l[0].tagName)&&1===l.length?0===t.childElementCount&&(t.innerHTML=this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(i):i):[].slice.call(l).forEach(function(e){w.isNullOrUndefined(e.tagName)||(e.style.display=""),t.appendChild(e)}),w.isNullOrUndefined(n)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),t},l.prototype.ariaAttrUpdate=function(e){var t=w.select("."+Vt,e),e=w.select("."+Ft,e);t.setAttribute("aria-controls",e.id),e.setAttribute("aria-labelledby",t.id),e.setAttribute("role","region")},l.prototype.contentRendering=function(e){var t,i=this.createElement("div",{className:Ft+" "+Kt,id:w.getUniqueID("acrdn_panel")}),s=(w.attributes(i,{"aria-hidden":"true"}),this.createElement("div",{className:qt}));return!w.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length?(this.isReact&&this.renderReactTemplates(),w.isNullOrUndefined(this.getItemTemplate())?i.appendChild(this.fetchElement(s,this.dataSource[parseInt(e.toString(),10)].content,e)):(w.append(this.getItemTemplate()(this.dataSource[parseInt(e.toString(),10)],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s))):(t=this.items[parseInt(e.toString(),10)].content,this.enableHtmlSanitizer&&"string"==typeof t&&(t=w.SanitizeHtmlHelper.sanitize(t)),i.appendChild(this.fetchElement(s,t,e))),i},l.prototype.expand=function(t){var i,s,n,r=this,e=this.getItems(),l=w.closest(t,"."+Ht);w.isNullOrUndefined(t)||w.isVisible(t)&&"true"!==t.getAttribute("e-animate")||l.classList.contains(Qt)||(i=w.closest(l,"."+Dt).querySelector("."+Zt),s={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},n=w.select("."+Wt,l).firstElementChild,e={element:l,item:e[this.getIndexByItem(l)],index:this.getIndexByItem(l),content:l.querySelector("."+Ft),isExpanded:!0},this.trigger("expanding",e,function(e){e.cancel||(n.classList.add(Jt),r.expandedItemsPush(l),w.isNullOrUndefined(i)||i.classList.remove(Zt),l.classList.add(Zt),"None"===s.name&&"Enable"!==w.animationMode||"Disable"===w.animationMode?(r.expandProgress("begin",n,t,l,e),r.expandProgress("end",n,t,l,e)):r.expandAnimation(s.name,n,t,l,s,e))}))},l.prototype.expandAnimation=function(e,t,i,s,n,r){var l,o=this;"None"===e&&"Enable"===w.animationMode&&(n.name=e="SlideDown"),this.lastActiveItemId=s.id,"SlideDown"===e?(n.begin=function(){o.expandProgress("begin",t,i,s,r),i.style.position="absolute",l=s.offsetHeight,i.style.maxHeight=i.offsetHeight+"px",s.style.maxHeight=""},n.progress=function(){s.style.minHeight=l+i.offsetHeight+"px"},n.end=function(){w.setStyleAttribute(i,{position:"",maxHeight:""}),s.style.minHeight="",o.expandProgress("end",t,i,s,r)}):(n.begin=function(){o.expandProgress("begin",t,i,s,r)},n.end=function(){o.expandProgress("end",t,i,s,r)}),new w.Animation(n).animate(i)},l.prototype.expandProgress=function(e,t,i,s,n){this.remove(i,Kt),this.add(s,Yt),this.add(t,_t),"end"===e&&(this.add(s,Gt),i.setAttribute("aria-hidden","false"),w.attributes(i.previousElementSibling,{"aria-expanded":"true"}),t.classList.remove(Jt),this.trigger("expanded",n))},l.prototype.expandedItemsPush=function(e){var t,e=this.getIndexByItem(e);-1===this.expandedIndices.indexOf(e)&&((t=[].slice.call(this.expandedIndices)).push(e),this.setProperties({expandedIndices:t},!0))},l.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},l.prototype.getItemElements=function(){var t=[],e=this.element.children;return[].slice.call(e).forEach(function(e){e.classList.contains(Ht)&&t.push(e)}),t},l.prototype.expandedItemsPop=function(e){var e=this.getIndexByItem(e),t=[].slice.call(this.expandedIndices);t.splice(t.indexOf(e),1),this.setProperties({expandedIndices:t},!0)},l.prototype.collapse=function(t){var i,s,n,e,r=this;w.isNullOrUndefined(t)||(e=this.getItems(),i=w.closest(t,"."+Ht),w.isVisible(t)&&!i.classList.contains(Qt)&&(s={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},n=w.select("."+Wt,i).firstElementChild,e={element:i,item:e[this.getIndexByItem(i)],index:this.getIndexByItem(i),content:i.querySelector("."+Ft),isExpanded:!1},this.trigger("expanding",e,function(e){e.cancel||(r.expandedItemsPop(i),i.classList.remove(Zt),n.classList.add(Jt),"None"===s.name&&"Enable"!==w.animationMode||"Disable"===w.animationMode?(r.collapseProgress("begin",n,t,i,e),r.collapseProgress("end",n,t,i,e)):r.collapseAnimation(s.name,t,i,n,s,e))})))},l.prototype.collapseAnimation=function(e,t,i,s,n,r){var l,o,a,d,h=this;"None"===e&&"Enable"===w.animationMode&&(n.name=e="SlideUp"),this.lastActiveItemId=i.id,"SlideUp"===e?(n.begin=function(){a=i.offsetHeight,i.style.minHeight=a+"px",t.style.position="absolute",l=i.offsetHeight,o=t.offsetHeight,t.style.maxHeight=o+"px",h.collapseProgress("begin",s,t,i,r)},n.progress=function(){(d=l-(o-t.offsetHeight))<a&&(i.style.minHeight=d+"px")},n.end=function(){t.style.display="none",h.collapseProgress("end",s,t,i,r),i.style.minHeight="",w.setStyleAttribute(t,{position:"",maxHeight:"",display:""})}):(n.begin=function(){h.collapseProgress("begin",s,t,i,r)},n.end=function(){h.collapseProgress("end",s,t,i,r)}),new w.Animation(n).animate(t)},l.prototype.collapseProgress=function(e,t,i,s,n){this.remove(t,_t),this.remove(s,Yt),"end"===e&&(this.add(i,Kt),t.classList.remove(Jt),this.remove(s,Gt),i.setAttribute("aria-hidden","true"),w.attributes(i.previousElementSibling,{"aria-expanded":"false"}),this.trigger("expanded",n))},l.prototype.getModuleName=function(){return"accordion"},l.prototype.getItems=function(){var e=this.itemTemplate&&this.headerTemplate?this.dataSource:this.items;return e},l.prototype.addItem=function(e,s){var n=this,r=this.element,l=this.getItemElements(),o=this.getItems();w.isNullOrUndefined(s)&&(s=o.length),r.childElementCount>=s&&(e instanceof Array?e:[e]).forEach(function(e,t){var t=s+t,i=(o.splice(t,0,e),n.renderInnerItem(e,t));r.childElementCount===t?r.appendChild(i):r.insertBefore(i,l[parseInt(t.toString(),10)]),w.EventHandler.add(i.querySelector("."+Vt),"focus",n.focusIn,n),w.EventHandler.add(i.querySelector("."+Vt),"blur",n.focusOut,n),n.expandedIndices=[],n.expandedItemRefresh(),e&&e.expanded&&n.expandItem(!0,t)}),this.isReact&&this.renderReactTemplates()},l.prototype.expandedItemRefresh=function(){var t=this,e=this.getItemElements();[].slice.call(e).forEach(function(e){e.classList.contains(Yt)&&t.expandedItemsPush(e)})},l.prototype.removeItem=function(e){(this.isReact||this.isAngular)&&(i=w.selectAll("."+Ht,this.element)[parseInt(e.toString(),10)],t=w.select("."+jt,i),i=w.select("."+qt,i),this.clearAccordionTemplate(t,0<this.dataSource.length?"headerTemplate":"header",jt),this.clearAccordionTemplate(i,0<this.dataSource.length?"itemTemplate":"content",qt));var t=this.getItemElements()[parseInt(e.toString(),10)],i=this.getItems();w.isNullOrUndefined(t)||(this.restoreContent(e),w.detach(t),i.splice(e,1),this.expandedIndices=[],this.expandedItemRefresh())},l.prototype.select=function(e){e=this.getItemElements()[parseInt(e.toString(),10)];w.isNullOrUndefined(e)||w.isNullOrUndefined(w.select("."+Vt,e))||e.children[0].focus()},l.prototype.hideItem=function(e,t){e=this.getItemElements()[parseInt(e.toString(),10)];w.isNullOrUndefined(e)||((t=w.isNullOrUndefined(t)?!0:t)?this.add(e,Bt):this.remove(e,Bt))},l.prototype.enableItem=function(e,t){var i,s=this.getItemElements()[parseInt(e.toString(),10)];w.isNullOrUndefined(s)||(i=s.firstElementChild,t?(this.remove(s,Qt),w.attributes(i,{tabindex:"0","aria-disabled":"false"}),i.focus()):(s.classList.contains(Gt)&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,i)),this.add(s,Qt),i.setAttribute("aria-disabled","true"),i.removeAttribute("tabindex")))},l.prototype.expandItem=function(t,e){var i,s,n,r=this,l=this.getItemElements();w.isNullOrUndefined(e)?"Single"===this.expandMode&&t?(n=l[l.length-1],this.itemExpand(t,n,this.getIndexByItem(n))):(i=w.select("#"+this.lastActiveItemId,this.element),[].slice.call(l).forEach(function(e){r.itemExpand(t,e,r.getIndexByItem(e)),e.classList.remove(Zt)}),(s=w.select("."+Zt,this.element))&&s.classList.remove(Zt),i&&i.classList.add(Zt)):(n=l[parseInt(e.toString(),10)],w.isNullOrUndefined(n)||!n.classList.contains(Xt)||n.classList.contains(Gt)&&t||("Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(t,n,e)))},l.prototype.itemExpand=function(e,t,i){var s=t.children[1];t.classList.contains(Qt)||(w.isNullOrUndefined(s)&&e?(s=this.contentRendering(i),t.appendChild(s),this.ariaAttrUpdate(t),this.expand(s)):w.isNullOrUndefined(s)||(e?this.expand(s):this.collapse(s)),this.isReact&&this.renderReactTemplates())},l.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+Ht)).forEach(function(e){var t=w.select("."+Vt,e);t&&w.EventHandler.clearEvents(t),w.detach(e)})},l.prototype.restoreContent=function(e){var t=w.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+Ht)[parseInt(e.toString(),10)];this.templateEle.forEach(function(e){w.isNullOrUndefined(t.querySelector(e))||(document.body.appendChild(t.querySelector(e)).style.display="none")})},l.prototype.updateItem=function(e,t){var i,s,n;w.isNullOrUndefined(e)||(i=(s=this.getItems())[parseInt(t.toString(),10)],s.splice(t,1),this.restoreContent(t),s=w.select("."+jt,e),n=w.select("."+qt,e),(this.isReact||this.isAngular)&&(this.clearAccordionTemplate(s,"header",jt),this.clearAccordionTemplate(n,"content",qt)),w.detach(e),this.addItem(i,t))},l.prototype.setTemplate=function(e,t,i){this.fetchElement(t,e,i),this.isReact&&this.renderReactTemplates()},l.prototype.clearAccordionTemplate=function(e,t,i){if(this.registeredTemplate&&this.registeredTemplate[""+t])for(var s=this.registeredTemplate,n=0;n<s[""+t].length;n++){var r=s[""+t][parseInt(n.toString(),10)].rootNodes[0],l=w.closest(r,"."+i);if(!w.isNullOrUndefined(l)&&l===e||w.isNullOrUndefined(r.parentNode)){this.clearTemplate([t],[s[""+t][parseInt(n.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var o=this.portals,n=0;n<o.length;n++){var a=o[parseInt(n.toString(),10)],l=w.closest(a.containerInfo,"."+i);if(!w.isNullOrUndefined(l)&&l===e){this.clearTemplate([t],n);break}}},l.prototype.getPersistData=function(){return this.addOnPersist(["expandedIndices"])},l.prototype.onPropertyChanged=function(e,t){for(var i=this.element,s=!1,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"items":if(e.items instanceof Array&&t.items instanceof Array)s=!0;else for(var l=Object.keys(e.items),o=0;o<l.length;o++)for(var a=parseInt(Object.keys(e.items)[parseInt(o.toString(),10)],10),d=Object.keys(e.items[parseInt(a.toString(),10)]),h=0;h<d.length;h++){var c=w.selectAll("."+Ht,this.element)[parseInt(a.toString(),10)],p=Object(t.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]],u=Object(e.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]],m=d[parseInt(h.toString(),10)],f=w.select("."+qt,c);("header"===m||"iconCss"===m||"expanded"===m||"content"===m&&""===p)&&this.updateItem(c,a),"cssClass"!==d[parseInt(h.toString(),10)]||w.isNullOrUndefined(c)||(p&&w.removeClass([c],p.split(" ")),u&&w.addClass([c],u.split(" "))),"visible"!==d[parseInt(h.toString(),10)]||w.isNullOrUndefined(c)||(!1===Object(e.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]]?c.classList.add(Bt):c.classList.remove(Bt)),"disabled"!==d[parseInt(h.toString(),10)]||w.isNullOrUndefined(c)||this.enableItem(a,!u),d.indexOf("header")<0&&"content"===d[parseInt(h.toString(),10)]&&!w.isNullOrUndefined(c)&&2===c.children.length&&("function"==typeof u?((this.isAngular||this.isReact)&&this.clearAccordionTemplate(f,d[parseInt(h.toString(),10)],qt),(m=c.querySelector("."+qt)).innerHTML="",this.setTemplate(u,m,a)):(c.classList.contains(Yt)&&this.expandItem(!1,a),w.detach(c.querySelector("."+Ft))))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),s=!0;break;case"headerTemplate":this.initializeHeaderTemplate(),s=!0;break;case"itemTemplate":this.initializeItemTemplate(),s=!0;break;case"enableRtl":e.enableRtl?this.add(i,zt):this.remove(i,zt);break;case"height":w.setStyleAttribute(this.element,{height:w.formatUnit(e.height)});break;case"width":w.setStyleAttribute(this.element,{width:w.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode&&!w.isNullOrUndefined(this.expandedIndices)&&1<this.expandedIndices.length&&this.expandItem(!1)}s&&(this.initExpand=[],!w.isNullOrUndefined(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},n([w.Collection([],li)],l.prototype,"items",void 0),n([w.Property([])],l.prototype,"dataSource",void 0),n([w.Property()],l.prototype,"itemTemplate",void 0),n([w.Property()],l.prototype,"headerTemplate",void 0),n([w.Property("100%")],l.prototype,"width",void 0),n([w.Property("auto")],l.prototype,"height",void 0),n([w.Property([])],l.prototype,"expandedIndices",void 0),n([w.Property("Multiple")],l.prototype,"expandMode",void 0),n([w.Property(!0)],l.prototype,"enableHtmlSanitizer",void 0),n([w.Complex({},si)],l.prototype,"animation",void 0),n([w.Event()],l.prototype,"clicked",void 0),n([w.Event()],l.prototype,"expanding",void 0),n([w.Event()],l.prototype,"expanded",void 0),n([w.Event()],l.prototype,"created",void 0),n([w.Event()],l.prototype,"destroyed",void 0);var ai,e=n([w.NotifyPropertyChanges],l);function l(e,t){e=ai.call(this,e,t)||this;return e.isKeyboardNavigation=!1,e.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},e}di=function(e,t){return(di=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 di,hi,n=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},ci="e-contextmenu-template",n=(function(e,t){function i(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(pi,hi=q),pi.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||w.getUniqueID("ej2-contextmenu"),hi.prototype.preRender.call(this)},pi.prototype.initialize=function(){this.template=this.itemTemplate||null,this.addTemplateClass(),hi.prototype.initialize.call(this),w.attributes(this.element,{role:"menu",tabindex:"0"}),this.element.style.zIndex=U.getZindexPartial(this.element).toString()},pi.prototype.open=function(e,t,i){this.isOpenCalled=!0,hi.prototype.openMenu.call(this,null,null,e,t,null,i),this.isOpenCalled=!1},pi.prototype.close=function(){hi.prototype.closeMenu.call(this)},pi.prototype.addTemplateClass=function(){(!w.isNullOrUndefined(this.itemTemplate)&&"function"==typeof this.itemTemplate||"string"==typeof this.itemTemplate&&""!==this.itemTemplate)&&w.addClass([this.element],ci)},pi.prototype.onPropertyChanged=function(e,t){hi.prototype.onPropertyChanged.call(this,e,t);for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"filter":this.close(),this.filter=e.filter;break;case"target":this.unWireEvents(t.target),this.wireEvents();break;case"itemTemplate":this.itemTemplate=e.itemTemplate,w.removeClass([this.element],ci),this.addTemplateClass(),this.refresh()}},pi.prototype.getModuleName=function(){return"contextmenu"},n([w.Property("")],pi.prototype,"target",void 0),n([w.Property("")],pi.prototype,"filter",void 0),n([w.Collection([],We)],pi.prototype,"items",void 0),n([w.Property(null)],pi.prototype,"itemTemplate",void 0),n([w.Property(!1)],pi.prototype,"enableScrolling",void 0),n([w.NotifyPropertyChanges],pi));function pi(e,t){return hi.call(this,e,t)||this}ui=function(e,t){return(ui=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 ui,mi,fi=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},gi="e-vertical",vi="e-hamburger",q=(function(e,t){function i(){this.constructor=e}ui(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(yi,mi=q),yi.prototype.getModuleName=function(){return"menu"},yi.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||w.getUniqueID("ej2-menu"),this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}this.updateMenuItems(this.items),mi.prototype.preRender.call(this)},yi.prototype.initialize=function(){mi.prototype.initialize.call(this),w.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(gi),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(gi),this.element.setAttribute("aria-orientation","vertical")):w.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add(vi),"Horizontal"===this.orientation)&&this.element.classList.add("e-hide-menu")},yi.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},yi.prototype.onPropertyChanged=function(e,t){for(var i=this,s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"orientation":"Vertical"===e.orientation?(this.element.classList.add(gi),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(gi),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(gi),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(gi),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(t.items).length||this.updateMenuItems(e.items);break;case"hamburgerMode":this.element.previousElementSibling||mi.prototype.createHeaderContainer.call(this),e.hamburgerMode?(this.element.parentElement.classList.add(vi),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[i.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove(vi),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(gi),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(gi):this.element.previousElementSibling.classList.remove(gi),this.element.classList[e.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(e.title=this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(e.title):e.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=e.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(t.target),this.wireEvents(),"Horizontal"===this.orientation)&&(e.target?this.element.previousElementSibling.classList.add(gi):(this.element.previousElementSibling||mi.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(gi)),this.element.classList.add("e-hide-menu"));break;case"template":this.template=e.template,this.refresh()}mi.prototype.onPropertyChanged.call(this,e,t)},yi.prototype.createMenuItems=function(e){var t,i,s=this.items,n=this.getField("parentId");if(e[""+n]){for(t=this.getIndex(e[""+n].toString(),!0),i=0;i<t.length;i++)s[t[i]].items||(s[t[i]].items=[]),s=s[t[i]].items;s.push(e)}else this.items.push(e)},yi.prototype.open=function(){mi.prototype.openHamburgerMenu.call(this)},yi.prototype.close=function(){mi.prototype.closeHamburgerMenu.call(this)},fi([w.Property("Horizontal")],yi.prototype,"orientation",void 0),fi([w.Property("")],yi.prototype,"target",void 0),fi([w.Property(null)],yi.prototype,"template",void 0),fi([w.Property(!1)],yi.prototype,"enableScrolling",void 0),fi([w.Property(!1)],yi.prototype,"hamburgerMode",void 0),fi([w.Property("Menu")],yi.prototype,"title",void 0),fi([w.Property(!0)],yi.prototype,"enableHtmlSanitizer",void 0),fi([w.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},je)],yi.prototype,"fields",void 0),fi([w.NotifyPropertyChanges],yi));function yi(e,t){e=mi.call(this,e,t)||this;return e.tempItems=[],e}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,Si,fi=function(e,t){function i(){this.constructor=e}bi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},o=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Ci="e-tab",Ii="e-tab-header",S="e-content",xi="e-nested",Ei="e-item",Ni="e-template",Oi="e-rtl",d="e-active",wi="e-disable",C="e-hidden",ki="e-focused",Li="e-icons",Ai="e-icon",Ti="e-icon-tab",Di="e-close-icon",Pi="e-close-show",Mi="e-tab-text",Hi="e-indicator",Ui="e-tab-wrap",Ri="e-text-wrap",Bi="e-tab-icon",Vi="e-toolbar-items",I="e-toolbar-item",ji="e-toolbar-pop",Fi="e-toolbar-popup",qi="e-hor-nav",Wi="e-progress",_i="e-overlay",zi="e-vertical-tab",Ki="e-vertical",Xi="e-vertical-left",Yi="e-vertical-right",Gi="e-horizontal-bottom",Qi="e-fill-mode",Ji="tabitem_",Zi="e-reorder-active-item",$i=(Si=w.ChildProperty,fi(es,Si),o([w.Property("SlideLeftIn")],es.prototype,"effect",void 0),o([w.Property(600)],es.prototype,"duration",void 0),o([w.Property("ease")],es.prototype,"easing",void 0),es);function es(){return null!==Si&&Si.apply(this,arguments)||this}ts=w.ChildProperty,fi(ss,ts),o([w.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},$i)],ss.prototype,"previous",void 0),o([w.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},$i)],ss.prototype,"next",void 0);var ts,is=ss;function ss(){return null!==ts&&ts.apply(this,arguments)||this}ns=w.ChildProperty,fi(ls,ns),o([w.Property("")],ls.prototype,"text",void 0),o([w.Property("")],ls.prototype,"iconCss",void 0),o([w.Property("left")],ls.prototype,"iconPosition",void 0);var ns,rs=ls;function ls(){return null!==ns&&ns.apply(this,arguments)||this}os=w.ChildProperty,fi(ds,os),o([w.Complex({},rs)],ds.prototype,"header",void 0),o([w.Property(null)],ds.prototype,"headerTemplate",void 0),o([w.Property("")],ds.prototype,"content",void 0),o([w.Property("")],ds.prototype,"cssClass",void 0),o([w.Property(!1)],ds.prototype,"disabled",void 0),o([w.Property(!0)],ds.prototype,"visible",void 0),o([w.Property()],ds.prototype,"id",void 0),o([w.Property(-1)],ds.prototype,"tabIndex",void 0);var os,as=ds;function ds(){return null!==os&&os.apply(this,arguments)||this}hs=w.Component,fi(h,hs),h.prototype.destroy=function(){if((this.isReact||this.isAngular)&&this.clearTemplate(),w.isNullOrUndefined(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),this.element.removeAttribute("aria-disabled"),this.expTemplateContent(),this.isTemplate){var e=w.select(".e-tab > ."+S,this.element);this.element.classList.remove(Ni),w.isNullOrUndefined(e)||(e.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)w.remove(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&0<this.draggableItems.length){for(var t=0;t<this.draggableItems.length;t++)this.draggableItems[t].destroy(),this.draggableItems[t]=null;this.draggableItems=[]}hs.prototype.destroy.call(this),this.trigger("destroyed")},h.prototype.refresh=function(){this.isReact&&this.clearTemplate(),hs.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},h.prototype.refreshOverflow=function(){w.isNullOrUndefined(this.tbObj)||(this.tbObj.refreshOverflow(),this.updatePopupIconAriaLabel())},h.prototype.preRender=function(){var e=w.closest(this.element,"."+S),e=(this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwiped=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=w.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" ."+Ii:this.dragArea),w.isNullOrUndefined(e)||(e.parentElement.classList.add(xi),this.isNested=!0),w.Browser.info.name),e="msie"===e?"e-ie":"edge"===e?"e-edge":"safari"===e?"e-safari":"";w.setStyleAttribute(this.element,{width:w.formatUnit(this.width),height:w.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),w.attributes(this.element,{"aria-disabled":"false"}),this.setCssClass(this.element,e,!0),this.updatePopAnimationConfig()},h.prototype.render=function(){var e=this;this.btnCls=this.createElement("span",{className:Li+" "+Di,attrs:{title:this.title}}),this.tabId=0<this.element.id.length?"-"+this.element.id:w.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1,this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow(),e.selectingContent(e.selectedItem,e.isInteracted),e.refreshActiveBorder()}),this.isAngular&&this.registeredTemplate&&!w.isNullOrUndefined(this.registeredTemplate.headerTemplate)&&setTimeout(function(){e.refreshOverflow(),e.refreshActiveBorder()},5)},h.prototype.renderContainer=function(){var e=this.element;this.items.forEach(function(e,t){w.isNullOrUndefined(e.id)&&!w.isNullOrUndefined(e.setProperties)&&e.setProperties({id:Ji+t.toString()},!0)}),0<this.items.length&&0===e.children.length?(e.appendChild(this.createElement("div",{className:S})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:Ii})),this.isTemplate=!1):0<this.element.children.length&&(this.isTemplate=!0,e.classList.add(Ni),e=e.querySelector("."+Ii))&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,e),w.isNullOrUndefined(w.select("."+Ii,this.element))||w.isNullOrUndefined(w.select("."+S,this.element))||(this.renderHeader(),this.tbItems=w.select("."+Ii+" ."+Vi,this.element),w.isNullOrUndefined(this.tbItems)||w.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),0<w.selectAll("."+I,this.element).length&&(this.tbItems=w.select("."+Ii+" ."+Vi,this.element),this.bdrLine=this.createElement("div",{className:Hi+" "+C+" e-ignore"}),e=w.select("."+this.scrCntClass,this.tbItems),w.isNullOrUndefined(e)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):e.insertBefore(this.bdrLine,e.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)),this.setRTL(this.enableRtl))},h.prototype.renderHeader=function(){var n=this,e=this.headerPlacement,t=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){1<this.element.children.length&&this.element.children[1].classList.contains(Ii)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var r,i=this.hdrEle.children.length,s=[],l=0;l<i;l++)s.push(this.hdrEle.children.item(l));0<i&&(r=this.createElement("div",{className:"e-items"}),this.hdrEle.appendChild(r),s.forEach(function(e,t){n.lastIndex=t;var i={className:Ei,id:Ei+n.tabId+"_"+t},s=n.createElement("span",{className:Mi,attrs:{role:"presentation"}}).outerHTML,s=n.createElement("div",{className:Ri,innerHTML:s+n.btnCls.outerHTML}).outerHTML,s=n.createElement("div",{className:Ui,innerHTML:s,attrs:{role:"tab",tabIndex:"-1","aria-selected":"false","aria-controls":S+n.tabId+"_"+t,"aria-disabled":"false"}});s.querySelector("."+Mi).appendChild(e),r.appendChild(n.createElement("div",i)),w.selectAll("."+Ei,r)[t].appendChild(s)}))}else t=this.parseObject(this.items,0);this.tbObj=new Lt({width:"Left"===e||"Right"===e?"auto":"100%",height:"Left"===e||"Right"===e?"100%":"auto",overflowMode:this.overflowMode,items:0!==t.length?t:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),w.attributes(this.hdrEle,{role:"tablist"}),w.isNullOrUndefined(this.element.getAttribute("aria-label"))?w.isNullOrUndefined(this.element.getAttribute("aria-labelledby"))||(this.hdrEle.setAttribute("aria-labelledby",this.element.getAttribute("aria-labelledby")),this.element.removeAttribute("aria-labelledby")):(this.hdrEle.setAttribute("aria-label",this.element.getAttribute("aria-label")),this.element.removeAttribute("aria-label")),this.updatePopupIconAriaLabel(),this.setCloseButton(this.showCloseButton);e=this.tbObj.element.querySelector("."+Vi);w.isNullOrUndefined(e)||!w.isNullOrUndefined(e.id)&&""!==e.id||(e.id=this.element.id+"_tab_header_items")},h.prototype.updatePopupIconAriaLabel=function(){var e,t;w.isNullOrUndefined(this.hdrEle)||w.isNullOrUndefined(this.tbObj)||"Popup"!==this.tbObj.overflowMode||(e=this.hdrEle.querySelector("."+qi),w.isNullOrUndefined(e))||(t=(window.getComputedStyle(e,"::before").getPropertyValue("content")||"").trim().replace(/^['"]|['"]$/g,"").replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\"),e.setAttribute("aria-label",t&&"none"!==t&&"normal"!==t?t:"overflow"))},h.prototype.createContentElement=function(e){var t=this.createElement("div",{id:S+this.tabId+"_"+e,className:Ei,attrs:{role:"tabpanel","aria-labelledby":Ei+this.tabId+"_"+e}});return(-1!==["Dynamic","Demand"].indexOf(this.loadOn)||"Init"===this.loadOn&&e===this.selectedItem)&&w.addClass([t],d),t},h.prototype.renderContent=function(){this.cntEle=w.select("."+S,this.element);var e=w.selectAll("."+I,this.element);if(this.isTemplate){this.cnt=0<this.cntEle.children.length?this.cntEle.innerHTML:"";for(var t=this.cntEle.children,i=0;i<e.length;i++)t.length-1>=i&&(w.addClass([t.item(i)],Ei),w.attributes(t.item(i),{role:"tabpanel","aria-labelledby":Ei+this.tabId+"_"+i}),t.item(i).id=S+this.tabId+"_"+i)}else if(0<w.selectAll("."+I,this.element).length)if("Init"===this.loadOn)for(i=0;i<this.itemIndexArray.length;i++)this.itemIndexArray[i]&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[i]))));else"Dynamic"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(0<this.selectedItem?this.selectedItem:Number(this.extIndex(this.itemIndexArray[0]))))},h.prototype.reRenderItems=function(){this.renderContainer(),w.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents()},h.prototype.parseObject=function(e,h){var c,p=this,u=Array.prototype.slice.call(w.selectAll(".e-tab-header ."+I,this.element)),m=this.lastIndex,f=(!this.isReplace&&0<u.length&&(m=this.getMaxIndicesFromItems(u)),[]),g=[];return e.forEach(function(e,t){var i,s,n,r,l,o,a=w.isNullOrUndefined(e.header)||w.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,d=w.isNullOrUndefined(e.header)||w.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;w.isNullOrUndefined(e.headerTemplate)&&(w.isNullOrUndefined(e.header)||w.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===d)?g.push(t):("string"==typeof(l=e.headerTemplate||e.header.text)&&p.enableHtmlSanitizer&&(l=w.SanitizeHtmlHelper.sanitize(l)),p.isReplace&&!w.isNullOrUndefined(p.tbId)&&""!==p.tbId?(i=parseInt(p.tbId.substring(p.tbId.lastIndexOf("_")+1),10),p.tbId=""):i=h+t,p.lastIndex=0===u.length?t:p.isReplace?i:m+1+t,i=e.disabled?" "+wi+" "+_i:"",s=!1===e.visible?" "+C:"",c=p.createElement("div",{className:Mi,attrs:{role:"presentation"}}),n=l instanceof Object?l.outerHTML:l,n=!w.isNullOrUndefined(n)&&""!==n,w.isNullOrUndefined(l.tagName)?p.headerTextCompile(c,l,t):c.appendChild(l),o=p.createElement("span",{className:Li+" "+Bi+" "+Ai+"-"+a+" "+d}),(r=p.createElement("div",{className:Ri})).appendChild(c),""!==l&&void 0!==l&&""!==d?("left"===a||"top"===a?r.insertBefore(o,r.firstElementChild):r.appendChild(o),p.isIconAlone=!1):(""===d?c:o)===o&&(w.detach(c),r.appendChild(o),p.isIconAlone=!0),l=w.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),o=e.disabled?{role:"tab","aria-disabled":"true"}:{tabIndex:l,"data-tabindex":l,role:"tab","aria-selected":"false","aria-disabled":"false"},r.appendChild(p.btnCls.cloneNode(!0)),(l=p.createElement("div",{className:Ui,attrs:o})).appendChild(r),p.itemIndexArray instanceof Array&&p.itemIndexArray.splice(h+t,0,Ei+p.tabId+"_"+p.lastIndex),(o={htmlAttributes:{id:Ei+p.tabId+"_"+p.lastIndex,"data-id":e.id},template:l}).cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+i+" "+s+" "+(""!==d?"e-i"+a:"")+" "+(n?"":Ai),"top"!==a&&"bottom"!==a||p.element.classList.add("e-vertical-icon"),f.push(o),t++)}),this.isAdd||g.forEach(function(e){p.items.splice(e,1)}),this.isIconAlone?this.element.classList.add(Ti):this.element.classList.remove(Ti),f},h.prototype.removeActiveClass=function(){var e=this.getTabHeader();e&&(e=w.selectAll("."+I+"."+d,e),[].slice.call(e).forEach(function(e){return e.classList.remove(d)}),[].slice.call(e).forEach(function(e){return e.firstElementChild.setAttribute("aria-selected","false")}))},h.prototype.checkPopupOverflow=function(e){this.tbPop=w.select("."+ji,this.element);var t=w.select(".e-hor-nav",this.element),i=w.select("."+Vi,this.element),s=i.lastChild,n=!1;return(n=!this.isVertical()&&(this.enableRtl&&t.offsetLeft+t.offsetWidth>i.offsetLeft||!this.enableRtl&&t.offsetLeft<i.offsetWidth)||this.isVertical()&&t.offsetTop<s.offsetTop+s.offsetHeight?!0:n)&&!w.isNullOrUndefined(e)&&(e.classList.add(Fi),this.tbPop.insertBefore(e,w.selectAll("."+Fi,this.tbPop)[0])),n},h.prototype.popupHandler=function(e){var t=e.querySelector(".e-ripple-element"),t=(w.isNullOrUndefined(t)||(t.outerHTML="",e.querySelector("."+Ui).classList.remove("e-ripple")),this.tbItem=w.selectAll("."+Vi+" ."+I,this.hdrEle),this.tbItem[this.tbItem.length-1]);if(0<=this.tbItem.length){if(e.classList.remove(Fi),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(t))for(var i=0;i<this.tbItems.children.length;i++){var s=(s=this.tbItems.lastChild.previousElementSibling)&&s.classList.contains(Hi)?s.previousElementSibling:s;if(!this.checkPopupOverflow(s||e))break}this.isPopup=!0}t=w.selectAll("."+I,this.tbItems).length;return 0<t?t-1:this.getEleIndex(e)},h.prototype.setCloseButton=function(e){var t=w.select("."+Ii,this.element);!0===e?t.classList.add(Pi):t.classList.remove(Pi),this.refreshOverflow(),this.refreshActiveTabBorder()},h.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains(Oi);e=this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null;return e},h.prototype.triggerPrevAnimation=function(e,t){var i=this,t=this.prevCtnAnimation(t,this.selectedItem);w.isNullOrUndefined(t)?e.classList.remove(d):(t.begin=function(){w.setStyleAttribute(e,{position:"absolute"}),e.classList.add(Wi),e.classList.add("e-view")},t.end=function(){e.style.display="none",e.classList.remove(d),e.classList.remove(Wi),e.classList.remove("e-view"),w.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||i.isTemplate||w.detach(e)},new w.Animation(t).animate(e))},h.prototype.triggerAnimation=function(e,t){var i,s,n,r=this,l=this.prevIndex,o=([].slice.call(this.element.querySelector("."+S).children).forEach(function(e){e.id===r.prevActiveEle&&(i=e)}),this.tbItem[l]),a=this.getTrgContent(this.cntEle,this.extIndex(e)),o=(w.isNullOrUndefined(i)&&!w.isNullOrUndefined(o)&&(e=this.extIndex(o.id),i=this.getTrgContent(this.cntEle,e)),w.isNullOrUndefined(a)||(this.prevActiveEle=a.id),w.isNullOrUndefined(this.animation)||w.isNullOrUndefined(this.animation.next.effect)||w.isNullOrUndefined(this.animation.previous.effect)||"None"===this.animation.previous.effect||"None"===this.animation.next.effect);this.initRender||!1===t||o?i&&i!==a&&i.classList.remove(d):(s=w.select("."+S,this.element),this.prevIndex>this.selectedItem&&!this.isPopup?n={name:"None"===(e=this.animation.previous.effect)?"":"SlideLeftIn"!==e?e:"SlideLeftIn",duration:0===this.animation.previous.duration&&"Enable"===w.animationMode?600:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem)&&(n={name:"None"===(t=this.animation.next.effect)?"":"SlideRightIn"!==t?t:"SlideRightIn",duration:0===this.animation.next.duration&&"Enable"===w.animationMode?600:this.animation.next.duration,timingFunction:this.animation.next.easing}),n.progress=function(){s.classList.add(Wi),r.setActiveBorder()},n.end=function(){s.classList.remove(Wi),a.classList.add(d)},this.initRender||w.isNullOrUndefined(i)||this.triggerPrevAnimation(i,l),this.isPopup=!1,""===n.name?a.classList.add(d):new w.Animation(n).animate(a))},h.prototype.keyPressed=function(e){var t=w.closest(e,"."+Ii+" ."+I),i=this.getEleIndex(t);!w.isNullOrUndefined(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():w.isNullOrUndefined(t)||!1!==t.classList.contains(d)||(this.selectTab(i,null,!0),w.isNullOrUndefined(this.popEle))||this.popObj.hide(this.hide)},h.prototype.getTabHeader=function(){var e;if(!w.isNullOrUndefined(this.element))return 0<(e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(Ii)})).length?e[0]:(e=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0])?[].slice.call(e.children).filter(function(e){return e.classList.contains(Ii)})[0]:void 0},h.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(w.selectAll("."+I,this.getTabHeader()),e)},h.prototype.extIndex=function(e){return e.replace(Ei+this.tabId+"_","")},h.prototype.getMaxIndicesFromItems=function(e){var t=this,i=[];return e.forEach(function(e){i.push(t.getIndexFromEle(e.id))}),Math.max.apply(Math,i)},h.prototype.expTemplateContent=function(){var t=this;this.templateEle.forEach(function(e){w.isNullOrUndefined(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")})},h.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.compileElement(s,t,"content",i),0!==s.childNodes.length&&e.appendChild(s),this.isReact&&this.renderReactTemplates()},h.prototype.compileElement=function(t,e,i,s){var n,r,l=this.heightAdjustMode,o=i;"string"==typeof e?(e=e.trim(),this.isVue?n=w.compile(this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(e):e):t.innerHTML=this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(e):e):n=w.compile(e),w.isNullOrUndefined(n)||(r=n({},this,i)),!w.isNullOrUndefined(n)&&0<r.length&&[].slice.call(r).forEach(function(e){"content"===o&&"Fill"===l&&e.style&&(e.style.height="100%"),t.appendChild(e)})},h.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},h.prototype.getContent=function(e,t,i,s){var n,r;"string"==typeof(t=w.isNullOrUndefined(t)?"":t)||w.isNullOrUndefined(t.innerHTML)?("."===(t="string"==typeof t&&this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(t):t)[0]||"#"===t[0])&&document.querySelectorAll(t).length?(r=(n=document.querySelector(t)).outerHTML.trim(),"clone"===i?e.appendChild(n.cloneNode(!0)):(e.appendChild(n),n.style.display="")):this.templateCompile(e,t,s):e.appendChild(t),w.isNullOrUndefined(r)||-1===this.templateEle.indexOf(t.toString())&&this.templateEle.push(t.toString())},h.prototype.getTrgContent=function(e,t){e=this.element.classList.contains(xi)?w.select("."+xi+"> ."+S+" > #"+S+this.tabId+"_"+t,this.element):this.findEle(e.children,S+this.tabId+"_"+t);return e},h.prototype.findEle=function(e,t){for(var i,s=0;s<e.length;s++)if(e[s].id===t){i=e[s];break}return i},h.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},h.prototype.addVerticalClass=function(){var e;this.isVertical()&&(e="Left"===this.headerPlacement?Xi:Yi,w.addClass([this.hdrEle],[Ki,e]),this.element.classList.contains(xi)?w.addClass([this.hdrEle],[zi,e]):w.addClass([this.element],[zi,e])),"Bottom"===this.headerPlacement&&w.addClass([this.hdrEle],[Gi])},h.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},h.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var e=this.hdrEle.querySelector("."+d),t=!!this.hdrEle.classList.contains(Ki);w.removeClass([this.element],[zi]),w.removeClass([this.hdrEle],[Ki,Xi,Yi]),t!==this.isVertical()&&(this.changeToolbarOrientation(),!w.isNullOrUndefined(e))&&e.classList.contains(Fi)&&this.popupHandler(e),this.addVerticalClass(),this.setActiveBorder(),this.focusItem()},h.prototype.focusItem=function(){var e=w.select(" #"+Ei+this.tabId+"_"+this.selectedItem,this.hdrEle);w.isNullOrUndefined(e)||e.firstElementChild.focus()},h.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},h.prototype.setOrientation=function(e,t){var i=Array.prototype.indexOf.call(this.element.children,t),s=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+S));"Bottom"===e&&i<s?this.element.appendChild(t):(w.removeClass([t],[Gi]),this.element.insertBefore(t,w.select("."+S,this.element)))},h.prototype.setCssClass=function(e,t,i){if(""!==t&&!w.isNullOrUndefined(t))for(var s=t.split(" "),n=0;n<s.length;n++)i?e.classList.add(s[n]):e.classList.remove(s[n])},h.prototype.loadContentInitMode=function(e){if(e&&"Init"===this.loadOn)for(var t=0;t<this.items.length;t++)this.cntEle.children.item(t)&&this.getContent(this.cntEle.children.item(t),this.items[t].content,"render",t)},h.prototype.loadContentElement=function(){var e;this.isTemplate||(e=this.cntEle.children.item(0),this.loadContentInitMode(e))},h.prototype.setContentHeight=function(e){if(this.element.classList.contains(Qi)&&w.removeClass([this.element],[Qi]),!w.isNullOrUndefined(this.cntEle)){var t=this.getTabHeader();if("None"===this.heightAdjustMode)this.loadContentElement(),"auto"===this.height||this.isVertical()||w.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-t.offsetHeight+"px"});else if("Fill"===this.heightAdjustMode)w.addClass([this.element],[Qi]),w.setStyleAttribute(this.element,{height:"100%"}),this.loadContentElement(),this.cntEle.style.height="calc(100% - "+this.hdrEle.offsetHeight+"px)";else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var i=w.selectAll("."+S+" > ."+Ei,this.element),s=0;s<i.length;s++)i[s].style.display="block",i[s].style.visibility="visible",this.maxHeight=Math.max(this.maxHeight,this.getHeight(i[s])),i[s].style.removeProperty("display"),i[s].style.removeProperty("visibility");else{this.cntEle=w.select("."+S,this.element),!0===e&&"Demand"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[0]))));for(var n=this.cntEle.children.item(0),s=0;s<this.items.length;s++)for(this.getContent(n,this.items[s].content,"clone",s),this.maxHeight=Math.max(this.maxHeight,this.getHeight(n));n.firstChild;)n.removeChild(n.firstChild);(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(["content"]),this.templateEle=[],"Demand"===this.loadOn&&this.getContent(n,this.items[0].content,"render",0),this.loadContentInitMode(n),this.prevIndex!==this.selectedItem&&n.classList.remove(d)}w.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else this.loadContentElement(),w.setStyleAttribute(this.cntEle,{height:"auto"})}},h.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},h.prototype.setActiveBorder=function(){var e,t,i=this.getTabHeader(),s=w.select("."+I+"."+d,i);w.isNullOrUndefined(s)||(this.reorderActiveTab?i&&i.classList.remove(Zi):(s.classList.contains(Fi)&&!this.bdrLine.classList.contains(C)&&this.bdrLine.classList.add(C),i&&!i.classList.contains(Zi)&&i.classList.add(Zi)),e=w.closest(s,"."+Ci),this.element!==e)||(this.tbItems=w.select("."+Vi,i),e=w.select("."+Hi,i),i=w.select("."+Vi+" ."+this.scrCntClass,i),this.isVertical()?(w.setStyleAttribute(e,{left:"",right:""}),0!==(w.isNullOrUndefined(i)?this.tbItems:i).offsetHeight?w.setStyleAttribute(e,{top:s.offsetTop+"px",height:s.offsetHeight+"px"}):w.setStyleAttribute(e,{top:0,height:0})):("MultiRow"===this.overflowMode?(t="Bottom"===this.headerPlacement?s.offsetTop:s.offsetHeight+s.offsetTop,w.setStyleAttribute(e,{top:t+"px",height:""})):w.setStyleAttribute(e,{top:"",height:""}),0!==(t=(w.isNullOrUndefined(i)?this.tbItems:i).offsetWidth)?w.setStyleAttribute(e,{left:s.offsetLeft+"px",right:t-(s.offsetLeft+s.offsetWidth)+"px"}):w.setStyleAttribute(e,{left:"auto",right:"auto"})),w.isNullOrUndefined(this.bdrLine))||s.classList.contains(Fi)||this.bdrLine.classList.remove(C)},h.prototype.setActive=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1),this.tbItem=w.selectAll("."+I,this.getTabHeader());var s=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length||!w.isNullOrUndefined(s)&&s.classList.contains(wi)))if(0<=e&&!t&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),s.classList.contains(d))this.setActiveBorder();else{this.isTemplate||w.attributes(s.firstElementChild,{"aria-controls":S+this.tabId+"_"+this.extIndex(s.id)});var n=s.id,r=(this.removeActiveClass(),s.classList.add(d),s.firstElementChild.setAttribute("aria-selected","true"),Number(this.extIndex(n)));if(w.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle=S+this.tabId+"_"+r),this.isTemplate)0<w.select("."+S,this.element).children.length&&(r=this.findEle(w.select("."+S,this.element).children,S+this.tabId+"_"+r),w.isNullOrUndefined(r)||r.classList.add(d),this.triggerAnimation(n,this.enableAnimation));else{for(this.cntEle=w.select(".e-tab > ."+S,this.element);"Dynamic"===this.loadOn&&this.cntEle.firstElementChild;)this.cntEle.removeChild(this.cntEle.firstElementChild);var l,o,r=this.getTrgContent(this.cntEle,this.extIndex(n));w.isNullOrUndefined(r)?(this.cntEle.appendChild(this.createElement("div",{id:S+this.tabId+"_"+this.extIndex(n),className:Ei+" "+d,attrs:{role:"tabpanel","aria-labelledby":Ei+this.tabId+"_"+this.extIndex(n)}})),l=this.getTrgContent(this.cntEle,this.extIndex(n)),o=Array.prototype.indexOf.call(this.itemIndexArray,n),this.getContent(l,this.items[o].content,"render",o)):r.classList.add(d),this.triggerAnimation(n,this.enableAnimation)}this.setActiveBorder(),this.refreshItemVisibility(s),this.initRender||t||(l={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:s,selectedIndex:e,selectedContent:w.select("#"+S+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:i,preventFocus:!1},this.trigger("selected",l,function(e){e.preventFocus||s.firstElementChild.focus()}))}},h.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=w.select("."+Vi,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},h.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,Oi,e),this.refreshActiveBorder()},h.prototype.refreshActiveBorder=function(){w.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(C),this.setActiveBorder()},h.prototype.showPopup=function(e){var t=w.select(".e-popup.e-toolbar-pop",this.hdrEle);t&&t.classList.contains("e-popup-close")&&((t=t&&t.ej2_instances[0]).position.X="Left"===this.headerPlacement||this.element.classList.contains(Oi)?"left":"right",t.dataBind(),t.show(e))},h.prototype.bindDraggable=function(e){var t=this;if(e&&0<this.draggableItems.length){for(var i=0;i<this.draggableItems.length;i++)this.draggableItems[i].destroy(),this.draggableItems[i]=null;this.draggableItems=[]}this.allowDragAndDrop&&(e=this.element.querySelector("."+Ii))&&Array.prototype.slice.call(e.querySelectorAll("."+I)).forEach(function(e){t.initializeDrag(e)})},h.prototype.bindSwipeEvents=function(){"None"!==this.swipeMode&&(this.touchModule=new w.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},h.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),w.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),w.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),w.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents(),this.keyModule=new w.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new w.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},h.prototype.unWireEvents=function(){w.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),w.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),w.isNullOrUndefined(this.cntEle)||w.isNullOrUndefined(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),w.EventHandler.remove(this.element,"mouseover",this.hoverHandler),w.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove(Oi),this.element.classList.remove(ki)},h.prototype.clickHandler=function(e){this.element.classList.remove(ki);var t=e.originalEvent.target,i=w.closest(t,"."+I),s=this.getEleIndex(i);t.classList.contains(Di)?this.removeTab(s):this.isVertical()&&w.closest(t,"."+qi)?this.showPopup(this.show):(this.isPopup=!1,w.isNullOrUndefined(i)||s===this.selectedItem||this.selectTab(s,e.originalEvent,!0))},h.prototype.swipeHandler=function(e){if(!(e.velocity<3&&w.isNullOrUndefined(e.originalEvent.changedTouches)||"Touch"===this.swipeMode&&("mouseup"===e.originalEvent.type||"mouseleave"===e.originalEvent.type)||"Mouse"===this.swipeMode&&"touchend"===e.originalEvent.type||"None"===this.swipeMode)){this.isNested&&this.element.setAttribute("data-swipe","true");var t=this.element.querySelector('[data-swipe="true"]');if(t)t.removeAttribute("data-swipe");else{if(this.isSwiped=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var i=this.selectedItem-1;0<=i;i--)if(!this.tbItem[i].classList.contains(C)){this.selectTab(i,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==w.selectAll("."+I,this.element).length-1)for(var s=this.selectedItem+1;s<this.tbItem.length;s++)if(!this.tbItem[s].classList.contains(C)){this.selectTab(s,null,!0);break}this.isSwiped=!1}}},h.prototype.spaceKeyDown=function(e){var t;(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which)&&(t=w.closest(e.target,"."+Ii),w.isNullOrUndefined(t)||e.preventDefault())},h.prototype.keyHandler=function(e){if(!this.element.classList.contains(wi)){this.element.classList.add(ki);var t=e.target;if(t&&t.isConnected){var i,s=this.getTabHeader(),n=w.select("."+d,s),r=(this.popEle=w.select("."+ji,s),w.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]),w.closest(document.activeElement,"."+I)),l=w.closest(t,"."+I);switch(e.action){case"space":case"enter":t.parentElement&&t.parentElement.classList.contains(wi)||("enter"===e.action&&t.classList.contains("e-hor-nav")?this.showPopup(this.show):this.keyPressed(t));break;case"tab":case"shiftTab":t.classList.contains(Ui)&&!1===w.closest(t,"."+I).classList.contains(d)&&t.setAttribute("tabindex",t.getAttribute("data-tabindex")),this.popObj&&w.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),w.isNullOrUndefined(n)||"-1"!==n.children.item(0).getAttribute("tabindex")||n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":w.isNullOrUndefined(r)||this.refreshItemVisibility(r);break;case"openPopup":!w.isNullOrUndefined(e.target)&&e.target.classList.contains(Ui)&&e.preventDefault(),!w.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":!0!==this.showCloseButton||w.isNullOrUndefined(l)||(i=l.nextSibling,!w.isNullOrUndefined(i)&&i.classList.contains(I)&&i.firstElementChild.focus(),this.removeTab(this.getEleIndex(l))),this.setActiveBorder()}}}},h.prototype.refreshItemVisibility=function(e){var t,i,s,n,r=w.select("."+this.scrCntClass,this.tbItems);this.isVertical()||w.isNullOrUndefined(r)||(i=(t=(r=w.select(".e-hscroll-bar",this.tbItems)).scrollLeft)+r.offsetWidth,s=e.offsetLeft,n=e.offsetWidth,e=e.offsetLeft+e.offsetWidth,t<s&&i<e?r.scrollLeft=t+(n-(i-s)):s<t&&e<i&&(r.scrollLeft=t-(n-(e-t))))},h.prototype.getIndexFromEle=function(e){return parseInt(e.substring(e.lastIndexOf("_")+1),10)},h.prototype.hoverHandler=function(e){e=e.target;!w.isNullOrUndefined(e.classList)&&e.classList.contains(Di)&&e.setAttribute("title",new w.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},h.prototype.evalOnPropertyChangeItems=function(e,t){var i=this;if(e.items instanceof Array&&t.items instanceof Array)if(this.lastIndex=0,w.isNullOrUndefined(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),0<this.templateEle.length&&this.expTemplateContent(),this.templateEle=[];for(var s=w.select(".e-tab > ."+S,this.element);s.firstElementChild;)w.detach(s.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else{for(var n=Object.keys(e.items),r=0;r<n.length;r++)for(var l=parseInt(Object.keys(e.items)[r],10),o=Object.keys(e.items[l]),a=0;a<o.length;a++){var d,h,c=Object(t.items[l])[o[a]],p=Object(e.items[l])[o[a]],u=this.element.querySelectorAll("."+I)[l],m=void 0,m=u&&!w.isNullOrUndefined(u.id)&&""!==u.id?this.getIndexFromEle(u.id):l,f=w.select("."+Vi+" #"+Ei+this.tabId+"_"+m,this.element),m=w.select("."+S+" #"+S+this.tabId+"_"+m,this.element);"header"!==o[a]&&"headerTemplate"!==o[a]||(h=w.isNullOrUndefined(this.items[l].header)||w.isNullOrUndefined(this.items[l].header.iconCss)?"":this.items[l].header.iconCss,d=this.items[l].headerTemplate||this.items[l].header.text,"headerTemplate"===o[a]&&this.clearTabTemplate(f,o[a],I),""===d&&""===h?this.removeTab(l):(this.tbId=u.id,(d=[]).push(this.items[l]),this.items.splice(l,1),this.itemIndexArray.splice(l,1),this.tbObj.items.splice(l,1),h=f.classList.contains(C),w.detach(f),this.isReplace=!0,this.addTab(d,l),h&&this.hideTab(l),this.isReplace=!1)),"content"!==o[a]||w.isNullOrUndefined(m)||(("string"==typeof p||w.isNullOrUndefined(p.innerHTML))&&("."===p[0]||"#"===p[0])&&p.length?(u=document.querySelector(p),m.appendChild(u),u.style.display=""):""===p&&"#"===c[0]?(document.body.appendChild(this.element.querySelector(c)).style.display="none",m.innerHTML=p):this.isAngular||this.isReact?(this.clearTabTemplate(m,o[a],Ei),m.innerHTML="",this.templateCompile(m,p,l)):"function"!=typeof p&&(m.innerHTML=p)),"cssClass"===o[a]&&(w.isNullOrUndefined(f)||(w.isNullOrUndefined(c)||""===c||f.classList.remove(c),w.isNullOrUndefined(p))||""===p||f.classList.add(p),w.isNullOrUndefined(m)||(w.isNullOrUndefined(c)||""===c||m.classList.remove(c),w.isNullOrUndefined(p))||""===p||m.classList.add(p)),"disabled"===o[a]&&this.enableTab(l,!0!==p),"visible"===o[a]&&this.hideTab(l,!0!==p)}this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){i.refreshActiveTabBorder()})}},h.prototype.clearTabTemplate=function(e,t,i){if(this.clearTemplates)if(this.registeredTemplate&&this.registeredTemplate[t])for(var s=this.registeredTemplate,n=0;n<s[t].length;n++){var r=s[t][n].rootNodes[0],l=w.closest(r,"."+i);if(!w.isNullOrUndefined(l)&&l===e){this.clearTemplate([t],[s[t][n]]);break}}else if(this.portals&&0<this.portals.length)for(var o=this.portals,n=0;n<o.length;n++){var a=o[n],l=w.closest(a.containerInfo,"."+i);if(!w.isNullOrUndefined(l)&&l===e){this.clearTemplate([t],n);break}}},h.prototype.initializeDrag=function(e){var l=this,e=new w.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+I,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var t,i,s,n=l.getEleIndex(l.dragItem),r={draggedItem:l.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+I),clonedElement:l.cloneElement,index:n};(w.isNullOrUndefined(e.target.closest("."+Ci))||e.target.closest("."+Ci).isEqualNode(l.element)||l.dragArea==="."+Ii)&&(e.target.closest(l.dragArea)||"Popup"===l.overflowMode?(document.body.style.cursor="",l.dragItem.querySelector("."+Ui).style.visibility="hidden",l.cloneElement.classList.contains(C)&&w.removeClass([l.cloneElement],C)):(document.body.style.cursor="not-allowed",w.addClass([l.cloneElement],C),l.dragItem.classList.contains(C)&&w.removeClass([l.dragItem],C),l.dragItem.querySelector("."+Ui).style.visibility="visible"),"Scrollable"!==l.overflowMode||w.isNullOrUndefined(l.element.querySelector(".e-hscroll"))||(t=l.element.querySelector(".e-scroll-right-nav"),s=l.element.querySelector(".e-scroll-left-nav"),i=l.element.querySelector(".e-hscroll-bar"),!w.isNullOrUndefined(t)&&Math.abs(t.offsetWidth/2+t.offsetLeft)>l.cloneElement.offsetLeft+l.cloneElement.offsetWidth&&(i.scrollLeft-=10),!w.isNullOrUndefined(s)&&Math.abs(s.offsetLeft+s.offsetWidth-l.cloneElement.offsetLeft)>s.offsetWidth/2&&(i.scrollLeft+=10)),l.cloneElement.style.pointerEvents="none",t=w.closest(e.target,"."+I+".e-draggable"),s=0,"Scrollable"!==l.overflowMode||w.isNullOrUndefined(l.element.querySelector(".e-hscroll"))||(s=l.element.querySelector(".e-hscroll-content").offsetWidth),null!=t&&!t.isSameNode(l.dragItem)&&t.closest("."+Ci).isSameNode(l.dragItem.closest("."+Ci))&&((i=l.getEleIndex(t))<n&&Math.abs(t.offsetLeft+t.offsetWidth-l.cloneElement.offsetLeft)>t.offsetWidth/2&&l.dragAction(t,n,i),n<i)&&Math.abs(t.offsetWidth/2)+t.offsetLeft-s<l.cloneElement.offsetLeft+l.cloneElement.offsetWidth&&l.dragAction(t,n,i),l.droppedIndex=l.getEleIndex(l.dragItem)),l.trigger("dragging",r)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(e)},h.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),w.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+Ii).classList.contains(Pi)&&w.addClass([this.cloneElement],Pi),w.removeClass([this.cloneElement.querySelector("."+Ui)],"e-ripple"),w.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||w.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},h.prototype.itemDragStart=function(t){var i=this,e=(this.draggingItems=this.items.map(function(e){return e}),this.dragItem=t.element,{draggedItem:t.element,event:t.event,target:t.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1});this.trigger("onDragStart",e,function(e){e.cancel?(e=t.element.ej2_instances[0],w.isNullOrUndefined(e)||e.intDestroy(t.event),w.detach(i.cloneElement)):(i.removeActiveClass(),w.addClass([i.tbItems.querySelector("."+Hi)],C),i.dragItem.querySelector("."+Ui).style.visibility="hidden")})},h.prototype.dragAction=function(e,t,i){var s,n;0<this.items.length&&(s=this.draggingItems[t],this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)),"MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),i<t&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e):"Extended"===this.overflowMode?e.isSameNode(e.parentElement.lastChild)?(n=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(e.parentElement.lastChild,n.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)):(s=e.parentElement.lastChild,e.isSameNode(s)?(n=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(s,n.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))),t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e.nextElementSibling):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},h.prototype.itemDragStop=function(e){var t=this,e=(w.detach(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+Ui).style.visibility="visible",document.body.style.cursor="",{draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1});this.trigger("dragged",e,function(e){e.cancel?t.refresh():0<t.items.length&&0<t.draggingItems.length?(t.items=t.draggingItems,t.selectedItem=w.isNullOrUndefined(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.refresh()):(t.dragItem.querySelector("."+Ui).style.visibility="",w.removeClass([t.tbItems.querySelector("."+Hi)],C),t.droppedIndex=w.isNullOrUndefined(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.selectTab(t.droppedIndex,null,!0))}),this.dragItem=null,this.droppedIndex=null},h.prototype.enableTab=function(e,t){var i=w.selectAll("."+I,this.element)[e];w.isNullOrUndefined(i)||(!0===t?(i.classList.remove(wi,_i),i.firstElementChild.setAttribute("tabindex",i.firstElementChild.getAttribute("data-tabindex"))):(i.classList.add(wi,_i),i.firstElementChild.removeAttribute("tabindex"),i.classList.contains(d)&&this.select(e+1)),w.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!t,this.dataBind()),i.firstElementChild.setAttribute("aria-disabled",!0===t?"false":"true"))},h.prototype.addTab=function(t,i){var s=this,e={addedItems:t,cancel:!1};if(this.isReplace)this.addingTabContent(t,i),this.updatePopupIconAriaLabel();else{for(var n=0,r=t;n<r.length;n++){var l=r[n];l.disabled=l.disabled||!1,l.visible=l.visible||!0}t&&0!==t.length&&this.element&&this.element.classList.contains(C)&&this.element.classList.remove(C),this.trigger("adding",e,function(e){e.cancel||(s.addingTabContent(t,i),s.updatePopupIconAriaLabel())})}this.isReact&&this.renderReactTemplates()},h.prototype.addingTabContent=function(e,n){var t,i,r,l,o,a=this,d=0;this.hdrEle=w.select("."+Ii,this.element),w.isNullOrUndefined(this.hdrEle)?(this.items=e,this.reRenderItems(),this.bindDraggable()):(0!==(i=(t=Array.from(w.selectAll(".e-tab-header ."+I,this.element))).length)&&(d=this.getMaxIndicesFromItems(t)+1),i<(n=w.isNullOrUndefined(n)?i-1:n)||n<0||isNaN(n)||(0!==i||w.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),w.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(C),this.tbItems=w.select("."+Vi,this.getTabHeader()),this.isAdd=!0,r=this.parseObject(e,n),this.isAdd=!1,l=0,e.forEach(function(e,t){var i,s;o=e.headerTemplate||e.header.text,w.isNullOrUndefined(e.headerTemplate||e.header)||w.isNullOrUndefined(o)||0===o.length&&!w.isNullOrUndefined(e.header)&&w.isNullOrUndefined(e.header.iconCss)||(r[t]&&(w.isNullOrUndefined(e.id)&&(e.id=Ei+a.tabId+"_"+Ji+(d+t).toString()),r[t].htmlAttributes["data-id"]=e.id),a.items.splice(n+l,0,e),l++),w.isNullOrUndefined(e.header)||w.isNullOrUndefined(e.header.text)||!a.isTemplate&&"Init"!==a.loadOn||(i=d+t,s=a.createElement("div",{id:S+a.tabId+"_"+i,className:Ei,attrs:{role:"tabpanel","aria-labelledby":Ei+"_"+i}}),a.cntEle.insertBefore(s,a.cntEle.children[n+t]),s=a.getTrgContent(a.cntEle,i.toString()),a.getContent(s,e.content,"render",n))}),this.tbObj.addItems(r,n),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===n?this.select(n):(this.setActiveBorder(),this.tbItem=w.selectAll("."+I,this.getTabHeader())),this.bindDraggable()))},h.prototype.removeTab=function(i){var e,s=this,n=w.selectAll("."+I,this.hdrEle)[i];w.isNullOrUndefined(n)||(e={removedItem:n,removedIndex:i,cancel:!1},this.trigger("removing",e,function(e){var t;e.cancel||(t=w.select("#"+Ei+s.tabId+"_"+s.extIndex(n.id),w.select("."+Vi,s.hdrEle)),w.isNullOrUndefined(t)||s.clearTabTemplate(t,"headerTemplate",I),s.tbObj.removeItems(i),s.allowDragAndDrop&&i!==Array.prototype.indexOf.call(s.itemIndexArray,n.id)&&(i=Array.prototype.indexOf.call(s.itemIndexArray,n.id)),t=s.itemIndexArray.indexOf(n.id),s.items.splice(t,1),s.itemIndexArray.splice(t,1),s.refreshActiveBorder(),t=w.select("#"+S+s.tabId+"_"+s.extIndex(n.id),w.select("."+S,s.element)),w.isNullOrUndefined(t)||(s.clearTabTemplate(t,"content",Ei),w.detach(t)),s.trigger("removed",e),s.draggableItems&&0<s.draggableItems.length&&(s.draggableItems[i].destroy(),s.draggableItems[i]=null,s.draggableItems.splice(i,1)),n.classList.contains(d)?(i=i>w.selectAll("."+I+":not(."+Fi+")",s.element).length-1?i-1:i,s.enableAnimation=!1,s.tbItem=w.selectAll("."+I,s.getTabHeader()),i=s.getSelectingTabIndex(i),i=!isNaN(i)&&0<=i&&s.tbItem.length>i?i:0,(t=s.tbItem[i])&&(t.classList.contains(C)&&t.classList.remove(C),e=t.firstElementChild)&&e.hasAttribute("aria-hidden")&&e.removeAttribute("aria-hidden"),s.selectedItem=i,s.select(i)):i!==s.selectedItem&&(i<s.selectedItem&&(i=s.itemIndexArray.indexOf(s.tbItem[s.selectedItem].id),s.setProperties({selectedItem:-1<i?i:s.selectedItem},!0),s.prevIndex=s.selectedItem),s.tbItem=w.selectAll("."+I,s.getTabHeader())),0===w.selectAll("."+I,s.element).length&&(t=w.select("."+S,s.element),w.detach(s.hdrEle),w.detach(t)),s.enableAnimation=!0)}))},h.prototype.hideTab=function(e,t){0<=e&&e<this.tbItem.length&&(s=this.tbItem[e].getAttribute("id"));var i,s=this.element.querySelector('[id="'+s+'"]');if(!w.isNullOrUndefined(s)){if(w.isNullOrUndefined(t)&&(t=!0),this.bdrLine.classList.add(C),!0===t)if(s.classList.add(C),0!==(i=w.selectAll("."+I+":not(."+C+")",this.tbItems)).length&&s.classList.contains(d)){if(0!==e)for(var n=e-1;0<=n;n--){if(!this.tbItem[n].classList.contains(C)){this.select(n);break}if(0===n)for(var r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(C)){this.select(r);break}}else for(r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(C)){this.select(r);break}}else 0===i.length&&this.element.classList.add(C);else this.element.classList.remove(C),i=w.selectAll("."+I+":not(."+C+")",this.tbItems),s.classList.remove(C),0===i.length&&this.select(e);this.setActiveBorder(),w.isNullOrUndefined(this.items[e])||(this.items[e].visible=!t,this.dataBind()),w.isNullOrUndefined(s.firstElementChild)||s.firstElementChild.setAttribute("aria-hidden",""+t),"Popup"===this.overflowMode&&this.refreshOverflow()}},h.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),this.isInteracted=i=void 0===i?!1:i,this.select(e,t)},h.prototype.select=function(t,e){var i=this,s=this.getTabHeader(),s=(this.tbItems=w.select("."+Vi,s),this.tbItem=w.selectAll("."+I,s),this.content=w.select("."+S,this.element),this.prevItem=this.tbItem[this.prevIndex],w.isNullOrUndefined(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id),this.tbItem[t]),e=(w.isNullOrUndefined(s)?this.selectedID="0":this.selectingID=this.extIndex(s.id),w.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains(wi)||this.prevItem.children.item(0).setAttribute("tabindex",this.prevItem.firstElementChild.getAttribute("tabindex")),{event:e,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:w.isNullOrUndefined(this.content)?null:w.select("#"+S+this.tabId+"_"+this.selectedID,this.content),selectingItem:s,selectingIndex:t,selectingContent:w.isNullOrUndefined(this.content)?null:w.select("#"+S+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:this.isInteracted,cancel:!1});this.initRender?this.selectingContent(t,this.isInteracted):this.trigger("selecting",e,function(e){e.cancel||i.selectingContent(t,i.isInteracted)}),this.isInteracted=!1},h.prototype.getSelectingTabIndex=function(e){if(!w.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains(wi)||this.tbItem[e].classList.contains(C)))for(var t=e+1;t<this.items.length;t++){if(!1===this.items[t].disabled&&!0===this.items[t].visible){e=t;break}e=0}return e},h.prototype.selectingContent=function(e,t){var i;"number"==typeof e?(e=this.getSelectingTabIndex(e),this.tbItem.length>e&&0<=e&&!isNaN(e)?(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(Fi)&&this.reorderActiveTab?(this.setActive(this.popupHandler(this.tbItem[e]),null,t),!w.isNullOrUndefined(this.items)&&0<this.items.length&&this.allowDragAndDrop&&(this.tbItem=w.selectAll("."+Vi+" ."+I,this.hdrEle),i=this.items[e],this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,i),i=this.itemIndexArray[e],this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,i))):this.setActive(e,null,t)):this.setActive(0,null,t)):e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,t)},h.prototype.getItemIndex=function(e){var t;this.tbItem=w.selectAll("."+I,this.getTabHeader());for(var i=0;i<this.tbItem.length;i++)if(e===this.tbItem[i].getAttribute("data-id")){t=i;break}return t},h.prototype.disable=function(e){this.setCssClass(this.element,wi,e),this.element.setAttribute("aria-disabled",""+e)},h.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},h.prototype.getModuleName=function(){return"tab"},h.prototype.onPropertyChanged=function(e,t){for(var i=this,s=0,n=Object.keys(e).sort(function(e,t){return"items"===e?-1:"items"===t?1:0});s<n.length;s++)switch(n[s]){case"width":w.setStyleAttribute(this.element,{width:w.formatUnit(e.width)});break;case"height":w.setStyleAttribute(this.element,{height:w.formatUnit(e.height)}),this.setContentHeight(!1);break;case"cssClass":var r=this.element.querySelector("."+Ii);""===t.cssClass||w.isNullOrUndefined(t.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),w.isNullOrUndefined(r)||this.setCssClass(r,e.cssClass,!0)):(this.setCssClass(this.element,t.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),w.isNullOrUndefined(r)||(this.setCssClass(r,t.cssClass,!1),this.setCssClass(r,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,t);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=t.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder(),this.updatePopupIconAriaLabel();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable(!0);break;case"swipeMode":this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.bindSwipeEvents();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=i.dragArea}),this.refresh())}},h.prototype.refreshActiveTab=function(){var e,t,i,s,n,r,l,o,a;this.isReact&&this.isTemplate&&this.clearTemplate(),this.isTemplate?(e=this.element.querySelector("."+Vi),o=this.element.querySelector("."+I+"."+d),t=this.getIndexFromEle(o.id),n=o.innerText,s=(r=this.element.querySelector("."+S).querySelector("."+d).children[0]).innerHTML,w.detach(o),w.detach(r),r={className:I+" "+Ni+" "+d,id:Ei+this.tabId+"_"+t},n=this.createElement("span",{className:Mi,innerHTML:n,attrs:{role:"presentation"}}).outerHTML,n=this.createElement("div",{className:Ri,innerHTML:n+this.btnCls.outerHTML}).outerHTML,o=o.firstElementChild.getAttribute("data-tabindex"),n=this.createElement("div",{className:Ui,innerHTML:n,attrs:{tabIndex:o,"data-tabindex":o,role:"tab","aria-controls":S+this.tabId+"_"+t,"aria-selected":"true","aria-disabled":"false"}}),e.insertBefore(this.createElement("div",r),e.children[t+1]),this.element.querySelector("."+I+"."+d).appendChild(n),r=this.createElement("div",{innerHTML:s}),this.element.querySelector("."+S).querySelector("."+d).appendChild(r)):this.element.querySelector("."+I+"."+d)&&(w.detach(this.element.querySelector("."+I+"."+d).children[0]),w.detach(this.element.querySelector("."+S).querySelector("."+d).children[0]),e=this.items[this.selectedItem],t=w.isNullOrUndefined(e.header)||w.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,n=w.isNullOrUndefined(e.header)||w.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss,s=e.headerTemplate||e.header.text,a=this.createElement("div",{className:Mi,attrs:{role:"presentation"}}),w.isNullOrUndefined(s.tagName)?this.headerTextCompile(a,s,this.selectedItem):a.appendChild(s),l=this.createElement("span",{className:Li+" "+Bi+" "+Ai+"-"+t+" "+n}),(i=this.createElement("div",{className:Ri})).appendChild(a),""!==s&&void 0!==s&&""!==n?("left"===t||"top"===t?i.insertBefore(l,i.firstElementChild):i.appendChild(l),this.isIconAlone=!1):(""===n?a:l)===l&&(w.detach(a),i.appendChild(l),this.isIconAlone=!0),o=w.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),s=e.disabled?{}:{tabIndex:o,"data-tabindex":o,role:"tab","aria-selected":"true","aria-disabled":"false"},i.appendChild(this.btnCls.cloneNode(!0)),(n=this.createElement("div",{className:Ui,attrs:s})).appendChild(i),"top"!==t&&"bottom"!==t||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+I+"."+d).appendChild(n),r=this.createElement("div"),a=void 0,"string"==typeof(l=e.content)||w.isNullOrUndefined(l.innerHTML)?("."===(l="string"==typeof l&&this.enableHtmlSanitizer?w.SanitizeHtmlHelper.sanitize(l):l)[0]||"#"===l[0])&&document.querySelectorAll(l).length?(a=(o=document.querySelector(l)).outerHTML.trim(),r.appendChild(o),o.style.display=""):this.compileElement(r,l,"content",this.selectedItem):r.appendChild(l),w.isNullOrUndefined(a)||-1===this.templateEle.indexOf(l.toString())&&this.templateEle.push(l.toString()),this.element.querySelector(".e-item."+d).appendChild(r)),this.isReact&&this.renderReactTemplates()},h.prototype.refreshActiveTabBorder=function(){"None"===this.heightAdjustMode&&"auto"!==this.height&&this.cntEle&&!this.isVertical()&&(e=this.getTabHeader(),w.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-e.offsetHeight+"px"}));var e=w.select("."+I+"."+Fi+"."+d,this.element);!w.isNullOrUndefined(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder(),this.updatePopupIconAriaLabel()},o([w.Collection([],as)],h.prototype,"items",void 0),o([w.Property("100%")],h.prototype,"width",void 0),o([w.Property("Both")],h.prototype,"swipeMode",void 0),o([w.Property("auto")],h.prototype,"height",void 0),o([w.Property("")],h.prototype,"cssClass",void 0),o([w.Property(0)],h.prototype,"selectedItem",void 0),o([w.Property("Top")],h.prototype,"headerPlacement",void 0),o([w.Property("Content")],h.prototype,"heightAdjustMode",void 0),o([w.Property("Scrollable")],h.prototype,"overflowMode",void 0),o([w.Property("Demand")],h.prototype,"loadOn",void 0),o([w.Property(!1)],h.prototype,"enablePersistence",void 0),o([w.Property(!0)],h.prototype,"enableHtmlSanitizer",void 0),o([w.Property(!1)],h.prototype,"showCloseButton",void 0),o([w.Property(!0)],h.prototype,"reorderActiveTab",void 0),o([w.Property()],h.prototype,"scrollStep",void 0),o([w.Property()],h.prototype,"dragArea",void 0),o([w.Property(!1)],h.prototype,"allowDragAndDrop",void 0),o([w.Property(!0)],h.prototype,"clearTemplates",void 0),o([w.Complex({},is)],h.prototype,"animation",void 0),o([w.Event()],h.prototype,"created",void 0),o([w.Event()],h.prototype,"adding",void 0),o([w.Event()],h.prototype,"added",void 0),o([w.Event()],h.prototype,"selecting",void 0),o([w.Event()],h.prototype,"selected",void 0),o([w.Event()],h.prototype,"removing",void 0),o([w.Event()],h.prototype,"removed",void 0),o([w.Event()],h.prototype,"onDragStart",void 0),o([w.Event()],h.prototype,"dragging",void 0),o([w.Event()],h.prototype,"dragged",void 0),o([w.Event()],h.prototype,"destroyed",void 0);var hs,fi=o([w.NotifyPropertyChanges],h);function h(e,t){e=hs.call(this,e,t)||this;return e.show={},e.hide={},e.maxHeight=0,e.title="Close",e.isInteracted=!1,e.lastIndex=0,e.isAdd=!1,e.isIconAlone=!1,e.draggableItems=[],e.resizeContext=e.refreshActiveTabBorder.bind(e),e.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},e}cs=function(e,t){return(cs=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 cs,ps,o=function(e,t){function i(){this.constructor=e}cs(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},c=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},us="e-treeview",ms="e-control",u="e-icon-collapsible",E="e-icon-expandable",N="e-list-item",fs="e-list-text",O="e-list-parent",gs="e-hover",vs="e-active",ys="e-icons-spinner",bs="e-process",L="e-icons",Ss="e-text-content",Cs="e-input",Is="e-input-group",xs="e-tree-input",Es="e-editing",Ns="e-interaction",Os="e-droppable",ws="e-dragging",ks="e-sibling",Ls="e-drop-in",As="e-drop-next",Ts="e-drop-out",Ds="e-no-drop",Ps="e-fullrow",Ms="e-selected",Hs="e-expanded",Us="e-node-collapsed",Rs="e-disable",Bs="e-check",Vs="e-stop",js="e-treeview-checkbox",Fs="e-frame",qs="e-ripple",Ws="e-node-focus",_s="e-focused",zs="e-list-img",Ks="e-has-child",Xs="e-animation-active",Ys="e-disabled",Gs="e-prevent",Qs="e-virtualization",Js={treeRole:"group",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},Zs=(ps=w.ChildProperty,o($s,ps),c([w.Property("child")],$s.prototype,"child",void 0),c([w.Property([])],$s.prototype,"dataSource",void 0),c([w.Property("expanded")],$s.prototype,"expanded",void 0),c([w.Property("hasChildren")],$s.prototype,"hasChildren",void 0),c([w.Property("htmlAttributes")],$s.prototype,"htmlAttributes",void 0),c([w.Property("iconCss")],$s.prototype,"iconCss",void 0),c([w.Property("id")],$s.prototype,"id",void 0),c([w.Property("imageUrl")],$s.prototype,"imageUrl",void 0),c([w.Property("isChecked")],$s.prototype,"isChecked",void 0),c([w.Property("parentID")],$s.prototype,"parentID",void 0),c([w.Property(null)],$s.prototype,"query",void 0),c([w.Property("selectable")],$s.prototype,"selectable",void 0),c([w.Property("selected")],$s.prototype,"selected",void 0),c([w.Property(null)],$s.prototype,"tableName",void 0),c([w.Property("text")],$s.prototype,"text",void 0),c([w.Property("tooltip")],$s.prototype,"tooltip",void 0),c([w.Property("navigateUrl")],$s.prototype,"navigateUrl",void 0),$s);function $s(){return null!==ps&&ps.apply(this,arguments)||this}en=w.ChildProperty,o(sn,en),c([w.Property("SlideDown")],sn.prototype,"effect",void 0),c([w.Property(400)],sn.prototype,"duration",void 0),c([w.Property("linear")],sn.prototype,"easing",void 0);var en,tn=sn;function sn(){return null!==en&&en.apply(this,arguments)||this}nn=w.ChildProperty,o(ln,nn),c([w.Complex({effect:"SlideUp",duration:400,easing:"linear"},tn)],ln.prototype,"collapse",void 0),c([w.Complex({effect:"SlideDown",duration:400,easing:"linear"},tn)],ln.prototype,"expand",void 0);var nn,rn=ln;function ln(){return null!==nn&&nn.apply(this,arguments)||this}on=w.Component,o(p,on),(an=p).prototype.getModuleName=function(){return"treeview"},p.prototype.preRender=function(){var t=this;this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",ctrlA:"ctrl+A",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",shiftSpace:"shift+space",ctrlSpace:"ctrl+space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:E,ariaAttributes:Js,expandIconPosition:"Left",itemCreated:function(e){t.beforeNodeCreate(e)},enableHtmlSanitizer:this.enableHtmlSanitizer,disableHtmlEncode:this.disableHtmlEncode,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new w.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource)),w.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),w.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),w.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},p.prototype.getPersistData=function(){return this.addOnPersist(["selectedNodes","checkedNodes","expandedNodes"])},p.prototype.render=function(){this.initialRender=!0,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.initialRender=!1,this.renderComplete()},p.prototype.initialize=function(){this.element.setAttribute("role","tree"),!w.isNullOrUndefined(this.fields.dataSource)&&Array.isArray(this.fields.dataSource)&&0!==this.fields.dataSource.length&&this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},p.prototype.setDisabledMode=function(){this.disabled?(this.element.classList.add(Ys),this.element.setAttribute("aria-disabled","true")):(this.element.classList.remove(Ys),this.element.setAttribute("aria-disabled","false"))},p.prototype.setEnableRtl=function(){(this.enableRtl?w.addClass:w.removeClass)([this.element],"e-rtl")},p.prototype.setRipple=function(){this.rippleFn=w.rippleEffect(this.element,{selector:".e-fullrow,.e-text-content",ignore:"."+Ss+" > ."+L+",."+Is+",."+Cs+", ."+js});var e={selector:"."+Ss+" > ."+L,isCenterRipple:!0};this.rippleIconFn=w.rippleEffect(this.element,e)},p.prototype.setFullRow=function(e){(e?w.addClass:w.removeClass)([this.element],"e-fullrow-wrap")},p.prototype.setMultiSelect=function(e){e?this.element.setAttribute("aria-multiselectable","true"):this.element.setAttribute("aria-multiselectable","false")},p.prototype.templateComplier=function(t){if(t){this.hasTemplate=!0,this.element.classList.add(Ns);try{return"function"!=typeof t&&document.querySelectorAll(t).length?w.compile(document.querySelector(t).innerHTML.trim()):w.compile(t)}catch(e){return w.compile(t)}}this.element.classList.remove(Ns)},p.prototype.setDataBinding=function(t){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof x.DataManager?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof x.DataManager&&i.isOffline&&(i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),i.renderItems(!0),0!==i.treeList.length||i.isLoaded||i.finalize())}).catch(function(e){i.trigger("actionFailure",{error:e})}):this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function(e){i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),t&&(i.changeDataSource=!0),i.renderItems(!0),i.changeDataSource=!1,0!==i.treeList.length||i.isLoaded||i.finalize()}).catch(function(e){i.trigger("actionFailure",{error:e})})):(this.treeList.pop(),w.isNullOrUndefined(this.fields.dataSource)?this.rootData=this.treeData=[]:(this.treeData=JSON.parse(JSON.stringify(this.fields.dataSource)),this.setRootData()),this.isNumberTypeId=this.getType(),this.renderItems(!1)),0!==this.treeList.length||this.isLoaded||this.finalize()},p.prototype.getQuery=function(e,t){void 0===t&&(t=null);var i=[];if(e.query)s=e.query.clone();else{for(var s=new x.Query,n=this.getActualProperties(e),r=0,l=Object.keys(n);r<l.length;r++){var o=l[r];"dataSource"!==o&&"tableName"!==o&&"child"!==o&&e[""+o]&&"url"!==o&&-1===i.indexOf(e[""+o])&&i.push(e[""+o])}s.select(i),Object.prototype.hasOwnProperty.call(n,"tableName")&&s.from(e.tableName)}return k.ListBase.addSorting(this.sortOrder,e.text,s),w.isNullOrUndefined(t)||w.isNullOrUndefined(e.parentID)||s.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(t):t),s},p.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof w.getValue(this.fields.id,this.treeData[0])},p.prototype.setRootData=function(){var e;this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType?(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID),e=this.getChildNodes(this.treeData,void 0,!0),w.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e):this.rootData=this.treeData},p.prototype.isChildObject=function(){return"object"==typeof this.fields.child},p.prototype.renderItems=function(e){if(this.enableVirtualization&&!w.isNullOrUndefined(this.height))this.ulElement=this.createElement("ul",{className:O+" e-ul",attrs:{role:"group"}}),this.element.appendChild(this.ulElement);else{this.listBaseOption.ariaAttributes.level=1;var t=this.getSortedData(this.rootData),i=(this.ulElement=k.ListBase.createList(this.createElement,e?this.rootData:t,this.listBaseOption),this.element.appendChild(this.ulElement),this.ulElement.querySelectorAll(".e-list-item"));if(!1===this.loadOnDemand)for(var s=0;s<i.length;)this.renderChildNodes(i[parseInt(s.toString(),10)],!0,null,!0),s++;(1===w.selectAll("."+O,this.element).length&&i&&0!==i.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()}},p.prototype.updateCheckedStateFromDS=function(){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var e=this.fields,t=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.isChecked,"equal",!0,!1)),i=0;i<t.length;i++){var s=t[parseInt(i.toString(),10)][this.fields.id]?t[parseInt(i.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(s)||this.isLoaded||this.checkDisabledState(s,t[i]),t[parseInt(i.toString(),10)][this.fields.hasChildren])for(var s=t[parseInt(i.toString(),10)][this.fields.id],n=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.parentID,"equal",s,!1)),r=0;r<n.length;r++){var l=n[parseInt(r.toString(),10)][this.fields.id]?n[parseInt(r.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(l)&&this.autoCheck&&this.checkDisabledState(l,n[r])}}for(i=0;i<this.checkedNodes.length;i++)for(var o=this.fields,a=new x.DataManager(this.treeData).executeLocal((new x.Query).where(o.id,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0)),d=(a[0]&&this.autoCheck&&(this.getCheckedNodeDetails(o,a),this.checkIndeterminateState(a[0])),0<a.length&&(c=a[0][this.fields.id]?a[0][this.fields.id].toString():null,-1<this.checkedNodes.indexOf(c))&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c),new x.DataManager(this.treeData).executeLocal((new x.Query).where(o.parentID,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0))),h=0;h<d.length;h++){var c=d[parseInt(h.toString(),10)][this.fields.id]?d[parseInt(h.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(c)&&this.autoCheck&&this.checkDisabledState(c,d[h]),-1<this.checkedNodes.indexOf(c)&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c)}}else if(2===this.dataType||this.fields.dataSource instanceof x.DataManager&&this.isOffline){for(h=0;h<this.treeData.length;h++){var p=this.treeData[parseInt(h.toString(),10)][this.fields.id]?this.treeData[parseInt(h.toString(),10)][this.fields.id].toString():"",p=(this.treeData[parseInt(h.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(p)&&this.checkDisabledState(p,this.treeData[h]),-1<this.checkedNodes.indexOf(p)&&-1===this.validNodes.indexOf(p)&&this.validNodes.push(p),w.getValue(this.fields.child.toString(),this.treeData[parseInt(h.toString(),10)]));p&&this.updateChildCheckState(p,this.treeData[parseInt(h.toString(),10)])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},p.prototype.getCheckedNodeDetails=function(e,t){var i=t[0][this.fields.parentID]?t[0][this.fields.parentID].toString():null,s=0,n=this.element.querySelector('[data-uid="'+t[0][this.fields.id]+'"]'),t=this.element.querySelector('[data-uid="'+t[0][this.fields.parentID]+'"]');if(n||t)t&&!w.select("."+Bs,t)&&this.changeState(t,"indeterminate",null,!0,!0);else{-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i);for(var r=this.getChildNodes(this.treeData,i),l=0;l<r.length;l++){var o=r[parseInt(l.toString(),10)][this.fields.id]?r[parseInt(l.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(o)&&s++,s===r.length&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i)}n=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.id,"equal",i,!0));this.getCheckedNodeDetails(e,n)}},p.prototype.updateParentCheckState=function(){var i,e=w.selectAll("."+Vs,this.element),t=this.treeData;this.element.classList.contains("e-filtering")&&(t=this.DDTTreeData);for(var s=0;s<e.length;s++){var n=w.closest(e[parseInt(s.toString(),10)],"."+N),r=n.getAttribute("data-uid").toString(),l=void 0,o=(this.element.classList.contains("e-filtering")&&(l=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("parentID","equal",r,!0))),i=1===this.dataType?new x.DataManager(t).executeLocal((new x.Query).where(this.fields.parentID,"equal",r,!0)):this.getChildNodes(t,r),0);if(i){for(var a=this,d=0;d<i.length;d++)!function(e){var t=i[parseInt(e.toString(),10)][a.fields.id].toString();(-1!==a.checkedNodes.indexOf(t)||a.element.classList.contains("e-filtering")&&-1!==l.findIndex(function(e){return e.id===t}))&&o++}(d);o===i.length?(r=n.getAttribute("data-uid"),-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r),this.changeState(n,"check",null,!0,!0)):0===o&&0===this.checkedNodes.length&&0===e.length&&this.changeState(n,"uncheck",null,!0,!0)}}},p.prototype.checkIndeterminateState=function(e){var t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]');t?"true"!==t.getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0):2===this.dataType&&-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())},p.prototype.updateChildCheckState=function(e,t){for(var i=0,s=t[this.fields.id]?t[this.fields.id].toString():"",n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",r=(e[parseInt(n.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]),-1!==this.checkedNodes.indexOf(s)&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkDisabledState(r,e[n]),-1!==this.checkedNodes.indexOf(r)&&this.autoCheck&&i++,-1<this.checkedNodes.indexOf(r)&&-1===this.validNodes.indexOf(r)&&this.validNodes.push(r),w.getValue(this.fields.child.toString(),e[parseInt(n.toString(),10)]));r&&r.length&&(-1===this.parentCheckData.indexOf(t)&&this.parentCheckData.push(t),this.updateChildCheckState(r,e[parseInt(n.toString(),10)])),i===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(s)&&this.checkDisabledState(s,t)}if(0!==i&&this.autoCheck){this.checkIndeterminateState(t);for(var l=0;l<this.parentCheckData.length;l++)t!==this.parentCheckData[parseInt(l.toString(),10)]&&this.parentCheckData[parseInt(l.toString(),10)]&&this.checkIndeterminateState(this.parentCheckData[parseInt(l.toString(),10)])}this.parentCheckData=[]},p.prototype.beforeNodeCreate=function(e){this.showCheckBox&&((t=R.createCheckBox(this.createElement,!0,{cssClass:this.touchClass})).classList.add(js),s=w.select("div."+E+", div."+u,e.item),i=e.item.getAttribute("data-uid"),e.item.childNodes[0].insertBefore(t,e.item.childNodes[0].childNodes[w.isNullOrUndefined(s)?0:1]),s=w.getValue(e.fields.isChecked,e.curData),!(-1<this.checkedNodes.indexOf(i))&&(w.isNullOrUndefined(s)||"true"!==s.toString())?e.item.setAttribute("aria-checked","false"):(w.select("."+Fs,t).classList.add(Bs),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item)),i=w.select("."+Fs,t),w.EventHandler.add(i,"mousedown",this.frameMouseHandler,this),w.EventHandler.add(i,"mouseup",this.frameMouseHandler,this),w.EventHandler.add(i,"mouseleave",this.frameMouseHandler,this)),this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains(Ms)&&e.item.setAttribute("aria-selected","false");var t,i,s=e.fields,s=(this.addActionClass(e,s.selected,Ms),this.addActionClass(e,s.expanded,Hs),e.item.setAttribute("tabindex","-1"),w.EventHandler.add(e.item,"focus",this.focusIn,this),w.isNullOrUndefined(this.nodeTemplateFn)||(t=e.item.querySelector("."+fs),i=e.item.getAttribute("data-uid"),t.innerHTML="",this.renderNodeTemplate(e.curData,t,i)),{node:e.item,nodeData:e.curData,text:e.text});this.isRefreshed||(this.trigger("drawNode",s),!1===e.curData[this.fields.selectable]&&(e.item.classList.add(Gs),e.item.firstElementChild.style.cursor="not-allowed"))},p.prototype.frameMouseHandler=function(e){var t=w.select(".e-ripple-container",e.target.parentElement);R.rippleMouseHandler(e,t)},p.prototype.addActionClass=function(e,t,i){var s=e.curData,t=w.getValue(t,s);w.isNullOrUndefined(t)||"false"===t.toString()||e.item.classList.add(i)},p.prototype.getDataType=function(e,t){if(this.fields.dataSource instanceof x.DataManager){for(var i=0;i<e.length;i++)if(this.isOffline){if("string"==typeof t.child&&w.isNullOrUndefined(w.getValue(t.child,e[parseInt(i.toString(),10)]))&&!w.isNullOrUndefined(w.getValue(t.parentID,e[parseInt(i.toString(),10)])))return 1}else if("string"==typeof t.child&&w.isNullOrUndefined(w.getValue(t.child,e[parseInt(i.toString(),10)])))return 1;return 2}for(var i=0,s=e.length;i<s;i++){if("string"==typeof t.child&&(!w.isNullOrUndefined(w.getValue(t.child,e[parseInt(i.toString(),10)]))||Object.prototype.hasOwnProperty.call(e[parseInt(i.toString(),10)],t.child)))return 2;if(this.isChildObject())return 2;if(!w.isNullOrUndefined(w.getValue(t.parentID,e[parseInt(i.toString(),10)]))||!w.isNullOrUndefined(w.getValue(t.hasChildren,e[parseInt(i.toString(),10)])))return 1}return 1},p.prototype.getGroupedData=function(e,t){for(var t=(new x.Query).group(t),i=k.ListBase.getDataSource(e,t),s=[],n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)].items;s.push(r)}return s},p.prototype.getSortedData=function(e){return e=e&&"None"!==this.sortOrder?k.ListBase.getDataSource(e,k.ListBase.addSorting(this.sortOrder,this.fields.text)):e},p.prototype.finalizeNode=function(e,t,i){var s=this;if(t||this.updateAttributes(e),!i){var n=w.selectAll("."+Hs,e);if(!this.loadOnDemand&&this.fields.dataSource instanceof x.DataManager&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[s.fields.expanded]}).length||this.isInitalExpand),!this.isInitalExpand)for(var r=0;r<n.length;r++)this.renderChildNodes(n[parseInt(r.toString(),10)]);w.removeClass(n,Hs)}t||this.updateList(),this.isLoaded&&this.updateCheckedProp()},p.prototype.updateAttributes=function(e){for(var t=w.selectAll("."+zs,e),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].setAttribute("alt",zs);if(this.isLoaded){for(var s=w.selectAll("."+Ms,e),n=0;n<s.length;n++){this.selectNode(s[parseInt(n.toString(),10)],null);break}w.removeClass(s,Ms)}for(var r=w.selectAll("."+N+":not(."+Hs+")",e),l=0;l<r.length;l++){var o=w.select("div."+L,r[parseInt(l.toString(),10)]);o&&o.classList.contains(E)&&this.disableExpandAttr(r[parseInt(l.toString(),10)])}},p.prototype.updateCheckedProp=function(){var e;this.showCheckBox&&(e=[].concat([],this.checkedNodes),this.setProperties({checkedNodes:e},!0))},p.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=w.selectAll("li",this.element),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].classList.contains(N)&&(w.select("."+O,e[parseInt(t.toString(),10)])?this.ensureParentCheckState(e[parseInt(t.toString(),10)]):this.ensureChildCheckState(e[parseInt(t.toString(),10)]));else for(var i=w.selectAll("."+Vs,this.element),t=0;t<i.length;t++)i[parseInt(t.toString(),10)].classList.remove(Vs)},p.prototype.ensureParentCheckState=function(e){var t,i,s,n,r,l,o,a,d,h,c,p,u,m=this;w.isNullOrUndefined(e)||e.classList.contains(us)||((o=e).classList.contains(N)&&(o=w.select("."+O,e)),a=w.selectAll("."+js+" ."+Bs,o),t=w.selectAll("."+Vs,o),o=w.selectAll(this.checkDisabledChildren?"."+N:"."+N+":not(."+Rs+")",o),i=e.getElementsByClassName(js)[0],d=o.length,a=a.length,h=[],c=[],s=e.getAttribute("data-uid"),r=!(n=!0),u=this.getAllChildNodes(this.DDTTreeData,s),l=0,o.forEach(function(e){e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")?r=!0:n=!1)}),o=!1,this.element.classList.contains("e-filtering")&&(a=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("parentID","equal",s,!0)).length,0<(p=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("hasChildren","equal",!0,!0))).length&&r&&(this.OldCheckedData.some(function(e){return e.id===s})||-1!==this.parentNodeCheck.indexOf(s))&&(a=p.length,o=!0),d=(1===this.dataType?new x.DataManager(this.DDTTreeData).executeLocal((new x.Query).where(this.fields.parentID,"equal",s,!0)):this.getChildNodes(this.DDTTreeData,s)).length,u.forEach(function(e){var t=String(e[m.fields.id]);-1===m.checkedNodes.indexOf(t)&&!m.OldCheckedData.some(function(e){return e.parentID===t})||l++})),!this.autoCheck||!this.showCheckBox||this.fields.dataSource instanceof x.DataManager||(h=this.getSelectedChildNodeDetails(s),c=new x.DataManager(this.checkActionNodes).executeLocal((new x.Query).where("parentID","equal",s,!0))),0===d&&0===a)||(d===a||o&&0<d&&(c.length===h.length||c.length!==h.length)&&0!==c.length&&0!==h.length&&n&&this.autoCheck&&this.showCheckBox?this.changeState(i,"check",null,!0,!0):0<a&&!o&&this.autoCheck&&this.showCheckBox||0<a||0<t.length||0<l?this.changeState(i,"indeterminate",null,!0,!0):0===a&&this.changeState(i,"uncheck",null,!0,!0),p=w.closest(e,"."+O),w.isNullOrUndefined(p))||(u=w.closest(p,"."+N),this.ensureParentCheckState(u))},p.prototype.getSelectedChildNodeDetails=function(i){function t(e){var t;return!w.isNullOrUndefined(n)&&n in e&&Array.isArray(e[n])?(t=e[r],!w.isNullOrUndefined(t)&&t.toString()===i):(t=e[l],!w.isNullOrUndefined(t)&&t.toString()===i)}var s=this,n="string"==typeof this.fields.child?this.fields.child:null,r=this.fields.id,l=this.fields.parentID;this.nodeIndex||(this.nodeIndex=new Map,this.buildNodeIndex(this.treeData));return this.checkedNodes.map(function(e){return s.nodeIndex.get(e)}).filter(function(e){return(e&&"object"==typeof e&&n in e||2!==s.dataType&&"object"==typeof e&&(l in e||n in e))&&t(e)})},p.prototype.buildNodeIndex=function(e){var i=this,s="string"==typeof this.fields.child?this.fields.child:null;e.forEach(function(e){var t=w.getValue(i.fields.id,e);null!=t&&(i.nodeIndex||(i.nodeIndex=new Map),i.nodeIndex.set(t.toString(),e)),s&&(t=w.getValue(s,e),Array.isArray(t))&&i.buildNodeIndex(t)})},p.prototype.getAllChildNodes=function(e,t){var i,s,n,r,l;return!w.isNullOrUndefined(e)&&!w.isNullOrUndefined(t)&&Array.isArray(e)?1===this.dataType?(i=this.fields.parentID,s=t.toString(),e.filter(function(e){e=w.getValue(i,e);return!w.isNullOrUndefined(e)&&e.toString()===s})):2===this.dataType&&(n=this.fields.id,r=this.fields.child.toString(),l=t.toString(),t=e.find(function(e){e=w.getValue(n,e);return!w.isNullOrUndefined(e)&&e.toString()===l}))&&(e=w.getValue(r,t),Array.isArray(e))?e:[]:[]},p.prototype.ensureChildCheckState=function(e,t,i){var s=this;if(!w.isNullOrUndefined(e)){var n=w.select("."+O,e),r=void 0;if(!w.isNullOrUndefined(n)){var l=Array.from(n.querySelectorAll("li")),r=w.selectAll("."+js,n);this.isFilter&&(r=Array.from(r).filter(function(e){e=e.closest("li").getAttribute("data-uid");return null!==e&&-1!==s.checkedNodes.indexOf(e)}),l=Array.from(l).filter(function(e){e=e.getAttribute("data-uid");return null!==e&&-1!==s.checkedNodes.indexOf(e)}),0===r.length)&&(r=w.selectAll("."+js,n),l=Array.from(n.querySelectorAll("li")));for(var o=e.getElementsByClassName(Fs)[0].classList.contains(Bs),a=e.getElementsByClassName(Fs)[0].classList.contains(Vs),d=void 0,h=0;h<r.length;h++){var c,p=l[parseInt(h.toString(),10)].getAttribute("data-uid");w.isNullOrUndefined(this.currentLoadData)||w.isNullOrUndefined(w.getValue(this.fields.isChecked,this.currentLoadData[parseInt(h.toString(),10)]))?(c=r[parseInt(h.toString(),10)].getElementsByClassName(Fs)[0].classList.contains(Bs),o||c&&!this.isLoaded||-1!==this.checkedNodes.indexOf(p)&&this.isLoaded&&(a||o)?d="check":l[parseInt(h.toString(),10)].classList.contains(Ks)&&!w.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(o||a)&&-1!==this.parentNodeCheck.indexOf(p)||1===this.dataType&&!w.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(o||a)&&-1!==this.parentNodeCheck.indexOf(p)?(d="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)):d="uncheck"):(d=w.getValue(this.fields.isChecked,this.currentLoadData[parseInt(h.toString(),10)])?"check":"uncheck","uncheck"===(d=-1!==this.ele?o?"check":"uncheck":d)&&!w.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(p)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1),d="indeterminate")),this.changeState(r[parseInt(h.toString(),10)],d,t,!0,!0)}}this.autoCheck&&this.isLoaded&&!i&&this.updateParentCheckState()}},p.prototype.doCheckBoxAction=function(e,t){var i=this;if(w.isNullOrUndefined(e)){var s=w.selectAll("."+js,this.element);if(this.loadOnDemand)for(var n=0;n<s.length;n++){l=w.closest(s[parseInt(n.toString(),10)],"."+N);this.updateFieldChecked(s[parseInt(n.toString(),10)],t),this.changeState(s[parseInt(n.toString(),10)],t?"check":"uncheck",null,null,null,t),this.updateOldCheckedData([this.getNodeData(l)])}else for(n=0;n<s.length;n++){l=w.closest(s[parseInt(n.toString(),10)],"."+N);this.updateFieldChecked(s[parseInt(n.toString(),10)],t),this.changeState(s[parseInt(n.toString(),10)],t?"check":"uncheck"),this.updateOldCheckedData([this.getNodeData(l)])}}else{1<e.length&&this.autoCheck&&(this.isBatchMode=!0,this.batchParentNode=new Set),e.reverse();for(var r=e.length-1;0<=r;r--){var l=this.getElement(e[parseInt(r.toString(),10)]);if(w.isNullOrUndefined(l)){if(""!==(p=e[r-e.length]?e[r-e.length].toString():e[parseInt(r.toString(),10)]?e[parseInt(r.toString(),10)].toString():null)&&t&&p)this.setValidCheckedNode(p,e),this.dynamicCheckState(p,t);else if(-1!==this.checkedNodes.indexOf(p)&&""!==p&&!t){this.checkedNodes.splice(this.checkedNodes.indexOf(p),1);var o=this.getChildNodes(this.treeData,p);if(o){for(var a=0;a<o.length;a++){var d=o[parseInt(a.toString(),10)][this.fields.id]?o[parseInt(a.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&(this.checkedNodes.splice(this.checkedNodes.indexOf(d),1),d=this.element.querySelector('[data-uid="'+d+'"]'))&&this.changeState(d,"uncheck",null)}-1!==this.parentNodeCheck.indexOf(p)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)}p&&this.dynamicCheckState(p,t),this.updateField(this.treeData,this.fields,p,"isChecked",null)}}else{var h=w.select("."+O+" ."+js,l);this.validateCheckNode(h,!t,l,null)}}this.isBatchMode&&this.autoCheck&&(this.isBatchMode=!1,Array.from(this.batchParentNode).forEach(function(e){e=i.getElement(e);e&&i.ensureParentCheckState(e)}),this.batchParentNode.clear())}if(e)for(var c=0;c<e.length-1;c++){var p=e[parseInt(c.toString(),10)]?e[parseInt(c.toString(),10)].toString():"";t||this.updateField(this.treeData,this.fields,p,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},p.prototype.updateFieldChecked=function(e,t){var e=w.closest(e,"."+N),i=e.getAttribute("data-uid");"true"!==this.getNodeData(e).isChecked||t||this.updateField(this.treeData,this.fields,i,"isChecked",null)},p.prototype.dynamicCheckState=function(e,t){if(1===this.dataType){var i=0,s=new x.DataManager(this.treeData).executeLocal((new x.Query).where(this.fields.id,"equal",e,!0));if(s[0]){var n=s[0][this.fields.id]?s[0][this.fields.id].toString():null,s=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null,r=this.element.querySelector('[data-uid="'+s+'"]'),l=this.element.querySelector('[data-uid="'+n+'"]'),o=this.getChildNodes(this.treeData,s);if(o)for(var a=0;a<o.length;a++){var d=o[parseInt(a.toString(),10)][this.fields.id]?o[parseInt(a.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&i++}-1!==this.checkedNodes.indexOf(e)&&r&&n===e&&this.autoCheck?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&l&&n===e&&!t?this.changeState(l,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&l&&n===e&&t?this.changeState(l,"check",null):-1===this.checkedNodes.indexOf(e)&&!l&&r&&n===e&&this.autoCheck&&0!==i?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!l&&r&&n===e&&this.autoCheck&&0===i?this.changeState(r,"uncheck",null):l||r||n!==e||!this.autoCheck||this.updateIndeterminate(e,t)}}else if(2===this.dataType||this.fields.dataSource instanceof x.DataManager&&this.isOffline)for(n=void 0,r=void 0,a=0;a<this.treeData.length;a++){n=this.treeData[parseInt(a.toString(),10)][this.fields.id]?this.treeData[parseInt(a.toString(),10)][this.fields.id].toString():"",h=(r=this.element.querySelector('[data-uid="'+n+'"]'))?w.select("."+Bs,r):null,-1===this.checkedNodes.indexOf(n)&&r&&h&&!t&&this.changeState(r,"uncheck",null);var h=w.getValue(this.fields.child.toString(),this.treeData[parseInt(a.toString(),10)]);h&&this.updateChildIndeterminate(h,n,e,t,n)}},p.prototype.updateIndeterminate=function(e,t){var i,e=this.getTreeData(e),s=0,n=(1===this.dataType&&(i=e[0][this.fields.parentID]?e[0][this.fields.parentID].toString():null),this.getChildNodes(this.treeData,i));if(n)for(var r=0;r<n.length;r++){var l=n[parseInt(r.toString(),10)][this.fields.id]?n[parseInt(r.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(l)&&s++}e=this.element.querySelector('[data-uid="'+i+'"]');e&&t||!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0!==s?this.changeState(e,"indeterminate",null):!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0===s?this.changeState(e,"uncheck",null):e||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?(t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)||!t&&-1!==this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)&&0!==s)&&this.parentNodeCheck.push(i):this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i),1),this.updateIndeterminate(i,t),-1===this.checkedNodes.indexOf(i))||t||this.checkedNodes.splice(this.checkedNodes.indexOf(i),1)},p.prototype.updateChildIndeterminate=function(e,t,i,s,n){for(var r=0,l=0;l<e.length;l++){var o=e[parseInt(l.toString(),10)][this.fields.id]?e[parseInt(l.toString(),10)][this.fields.id].toString():"",a=(-1!==this.checkedNodes.indexOf(o)&&r++,this.element.querySelector('[data-uid="'+t+'"]')),d=a?w.select("."+Vs,a):null,h=a?w.select("."+Bs,a):null,c=this.element.querySelector('[data-uid="'+o+'"]'),p=c?w.select("."+Bs,c):null,h=(-1!==this.checkedNodes.indexOf(i)&&a&&o===i&&this.autoCheck?this.changeState(a,"indeterminate",null):-1!==this.checkedNodes.indexOf(i)||!a||c||o!==i||s?-1===this.checkedNodes.indexOf(i)&&c&&o===i&&!s?this.changeState(c,"uncheck",null):-1===this.checkedNodes.indexOf(i)&&d&&o===i&&this.autoCheck&&0===r&&!s?d.classList.remove(Vs):-1===this.checkedNodes.indexOf(i)&&!c&&h&&o===i&&0===r?this.changeState(a,"uncheck",null):-1===this.checkedNodes.indexOf(o)&&c&&p&&0===r?this.changeState(c,"uncheck",null):(!c&&!a&&o===i||-1!==this.parentNodeCheck.indexOf(t)&&this.autoCheck)&&(d=this.element.querySelector('[data-uid="'+n+'"]'),s&&0!==r?this.changeState(d,"indeterminate",null):s&&r===e.length&&-1===this.checkedNodes.indexOf(t)?this.checkDisabledState(t):s||0!==r||-1===this.parentNodeCheck.indexOf(t)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(t)),-1===this.parentNodeCheck.indexOf(t))&&this.parentNodeCheck.push(t):!this.autoCheck&&0!==r?this.changeState(a,"indeterminate",null):this.changeState(a,"uncheck",null),w.getValue(this.fields.child.toString(),e[parseInt(l.toString(),10)]));h&&this.updateChildIndeterminate(h,o,i,s,n)}},p.prototype.changeState=function(t,i,s,n,r,l){var e,o=this,a=w.closest(t,"."+N);!this.checkDisabledChildren&&a&&(a.classList.contains(Rs)||this.disableNode&&-1!==this.disableNode.indexOf(a.getAttribute("data-uid")))||(t===a&&(t=w.select("."+js,a)),n?this.nodeCheckAction(t,i,a,e,s,n,r,l):(this.checkActionNodes=[],e=this.getCheckEvent(a,i,s),this.trigger("nodeChecking",e,function(e){e.cancel||o.nodeCheckAction(t,i,a,e,s,n,r,l)})))},p.prototype.nodeCheckAction=function(e,t,i,s,n,r,l,o){var a,e=e.getElementsByClassName(Fs)[0];"check"!==t||e.classList.contains(Bs)?"uncheck"===t&&(e.classList.contains(Bs)||e.classList.contains(Vs))?(w.removeClass([e],[Bs,Vs]),this.removeCheck(i),a="false"):"indeterminate"===t&&this.autoCheck&&(e.classList.remove(Bs),e.classList.add(Vs),this.removeCheck(i,!0),a="mixed"):(e.classList.remove(Vs),e.classList.add(Bs),this.addCheck(i),a="true"),w.isNullOrUndefined(a="check"===t?"true":"uncheck"===t?"false":a)||i.setAttribute("aria-checked",a),l&&(e=[].concat([],this.checkActionNodes),s=this.getCheckEvent(i,t,n),w.isUndefined(r))&&(s.data=e),void 0!==o&&this.ensureStateChange(i,o),r||w.isNullOrUndefined(a)||(i.setAttribute("aria-checked",a),s.data[0].checked=a,this.trigger("nodeChecked",s),this.checkActionNodes=[])},p.prototype.addCheck=function(e){var t,e=e.getAttribute("data-uid");w.isNullOrUndefined(e)||-1!==this.checkedNodes.indexOf(e)||this.checkDisabledState(e),this.enableVirtualization&&(this.virtualIndeterminateNodesSet.delete(e),t=this.virtualNodeMap.get(e),!w.isNullOrUndefined(t))&&-1<t&&(this.virtualFlatNodes[parseInt(t.toString(),10)].isChecked=!0,this.autoCheck)&&this.virtualFlatNodes[parseInt(t.toString(),10)].hasChildren&&this.setVirtualChildCheckState(e,!0)},p.prototype.removeCheck=function(e,t){var e=e.getAttribute("data-uid"),i=this.checkedNodes.indexOf(e);-1<i&&this.checkedNodes.splice(i,1),this.enableVirtualization&&(i=this.virtualNodeMap.get(e),!w.isNullOrUndefined(i))&&-1<i&&(t?(this.virtualFlatNodes[parseInt(i.toString(),10)].isChecked="indeterminate",this.virtualIndeterminateNodesSet.add(e)):(this.virtualIndeterminateNodesSet.delete(e),this.virtualCheckedNodesSet.delete(e),this.virtualFlatNodes[parseInt(i.toString(),10)].isChecked=!1,this.treeData&&this.fields&&this.fields.isChecked&&w.setValue(this.fields.isChecked,!1,this.treeData[parseInt(e.toString(),10)-1]),this.autoCheck&&this.virtualFlatNodes[parseInt(i.toString(),10)].hasChildren&&this.setVirtualChildCheckState(e,!1)))},p.prototype.setVirtualChildCheckState=function(e,t){if(this.virtualFlatNodes&&0!==this.virtualFlatNodes.length){for(var i=0;i<this.virtualFlatNodes.length;i++){var s=this.virtualFlatNodes[parseInt(i.toString(),10)];s.parentId===e&&((s.isChecked=t)?(this.virtualCheckedNodesSet.add(s.id),this.checkedNodes&&-1===this.checkedNodes.indexOf(s.id)&&this.checkedNodes.push(s.id)):(this.virtualCheckedNodesSet.delete(s.id),-1!==(r=this.checkedNodes?this.checkedNodes.indexOf(s.id):-1)&&this.checkedNodes.splice(r,1)),s.hasChildren)&&this.setVirtualChildCheckState(s.id,t)}var n=this.getChildNodes(this.treeData,e);if(n)for(i=0;i<n.length;i++){var r,l=n[parseInt(i.toString(),10)][this.fields.id]?n[parseInt(i.toString(),10)][this.fields.id].toString():null;!l||this.virtualNodeMap&&this.virtualNodeMap.has(l)||(this.updateField(this.treeData,this.fields,l,this.fields.isChecked,t),t?this.checkedNodes&&-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l):-1!==(r=this.checkedNodes?this.checkedNodes.indexOf(l):-1)&&this.checkedNodes.splice(r,1),this.setVirtualChildCheckState(l,t))}}},p.prototype.getCheckEvent=function(e,t,i){this.checkActionNodes.push(this.getNodeData(e));var s=this.checkActionNodes;return{action:t,cancel:!1,isInteracted:!w.isNullOrUndefined(i),node:e,data:s}},p.prototype.finalize=function(){var e=w.select("."+O,this.element);w.isNullOrUndefined(e)||(e.setAttribute("role",Js.treeRole),this.setMultiSelect(this.allowMultiSelection),this.setNodeFocusable(),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&Object.prototype.hasOwnProperty.call(this.rootData[0],this.fields.parentID),this.doExpandAction())},p.prototype.setTextWrap=function(){(this.allowTextWrap?w.addClass:w.removeClass)([this.element],"e-text-wrap"),w.Browser.isIE&&(this.allowTextWrap?w.addClass:w.removeClass)([this.element],"e-ie-wrap")},p.prototype.updateWrap=function(e){if(this.fullRowSelect){var t=e?w.selectAll("."+N,e):this.liList;if(t)for(var i=t.length,s=0;s<i;s++)this.calculateWrap(t[parseInt(s.toString(),10)])}},p.prototype.calculateWrap=function(e){e=w.select("."+Ps,e);e&&e.nextElementSibling&&(e.style.height=this.allowTextWrap?e.nextElementSibling.offsetHeight+"px":"")},p.prototype.doExpandAction=function(){var t=this,e=this.expandedNodes;if(!this.loadOnDemand&&this.fields.dataSource instanceof x.DataManager&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[t.fields.expanded]}).length||this.isInitalExpand),this.isInitalExpand&&0<e.length)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof x.DataManager)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var s,n=this.escapeHashInUid(e[parseInt(i.toString(),10)]),n=w.select('[data-uid="'+n+'"]',this.element);w.isNullOrUndefined(n)?e[parseInt(i.toString(),10)]&&-1===this.expandChildren.indexOf(e[parseInt(i.toString(),10)])&&this.expandChildren.push(e[parseInt(i.toString(),10)].toString()):(s=w.select("."+E,w.select("."+Ss,n)),w.isNullOrUndefined(s)||this.expandAction(n,s,null))}this.afterFinalized()}else this.afterFinalized()},p.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){t.index++,t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()}),0<this.index&&(this.index=0)},p.prototype.expandCallback=function(e,t){var i,e=this.escapeHashInUid(e),e=w.select('[data-uid="'+e+'"]',this.element);w.isNullOrUndefined(e)||(i=w.select("."+E,w.select("."+Ss,e)),w.isNullOrUndefined(i))||this.expandAction(e,i,null,!1,t),t()},p.prototype.afterFinalized=function(){var e;this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,this.isLoaded&&!this.isFieldChange||this.isNodeDropped||(e={data:this.treeData},this.trigger("dataBound",e)),this.isLoaded=!0,this.isNodeDropped=!1,this.enableVirtualization&&!w.isNullOrUndefined(this.height)&&this.initVirtualization()},p.prototype.doSelectionAction=function(){var e=w.selectAll("."+Ms,this.element),t=this.selectedNodes;if(0<t.length){this.setProperties({selectedNodes:[]},!0);for(var i=0;i<t.length;i++){var s=this.escapeHashInUid(t[parseInt(i.toString(),10)]),s=w.select('[data-uid="'+s+'"]',this.element);if(s&&!s.classList.contains("e-active")?this.selectNode(s,null,!0):this.selectedNodes.push(t[parseInt(i.toString(),10)]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);w.removeClass(e,Ms)},p.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[parseInt(t.toString(),10)].classList.contains("e-disable")||this.selectNode(e[parseInt(t.toString(),10)],null,!0),this.allowMultiSelection);t++);},p.prototype.clickHandler=function(e){var t=w.Browser.isDevice&&e.originalEvent.changedTouches&&!w.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;if(w.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),t&&!this.dragStartAction){var i=t.classList,s=w.closest(t,"."+N);if(s&&(!s.classList.contains(Gs)||i.contains(E)||i.contains(u))){if(3!==e.originalEvent.which){var n=w.select(".e-ripple-element",s),r=w.select("."+L,s),l=(this.removeHover(),this.setFocusElement(s),i.contains(E)||i.contains(u));if(this.showCheckBox&&!s.classList.contains("e-disable")&&!l){var o,l=this.checkOnClick?w.select("."+js,s):w.closest(t,"."+js);if(!w.isNullOrUndefined(l))return o=w.select("."+Fs,l),this.validateCheckNode(l,o.classList.contains(Bs),s,e.originalEvent),void this.triggerClickEvent(e.originalEvent,s)}i.contains(E)?this.expandAction(s,t,e):i.contains(u)?this.collapseNode(s,t,e):n&&r?r.classList.contains(qs)&&r.classList.contains(E)?this.expandAction(s,r,e):r.classList.contains(qs)&&r.classList.contains(u)?this.collapseNode(s,r,e):i.contains(O)||i.contains(N)||this.toggleSelect(s,e.originalEvent,!1):i.contains(O)||i.contains(N)||this.toggleSelect(s,e.originalEvent,!1)}3===e.originalEvent.which&&(this.isRightClick=!0),this.triggerClickEvent(e.originalEvent,s)}}},p.prototype.nodeCheckedEvent=function(e,t,i){e=this.getCheckEvent(e,t?"uncheck":"check",i);e.data=e.data.splice(0,e.data.length-1),this.trigger("nodeChecked",e)},p.prototype.updateOldCheckedData=function(e){var t,i=this,e=new x.DataManager(e),s=e.executeLocal((new x.Query).where("isChecked","equal","true",!0)),n=e.executeLocal((new x.Query).where("isChecked","equal","false",!0));if(0<n.length&&-1!==(t=this.OldCheckedData.findIndex(function(e){return e.id===n[0].id})))return this.OldCheckedData.splice(t,1),void(0<(e=this.OldCheckedData.filter(function(e){return e.parentID===n[0].id})).length&&e.forEach(function(t){var e=i.OldCheckedData.findIndex(function(e){return e.id===t.id});-1!==e&&i.OldCheckedData.splice(e,1)}));0<s.length&&-1===(t=this.OldCheckedData.findIndex(function(e){return e.id===s[0].id}))&&this.OldCheckedData.push(s[0])},p.prototype.triggerClickEvent=function(e,t){this.trigger("nodeClicked",{event:e,node:t})},p.prototype.expandNode=function(i,t,e,s){var n,r,l,o,a,d,h=this;this.enableVirtualization&&!w.isNullOrUndefined(this.height)?(n=i?i.getAttribute("data-uid"):null)&&this.handleVirtualExpand(n,s):(this.renderReactTemplates(),t.classList.contains(ys)&&this.hideSpinner(t),this.initialRender||t.classList.add("interaction"),!0!==e||!0===e&&i.classList.contains("e-expanded")?!0!==this.preventExpand&&(w.removeClass([t],E),w.addClass([t],u),l=r=0,o=w.select("."+O,i),a=i,this.isAnimate&&!this.isRefreshed?(this.setHeight(a,o),d=w.select("."+N+"."+vs,i),this.aniObj.animate(o,{name:this.animation.expand.effect,duration:0===this.animation.expand.duration&&"Enable"===w.animationMode?400:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(){a.style.overflow="hidden",!w.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.add(Xs),r=a.offsetHeight;var e=window.getComputedStyle(a),t=parseFloat(e.paddingTop),e=parseFloat(e.paddingBottom);l=w.select("."+Ss,i).offsetHeight+e+t},progress:function(e){e.element.style.display="block",h.animateHeight(e,r,l)},end:function(e){e.element.style.display="block",!w.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.remove(Xs),h.expandedNode(a,o,t)}})):this.expandedNode(a,o,t)):(w.select("."+O,i).style.display="none",this.fields.dataSource instanceof x.DataManager==!0&&(this.preventExpand=!1)),this.initialRender&&t.classList.add("interaction"))},p.prototype.expandedNode=function(e,t,i){t.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",w.removeClass([i],bs),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.expandArgs.isInteracted=this.isInteracted,this.trigger("nodeExpanded",this.expandArgs)),this.isHiddenItem&&this.collapseAll([this.getNodeData(e).id])},p.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),w.removeClass([e],Us);e=e.getAttribute("data-uid");w.isNullOrUndefined(e)||-1!==this.expandedNodes.indexOf(e)||this.expandedNodes.push(e)},p.prototype.collapseNode=function(i,s,n){var e,t,r=this;s.classList.contains(bs)||(w.addClass([s],bs),this.isLoaded?(e=this.getExpandEvent(i,n),this.isInteracted=e.isInteracted,this.trigger("nodeCollapsing",e,function(e){var t;e.cancel?w.removeClass([s],bs):(t=n&&void 0!==n.action,r.nodeCollapseAction(i,s,e,t))})):(t=n&&void 0!==n.action,this.nodeCollapseAction(i,s,e,t)))},p.prototype.nodeCollapseAction=function(e,t,i,s){var n,r,l,o,a,d,h=this;this.enableVirtualization&&!w.isNullOrUndefined(this.height)?(n=e?e.getAttribute("data-uid"):null)&&this.handleVirtualCollapse(n,s):(w.removeClass([t],u),w.addClass([t],E),l=r=0,o=w.select("."+O,e),a=e,d=w.select("."+N+"."+vs,e),this.isAnimate?this.aniObj.animate(o,{name:this.animation.collapse.effect,duration:0===this.animation.collapse.duration&&"Enable"===w.animationMode?400:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(){a.style.overflow="hidden",!w.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.add(Xs),r=w.select("."+Ss,e).offsetHeight,l=a.offsetHeight},progress:function(e){h.animateHeight(e,r,l)},end:function(e){e.element.style.display="none",!w.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.remove(Xs),h.collapsedNode(a,o,t,i)}}):this.collapsedNode(a,o,t,i))},p.prototype.collapsedNode=function(e,t,i,s){t.style.display="none",e.style.overflow="",e.style.height="",w.removeClass([i],bs),this.removeExpand(e),this.isLoaded&&((s=this.getExpandEvent(e,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",s))},p.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);t=this.expandedNodes.indexOf(e.getAttribute("data-uid"));-1<t&&this.expandedNodes.splice(t,1)},p.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),w.addClass([e],Us)},p.prototype.setHeight=function(e,t){t.style.display="block",t.style.visibility="hidden",e.style.height=e.offsetHeight+"px",t.style.display="none",t.style.visibility=""},p.prototype.animateHeight=function(e,t,i){var s;w.isNullOrUndefined(e.element.parentElement)||(s=(e.duration-e.timeStamp)/e.duration,e.element.parentElement.style.height=(i-t)*s+t+"px")},p.prototype.renderChildNodes=function(t,i,s,n,e){var r,l,o,a=this,d=w.select("div."+L,t);w.isNullOrUndefined(d)||(this.showSpinner(d),this.fields.dataSource instanceof x.DataManager?(l=this.parents(t,"."+O).length,o=this.getChildFields(this.fields,l,1),w.isNullOrUndefined(o)||w.isNullOrUndefined(o.dataSource)?(w.detach(d),this.removeExpand(t,!0)):(this.treeList.push("false"),this.fields.dataSource instanceof x.DataManager&&this.isOffline?(this.treeList.pop(),r=this.getChildNodes(this.treeData,t.getAttribute("data-uid")),this.loadChild(r,o,d,t,i,s,n)):o.dataSource.executeQuery(this.getQuery(o,t.getAttribute("data-uid"))).then(function(e){a.treeList.pop(),r=e.result,1===a.dataType&&(a.dataType=2),a.loadChild(r,o,d,t,i,s,n)}).catch(function(e){a.trigger("actionFailure",{error:e})}))):(r=this.getChildNodes(this.treeData,t.getAttribute("data-uid"),!1,parseFloat(t.getAttribute("aria-level"))+1),this.currentLoadData=this.getSortedData(r),w.isNullOrUndefined(r)||0===r.length?(w.detach(d),d.classList.contains(ys)&&this.hideSpinner(d),this.removeExpand(t,!0)):(this.listBaseOption.ariaAttributes.level=parseFloat(t.getAttribute("aria-level"))+1,t.appendChild(k.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(t,d,n),this.setSelectionForChildNodes(r),this.ensureCheckNode(t,e),this.finalizeNode(t,e,i),this.disableTreeNodes(r),this.renderSubChild(t,i,n,e))))},p.prototype.loadChild=function(e,t,i,s,n,r,l){this.currentLoadData=e,w.isNullOrUndefined(e)||0===e.length?(w.detach(i),this.removeExpand(s,!0)):(this.updateListProp(t),this.fields.dataSource instanceof x.DataManager&&!this.isOffline&&(t=s.getAttribute("data-uid"),t=this.getNodeObject(t),w.setValue("child",e,t)),this.listBaseOption.ariaAttributes.level=parseFloat(s.getAttribute("aria-level"))+1,s.appendChild(k.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(s,i,l),this.setSelectionForChildNodes(e),this.ensureCheckNode(s),this.finalizeNode(s),this.disableTreeNodes(e),this.renderSubChild(s,n,l)),r&&r(),n&&this.expandedNodes.push(s.getAttribute("data-uid")),0!==this.treeList.length||this.isLoaded||this.finalize()},p.prototype.disableTreeNodes=function(e){if(!w.isNullOrUndefined(this.disableNode)&&0!==this.disableNode.length)for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},p.prototype.setSelectionForChildNodes=function(e){if(!w.isNullOrUndefined(this.selectedNodes)&&0!==this.selectedNodes.length)for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},p.prototype.ensureCheckNode=function(e,t){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck)&&(this.ensureChildCheckState(e,null,t),t&&!w.select("."+Bs,this.element)&&!w.select("."+Vs,this.element)||this.ensureParentCheckState(e)),this.currentLoadData=null},p.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},p.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},p.prototype.getChildMapper=function(e){return"string"==typeof e.child||w.isNullOrUndefined(e.child)?e:e.child},p.prototype.getChildNodes=function(e,t,i,s){var n,r=this;if(void 0===i&&(i=!1),!w.isNullOrUndefined(e)){if(1===this.dataType)return this.getChildGroup(this.groupedData,t,i);if("string"==typeof this.fields.child)return this.findChildNodes(e,this.fields.id,t)||this.findNestedChildNodes(e,t,s)||[];if(this.isChildObject()){for(var l=w.isNullOrUndefined(s)?this.fields.child:this.fields,o=1;o<s&&!w.isNullOrUndefined(l.child);)l=l.child,o++;this.updateListProp(l);i=e.findIndex(function(e){return w.getValue(r.fields.id,e)&&w.getValue(r.fields.id,e).toString()===t});if(-1!==i)return w.getValue("child",e[parseInt(i.toString(),10)]);if(-1===i)for(var a=0,d=e.length;a<d;a++){var h=w.getValue("child",e[parseInt(a.toString(),10)]),c=w.isNullOrUndefined(h)?-1:h.findIndex(function(e){return w.getValue(r.fields.child.id,e)&&w.getValue(r.fields.child.id,e).toString()===t});if(-1!==c)return w.getValue("child",h[parseInt(c.toString(),10)]);if(!w.isNullOrUndefined(h)&&void 0!==(n=this.getChildNodes(h,t,!1,s)))break}}}return n},p.prototype.findChildNodes=function(e,t,i){var s=e.findIndex(function(e){e=w.getValue(t,e);return e&&e.toString()===i});return-1!==s?w.getValue(this.fields.child,e[s]):null},p.prototype.findNestedChildNodes=function(e,t,i){for(var s=0,n=e;s<n.length;s++){var r=n[s],r=w.getValue(this.fields.child,r);if(!w.isNullOrUndefined(r)){var l=this.findChildNodes(r,this.fields.id,t);if(l)return l;l=this.getChildNodes(r,t,!1,i);if(l&&0<l.length)return l}}},p.prototype.getChildGroup=function(e,t,i){var s=[];if(!w.isNullOrUndefined(e))for(var n=0,r=e.length;n<r;n++)if(w.isNullOrUndefined(e[parseInt(n.toString(),10)][0])||w.isNullOrUndefined(w.getValue(this.fields.parentID,e[parseInt(n.toString(),10)][0]))){if(i)return e[parseInt(n.toString(),10)]}else if(w.getValue(this.fields.parentID,e[parseInt(n.toString(),10)][0]).toString()===t)return e[parseInt(n.toString(),10)];return s},p.prototype.renderSubChild=function(e,t,i,s){if(t)for(var n=w.selectAll("."+E,e),r=0,l=n.length;r<l;r++){var o=n[parseInt(r.toString(),10)];e.querySelector(".e-icons")!==n[parseInt(r.toString(),10)]&&(o=w.closest(o,"."+N),this.expandArgs=this.getExpandEvent(o,null),!0!==i&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(o,t,null,i,s))}},p.prototype.toggleSelect=function(e,t,i){e.classList.contains("e-disable")||(this.allowMultiSelection&&(t&&t.ctrlKey||i)&&this.isActive(e)?this.unselectNode(e,t):this.selectNode(e,t,i))},p.prototype.isActive=function(e){return!!e.classList.contains(vs)},p.prototype.selectNode=function(t,i,s){var e,n,r=this;w.isNullOrUndefined(t)||!this.allowMultiSelection&&this.isActive(t)&&!w.isNullOrUndefined(i)?((this.element.closest(".e-ddt")?this.checkOnClick&&this.showCheckBox:this.checkOnClick)&&(e=w.select(" ."+Fs,t),!w.isNullOrUndefined(e)&&e.classList.contains(Bs)?w.addClass([t],vs):w.removeClass([t],vs)),this.setFocusElement(t)):this.isLoaded?(n=this.getSelectEvent(t,"select",i),this.trigger("nodeSelecting",n,function(e){e.cancel||e.node.classList.contains(Gs)||r.nodeSelectAction(t,i,e,s)})):this.nodeSelectAction(t,i,n,s)},p.prototype.nodeSelectAction=function(e,t,i,s){if(this.allowMultiSelection&&(s||t&&(t.ctrlKey||t.metaKey))||this.removeSelectAll(),this.allowMultiSelection&&t&&t.shiftKey){this.startNode||(this.startNode=e);var s=this.liList.indexOf(this.startNode),n=this.liList.indexOf(e);n<s&&(t=s,s=n,n=t);for(var r=s;r<=n;r++){var l=this.liList[parseInt(r.toString(),10)];w.isVisible(l)&&!l.classList.contains("e-disable")&&this.addSelect(l)}}else this.startNode=e,this.addSelect(e);this.isLoaded&&(i.nodeData=this.getNodeData(e),this.trigger("nodeSelected",i),this.isRightClick=!1),this.isRightClick=!1},p.prototype.unselectNode=function(t,e){var i,s=this;this.isLoaded?(i=this.getSelectEvent(t,"un-select",e),this.trigger("nodeSelecting",i,function(e){e.cancel||s.nodeUnselectAction(t,e)})):this.nodeUnselectAction(t,i)},p.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},p.prototype.setFocusElement=function(e){var t;w.isNullOrUndefined(e)||((t=this.getFocusedNode())&&(w.removeClass([t],Ws),w.removeClass([t],_s),t.setAttribute("tabindex","-1")),w.addClass([e],Ws),e.setAttribute("tabindex","0"),w.EventHandler.add(e,"blur",this.focusOut,this),this.updateIdAttr(t,e),this.enableVirtualization&&(this.virtualFocusedId=e.getAttribute("data-uid")))},p.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),w.addClass([e],vs);var e=e.getAttribute("data-uid");w.isNullOrUndefined(e)||-1!==this.selectedNodes.indexOf(e)||this.selectedNodes.push(e),this.enableVirtualization&&!w.isNullOrUndefined(this.height)&&(this.virtualSelectedNodesSet.add(e),e=this.virtualNodeMap.get(e))&&-1<e&&(this.virtualFlatNodes[parseInt(e.toString(),10)].selected=!0)},p.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),w.removeClass([e],vs);var t=this.selectedNodes.indexOf(e.getAttribute("data-uid"));-1<t&&this.selectedNodes.splice(t,1),this.enableVirtualization&&!w.isNullOrUndefined(this.height)&&(t=e.getAttribute("data-uid"),this.virtualSelectedNodesSet.delete(t),e=this.virtualNodeMap.get(t))&&-1<e&&(this.virtualFlatNodes[parseInt(e.toString(),10)].selected=!1)},p.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+vs),t=0,i=e;t<i.length;t++){var s=i[t];this.allowMultiSelection?s.setAttribute("aria-selected","false"):s.removeAttribute("aria-selected")}if(w.removeClass(e,vs),this.setProperties({selectedNodes:[]},!0),this.enableVirtualization&&!w.isNullOrUndefined(this.height)){this.virtualSelectedNodesSet.clear();for(var n=0;n<this.virtualFlatNodes.length;n++){var r=this.virtualFlatNodes[parseInt(n.toString(),10)];r.selected&&(r.selected=!1)}}},p.prototype.getSelectEvent=function(e,t,i){var s=this.getNodeData(e);return{action:t,cancel:!1,isInteracted:!w.isNullOrUndefined(i),node:e,nodeData:s}},p.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?w.Browser.isDevice?"Click":"DblClick":this.expandOn},p.prototype.expandHandler=function(e){var t=w.Browser.isDevice&&e.originalEvent.changedTouches&&!w.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;!t||t.classList.contains(Cs)||t.classList.contains(us)||t.classList.contains(O)||t.classList.contains(N)||t.classList.contains(L)||this.showCheckBox&&w.closest(t,"."+js)||this.expandCollapseAction(w.closest(t,"."+N),e)},p.prototype.expandCollapseAction=function(e,t){var i,s;this.enableVirtualization&&!w.isNullOrUndefined(this.height)&&e.classList.contains(Es)||(i=w.select("div."+L,e))&&!i.classList.contains(bs)&&((s=i.classList).contains(E)?this.expandAction(e,i,t):s.contains(u)&&this.collapseNode(e,i,t))},p.prototype.expandAction=function(t,i,s,n,r,l){var e,o=this;i.classList.contains(bs)||(w.addClass([i],bs),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(t,s),this.isInteracted=this.expandArgs.isInteracted,this.trigger("nodeExpanding",this.expandArgs,function(e){e.cancel?w.removeClass([i],bs):(e=s&&void 0!==s.action,o.nodeExpandAction(t,i,n,r,l,e))})):(e=s&&void 0!==s.action,this.nodeExpandAction(t,i,n,r,l,e)))},p.prototype.nodeExpandAction=function(e,t,i,s,n,r){if(this.enableVirtualization&&!w.isNullOrUndefined(this.height))this.expandNode(e,t,void 0,r);else{r=w.select("."+O,e);if(r&&"UL"===r.nodeName)this.expandNode(e,t);else if(this.isFirstRender=!0,this.renderChildNodes(e,i,s,null,n),!w.isNullOrUndefined(this.expandChildren)&&0!==this.expandChildren.length)for(var l=w.selectAll("."+N,e),o=0;o<l.length;o++){var a,d=this.getId(l[parseInt(o.toString(),10)]);-1!==this.expandChildren.indexOf(d)&&void 0!==this.expandChildren&&(a=w.select("."+E,w.select("."+Ss,l[parseInt(o.toString(),10)])),w.isNullOrUndefined(a)||this.expandAction(l[parseInt(o.toString(),10)],a,null),this.expandChildren.splice(this.expandChildren.indexOf(d),1))}}},p.prototype.keyActionHandler=function(i){var s=this,e=i.target,n=this.getFocusedNode();e&&e.classList.contains(Cs)?(e=e,"enter"===i.action?e.blur():"escape"===i.action&&(e.value=this.oldText,e.blur())):(i.preventDefault(),e={cancel:!1,event:i,node:n},this.trigger("keyPress",e,function(e){if(!e.cancel)switch(i.action){case"space":s.showCheckBox?s.checkNode(i):s.toggleSelect(n,i);break;case"moveRight":s.openNode(!s.enableRtl,i);break;case"moveLeft":s.openNode(!!s.enableRtl,i);break;case"shiftDown":s.shiftKeySelect(!0,i);break;case"moveDown":case"ctrlDown":case"csDown":s.navigateNode(!0);break;case"shiftUp":s.shiftKeySelect(!1,i);break;case"moveUp":case"ctrlUp":case"csUp":s.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":s.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":s.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":case"shiftSpace":case"ctrlSpace":s.toggleSelect(n,i);break;case"f2":s.allowEditing&&!n.classList.contains("e-disable")&&s.createTextbox(n);break;case"ctrlA":var t;s.allowMultiSelection&&(t=w.selectAll("."+N+":not(."+vs+")",s.element),s.selectGivenNodes(t))}}))},p.prototype.navigateToFocus=function(e){var t,i,s,n;this.enableVirtualization&&!w.isNullOrUndefined(this.height)?(t=this.getFocusedNode())&&(t=t.getAttribute("data-uid"))&&this.ensureVirtualNodeVisible(t):(i=(t=this.getFocusedNode().querySelector("."+Ss)).getBoundingClientRect(),s=this.getScrollParent(this.element),w.isNullOrUndefined(s)||(n=s.getBoundingClientRect(),i.bottom>n.bottom?s.scrollTop+=i.bottom-n.bottom:i.top<n.top&&(s.scrollTop-=n.top-i.top)),this.isVisibleInViewport(t)||t.scrollIntoView(e))},p.prototype.isVisibleInViewport=function(e){e=e.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},p.prototype.getScrollParent=function(e){return w.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},p.prototype.shiftKeySelect=function(e,t){var i;this.allowMultiSelection?(i=this.getFocusedNode(),i=e?this.getNextNode(i):this.getPrevNode(i),this.removeHover(),this.setFocusElement(i),this.toggleSelect(i,t,!1),this.navigateToFocus(!e)):this.navigateNode(e)},p.prototype.checkNode=function(e){var t=this.getFocusedNode(),i=w.select("."+js,t),s=w.select(" ."+Fs,i).classList.contains(Bs);t.classList.contains("e-disable")||0===t.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(i,s,t,e)},p.prototype.validateCheckNode=function(t,i,s,n){var e,r=this,l=w.closest(t,"."+N);l&&l.classList.contains(Gs)&&this.showCheckBox?n&&n.preventDefault&&n.preventDefault():(this.checkActionNodes=[],w.isNullOrUndefined(e=i?"false":"true")||l.setAttribute("aria-checked",e),e=this.getCheckEvent(l,i?"uncheck":"check",n),this.trigger("nodeChecking",e,function(e){e.cancel||r.nodeCheckingAction(t,i,s,e,n)}))},p.prototype.nodeCheckingAction=function(e,t,i,s,n){var r,l;-1===this.checkedElement.indexOf(i.getAttribute("data-uid"))&&(this.checkedElement.push(i.getAttribute("data-uid")),this.autoCheck)&&(null!==(r=this.getChildNodes(this.treeData,i.getAttribute("data-uid")))?this.allCheckNode(r,this.checkedElement,null,null,!1):r=null),this.changeState(e,t?"uncheck":"check",n,!0),this.updateActiveClass(i,t),this.autoCheck&&(this.ensureChildCheckState(i),this.updateOldCheckedData([this.getNodeData(i)]),r=w.closest(w.closest(i,"."+O),"."+N),l=void(this.isBatchMode?(l=w.isNullOrUndefined(r)?null:r.getAttribute("data-uid"))&&this.batchParentNode.add(l):this.ensureParentCheckState(r)),"check"===s.action?l=!0:"uncheck"===s.action&&(l=!1),this.ensureStateChange(i,l)),this.nodeCheckedEvent(e,t,n)},p.prototype.updateActiveClass=function(e,t){this.showCheckBox&&this.checkOnClick&&("check"===t||!1===t?(this.removeSelectAll(),w.addClass([e],vs)):"uncheck"!==t&&"indeterminate"!==t&&!0!==t||w.removeClass([e],vs))},p.prototype.ensureStateChange=function(e,t){var i=this,s=w.select("."+O,e),n=e.getAttribute("data-uid"),r=this.fields;if(1===this.dataType&&this.autoCheck){var l=new x.DataManager(this.treeData).executeLocal((new x.Query).where(r.parentID,"equal",n,!0)),e=l.filter(function(e){return-1!==i.checkedNodes.indexOf(e[r.id].toString())},this);-1!==this.checkedNodes.indexOf(n)&&e.length!==l.length&&this.isFilter&&0<e.length&&(l=e);for(var o=0;o<l.length;o++){var a,d=l[parseInt(o.toString(),10)][this.fields.id]?l[parseInt(o.toString(),10)][this.fields.id].toString():null,h=l[parseInt(o.toString(),10)][this.fields.isChecked]?l[parseInt(o.toString(),10)][this.fields.isChecked].toString():null;-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(d)?(this.checkDisabledState(d,l[o]),a=this.getChildNodes(this.treeData,d),this.getChildItems(a,t),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)):-1===this.checkedNodes.indexOf(n)&&null===s&&-1!==this.checkedNodes.indexOf(d)?(this.checkedNodes.splice(this.checkedNodes.indexOf(d),1),"true"===h&&this.updateField(this.treeData,this.fields,d,"isChecked",null),(-1===this.checkedNodes.indexOf(n)&&null===s||-1!==this.parentNodeCheck.indexOf(d))&&(h=this.getChildNodes(this.treeData,d),this.getChildItems(h,t),-1!==this.parentNodeCheck.indexOf(d))&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)):(a=this.getChildNodes(this.treeData,d),this.getChildItems(a,t))}}else if(1!==this.dataType||this.autoCheck)(a=this.getChildNodes(this.treeData,n))&&(0<(e=a.filter(function(e){e=String(e[Object.keys(e)[0]]);return-1!==i.checkedNodes.indexOf(e)})).length&&a.length&&this.isFilter&&(a=e),this.childStateChange(a,n,s,t));else if(t)for(o=0;o<this.treeData.length;o++){var c=this.treeData[parseInt(o.toString(),10)][this.fields.id]?this.treeData[parseInt(o.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(c)&&this.checkDisabledState(c,this.treeData[o])}else{for(var p=new x.DataManager(this.treeData).executeLocal((new x.Query).where(r.isChecked,"equal",!0,!1)),o=0;o<p.length;o++){var u=p[parseInt(o.toString(),10)][this.fields.id]?p[parseInt(o.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(u)&&this.checkedNodes.splice(this.checkedNodes.indexOf(u),1),this.updateField(this.treeData,this.fields,u,"isChecked",null)}this.checkedNodes=[]}},p.prototype.checkDisabledState=function(e,t){var i,s=this.checkDisabledChildren;s||(i=!0,this.loadOnDemand&&this.fields.htmlAttributes&&(t=w.isNullOrUndefined(t)?t:this.getNodeObject(e),w.isNullOrUndefined(t)||(t=t[this.fields.htmlAttributes])&&!w.isNullOrUndefined(t.class)&&-1!==t.class.indexOf(Rs)&&(i=!1)),s=(t=w.select('[data-uid="'+e+'"]',this.element))?!t.classList.contains(Rs):-1===this.disableNode.indexOf(e)&&i),s&&this.checkedNodes.push(e)},p.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,n=e[parseInt(i.toString(),10)][this.fields.isChecked]?e[parseInt(i.toString(),10)][this.fields.isChecked].toString():null,n=(-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkDisabledState(s,e[i]),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null),this.getChildNodes(this.treeData,s));0<n.length&&this.getChildItems(n,t)}},p.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",l=e[parseInt(n.toString(),10)][this.fields.isChecked]?e[parseInt(n.toString(),10)][this.fields.isChecked].toString():null,l=(this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkDisabledState(r,e[n]),-1!==this.parentNodeCheck.indexOf(r)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(r),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(r)||s||(this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),"true"===l&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[])),this.getChildNodes([e[parseInt(n.toString(),10)]],r));l&&this.childStateChange(l,t,i,s)}},p.prototype.allCheckNode=function(e,t,i,s,n){if(e)for(var r=0;r<e.length;r++){var l,o=w.getValue(this.fields.id,e[parseInt(r.toString(),10)]),a=this.element.querySelector('[data-uid="'+o+'"]'),a=(!1===n||-1!==this.checkedElement.indexOf(o.toString())||(null!==a||w.isNullOrUndefined(e[parseInt(r.toString(),10)][this.fields.isChecked])||-1!==t.indexOf(o.toString()))&&0!==s&&2!==i||(!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?t.push(o.toString()):s=null,s=!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?0:null),-1===t.indexOf(o.toString())&&w.isNullOrUndefined(i)&&t.push(o.toString()),w.getValue(this.fields.child.toString(),e[parseInt(r.toString(),10)]));(!0===w.getValue(this.fields.hasChildren,e[parseInt(r.toString(),10)])||a)&&(o=w.getValue(this.fields.id,e[parseInt(r.toString(),10)]),l=void 0,l=1===this.dataType?this.getChildNodes(this.treeData,o.toString()):a)&&(w.isNullOrUndefined(n)?this.allCheckNode(l,t,i,s):this.allCheckNode(l,t,i,s,n),s=null),s=null}},p.prototype.openNode=function(e,t){var i=this.getFocusedNode(),s=w.select("div."+L,i);e?s&&(s.classList.contains(E)?this.expandAction(i,s,t):this.focusNextNode(i,!0)):s&&s.classList.contains(u)?this.collapseNode(i,s,t):(e=w.closest(w.closest(i,"."+O),"."+N))&&!e.classList.contains("e-disable")&&(this.setFocus(i,e),this.navigateToFocus(!0))},p.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},p.prototype.navigateRootNode=function(e){var t=this.getFocusedNode(),i=e?this.getRootNode():this.getEndNode();i.classList.contains("e-disable")||(this.setFocus(t,i),this.navigateToFocus(e))},p.prototype.getFocusedNode=function(){var e,t,i=w.select("."+N+'[tabindex="0"]',this.element);return w.isNullOrUndefined(i)||"mixed"!==(t=i.getAttribute("aria-checked"))&&"false"!==t||(this.isFilter=!1),w.isNullOrUndefined(i)&&(e=w.select("."+N,this.element)),w.isNullOrUndefined(i)?w.isNullOrUndefined(e)?this.element.firstElementChild:e:i},p.prototype.focusNextNode=function(e,t){if(this.enableVirtualization&&!w.isNullOrUndefined(this.height)){var i=e?e.getAttribute("data-uid"):null,s=-1,n=(w.isNullOrUndefined(i)||(n=this.virtualNodeMap.get(i),s=w.isNullOrUndefined(n)?-1:n),t?s+1:s-1);if(!(n<0||n>=this.virtualFlatNodes.length)){for(var s=this.virtualFlatNodes[parseInt(n.toString(),10)].id,r=(this.virtualFocusedId=s,this.element.querySelectorAll("."+N+"."+Ws)),l=0;l<r.length;l++)r[parseInt(l.toString(),10)].classList.remove(Ws),r[parseInt(l.toString(),10)].classList.remove(_s),r[parseInt(l.toString(),10)].setAttribute("tabindex","-1");this.ensureVirtualNodeVisible(s);n=i?this.getElement(i):e,i=this.getElement(s);w.isNullOrUndefined(i)||this.setFocus(w.isNullOrUndefined(n)?i:n,i)}}else{s=t?this.getNextNode(e):this.getPrevNode(e);this.setFocus(e,s),this.navigateToFocus(!t),s.classList.contains("e-disable")&&(n=s.lastChild,null==s.previousSibling&&s.classList.contains("e-level-1")?this.focusNextNode(s,!0):null==s.nextSibling&&s.classList.contains("e-node-collapsed")||null==s.nextSibling&&n.classList.contains(Ss)?this.focusNextNode(s,!1):this.focusNextNode(s,t))}},p.prototype.getNextNode=function(e){var t,i=this.liList.indexOf(e);do{if(i++,t=this.liList[parseInt(i.toString(),10)],w.isNullOrUndefined(t))return e}while(!w.isVisible(t));return t},p.prototype.getPrevNode=function(e){var t,i=this.liList.indexOf(e);do{if(i--,t=this.liList[parseInt(i.toString(),10)],w.isNullOrUndefined(t))return e}while(!w.isVisible(t));return t},p.prototype.getRootNode=function(){for(var e,t=0;e=this.liList[parseInt(t.toString(),10)],t++,!w.isVisible(e););return e},p.prototype.getEndNode=function(){for(var e,t=this.liList.length-1;e=this.liList[parseInt(t.toString(),10)],t--,!w.isVisible(e););return e},p.prototype.setFocus=function(e,t){w.removeClass([e],Ws),w.removeClass([e],_s),e.setAttribute("tabindex","-1"),t.classList.contains("e-disable")||(w.addClass([t],Ws),w.addClass([t],_s),t.setAttribute("tabindex","0"),this.enableVirtualization&&!w.isNullOrUndefined(this.height)?t.focus({preventScroll:!0}):t.focus(),t.focus(),w.EventHandler.add(t,"blur",this.focusOut,this),this.updateIdAttr(e,t))},p.prototype.updateIdAttr=function(e,t){this.element.removeAttribute("aria-activedescendant"),e&&e.removeAttribute("id"),t.setAttribute("id",this.element.id+"_active"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active")},p.prototype.focusIn=function(){var e,t=this.getFocusedNode();t&&(e=document.activeElement,this.enableVirtualization&&e===t&&"0"===e.getAttribute("tabindex")&&e.classList.contains(Ws)?this.isKeyboardFocus&&!e.classList.contains(_s)&&w.addClass([e],_s):this.mouseDownStatus?this.isKeyboardFocus&&!t.classList.contains("e-disable")&&w.addClass([t],_s):(t.classList.contains("e-disable")?(t.setAttribute("tabindex","-1"),this.navigateNode(!0)):(t.setAttribute("tabindex","0"),w.addClass([t],Ws),this.isKeyboardFocus&&w.addClass([t],_s),w.EventHandler.add(t,"blur",this.focusOut,this)),this.mouseDownStatus=!1),this.isKeyboardFocus=!1)},p.prototype.focusOut=function(e){var t=this.getFocusedNode();e.target===t&&(w.removeClass([t],Ws),w.removeClass([t],_s),w.EventHandler.remove(t,"blur",this.focusOut),this.enableVirtualization)&&(this.virtualFocusedId=null)},p.prototype.onMouseOver=function(e){var t;w.Browser.isDevice||(t=(e=e.target).classList,!(e=w.closest(e,"."+N))||t.contains(O)||t.contains(N)?this.removeHover():e&&!e.classList.contains("e-disable")&&this.setHover(e))},p.prototype.setHover=function(e){e.classList.contains(gs)||e.classList.contains(Gs)||(this.removeHover(),w.addClass([e],gs))},p.prototype.onMouseLeave=function(){this.removeHover()},p.prototype.removeHover=function(){var e=w.selectAll("."+gs,this.element);e&&e.length&&w.removeClass(e,gs)},p.prototype.getNodeData=function(e,t,i){var s,n,r,l,o,a,d;return!w.isNullOrUndefined(e)&&e.classList.contains(N)&&!w.isNullOrUndefined(w.closest(e,"."+ms))&&w.closest(e,"."+ms).classList.contains(us)?(s=e.getAttribute("data-uid"),t=this.getText(e,t,i),i=(i=w.closest(e.parentNode,"."+N))?i.getAttribute("data-uid"):null,n=e.classList.contains(vs),r=!e.classList.contains(Gs),l="true"===e.getAttribute("aria-expanded"),o=null!==e.getAttribute("aria-expanded")||null!=(w.select("."+E,e)||w.select("."+u,e)),a=null,d=w.select("."+js,e),{id:s,text:t,parentID:i,selected:n,selectable:r,expanded:l,isChecked:a=this.showCheckBox&&d?e.getAttribute("aria-checked"):a,hasChildren:o}):{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},p.prototype.getText=function(e,t,i){var s;return t?(t=w.isNullOrUndefined(i)?this.getNodeObject(e.getAttribute("data-uid")):i,s=parseFloat(e.getAttribute("aria-level")),s=this.getFields(this.fields,s,1),w.isNullOrUndefined(i)?w.getValue(s.text,t):i.text):w.select("."+fs,e).textContent},p.prototype.getExpandEvent=function(e,t){var i=this.getNodeData(e);return{cancel:!1,isInteracted:!w.isNullOrUndefined(t),node:e,nodeData:i,event:t}},p.prototype.renderNodeTemplate=function(e,t,i){e=this.nodeTemplateFn(e,this,"nodeTemplate"+i,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,t,this.root);e&&(e=Array.prototype.slice.call(e),w.append(e,t))},p.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},p.prototype.reRenderNodes=function(){this.updateListProp(this.fields),w.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",w.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},p.prototype.setCssClass=function(e,t){w.isNullOrUndefined(e)||""===e||w.removeClass([this.element],e.split(" ")),w.isNullOrUndefined(t)||""===t||w.addClass([this.element],t.split(" "))},p.prototype.editingHandler=function(e){var e=e.target;!e||e.classList.contains(us)||e.classList.contains(O)||e.classList.contains(N)||e.classList.contains(L)||e.classList.contains(Cs)||e.classList.contains(Is)||(e=w.closest(e,"."+N),this.createTextbox(e))},p.prototype.createTextbox=function(i){var s=this,e=w.select("."+xs,this.element),n=(e&&e.blur(),w.select("."+fs,i)),e=(this.updateOldText(i),this.createElement("input",{className:xs,attrs:{value:this.oldText}})),r=this.getEditEvent(i,null,e.outerHTML);this.trigger("nodeEditing",r,function(e){var t;e.cancel||(t=n.offsetWidth+5+"px",w.addClass([i],Es),w.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(i),s.isReact?setTimeout(function(){s.renderTextBox(r,n,t)},5):s.renderTextBox(r,n,t))})},p.prototype.renderTextBox=function(e,t,i){t.innerHTML=e.innerHtml;e=w.select("."+xs,t),this.inputObj=B.Input.createInput({element:e,properties:{enableRtl:this.enableRtl}},this.createElement),this.inputObj.container.style.width=i,e.focus(),t=e;t.setSelectionRange(0,t.value.length),this.wireInputEvents(e)},p.prototype.updateOldText=function(e){var t=e.getAttribute("data-uid"),t=(this.editData=this.getNodeObject(t),parseFloat(e.getAttribute("aria-level")));this.editFields=this.getFields(this.fields,t,1),this.oldText=w.getValue(this.editFields.text,this.editData)},p.prototype.inputFocusOut=function(e){var t,i,s;w.select("."+xs,this.element)&&(t=(e=e.target).value,i=w.closest(e,"."+fs),s=w.closest(e,"."+N),w.detach(this.inputObj.container),B.Input.destroy({element:e,properties:this.properties}),this.fields.dataSource instanceof x.DataManager&&!this.isOffline?this.crudOperation("update",null,s,t,null,null,!0):this.appendNewText(s,i,t,!0),w.EventHandler.remove(e,"blur",this.inputFocusOut),this.inputObj=null,w.detach(e))},p.prototype.appendNewText=function(t,i,s,n){var r=this,e=this.getEditEvent(t,s,null);this.trigger("nodeEdited",e,function(e){s=e.cancel?e.oldText:e.newText,r.updateText(t,i,s,n),e.oldText!==s&&r.triggerEvent("nodeEdited",[r.getNode(t)])})},p.prototype.updateText=function(e,t,i,s){var n,r=w.setValue(this.editFields.text,i,this.editData);w.isNullOrUndefined(this.nodeTemplateFn)?t[k.ListBase.getDomSetter(this.listBaseOption)]=k.ListBase.getSanitizedText(i,this.listBaseOption):(t.innerText="",n=e.getAttribute("data-uid"),this.renderNodeTemplate(r,t,n),this.renderReactTemplates()),this.enableVirtualization&&(r=e.getAttribute("data-uid"),t=this.virtualNodeMap?this.virtualNodeMap.get(r):void 0,!w.isNullOrUndefined(t))&&-1<t&&(this.virtualFlatNodes[parseInt(t.toString(),10)].text=i),s&&(w.removeClass([e],Es),e.focus(),w.EventHandler.add(e,"blur",this.focusOut,this),w.addClass([e],Ws)),this.allowTextWrap&&this.calculateWrap(e)},p.prototype.getElement=function(e){return w.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?w.getElement(e):null},p.prototype.getId=function(e){return w.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?w.getElement(e).getAttribute("data-uid"):null},p.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},p.prototype.getNodeObject=function(e){if(!w.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var t=0,i=this.treeData.length;t<i;t++){var s=w.getValue(this.fields.id,this.treeData[parseInt(t.toString(),10)]);if(!w.isNullOrUndefined(this.treeData[parseInt(t.toString(),10)])&&!w.isNullOrUndefined(s)&&s.toString()===e)return this.treeData[parseInt(t.toString(),10)]}}},p.prototype.getChildNodeObject=function(e,t,i){if(!w.isNullOrUndefined(e))for(var s=0,n=e.length;s<n;s++){var r=w.getValue(t.id,e[parseInt(s.toString(),10)]);if(e[parseInt(s.toString(),10)]&&r&&r.toString()===i)return e[parseInt(s.toString(),10)];if("string"!=typeof t.child||w.isNullOrUndefined(w.getValue(t.child,e[parseInt(s.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!w.isNullOrUndefined(w.getValue("child",e[parseInt(s.toString(),10)]))){if(void 0!==(l=this.getChildNodeObject(w.getValue("child",e[parseInt(s.toString(),10)]),this.getChildMapper(t),i)))break}else if(this.isChildObject()){o=w.getValue("child",e[parseInt(s.toString(),10)]);if(void 0!==(l=this.getChildNodeObject(o,this.getChildMapper(t),i)))break}}else{var l,o=w.getValue(t.child,e[parseInt(s.toString(),10)]);if(void 0!==(l=this.getChildNodeObject(o,this.getChildMapper(t),i)))break}}return l},p.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},p.prototype.initializeDrag=function(){var s,n=this;this.dragObj=new w.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+Ss,enableTapHold:!0,tapHoldThreshold:100,helper:function(e){n.dragTarget=e.sender.target;var t=w.closest(n.dragTarget,"."+us),i=w.closest(n.dragTarget,"."+Ss);return n.dragLi=w.closest(n.dragTarget,"."+N),n.fullRowSelect&&!i&&n.dragTarget.classList.contains(Ps)&&(i=n.dragTarget.nextElementSibling),!(!(n.dragTarget&&e.element.isSameNode(t)&&i)||n.dragTarget.classList.contains(us)||n.dragTarget.classList.contains(O)||n.dragTarget.classList.contains(N)||n.dragLi.classList.contains("e-disable"))&&(e=i.cloneNode(!0),w.isNullOrUndefined(w.select("div."+L,e))&&(t=n.createElement("div",{className:L+" "+E}),e.insertBefore(t,e.children[0])),i="e-drag-item "+us+" "+n.cssClass+" "+(n.enableRtl?"e-rtl":""),(s=n.createElement("div",{className:i})).appendChild(e),1<(t=n.selectedNodes.length)&&n.allowMultiSelection&&n.dragLi.classList.contains(vs)&&(i=n.createElement("span",{className:"e-drop-count",innerHTML:""+t}),s.appendChild(i)),n.getAppendToElement().appendChild(s),document.body.style.cursor="",n.dragData=n.getNodeData(n.dragLi),s)},dragStart:function(t){w.addClass([n.element],ws);var e,i=w.closest(t.target,".e-list-item"),i=(i&&(e=parseInt(i.getAttribute("aria-level"),10)),n.getDragEvent(t.event,n,null,t.target,null,s,e));i.draggedNode.classList.contains(Es)?(n.dragObj.intDestroy(t.event),n.dragCancelAction(s)):n.trigger("nodeDragStart",i,function(e){e.cancel?(n.dragObj.intDestroy(t.event),n.dragCancelAction(s)):n.dragStartAction=!0})},drag:function(e){n.dragObj.setProperties({cursorAt:{top:!w.isNullOrUndefined(e.event.targetTouches)||w.Browser.isDevice?60:-20}}),n.dragAction(e,s)},dragStop:function(t){var i,e,s;t.target?(w.removeClass([n.element],ws),t.target.classList.contains("e-sibling")||n.removeVirtualEle(),i=t.target,s=w.closest(i,"."+Os),i&&s||(w.detach(t.helper),document.body.style.cursor=""),(s=w.closest(i,".e-list-item"))&&(e=parseInt(s.getAttribute("aria-level"),10)),(s=n.getDragEvent(t.event,n,i,i,null,t.helper,e)).preventTargetExpand=!1,n.trigger("nodeDragStop",s,function(e){n.dragParent=e.draggedParentNode,n.preventExpand=e.preventTargetExpand,e.cancel&&(t.helper.parentNode&&w.detach(t.helper),document.body.style.cursor="",i.classList.contains("e-sibling"))&&n.removeVirtualEle(),n.dragStartAction=!1})):(t.helper&&t.helper.parentNode&&w.detach(t.helper),document.body.style.cursor="",w.removeClass([n.element],ws),n.dragStartAction=!1)}}),this.dropObj=new w.Droppable(this.element,{out:function(e){e.target&&!w.isNullOrUndefined(e)&&!e.target.classList.contains(ks)&&n.dropObj.dragData.default&&n.dropObj.dragData.default.helper.classList.contains(us)&&(document.body.style.cursor="not-allowed")},over:function(){document.body.style.cursor=""},drop:function(e){n.dropAction(e),n.removeVirtualEle()}})},p.prototype.dragCancelAction=function(e){w.detach(e),w.removeClass([this.element],ws),this.dragStartAction=!1},p.prototype.getAppendToElement=function(){if(this.isAngular){var e=this.element.closest(".cdk-overlay-pane"),t=this.element.closest("[popover]");if(e&&t)return e}return document.body},p.prototype.getOffsetX=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientX-t.getBoundingClientRect().left:e.offsetX},p.prototype.getOffsetY=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientY-t.getBoundingClientRect().top:e.offsetY},p.prototype.dragAction=function(e,t){var i,s,n,r,l,o,a,d,h,c,p;e.target&&(p=w.closest(e.target,"."+Os),h=w.closest(e.target,"."+Ss),i=w.select("div."+L,t),w.removeClass([i],[Ls,As,Ts,Ds]),this.isDropIn=!1,this.removeVirtualEle(),document.body.style.cursor="",r=e.target.classList,n=e.event,s=this.getOffsetY(n,e.target),n=this.getOffsetX(n,e.target),this.fullRowSelect&&!h&&!w.isNullOrUndefined(r)&&r.contains(Ps)&&(h=e.target.nextElementSibling),p?(r=w.closest(e.target,"."+N),l=w.closest(e.target,"."+js),o=w.closest(e.target,"."+u),a=w.closest(e.target,"."+E),!p.classList.contains(us)||h&&!r.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,r)?this.hasTemplate&&r?(p=w.select(this.fullRowSelect?"."+Ps:"."+Ss,r),e&&!a&&!o&&s<7&&!l||a&&s<5||o&&n<3?(d=this.fullRowSelect?1:0,this.appendIndicator(r,i,d)):e&&!a&&!o&&!l&&p&&s>p.offsetHeight-10||a&&19<s||o&&19<n?(d=this.fullRowSelect?2:1,this.appendIndicator(r,i,d)):(w.addClass([i],Ls),this.isDropIn=!0)):r&&e&&!a&&!o&&s<7&&!l||a&&s<5||o&&n<3?(d=this.fullRowSelect?1:0,this.appendIndicator(r,i,d)):r&&e&&!a&&!o&&0<e.target.offsetHeight&&s>e.target.offsetHeight-10&&!l||a&&19<s||o&&19<n?(d=this.fullRowSelect?2:1,this.appendIndicator(r,i,d)):(w.addClass([i],Ls),this.isDropIn=!0):"LI"!==e.target.nodeName||r.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,r)?e.target.classList.contains(ks)?w.addClass([i],As):w.addClass([i],Ts):(w.addClass([i],As),this.renderVirtualEle(e))):(w.addClass([i],Ds),document.body.style.cursor="not-allowed"),(h=w.closest(e.target,".e-list-item"))&&(c=parseInt(h.getAttribute("aria-level"),10)),(p=this.getDragEvent(e.event,this,e.target,e.target,null,t,c)).dropIndicator&&w.removeClass([i],p.dropIndicator),this.trigger("nodeDragging",p),p.dropIndicator)&&w.addClass([i],p.dropIndicator)},p.prototype.appendIndicator=function(e,t,i){w.addClass([t],As);t=this.createElement("div",{className:ks});e.insertBefore(t,e.children[parseInt(i.toString(),10)])},p.prototype.dropAction=function(e){for(var t,i=e.event,s=this.getOffsetY(i,e.target),n=e.target,i=!1,r=[],l=[],o=e.dragData.draggable,a=0;a<o.ej2_instances.length;a++)if(o.ej2_instances[parseInt(a.toString(),10)]instanceof an){t=o.ej2_instances[parseInt(a.toString(),10)];break}if(t&&t.dragTarget){var d=t.dragTarget,d=w.closest(d,"."+N),h=w.closest(n,"."+N);if(l.push(d),null==h&&n.classList.contains(us)&&(h=n.firstElementChild),w.detach(e.droppedElement),document.body.style.cursor="",!h||h.isSameNode(d)||this.isDescendant(d,h))return void(this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1));if(t.allowMultiSelection&&d.classList.contains(vs)){var c=w.selectAll("."+vs,t.element),l=c;if(e.target.offsetHeight<=33&&s>e.target.offsetHeight-10&&6<s)for(a=c.length-1;0<=a;a--)h.isSameNode(c[parseInt(a.toString(),10)])||this.isDescendant(c[parseInt(a.toString(),10)],h)||this.appendNode(n,c[parseInt(a.toString(),10)],h,e,t,s);else for(a=0;a<c.length;a++)h.isSameNode(c[parseInt(a.toString(),10)])||this.isDescendant(c[parseInt(a.toString(),10)],h)||this.appendNode(n,c[parseInt(a.toString(),10)],h,e,t,s)}else this.appendNode(n,d,h,e,t,s);d=parseInt(d.getAttribute("aria-level"),10),i=!0}this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1);for(var p=w.isNullOrUndefined(t)?null:t.dragData,a=0;a<l.length;a++)r.push(this.getNodeData(this.getElement(l[parseInt(a.toString(),10)]),!0,p));this.trigger("nodeDropped",this.getDragEvent(e.event,t,n,e.target,e.dragData.draggedElement,null,d,i)),t.element.id!==this.element.id&&(t.triggerEvent("nodeDropped",r),this.isNodeDropped=!0,this.fields.dataSource=this.treeData),this.triggerEvent("nodeDropped",r)},p.prototype.appendNode=function(e,t,i,s,n,r){var l=w.closest(e,"."+js),o=w.closest(s.target,"."+u),a=w.closest(s.target,"."+E);t.classList.contains("e-disable")||l||!(a&&s.event.offsetY<5||o&&s.event.offsetX<3||a&&19<s.event.offsetY||o&&19<s.event.offsetX||!a&&!o)?this.dropAsChildNode(t,i,n,null,s,r,!0,e):"LI"===e.nodeName?this.dropAsSiblingNode(t,i,s,n):e.firstElementChild&&e.classList.contains(us)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(t,i,s,n):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(t,i,s,n):this.dropAsChildNode(t,i,n,null,s,r,null,e),this.showCheckBox&&this.ensureIndeterminate()},p.prototype.dropAsSiblingNode=function(e,t,i,s){var n,r,l=w.closest(t,"."+O),o=w.closest(e,"."+O),a=w.closest(o,"."+N);0<i.target.offsetHeight&&i.event.offsetY>i.target.offsetHeight-2?n=!1:i.event.offsetY<2?n=!0:(i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible"))&&(i.event.offsetY<5||i.event.offsetX<3?n=!0:(15<i.event.offsetY||17<i.event.offsetX)&&(n=!1)),i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible")?(r=i.target.closest("li"),l.insertBefore(e,n?r:r.nextElementSibling)):l.insertBefore(e,n?i.target:i.target.nextElementSibling),this.moveData(e,t,l,n,s),this.updateElement(o,a),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},p.prototype.dropAsChildNode=function(e,t,i,s,n,r,l,o){var a,d=w.closest(e,"."+O),h=w.closest(d,"."+N),c=w.closest(t,"."+O);n&&n.target&&(a=w.select(this.fullRowSelect?"."+Ps:"."+Ss,t)),n&&(r<7&&!o.classList.contains("e-sibling")||o.classList.contains("e-sibling")&&!t.lastChild.classList.contains("e-sibling"))&&!l?(c.insertBefore(e,t),this.moveData(e,t,c,!0,i)):n&&0<n.target.offsetHeight&&r>n.target.offsetHeight-10&&!l&&!this.hasTemplate||this.hasTemplate&&a&&r>a.offsetHeight-10&&!l?(c.insertBefore(e,t.nextElementSibling),this.moveData(e,t,c,!1,i)):(o=this.expandParent(t),n=w.isNullOrUndefined(s)?null:o.childNodes[parseInt(s.toString(),10)],o.insertBefore(e,n),this.moveData(e,n,o,!0,i)),this.updateElement(d,h),this.updateAriaLevel(e),i.element.id===this.element.id?this.updateList():(i.updateInstance(),this.updateInstance())},p.prototype.moveData=function(e,t,i,s,n){var i=w.closest(i,"."+N),e=this.getId(e),r=n.updateChildField(n.treeData,n.fields,e,null,null,!0),t=this.getId(t),t=t?this.getDataPos(this.treeData,this.fields,t):null,i=this.getId(i);if(1===this.dataType){this.updateField(this.treeData,this.fields,i,"hasChildren",!0);var l,o=w.isNullOrUndefined(t)?this.treeData.length:s?t:t+1;if(w.isNullOrUndefined(i)&&!this.hasPid?delete r[0][this.fields.parentID]:(l=this.isNumberTypeId?parseFloat(i):i,w.setValue(this.fields.parentID,l,r[0])),this.treeData.splice(o,0,r[0]),n.element.id!==this.element.id){var a=n.removeChildNodes(e);o++;for(var d=0,h=a.length;d<h;d++)this.treeData.splice(o,0,a[parseInt(d.toString(),10)]),o++;n.groupedData=n.getGroupedData(n.treeData,n.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,i,r,s?t:t+1)},p.prototype.expandParent=function(e){var t,i=w.select("div."+E+", div."+u,e),s=(i&&i.classList.contains(E)&&!0!==this.preventExpand&&this.expandAction(e,i,null),w.select("."+O,e)),n=(!0===this.preventExpand&&!s&&i&&this.renderChildNodes(e),s=w.select("."+O,e),!w.isNullOrUndefined(s)&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(s.style.display="none"),w.isNullOrUndefined(s)||!1!==this.preventExpand||(s.style.display="block"),w.isNullOrUndefined(s)&&!0===this.preventExpand&&(w.isNullOrUndefined(i)&&k.ListBase.generateIcon(this.createElement,e,E,this.listBaseOption),(t=w.select("div."+E+", div."+u,e))&&t.classList.add("e-icon-expandable"),s=k.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(s),t?w.removeClass([t],u):k.ListBase.generateIcon(this.createElement,e,E,this.listBaseOption),e.setAttribute("aria-expanded","false"),s.style.display="none"),w.isNullOrUndefined(s)&&(n=this.expandArgs,(w.isNullOrUndefined(n)||n&&"nodeExpanding"!==n.name)&&this.trigger("nodeExpanding",this.getExpandEvent(e,null)),w.isNullOrUndefined(i)&&k.ListBase.generateIcon(this.createElement,e,u,this.listBaseOption),(t=w.select("div."+E+", div."+u,e))||(k.ListBase.generateIcon(this.createElement,e,u,this.listBaseOption),t=w.select("div."+L,e)),w.removeClass([t],E),s=k.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(s),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))),w.select("div."+u,e));return!w.isNullOrUndefined(s)&&n&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(w.removeClass([n],u),e.setAttribute("aria-expanded","false"),w.addClass([n],E)),s},p.prototype.updateElement=function(e,t){var i;t&&0===e.childElementCount&&(i=w.select("div."+L,t),w.detach(e),w.detach(i),e=this.getId(t),this.updateField(this.treeData,this.fields,e,"hasChildren",!1),this.removeExpand(t,!0))},p.prototype.updateAriaLevel=function(e){var t=this.parents(e,"."+O).length;e.setAttribute("aria-level",""+t),this.updateChildAriaLevel(w.select("."+O,e),t+1)},p.prototype.updateChildAriaLevel=function(e,t){if(!w.isNullOrUndefined(e))for(var i=e.childNodes,s=0,n=i.length;s<n;s++){var r=i[parseInt(s.toString(),10)];r.setAttribute("aria-level",""+t),this.updateChildAriaLevel(w.select("."+O,r),t+1)}},p.prototype.renderVirtualEle=function(e){var t=e.event,t=this.getOffsetY(t,e.target),t=(t>e.target.offsetHeight-2?i=!1:t<2&&(i=!0),this.createElement("div",{className:ks})),i=this.fullRowSelect?i?1:2:i?0:1;e.target.insertBefore(t,e.target.children[parseInt(i.toString(),10)])},p.prototype.removeVirtualEle=function(){var e=w.select("."+ks);e&&w.detach(e)},p.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},p.prototype.getDragEvent=function(e,t,i,s,n,r,l,o){var a=i?w.closest(i,"."+N):null,d=a?this.getNodeData(a):null,h=t?t.dragLi:n,n=t?t.dragData:null,c=i?this.parents(i,"."+N):null,p=t.dragLi.parentElement,u=t.dragLi?w.closest(p,"."+N):null,m=null,f=null,g=[As,Ls,Ts,Ds],v=null,y=!0===o?h:a,b=y?w.closest(y,".e-list-parent"):null,S=0,C=null,u=t.dragLi&&null===u?w.closest(p,"."+us):u;if(u=!0===o?this.dragParent:u,r)for(;S<4;){if(w.select("."+L,r).classList.contains(g[parseInt(S.toString(),10)])){v=g[parseInt(S.toString(),10)];break}S++}if(b){for(var I=0,S=0;S<b.childElementCount;S++){if(I=!0!==o&&b.children[parseInt(S.toString(),10)]===h&&a!==h?++I:I,!0!==o&&b.children[parseInt(S.toString(),10)].classList.contains("e-hover")){f=23<=e.offsetY?S+1:S;break}if(b.children[parseInt(S.toString(),10)]===y){e.offsetY,f=S;break}}f=0!==I?--f:f,C=this.isDropIn?"Inside":e.offsetY<7?"Before":"After"}return i&&(m=0===c.length?null:i.classList.contains(N)?c[0]:c[1]),a===h&&(m=a),i&&s.offsetHeight<=33&&e.offsetY<s.offsetHeight-10&&6<e.offsetY&&(m=a,!0!==o)&&(l=++l,f=(t=m?w.select(".e-list-parent",m):null)?t.children.length:0,this.fields.dataSource instanceof x.DataManager||null!==t||!m||(f=(p=m.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,m.getAttribute("data-uid").toString()):null)?p.length:0)),{cancel:!1,clonedNode:r,event:e,draggedNode:h,draggedNodeData:n,droppedNode:a,droppedNodeData:d,dropIndex:f,dropLevel:l,draggedParentNode:u,dropTarget:m,dropIndicator:v,target:s,position:C}},p.prototype.addFullRow=function(e){var t=this.liList.length;if(e)for(var i=0;i<t;i++)this.createFullRow(this.liList[parseInt(i.toString(),10)]);else for(i=0;i<t;i++){var s=w.select("."+Ps,this.liList[parseInt(i.toString(),10)]);w.detach(s)}},p.prototype.createFullRow=function(e){var t=this.createElement("div",{className:Ps});e.insertBefore(t,e.childNodes[0])},p.prototype.addMultiSelect=function(e){if(e)for(var t=0,i=w.selectAll("."+N+':not([aria-selected="true"])',this.element);t<i.length;t++)i[t].setAttribute("aria-selected","false");else for(var s=0,n=w.selectAll("."+N+'[aria-selected="false"]',this.element);s<n.length;s++)n[s].removeAttribute("aria-selected")},p.prototype.collapseByLevel=function(e,t,i,s){if(s=w.isNullOrUndefined(s)?1:s,0<t&&!w.isNullOrUndefined(e))for(var n=this.getVisibleNodes(i,e.childNodes),r=0,l=n.length;r<l;r++){var o=n[parseInt(r.toString(),10)],a=w.select("."+u,w.select("."+Ss,o));t<=s&&!w.isNullOrUndefined(a)&&this.collapseNode(o,a,null),this.collapseByLevel(w.select("."+O,o),t,i,s+1)}},p.prototype.collapseAllNodes=function(e){for(var t=this.getVisibleNodes(e,w.selectAll("."+u,this.element)),i=0,s=t.length;i<s;i++){var n=t[parseInt(i.toString(),10)],r=w.closest(n,"."+N);this.collapseNode(r,n,null)}},p.prototype.expandByLevel=function(e,t,i){if(0<t&&!w.isNullOrUndefined(e))for(var s=this.getVisibleNodes(i,e.childNodes),n=0,r=s.length;n<r;n++){var l=s[parseInt(n.toString(),10)],o=w.select("."+E,w.select("."+Ss,l));w.isNullOrUndefined(o)||this.expandAction(l,o,null),this.expandByLevel(w.select("."+O,l),t-1,i)}},p.prototype.expandAllNodes=function(e){for(var t=0,i=this.getVisibleNodes(e,w.selectAll("."+E,this.element));t<i.length;t++){var s=i[t],n=w.closest(s,"."+N);this.expandAction(n,s,null,!0,null,!0)}},p.prototype.getVisibleNodes=function(e,t){var i=Array.prototype.slice.call(t);if(e)for(var s=0;s<i.length;s++)w.isVisible(i[parseInt(s.toString(),10)])||(i.splice(s,1),s--);return i},p.prototype.removeNode=function(e){var t=w.closest(e,"."+O),i=w.closest(t,"."+N);w.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),w.detach(e),this.updateElement(t,i),this.removeData(e)},p.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},p.prototype.updateList=function(){this.liList=Array.prototype.slice.call(w.selectAll("."+N,this.element))},p.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=w.selectAll("."+vs,this.element);this.selectGivenNodes(e)},p.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=w.selectAll('[aria-expanded="true"]',this.element),t=0,i=e.length;t<i;t++)this.addExpand(e[parseInt(t.toString(),10)])},p.prototype.removeData=function(e){var t,i,s,n;1===this.dataType?(t=new x.DataManager(this.treeData),n=this.getId(e),i={},s=this.isNumberTypeId?parseFloat(n):n,i[this.fields.id]=s,t.remove(this.fields.id,i),this.removeChildNodes(n)):(n=this.getId(e),this.updateChildField(this.treeData,this.fields,n,null,null,!0))},p.prototype.removeChildNodes=function(e){for(var t=this.getChildGroup(this.groupedData,e,!1),i=[],s=0,n=t.length;s<n;s++){var r=new x.DataManager(this.treeData),l=w.getValue(this.fields.id,t[parseInt(s.toString(),10)]).toString(),o={},a=this.isNumberTypeId?parseFloat(l):l,a=(o[this.fields.id]=a,r.remove(this.fields.id,o));i.push(a[0]),this.removeChildNodes(l)}return i},p.prototype.doGivenAction=function(e,t,i){for(var s=0,n=e.length;s<n;s++){var r,l=this.getElement(e[parseInt(s.toString(),10)]);w.isNullOrUndefined(l)||(r=w.select("."+t,w.select("."+Ss,l)),w.isNullOrUndefined(r))||(i?this.expandAction(l,r,null):this.collapseNode(l,r,null))}},p.prototype.addGivenNodes=function(e,t,i,s,n){if(0!==e.length){var r,l,o=this.getSortedData(e),a=t?parseFloat(t.getAttribute("aria-level"))+1:1,d=(s&&this.updateMapper(a),k.ListBase.createListItemFromJson(this.createElement,o,this.listBaseOption,a)),h=this.getId(t),c=(w.isNullOrUndefined(t)||(r=w.select("div."+L,t)),1===this.dataType&&r&&r.classList.contains(E)&&this.preventExpand&&!w.isNullOrUndefined(this.element.offsetParent)&&!this.element.offsetParent.parentElement.classList.contains("e-filemanager")&&(this.preventExpand=!0),1!==this.dataType&&(this.addChildData(this.treeData,this.fields,h,e,i),this.isFirstRender=!1),l=n||(t?this.expandParent(t):w.select("."+O,this.element)),w.isNullOrUndefined(i)?null:l.childNodes[parseInt(i.toString(),10)]);if(!this.isFirstRender||1===this.dataType){s=this.expandArgs;if(c||"None"===this.sortOrder){for(var p=0;p<d.length;p++)l.insertBefore(d[parseInt(p.toString(),10)],c);1!==this.dataType||w.isNullOrUndefined(t)||this.preventExpand||w.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=w.select("div."+L,t))&&u.classList.contains(E)&&(w.isNullOrUndefined(s)||"nodeExpanding"!==s.name)&&this.expandAction(t,u,null))}if(!c&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder))if(0===l.childNodes.length){for(var u,p=0;p<d.length;p++)l.insertBefore(d[parseInt(p.toString(),10)],c);1!==this.dataType||w.isNullOrUndefined(t)||this.preventExpand||w.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=w.select("div."+L,t))&&u.classList.contains(E)&&(w.isNullOrUndefined(s)||"nodeExpanding"!==s.name)&&this.expandAction(t,u,null))}else for(var m=l.childNodes,p=0;p<d.length;p++)for(var f=0;f<m.length;f++){if("Ascending"===this.sortOrder?m[parseInt(f.toString(),10)].textContent.toUpperCase()>d[parseInt(p.toString(),10)].innerText.toUpperCase():m[parseInt(f.toString(),10)].textContent.toUpperCase()<d[parseInt(p.toString(),10)].innerText.toUpperCase()){l.insertBefore(d[parseInt(p.toString(),10)],m[parseInt(f.toString(),10)]);break}l.insertBefore(d[parseInt(p.toString(),10)],m[m.length])}}if(1===this.dataType){this.updateField(this.treeData,this.fields,h,"hasChildren",!0);for(var g,o=this.getId(c),v=w.isNullOrUndefined(o)?this.treeData.length:this.getDataPos(this.treeData,this.fields,o),f=0;f<e.length;f++)w.isNullOrUndefined(h)||(g=this.isNumberTypeId?parseFloat(h):h,w.setValue(this.fields.parentID,g,e[parseInt(f.toString(),10)])),this.treeData.splice(v,0,e[parseInt(f.toString(),10)]),v++}this.finalizeNode(l)}},p.prototype.updateMapper=function(e){e=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(e)},p.prototype.updateListProp=function(e){e=this.getActualProperties(e);this.listBaseOption.fields=e,this.listBaseOption.fields.url=Object.prototype.hasOwnProperty.call(e,"navigateUrl")?e.navigateUrl:"navigateUrl"},p.prototype.getDataPos=function(e,t,i){for(var s=null,n=0,r=e.length;n<r;n++){var l=w.getValue(t.id,e[parseInt(n.toString(),10)]);if(e[parseInt(n.toString(),10)]&&l&&l.toString()===i)return n;if("string"!=typeof t.child||w.isNullOrUndefined(w.getValue(t.child,e[parseInt(n.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!w.isNullOrUndefined(w.getValue("child",e[parseInt(n.toString(),10)]))){l=w.getValue("child",e[parseInt(n.toString(),10)]);if(null!==(s=this.getDataPos(l,this.getChildMapper(t),i)))break}}else{l=w.getValue(t.child,e[parseInt(n.toString(),10)]);if(null!==(s=this.getDataPos(l,this.getChildMapper(t),i)))break}}return s},p.prototype.addChildData=function(e,t,i,s,n){if(w.isNullOrUndefined(i)){n=w.isNullOrUndefined(n)?e.length:n;for(var r=0,l=s.length;r<l;r++)e.splice(n,0,s[parseInt(r.toString(),10)]),n++}else for(var o=0,a=e.length;o<a;o++){var d=w.getValue(t.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&d&&d.toString()===i){if("string"==typeof t.child&&Object.prototype.hasOwnProperty.call(e[parseInt(o.toString(),10)],t.child)&&null!==e[parseInt(o.toString(),10)][t.child]||this.fields.dataSource instanceof x.DataManager&&Object.prototype.hasOwnProperty.call(e[parseInt(o.toString(),10)],"child")){var h="string"==typeof t.child?t.child:"child",c=w.getValue(h,e[parseInt(o.toString(),10)]);w.isNullOrUndefined(c)&&(c=[]),n=w.isNullOrUndefined(n)?c.length:n;for(r=0,l=s.length;r<l;r++)c.splice(n,0,s[parseInt(r.toString(),10)]),n++}else{h="string"==typeof t.child?t.child:"child";e[parseInt(o.toString(),10)][""+h]=s}return!0}if("string"!=typeof t.child||w.isNullOrUndefined(w.getValue(t.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!w.isNullOrUndefined(w.getValue("child",e[parseInt(o.toString(),10)]))){c=w.getValue("child",e[parseInt(o.toString(),10)]);if(void 0!==(p=this.addChildData(c,this.getChildMapper(t),i,s,n)))break}}else{var p,d=w.getValue(t.child,e[parseInt(o.toString(),10)]);if(void 0!==(p=this.addChildData(d,this.getChildMapper(t),i,s,n)))break}}return p},p.prototype.doDisableAction=function(e){var e=this.nodeType(e),t=this.checkValidId(e);this.validArr=[];for(var i=0,s=t.length;i<s;i++){var n=t[parseInt(i.toString(),10)][this.fields.id].toString(),n=(n&&-1===this.disableNode.indexOf(n)&&this.disableNode.push(n),this.getElement(n));n&&(n.setAttribute("aria-disabled","true"),w.addClass([n],Rs))}},p.prototype.doEnableAction=function(e){for(var t=this.nodeType(e),i=0,s=t.length;i<s;i++){var n=this.getElement(t[parseInt(i.toString(),10)]),r=t[parseInt(i.toString(),10)];r&&-1!==this.disableNode.indexOf(r)&&this.disableNode.splice(this.disableNode.indexOf(r),1),n&&(n.removeAttribute("aria-disabled"),w.removeClass([n],Rs))}},p.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[parseInt(i.toString(),10)]?n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].toString():null:"object"==typeof e[parseInt(i.toString(),10)]&&(n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].getAttribute("data-uid").toString():null),-1===t.indexOf(n)&&t.push(n)}return t},p.prototype.checkValidId=function(t){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(e){return-1!==t.indexOf(e[i.fields.id]?e[i.fields.id].toString():null)});else if(2===this.dataType)for(var e=0;e<this.treeData.length;e++){var s=this.treeData[parseInt(e.toString(),10)][this.fields.id]?this.treeData[parseInt(e.toString(),10)][this.fields.id].toString():null,s=(-1!==t.indexOf(s)&&this.validArr.push(this.treeData[parseInt(e.toString(),10)]),w.getValue(this.fields.child.toString(),this.treeData[parseInt(e.toString(),10)]));s&&this.filterNestedChild(s,t)}return this.validArr},p.prototype.filterNestedChild=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,s=(-1!==t.indexOf(s)&&this.validArr.push(e[parseInt(i.toString(),10)]),w.getValue(this.fields.child.toString(),e[parseInt(i.toString(),10)]));s&&this.filterNestedChild(s,t)}},p.prototype.setTouchClass=function(){var e=w.closest(this.element,".e-bigger");this.touchClass=w.isNullOrUndefined(e)?"":"e-small"},p.prototype.updatePersistProp=function(){this.removeField(this.treeData,this.fields,["selected","expanded"]);for(var e=this.selectedNodes,t=0,i=e.length;t<i;t++)this.updateField(this.treeData,this.fields,e[parseInt(t.toString(),10)],"selected",!0);for(var s=this.expandedNodes,n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[parseInt(n.toString(),10)],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var l=this.checkedNodes,o=0,r=l.length;o<r;o++)this.updateField(this.treeData,this.fields,l[parseInt(o.toString(),10)],"isChecked",!0)}},p.prototype.removeField=function(e,t,i){if(!w.isNullOrUndefined(e)&&!w.isNullOrUndefined(t))for(var s=0,n=e.length;s<n;s++){for(var r=0;r<i.length;r++){var l=this.getMapperProp(t,i[parseInt(r.toString(),10)]);w.isNullOrUndefined(e[parseInt(s.toString(),10)][""+l])||delete e[parseInt(s.toString(),10)][""+l]}"string"!=typeof t.child||w.isNullOrUndefined(w.getValue(t.child,e[parseInt(s.toString(),10)]))?this.fields.dataSource instanceof x.DataManager&&!w.isNullOrUndefined(w.getValue("child",e[parseInt(s.toString(),10)]))&&this.removeField(w.getValue("child",e[parseInt(s.toString(),10)]),this.getChildMapper(t),i):this.removeField(w.getValue(t.child,e[parseInt(s.toString(),10)]),this.getChildMapper(t),i)}},p.prototype.getMapperProp=function(e,t){switch(t){case"selected":return w.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return w.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return w.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return w.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return t}},p.prototype.updateField=function(e,t,i,s,n){var r;w.isNullOrUndefined(i)||(1===this.dataType?(r=this.isNumberTypeId?parseFloat(i):i,r=new x.DataManager(this.treeData).executeLocal((new x.Query).where(t.id,"equal",r,!1)),w.setValue(this.getMapperProp(t,s),n,r[0])):this.updateChildField(e,t,i,s,n))},p.prototype.updateChildField=function(e,t,i,s,n,r){if(!w.isNullOrUndefined(e))for(var l=0,o=e.length;l<o;l++){var a=w.getValue(t.id,e[parseInt(l.toString(),10)]);if(e[parseInt(l.toString(),10)]&&!w.isNullOrUndefined(a)&&a.toString()===i)return d=r?e.splice(l,1):(w.setValue(this.getMapperProp(t,s),n,e[parseInt(l.toString(),10)]),[]);if("string"!=typeof t.child||w.isNullOrUndefined(w.getValue(t.child,e[parseInt(l.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!w.isNullOrUndefined(w.getValue("child",e[parseInt(l.toString(),10)]))){a=w.getValue("child",e[parseInt(l.toString(),10)]);if(void 0!==(d=this.updateChildField(a,this.getChildMapper(t),i,s,n,r)))break}}else{var d,a=w.getValue(t.child,e[parseInt(l.toString(),10)]);if(void 0!==(d=this.updateChildField(a,this.getChildMapper(t),i,s,n,r)))break}}return d},p.prototype.triggerEvent=function(e,t){if(this.renderReactTemplates(),"addNodes"===e){for(var i=[],s=0;s<t.length;s++)i.push(this.getNode(this.getElement(w.isNullOrUndefined(t[parseInt(s.toString(),10)][this.fields.id])?w.getValue(this.fields.id,t[parseInt(s.toString(),10)]).toString():null)));t=i}e={data:this.treeData,action:e,nodeData:t};this.trigger("dataSourceChanged",e)},p.prototype.wireInputEvents=function(e){w.EventHandler.add(e,"blur",this.inputFocusOut,this)},p.prototype.wireEditingEvents=function(e){var t=this;e&&!this.disabled?this.touchEditObj=new w.Touch(this.element,{tap:function(e){t.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),t.editingHandler(e.originalEvent))}}):this.touchEditObj&&this.touchEditObj.destroy()},p.prototype.wireClickEvent=function(e){var t=this;e?this.touchClickObj=new w.Touch(this.element,{tap:function(e){t.clickHandler(e)}}):this.touchClickObj&&this.touchClickObj.destroy()},p.prototype.wireExpandOnEvent=function(e){var t=this;e?this.touchExpandObj=new w.Touch(this.element,{tap:function(e){("Click"===t.expandOnType||"DblClick"===t.expandOnType&&t.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&t.expandHandler(e)}}):this.touchExpandObj&&this.touchExpandObj.destroy()},p.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,this.isKeyboardFocus=!1,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&w.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},p.prototype.keyDownHandler=function(e){"Tab"!==e.key&&9!==e.keyCode||(this.isKeyboardFocus=!0,this.enableVirtualization&&(this.virtualSkipNextScrollRender=!0)),"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&40!==e.keyCode&&38!==e.keyCode&&"ArrowRight"!==e.key&&"ArrowLeft"!==e.key&&39!==e.keyCode&&37!==e.keyCode||this.enableVirtualization&&(this.virtualSkipNextScrollRender=!0)},p.prototype.preventContextMenu=function(e){e.preventDefault()},p.prototype.wireEvents=function(){w.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),w.EventHandler.add(document,"keydown",this.keyDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),w.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),w.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new w.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},p.prototype.unWireEvents=function(){w.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),w.EventHandler.remove(document,"keydown",this.keyDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),w.EventHandler.remove(this.element,"mouseover",this.onMouseOver),w.EventHandler.remove(this.element,"mouseout",this.onMouseLeave);for(var e=w.selectAll("."+N,this.element),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],i=(w.EventHandler.remove(i,"focus",this.focusIn),w.EventHandler.remove(i,"blur",this.focusOut),w.select("."+Fs,i));i&&(w.EventHandler.remove(i,"mousedown",this.frameMouseHandler),w.EventHandler.remove(i,"mouseup",this.frameMouseHandler),w.EventHandler.remove(i,"mouseleave",this.frameMouseHandler))}this.disabled||this.keyboardModule.destroy()},p.prototype.parents=function(e,t){for(var i=[],s=e.parentNode;!w.isNullOrUndefined(s);)w.matches(s,t)&&i.push(s),s=s.parentNode;return i},p.prototype.isDoubleTapped=function(e){var t,i=e.originalEvent.target;return i&&e.tapCount&&(1===e.tapCount?this.firstTap=w.closest(i,"."+N):2===e.tapCount&&(t=w.closest(i,"."+N))),this.firstTap===t},p.prototype.isDescendant=function(e,t){for(var i=t.parentNode;!w.isNullOrUndefined(i);){if(i===e)return!0;i=i.parentNode}return!1},p.prototype.showSpinner=function(e){w.addClass([e],ys),U.createSpinner({target:e,width:w.Browser.isDevice?16:14},this.createElement),U.showSpinner(e)},p.prototype.hideSpinner=function(e){U.hideSpinner(e),e.innerHTML="",w.removeClass([e],ys)},p.prototype.setCheckedNodes=function(e){1<(e=JSON.parse(JSON.stringify(e))).length&&"function"==typeof this.nodeChecked&&0<this.nodeChecked.length&&(this.isFilter=!0),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),0<e.length&&this.checkAll(e)},p.prototype.setValidCheckedNode=function(e,t){if(void 0===t&&(t=[]),1===this.dataType){var i=this.fields,i=new x.DataManager(this.treeData).executeLocal((new x.Query).where(i.id,"equal",e,!0));if(i[0]&&(this.setChildCheckState(i,e,i[0],t),this.autoCheck)){for(var i=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,s=this.getChildNodes(this.treeData,i),n=0,r=0;r<s.length;r++){var l=s[parseInt(r.toString(),10)][this.fields.id].toString();-1!==this.checkedNodes.indexOf(l)&&n++}n===s.length&&-1===this.checkedNodes.indexOf(i)&&i&&this.checkDisabledState(i)}}else if(2===this.dataType)for(var o=0;o<this.treeData.length;o++){if((this.treeData[parseInt(o.toString(),10)][this.fields.id]?this.treeData[parseInt(o.toString(),10)][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkDisabledState(e);break}var a=w.getValue(this.fields.child.toString(),this.treeData[parseInt(o.toString(),10)]);a&&this.setChildCheckState(a,e,this.treeData[parseInt(o.toString(),10)],t)}},p.prototype.setChildCheckState=function(e,t,i,s){void 0===s&&(s=[]);var n,r=0;if(1===this.dataType){i&&(n=i[this.fields.id]?i[this.fields.id].toString():null);for(var l=0;l<e.length;l++){var o=e[parseInt(l.toString(),10)][this.fields.id]?e[parseInt(l.toString(),10)][this.fields.id].toString():null,a=(i&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(o)&&this.checkDisabledState(o,e[l]),o===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),this.getChildNodes(this.treeData,o)),d=1===s.length&&s[0]===o;a.length!==t.length&&!d||this.setChildCheckState(a,t,i)}}else{i&&(n=i[this.fields.id]?i[this.fields.id].toString():"");for(l=0;l<e.length;l++){var h=e[parseInt(l.toString(),10)][this.fields.id]?e[parseInt(l.toString(),10)][this.fields.id].toString():"",d=1===[t].length&&0===s.length;i&&n&&this.autoCheck&&(-1===this.checkedNodes.indexOf(n)||-1!==this.checkedNodes.indexOf(h)||h!==t&&!d||this.checkDisabledState(h,e[l])),h===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),(a=w.getValue(this.fields.child.toString(),e[parseInt(l.toString(),10)]))&&this.setChildCheckState(a,t,e[parseInt(l.toString(),10)]),-1!==this.checkedNodes.indexOf(h)&&this.autoCheck&&r++,r===e.length&&-1===this.checkedNodes.indexOf(n)&&this.autoCheck&&this.checkDisabledState(n,i)}}},p.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[parseInt(t.toString(),10)],e)},p.prototype.updatePosition=function(e,t,i,s){if(1===this.dataType){var n=this.getDataPos(this.treeData,this.fields,e);if(this.treeData.splice(n,1,t),i){this.removeChildNodes(e);for(var r=0;r<s.length;r++)this.treeData.splice(n,0,s[parseInt(r.toString(),10)]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},p.prototype.updateChildPosition=function(e,t,i,s,n){for(var r=0,l=e.length;r<l;r++){var o=w.getValue(t.id,e[parseInt(r.toString(),10)]);if(e[parseInt(r.toString(),10)]&&o&&o.toString()===i)return e[parseInt(r.toString(),10)]=s[0],!0;if("string"!=typeof t.child||w.isNullOrUndefined(w.getValue(t.child,e[parseInt(r.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!w.isNullOrUndefined(w.getValue("child",e[parseInt(r.toString(),10)]))){o=w.getValue("child",e[parseInt(r.toString(),10)]);if(void 0!==(a=this.updateChildPosition(o,this.getChildMapper(t),i,s,n)))break}}else{var a,o=w.getValue(t.child,e[parseInt(r.toString(),10)]);if(void 0!==(a=this.updateChildPosition(o,this.getChildMapper(t),i,s,n)))break}}return a},p.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},p.prototype.crudOperation=function(e,t,i,s,n,r,l){var o,a=this,d=this.fields.dataSource,h=[],c=this.getQuery(this.fields),p=this.fields.id,u={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];t?m=this.nodeType(t):i&&("string"==typeof i?m[0]=i.toString():"object"==typeof i&&(m[0]=i.getAttribute("data-uid").toString()));for(var f=0,g=m.length;f<g;f++){var v=this.getElement(m[parseInt(f.toString(),10)]);w.isNullOrUndefined(v)||(v=this.getNodeObject(m[parseInt(f.toString(),10)]),h.push(v))}switch(e){case"delete":(o=1===t.length?d.remove(p,h[0],c.fromTable,c):(u.deletedRecords=h,d.saveChanges(u,p,c.fromTable,c))).then(function(){return a.deleteSuccess(m)}).catch(function(e){return a.dmFailure(e)});break;case"update":h[0][this.fields.text]=s,(o=d.update(p,h[0],c.fromTable,c)).then(function(){return a.editSucess(i,s,l)}).catch(function(e){return a.dmFailure(e,i,l)});break;case"insert":if(1===n.length)o=d.insert(n[0],c.fromTable,c);else{for(var y=[],f=0,g=n.length;f<g;f++)y.push(n[parseInt(f.toString(),10)]);u.addedRecords=y,o=d.saveChanges(u,p,c.fromTable,c)}o.then(function(){var e=a.getElement(i);a.addSuccess(n,e,r),a.preventExpand=!1}).catch(function(e){return a.dmFailure(e)})}},p.prototype.deleteSuccess=function(e){for(var t,i=[],s=0,n=e.length;s<n;s++){var r=this.getElement(e[parseInt(s.toString(),10)]);i.push(this.getNode(r)),w.isNullOrUndefined(r)||this.removeNode(r)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.enableVirtualization&&!w.isNullOrUndefined(this.height)&&(this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap(),t=this.getVirtualWindow(),this.virtualStartIndex=t.startIndex,this.virtualEndIndex=t.endIndex,this.renderVirtualItems()),this.triggerEvent("removeNode",i)},p.prototype.editSucess=function(e,t,i){var e=this.getElement(e),s=w.select("."+fs,e);this.appendNewText(e,s,t,i)},p.prototype.addSuccess=function(e,t,i){var s,n=this,r=t?t.querySelector("."+L):null;t&&r&&r.classList.contains(E)&&null===t.querySelector("."+O)?this.renderChildNodes(t,null,function(){s=t.querySelector("."+O),n.addGivenNodes(e,t,i,!0,s),n.triggerEvent("addNodes",e)}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent("addNodes",e))},p.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},p.prototype.updatePreviousText=function(e,t){var e=this.getElement(e),i=w.select("."+fs,e);this.updateText(e,i,this.oldText,t)},p.prototype.getHierarchicalParentId=function(t,e,i){var s=this;if(-1===e.findIndex(function(e){return e[s.fields.id]&&e[s.fields.id].toString()===t}))for(var n=0;n<e.length;n++){var r=w.getValue(this.fields.child.toString(),e[parseInt(n.toString(),10)]);if(!w.isNullOrUndefined(r)){if(-1!==r.findIndex(function(e){return e[s.fields.id]&&e[s.fields.id].toString()===t})){i.push(e[parseInt(n.toString(),10)][this.fields.id].toString()),this.getHierarchicalParentId(e[parseInt(n.toString(),10)][this.fields.id].toString(),this.treeData,i);break}this.getHierarchicalParentId(t,r,i)}}return i},p.prototype.parseHeightToPixels=function(){var e=this.height;return w.isNullOrUndefined(e)?0:"number"==typeof e?e:(e=parseFloat(e),isNaN(e)?0:e)},p.prototype.measureVirtualItemHeight=function(){var e=w.select("."+N,this.element);return e&&0<e.offsetHeight?e.offsetHeight:this.virtualItemHeight},p.prototype.rebuildVirtualCheckCache=function(){if(this.virtualExpandedNodesSet.clear(),this.virtualCheckedNodesSet.clear(),this.virtualSelectedNodesSet.clear(),this.expandedNodes&&Array.isArray(this.expandedNodes))for(var e=0;e<this.expandedNodes.length;e++)this.virtualExpandedNodesSet.add(this.expandedNodes[e]);if(this.checkedNodes&&Array.isArray(this.checkedNodes))for(e=0;e<this.checkedNodes.length;e++)this.virtualCheckedNodesSet.add(this.checkedNodes[e]);if(this.selectedNodes&&Array.isArray(this.selectedNodes))for(e=0;e<this.selectedNodes.length;e++)this.virtualSelectedNodesSet.add(this.selectedNodes[e])},p.prototype.flattenVisibleNodes=function(){this.rebuildVirtualCheckCache();var e,t=[];return 1===this.dataType?(e=[],(e=this.groupedData?this.getChildGroup(this.groupedData,null,!0):e)&&0!==e.length||(e=this.rootData),e=this.getSortedData(e),this.flattenNodeRecursive(e,1,null,t)):(e=this.getSortedData(this.rootData),this.flattenNodeRecursive(e,1,null,t)),t},p.prototype.flattenNodeRecursive=function(e,t,i,s){if(e&&0!==e.length)for(var n=this.fields.child.toString(),r=this.fields.expanded,l=this.fields.isChecked,o=this.fields.iconCss,a=this.fields.imageUrl,d=this.fields.id,h=this.fields.text,c=this.fields.selected,p="None"!==this.sortOrder,u=1===this.dataType,m=this.enableVirtualization,f=0;f<e.length;f++){var g,v,y=e[f],b=w.isNullOrUndefined(y[d])?"":y[d].toString(),S=w.isNullOrUndefined(y[h])?"":y[h].toString(),C=this.virtualExpandedNodesSet.has(b),I=!C&&!0===w.getValue(r,y),C=C||I,I=(I&&b&&(this.expandedNodes.push(b),this.virtualExpandedNodesSet.add(b)),!1),x=(u?this.groupedData&&(g=this.getChildGroup(this.groupedData,b,!1),I=!w.isNullOrUndefined(g)&&0<g.length):(g=w.getValue(n,y),I=!w.isNullOrUndefined(g)&&Array.isArray(g)&&0<g.length),m&&b&&l&&!this.virtualCheckedNodesSet.has(b)&&(v=w.getValue(l,y),w.isNullOrUndefined(v)||"true"!==v.toString()||(this.virtualCheckedNodesSet.add(b),this.checkedNodes&&-1===this.checkedNodes.indexOf(b)&&this.checkedNodes.push(b))),this.initialRender&&m&&b&&c&&!this.virtualSelectedNodesSet.has(b)&&(v=w.getValue(c,y),w.isNullOrUndefined(v)||"true"!==v.toString()||(this.virtualSelectedNodesSet.add(b),this.selectedNodes&&-1===this.selectedNodes.indexOf(b)&&this.selectedNodes.push(b))),this.virtualSelectedNodesSet.has(b)),E=m&&this.virtualIndeterminateNodesSet.has(b)?"indeterminate":this.virtualCheckedNodesSet.has(b),N=y[o],N=w.isNullOrUndefined(N)?"":N.toString(),O=y[a],O=w.isNullOrUndefined(O)?"":O.toString();s.push({id:b,text:S,level:t,parentId:i,hasChildren:I,expanded:C,selected:x,isChecked:E,iconCss:N,imageUrl:O}),C&&I&&(S=[],u?this.groupedData&&(S=this.getChildGroup(this.groupedData,b,!1),p)&&(S=k.ListBase.getDataSource(S,k.ListBase.addSorting(this.sortOrder,this.fields.text))):(x=w.getValue(n,y),!w.isNullOrUndefined(x)&&Array.isArray(x)&&(S=x,p)&&(S=k.ListBase.getDataSource(S,k.ListBase.addSorting(this.sortOrder,this.fields.text)))),this.flattenNodeRecursive(S,t+1,b,s))}},p.prototype.hasChildRecords=function(e){var t;return 1===this.dataType?!!this.groupedData&&(t=e[this.fields.id],!w.isNullOrUndefined(t))&&(t=this.getChildGroup(this.groupedData,t.toString(),!1),!w.isNullOrUndefined(t))&&0<t.length:(t=this.fields.child.toString(),t=w.getValue(t,e),!w.isNullOrUndefined(t)&&Array.isArray(t)&&0<t.length)},p.prototype.rebuildVirtualNodeMap=function(){this.virtualNodeMap.clear();for(var e=0;e<this.virtualFlatNodes.length;e++)this.virtualNodeMap.set(this.virtualFlatNodes[parseInt(e.toString(),10)].id,e)},p.prototype.getVirtualWindow=function(e){var t,i,s,n=this.virtualFlatNodes.length;return 0===n?{startIndex:0,endIndex:0}:(e=void 0!==e?e:this.element.scrollTop,t=this.virtualItemHeight,i=this.virtualViewportHeight,s=Math.floor(e/t)-this.virtualOverscanCount,e=Math.ceil((e+i)/t)+this.virtualOverscanCount,{startIndex:Math.max(0,s),endIndex:Math.min(n,e)})},p.prototype.getVirtualWindowAt=function(e){return this.getVirtualWindow(e)},p.prototype.getVirtualPadding=function(){var e=this.virtualFlatNodes.length,t=this.virtualItemHeight,i=this.virtualStartIndex,s=this.virtualEndIndex;return{paddingTop:i*t,paddingBottom:Math.max(0,(e-s)*t)}},p.prototype.renderVirtualItems=function(){if(this.ulElement){for(var e=this.ulElement,t=this.virtualFocusedId||null,i=e.querySelectorAll(":scope > li"),s=i.length-1;0<=s;s--)e.removeChild(i[parseInt(s.toString(),10)]);var n=new Map,r=this.virtualItemHeight,l=0;if(this.virtualStartIndex<this.virtualFlatNodes.length){var o=this.virtualFlatNodes[this.virtualStartIndex];if(o.parentId){for(var a=[],d=o.parentId;d;){var h=this.virtualNodeMap.get(d);if(w.isNullOrUndefined(h)||!(h<this.virtualStartIndex))break;var c=this.virtualFlatNodes[parseInt(h.toString(),10)];a.unshift(c),d=c.parentId}for(var p=0;p<a.length;p++){var u,c=a[parseInt(p.toString(),10)],m=this.createVirtualListItem(c,!1),f=e;c.parentId&&n.has(c.parentId)&&((u=n.get(c.parentId)).childUl||(u.childUl=this.createElement("ul",{className:O+" e-ul",attrs:{role:"group"}}),u.li.appendChild(u.childUl)),f=u.childUl),f.appendChild(m),n.set(c.id,{li:m,childUl:null}),l++}}}for(var o=this.virtualFlatNodes.length,g=this.virtualStartIndex,v=this.virtualEndIndex,y=Math.max(0,g*r-l*r),b=(e.style.paddingTop=y+"px",e.style.paddingBottom=Math.max(0,(o-v)*r)+"px",[]),s=g;s<v;s++){var S,C=this.virtualFlatNodes[parseInt(s.toString(),10)],I=this.createVirtualListItem(C,s===g),f=e;C.parentId&&n.has(C.parentId)&&((S=n.get(C.parentId)).childUl||(S.childUl=this.createElement("ul",{className:O+" e-ul",attrs:{role:"group"}}),S.li.appendChild(S.childUl)),f=S.childUl),f.appendChild(I),b.push(I),C.expanded&&C.hasChildren&&n.set(C.id,{li:I,childUl:null})}for(var x=!1,E=0;E<b.length;E++)if((I=b[parseInt(E.toString(),10)]).classList.contains(vs)){I.setAttribute("tabindex","0"),w.addClass([I],Ws),x=!0;break}if(!x&&t)for(E=0;E<b.length;E++)if((I=b[parseInt(E.toString(),10)]).getAttribute("data-uid")===t){I.setAttribute("tabindex","0"),w.addClass([I],Ws),w.addClass([I],_s),w.EventHandler.add(I,"blur",this.focusOut,this),I.focus({preventScroll:!0}),x=!0;break}!x&&0<b.length&&b[0].setAttribute("tabindex","0");for(E=0;E<b.length;E++)"0"!==(I=b[parseInt(E.toString(),10)]).getAttribute("tabindex")&&I.setAttribute("tabindex","-1");this.liList=b}},p.prototype.createVirtualListItem=function(e,t){var i,s=this.createElement("li",{className:N}),n=(s.classList.add("e-level-"+e.level),s.setAttribute("data-uid",e.id),s.setAttribute("aria-level",e.level.toString()),s.setAttribute("role","treeitem"),s.setAttribute("tabindex","-1"),this.fullRowSelect&&(n=this.createElement("div",{className:Ps}),s.appendChild(n)),this.createElement("div",{className:Ss})),r=(e.hasChildren&&(i=this.createElement("div",{className:L+" "+(e.expanded?u:E)}),n.appendChild(i)),this.showCheckBox&&(i=R.createCheckBox(this.createElement,!1,{checked:!0===e.isChecked,cssClass:js}),"indeterminate"===e.isChecked&&(r=i.querySelector("."+Fs))&&r.classList.add(Vs),n.appendChild(i)),e.iconCss&&(r=this.createElement("span",{className:L+" "+e.iconCss}),n.appendChild(r)),e.imageUrl&&((i=document.createElement("img")).src=e.imageUrl,i.classList.add(zs),n.appendChild(i)),this.createElement("span",{className:"e-list-text",innerHTML:e.text}));return n.appendChild(r),s.appendChild(n),w.isNullOrUndefined(this.nodeTemplateFn)||(i=this.findNodeInTreeData(e.id),w.isNullOrUndefined(i))||(r.innerHTML="",this.renderNodeTemplate(i,r,e.id)),e.expanded?(s.classList.add(Hs),s.setAttribute("aria-expanded","true")):e.hasChildren&&(s.classList.add(Us),s.setAttribute("aria-expanded","false")),e.selected&&(s.classList.add(vs),s.setAttribute("aria-selected","true")),e.hasChildren&&s.classList.add(Ks),w.EventHandler.add(s,"focus",this.focusIn,this),s},p.prototype.initVirtualization=function(){w.addClass([this.element],Qs);var e=this.parseHeightToPixels();0<e&&(this.element.style.height=e+"px",this.element.style.overflowY="auto"),this.ulElement||(this.ulElement=w.select("."+O,this.element)),this.ulElement&&(this.ulElement.style.position="relative",this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap(),this.virtualViewportHeight=0<e?e:this.element.offsetHeight,0<this.virtualFlatNodes.length&&(e=this.createVirtualListItem(this.virtualFlatNodes[0],!0),this.ulElement.appendChild(e),this.virtualItemHeight=0<e.offsetHeight?e.offsetHeight:this.virtualItemHeight,this.ulElement.removeChild(e)),e=this.getVirtualWindow(),this.virtualStartIndex=e.startIndex,this.virtualEndIndex=e.endIndex,this.renderVirtualItems(),this.wireVirtualScrollEvents())},p.prototype.wireVirtualScrollEvents=function(){this.unwireVirtualScrollEvents(),this.virtualScrollBound=this.onVirtualScroll.bind(this),this.element.addEventListener("scroll",this.virtualScrollBound,{passive:!0})},p.prototype.unwireVirtualScrollEvents=function(){this.virtualScrollBound&&(this.element.removeEventListener("scroll",this.virtualScrollBound),this.virtualScrollBound=null),null!==this.virtualScrollRAF&&(cancelAnimationFrame(this.virtualScrollRAF),this.virtualScrollRAF=null)},p.prototype.onVirtualScroll=function(){var e,t,i=this;null!==this.virtualScrollRAF&&cancelAnimationFrame(this.virtualScrollRAF),this.virtualSkipNextScrollRender?(this.virtualSkipNextScrollRender=!1,this.virtualPrevScrollTop=this.element.scrollTop):(e=this.element.scrollTop,t=Math.abs(e-this.virtualPrevScrollTop),2*this.virtualViewportHeight<t&&this.showVirtualMask(e),this.virtualScrollRAF=requestAnimationFrame(function(){i.virtualScrollRAF=null,i.virtualPrevScrollTop=i.element.scrollTop;var e=i.getVirtualWindow();i.virtualStartIndex=e.startIndex,i.virtualEndIndex=e.endIndex,i.renderVirtualItems(),setTimeout(function(){i.hideVirtualMask(),i.updateMaskPosition()},200)}))},p.prototype.createVirtualMask=function(){if(!this.virtualMaskElement){for(var e=this.element.getBoundingClientRect(),t=this.element.offsetWidth-this.element.clientWidth,i=this.createElement("div",{className:"e-mask-parent",styles:"position:fixed;top:"+e.top+"px;left:"+e.left+"px;width:"+(e.width-t)+"px;height:"+e.height+"px;z-index:10;overflow:hidden;background:#fff;pointer-events:none;display:none;"}),s=Math.ceil(this.virtualViewportHeight/this.virtualItemHeight)+1,n=0;n<s;n++){var r=this.createElement("div",{className:"e-mask-item",styles:"display:flex;align-items:center;height:"+this.virtualItemHeight+"px;padding:0 12px;gap:8px;"}),l=this.createElement("span"),o=(l.style.flex="1",l.style.height="14px",r.appendChild(l),new V.Skeleton({shape:"Text",width:"80%",height:"14px",cssClass:"e-virtual-skel-text"}));o.appendTo(l),this.skeletonInstances.push(o),i.appendChild(r)}this.virtualMaskElement=i,this.element.appendChild(i)}},p.prototype.updateMaskPosition=function(){var e,t;this.virtualMaskElement&&(e=this.element.getBoundingClientRect(),t=this.element.offsetWidth-this.element.clientWidth,this.virtualMaskElement.style.top=e.top+"px",this.virtualMaskElement.style.left=e.left+"px",this.virtualMaskElement.style.width=e.width-t+"px",this.virtualMaskElement.style.height=e.height+"px")},p.prototype.destroyVirtualMask=function(){for(var e=this.skeletonInstances.length-1;0<=e;e--)this.skeletonInstances[parseInt(e.toString(),10)].destroy();this.skeletonInstances=[],this.virtualMaskElement&&(this.virtualMaskElement.parentElement&&this.virtualMaskElement.parentElement.removeChild(this.virtualMaskElement),this.virtualMaskElement=null)},p.prototype.showVirtualMask=function(e){this.virtualMaskElement||this.createVirtualMask(),this.virtualMaskElement&&(this.updateMaskPosition(),this.virtualMaskElement.style.display="block",this.ulElement)&&(this.ulElement.style.visibility="hidden")},p.prototype.hideVirtualMask=function(){this.virtualMaskElement&&(this.virtualMaskElement.style.display="none",this.ulElement)&&(this.ulElement.style.visibility="")},p.prototype.ensureVirtualNodeVisible=function(e){e=this.virtualNodeMap.get(e);if(!w.isNullOrUndefined(e)){var t=this.virtualItemHeight,i=this.virtualViewportHeight,e=e*t,t=e+t,s=this.element.scrollTop,n=s+i;if(e<s)this.element.scrollTop=e;else{if(!(n<t))return;this.element.scrollTop=t-i}s=this.getVirtualWindow();this.virtualStartIndex=s.startIndex,this.virtualEndIndex=s.endIndex,this.renderVirtualItems()}},p.prototype.findNodeInTreeData=function(s){var n,r,l;return this.treeData?(n=this.fields.id.toString(),r=this.fields.child.toString(),(l=function(e){if(e&&0!==e.length)for(var t=0;t<e.length;t++){var i=e[t];if(i[n]&&i[n].toString()===s)return i;i=w.getValue(r,i);if(i&&Array.isArray(i)){i=l(i);if(i)return i}}return null})(this.treeData)):null},p.prototype.handleVirtualExpand=function(e,t){null!==this.virtualScrollRAF&&(cancelAnimationFrame(this.virtualScrollRAF),this.virtualScrollRAF=null),-1===this.expandedNodes.indexOf(e)&&this.expandedNodes.push(e),this.virtualExpandedNodesSet&&this.virtualExpandedNodesSet.add(e),this.treeData&&(i=this.findNodeInTreeData(e))&&this.fields&&this.fields.expanded&&w.setValue(this.fields.expanded,!0,i),this.virtualFocusedId=t?e:null,this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap();var i=this.element.scrollTop,t=this.getVirtualWindowAt(i),i=(this.virtualStartIndex=t.startIndex,this.virtualEndIndex=t.endIndex,this.virtualSkipNextScrollRender=!0,this.renderVirtualItems(),this.getElement(e));i&&((t=w.select("."+L,i))&&w.removeClass([t],bs),i.focus({preventScroll:!0})),this.isLoaded&&(t=this.getElement(e))&&((i=this.getExpandEvent(t,null)).isInteracted=this.isInteracted,this.trigger("nodeExpanded",i))},p.prototype.handleVirtualCollapse=function(e,t){null!==this.virtualScrollRAF&&(cancelAnimationFrame(this.virtualScrollRAF),this.virtualScrollRAF=null);var i=this.expandedNodes.indexOf(e),i=(-1!==i&&this.expandedNodes.splice(i,1),this.virtualExpandedNodesSet&&this.virtualExpandedNodesSet.delete(e),this.treeData&&(i=this.findNodeInTreeData(e))&&this.fields&&this.fields.expanded&&w.setValue(this.fields.expanded,!1,i),this.virtualFocusedId=t?e:null,this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap(),this.element.scrollTop),t=this.getVirtualWindowAt(i),i=(this.virtualStartIndex=t.startIndex,this.virtualEndIndex=t.endIndex,this.virtualSkipNextScrollRender=!0,this.renderVirtualItems(),this.getElement(e));i&&((t=w.select("."+L,i))&&w.removeClass([t],bs),i.focus({preventScroll:!0})),this.isLoaded&&(t=this.getElement(e))&&((i=this.getExpandEvent(t,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",i))},p.prototype.updateVirtualNodeSelection=function(e,t){e=this.virtualNodeMap.get(e);w.isNullOrUndefined(e)||(this.virtualFlatNodes[parseInt(e.toString(),10)].selected=t,this.renderVirtualItems())},p.prototype.updateVirtualNodeCheckState=function(e,t){var i=this.virtualNodeMap.get(e);w.isNullOrUndefined(i)||(this.virtualFlatNodes[parseInt(i.toString(),10)].isChecked="check"===t||"indeterminate"===t&&"indeterminate","indeterminate"===t?this.virtualIndeterminateNodesSet.add(e):this.virtualIndeterminateNodesSet.delete(e),this.renderVirtualItems())},p.prototype.onPropertyChanged=function(e,t){for(var i,s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"allowDragAndDrop":this.setDragAndDrop(this.allowDragAndDrop);break;case"dragArea":this.allowDragAndDrop&&(this.dragObj.dragArea=this.dragArea);break;case"allowEditing":this.wireEditingEvents(this.allowEditing);break;case"allowMultiSelection":1<this.selectedNodes.length&&(i=this.getElement(this.selectedNodes[0]),this.isLoaded=!1,this.removeSelectAll(),this.selectNode(i,null),this.isLoaded=!0),this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":JSON.stringify(t.checkedNodes)!==JSON.stringify(e.checkedNodes)&&this.showCheckBox&&(this.checkedNodes=t.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(t.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:w.isNullOrUndefined(e.expandedNodes)?[]:e.expandedNodes},!0),this.doExpandAction(),this.isInitalExpand=!1,this.isAnimate=!0;break;case"expandOn":this.wireExpandOnEvent(!1),this.setExpandOnType(),"None"===this.expandOnType||this.disabled||this.wireExpandOnEvent(!0);break;case"disabled":this.setDisabledMode(),this.dynamicState();break;case"fields":this.isAnimate=!1,this.isFieldChange=!0,this.initialRender=!0,this.isReact&&(!this.isReact||this.fields.dataSource instanceof x.DataManager)||(this.element.classList.contains("e-filtering")||(this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource))),this.reRenderNodes()),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var r=this.element.querySelectorAll("li"),l=0;l<r.length;)"true"!==r[parseInt(l.toString(),10)].getAttribute("aria-expanded")&&this.renderChildNodes(r[parseInt(l.toString(),10)],!0,null,!0),l++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"checkDisabledChildren":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes();break;case"enableVirtualization":this.enableVirtualization?w.isNullOrUndefined(this.height)||this.initVirtualization():(this.unwireVirtualScrollEvents(),this.destroyVirtualMask(),w.removeClass([this.element],Qs),this.element.style.height="",this.element.style.overflowY="",this.reRenderNodes());break;case"height":this.enableVirtualization?(this.unwireVirtualScrollEvents(),this.initVirtualization()):(i=this.parseHeightToPixels(),this.element.style.height=0<i?i+"px":"")}},p.prototype.destroy=function(){this.enableVirtualization&&(this.unwireVirtualScrollEvents(),this.destroyVirtualMask(),this.virtualFlatNodes=[],this.virtualNodeMap.clear()),this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.ulElement=null,this.liList=null,this.startNode=null,this.firstTap=null,this.expandArgs=null,this.dragLi=null,this.dragTarget=null,this.dragParent=null,this.dragObj=null,this.dropObj=null,this.inputObj=null,this.touchEditObj=null,this.touchExpandObj=null,this.touchClickObj=null,on.prototype.destroy.call(this)},p.prototype.addNodes=function(e,t,i,s){if(!w.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var n=this.getElement(t);if(this.preventExpand=s,this.fields.dataSource instanceof x.DataManager)this.isOffline?this.addSuccess(e,n,i):this.crudOperation("insert",null,t,null,e,i,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,n,i);else{if(n)this.addGivenNodes(e,n,i);else{e=this.getSortedData(e);for(var r=0;r<e.length;r++){var l=w.getValue(this.fields.parentID,e[parseInt(r.toString(),10)]),n=l&&this.getElement(l.toString());!w.isNullOrUndefined(l)&&w.isNullOrUndefined(n)&&(this.isHiddenItem=!0,this.preventExpand=!1,this.ensureVisible(l),this.preventExpand=s,this.isHiddenItem=!1,n=this.getElement(l.toString())),this.addGivenNodes([e[parseInt(r.toString(),10)]],n,i)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}var t=w.select("."+N+'[tabindex="0"]',this.element);w.isNullOrUndefined(t)&&this.setNodeFocusable(),this.enableVirtualization&&!w.isNullOrUndefined(this.height)?(this.setRootData(),this.rebuildVirtualCheckCache(),this.virtualFlatNodes=this.flattenVisibleNodes(),this.rebuildVirtualNodeMap(),t=this.getVirtualWindow(),this.virtualStartIndex=t.startIndex,this.virtualEndIndex=t.endIndex,this.renderVirtualItems()):(this.updateCheckedStateFromDS(),this.showCheckBox&&n&&this.autoCheck&&this.ensureParentCheckState(n)),this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1,this.triggerEvent("addNodes",e))}},p.prototype.beginEdit=function(e){e=this.getElement(e);w.isNullOrUndefined(e)||this.disabled||this.createTextbox(e)},p.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},p.prototype.collapseAll=function(e,t,i){var s,n=this;this.enableVirtualization&&!w.isNullOrUndefined(this.height)&&(this.virtualExpandedNodesSet.clear(),this.setProperties({expandedNodes:[]},!0),(s=function(e){if(e)for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],i=(i.expanded=!1,w.getValue(n.fields.child.toString(),i));i&&Array.isArray(i)&&s(i)}})(this.treeData)),w.isNullOrUndefined(e)?0<t?this.collapseByLevel(w.select("."+O,this.element),t,i):this.collapseAllNodes(i):this.doGivenAction(e,u,!1)},p.prototype.disableNodes=function(e){w.isNullOrUndefined(e)||this.doDisableAction(e)},p.prototype.enableNodes=function(e){w.isNullOrUndefined(e)||this.doEnableAction(e)},p.prototype.ensureVisible=function(e){var t=[];if(1===this.dataType)for(var i=this.getTreeData(e);0!==i.length&&!w.isNullOrUndefined(i[0][this.fields.parentID]);)t.push(i[0][this.fields.parentID].toString()),i=this.getTreeData(i[0][this.fields.parentID].toString());else 2===this.dataType&&(t=this.getHierarchicalParentId(e,this.treeData,t));this.expandAll(t.reverse(),null,null,this.isHiddenItem);var s=this.getElement(e);w.isNullOrUndefined(s)||("object"==typeof e&&(e=this.parents(s,"."+N),this.expandAll(e)),setTimeout(function(){s.scrollIntoView({behavior:"smooth"})},450))},p.prototype.expandAll=function(e,t,i,s){if(this.isAnimate=!s,this.enableVirtualization&&!w.isNullOrUndefined(this.height)){var n=[],r=this.fields.id,l=(this.fields.child.toString(),this.dataType,this.treeData);if(l)for(var o=0;o<l.length;o++){var a=l[parseInt(o.toString(),10)],d=w.getValue(r,a);a.hasChild&&(n.push(d),a.expanded=!0)}for(var h=0;h<n.length;h++){var c=n[parseInt(h.toString(),10)];this.virtualExpandedNodesSet.has(c)||this.virtualExpandedNodesSet.add(c)}this.setProperties({expandedNodes:n},!0)}w.isNullOrUndefined(e)?0<t?this.expandByLevel(w.select("."+O,this.element),t,i):(this.expandAllNodes(i),this.loadOnDemand&&!this.element.classList.contains("e-filtering")||(this.updateAttributes(this.element),this.updateList())):this.doGivenAction(e,E,!0),this.isAnimate=!0},p.prototype.getAllCheckedNodes=function(){return this.checkedNodes},p.prototype.getDisabledNodes=function(){return this.disableNode},p.prototype.getNode=function(e){e=this.getElement(e);return this.getNodeData(e,!0)},p.prototype.getTreeData=function(e){var e=this.getId(e);return this.updatePersistProp(),w.isNullOrUndefined(e)?this.treeData:(e=this.getNodeObject(e),w.isNullOrUndefined(e)?[]:[e])},p.prototype.moveNodes=function(e,t,i,s){if(!w.isNullOrUndefined(e)&&0!==e.length){var n=this.getElement(t),r=[];w.isNullOrUndefined(n)&&(this.isHiddenItem=!0,this.ensureVisible(t),this.isHiddenItem=!1,n=this.getElement(t));for(var l=0;l<e.length;l++){var o=this.getElement(e[parseInt(l.toString(),10)]);r.push(this.getNode(o)),w.isNullOrUndefined(o)||n.isSameNode(o)||this.isDescendant(o,n)||(this.preventExpand=s,this.dropAsChildNode(o,n,this,i,null,null,null,n))}this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent("moveNodes",r)}},p.prototype.refreshNode=function(e,t){if(!w.isNullOrUndefined(e)&&!w.isNullOrUndefined(t)){var i,s,n,r,l,o,a=!1,d=(1===this.dataType&&1<t.length?a=!0:2===this.dataType&&1===t.length&&(d=w.getValue(this.fields.child.toString(),t[0]),w.isNullOrUndefined(d)||(a=!0)),this.getElement(e)),h=d?d.getAttribute("data-uid"):e?e.toString():null;if(this.refreshData=this.getNodeObject(h),t=JSON.parse(JSON.stringify(t)),1===this.dataType&&a){for(var c=0;c<t.length;c++)if(w.isNullOrUndefined(t[parseInt(c.toString(),10)][this.fields.parentID])){s=t[parseInt(c.toString(),10)],t.splice(c,1);break}i=w.extend({},this.refreshData,s)}else i=w.extend({},this.refreshData,t[0]);w.isNullOrUndefined(d)?this.updatePosition(h,i,a,t):(this.isRefreshed=!0,o=parseFloat(d.getAttribute("aria-level")),o=k.ListBase.createListItemFromJson(this.createElement,[i],this.listBaseOption,o),l=w.select("."+O,d),n=w.getValue(this.fields.child.toString(),i),a&&l||a&&!w.isNullOrUndefined(n)?(n=d.parentElement,r=Array.prototype.indexOf.call(n.childNodes,d),w.remove(d),n.insertBefore(o[0],n.childNodes[parseInt(r.toString(),10)]),this.updatePosition(h,i,a,t),a&&l&&this.expandAll([h])):(n=w.select("."+Ss,d),r=w.select("."+Ss,o[0]),l=w.select("div."+L,n),o=w.select("div."+L,r),l&&o&&(o.classList.contains(E)&&l.classList.contains(u)?(w.removeClass([o],E),w.addClass([o],u)):o.classList.contains(u)&&l.classList.contains(E)?(w.removeClass([o],u),w.addClass([o],E)):l.classList.contains("interaction")&&w.addClass([o],"interaction")),w.remove(n),(l=w.select("."+Ps,d)).parentNode.insertBefore(r,l.nextSibling),this.updatePosition(h,i,a,t)),d=this.getElement(e),i[this.fields.tooltip]&&d.setAttribute("title",i[this.fields.tooltip]),Object.prototype.hasOwnProperty.call(i,this.fields.htmlAttributes)&&i[this.fields.htmlAttributes]&&(w.merge(o={},i[this.fields.htmlAttributes]),o.class?(w.addClass([d],o.class.split(" ")),delete o.class):w.attributes(d,o)),-1!==this.selectedNodes.indexOf(h)&&(d.setAttribute("aria-selected","true"),w.addClass([d],vs)),this.isRefreshed=!1,this.triggerEvent("refreshNode",[this.getNode(d)]))}},p.prototype.removeNodes=function(e){w.isNullOrUndefined(e)||(this.fields.dataSource instanceof x.DataManager&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},p.prototype.updateNode=function(t,i){var s,n,e,r=this;w.isNullOrUndefined(t)||w.isNullOrUndefined(i)||!this.allowEditing||(s=this.getElement(t),w.isNullOrUndefined(s))||(n=w.select("."+fs,s),this.updateOldText(s),e=this.getEditEvent(s,null,null),this.trigger("nodeEditing",e,function(e){e.cancel||(r.fields.dataSource instanceof x.DataManager&&!r.isOffline?r.crudOperation("update",null,t,i,null,null,!1):r.appendNewText(s,n,i,!1))}))},p.prototype.uncheckAll=function(e){this.showCheckBox&&0<this.checkedNodes.length&&this.doCheckBoxAction(e,!1)},p.prototype.setNodeFocusable=function(){var e=w.select("."+N,this.element);e&&(e.setAttribute("tabindex","0"),this.updateIdAttr(null,e))},c([w.Property(!(p.prototype.escapeHashInUid=function(e){return!w.isNullOrUndefined(e)&&"string"==typeof e?e.replace(/[#:.[\]!~^$*() ]/g,"\\$&"):e}))],p.prototype,"allowDragAndDrop",void 0),c([w.Property(!1)],p.prototype,"allowEditing",void 0),c([w.Property(!1)],p.prototype,"allowMultiSelection",void 0),c([w.Property(!1)],p.prototype,"allowTextWrap",void 0),c([w.Property(!1)],p.prototype,"enableVirtualization",void 0),c([w.Property()],p.prototype,"height",void 0),c([w.Complex({},rn)],p.prototype,"animation",void 0),c([w.Property()],p.prototype,"checkedNodes",void 0),c([w.Property(!0)],p.prototype,"checkDisabledChildren",void 0),c([w.Property("")],p.prototype,"cssClass",void 0),c([w.Property(!1)],p.prototype,"disabled",void 0),c([w.Property(null)],p.prototype,"dragArea",void 0),c([w.Property(!0)],p.prototype,"enableHtmlSanitizer",void 0),c([w.Property(!0)],p.prototype,"disableHtmlEncode",void 0),c([w.Property(!1)],p.prototype,"enablePersistence",void 0),c([w.Property()],p.prototype,"expandedNodes",void 0),c([w.Property("Auto")],p.prototype,"expandOn",void 0),c([w.Complex({},Zs)],p.prototype,"fields",void 0),c([w.Property(!0)],p.prototype,"fullRowSelect",void 0),c([w.Property(!0)],p.prototype,"loadOnDemand",void 0),c([w.Property()],p.prototype,"locale",void 0),c([w.Property()],p.prototype,"nodeTemplate",void 0),c([w.Property()],p.prototype,"selectedNodes",void 0),c([w.Property("None")],p.prototype,"sortOrder",void 0),c([w.Property(!1)],p.prototype,"showCheckBox",void 0),c([w.Property(!1)],p.prototype,"checkOnClick",void 0),c([w.Property(!0)],p.prototype,"autoCheck",void 0),c([w.Property(!1)],p.prototype,"fullRowNavigable",void 0),c([w.Event()],p.prototype,"actionFailure",void 0),c([w.Event()],p.prototype,"created",void 0),c([w.Event()],p.prototype,"dataBound",void 0),c([w.Event()],p.prototype,"dataSourceChanged",void 0),c([w.Event()],p.prototype,"drawNode",void 0),c([w.Event()],p.prototype,"destroyed",void 0),c([w.Event()],p.prototype,"keyPress",void 0),c([w.Event()],p.prototype,"nodeChecked",void 0),c([w.Event()],p.prototype,"nodeChecking",void 0),c([w.Event()],p.prototype,"nodeClicked",void 0),c([w.Event()],p.prototype,"nodeCollapsed",void 0),c([w.Event()],p.prototype,"nodeCollapsing",void 0),c([w.Event()],p.prototype,"nodeDragging",void 0),c([w.Event()],p.prototype,"nodeDragStart",void 0),c([w.Event()],p.prototype,"nodeDragStop",void 0),c([w.Event()],p.prototype,"nodeDropped",void 0),c([w.Event()],p.prototype,"nodeEdited",void 0),c([w.Event()],p.prototype,"nodeEditing",void 0),c([w.Event()],p.prototype,"nodeExpanded",void 0),c([w.Event()],p.prototype,"nodeExpanding",void 0),c([w.Event()],p.prototype,"nodeSelected",void 0),c([w.Event()],p.prototype,"nodeSelecting",void 0);var on,an,o=an=c([w.NotifyPropertyChanges],p);function p(e,t){e=on.call(this,e,t)||this;return e.isRefreshed=!1,e.preventExpand=!1,e.checkedElement=[],e.disableNode=[],e.validArr=[],e.validNodes=[],e.expandChildren=[],e.isFieldChange=!1,e.changeDataSource=!1,e.hasTemplate=!1,e.isFirstRender=!1,e.batchParentNode=new Set,e.isNodeDropped=!1,e.isInteracted=!1,e.isRightClick=!1,e.mouseDownStatus=!1,e.isKeyboardFocus=!1,e.isDropIn=!1,e.OldCheckedData=[],e.isHiddenItem=!1,e.virtualFlatNodes=[],e.virtualNodeMap=new Map,e.virtualExpandedNodesSet=new Set,e.virtualCheckedNodesSet=new Set,e.virtualIndeterminateNodesSet=new Set,e.virtualSelectedNodesSet=new Set,e.virtualItemHeight=40,e.virtualViewportHeight=0,e.virtualPrevScrollTop=0,e.virtualStartIndex=0,e.virtualEndIndex=0,e.virtualOverscanCount=3,e.virtualScrollRAF=null,e.virtualMaskElement=null,e.virtualScrollBound=null,e.skeletonInstances=[],e.virtualTreeDirty=!1,e.virtualFocusedId=null,e.virtualSkipNextScrollRender=!1,e}dn=function(e,t){return(dn=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 dn,hn,c=function(e,t){function i(){this.constructor=e}dn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},f=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},cn="e-sidebar",pn="e-dock",un="e-close",mn="e-open",fn="e-transition",gn="e-sidebar-overlay",vn="e-right",yn="e-left",bn="e-over",Sn="e-push",Cn="e-slide",In="e-visibility",xn="e-disable-animation",En="e-sidebar-context",Nn="e-sidebar-absolute",c=(hn=w.Component,c(A,hn),A.prototype.preRender=function(){this.setWidth()},A.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},A.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),w.Browser.isDevice&&(this.windowWidth=window.innerWidth)},A.prototype.setEnableRTL=function(){(this.enableRtl?w.addClass:w.removeClass)([this.element],"e-rtl")},A.prototype.setTarget=function(){this.targetEle=this.element.nextElementSibling,this.sidebarEleCopy=this.element.cloneNode(!0),"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),this.target&&(this.target.insertBefore(this.element,this.target.children[0]),w.addClass([this.element],Nn),w.addClass([this.target],En),this.targetEle=this.getTargetElement())},A.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!w.isNullOrUndefined(e)&&e.classList.contains(cn);)e=e.nextElementSibling;return e},A.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?(document.addEventListener("mousedown",this.documentClickContext),document.addEventListener("touchstart",this.documentClickContext)):(document.removeEventListener("mousedown",this.documentClickContext),document.removeEventListener("touchstart",this.documentClickContext))},A.prototype.setWidth=function(){this.enableDock&&"Left"===this.position||this.enableDock&&"Right"===this.position?w.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||w.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},A.prototype.setDimension=function(e){return e="number"==typeof e?w.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:w.formatUnit(e):"100%"},A.prototype.setZindex=function(){w.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},A.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&w.addClass([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");w.isNullOrUndefined(e||this.targetEle)||w.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):null,this.enableDock||"Auto"===this.type||w.addClass([this.element],[In]),w.removeClass([this.element],[mn,un,vn,yn,Cn,Sn,bn]),this.element.classList.add(cn),w.addClass([this.element],"Right"===this.position?vn:yn),this.enableDock&&w.addClass([this.element],pn),w.isNullOrUndefined(this.tabIndex)||this.element.setAttribute("tabindex",this.tabIndex),"Auto"===this.type&&!w.Browser.isDevice&&this.checkMediaQuery()?this.show():this.isOpen||w.addClass([this.element],[un,xn])},A.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(un)||e||this.hide()},A.prototype.transitionEnd=function(e){this.setDock(),w.isNullOrUndefined(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,w.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},A.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e&&!w.isNullOrUndefined(this.defaultBackdropDiv)?(w.removeClass([this.defaultBackdropDiv],gn),this.defaultBackdropDiv.remove(),this.defaultBackdropDiv=null):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},A.prototype.hide=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!w.isNullOrUndefined(e),event:e||null};this.trigger("close",e,function(e){e.cancel?t.preventClose=!0:t.element.classList.contains(un)||(t.element.classList.contains(mn)&&!t.animate&&t.triggerChange(),w.addClass([t.element],un),w.removeClass([t.element],mn),w.setStyleAttribute(t.element,{width:w.formatUnit(t.enableDock?t.dockSize:t.width)}),t.setType(t.type),e=document.querySelector(".e-main-content")||t.targetEle,!t.enableDock&&e&&(e.style.transform="translateX(0px)",e.style["Left"===t.position?"marginLeft":"marginRight"]="0px"),t.destroyBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.remove("e-sidebar-overflow"),t.setProperties({isOpen:!1},!0),t.enableDock&&setTimeout(function(){return t.setTimeOut()},50),w.EventHandler.add(t.element,"transitionend",t.transitionEnd,t),t.preventClose=!1)})},A.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(mn)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(un)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize)):"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width)},A.prototype.show=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!w.isNullOrUndefined(e),event:e||null};this.trigger("open",e,function(e){e.cancel||(w.removeClass([t.element],[In,xn]),t.element.classList.contains(mn))||(t.element.classList.contains(un)&&!t.animate&&t.triggerChange(),w.addClass([t.element],[mn,fn]),w.setStyleAttribute(t.element,{transform:""}),w.removeClass([t.element],un),w.setStyleAttribute(t.element,{width:w.formatUnit(t.width)}),t.setType(t.type),t.targetEle&&!t.targetEle.querySelector(".e-sidebar-overlay")&&t.createBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.add("e-sidebar-overflow"),t.setProperties({isOpen:!0},!0),w.EventHandler.add(t.element,"transitionend",t.transitionEnd,t))})},A.prototype.setAnimation=function(){this.animate?w.removeClass([this.element],xn):w.addClass([this.element],xn)},A.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},A.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?w.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&w.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(un)&&this.enableDock&&w.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},A.prototype.createBackDrop=function(){var e,t;this.target&&this.showBackdrop&&this.getState()?(e=this.target,t=document.querySelector(".e-main-content")||this.targetEle,this.defaultBackdropDiv=this.createElement("div"),w.addClass([this.defaultBackdropDiv],gn),w.setStyleAttribute(this.defaultBackdropDiv,{height:e.style.height}),t.appendChild(this.defaultBackdropDiv)):this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className=gn,this.modal.style.display="block",document.body.appendChild(this.modal))},A.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},A.prototype.getModuleName=function(){return"sidebar"},A.prototype.toggle=function(){this.element.classList.contains(mn)?this.hide():this.show()},A.prototype.getState=function(){return!!this.element.classList.contains(mn)},A.prototype.setMediaQuery=function(){this.mediaQuery&&(("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery):this.mediaQuery).matches&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide())},A.prototype.checkMediaQuery=function(){return!!w.isNullOrUndefined(this.mediaQuery)||("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery):this.mediaQuery).matches},A.prototype.resize=function(){w.isNullOrUndefined(this.width)||"auto"===this.width||"string"!=typeof this.width||this.width.includes("px")||this.setType(this.type),"Auto"===this.type&&(w.Browser.isDevice?w.addClass([this.element],bn):w.addClass([this.element],Sn)),this.setMediaQuery(),w.Browser.isDevice&&(this.windowWidth=window.innerWidth)},A.prototype.documentclickHandler=function(e){w.closest(e.target,".e-control."+cn)||this.hide(e)},A.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&50<=e.distanceX&&.5<=e.velocity?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection||this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide(e.originalEvent):!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&50<=e.distanceX&&.5<=e.velocity&&this.show()},A.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new w.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new w.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},A.prototype.wireEvents=function(){this.setEnableGestures(),w.EventHandler.add(window,"resize",this.resizeHandler)},A.prototype.unWireEvents=function(){w.EventHandler.remove(window,"resize",this.resizeHandler),w.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),w.EventHandler.remove(this.element,"transitionend",this.transitionEnd),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},A.prototype.onPropertyChanged=function(e,t){for(var i=document.querySelector(".e-main-content")||this.targetEle,s=this.isServerRendered,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"isOpen":this.isOpen?this.show():this.hide();break;case"width":this.setWidth(),this.getState()||this.setDock();break;case"animate":this.setAnimation();break;case"type":this.checkType(!1),w.removeClass([this.element],[In]),this.preventClose||this.addClass(),w.addClass([this.element],"Auto"===this.type?w.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]),this.setType(this.type);break;case"position":this.element.style.transform="",this.setDock(),i&&(i.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(w.removeClass([this.element],yn),w.addClass([this.element],vn)):(w.removeClass([this.element],vn),w.addClass([this.element],yn)),this.setType(this.type);break;case"showBackdrop":this.showBackdrop?this.createBackDrop():this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null);break;case"target":"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),w.isNullOrUndefined(this.target)&&(w.removeClass([this.element],Nn),w.removeClass([t.target],En),w.setStyleAttribute(i,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,hn.prototype.refresh.call(this),this.isServerRendered=s;break;case"closeOnDocumentClick":this.setCloseOnDocumentClick();break;case"enableDock":this.getState()||this.setDock(),this.enableDock?w.addClass([this.element],pn):w.removeClass([this.element],pn),!this.isOpen&&i&&(this.enableDock||(this.element.style.transform=i.style.transform=""),i.style["Left"===this.position?"marginLeft":"marginRight"]=this.enableDock?this.setDimension(this.dockSize):"0px");break;case"zIndex":this.setZindex();break;case"mediaQuery":this.setMediaQuery();break;case"enableGestures":this.setEnableGestures();break;case"enableRtl":this.setEnableRTL()}},A.prototype.setType=function(e){var t=this.element.getBoundingClientRect().width,i=(this.setZindex(),document.querySelector(".e-main-content")||this.targetEle),s=(i&&(i.style.transform="translateX(0px)",w.Browser.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(i.style["Left"===this.position?"marginLeft":"marginRight"]="0px")),this.position,t+"px"),n="Left"===this.position?t:-t;switch(w.removeClass([this.element],[Sn,bn,Cn]),e){case"Push":w.addClass([this.element],[Sn]),i&&(this.enableDock||this.element.classList.contains(mn))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=s);break;case"Slide":w.addClass([this.element],[Cn]),i&&(this.enableDock||this.element.classList.contains(mn))&&(i.style.transform="translateX("+n+"px)");break;case"Over":w.addClass([this.element],[bn]),this.enableDock&&(this.element.classList.contains(un)||this.isOpen)&&i&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":w.addClass([this.element],[fn]),w.Browser.isDevice?i&&this.enableDock&&!this.getState()?(i.style["Left"===this.position?"marginLeft":"marginRight"]=s,w.addClass([this.element],Sn)):w.addClass([this.element],bn):(w.addClass([this.element],Sn),i&&(this.enableDock||this.element.classList.contains(mn))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=s)),this.createBackDrop()}},A.prototype.destroy=function(){hn.prototype.destroy.call(this),this.target&&0===(t=this.target).querySelectorAll("."+cn+"."+Nn).length&&w.removeClass([t],En),this.destroyBackDrop(),this.element&&(w.removeClass([this.element],[mn,un,Sn,Cn,bn,yn,vn,fn,xn]),w.removeClass([this.element],Nn),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",w.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var e,t=document.querySelector(".e-main-content")||this.targetEle;w.isNullOrUndefined(t)||(e=!1,e=this.target?0<this.target.querySelectorAll("."+cn+"."+mn).length:e)||(t.style.margin="",t.style.transform=""),this.unWireEvents()},f([w.Property("auto")],A.prototype,"dockSize",void 0),f([w.Property(null)],A.prototype,"mediaQuery",void 0),f([w.Property(!1)],A.prototype,"enableDock",void 0),f([w.Property("en-US")],A.prototype,"locale",void 0),f([w.Property(!1)],A.prototype,"enablePersistence",void 0),f([w.Property(!0)],A.prototype,"enableGestures",void 0),f([w.Property(!1)],A.prototype,"isOpen",void 0),f([w.Property(!1)],A.prototype,"enableRtl",void 0),f([w.Property(!0)],A.prototype,"animate",void 0),f([w.Property("auto")],A.prototype,"height",void 0),f([w.Property(!1)],A.prototype,"closeOnDocumentClick",void 0),f([w.Property("Left")],A.prototype,"position",void 0),f([w.Property(null)],A.prototype,"target",void 0),f([w.Property(!1)],A.prototype,"showBackdrop",void 0),f([w.Property("Auto")],A.prototype,"type",void 0),f([w.Property("auto")],A.prototype,"width",void 0),f([w.Property(1e3)],A.prototype,"zIndex",void 0),f([w.Event()],A.prototype,"created",void 0),f([w.Event()],A.prototype,"close",void 0),f([w.Event()],A.prototype,"open",void 0),f([w.Event()],A.prototype,"change",void 0),f([w.Event()],A.prototype,"destroyed",void 0),f([w.NotifyPropertyChanges],A));function A(e,t){e=hn.call(this,e,t)||this;return e.documentClickContext=e.documentclickHandler.bind(e),e.resizeHandler=e.resize.bind(e),e.preventClose=!1,e}On=function(e,t){return(On=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 On,wn,f=function(e,t){function i(){this.constructor=e}On(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},kn=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Ln="e-icon-right",An="e-breadcrumb-text",Tn="e-breadcrumb-icon",Dn="e-breadcrumb-menu",Pn="e-breadcrumb-item",Mn="e-breadcrumb-popup",Hn="e-breadcrumb-wrap-mode",Un="e-breadcrumb-scroll-mode",Rn="tabindex",Bn="e-disabled",Vn="aria-disabled",jn=".",Fn=((Fn=a.BreadcrumbOverflowMode||(a.BreadcrumbOverflowMode={})).Hidden="Hidden",Fn.Collapsed="Collapsed",Fn.Menu="Menu",Fn.Wrap="Wrap",Fn.Scroll="Scroll",Fn.None="None",wn=w.ChildProperty,f(qn,wn),kn([w.Property("")],qn.prototype,"text",void 0),kn([w.Property("")],qn.prototype,"id",void 0),kn([w.Property("")],qn.prototype,"url",void 0),kn([w.Property(null)],qn.prototype,"iconCss",void 0),kn([w.Property(!1)],qn.prototype,"disabled",void 0),qn);function qn(){return null!==wn&&wn.apply(this,arguments)||this}Wn=w.Component,f(T,Wn),T.prototype.preRender=function(){},T.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},T.prototype.initialize=function(){this._maxItems=this.maxItems,w.isNullOrUndefined(this.element.getAttribute("aria-label"))&&this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&w.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add(Bn),this.element.setAttribute(Vn,"true")),"Wrap"===this.overflowMode?this.element.classList.add(Hn):"Scroll"===this.overflowMode&&this.element.classList.add(Un),this.initItems(),this.initPvtProps()},T.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&0<this._maxItems&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(0<=this._maxItems?(this.startIndex=1<this._maxItems?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},T.prototype.getEndIndex=function(){var i,s=this;return this.activeItem?this.items.forEach(function(e,t){e.url!==s.activeItem&&e.text!==s.activeItem||(i=t)}):i=this.items.length-1,i},T.prototype.initItems=function(){if(!this.items.length){var e,t=void 0,i=void 0,s=[];i=(this.url?(t=(e=new URL(this.url,window.location.origin)).origin+"/",e):(t=window.location.origin+"/",window.location)).href.split(t)[1].split("/"),s.push({iconCss:"e-icons e-home",url:t});for(var n=0;n<i.length;n++)i[n]&&(s.push({text:i[n],url:t+i[n]}),t+=i[n]+"/");this.setProperties({items:s},!0)}},T.prototype.renderItems=function(e){var t,i,n=this,r=this.element.classList.contains(Ln),s=e.length;if(s){for(var l,o,a=void 0,d=0,h=void 0,c=2*s-1,p=!1,u=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),m=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),f=this.hasField(e,"iconCss"),g="Collapsed"===this.overflowMode&&0<this._maxItems&&s>this._maxItems&&!this.isExpanded,v="Hidden"===this.overflowMode&&0<this._maxItems,y=("Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML=""),{moduleName:this.getModuleName(),showIcon:f,itemNavigable:!0,itemCreated:function(e){var t=e.curData.isLastItem,i=(t&&e.item.children.length&&!n.itemTemplate&&(delete e.curData.isLastItem,o||n.enableActiveItemNavigation||(e.item.innerHTML=n.createElement("span",{className:An,innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||n.itemTemplate||e.item.classList.add("e-icon-item"),v&&e.item.setAttribute("item-index",d.toString()),{item:w.extend({},e.curData.properties||e.curData),element:e.item,cancel:!1}),s=(n.trigger("beforeItemRender",i),p=i.cancel,r||i.element.classList.contains(Ln));s&&e.curData.iconCss&&!n.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector(jn+Tn)),i.item.disabled&&(e.item.setAttribute(Vn,"true"),e.item.classList.add(Bn)),i.item.id&&e.item.setAttribute("id",i.item.id),(i.item.disabled||n.disabled)&&e.item.children.length&&!n.itemTemplate&&e.item.children[0].setAttribute(Rn,"-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),t&&!n.enableActiveItemNavigation||i.item.disabled||n.disabled||(e.item.children[0].setAttribute(Rn,"0"),w.EventHandler.add(e.item.children[0],"keydown",n.keyDownHandler,n))),e.item.removeAttribute("role"),t?(e.item.setAttribute("data-active-item",""),e.item.setAttribute("aria-current","page")):e.item.removeAttribute("aria-current"),n.itemTemplate||n.beforeItemRenderChanges(e.curData,i.item,e.item,s)}}),b=0;b<c;b%2&&d++,b++)if(l=this.activeItem&&(this.activeItem===e[d].url||this.activeItem===e[d].text),!(g&&1<b&&b<c-2)&&(!v||!(d<this.startIndex||d>this.endIndex)||b%2&&d===this.startIndex-1||0===d)){b%2?(h=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),this.separatorTemplate&&"/"===this.separatorTemplate||w.isNullOrUndefined(this.separatorTemplate)?y.template=w.initializeCSPTemplate(function(){return"/"}):y.template=this.separatorTemplate,i=!(y.itemClass="e-breadcrumb-separator"),t=[{previousItem:e[d],nextItem:e[d+1]}]):(y.itemClass="",i=!this.itemTemplate||(y.template=this.itemTemplate,!1),(t=[w.extend({},e[d].properties||e[d])])[0].url||this.itemTemplate||(t=[w.extend({},t[0],{isEmptyUrl:!0,url:"#"})]),a=(v||"Menu"===this.overflowMode)&&d===this.endIndex,(b!==c-1&&!a||this.itemTemplate)&&!l||(t[0].isLastItem=!0));var S=u,C=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(d>=this.startIndex&&d<=C&&(!(b%2)||d!==C)&&this.endIndex>=this._maxItems&&0<this._maxItems||0===this._maxItems)){if(b%2)continue;S=this.popupUl,a&&(o=!0)}else"Wrap"===this.overflowMode&&(S=0===b?m:h);var C=k.ListBase.createList(this.createElement,t,y,i,this).childNodes;if(p){if(v||g||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(d,1),this.initPvtProps(),this.reRenderItems();b!==c-1&&!a||w.remove(S.lastElementChild)}else w.append(C,S);if("Wrap"===this.overflowMode&&0!==b&&b%2==0&&u.appendChild(h),g&&1===b&&(C=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}}),w.EventHandler.add(C,"keyup",this.expandHandler,this),u.appendChild(C)),"Menu"===this.overflowMode&&this.startIndex===b&&this.endIndex>=this._maxItems&&0<=this._maxItems&&(S=this.getMenuElement(),w.EventHandler.add(S,"keyup",this.keyDownHandler,this),u.appendChild(S)),l||a)break;p&&b++}this.isReact&&(this.renderReactTemplates(),setTimeout(function(){n.calculateMaxItems()},5)),"Wrap"===this.overflowMode&&this.element.appendChild(m),this.element.appendChild(u),this.isReact||this.calculateMaxItems()}},T.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e,t,i=this.element.offsetWidth,s=[].slice.call(this.element.children[0].children).reverse(),n="Menu"===this.overflowMode?0:s[s.length-1].offsetWidth+(s[s.length-2]?s[s.length-2].offsetWidth:0);"Menu"===this.overflowMode&&(t=this.getMenuElement(),this.element.appendChild(t),n+=t.offsetWidth,w.remove(t));for(var r=0;r<s.length-2;r++){if(i<n){if(e=Math.ceil((r-1)/2)+("Menu"===this.overflowMode&&r<=2?0:1),(this.maxItems>e&&!(-1<this.maxItems&&-1===e)||-1===this.maxItems)&&this._maxItems!==e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===r&&i<(n+=s[s.length-1].offsetWidth+s[s.length-2].offsetWidth))return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&s[r].classList.contains(Dn)||(n+=s[r].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&0<this._maxItems){i=0;if((s=this.element.querySelectorAll(jn+Pn)).length>this._maxItems+this._maxItems-1){for(r="Wrap"===this.overflowMode?1:0;r<this._maxItems+this._maxItems-1;r++)i+=s[r].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},T.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},T.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},T.prototype.beforeItemRenderChanges=function(e,t,i,s){var n,r=i.querySelector(".e-anchor-wrap");t.text!==e.text&&r&&r.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=t.text)}),t.iconCss!==e.iconCss&&r&&((n=i.querySelector(jn+Tn))?t.iconCss?(w.removeClass([n],e.iconCss.split(" ")),w.addClass([n],t.iconCss.split(" "))):w.remove(n):t.iconCss&&(n=this.createElement("span",{className:Tn+" "+t.iconCss}),s?w.append([n],r):r.insertBefore(n,r.childNodes[0]))),t.url!==e.url&&this.enableNavigation&&(s=i.querySelector("a."+An))&&(t.url?s.setAttribute("href",t.url):s.removeAttribute("href"))},T.prototype.reRenderItems=function(){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&this.popupObj.element.querySelector(".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,w.detach(this.popupObj.element)),this.element.innerHTML="",this.renderItems(this.items)},T.prototype.clickHandler=function(e){var t=w.closest(e.target,jn+Pn+":not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),t&&(w.closest(e.target,jn+An)||this.itemTemplate)){var i=void 0,i=("Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll(jn+Pn)):[].slice.call(t.parentElement.children)).indexOf(t),t=("Menu"===this.overflowMode?w.closest(e.target,jn+Mn)?(i+=this.startIndex,this.endIndex=i,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector(jn+Dn)?i>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector(jn+Dn))?(i+=2*this.popupUl.childElementCount-2,i=Math.floor(i/2),this.endIndex=i):this.startIndex=this.endIndex=i:(i=Math.floor(i/2),this.startIndex=this.endIndex=i):i=Math.floor(i/2),"Hidden"===this.overflowMode&&0<this._maxItems&&0!==this.endIndex&&(i=parseInt(t.getAttribute("item-index"),10),1<this.startIndex&&(this.startIndex-=this.endIndex-i),this.endIndex=i),{element:t,item:this.items[i],event:e,cancel:!1});if(this.trigger("itemClick",t),t.cancel)return;this.items[i]&&(this.activeItem=this.items[i].url||this.items[i].text),this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(Dn)&&!this.isPopupCreated&&this.renderPopup()},T.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:Mn+" "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.isPopupCreated=!0,this.popupObj=new U.Popup(t,{content:this.popupUl,relateTo:this.element.querySelector(jn+Dn),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl&&e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},T.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!w.closest(e.target,jn+Dn)&&!w.closest(e.target,".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,w.detach(this.popupObj.element))},T.prototype.resize=function(e){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},T.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},T.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},T.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},T.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"enableActiveItemNavigation":this.reRenderItems();break;case"items":case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===t.overflowMode?this.element.classList.remove(Hn):"Wrap"===e.overflowMode&&this.element.classList.add(Hn),"Scroll"===t.overflowMode?this.element.classList.remove(Un):"Scroll"===e.overflowMode&&this.element.classList.add(Un);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":t.cssClass&&w.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&w.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" ")),(t.cssClass&&-1<t.cssClass.indexOf(Ln)&&!(e.cssClass&&-1<e.cssClass.indexOf(Ln))||!(t.cssClass&&-1<t.cssClass.indexOf(Ln))&&e.cssClass&&-1<e.cssClass.indexOf(Ln))&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle(Bn),this.element.setAttribute(Vn,e.disabled+"")}},T.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),w.EventHandler.add(document,"click",this.delegateClickHanlder,this),w.EventHandler.add(this.element,"click",this.clickHandler,this),this.resizeHandler=this.resize.bind(this),window.addEventListener("resize",this.resizeHandler)},T.prototype.popupWireEvents=function(){w.EventHandler.add(this.popupObj.element,"click",this.clickHandler,this),w.EventHandler.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},T.prototype.unWireEvents=function(){w.EventHandler.remove(document,"click",this.delegateClickHanlder),w.EventHandler.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null,this.popupObj&&(w.EventHandler.remove(this.popupObj.element,"click",this.clickHandler),w.EventHandler.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},T.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},T.prototype.getModuleName=function(){return"breadcrumb"},T.prototype.destroy=function(){var t=this,e=(this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&(this.popupObj.destroy(),this.isPopupCreated=!1,w.detach(this.popupObj.element)),[]),i=["aria-label"];this.cssClass&&e.concat(this.cssClass.split(" ")),this.enableRtl&&e.push("e-rtl"),this.disabled&&(e.push(Bn),i.push(Vn)),"Wrap"===this.overflowMode?e.push(Hn):"Scroll"===this.overflowMode&&e.push(Un),this.unWireEvents(),this.element.innerHTML="",w.removeClass([this.element],e),i.forEach(function(e){t.element.removeAttribute(e)}),Wn.prototype.destroy.call(this)},kn([w.Property("")],T.prototype,"url",void 0),kn([w.Collection([],Fn)],T.prototype,"items",void 0),kn([w.Property("")],T.prototype,"activeItem",void 0),kn([w.Property(-1)],T.prototype,"maxItems",void 0),kn([w.Property("Menu")],T.prototype,"overflowMode",void 0),kn([w.Property("")],T.prototype,"cssClass",void 0),kn([w.Property(null)],T.prototype,"itemTemplate",void 0),kn([w.Property("/")],T.prototype,"separatorTemplate",void 0),kn([w.Property(!0)],T.prototype,"enableNavigation",void 0),kn([w.Property(!1)],T.prototype,"enableActiveItemNavigation",void 0),kn([w.Property(!1)],T.prototype,"disabled",void 0),kn([w.Property("")],T.prototype,"locale",void 0),kn([w.Event()],T.prototype,"beforeItemRender",void 0),kn([w.Event()],T.prototype,"itemClick",void 0),kn([w.Event()],T.prototype,"created",void 0);var Wn,f=kn([w.NotifyPropertyChanges],T);function T(e,t){e=Wn.call(this,e,t)||this;return e.isPopupCreated=!1,e}_n=function(e,t){return(_n=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 _n,zn,kn=function(e,t){function i(){this.constructor=e}_n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},D=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Kn="e-carousel",Xn="e-active",Yn="e-rtl",Gn="e-partial",Qn="e-swipe",Jn="e-carousel-slide-container",Zn="e-carousel-items",$n="e-carousel-item",er="e-previous",tr="e-carousel-navigators",ir="e-carousel-indicators",sr="e-indicator-bars",nr="e-indicator-bar",rr="e-indicator",lr="e-icons",or="e-play-pause",ar="e-play-icon",dr="e-pause-icon",hr="e-previous-button",cr="e-next-button",pr="e-play-button",ur="e-round",mr="e-hover-arrows",fr="e-carousel-hover",gr="e-template",vr="e-carousel-slide-animation",yr="e-carousel-fade-animation",br="e-carousel-custom-animation",Sr="e-carousel-animation-none",Cr="e-prev",Ir="e-next",xr="e-transition-start",Er="e-transition-end",Nr=((Nr=a.CarouselSwipeMode||(a.CarouselSwipeMode={}))[Nr.Touch=1]="Touch",Nr[Nr.Mouse=2]="Mouse",zn=w.ChildProperty,kn(Or,zn),D([w.Property()],Or.prototype,"cssClass",void 0),D([w.Property()],Or.prototype,"interval",void 0),D([w.Property()],Or.prototype,"template",void 0),D([w.Property()],Or.prototype,"htmlAttributes",void 0),Or);function Or(){return null!==zn&&zn.apply(this,arguments)||this}wr=w.Component,kn(P,wr),P.prototype.getModuleName=function(){return Kn.replace("e-","")},P.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},P.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};this.localeObj=new w.L10n(this.getModuleName(),{nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"},this.locale)},P.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},P.prototype.onPropertyChanged=function(e,t){for(var i,s=0,n=Object.keys(e);s<n.length;s++){var r,l=n[s];switch(l){case"animationEffect":this.applyAnimation();break;case"cssClass":w.classList(this.element,[e.cssClass],[t.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,t.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":w.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":this.element.querySelector("."+Zn)&&this.renderTouchActions();break;case"loop":this.loop&&w.isNullOrUndefined(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex),!this.partialVisible&&this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||this.reRenderSlides();break;case"allowKeyboardInteraction":this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),e.allowKeyboardInteraction&&this.renderKeyboardActions();break;case"enableRtl":(r=[].slice.call(this.element.querySelectorAll("."+hr+",\n ."+cr+", ."+pr))).push(this.element),this.enableRtl?w.addClass(r,Yn):w.removeClass(r,Yn),!this.partialVisible&&this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||(r=this.loop?this.getNumOfItems():0,o=this.itemsContainer.firstElementChild.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(o,this.selectedIndex+r));break;case"buttonsVisibility":if(i=this.element.querySelector("."+tr))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),w.remove(i);break;case"VisibleOnHover":w.addClass([].slice.call(i.childNodes),mr);break;case"Visible":w.removeClass([].slice.call(i.childNodes),mr)}else this.renderNavigators(),this.renderPlayButton();break;case"width":w.setStyleAttribute(this.element,{width:w.formatUnit(this.width)});break;case"height":w.setStyleAttribute(this.element,{height:w.formatUnit(this.height)});break;case"autoPlay":this.showPlayButton&&w.isNullOrUndefined(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":case"indicatorsType":(i=this.element.querySelector("."+ir))&&(this.resetTemplates(["indicatorsTemplate"]),w.remove(i)),this.renderIndicators();break;case"showPlayButton":i=this.element.querySelector("."+or),!this.showPlayButton&&i&&(w.remove(i),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":var o="dataSource"===l?this.dataSource:this.items;!w.isNullOrUndefined(o)&&0<o.length&&this.selectedIndex>=o.length&&(this.setActiveSlide(o.length-1,"Previous"),this.autoSlide()),this.reRenderSlides(),this.reRenderIndicators();break;case"partialVisible":this.partialVisible?w.addClass([this.element],Gn):w.removeClass([this.element],Gn),this.reRenderSlides();break;case"swipeMode":w.EventHandler.remove(this.element,"mousedown touchstart",this.swipeStart),w.EventHandler.remove(this.element,"mousemove touchmove",this.swiping),w.EventHandler.remove(this.element,"mouseup touchend",this.swipStop),this.swipeModehandlers(),this.reRenderSlides()}}},P.prototype.reRenderSlides=function(){var e=this.element.querySelector("."+Zn);e&&(this.resetTemplates(["itemTemplate"]),w.remove(e)),this.renderSlides()},P.prototype.reRenderIndicators=function(){var e=this.element.querySelector("."+ir);e&&(this.resetTemplates(["indicatorsTemplate"]),w.remove(e)),this.renderIndicators()},P.prototype.initialize=function(){var e=[];e.push(Kn),this.cssClass&&e.push(this.cssClass),this.enableRtl&&e.push(Yn),this.partialVisible&&e.push(Gn),this.swipeMode!==(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)&&e.push(Qn),w.addClass([this.element],e),w.setStyleAttribute(this.element,{width:w.formatUnit(this.width),height:w.formatUnit(this.height)}),w.attributes(this.element,{role:"group","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),w.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},P.prototype.renderSlides=function(){var i=this,e=this.element.querySelector("."+Jn),e=(e||(e=this.createElement("div",{className:Jn,attrs:{tabindex:"0",role:"tabpanel"}}),this.element.appendChild(e)),this.itemsContainer=this.createElement("div",{className:Zn,attrs:{"aria-live":this.autoPlay?"off":"polite"}}),e.appendChild(this.itemsContainer),this.getNumOfItems()),t=(0<e&&this.loop&&(0<this.items.length?this.items.slice(-e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!w.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(-e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),0<this.items.length?(this.slideItems=this.items,this.items.forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer)})):!w.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer)})),0<e&&this.loop&&(0<this.items.length?this.items.slice(0,e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!w.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(0,e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),this.renderTemplates(),this.itemsContainer.style.setProperty("--carousel-items-count",""+this.itemsContainer.children.length),w.isNullOrUndefined(this.itemsContainer.firstElementChild)?0:this.itemsContainer.firstElementChild.clientWidth),e=(this.itemsContainer.style.transitionProperty="none",this.loop?e:0);this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},P.prototype.getTranslateX=function(e,t){return void 0===t&&(t=1),this.enableRtl?"translateX("+e*t+"px)":"translateX("+-e*t+"px)"},P.prototype.renderSlide=function(e,t,i,s,n){void 0===n&&(n=!1);var r=this.createElement("div",{id:w.getUniqueID("carousel_item"),className:$n+" "+(e.cssClass||"")+" "+(this.selectedIndex!==i||n?"":Xn),attrs:{"aria-hidden":this.selectedIndex!==i||n?"true":"false","data-index":i.toString(),role:"group","aria-roledescription":"slide"}}),i=(n&&r.classList.add("e-cloned"),this.selectedIndex===i&&!n||r.setAttribute("inert","true"),w.isNullOrUndefined(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,r),this.element.id+"_template"),n=this.templateParser(t)(e,this,"itemTemplate",i,!1);w.append(n,r),s.appendChild(r)},P.prototype.renderNavigators=function(){var e;"Hidden"!==this.buttonsVisibility&&(e=this.createElement("div",{className:tr}),this.element.querySelector("."+Jn).insertAdjacentElement("afterend",e),!w.isNullOrUndefined(this.slideItems)&&1<this.slideItems.length&&(this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next")),this.renderTemplates())},P.prototype.renderNavigatorButton=function(e){var t,i,s=this.createElement("div",{className:("Previous"===e?er:"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?mr:"")});"Previous"===e&&this.previousButtonTemplate?(w.addClass([s],gr),i=this.element.id+"_previousButtonTemplate",t=this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",i,!1),w.append(t,s)):"Next"===e&&this.nextButtonTemplate?(w.addClass([s],gr),i=this.element.id+"_nextButtonTemplate",t=this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",i,!1),w.append(t,s)):(i=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide"),type:"button"}}),new R.Button({cssClass:"e-flat "+ur+" "+("Previous"===e?hr:cr),iconCss:lr+" "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(i),s.appendChild(i)),this.element.querySelector("."+tr).appendChild(s),w.EventHandler.add(s,"click",this.navigatorClickHandler,this)},P.prototype.renderPlayButton=function(){var e,t,i,s;w.isNullOrUndefined(this.slideItems)||"Hidden"===this.buttonsVisibility||!this.showPlayButton||this.slideItems.length<=1||(e=this.createElement("div",{className:or+" "+("VisibleOnHover"===this.buttonsVisibility?mr:"")}),this.playButtonTemplate?(w.addClass([e],gr),t=this.element.id+"_playButtonTemplate",t=this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",t,!1),w.append(t,e)):(t=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"),type:"button"}}),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=new R.Button({cssClass:"e-flat "+ur+" "+pr,iconCss:lr+" "+(this.autoPlay&&!s?dr:ar),isToggle:!0,enableRtl:this.enableRtl}),s&&(this.setProperties({autoPlay:!1},!0),t.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),this.itemsContainer.setAttribute("aria-live","polite")),i.appendTo(t),e.appendChild(t)),(s=this.element.querySelector("."+tr)).insertBefore(e,s.lastElementChild),this.renderTemplates(),w.EventHandler.add(e,"click",this.playButtonClickHandler,this))},P.prototype.renderIndicators=function(){var s=this;if(this.showIndicators&&!w.isNullOrUndefined(this.indicatorsType)){var e,t="e-default",t=(this.indicatorsTemplate||(t="e-"+this.indicatorsType.toLowerCase()),this.createElement("div",{className:ir+" "+t})),n=this.createElement("div",{className:sr});if(t.appendChild(n),this.slideItems)switch(this.indicatorsType){case"Fraction":this.indicatorsTemplate?this.renderIndicatorTemplate(n,this.selectedIndex+1):n.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?this.renderIndicatorTemplate(n,this.selectedIndex+1):((e=this.createElement("div",{className:nr})).style.setProperty("--carousel-items-current",""+(this.selectedIndex+1)),e.style.setProperty("--carousel-items-count",""+this.slideItems.length),n.appendChild(e));break;case"Default":case"Dynamic":this.slideItems.forEach(function(e,t){var i=s.createElement("div",{className:nr+" "+(s.selectedIndex===t?Xn:s.selectedIndex-1===t?Cr:s.selectedIndex+1===t?Ir:""),attrs:{"data-index":t.toString(),"aria-current":s.selectedIndex===t?"true":"false"}});i.style.setProperty("--carousel-items-current",""+s.selectedIndex),s.indicatorsTemplate?s.renderIndicatorTemplate(i,t):"Default"===s.indicatorsType&&(t=s.createElement("button",{className:rr,attrs:{type:"button","aria-label":s.localeObj.getConstant("slide")+" "+(t+1)+" "+s.localeObj.getConstant("of")+" "+s.slideItems.length}}),i.appendChild(t),t.appendChild(s.createElement("div",{})),new R.Button({cssClass:"e-flat e-small"}).appendTo(t)),n.appendChild(i),"Default"===s.indicatorsType&&w.EventHandler.add(i,"click",s.indicatorClickHandler,s)})}this.element.appendChild(t)}},P.prototype.renderIndicatorTemplate=function(e,t){void 0===t&&(t=0),w.addClass([e],gr);var i=this.element.id+"_indicatorsTemplate",t=this.templateParser(this.indicatorsTemplate)({index:t,selectedIndex:this.selectedIndex},this,"indicatorsTemplate",i,!1);w.append(t,e)},P.prototype.renderKeyboardActions=function(){this.allowKeyboardInteraction&&(this.keyModule=new w.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}))},P.prototype.renderTouchActions=function(){this.touchModule=new w.Touch(this.element,{swipe:this.swipeHandler.bind(this)})},P.prototype.applyAnimation=function(){switch(w.removeClass([this.element],[br,yr,vr,Sr]),this.animationEffect){case"Slide":w.addClass([this.element],vr);break;case"Fade":w.addClass([this.element],yr);break;case"None":w.addClass([this.element],Sr);break;case"Custom":w.addClass([this.element],br)}},P.prototype.autoSlide=function(){w.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||(this.resetSlideInterval(),this.applySlideInterval())},P.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+$n+"."+Xn)||this.element.querySelector("."+ir+" ."+Xn);w.isNullOrUndefined(e)||(e=parseInt(e.dataset.index,10),this.loop||e!==this.slideItems.length-1?(e=(e+1)%this.slideItems.length,this.element.classList.contains(fr)||this.setActiveSlide(e,"Next"),this.autoSlide()):this.resetSlideInterval())},P.prototype.applySlideInterval=function(){var e,t=this;this.autoPlay&&!this.element.classList.contains(fr)&&(e=this.interval,0<this.items.length&&!w.isNullOrUndefined(this.items[this.selectedIndex||0].interval)&&(e=this.items[this.selectedIndex||0].interval),this.autoSlideInterval=setInterval(function(){return t.autoSlideChange()},e))},P.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},P.prototype.getSlideIndex=function(e){var t=this.selectedIndex||0;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},P.prototype.setActiveSlide=function(s,n,r){var l,o,e,t,a=this;void 0===r&&(r=!1),0<this.element.querySelectorAll("."+$n+"."+Cr+",."+$n+"."+Ir).length||(s=w.isNullOrUndefined(s)?0:s,l=[].slice.call(this.element.querySelectorAll("."+$n+":not(.e-cloned)")),t=this.element.querySelector("."+$n+"."+Xn),w.isNullOrUndefined(t)&&this.showIndicators?(e=this.element.querySelector("."+nr+"."+Xn),e=parseInt(e.dataset.index,10),w.addClass([l[parseInt(e.toString(),10)]],Xn)):w.isNullOrUndefined(t)?w.addClass([l[parseInt(s.toString(),10)]],Xn):(o=parseInt(t.dataset.index,10),e=l[parseInt(s.toString(),10)],t={currentIndex:o,nextIndex:s,currentSlide:t,nextSlide:e,slideDirection:n,isSwiped:r,cancel:!1},this.trigger("slideChanging",t,function(e){var t,i;e.cancel||(a.setProperties({selectedIndex:s},!0),w.attributes(e.currentSlide,{"aria-hidden":"true"}),e.currentSlide.setAttribute("inert","true"),w.attributes(e.nextSlide,{"aria-hidden":"false"}),e.nextSlide.removeAttribute("inert"),a.refreshIndicators(o,s),a.slideChangedEventArgs={currentIndex:e.nextIndex,previousIndex:e.currentIndex,currentSlide:e.nextSlide,previousSlide:e.currentSlide,slideDirection:n,isSwiped:r},t=l[parseInt(s.toString(),10)].clientWidth,i=a.getNumOfItems(),a.isSwipe||(a.itemsContainer.style.transitionDuration="0.6s"),a.isSwipe=!1,"Fade"===a.animationEffect?a.itemsContainer.classList.add("e-fade-in-out"):a.itemsContainer.style.transitionProperty="transform",a.loop?0===a.slideChangedEventArgs.currentIndex&&"Next"===a.slideChangedEventArgs.slideDirection?a.itemsContainer.style.transform=a.getTranslateX(t,l.length+i):a.slideChangedEventArgs.currentIndex===a.slideItems.length-1&&"Previous"===a.slideChangedEventArgs.slideDirection?a.itemsContainer.style.transform=a.partialVisible?a.getTranslateX(t):"translateX(0px)":a.itemsContainer.style.transform=a.getTranslateX(t,s+i):a.itemsContainer.style.transform=a.getTranslateX(t,s),"Slide"===a.animationEffect?"Previous"===n?(w.addClass([e.nextSlide],Cr),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),w.addClass([e.currentSlide,e.nextSlide],Er)):(w.addClass([e.nextSlide],Ir),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),w.addClass([e.currentSlide,e.nextSlide],xr)):"Fade"===a.animationEffect?(w.removeClass([e.currentSlide],Xn),w.addClass([e.nextSlide],Xn)):"Custom"===a.animationEffect?"Previous"===n?(w.addClass([e.nextSlide],Ir),w.addClass([e.currentSlide],Cr)):(w.addClass([e.currentSlide],Cr),w.addClass([e.nextSlide],Ir)):a.onTransitionEnd(),a.handleNavigatorsActions(s))})))},P.prototype.onTransitionEnd=function(){var e,t=this,i=(w.removeClass(this.element.querySelectorAll("."+Zn),"e-fade-in-out"),this.getNumOfItems());this.slideChangedEventArgs&&(this.itemsContainer.style.transitionProperty="none",this.loop&&(0===this.slideChangedEventArgs.currentIndex&&"Next"===this.slideChangedEventArgs.slideDirection||this.slideChangedEventArgs.currentIndex===this.slideItems.length-1&&"Previous"===this.slideChangedEventArgs.slideDirection)&&(e=this.slideChangedEventArgs.currentSlide.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(e,this.slideChangedEventArgs.currentIndex+i)),w.addClass([this.slideChangedEventArgs.currentSlide],Xn),w.removeClass([this.slideChangedEventArgs.previousSlide],Xn),this.trigger("slideChanged",this.slideChangedEventArgs,function(){w.removeClass(t.element.querySelectorAll("."+$n),[Cr,Ir,xr,Er]),t.slideChangedEventArgs=null}))},P.prototype.refreshIndicators=function(e,t){var i=this,s=this.element.querySelector("."+sr);if(!w.isNullOrUndefined(s)){var n=[].slice.call(s.childNodes);switch(this.indicatorsType){case"Default":case"Dynamic":w.attributes(n[parseInt(e.toString(),10)],{"aria-current":"false"}),w.attributes(n[parseInt(t.toString(),10)],{"aria-current":"true"}),w.removeClass(n,[Xn,Cr,Ir]),w.addClass([n[parseInt(t.toString(),10)]],Xn),n[t-1]&&w.addClass([n[t-1]],Cr),n[t+1]&&w.addClass([n[t+1]],Ir),n.forEach(function(e){return e.style.setProperty("--carousel-items-current",""+i.selectedIndex)});break;case"Fraction":this.indicatorsTemplate?(0<s.children.length&&s.removeChild(s.firstElementChild),this.renderIndicatorTemplate(s,t+1)):s.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?(0<s.children.length&&s.removeChild(s.firstElementChild),this.renderIndicatorTemplate(s,t+1)):s.firstElementChild.style.setProperty("--carousel-items-current",""+(this.selectedIndex+1))}}},P.prototype.setHtmlAttributes=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"class"===n?w.addClass([t],e[""+n]):t.setAttribute(n,e[""+n])}},P.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?w.compile(document.querySelector(t).innerHTML.trim()):w.compile(t)}catch(e){return w.compile(t)}},P.prototype.getNavigatorState=function(e,t){e=e.querySelector("."+(t?hr:cr));return!!e&&w.getInstance(e,R.Button).disabled},P.prototype.navigatorClickHandler=function(e){var e=e.currentTarget;this.getNavigatorState(e,e.classList.contains(er))||(e=e.classList.contains(er)?"Previous":"Next",this.setActiveSlide(this.getSlideIndex(e),e),this.autoSlide())},P.prototype.indicatorClickHandler=function(e){e=w.closest(e.target,"."+nr),e=parseInt(e.dataset.index,10);this.selectedIndex!==e&&(this.setActiveSlide(e,this.selectedIndex>e?"Previous":"Next"),this.autoSlide())},P.prototype.playButtonClickHandler=function(e,t){void 0===t&&(t=!1);var i,s=this.element.querySelector("."+pr);s&&(i=w.getInstance(s,R.Button),t||this.setProperties({autoPlay:!this.autoPlay},!0),s.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),i.iconCss=lr+" "+(this.autoPlay?dr:ar),i.dataBind(),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide())},P.prototype.keyHandler=function(e){if(this.allowKeyboardInteraction){var t,i,s=!1,n=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&n.classList.contains(rr)?n.click():n.classList.contains(Kn)||n.classList.contains(pr)?this.playButtonClickHandler(e):n.classList.contains(cr)?this.next():n.classList.contains(hr)&&this.prev();break;case"end":i=this.slideItems.length-1,t="Next",s=!0;break;case"home":t="Previous",s=!(i=0);break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&w.isNullOrUndefined(this.indicatorsTemplate)&&this.element.focus(),t="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",i=this.getSlideIndex(t),s=!this.isSuspendSlideTransition(i,t)}s&&(this.setActiveSlide(i,t),this.autoSlide())}},P.prototype.swipeHandler=function(e){var t;this.element.classList.contains(fr)||w.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||(t=e.startEvents?e.startEvents.toString():null)&&(this.swipeMode===a.CarouselSwipeMode.Mouse&&t.includes("Touch")||this.swipeMode===a.CarouselSwipeMode.Touch&&t.includes("Mouse"))||(t="Right"===e.swipeDirection?"Previous":"Next",e=this.getSlideIndex(t),this.isSuspendSlideTransition(e,t))||(this.setActiveSlide(e,t,!0),this.autoSlide())},P.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},P.prototype.handleNavigatorsActions=function(e){var t,i,s,n;"Hidden"!==this.buttonsVisibility&&(this.showPlayButton&&(t=this.element.querySelector("."+pr),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=w.isNullOrUndefined(this.playButtonTemplate)&&t&&s,i=w.isNullOrUndefined(this.playButtonTemplate)&&t&&!s?!t.classList.contains(Xn):i)&&(this.setProperties({autoPlay:!s},!0),t.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),(n=w.getInstance(t,R.Button)).iconCss=lr+" "+(this.autoPlay?dr:ar),n.dataBind()),(i=this.element.querySelector("."+hr))&&w.isNullOrUndefined(this.previousButtonTemplate)&&((n=w.getInstance(i,R.Button)).disabled=!this.loop&&0===e,n.dataBind()),s=this.element.querySelector("."+cr))&&w.isNullOrUndefined(this.nextButtonTemplate)&&((n=w.getInstance(s,R.Button)).disabled=!this.loop&&e===this.slideItems.length-1,n.dataBind())},P.prototype.onHoverActions=function(e){var t=this.element.querySelector("."+tr);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&t&&w.removeClass([].slice.call(t.childNodes),mr),this.pauseOnHover&&w.addClass([this.element],fr);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&t&&w.addClass([].slice.call(t.childNodes),mr),w.removeClass([this.element],fr),this.isSwipe&&this.swipStop()}this.autoSlide()},P.prototype.onFocusActions=function(e){switch(e.type){case"focusin":w.addClass([this.element],fr);break;case"focusout":w.removeClass([this.element],fr)}this.autoSlide()},P.prototype.destroyButtons=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<t.length;e++){var i=t[e],i=w.getInstance(i,R.Button);i&&i.destroy()}},P.prototype.getNumOfItems=function(){return this.partialVisible?2:1},P.prototype.getTranslateValue=function(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0},P.prototype.swipeStart=function(e){this.timeStampStart||(this.timeStampStart=Date.now()),e.preventDefault(),this.isSwipe=!1,this.itemsContainer.classList.add("e-swipe-start"),this.prevPageX=(e.touches?e.touches[0]:e).pageX,this.initialTranslate=this.getTranslateValue(this.itemsContainer)},P.prototype.swiping=function(e){this.itemsContainer.classList.contains("e-swipe-start")&&(this.isSwipe=!0,e.preventDefault(),e=(e.touches?e.touches[0]:e).pageX,e=this.prevPageX-e,!this.loop&&(this.enableRtl&&(0===this.selectedIndex&&0<e||this.selectedIndex===this.itemsContainer.childElementCount-1&&e<0)||!this.enableRtl&&(0===this.selectedIndex&&e<0||this.selectedIndex===this.itemsContainer.childElementCount-1&&0<e))||(this.itemsContainer.style.transform="translateX("+(this.initialTranslate+(this.enableRtl?e:-e))+"px)"))},P.prototype.swipStop=function(){var e=Date.now()-this.timeStampStart,t=(t=this.getTranslateValue(this.itemsContainer)-this.initialTranslate)<0?-1*t:t;this.isSwipe&&(i=t*(w.Browser.isDevice?6:1.66),this.itemsContainer.style.transitionDuration=(w.Browser.isDevice?t:i)/e/10+"s");var t=this.itemsContainer.firstElementChild.clientWidth/2,i=(this.itemsContainer.classList.remove("e-swipe-start"),this.getTranslateValue(this.itemsContainer));i-this.initialTranslate<-t?this.swipeNavigation(!this.enableRtl):i-this.initialTranslate>t?this.swipeNavigation(this.enableRtl):(this.itemsContainer.style.transform="translateX("+this.initialTranslate+"px)","Fade"===this.animationEffect&&this.itemsContainer.classList.add("e-fade-in-out"))},P.prototype.swipeNavigation=function(e){e?this.next():this.prev()},P.prototype.swipeModehandlers=function(){(this.swipeMode&a.CarouselSwipeMode.Touch)===a.CarouselSwipeMode.Touch&&(w.EventHandler.add(this.itemsContainer,"touchstart",this.swipeStart,this),w.EventHandler.add(this.itemsContainer,"touchmove",this.swiping,this),w.EventHandler.add(this.itemsContainer,"touchend",this.swipStop,this)),(this.swipeMode&a.CarouselSwipeMode.Mouse)===a.CarouselSwipeMode.Mouse&&(w.EventHandler.add(this.itemsContainer,"mousedown",this.swipeStart,this),w.EventHandler.add(this.itemsContainer,"mousemove",this.swiping,this),w.EventHandler.add(this.itemsContainer,"mouseup",this.swipStop,this)),0===this.swipeMode&&(this.swipeMode&a.CarouselSwipeMode.Mouse&a.CarouselSwipeMode.Touch)==(a.CarouselSwipeMode.Mouse&a.CarouselSwipeMode.Touch)&&(w.EventHandler.add(this.itemsContainer,"mousedown touchstart",this.swipeStart,this),w.EventHandler.add(this.itemsContainer,"mousemove touchmove",this.swiping,this),w.EventHandler.add(this.itemsContainer,"mouseup touchend",this.swipStop,this))},P.prototype.resizeHandler=function(){var e,t;this.itemsContainer&&this.itemsContainer.firstElementChild&&(e=this.getNumOfItems(),t=this.itemsContainer.firstElementChild.clientWidth,this.loop?this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e):this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex))},P.prototype.wireEvents=function(){"Custom"!==this.animationEffect&&this.swipeModehandlers(),w.EventHandler.add(this.element,"focusin focusout",this.onFocusActions,this),w.EventHandler.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),w.EventHandler.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),w.EventHandler.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this),w.EventHandler.add(window,"resize",this.resizeHandler,this)},P.prototype.unWireEvents=function(){var t=this;[].slice.call(this.element.querySelectorAll("."+nr)).forEach(function(e){w.EventHandler.remove(e,"click",t.indicatorClickHandler)});[].slice.call(this.element.querySelectorAll("."+er+",.e-next")).forEach(function(e){w.EventHandler.remove(e,"click",t.navigatorClickHandler)});var e=this.element.querySelector("."+or);e&&w.EventHandler.remove(e,"click",this.playButtonClickHandler),w.EventHandler.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),w.EventHandler.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),w.EventHandler.clearEvents(this.element),w.EventHandler.clearEvents(this.itemsContainer),w.EventHandler.remove(window,"resize",this.resizeHandler)},P.prototype.prev=function(){var e;!this.loop&&0===this.selectedIndex||(e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1,this.setActiveSlide(e,"Previous"),this.autoSlide())},P.prototype.next=function(){var e;!this.loop&&this.selectedIndex===this.slideItems.length-1||(e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1,this.setActiveSlide(e,"Next"),this.autoSlide())},P.prototype.play=function(){var e=this.element.querySelector("."+ar);this.showPlayButton&&e&&(w.classList(e,[dr],[ar]),this.element.querySelector("."+pr).setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))),this.setProperties({autoPlay:!0},!0),this.itemsContainer.setAttribute("aria-live","off"),this.applySlideInterval()},P.prototype.pause=function(){var e=this.element.querySelector("."+dr);this.showPlayButton&&e&&(this.element.querySelector("."+pr).setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),w.classList(e,[ar],[dr])),this.setProperties({autoPlay:!1},!0),this.itemsContainer.setAttribute("aria-live","off"),this.resetSlideInterval()},P.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},P.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},P.prototype.destroy=function(){var t=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(e){t.element.removeChild(e)}),w.removeClass([this.element],[Kn,this.cssClass,Yn,Qn]),["role","style"].forEach(function(e){t.element.removeAttribute(e)}),this.itemsContainer=null,wr.prototype.destroy.call(this)},D([w.Collection([],Nr)],P.prototype,"items",void 0),D([w.Property("Slide")],P.prototype,"animationEffect",void 0),D([w.Property()],P.prototype,"previousButtonTemplate",void 0),D([w.Property()],P.prototype,"nextButtonTemplate",void 0),D([w.Property()],P.prototype,"indicatorsTemplate",void 0),D([w.Property()],P.prototype,"playButtonTemplate",void 0),D([w.Property()],P.prototype,"cssClass",void 0),D([w.Property([])],P.prototype,"dataSource",void 0),D([w.Property()],P.prototype,"itemTemplate",void 0),D([w.Property(0)],P.prototype,"selectedIndex",void 0),D([w.Property("100%")],P.prototype,"width",void 0),D([w.Property("100%")],P.prototype,"height",void 0),D([w.Property(5e3)],P.prototype,"interval",void 0),D([w.Property(!0)],P.prototype,"autoPlay",void 0),D([w.Property(!0)],P.prototype,"pauseOnHover",void 0),D([w.Property(!0)],P.prototype,"loop",void 0),D([w.Property(!1)],P.prototype,"showPlayButton",void 0),D([w.Property(!0)],P.prototype,"enableTouchSwipe",void 0),D([w.Property(!0)],P.prototype,"allowKeyboardInteraction",void 0),D([w.Property(!0)],P.prototype,"showIndicators",void 0),D([w.Property("Default")],P.prototype,"indicatorsType",void 0),D([w.Property("Visible")],P.prototype,"buttonsVisibility",void 0),D([w.Property(!1)],P.prototype,"partialVisible",void 0),D([w.Property(a.CarouselSwipeMode.Touch)],P.prototype,"swipeMode",void 0),D([w.Property()],P.prototype,"htmlAttributes",void 0),D([w.Event()],P.prototype,"slideChanging",void 0),D([w.Event()],P.prototype,"slideChanged",void 0);var wr,kn=D([w.NotifyPropertyChanges],P);function P(e,t){e=wr.call(this,e,t)||this;return e.isSwipe=!1,e}kr=function(e,t){return(kr=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 kr,Lr,D=function(e,t){function i(){this.constructor=e}kr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ar=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Tr="e-appbar",Dr="e-horizontal-bottom",Pr="e-sticky",Mr="e-prominent",Hr="e-dense",Ur="e-rtl",Rr="e-light",Br="e-primary",Vr="e-inherit",D=(Lr=w.Component,D(jr,Lr),jr.prototype.destroy=function(){Lr.prototype.destroy.call(this),this.element.classList.remove(Tr),this.element.removeAttribute("style"),this.element.removeAttribute("role")},jr.prototype.getModuleName=function(){return"appbar"},jr.prototype.getPersistData=function(){return this.addOnPersist([])},jr.prototype.preRender=function(){},jr.prototype.render=function(){this.element.classList.add(Tr),"HEADER"!==this.element.tagName&&this.element.setAttribute("role","banner"),this.cssClass&&w.addClass([this.element],this.cssClass.split(" ")),"Bottom"===this.position&&this.element.classList.add(Dr),this.isSticky&&this.element.classList.add(Pr),this.enableRtl&&this.element.classList.add(Ur),this.setHeightMode(),this.setColorMode(),w.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},jr.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"mode":w.removeClass([this.element],[Hr,Mr]),this.setHeightMode();break;case"position":"Bottom"===this.position?w.addClass([this.element],Dr):w.removeClass([this.element],Dr);break;case"cssClass":t.cssClass&&w.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&w.addClass([this.element],e.cssClass.split(" "));break;case"isSticky":this.isSticky?w.addClass([this.element],Pr):w.removeClass([this.element],Pr);break;case"htmlAttributes":if(!w.isNullOrUndefined(this.htmlAttributes)){if(!w.isNullOrUndefined(t.htmlAttributes))for(var n=0,r=Object.keys(t.htmlAttributes);n<r.length;n++){var l=r[n];"class"===l?w.removeClass([this.element],t.htmlAttributes[""+l]):this.element.removeAttribute(l)}this.setHtmlAttributes(e.htmlAttributes,this.element)}break;case"colorMode":w.removeClass([this.element],["e-dark",Br,Vr,Rr]),this.setColorMode();break;case"enableRtl":this.enableRtl?w.addClass([this.element],Ur):w.removeClass([this.element],Ur)}},jr.prototype.setHtmlAttributes=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"class"===n?w.addClass([t],e[""+n]):t.setAttribute(n,e[""+n])}},jr.prototype.setHeightMode=function(){"Prominent"===this.mode?this.element.classList.add(Mr):"Dense"===this.mode&&this.element.classList.add(Hr)},jr.prototype.setColorMode=function(){switch(this.colorMode){case"Light":this.element.classList.add(Rr);break;case"Dark":this.element.classList.add("e-dark");break;case"Primary":this.element.classList.add(Br);break;case"Inherit":this.element.classList.add(Vr)}},Ar([w.Property("Regular")],jr.prototype,"mode",void 0),Ar([w.Property("Top")],jr.prototype,"position",void 0),Ar([w.Property()],jr.prototype,"cssClass",void 0),Ar([w.Property(!1)],jr.prototype,"isSticky",void 0),Ar([w.Property()],jr.prototype,"htmlAttributes",void 0),Ar([w.Property("Light")],jr.prototype,"colorMode",void 0),Ar([w.Event()],jr.prototype,"created",void 0),Ar([w.Event()],jr.prototype,"destroyed",void 0),Ar([w.NotifyPropertyChanges],jr));function jr(e,t){return Lr.call(this,e,t)||this}Fr=function(e,t){return(Fr=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 Fr,qr,Ar=function(e,t){function i(){this.constructor=e}Fr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},Wr="--progress-position",_r="e-vertical",zr="e-horizontal",Kr="e-stepper-steps",Xr=((Xr=a.StepStatus||(a.StepStatus={})).NotStarted="NotStarted",Xr.InProgress="InProgress",Xr.Completed="Completed",qr=w.ChildProperty,Ar(Yr,qr),M([w.Property("")],Yr.prototype,"cssClass",void 0),M([w.Property(!1)],Yr.prototype,"disabled",void 0),M([w.Property("")],Yr.prototype,"iconCss",void 0),M([w.Property(null)],Yr.prototype,"isValid",void 0),M([w.Property("")],Yr.prototype,"label",void 0),M([w.Property(!1)],Yr.prototype,"optional",void 0),M([w.Property(a.StepStatus.NotStarted)],Yr.prototype,"status",void 0),M([w.Property("")],Yr.prototype,"text",void 0),Yr);function Yr(){return null!==qr&&qr.apply(this,arguments)||this}(Qr=a.StepperOrientation||(a.StepperOrientation={})).Horizontal="Horizontal",Qr.Vertical="Vertical";Gr=w.Component,Ar(Jr,Gr),Jr.prototype.preRender=function(){},Jr.prototype.getModuleName=function(){return"stepperBase"},Jr.prototype.getPersistData=function(){return this.addOnPersist([])},Jr.prototype.render=function(){},Jr.prototype.updateOrientaion=function(e){(e.classList.contains(zr)||e.classList.contains(_r))&&e.classList.remove(zr,_r),w.isNullOrUndefined(this.orientation)||e.classList.add("e-"+this.orientation.toLocaleLowerCase())},Jr.prototype.renderProgressBar=function(e){this.progressStep=this.createElement("div",{className:"e-stepper-progressbar"}),this.progressbar=this.createElement("div",{className:"e-progressbar-value"});var t,i=e.querySelector("li").querySelector(".e-step-label-container");this.progressStep.appendChild(this.progressbar),e.prepend(this.progressStep),this.progressbar.style.setProperty("--progress-value","0%"),e.classList.contains(_r)&&(e.classList.contains("e-label-bottom")||e.classList.contains("e-label-top")?(t=e.querySelector("."+Kr),this.progressStep.style.setProperty(Wr,t.offsetWidth/2+"px")):this.progressStep.style.setProperty(Wr,this.progressBarPosition/2-1+"px")),i&&i.classList.contains("e-label-before")&&this.progressStep.style.setProperty(Wr,this.progressBarPosition-1+5+"px"),e.classList.contains(zr)&&this.setProgressPosition(e)},Jr.prototype.setProgressPosition=function(e,t){var i=e.querySelector(".e-step-container"),s=i.firstElementChild,i=(!0!==t&&(t=0,t=e.classList.contains("e-label-before")?i.offsetParent.offsetHeight-s.offsetHeight/2-1:s.offsetHeight/2,this.progressStep.style.setProperty("--progress-top-position",t+"px")),e.querySelector("."+Kr).lastChild.firstChild);e.classList.contains("e-rtl")?(t=s.offsetLeft+s.offsetWidth-e.querySelector("."+Kr).offsetWidth,this.progressStep.style.setProperty("--progress-left-position",Math.abs(t)+"px"),this.progressStep.style.setProperty("--progress-bar-width",Math.abs(i.offsetLeft-s.offsetLeft)+"px")):(this.progressStep.style.setProperty("--progress-left-position",s.offsetLeft+1+"px"),this.progressStep.style.setProperty("--progress-bar-width",i.offsetWidth+i.offsetLeft-2-(s.offsetLeft+2)+"px"))},Jr.prototype.onPropertyChanged=function(e,t){},M([w.Collection([],Xr)],Jr.prototype,"steps",void 0),M([w.Property("")],Jr.prototype,"cssClass",void 0),M([w.Property(!1)],Jr.prototype,"readOnly",void 0),M([w.Property(a.StepperOrientation.Horizontal)],Jr.prototype,"orientation",void 0),M([w.Event()],Jr.prototype,"created",void 0);var Gr,Qr=M([w.NotifyPropertyChanges],Jr);function Jr(e,t){return Gr.call(this,e,t)||this}Zr=function(e,t){return(Zr=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 Zr,$r,Ar=function(e,t){function i(){this.constructor=e}Zr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(l=(r<3?n(l):3<r?n(t,i,l):n(t,i))||l);return 3<r&&l&&Object.defineProperty(t,i,l),l},el="e-indicator",tl="e-step-text-container",il="e-step-selected",sl="e-step-inprogress",nl="e-step-notstarted",rl="e-step-focus",ll="e-step-completed",ol="e-step-disabled",al="e-stepper-readonly",dl="--progress-value",hl="e-rtl",cl="e-step-template",pl="e-label-after",ul="e-label-before",ml="e-vertical",fl="e-horizontal",gl="e-step-item",vl="e-step-text",yl="e-text",bl="e-step-label",Sl="e-label",Cl="e-step-type-indicator",Il="e-step-type-label",xl="e-step-indicator",El="e-stepper-tooltip",Nl="e-linear",Ol=($r=w.ChildProperty,Ar(wl,$r),M([w.Property(!0)],wl.prototype,"enable",void 0),M([w.Property(2e3)],wl.prototype,"duration",void 0),M([w.Property(0)],wl.prototype,"delay",void 0),wl);function wl(){return null!==$r&&$r.apply(this,arguments)||this}(Ll=a.StepLabelPosition||(a.StepLabelPosition={})).Top="Top",Ll.Bottom="Bottom",Ll.Start="Start",Ll.End="End",(Ll=a.StepType||(a.StepType={})).Default="Default",Ll.Label="Label",Ll.Indicator="Indicator";Ar(H,kl=Qr),H.prototype.preRender=function(){this.element.id||(this.element.id=w.getUniqueID("e-"+this.getModuleName()));this.l10n=new w.L10n("stepper",{optional:"Optional"},this.locale),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space",enter:"enter",home:"home",end:"end",tab:"tab",shiftTab:"shift+tab",escape:"escape"},this.tooltipOpen=!1},H.prototype.getModuleName=function(){return"stepper"},H.prototype.render=function(){this.initialize(),this.navigationHandler(this.activeStep,null,!1),this.updateStepperStatus(!0)},H.prototype.initialize=function(){this.element.setAttribute("aria-label",this.element.id),this.updatePosition(),this.stepperItemList=this.createElement("ol",{className:"e-stepper-steps"}),this.updateOrientaion(this.element),this.updateStepType(),this.element.appendChild(this.stepperItemList),this.cssClass&&w.addClass([this.element],this.cssClass.trim().split(" ")),this.readOnly&&this.element.classList.add(al),this.enableRtl&&this.element.classList.add(hl),this.wireEvents(),this.updateTemplateFunction(),this.renderItems(),0<this.steps.length&&(this.initiateProgressBar(),this.checkValidStep(),this.updateAnimation(),this.updateTooltip(),this.wireKeyboardEvent())},H.prototype.initiateProgressBar=function(){var e=this;1<this.steps.length&&(this.isAngular&&this.template?setTimeout(function(){e.renderProgressBar(e.element)}):this.renderProgressBar(this.element))},H.prototype.updatePosition=function(){this.progressBarPosition=this.beforeLabelWidth=this.textEleWidth=0},H.prototype.renderDefault=function(e){e=this.steps[parseInt(e.toString(),10)];return!e.iconCss&&!e.text&&!e.label},H.prototype.updateAnimation=function(){var e=this.element.querySelector(".e-progressbar-value");this.animation.enable?0<=this.animation.delay&&e&&e.style.setProperty("--delay",this.animation.delay+"ms"):e&&(e.style.setProperty("--delay","0ms"),e.style.setProperty("--duration","0ms"))},H.prototype.updateStepType=function(){var e;w.isNullOrUndefined(this.stepType)||(e=this.stepType.toLowerCase(),-1!==["indicator","label","default"].indexOf(e)&&("default"!==e&&this.element.classList.add("e-step-type-"+e),"indicator"!==e&&"label"!==e||!this.labelContainer||this.clearLabelPosition()))},H.prototype.wireEvents=function(){this.windowEventHandlers={},this.windowEventHandlers.resize=this.updateResize.bind(this),this.windowEventHandlers.click=this.updateStepFocus.bind(this),w.EventHandler.add(window,"resize",this.windowEventHandlers.resize),w.EventHandler.add(window,"click",this.windowEventHandlers.click)},H.prototype.unWireEvents=function(){w.EventHandler.remove(window,"resize",this.windowEventHandlers&&this.windowEventHandlers.resize),w.EventHandler.remove(window,"click",this.windowEventHandlers&&this.windowEventHandlers.click),this.windowEventHandlers&&(this.windowEventHandlers.resize=null,this.windowEventHandlers.click=null,this.windowEventHandlers=null)},H.prototype.updateResize=function(){this.stepperItemList&&this.progressbar&&this.element.classList.contains(fl)&&this.setProgressPosition(this.element,!0),this.navigateToStep(this.activeStep,null,null,!1,!1)},H.prototype.updateStepFocus=function(){var e;this.isKeyNavFocus&&(this.isKeyNavFocus=!1,e=this.element.querySelector("."+rl))&&(e.classList.remove(rl),this.element.classList.remove("e-steps-focus"))},H.prototype.updateStepperStatus=function(e){for(var t=0;t<this.steps.length;t++){var i=this.steps[parseInt(t.toString(),10)],s=i.status.toLowerCase();if(e&&0===this.activeStep&&0===t&&(l=this.isProtectedOnChange,this.isProtectedOnChange=!0,i.status=a.StepStatus.InProgress,this.isProtectedOnChange=l),i&&"notstarted"!==s&&t===this.activeStep)for(var n=0;n<this.steps.length;n++){var r=this.stepperItemElements[parseInt(n.toString(),10)],l=(r.classList.remove(il,sl,ll,nl),this.isProtectedOnChange);this.isProtectedOnChange=!0,"completed"===s?this.updateStatusClass(n,t,r):this.updateStatusClass(n,t,r,!0),this.isProtectedOnChange=l}else i&&"notstarted"!==s&&t!==this.activeStep&&this.navigationHandler(this.activeStep,null,!0)}},H.prototype.updateStatusClass=function(e,t,i,s){var n=this.steps[parseInt(e.toString(),10)];e<t?(i.classList.add(ll),n.status=a.StepStatus.Completed):e===t?i.classList.add(s?sl:ll,il):i.classList.add(nl)},H.prototype.renderItems=function(){for(var t=this,e=this.element.classList.contains(fl),i=this.element.classList.contains(ml),s=w.isNullOrUndefined(this.labelPosition)?"":this.labelPosition.toLowerCase(),n=0;n<this.steps.length;n++){this.stepperItemContainer=this.createElement("li",{className:"e-step-container"});var r,l,o,a=this.createElement("span",{className:"e-step"}),d=this.steps[parseInt(n.toString(),10)],h=!!d.label,c=!!d.text,p=this.element.classList.contains(Cl),c=(this.stepperItemContainer.classList[0===n?"add":"remove"](il,sl),this.stepperItemContainer.classList[0!==n?"add":"remove"](nl),e&&this.stepperItemContainer.style.setProperty("--max-width",100/this.steps.length+"%"),this.renderDefault(n)&&(w.isNullOrUndefined(this.template)||""===this.template)?((r=!this.element.classList.contains("e-step-type-default")&&"indicator"===this.stepType.toLowerCase())&&a.classList.add("e-icons",xl),r||null!=d.isValid||(a.classList.add("e-step-content"),a.innerHTML=(n+1).toString()),this.stepperItemContainer.appendChild(a)):!w.isNullOrUndefined(this.template)&&""!==this.template||(r=!0,!(d.iconCss||!d.iconCss&&c&&h)||(c||h)&&this.element.classList.contains(Il)||(d.iconCss?(o=d.iconCss.trim().split(" "),(l=a.classList).add.apply(l,[el].concat(o)),this.stepperItemContainer.classList.add(gl)):!d.iconCss&&c&&h&&(a.classList.add(el),a.innerHTML=d.text,this.stepperItemContainer.classList.add(gl)),this.stepperItemContainer.appendChild(a),(e&&("start"===s||"end"===s)&&h||i&&("top"===s||"bottom"===s)&&h)&&!p&&(this.element.classList.add("e-label-"+s),this.createTextLabelElement(d.label),r=!1)),!c||d.iconCss&&p||!r||d.iconCss&&h||(!d.iconCss&&p||(!d.iconCss||this.element.classList.contains(Il))&&!h?(d.iconCss||h||this.element.classList.add("e-step-type-indicator"),this.checkValidState(d,a),h=!1):(h||this.createTextLabelElement(d.text),h&&this.element.classList.contains(Il)&&(this.createElement("span",{className:yl}).innerText=d.label),c=!h)),!h)||d.iconCss&&p||!r||(d.iconCss||c||!p?(!this.element.classList.contains(Il)||!c||this.element.classList.contains(Il)&&h)&&(this.createTextLabelElement(d.label,!0),this.updateLabelPosition(),(d.iconCss||c||this.stepperItemContainer.classList.contains(gl))&&!this.element.classList.contains(Il)||(this.stepperItemContainer.classList.add("e-step-label-only"),null!==d.isValid&&(l=this.createElement("span",{className:"e-step-validation-icon e-icons"}),this.labelContainer.appendChild(l)))):this.checkValidState(d,a,!0)),d.optional&&(o=this.createElement("span",{className:"e-step-label-optional"}),this.l10n.setLocale(this.locale),p=this.l10n.getConstant("optional"),o.innerText=p,(h&&this.labelContainer&&(this.element.classList.contains(pl)&&!this.stepperItemContainer.classList.contains("e-step-label-only")||e&&this.element.classList.contains(ul)&&!this.stepperItemContainer.classList.contains("e-step-label-only"))||i&&this.element.classList.contains(ul)?this.labelContainer:this.stepperItemContainer).appendChild(o),null!==d.isValid)&&this.stepperItemContainer.classList.add(d.isValid?"e-step-valid":"e-step-error"),d.cssClass&&w.addClass([this.stepperItemContainer],d.cssClass.trim().split(" ")),d.disabled&&(this.stepperItemContainer.classList[d.disabled?"add":"remove"](ol),w.attributes(this.stepperItemContainer,{tabindex:"-1","aria-disabled":"true"})),null!==d.isValid&&(d.isValid?this.stepperItemContainer.classList.add("e-step-valid"):this.stepperItemContainer.classList.add("e-step-error")),this.renderItemContent(n,!1),this.stepperItemContainer.classList.contains(sl)?w.attributes(this.stepperItemContainer,{tabindex:"0","aria-current":"true"}):w.attributes(this.stepperItemContainer,{tabindex:"-1"}),this.wireItemsEvents(this.stepperItemContainer,n),this.stepperItemElements.push(this.stepperItemContainer),{element:this.stepperItemContainer,index:n});this.trigger("beforeStepRender",c,function(e){t.stepperItemList.appendChild(e.element)}),i&&(this.isAngular&&this.template?setTimeout(function(){t.calculateProgressBarPosition()}):this.calculateProgressBarPosition())}if(i&&this.element.classList.contains(ul))for(var u=this.stepperItemList.querySelectorAll("."+Sl),m=0;m<u.length;m++)u[parseInt(m.toString(),10)].style.setProperty("--label-width",this.beforeLabelWidth+5+"px")},H.prototype.createTextLabelElement=function(e,t){var i=this.createElement("span",{className:(t=void 0===t?!1:t)?Sl:tl+" "+yl});i.innerText=e,(t?(this.labelContainer=this.createElement("span",{className:"e-step-label-container"}),this.labelContainer):this.stepperItemContainer).appendChild(i),this.stepperItemContainer.classList.add(t?bl:vl)},H.prototype.calculateProgressBarPosition=function(){var e=!!this.element.classList.contains(ul),t=this.stepperItemContainer.classList.contains(gl)&&!this.stepperItemContainer.classList.contains(vl)&&!this.stepperItemContainer.classList.contains(bl),i=this.stepperItemContainer.querySelector("."+tl);i&&(this.textEleWidth=this.textEleWidth<i.offsetWidth?i.offsetWidth:this.textEleWidth),e?(i=this.stepperItemContainer.querySelector("."+Sl).offsetWidth+15,this.beforeLabelWidth=Math.max(this.beforeLabelWidth,i),e=this.element.querySelector("ol").lastChild.querySelector("."+el),i=this.stepperItemContainer.querySelector("."+tl),e||i?(e=this.beforeLabelWidth+(this.stepperItemContainer.querySelector("."+el)||i).offsetWidth/2,this.progressBarPosition=Math.max(this.progressBarPosition,e)):this.progressBarPosition=Math.max(this.progressBarPosition,this.beforeLabelWidth/2)):(i=this.element.querySelector("ol").lastChild,e=(t?this.stepperItemContainer:i.firstChild).offsetWidth,this.progressBarPosition=Math.max(this.progressBarPosition,e))},H.prototype.checkValidState=function(e,t,i){null==e.isValid?(t.classList.add("e-step-content"),t.innerHTML=i?e.label:e.label||e.text,this.stepperItemContainer.appendChild(t)):(t.classList.add(el),this.stepperItemContainer.appendChild(t),this.stepperItemContainer.classList.add(gl))},H.prototype.updateCurrentLabel=function(){var e=this.labelPosition.toLowerCase();return this.element.classList.contains(fl)?"top"===e?"before":"bottom"===e?"after":e:"start"===e?"before":"end"===e?"after":e},H.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.labelContainer.classList.add("e-label-"+this.updateCurrentLabel()),"start"===this.labelPosition.toLowerCase()&&"vertical"===this.orientation.toLowerCase()&&this.stepperItemContainer.firstChild?this.stepperItemContainer.firstChild.before(this.labelContainer):this.stepperItemContainer.appendChild(this.labelContainer),this.element.classList.add("e-label-"+this.updateCurrentLabel())},H.prototype.clearLabelPosition=function(){var e=this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);e&&(w.removeClass([this.labelContainer],e),w.removeClass([this.element],e))},H.prototype.checkValidStep=function(){for(var a=this.element.classList.contains(Cl),d=this,e=0;e<this.steps.length;e++)!function(e){var t,i,s,n,r,l=d.steps[parseInt(e.toString(),10)],o=d.stepperItemElements[parseInt(e.toString(),10)];null!==l.isValid&&(r=void 0,a&&!l.iconCss?r=o.querySelector("."+el):t=o.querySelector("."+el),!r&&a&&d.renderDefault(e)&&(r=o.querySelector("."+xl)),i=o.querySelector(".e-step-validation-icon"),l=l.iconCss.trim().split(" "),n=(s=o.classList.contains("e-step-valid"))?"e-check":"e-circle-info",r&&(r.classList.remove(xl),""!==r.innerHTML&&(r.innerHTML=""),r.classList.add("e-icons",n,el)),d.renderDefault(e)&&!a&&o.querySelector(".e-step").classList.add("e-icons",n,el),t&&(""!==t.innerHTML?t.innerHTML="":0<l.length&&l.forEach(function(e){t.classList.remove(e)}),t.classList.add("e-icons",n)),i)&&(i.classList.add(s?"e-circle-check":"e-circle-info"),d.element.classList.contains(ml))&&(r=o.querySelector("."+Sl),l=(e=o.querySelector("."+yl))?e.offsetWidth+e.getBoundingClientRect().left:r.offsetWidth+r.getBoundingClientRect().left,o.querySelector(".e-step-validation-icon").style.setProperty("--icon-position",l+20+"px"))}(e)},H.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new U.Tooltip({target:".e-step-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?El+" "+this.cssClass:El,position:"TopCenter"}),this.tooltipObj.appendTo(this.stepperItemList)):w.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},H.prototype.wireItemsEvents=function(e,t){w.EventHandler.add(e,"click",this.linearModeHandler.bind(this,e,t),this),w.EventHandler.add(e,"mouseover",this.openStepperTooltip.bind(this,t),this),w.EventHandler.add(e,"mouseleave",this.closeStepperTooltip,this)},H.prototype.unWireItemsEvents=function(){for(var e=0;e<this.steps.length;e++){var t=this.stepperItemElements[parseInt(e.toString(),10)];w.EventHandler.remove(t,"click",this.linearModeHandler.bind(this,t,e)),w.EventHandler.remove(t,"mouseover",this.openStepperTooltip.bind(this,e)),w.EventHandler.remove(t,"mouseleave",this.closeStepperTooltip)}},H.prototype.linearModeHandler=function(e,t,i){var s;this.linear&&(s=t-this.activeStep,1!==Math.abs(s))||this.stepClickHandler(t,i,e)},H.prototype.openStepperTooltip=function(e){var t=this.steps[parseInt(e.toString(),10)];this.showTooltip&&(t.label||t.text)&&!this.tooltipOpen&&(this.updateTooltipContent(e),this.tooltipObj.open(this.stepperItemElements[parseInt(e.toString(),10)]),"label"!==this.stepType.toLocaleLowerCase()&&("indicator"===this.stepType.toLocaleLowerCase()||""!==t.label&&""!==t.iconCss||null===t.label&&""===t.iconCss&&""!==t.text)&&(e="inprogress"===t.status.toLowerCase()?El+" e-step-inprogress-tip "+(this.cssClass||""):El+" "+(this.cssClass||""),this.tooltipObj.setProperties({cssClass:e.trim()})),this.tooltipOpen=!0)},H.prototype.closeStepperTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},H.prototype.updateTooltipContent=function(e){var t,i,s;this.showTooltip&&(this.isReact&&this.clearTemplate(["stepperTooltipTemplate"]),t=void 0,e=this.steps[parseInt(e.toString(),10)],this.tooltipTemplate?(t=this.createElement("span",{className:"e-stepper-tooltip-content"}),i=this.getTemplateFunction(this.tooltipTemplate),w.append(i({value:e},this,"stepperTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),t),this.tooltipObj.setProperties({content:t},!0)):(s=e.label||e.text,this.tooltipObj.setProperties({content:w.initializeCSPTemplate(function(){return s})},!0)),this.renderReactTemplates())},H.prototype.stepClickHandler=function(e,t,i){var s={element:i,event:t,previousStep:this.activeStep,activeStep:e};this.trigger("stepClick",s),this.navigateToStep(e,t,i,!0)},H.prototype.updateTemplateFunction=function(){this.templateFunction=this.template?this.getTemplateFunction(this.template):null},H.prototype.renderItemContent=function(e,t){var i,s=this.stepperItemList.querySelectorAll("li");t&&this.removeItemContent(s[parseInt(e.toString(),10)]),this.template&&((t?s[parseInt(e.toString(),10)]:this.stepperItemContainer).classList.add(cl),i=this.steps[parseInt(e.toString(),10)],w.append(this.templateFunction({step:i,currentStep:e},this,"stepperTemplate",this.element.id+"_stepperTemplate",this.isStringTemplate),t?s[parseInt(e.toString(),10)]:this.stepperItemContainer)),this.renderReactTemplates()},H.prototype.removeItemContent=function(e){e.classList.remove(cl);for(var t=e.firstElementChild,i=0;i<e.childElementCount;i++)t.remove()},H.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["stepperTemplate"]);for(var e=0;e<this.steps.length;e++)this.renderItemContent(e,!0)},H.prototype.getTemplateFunction=function(t){if("string"!=typeof t)return w.compile(t);var i="";try{var e=w.select(t),i=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return w.compile(i)},H.prototype.navigateToStep=function(t,i,s,n,e){var r,l=this,o={element:s,event:i,isInteracted:n,previousStep:this.activeStep,activeStep:t,cancel:!1};!1!==e?(r=this.activeStep,this.trigger("stepChanging",o,function(e){e.cancel||(l.navigationHandler(t),e={element:s,event:i,isInteracted:n,previousStep:r,activeStep:l.activeStep},l.trigger("stepChanged",e))})):this.navigationHandler(t)},H.prototype.navigationHandler=function(e,t,i){e!==this.activeStep&&this.progressbar&&(this.progressbar.style.transitionDuration=this.animation.duration+"ms"),e=Math.min(e,this.steps.length-1);var s=this.stepperItemElements.length,s=(0<=e&&e<s-1&&(e=this.stepperItemElements[parseInt(e.toString(),10)].classList.contains(ol)?this.activeStep:e),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.activeStep=parseInt(e.toString(),10),this.isProtectedOnChange=s;for(var n=0;n<this.steps.length;n++){var r=this.stepperItemElements[parseInt(n.toString(),10)],l=this.steps[parseInt(n.toString(),10)],o=(r.classList.remove(il,sl,ll,nl),n===this.activeStep&&r.classList.add(il),0<=this.activeStep&&this.progressbar?this.element.classList.contains(fl)?this.calculateProgressbarPos():this.progressbar.style.setProperty(dl,100/(this.steps.length-1)*e+"%"):this.activeStep<0&&this.progressbar&&this.progressbar.style.setProperty(dl,"0%"),n===this.activeStep?r.classList.add(sl):0<this.activeStep&&n<this.activeStep?r.classList.add(ll):r.classList.add(nl),r.classList.contains(sl)?w.attributes(r,{tabindex:"0","aria-current":"true"}):w.attributes(r,{tabindex:"-1","aria-current":"false"}),this.isProtectedOnChange);!(this.isProtectedOnChange=!0)!==i&&(n<this.activeStep||this.steps.length-1===this.activeStep&&"completed"===l.status.toLowerCase()?l.status=a.StepStatus.Completed:n===this.activeStep?l.status=a.StepStatus.InProgress:n>this.activeStep&&(l.status=a.StepStatus.NotStarted),t&&this.activeStep===n&&(l.status=t),"completed"===l.status.toLowerCase()&&(r.classList.remove(il,sl,nl),r.classList.add(ll)),"notstarted"===l.status.toLowerCase())&&(r.classList.remove(il,sl,ll),r.classList.add(nl)),this.isProtectedOnChange=o,this.updateIndicatorStatus(n,r)}this.updateStepInteractions(),this.progressbar&&(this.progressbar.style.transitionDuration="0ms")},H.prototype.calculateProgressbarPos=function(){var e,i,s,t,n,r=this;(this.element.classList.contains(ul)||this.element.classList.contains(pl))&&!this.element.classList.contains(Cl)&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(gl)?(n=this.element.querySelector(".e-stepper-progressbar"),t=this.stepperItemElements[parseInt(this.activeStep.toString(),10)].firstChild,e=0===this.activeStep?0:(t.offsetLeft-n.offsetLeft+t.offsetWidth/2)/n.offsetWidth*100,this.element.classList.contains(hl)&&(e=(n.getBoundingClientRect().right-t.getBoundingClientRect().right+t.offsetWidth/2)/n.offsetWidth*100),this.progressbar.style.setProperty(dl,e+"%")):(s=i=0,this.stepperItemElements.forEach(function(e,t){e=e.offsetWidth;i+=e,t<=r.activeStep&&(s+=t===r.activeStep&&0!==t?e/2:e)}),t=(this.stepperItemList.offsetWidth-i)/(this.stepperItemElements.length-1),n=(s+t*this.activeStep)/this.stepperItemList.offsetWidth*100,this.progressbar.style.setProperty(dl,n+"%"))},H.prototype.updateIndicatorStatus=function(e,t){this.renderDefault(e)&&this.element.classList.contains(Cl)&&!t.classList.contains("e-step-valid")&&!t.classList.contains("e-step-error")&&(t.classList.contains(ll)?(t.firstChild.classList.remove("e-icons","e-step-indicator"),t.firstChild.classList.add(el,"e-icons","e-check")):(t.classList.contains(sl)||t.classList.contains(nl))&&(t.firstChild.classList.remove(el,"e-icons","e-check"),t.firstChild.classList.add("e-icons","e-step-indicator")))},H.prototype.updateStepInteractions=function(){var i=this;this.element.classList.toggle(Nl,this.linear),this.stepperItemElements.forEach(function(e,t){e.classList.toggle("e-previous",t===i.activeStep-1),e.classList.toggle("e-next",t===i.activeStep+1)})},H.prototype.removeItemElements=function(){for(var e=0;e<this.stepperItemElements.length;e++)w.remove(this.stepperItemElements[parseInt(e.toString(),10)]);this.stepperItemElements=[]},H.prototype.nextStep=function(){this.activeStep!==this.steps.length-1&&this.navigateToStep(this.activeStep+1,null,null,!1)},H.prototype.previousStep=function(){0<this.activeStep&&this.navigateToStep(this.activeStep-1,null,null,!1)},H.prototype.reset=function(){var e;0===this.activeStep?this.updateStepInteractions():(e=!!this.stepperItemElements[0].classList.contains(ol),this.navigateToStep(e?-1:0,null,null,!1))},H.prototype.refreshProgressbar=function(){this.stepperItemList&&this.progressbar&&this.setProgressPosition(this.element),this.navigateToStep(this.activeStep,null,null,!1,!1)},H.prototype.updateElementClassArray=function(){w.removeClass([this.element],[hl,al,"e-steps-focus",pl,ul,"e-label-top","e-label-bottom","e-label-start","e-label-end",Cl,Il,ml,fl,Nl])},H.prototype.destroy=function(){kl.prototype.destroy.call(this),this.unWireEvents(),this.unWireItemsEvents(),this.removeItemElements(),this.clearTemplate(),this.stepperItemList&&w.remove(this.stepperItemList),this.stepperItemList=null,this.progressStep&&w.remove(this.progressStep),this.progressStep=null,this.progressbar=null,this.progressBarPosition=null,this.stepperItemContainer=null,this.textContainer=null,this.labelContainer=null,this.updateElementClassArray(),this.element.removeAttribute("aria-label"),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),this.keyboardModuleStepper&&this.keyboardModuleStepper.destroy(),this.keyboardModuleStepper=null},H.prototype.wireKeyboardEvent=function(){this.keyboardModuleStepper=new w.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},H.prototype.keyActionHandler=function(e){if(!this.readOnly)switch(e.action){case"uparrow":case"downarrow":case"leftarrow":case"rightarrow":case"tab":case"shiftTab":this.handleNavigation(this.enableRtl&&this.element.classList.contains(fl)?"leftarrow"===e.action||"tab"===e.action||"uparrow"===e.action:"rightarrow"===e.action||"tab"===e.action||"downarrow"===e.action,e);break;case"space":case"enter":case"escape":this.handleNavigation(null,e);break;case"home":case"end":this.handleNavigation(null,e,this.enableRtl)}},H.prototype.handleNavigation=function(e,t,i){this.isKeyNavFocus=!0,this.element.classList.add("e-steps-focus");var s=(s=this.element.querySelector("."+rl))||this.element.querySelector("."+il),n=Array.prototype.slice.call(this.stepperItemList.children),r=n.indexOf(s);if("tab"===t.action||"shiftTab"===t.action||"downarrow"===t.action||"uparrow"===t.action||"space"===t.action||"home"===t.action||"end"===t.action)if("tab"===t.action&&r===n.length-1||"shiftTab"===t.action&&0===r){if(s.classList.contains(rl))return void this.updateStepFocus()}else t.preventDefault();if("escape"===t.action&&(n[parseInt(r.toString(),10)].classList.remove(rl),this.element.classList.remove("e-steps-focus")),"space"!==t.action&&"enter"!==t.action){for(var s=r,r=e?r+1:r-1;0<=r&&r<n.length&&n[parseInt(r.toString(),10)].classList.contains(ol);)r=e?r+1:r-1;r=r<0?0:r>n.length-1?n.length-1:r,n[parseInt(s.toString(),10)].classList.contains(rl)&&n[parseInt(s.toString(),10)].classList.remove(rl),0<=(r="home"!==t.action&&"end"!==t.action?r:"home"===t.action?i?n.length-1:0:i?0:n.length-1)&&r<n.length&&n[parseInt(r.toString(),10)].classList.add(rl)}else"space"!==t.action&&"enter"!==t.action||(s=!1,this.linear&&(i=this.activeStep-r,1!==Math.abs(i))||(this.navigateToStep(r,null,null,!0),s=!0),s&&(this.updateStepFocus(),this.stepperItemElements[r].focus()))},H.prototype.renderStepperItems=function(e,t){this.updateElementClassArray(),this.removeItemElements(),this.element.querySelector(".e-stepper-progressbar").remove(),e&&this.updatePosition(),t&&this.updateStepType(),this.readOnly&&!this.element.classList.contains(al)&&this.element.classList.add(al),this.enableRtl&&!this.element.classList.contains(hl)&&this.element.classList.add(hl),this.updateOrientaion(this.element),this.renderItems(),this.renderProgressBar(this.element),this.checkValidStep(),this.updateAnimation(),this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},H.prototype.updateDynamicSteps=function(e,t){if(e instanceof Array&&t instanceof Array)this.renderStepperItems(!0,!0);else for(var i=Object.keys(e),s=0;s<i.length;s++)for(var n=parseInt(Object.keys(e)[s],10),r=Object.keys(e[n]).length,l=0;l<r;l++){var o=Object.keys(e[n])[l];"status"===o?this.activeStep===n?this.navigationHandler(n,e[n].status):this.steps[n].status=t[n].status:(this.removeItemElements(),this.renderItems(),this.updateStepperStatus()),"label"===o&&(this.steps[n].iconCss||this.steps[n].text)&&"default"===this.stepType.toLowerCase()&&this.refreshProgressbar(),this.updateStepInteractions(),this.checkValidStep()}},H.prototype.updateDynamicActiveStep=function(e,t){this.activeStep=e>this.steps.length-1||e<-1?t:this.activeStep,0<=this.activeStep&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(ol)&&(this.activeStep=t),this.linear?(e=t-this.activeStep,1===Math.abs(e)&&this.navigateToStep(this.activeStep,null,null,!0)):this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},H.prototype.updateDynamicCssClass=function(e,t){t&&w.removeClass([this.element],t.trim().split(" ")),e&&w.addClass([this.element],e.trim().split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?El+" "+this.cssClass:El})},H.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"steps":this.updateDynamicSteps(e.steps,t.steps);break;case"orientation":this.updateOrientaion(this.element),this.renderStepperItems(!0);break;case"activeStep":this.updateDynamicActiveStep(e.activeStep,t.activeStep);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"](hl);break;case"readOnly":this.element.classList[this.readOnly?"add":"remove"](al);break;case"cssClass":this.updateDynamicCssClass(e.cssClass,t.cssClass);break;case"labelPosition":this.renderStepperItems(!0);break;case"showTooltip":this.updateTooltip();break;case"stepType":this.renderStepperItems(!0,!0);break;case"template":this.updateTemplateFunction(),this.updateContent();break;case"animation":this.updateAnimation();break;case"linear":this.updateStepInteractions()}},M([w.Property(0)],H.prototype,"activeStep",void 0),M([w.Complex({},Ol)],H.prototype,"animation",void 0),M([w.Property(!1)],H.prototype,"linear",void 0),M([w.Property(!1)],H.prototype,"showTooltip",void 0),M([w.Property("")],H.prototype,"template",void 0),M([w.Property("")],H.prototype,"tooltipTemplate",void 0),M([w.Property(a.StepLabelPosition.Bottom)],H.prototype,"labelPosition",void 0),M([w.Property(a.StepType.Default)],H.prototype,"stepType",void 0),M([w.Event()],H.prototype,"stepChanged",void 0),M([w.Event()],H.prototype,"stepChanging",void 0),M([w.Event()],H.prototype,"stepClick",void 0),M([w.Event()],H.prototype,"beforeStepRender",void 0);var kl,Ll=M([w.NotifyPropertyChanges],H);function H(e,t){e=kl.call(this,e,t)||this;return e.stepperItemElements=[],e}a.Accordion=e,a.AccordionActionSettings=ei,a.AccordionAnimationSettings=si,a.AccordionItem=li,a.ActionSettings=tn,a.AppBar=D,a.Breadcrumb=f,a.BreadcrumbItem=Fn,a.Carousel=kn,a.CarouselItem=Nr,a.ContextMenu=n,a.FieldSettings=je,a.FieldsSettings=Zs,a.HScroll=te,a.Header=rs,a.Item=Ot,a.Menu=q,a.MenuAnimationSettings=Ke,a.MenuItem=We,a.NodeAnimationSettings=rn,a.Sidebar=c,a.Step=Xr,a.Stepper=Ll,a.StepperAnimationSettings=Ol,a.StepperBase=Qr,a.Tab=fi,a.TabActionSettings=$i,a.TabAnimationSettings=is,a.TabItem=as,a.Toolbar=Lt,a.TreeView=o,a.VScroll=ge,a.addScrolling=ve,a.destroyScroll=be,Object.defineProperty(a,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-navigations.umd.min.js.map
|