import{d as k,a as H,N as M,R as F,C as j,r as U,o as V,P as z,X as E,m as J,b as $,e as c,f as d,g as v,w as W,s as m,F as X,k as Z,t as C,u as f,A as R,J as q}from"./vue.BxlDVA1H.js";import{W as G,u as K,t as i,Z as Q}from"./index.lP_uh0LI.js";import{_ as Y}from"./_plugin-vue_export-helper.DlAUqK2U.js";const ee={class:"layout-columns-aside"},te=["onClick","onMouseenter","title"],se={class:"columns-vertical-title font12"},ne=["href"],oe={class:"columns-vertical-title font12"},le=k({name:"layoutColumnsAside"}),ie=k({...le,setup(ae){const A=H([]),_=H(),h=G(),O=K(),{routesList:x,isColumnsMenuHover:b,isColumnsNavHover:P}=M(h),{themeConfig:a}=M(O),y=F(),g=j(),t=U({columnsAsideList:[],liIndex:0,liOldIndex:null,liHoverIndex:null,liOldPath:null,difference:0,routeSplit:[]}),L=e=>{t.liIndex=e,_.value.style.top=`${A.value[e].offsetTop+t.difference}px`},T=(e,s)=>{L(s);let{path:o,redirect:l}=e;l?g.push(l):g.push(o)},D=(e,s)=>{if(!a.value.isColumnsMenuHoverPreload)return!1;let{path:o}=e;t.liOldPath=o,t.liOldIndex=s,t.liHoverIndex=s,i.emit("setSendColumnsChildren",r(o)),h.setColumnsMenuHover(!1),h.setColumnsNavHover(!0)},N=async()=>{await h.setColumnsNavHover(!1),setTimeout(()=>{!b&&!P&&i.emit("restoreDefault")},100)},S=e=>{q(()=>{L(e)})},w=()=>{var s;t.columnsAsideList=I(x.value);const e=r(y.path);if(Object.keys(e).length<=0)return!1;S((s=e.item)==null?void 0:s.k),i.emit("setSendColumnsChildren",e)},r=e=>{const s=e.split("/");let o={children:[]};return t.columnsAsideList.map((l,n)=>{l.path===`/${s[1]}`&&(l.k=n,o.item={...l},o.children=[{...l}],l.children&&(o.children=l.children))}),o},I=e=>e.filter(s=>{var o;return!((o=s.meta)!=null&&o.isHide)}).map(s=>(s=Object.assign({},s),s.children&&(s.children=I(s.children)),s)),B=e=>{t.routeSplit=e.split("/"),t.routeSplit.shift();const s=`/${t.routeSplit[0]}`,o=t.columnsAsideList.find(l=>l.path===s);if(!o)return!1;setTimeout(()=>{S(o.k)},0)};return V(()=>{w(),i.on("restoreDefault",()=>{t.liOldIndex=null,t.liOldPath=null})}),z(()=>{i.off("restoreDefault",()=>{})}),E(e=>{B(e.path),i.emit("setSendColumnsChildren",r(e.path))}),J(Q.state,e=>{if(e.themeConfig.themeConfig.columnsAsideStyle==="columnsRound"?t.difference=3:t.difference=0,!e.routesList.isColumnsMenuHover&&!e.routesList.isColumnsNavHover)t.liHoverIndex=null,i.emit("setSendColumnsChildren",r(y.path));else{if(t.liHoverIndex=t.liOldIndex,!t.liOldPath)return!1;i.emit("setSendColumnsChildren",r(t.liOldPath))}},{deep:!0}),(e,s)=>{const o=$("SvgIcon"),l=$("el-scrollbar");return d(),c("div",ee,[v(l,null,{default:W(()=>[m("ul",{onMouseleave:s[0]||(s[0]=n=>N())},[(d(!0),c(X,null,Z(t.columnsAsideList,(n,u)=>(d(),c("li",{key:u,onClick:p=>T(n,u),onMouseenter:p=>D(n,u),ref_for:!0,ref:p=>{p&&(A.value[u]=p)},class:C({"layout-columns-active":t.liIndex===u,"layout-columns-hover":t.liHoverIndex===u}),title:e.$t(n.meta.title)},[!n.meta.isLink||n.meta.isLink&&n.meta.isIframe?(d(),c("div",{key:0,class:C(f(a).columnsAsideLayout)},[v(o,{name:n.meta.icon},null,8,["name"]),m("div",se,R(e.$t(n.meta.title)&&e.$t(n.meta.title).length>=4?e.$t(n.meta.title).substr(0,f(a).columnsAsideLayout==="columns-vertical"?4:3):e.$t(n.meta.title)),1)],2)):(d(),c("div",{key:1,class:C(f(a).columnsAsideLayout)},[m("a",{href:n.meta.isLink,target:"_blank"},[v(o,{name:n.meta.icon},null,8,["name"]),m("div",oe,R(e.$t(n.meta.title)&&e.$t(n.meta.title).length>=4?e.$t(n.meta.title).substr(0,f(a).columnsAsideLayout==="columns-vertical"?4:3):e.$t(n.meta.title)),1)],8,ne)],2))],42,te))),128)),m("div",{ref_key:"columnsAsideActiveRef",ref:_,class:C(f(a).columnsAsideStyle)},null,2)],32)]),_:1})])}}}),de=Y(ie,[["__scopeId","data-v-a41d6147"]]);export{de as default};
