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