const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/subItem.Cfm4Wl4e.js","assets/vue.D1BjjNmv.js","assets/index.Df8UJ10K.js","assets/index.B3U2FkM1.css"])))=>i.map(i=>d[i]);
import{ay as E,u as P,_ as V,o as N,e as O}from"./index.Df8UJ10K.js";import{a as R,r as j,aC as h,aB as q,_ as F,f as K,a5 as Y,q as J,aK as Q,aj as i,c as m,o as r,S as a,K as l,R as k,a9 as U,J as C,u as W,aA as G,b as L,Q as d,a8 as X,P as y,Y as S,t as Z}from"./vue.D1BjjNmv.js";import{f as ee}from"./routeFilter._N12e_OU.js";import{_ as te}from"./_plugin-vue_export-helper.DlAUqK2U.js";const ne={class:"el-menu-horizontal-warp"},se=["onClick"],oe=R({name:"navMenuHorizontal"}),ae=R({...oe,props:{menuList:{type:Array,default:()=>[]}},setup(g){const A=G(()=>V(()=>import("./subItem.Cfm4Wl4e.js"),__vite__mapDeps([0,1,2,3]))),b=g,c=j(),M=E(),$=P(),{routesList:w}=h(M),{themeConfig:p}=h($),z=q(),u=F({defaultActive:""}),v=K(()=>b.menuList),x=e=>{const s=e.wheelDelta||-e.deltaY*40;c.value.$refs.wrapRef.scrollLeft=c.value.$refs.wrapRef.scrollLeft+s/4},B=()=>{Z(()=>{let e=document.querySelector(".el-menu.el-menu--horizontal li.is-active");if(!e)return!1;c.value.$refs.wrapRef.scrollLeft=e.offsetLeft})},D=e=>{const s=e.split("/");let t={children:[]};return ee(w.value).map((o,f)=>{o.path===`/${s[1]}`&&(o.k=f,t.item={...o},t.children=[{...o}],o.children&&(t.children=o.children))}),t},_=e=>{const{path:s,meta:t}=e;if(p.value.layout==="classic")u.defaultActive=`/${s==null?void 0:s.split("/")[1]}`;else{const o=t!=null&&t.isDynamic?t.isDynamicPath.split("/"):s.split("/");o.length>=4&&(t!=null&&t.isHide)?u.defaultActive=o.splice(0,3).join("/"):u.defaultActive=s}},H=e=>{N.handleOpenLink(e)};return Y(()=>{_(z)}),J(()=>{B()}),Q(e=>{_(e);let{layout:s,isClassicSplitMenu:t}=p.value;s==="classic"&&t&&O.emit("setSendClassicChildren",D(e.path))}),(e,s)=>{const t=i("SvgIcon"),o=i("el-sub-menu"),f=i("el-menu-item"),I=i("el-menu"),T=i("el-scrollbar");return r(),m("div",ne,[a(T,{onWheel:S(x,["prevent"]),ref_key:"elMenuHorizontalScrollbarRef",ref:c},{default:l(()=>[a(I,{router:"","default-active":u.defaultActive,ellipsis:!1,"background-color":"transparent",mode:"horizontal"},{default:l(()=>[(r(!0),m(k,null,U(v.value,n=>(r(),m(k,null,[n.children&&n.children.length>0?(r(),C(o,{index:n.path,key:n.path},{title:l(()=>[a(t,{name:n.meta.icon},null,8,["name"]),L("span",null,d(e.$t(n.meta.title)),1)]),default:l(()=>[a(W(A),{chil:n.children},null,8,["chil"])]),_:2},1032,["index"])):(r(),C(f,{index:n.path,key:n.path},X({_:2},[!n.meta.isLink||n.meta.isLink&&n.meta.isIframe?{name:"title",fn:l(()=>[a(t,{name:n.meta.icon},null,8,["name"]),y(" "+d(e.$t(n.meta.title)),1)]),key:"0"}:{name:"title",fn:l(()=>[L("a",{class:"w100",onClick:S(le=>H(n),["prevent"])},[a(t,{name:n.meta.icon},null,8,["name"]),y(" "+d(e.$t(n.meta.title)),1)],8,se)]),key:"1"}]),1032,["index"]))],64))),256))]),_:1},8,["default-active"])]),_:1},512)])}}}),fe=te(ae,[["__scopeId","data-v-c3d744c0"]]);export{fe as default};
