const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/subItem.B4BgFwlw.js","assets/vue.BxlDVA1H.js","assets/index.lP_uh0LI.js","assets/index.TG7KVPIy.css"])))=>i.map(i=>d[i]);
import{W as P,u as V,_ as j,$ as W,t as q}from"./index.lP_uh0LI.js";import{d as T,C as J,r as Q,a as I,N as S,R as Y,c as Z,O as G,o as K,b as u,e as d,f as a,g as r,w as c,F as R,k as U,h as v,u as X,Q as ee,s as $,A as h,Y as te,l as M,Z as ne,J as se}from"./vue.BxlDVA1H.js";import{_ as ie}from"./_plugin-vue_export-helper.DlAUqK2U.js";const oe={class:"el-menu-horizontal-warp"},le=["onClick"],ae=T({name:"navMenuHorizontal"}),re=T({...ae,props:{menuList:{type:Array,default:()=>[]}},setup(b){const f=J(),w=ee(()=>j(()=>import("./subItem.B4BgFwlw.js"),__vite__mapDeps([0,1,2,3])));Q({menuList:[],clientWidth:0});const m=b,z=I(),A=P(),B=V(),{routesList:p}=S(A),{themeConfig:_}=S(B),k=Y(),o=I(""),C=Z(()=>(m.menuList.shift(),m.menuList)),g=(t,i)=>{for(let e=0;e<t.length;e++){const n=t[e];if(n.children&&n.children.length>0&&(n.children.findIndex(s=>s.path===i)!==-1||g(n.children,i)!==null))return e}return null},D=()=>{se(()=>{let t=document.querySelector(".el-menu.el-menu--horizontal li.is-active");if(!t)return!1;z.value.$refs.wrapRef.scrollLeft=t.offsetLeft})},L=t=>t.filter(i=>{var e;return!((e=i.meta)!=null&&e.isHide)}).map(i=>(i=Object.assign({},i),i.children&&(i.children=L(i.children)),i)),H=t=>{const i=t.split("/");let e={children:[]};return L(p.value).map((n,l)=>{n.path===`/${i[1]}`&&(n.k=l,e.item={...n},e.children=[{...n}],n.children&&(e.children=n.children))}),e},O=t=>{const{path:i,meta:e}=t;if(_.value.layout==="classic"){let n=(g(p.value,k.path)||0)-1;o.value=n<0?o.value:C.value[n].path}else{const n=e!=null&&e.isDynamic?e.isDynamicPath.split("/"):i.split("/");n.length>=4&&(e!=null&&e.isHide)?o.value=n.splice(0,3).join("/"):o.value=i||""}},E=t=>{W.handleOpenLink(t)},x=(t,i)=>{let e=t.children;if(e===void 0&&(o.value=t.path,e=H(t.path).children),e.length>=1){if(e[0].is_catalog){x(e[0]);return}f.push(e[0].path);let{layout:n,isClassicSplitMenu:l}=_.value;n==="classic"&&l&&q.emit("setSendClassicChildren",e[0])}else f.push("/home")};return G(()=>{O(k)}),K(()=>{D()}),(t,i)=>{const e=u("SvgIcon"),n=u("el-sub-menu"),l=u("el-menu-item"),y=u("el-menu");return a(),d("div",oe,[r(y,{"default-active":o.value,"background-color":"transparent",mode:"horizontal"},{default:c(()=>[(a(!0),d(R,null,U(C.value,(s,F)=>(a(),d(R,null,[s.children&&s.children.length>0?(a(),v(n,{index:s.path,key:s.path},{title:c(()=>[r(e,{name:s.meta.icon},null,8,["name"]),$("span",null,h(t.$t(s.meta.title)),1)]),default:c(()=>[r(X(w),{chil:s.children},null,8,["chil"])]),_:2},1032,["index"])):(a(),v(l,{index:s.path,key:s.path,style:{"--el-menu-active-color":"#fff"},onClick:N=>x(s,F)},te({_:2},[!s.meta.isLink||s.meta.isLink&&s.meta.isIframe?{name:"title",fn:c(()=>[r(e,{name:s.meta.icon},null,8,["name"]),M(" "+h(t.$t(s.meta.title)),1)]),key:"0"}:{name:"title",fn:c(()=>[$("a",{class:"w100",onClick:ne(N=>E(s),["prevent"])},[r(e,{name:s.meta.icon},null,8,["name"]),M(" "+h(t.$t(s.meta.title)),1)],8,le)]),key:"1"}]),1032,["index","onClick"]))],64))),256))]),_:1},8,["default-active"])])}}}),he=ie(re,[["__scopeId","data-v-57775321"]]);export{he as default};
