"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),ee={props:["data"]},te=Object.assign(ee,{__name:"HeaderItem",setup(t){const n=e.inject("getSlotByName")("headerItem");return(i,r)=>{var l,s,c;return e.unref(n)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n)),{key:0,header:t.data.header},null,8,["header"])):(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:["vsss-header",(l=t.data)!=null&&l.class?(s=t.data)==null?void 0:s.class:""]},(c=t.data)==null?void 0:c.attributes),e.toDisplayString(t.data.header),17))}}}),L=(t,o)=>{const n=t.__vccOpts||t;for(const[i,r]of o)n[i]=r;return n},ne={name:"MenuItemIcon",props:{icon:{default:""}}};function ie(t,o,n,i,r,l){var s,c,u,m;return e.openBlock(),e.createBlock(e.resolveDynamicComponent((s=n.icon)!=null&&s.element?n.icon.element:"i"),e.mergeProps({class:["menu-icon",(c=n.icon)!=null&&c.class?(u=n.icon)==null?void 0:u.class:""],"aria-hidden":"true"},(m=n.icon)==null?void 0:m.attributes),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.icon.text),1)]),_:1},16,["class"])}const oe=L(ne,[["render",ie]]),le={name:"menu-item",components:{MenuItemIconVue:oe},data:()=>({showChildren:!1,expanded:!1,containerHeight:"0",hieghtTimeout:null,renderTimeOut:null,renderChildren:!1,cacheHieght:null,active:!1,miniActive:!1,hover:!1,ContainerOffsetY:0,id:null,siblingsHaveIcon:!1,MakeSpace:!1,TopcontainerHiefht:"fit-content",labelMiniYofsset:0,labelMiniYYofsset:0,miniMenuOffset:50,seTAnimationTimeOut:!1,topConTime:null}),props:["smallMenu","header","depth","siblingsHaveIconProp","isParentFlat","item","isMakeSpace","setMaxHeightTopCProp"],setup(){const t=e.inject("getSlotByName"),{animationDuration:o,menuType:n,widthMiniMenu:i,childrenOpenAnimation:r,removeIconSpace:l,vueRouterEnabel:s,keepChildrenOpen:c,checkButtonActive:u,ChildrenOpenActiveRoute:m,collapsed:a,closeOpenMenuOnHrefPush:p,position:v,keepOneMenuOpenAtAtime:h}=e.inject("sidebarProps"),C=e.inject("browserAgent"),k=e.inject("currentRoute"),g=e.inject("isSameUrl"),f=e.inject("extractChildrenRoutes"),N=e.inject("menuMounted"),D=e.inject("miniMenu"),V=e.inject("MenuScroll"),x=e.inject("MenuHover"),H=e.inject("getRandomUid"),y=e.inject("updateCurrantItemHover"),B=e.inject("updateCurranContainerHover"),I=e.inject("CurrantItemHover"),M=e.inject("menuDirection"),O=e.inject("emitOut"),S=e.inject("updateIsCollapsed"),w=e.inject("routerPushBlockList"),T=e.inject("pushToRouterPush"),A=e.inject("symbolId");let j=t("itemApendIcon"),E=t("itemPrepandIcon"),F=t("menuItemLabel");return{animationDuration:o,pushToRouterPush:T,symbolId:A,routerPushBlockList:w,menuItemLabel:F,updateIsCollapsed:S,currentRoute:k,menuMounted:N,itemApendIcon:j,itemPrepandIcon:E,miniMenu:D,MenuScroll:V,MenuHover:x,keepChildrenOpen:c,ChildrenOpenActiveRoute:m,closeOpenMenuOnHrefPush:p,emitOut:O,menuDirection:M,checkButtonActive:u,CurrantItemHover:I,updateCurranContainerHover:B,updateCurrantItemHover:y,getRandomUid:H,vueRouterEnabel:s,extractChildrenRoutes:f,isSameUrl:g,menuType:n,widthMiniMenu:i,childrenOpenAnimation:r,removeIconSpace:l,collapsed:a,userAgentHeight:C,position:v,keepOneMenuOpenAtAtime:h}},watch:{routerPushBlockList(t){if(!!(this.keepOneMenuOpenAtAtime||this.closeOpenMenuOnHrefPush)&&this.item[this.symbolId]!==t&&this.item.children){let i=function(r){if(!o)for(let l=0;l{setTimeout(()=>{this.setItemOffsetHeight()},0);const t=this.$refs.labelRef.getBoundingClientRect();this.labelMiniYofsset=t[this.menuDirection],this.labelMiniYYofsset=t.top})):this.CurrantItemHover===this.id&&this.MenuHover||this.closeItemChildren()},MenuHover(){this.MenuHover||this.closeItemChildren()},CurrantItemHover(){this.CurrantItemHover!=this.id&&this.closeItemChildren()},MenuScroll(){if(this.isMobile)this.closeItemChildren();else{this.setItemOffsetHeight();const t=this.$refs.labelRef.getBoundingClientRect();this.labelMiniYofsset=t[this.menuDirection],this.labelMiniYYofsset=t.top}},miniMenu(){this.closeItemChildren(),this.$nextTick(()=>{this.setItemOffsetHeight()})}},created(){this.checkActive()},mounted(){if(this.checkSiblingsForIcon(),this.setItemOffsetHeight(),this.position!="fixed"){const t=()=>{if("ontouchstart"in document.documentElement){this.closeItemChildren();return}this.setItemOffsetHeight();const n=this.$refs.labelRef.getBoundingClientRect();this.labelMiniYofsset=n[this.menuDirection],this.labelMiniYYofsset=n.top},o=()=>{window.removeEventListener("scroll",t)};window.addEventListener("scroll",t),e.onBeforeUnmount(o)}},computed:{isMobile(){return"ontouchstart"in document.documentElement},miniActiveClass(){var t,o;return(t=this.item)!=null&&t.miniActiveClass?(o=this.item)==null?void 0:o.miniActiveClass:"miniActive"},activeClass(){var t,o;return(t=this.item)!=null&&t.activeClass?(o=this.item)==null?void 0:o.activeClass:"activeClass"},menuDirectionOposite(){return this.menuDirection==="right"?"left":"right"},labelName(){var t,o;return this.miniMenu?this.depth!=0?(t=this.item)==null?void 0:t.name:!1:(o=this.item)==null?void 0:o.name},heifOfContainer(){return this.containerHeight===this.userAgentHeight?this.containerHeight:this.containerHeight+"px"},transitionTime(){return`all ${this.animationDuration/1e3}s ease-in-out`},menuItemSlotData(){var t,o;return{icon:{icon:((t=this.item)==null?void 0:t.icon)||{},name:(o=this.item)==null?void 0:o.name}}},shouldMouseEnterEvent(){return this.miniMenu&&this.depth==0?"mouseover":null},keyOrClick(){return this.miniMenu&&this.depth==0?this.expanded?this.isMobile?"touchend":"click":this.isMobile?"":"click":"click"},shouldMouseLeaveEvent(){return this.miniMenu&&this.depth==0?"mouseleave":null},ContainerOffsetYConputed(){return`${this.ContainerOffsetY}px`},menuItemClass(){var o,n;let t={};return t[`vas-${this.menuType}`]=!0,t[((o=this.item)==null?void 0:o.class)||""]=(n=this.item)==null?void 0:n.class,{miniCollapseIconWidth:this.miniMenu&&this.depth==0,MenuItemWidthOnMiniCollapse:this.miniMenu&&this.depth!=0,menuExpanded:this.menuType==="fully"&&(!this.miniMenu&&this.expanded&&this.depth==0||this.miniMenu&&this.depth==1&&this.expanded),noIconWidth:this.removeIconSpace&&!this.miniMenu&&!this.siblingsHaveIconProp&&this.isParentFlat,noIconwidthMiniMenu:this.removeIconSpace&&this.miniMenu&&this.depth!=0&&!this.siblingsHaveIconProp&&this.isParentFlat,...t}},miniLabelWidth(){const t=Number(this.menuType!="fully");return this.expanded?`calc(${this.widthMiniMenu}*${t}/2 - ${this.$refs.menuItem.clientWidth}*${t}px/2 + ${this.$refs.menuItem.clientWidth}px + 250px - 1.5px)`:"35px"},miniLabelDirection(){return`calc((${this.widthMiniMenu} - ${this.miniMenuOffset}px) / 2)`}},methods:{mousewheelop(t){document.querySelector(".vas-menu").scrollBy(0,t.deltaY)},PushToTopOfCallStack(t){setTimeout(()=>{t()},0)},resloveHref(t){return this!=null&&this.$router?this.$router.resolve(t).href:t},checkActive(){var o,n,i,r;if(!!this.checkButtonActive)if(((o=this.item)==null?void 0:o.href)&&this.isSameUrl(this.resloveHref((n=this.item)==null?void 0:n.href)))this.active=!0,this.miniActive=!1;else{if(this.active=!1,!((i=this.item)!=null&&i.children))return;let l=!1,s=this.extractChildrenRoutes((r=this.item)==null?void 0:r.children,"href")||[];for(var t=0;t{this.expanded=t}),this.showChildren=t},checkSiblingsForIcon(){var o,n,i,r;if(!(!this.removeIconSpace&&this.menuType=="fully")&&!!((o=this.item)!=null&&o.children)){for(var t=0;t<((n=this.item)==null?void 0:n.children.length);t++)if((r=(i=this.item)==null?void 0:i.children[t])!=null&&r.icon){this.siblingsHaveIcon=!0;break}}},openItemCildren(){var t,o,n;this.depth===1&&this.miniMenu&&this.setMaxHeightTopCProp(),this.miniMenu&&this.depth===0&&(this.showChildren=!0,this.$nextTick(()=>{this.expanded=!0})),(t=this.item)!=null&&t.children&&(this.expanded||(this.setSmallMenuDataForToggle(!0),this.renderChildren=!0,this.cacheHieght?this.containerHeight=this.cacheHieght:this.containerHeight=this.menuMounted?((o=this.item)==null?void 0:o.children.length)*((n=this.$refs.menuItem)==null?void 0:n.offsetHeight)+3:this.userAgentHeight,this.cacheHieght=null,this.menuMounted&&(this.miniMenu&&this.depth===0&&(this.containerHeight=this.userAgentHeight),this.hieghtTimeout=setTimeout(()=>{this.containerHeight=this.userAgentHeight},this.childrenOpenAnimation?this.animationDuration:0))))},closeItemChildren(){var t,o,n;if(this.seTAnimationTimeOut=!1,!this.menuCollapsed&&this.miniMenu&&this.depth===0){this.setSmallMenuDataForToggle(!1),this.topConTime=setTimeout(()=>{this.containerHeight=0,this.topConTime=null},this.animationDuration);return}this.setSmallMenuDataForToggle(!1),(t=this.item)!=null&&t.children&&(this.cacheHieght||(this.cacheHieght=(o=this.$refs.container)==null?void 0:o.offsetHeight),this.containerHeight=(n=this.$refs.container)==null?void 0:n.offsetHeight,this.PushToTopOfCallStack(()=>{}),setTimeout(()=>{this.$nextTick(()=>{this.containerHeight=0})},10),!this.keepChildrenOpen&&(this.renderTimeOut=setTimeout(()=>{setTimeout(()=>{this.renderChildren=!1},20),this.cacheHieght=null},this.childrenOpenAnimation?this.animationDuration:0)))},setMaxHeightTopC(){var o;const t=(o=this.$refs.topContainerRef)==null?void 0:o.getBoundingClientRect();this.MakeSpace?this.TopcontainerHiefht=t.height+"px":this.TopcontainerHiefht=t.height+innerHeight-(t.top+t.height)-2+"px"},setItemOffsetHeight(){var t,o,n;if(this.depth==0){const i=this.$refs.menuItem.getBoundingClientRect(),r=(t=this.$refs.topContainerRef)==null?void 0:t.getBoundingClientRect().height;let l=0;(o=this.item)!=null&&o.children&&(l=i.height*((n=this.item)==null?void 0:n.children.length)+i.height),r&&l+i.top-15>innerHeight?(this.ContainerOffsetY=innerHeight-i.bottom,this.MakeSpace=!0):(this.ContainerOffsetY=i.top,this.MakeSpace=!1),this.miniMenuOffset=i.width}}}},re={key:0,class:"BlockBack"},se={key:0,class:"labelName"},ae={key:1},ce={key:1},ue={key:0,class:"labelName"},me={key:0,class:"labelminiSub"},he={key:2,class:"labelminiSub"};function de(t,o,n,i,r,l){var u,m,a,p,v;const s=e.resolveComponent("MenuItemIconVue"),c=e.resolveComponent("menu-item",!0);return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.menuItemClass,"menu-item-base alignCenter"]),ref:"menuItem",style:e.normalizeStyle({float:i.miniMenu&&n.depth===1?i.menuDirection:l.menuDirectionOposite})},[t.active?(e.openBlock(),e.createElementBlock("div",re)):e.createCommentVNode("",!0),e.createElementVNode("div",e.mergeProps({class:"label"},{[e.toHandlerKey(l.shouldMouseEnterEvent)]:o[0]||(o[0]=h=>this.hover=!0)},{[e.toHandlerKey(l.shouldMouseLeaveEvent)]:o[1]||(o[1]=h=>this.hover=!1)},{class:{TransitionC:!i.miniMenu||i.miniMenu&&!t.showChildren,menuexpand:t.showChildren,[l.activeClass]:t.active,[l.miniActiveClass]:t.miniActive,labelHoverClass:n.depth!=0&&i.miniMenu||!i.miniMenu}},{[e.toHandlerKey(l.keyOrClick)]:o[2]||(o[2]=(...h)=>l.labelClick&&l.labelClick(...h))},{style:{[i.menuDirection=="left"?"paddingLeft":"paddingRight"]:i.menuType==="fully"?`${n.depth*18}px`:"",background:n.depth==0&&!t.active&&i.miniMenu?"none":""}}),[e.createElementVNode("div",{class:e.normalizeClass(["left",{marginAuto:i.miniMenu&&n.depth===0,collapseEnd:i.miniMenu}]),ref:"labelRef"},[!i.removeIconSpace||i.removeIconSpace&&n.siblingsHaveIconProp?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.itemPrepandIcon?i.itemPrepandIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.itemPrepandIcon),{key:1,icon:(m=n.item)==null?void 0:m.icon,active:t.active,miniActive:t.miniActive,isChildrenMenuOpen:t.showChildren},null,8,["icon","active","miniActive","isChildrenMenuOpen"])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s,{key:0,icon:(u=n.item)==null?void 0:u.icon},null,8,["icon"]))],64)):e.createCommentVNode("",!0),l.labelName?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.menuItemLabel?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.menuItemLabel),{key:1,labelName:l.labelName,active:t.active,miniActive:t.miniActive,isChildrenMenuOpen:t.showChildren},null,8,["labelName","active","miniActive","isChildrenMenuOpen"])):(e.openBlock(),e.createElementBlock("span",se,e.toDisplayString(l.labelName),1))],64)):e.createCommentVNode("",!0)],2),i.miniMenu&&n.depth!=0||!i.miniMenu?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.item.children&&!i.itemApendIcon?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["icons postIconOpenAnima",{opened:t.showChildren}])},null,2)):e.createCommentVNode("",!0),n.item.children&&i.itemApendIcon?(e.openBlock(),e.createElementBlock("div",ae,[i.itemApendIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.itemApendIcon),{key:0,icon:(a=n.item)==null?void 0:a.icon,isChildrenMenuOpen:t.showChildren,active:t.active,miniActive:t.miniActive},null,8,["icon","isChildrenMenuOpen","active","miniActive"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],16),!i.miniMenu||n.depth!=0&&i.miniMenu?(e.openBlock(),e.createElementBlock("div",ce,[n.item.children?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["items-container",{"small-menu":n.smallMenu}]),style:e.normalizeStyle({maxHeight:l.heifOfContainer,transition:l.transitionTime}),ref:"container"},[t.renderChildren?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.item.children,(h,C)=>(e.openBlock(),e.createBlock(c,{siblingsHaveIconProp:t.siblingsHaveIcon,isParentFlat:n.siblingsHaveIconProp,key:C,item:h,depth:n.depth+1,smallMenu:n.smallMenu},null,8,["siblingsHaveIconProp","isParentFlat","item","depth","smallMenu"]))),128)):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),i.miniMenu&&n.depth===0&&!i.collapsed?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass({topContainer:n.depth==0,vasopacitiy:!t.expanded}),ref:"topContainerRef",style:e.normalizeStyle({[t.MakeSpace?"bottom":"top"]:`calc(${l.ContainerOffsetYConputed} - 1px)`,[i.menuDirection]:`calc(${i.widthMiniMenu} - 1px)`,maxHeight:t.TopcontainerHiefht,width:t.showChildren?"250px":"0px",zIndex:t.showChildren?"850":"849",animationDelay:t.seTAnimationTimeOut?"0.3s":"0"})},[e.createElementVNode("div",{onClick:o[3]||(o[3]=(...h)=>l.miniLabelClick&&l.miniLabelClick(...h)),onMousewheel:o[4]||(o[4]=(...h)=>l.mousewheelop&&l.mousewheelop(...h)),class:e.normalizeClass(["labelMini",{[l.miniActiveClass]:t.miniActive,[l.activeClass]:t.active}]),style:e.normalizeStyle({position:"fixed",whiteSpace:"nowrap",[i.menuDirection]:i.menuType==="fully"?"0px":l.miniLabelDirection,width:l.miniLabelWidth,[t.MakeSpace?"bottom":"top"]:l.ContainerOffsetYConputed,opacity:n.depth===0&&t.showChildren?"1":"0"})},[t.showChildren?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["left",{marginAuto:i.miniMenu&&n.depth===0}]),style:e.normalizeStyle({[i.menuDirection]:i.widthMiniMenu,top:t.labelMiniYYofsset+"px"})},[i.menuItemLabel?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.menuItemLabel),{key:1,labelName:(v=n.item)==null?void 0:v.name,active:t.active,miniActive:t.miniActive,isChildrenMenuOpen:t.showChildren},null,8,["labelName","active","miniActive","isChildrenMenuOpen"])):(e.openBlock(),e.createElementBlock("span",ue,e.toDisplayString((p=n.item)==null?void 0:p.name),1))],6)):e.createCommentVNode("",!0)],38),n.depth==0&&!t.MakeSpace?(e.openBlock(),e.createElementBlock("div",me)):e.createCommentVNode("",!0),n.item.children?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["items-container",{"small-menu":n.smallMenu}]),style:e.normalizeStyle({maxHeight:l.heifOfContainer,transition:l.transitionTime}),ref:"container"},[t.renderChildren?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.item.children,(h,C)=>(e.openBlock(),e.createBlock(c,{siblingsHaveIconProp:t.siblingsHaveIcon,isParentFlat:n.siblingsHaveIconProp,key:C,item:h,depth:n.depth+1,smallMenu:n.smallMenu,setMaxHeightTopCProp:l.setMaxHeightTopC,isMakeSpace:t.MakeSpace},null,8,["siblingsHaveIconProp","isParentFlat","item","depth","smallMenu","setMaxHeightTopCProp","isMakeSpace"]))),128)):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0),n.depth==0&&t.MakeSpace?(e.openBlock(),e.createElementBlock("div",he)):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0)],6)}const fe=L(le,[["render",de]]),ve={name:"MenuHl",props:{data:{default:""}}};function pe(t,o,n,i,r,l){var s,c,u,m;return e.openBlock(),e.createBlock(e.resolveDynamicComponent((s=n.data)!=null&&s.element?n.data.element:"hr"),e.mergeProps({class:["vas-hr",(c=n.data)!=null&&c.class?(u=n.data)==null?void 0:u.class:""]},(m=n.data)==null?void 0:m.attributes),null,16,["class"])}const Ce=L(ve,[["render",pe]]),Me=(t,o)=>{const{menu:n,menuType:i,miniMenu:r,collapsed:l,animationDuration:s,width:c,widthMiniMenu:u,removeIconSpace:m,closeOnClickOutSide:a,overLayerOnOpen:p,childrenOpenAnimation:v,position:h,collapseBreakPoint:C,dark:k,vueRouterEnabel:g,keepChildrenOpen:f,checkButtonActive:N,ChildrenOpenActiveRoute:D,closeOpenMenuOnHrefPush:V,keepOneMenuOpenAtAtime:x,rtl:H}=e.toRefs(t),y=e.ref(l.value),B=e.ref(!1),I=e.ref(!1),M=e.ref(r.value),O=e.ref(!1),S=e.ref(null),w=e.ref(null),T=e.ref(""),A=Symbol("id");let j=3;const E=()=>j++;function F(d){let R=[...d];function U(P){for(let b=0;bo.slots.hasOwnProperty(d)?o.slots[d]:null,z=d=>{y.value=d},q=()=>{I.value=!I.value},G=d=>{O.value=d},J=d=>{S.value=d},Q=d=>{w.value=d},W=e.computed(()=>H.value?"right":"left"),X=(d,R)=>{o.emit(d,R)},Z=d=>{M.value=d};let $=navigator.userAgent.indexOf("Firefox")!=-1?"-moz-max-content":"fit-content";return e.onMounted(()=>{B.value=!0}),e.provide("sidebarProps",{menu:n,menuType:i,collapsed:y,miniMenu:M,animationDuration:s,width:c,widthMiniMenu:u,removeIconSpace:m,closeOnClickOutSide:a,overLayerOnOpen:p,childrenOpenAnimation:v,position:h,collapseBreakPoint:C,vueRouterEnabel:g,checkButtonActive:N,ChildrenOpenActiveRoute:D,closeOpenMenuOnHrefPush:V,keepChildrenOpen:f,dark:k,rtl:H,keepOneMenuOpenAtAtime:x}),e.provide("getSlotByName",Y),e.provide("routerPushBlockList",T),e.provide("pushToRouterPush",K),e.provide("symbolId",A),e.provide("browserAgent",$),e.provide("menuMounted",B),e.provide("miniMenu",M),e.provide("MenuScroll",I),e.provide("MenuHover",O),e.provide("getRandomUid",E),e.provide("updateCurrantItemHover",J),e.provide("updateCurranContainerHover",Q),e.provide("CurrantItemHover",S),e.provide("CurranContainerHover",w),e.provide("menuDirection",W),e.provide("updateIsCollapsed",z),e.provide("emitOut",X),{getIsCollapsed:y,getIsminiMenu:M,updateIsCollapsed:z,getSlotByName:Y,updateminiMenu:Z,menuMounted:B,updateMenuScroll:q,updateMenuHover:G,menuDirection:W,addIdToMenuItems:F}};function ke(t,o,n){if(!t)return;const i=s=>{if(n.value){r();return}s.target==t.value||s.composedPath().includes(t.value)||o()},r=()=>{window.removeEventListener("click",i)},l=()=>{r(),setTimeout(()=>{window.addEventListener("click",i)},0)};return e.onBeforeUnmount(r),{removeSideBarListner:r,addSideBarListner:l}}function ge(t,o){if(!t)return;o(t>innerWidth);let n=window.innerWidth;const i=()=>{n!=window.innerWidth&&(o(t>innerWidth),n=window.innerWidth)};window.addEventListener("resize",i),e.onBeforeUnmount(()=>{window.removeEventListener("resize",i)})}const ye=(t,o)=>{e.toRefs(t);const n=e.ref(window.location);function i(s,c=n.value){return c.href===c.origin+s||c.pathname+c.hash===s||c.pathname+c.search===s||c.href===s||c.hash===s}function r(s,c){if(!!s)return Object.entries(s).reduce((u,[m,a])=>m===c?u.concat(a):typeof a=="object"?u.concat(r(a,c)):u,[])}const l=s=>{n.value={...s}};return e.provide("currentRoute",n),e.provide("updateCurrentRoute",l),e.provide("isSameUrl",i),e.provide("extractChildrenRoutes",r),{isSameUrl:i,extractChildrenRoutes:r,currentRoute:n,updateCurrentRoute:l}};const Be={name:"vas-menu",props:{menu:{type:Array,required:!0},menuType:{type:String,default:"simple"},collapsed:{type:Boolean,default:!1},miniMenu:{type:Boolean,default:!1},animationDuration:{type:Number,default:300},width:{type:String,default:"290px"},widthMiniMenu:{type:String,default:"65px"},autoCollapse:{type:Number,default:null},removeIconSpace:{type:Boolean,default:!1},closeOnClickOutSide:{type:Boolean,default:!1},overLayerOnOpen:{type:Boolean,default:!1},childrenOpenAnimation:{type:Boolean,default:!0},position:{type:String,default:"fixed"},keepChildrenOpen:{type:Boolean,default:!1},ChildrenOpenActiveRoute:{type:Boolean,default:!0},checkButtonActive:{type:Boolean,default:!0},vueRouterEnabel:{type:Boolean,default:!1},BottomMiniMenuBtn:{type:Boolean,default:!0},paddingTop:{type:String,default:"0px"},dark:{type:Boolean},rtl:{type:Boolean,default:!1},closeOpenMenuOnHrefPush:{type:Boolean,default:!1},keepOneMenuOpenAtAtime:{type:Boolean,default:!1}},emits:{"item-click"(t){return!!t},"update:collapsed"(t){return typeof t=="boolean"},"update:miniMenu"(t){return typeof t=="boolean"}},data:()=>({smallMenu:!1,siblingsHaveIcon:!1}),components:{MenuItem:fe,HeaderItem:te,Menuline:Ce},mounted(){this.checkSiblingsForIcon(),window.addEventListener("hashchange",()=>{this.updateCurrentRoute(window.location)},!1)},watch:{async $route(){this.updateCurrentRoute(window.location)},miniMenuRef(){this.miniMenuRef&&this.updateMenuHover(!0)}},computed:{menuScrollEvent(){return this.miniMenuRef?"scroll":null},mouseEnterEvent(){return this.miniMenuRef?"mouseenter":null},mouseLeaveEvent(){return this.miniMenuRef?"mouseleave":null},computedMenuList(){return this.addIdToMenuItems(this.menu)}},methods:{onMenuScroll(){this.updateMenuScroll()},onEnter(){this.updateMenuHover(!0)},onLeave(){this.updateMenuHover(!1)},checkSiblingsForIcon(){var o;if(!(!this.removeIconSpace&&this.menuType=="fully")){for(var t=0;t{u(!n.value)},n);t.closeOnClickOutSide&&C(),e.watch(()=>n.value,f=>{o.emit("update:collapsed",f),t.overLayerOnOpen&&(v.value=!f),t.closeOnClickOutSide&&(f?h():C())}),e.watch(()=>t.collapsed,f=>{u(f)}),e.watch(()=>t.closeOnClickOutSide,f=>{f?C():h()}),e.watch(()=>t.miniMenu,f=>{s(f)}),e.watch(()=>t.overLayerOnOpen,f=>{f?v.value=!n.value:v.value=!1});const k=e.computed(()=>i.value?t.widthMiniMenu:t.width),g=e.computed(()=>[`${t.dark?"dark":"white"}-theme`,t.rtl?"rtl":"ltr"]);return ge(t.autoCollapse,u),t.overLayerOnOpen&&(v.value=!n.value),{sidebarMenuWidth:k,updateMenuScroll:r,sidebarClass:g,sidebarmen:p,updateCurrentRoute:a,updateMenuHover:l,overLayer:v,isCollapsed:n,updateminiMenu:s,miniMenuRef:i,menuDirection:c,addIdToMenuItems:m}}},Ie={class:"vas-footer"},be=e.createElementVNode("div",{class:"footer-wrapper"},null,-1),He={key:0,class:"vas-over-layer"};function Oe(t,o,n,i,r,l){var m;const s=e.resolveComponent("MenuItem"),c=e.resolveComponent("HeaderItem"),u=e.resolveComponent("Menuline");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("nav",e.mergeProps({class:["vas-menu",i.sidebarClass],ref:"sidebarmen",style:[{width:i.sidebarMenuWidth,position:n.position,[i.menuDirection]:i.isCollapsed?`calc(-1*(${i.sidebarMenuWidth} + 2px))`:"0px",direction:n.rtl?"rtl":"ltr",paddingTop:n.paddingTop},{overflow:"hidden"}]},{[e.toHandlerKey(l.mouseEnterEvent)]:o[2]||(o[2]=(...a)=>l.onEnter&&l.onEnter(...a))},{[e.toHandlerKey(l.mouseLeaveEvent)]:o[3]||(o[3]=(...a)=>l.onLeave&&l.onLeave(...a))}),[e.createElementVNode("div",e.mergeProps({[e.toHandlerKey(l.menuScrollEvent)]:o[0]||(o[0]=(...a)=>l.onMenuScroll&&l.onMenuScroll(...a))},{class:["menu-wraper",{miniCoolapseMenu:i.miniMenuRef,compeleteCoolapseMenu:i.isCollapsed}],style:{width:i.sidebarMenuWidth}}),[e.renderSlot(t.$slots,"header"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.computedMenuList,(a,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[!(a!=null&&a.header)&&!(a!=null&&a.LineShow)?(e.openBlock(),e.createBlock(s,{key:0,item:a,depth:0,smallMenu:t.smallMenu,siblingsHaveIconProp:t.siblingsHaveIcon},null,8,["item","smallMenu","siblingsHaveIconProp"])):(a==null?void 0:a.header)&&!i.miniMenuRef?(e.openBlock(),e.createBlock(c,{key:1,data:a},null,8,["data"])):a!=null&&a.LineShow?(e.openBlock(),e.createBlock(u,{key:2,data:a},null,8,["data"])):e.createCommentVNode("",!0)],64))),128)),e.createElementVNode("div",Ie,[be,e.renderSlot(t.$slots,"footer")])],16),n.BottomMiniMenuBtn?(e.openBlock(),e.createElementBlock("div",{key:0,class:"bottomBtn",onClick:o[1]||(o[1]=(...a)=>l.toggleMiniCollapse&&l.toggleMiniCollapse(...a))},[(m=t.$slots)!=null&&m.BottomMiniMenuBtn?e.renderSlot(t.$slots,"BottomMiniMenuBtn",{key:1,miniMenu:i.miniMenuRef}):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["icons bottomBtnIcon",{ssdSpin:!i.miniMenuRef}])},null,2))])):e.createCommentVNode("",!0)],16),e.createVNode(e.Transition,{name:"vas-fade"},{default:e.withCtx(()=>[i.overLayer?(e.openBlock(),e.createElementBlock("div",He)):e.createCommentVNode("",!0)]),_:1})],64)}const _=L(Be,[["render",Oe]]),Se={install:t=>{t.component("VueAwesomeSideBar",_)}};exports.VueAwesomeSideBar=_;exports.default=Se; //# sourceMappingURL=vue-awesome-sidebar.cjs.map