UNPKG

@syncfusion/ej2-navigations

Version:

A package of Essential JS 2 navigation components such as Tree-view, Tab, Toolbar, Context-menu, and Accordion which is used to navigate from one page to another

10 lines 432 kB
/*! * filename: ej2-navigations.umd.min.js * version : 31.1.20 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !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")):"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"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Lists,e.ej2Popups,e.ej2Buttons,e.ej2Data,e.ej2Inputs)}(this,function(a,E,U,g,R,x,B){"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,q,F=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",V="e-overlay",_="e-nav-arrow",z="e-nav-right-arrow",K="e-nav-left-arrow",X="e-scroll-nav",Y="e-scroll-right-nav",G="e-scroll-left-nav",Q="e-scroll-device",J="e-scroll-overlay",Z="e-scroll-right-overlay",$="e-scroll-left-overlay",ee=(q=E.Component,F(t,q),t.prototype.preRender=function(){this.browser=E.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=E.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=E.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(W)},t.prototype.render=function(){this.touchModule=new E.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),E.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add(Q),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},t.prototype.setScrollState=function(){E.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(Q),e.classList.remove(W),E.selectAll(".e-"+e.id+"_nav."+X,e)),i=E.selectAll("."+J,e);[].slice.call(i).forEach(function(e){E.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"),E.detach(this.scrollEle),0<t.length&&(E.detach(t[0]),E.isNullOrUndefined(t[1])||E.detach(t[1])),E.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,q.prototype.destroy.call(this)},t.prototype.disable=function(t){var e=E.selectAll(".e-scroll-nav:not(."+V+")",this.element);t?this.element.classList.add(V):this.element.classList.remove(V),[].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:J+" "+Z}),s="e-"+e.id.concat("_nav "+X+" "+Y),t=this.createElement("div",{id:t.concat("_right"),className:s}),s=this.createElement("div",{className:z+" "+_+" e-icons"}),s=(t.appendChild(s),this.createElement("div",{className:J+" "+$}));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 "+X+" "+Y),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:z+" "+_+" e-icons"})),n="e-"+e.id.concat("_nav "+X+" "+G),t={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},n=this.createElement("div",{className:n+" "+V,attrs:t}),t=(n.setAttribute("aria-disabled","true"),this.createElement("div",{className:K+" "+_+" 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 E.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()}),E.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,X)?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(X)&&(n=t.querySelector("."+_).classList),this.contains(s,W)&&this.browserCheck&&(e=-e),!this.contains(s,W)||this.browserCheck||this.ieCheck?n.contains(z)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains(K)?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(E.selectAll("."+J,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=(E.isNullOrUndefined(e)?t:e).querySelector("."+_),E.isNullOrUndefined(e)?E.classList(i,[z],[K]):E.classList(i,[K],[z])):e&&t&&(e.classList.add(V),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(V),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},t.prototype.scrollHandler=function(e){var e=e.target,t=e.offsetWidth,i=(this.element,this.element.querySelector("."+G)),s=this.element.querySelector("."+Y),n=this.element.querySelector("."+$),r=this.element.querySelector("."+Z),l=e.scrollLeft;l<=0&&(l=-l),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(n=this.element.querySelector("."+Z),r=this.element.querySelector("."+$)),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("."+X+"."+V))&&(n.classList.remove(V),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([E.Property(null)],t.prototype,"scrollStep",void 0),e([E.NotifyPropertyChanges],t));function t(e,t){return q.call(this,e,t)||this}te=function(e,t){return(te=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 te,ie,F=function(e,t){function i(){this.constructor=e}te(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},se="e-rtl",ne="e-overlay",re="e-nav-arrow",le="e-nav-up-arrow",oe="e-nav-down-arrow",ae="e-scroll-nav",de="e-scroll-up-nav",he="e-scroll-down-nav",ce="e-scroll-device",pe="e-scroll-overlay",ue="e-scroll-up-overlay",me="e-scroll-down-overlay",fe=(ie=E.Component,F(i,ie),i.prototype.preRender=function(){this.browser=E.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=E.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=E.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(se)},i.prototype.render=function(){this.touchModule=new E.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),E.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(ce),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),E.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){E.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){for(var e=E.createElement("div",{className:"e-vscroll-content"}),t=E.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="",E.removeClass([this.element],["e-vscroll",ce,se]),E.selectAll(".e-"+e.id+"_nav."+ae,e)),i=E.selectAll("."+pe,e);[].slice.call(i).forEach(function(e){E.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"),E.detach(this.scrollEle),0<t.length&&(E.detach(t[0]),E.isNullOrUndefined(t[1])||E.detach(t[1])),E.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,ie.prototype.destroy.call(this)},i.prototype.disable=function(t){var e=E.selectAll(".e-scroll-nav:not(."+ne+")",this.element);t?this.element.classList.add(ne):this.element.classList.remove(ne),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},i.prototype.createOverlayElement=function(e){var t=e.id.concat("_nav"),i=E.createElement("div",{className:pe+" "+me}),s="e-"+e.id.concat("_nav "+ae+" "+he),t=E.createElement("div",{id:t.concat("down"),className:s}),s=E.createElement("div",{className:oe+" "+re+" e-icons"}),s=(t.appendChild(s),E.createElement("div",{className:pe+" "+ue}));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 "+ae+" "+he),i=E.createElement("div",{id:t.concat("_down"),className:i}),s=(i.setAttribute("aria-disabled","false"),E.createElement("div",{className:oe+" "+re+" e-icons"})),n="e-"+e.id.concat("_nav "+ae+" "+de),t=E.createElement("div",{id:t.concat("_up"),className:n+" "+ne}),n=(t.setAttribute("aria-disabled","true"),E.createElement("div",{className:le+" "+re+" 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 E.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()}),E.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,ae)?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(ae)?t.querySelector("."+re).classList:s).contains(oe)?this.frameScrollRequest(e,"add",i):s.contains(le)&&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(E.selectAll("."+pe,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=(E.isNullOrUndefined(e)?t:e).querySelector("."+re),E.isNullOrUndefined(e)?E.classList(i,[oe],[le]):E.classList(i,[le],[oe])):(e.classList.add(ne),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(ne),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("."+de),s=this.element.querySelector("."+he),n=this.element.querySelector("."+ue),r=this.element.querySelector("."+me),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("."+ae+"."+ne))&&(n.classList.remove(ne),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(se):this.element.classList.remove(se)}},e([E.Property(null)],i.prototype,"scrollStep",void 0),e([E.NotifyPropertyChanges],i));function i(e,t){return ie.call(this,e,t)||this}function ge(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?ve(e,t,i,s,n,r):o&&(o=o.getBoundingClientRect().width)<l&&"hscroll"===s?(t.style.maxWidth=(a=o)+"px",ve(e,t,i,s,n,r)):i}function ve(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 fe({enableRtl:n},e).scrollStep=E.select(".e-"+s+"-bar",t).offsetHeight/2:new ee({enableRtl:n},e).scrollStep=E.select(".e-"+s+"-bar",t).offsetWidth,e}function ye(e,t,i){var s;e&&((s=E.select(".e-menu-parent",t))?i&&i!==s||(e.destroy(),t.parentElement.appendChild(s),E.detach(t)):(e.destroy(),E.detach(t)))}be=function(e,t){return(be=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 be,Ce,F=function(e,t){function i(){this.constructor=e}be(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},Se="enter",Ie="escape",v="e-focused",Ee="e-menu-header",y="e-selected",xe="e-separator",Ne="uparrow",Oe="downarrow",we="leftarrow",Le="rightarrow",ke="home",Ae="end",Te="tab",Pe="e-caret",De="e-menu-item",Me="e-disabled",He="e-menu-hide",Ue="e-icons",Re="e-rtl",Be="e-menu-popup",je=(Ce=E.ChildProperty,F(qe,Ce),e([E.Property("id")],qe.prototype,"itemId",void 0),e([E.Property("parentId")],qe.prototype,"parentId",void 0),e([E.Property("text")],qe.prototype,"text",void 0),e([E.Property("iconCss")],qe.prototype,"iconCss",void 0),e([E.Property("url")],qe.prototype,"url",void 0),e([E.Property("separator")],qe.prototype,"separator",void 0),e([E.Property("items")],qe.prototype,"children",void 0),qe);function qe(){return null!==Ce&&Ce.apply(this,arguments)||this}Fe=E.ChildProperty,F(Ve,Fe),e([E.Property(null)],Ve.prototype,"iconCss",void 0),e([E.Property("")],Ve.prototype,"id",void 0),e([E.Property(!1)],Ve.prototype,"separator",void 0),e([E.Collection([],Ve)],Ve.prototype,"items",void 0),e([E.Property("")],Ve.prototype,"text",void 0),e([E.Property("")],Ve.prototype,"url",void 0),e([E.Property()],Ve.prototype,"htmlAttributes",void 0);var Fe,We=Ve;function Ve(){return null!==Fe&&Fe.apply(this,arguments)||this}_e=E.ChildProperty,F(Ke,_e),e([E.Property("SlideDown")],Ke.prototype,"effect",void 0),e([E.Property(400)],Ke.prototype,"duration",void 0),e([E.Property("ease")],Ke.prototype,"easing",void 0);var _e,ze=Ke;function Ke(){return null!==_e&&_e.apply(this,arguments)||this}Xe=E.Component,F(s,Xe),s.prototype.preRender=function(){if(this.isMenu||(i=void 0,"EJS-CONTEXTMENU"===this.element.tagName?(i=this.createElement("ul",{id:E.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()}),t=E.getValue("ej2_instances",this.element),E.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=i,E.setValue("ej2_instances",t,this.element)):(i=this.createElement("ul",{id:E.getUniqueID(this.getModuleName())}),E.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=E.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),E.detach(e),e=i,s.appendChild(e),E.setValue("ej2_instances",t,e),this.clonedElement=s,this.element=e,this.element.id||(this.element.id=E.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(){ge(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;E.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):document.body.appendChild(e)),this.cssClass&&E.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&e.classList.add(Re),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},s.prototype.renderItems=function(){this.items.length||(e=U.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}}),this.setProperties({items:e},!0),E.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="");var e=this.createItems(this.items);E.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")?ge(this.createElement,e,this.element,"vscroll",this.enableRtl):ge(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=E.selectAll(this.target),s=0,n=i.length;s<n;s++)t=i[s],this.isMenu?E.EventHandler.add(t,"click",this.menuHeaderClickHandler,this):E.Browser.isIos?new E.Touch(t,{tapHold:this.touchHandler.bind(this)}):E.EventHandler.add(t,"contextmenu",this.cmenuHandler,this);if(this.targetElement=t,!this.isMenu){E.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this);for(var r=0,l=g.getScrollableParent(this.targetElement);r<l.length;r++){var o=l[r];E.EventHandler.add(o,"scroll",this.scrollHandler,this)}}}E.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),E.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),E.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this),E.EventHandler.add(document,"keydown",this.domKeyHandler,this),this.isMenu)||this.target||E.EventHandler.add(document,"scroll",this.scrollHandler,this),this.delegateClickHandler=this.clickHandler.bind(this),E.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=E.rippleEffect(e,{selector:"."+De}),!this.isMenu&&this.enableScrolling&&(this.enableTouchScroll(e),document.addEventListener("touchstart",this.touchOutsideHandler.bind(this),{passive:!0}))},s.prototype.wireKeyboardEvent=function(e){var t={downarrow:Oe,uparrow:Ne,enter:Se,leftarrow:we,rightarrow:Le,escape:Ie};this.isMenu&&(t.home=ke,t.end=Ae,t.tab=Te),new E.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:t})},s.prototype.mouseDownHandler=function(e){E.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||E.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=Ie,this.leftEscKeyHandler(e))},s.prototype.keyBoardHandler=function(e){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([v,y],[E.closest(i,".e-"+this.getModuleName()+"-wrapper")]),this.isKBDAction=!0,s)switch(e.action){case Le:t=Le,e.action=Oe;break;case we:t=we,e.action=Ne;break;case Oe:t=Oe,e.action=Le;break;case Ne:t=Ne,e.action=""}else if(this.enableRtl)switch(e.action){case we:s=!0,t=we,e.action=Le;break;case Le:s=!0,t=Le,e.action=we}switch(e.action){case Oe:case Ne:case Ae:case ke:case Te:this.upDownKeyHandler(e);break;case Le:this.rightEnterKeyHandler(e);break;case we:this.leftEscKeyHandler(e);break;case Se: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===Oe||e.action===ke||e.action===Te?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,v),n=(n&&(e.action!==Ae&&e.action!==ke&&(s=this.getIdx(t,n)),n.classList.remove(v),e.action!==Ae)&&e.action!==ke&&(e.action===Oe?s++:s--,s===(e.action===Oe?t.childElementCount:-1))&&(s=i),t.children[s]),s=this.isValidLI(n,s,e.action);t.children[s].classList.add(v),t.children[s].focus()},s.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx(),n=i===Oe||i===ke||i===Te?0:s.childElementCount-1;return(e.classList.contains(xe)||e.classList.contains(Me)||e.classList.contains(He))&&(i===Oe&&t===s.childElementCount-1||i===Ne&&0===t?t=n:i===Oe||i===Le||"tab"===i&&e.classList.contains(xe)?t++:t--),t=(e=s.children[t])&&(e.classList.contains(xe)||e.classList.contains(Me)||e.classList.contains(He))?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(E.selectAll("."+Be)))[e],i=[],E.selectAll("."+Be).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],E.isNullOrUndefined(t)?null:E.select(".e-menu-parent",t)):document.body.contains(this.element)||0!==e?this.getWrapper().children[e]:null},s.prototype.rightEnterKeyHandler=function(e){var t=this.getUlByNavIdx(),i=this.getLIByClass(t,v);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===Se){this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([y],[this.getWrapper()]):i.classList.remove(v),i.classList.add(y),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(),y);t&&(t.classList.add(v),t.focus())}}},s.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):e.action===Ie&&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.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?E.select(".e-ul",i[n-2]):E.selectAll(".e-menu-parent",c)[n-1],this.isMenu&&u.classList.contains("e-menu")&&((e=this.getLIByClass(u,y))&&e.classList.remove(y),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=E.closest(u,"."+Be),f.hamburgerMode&&(t.parentElement.style.minHeight="",E.closest(u,".e-menu-item").setAttribute("aria-expanded","false")),f.unWireKeyboardEvent(t),ye(E.getInstance(t.children[0],fe),t.children[0]),(l=E.getInstance(t,g.Popup)).hide(),n=t.id,l.destroy(),E.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||(E.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"))?E.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&&E.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&&E.closest(a.target,".e-menu-parent.e-control")?f.closeMenu(0,a):r&&!f.isMenu&&E.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,y))&&(i.setAttribute("aria-expanded","false"),i.classList.remove(y),e.isFocused&&m||"left"===f.keyType)&&(i.classList.add(v),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")&&(E.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(E.isNullOrUndefined(e))return null;E.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("."+Be)).forEach(function(e){!E.isNullOrUndefined(e.querySelector("."+De))&&t.getIndex(e.querySelector("."+De).id,!0).length&&i.push(e)}),i},s.prototype.isMenuVisible=function(){return 0<this.navIdx.length||this.element.classList.contains("e-contextmenu")&&E.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(E.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,E.isNullOrUndefined(i)&&(i=-1),E.isNullOrUndefined(s)&&(s=-1),e?(this.uList=this.createItems(t[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&E.Browser.isDevice&&(a.lastChild.style.display="none",l={text:t[this.getField("text")].toString(),iconCss:Ue+" e-previous"},this.template&&(t.iconCss=(t.iconCss||"")+Ue+" 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 "+Be,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):document.body).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&&E.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=g.getZindexPartial(r||this.element).toString(),E.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 g.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=E.select(".e-menu-vscroll",r.element),e=(e&&(e.style.height="inherit",e.style.maxHeight=""),E.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?E.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 g.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&&ge(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(),E.detach(a.popupWrapper)):-1<n.className.indexOf("e-ul")&&E.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),E.rippleEffect(a.popupWrapper,{selector:"."+De}),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),E.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(v),a.isMenu&&1===a.navIdx.length&&a.removeLIStateByClass([y],[a.getWrapper()]),s.classList.add(y),a.action===Se&&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(v),t.children[i].focus())})},s.prototype.collision=function(){var e,t=g.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=E.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth,this.left=this.enableRtl?g.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-e+2),(-1<(t=g.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=E.isNullOrUndefined(e)?this.element:E.closest(e.target,"."+De),(i=E.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=g.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=g.isCollide(t,null,s,i)).indexOf("left")&&(s=(o=this.callFit(t,!0,!1,i,s)).left)):E.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=g.calculatePosition(e,r,"top")).top,s=o.left,(r=-1<(l=g.isCollide(t,null,this.enableRtl?s-t.offsetWidth:s,i)).indexOf("left")||-1<l.indexOf("right"))&&(s=(o=g.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.enableScrolling&&t&&(t.style.height="",t.style.top="",t.style.left="",t.style.width="",t.style.position="");var r,l,o,e=E.closest(this.element,".e-"+this.getModuleName()+"-wrapper");!this.isMenu&&this.enableScrolling&&t&&e&&0<e.offsetHeight?(r=E.closest(t,".e-menu-vscroll"),t.style.display="block",r&&ye(E.getInstance(r,fe),r),l=Math.ceil(this.getMenuWidth(t,t.offsetWidth,this.enableRtl)),o=ge(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]]=E.getUniqueID("menuitem")),E.isNullOrUndefined(e.curData.htmlAttributes)&&Object.defineProperty(e.curData,"htmlAttributes",{value:{},writable:!0,enumerable:!0,configurable:!0}),E.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(xe),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:Ue+" "+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"),U.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?E.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([v,y],[this.getWrapper()]),!this.navIdx.length)return;l=!0}i&&E.closest(i,".e-"+this.getModuleName()+"-wrapper")&&!l?(this.removeLIStateByClass([v],this.isMenu?[s].concat(this.getPopups()):[s]),this.removeLIStateByClass([v],this.isMenu?[n].concat(this.getPopups()):[n]),i.classList.add(v),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!l&&this.removeLIStateByClass([v],[s].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||t.parentElement===s||E.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([v],[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=E.closest(this.liTrgt,".e-menu-vscroll"),"DIV"===this.liTrgt.tagName)&&e&&this.removeLIStateByClass([v,y],[e])},s.prototype.removeLIStateByClass=function(e,i){for(var s,t=0;t<i.length;t++)!function(t){e.forEach(function(e){(s=E.select("."+e,i[t]))&&s.classList.remove(e)})}(t)},s.prototype.getField=function(e,t){void 0===t&&(t=0);e=this.fields[""+e];ret