import{_ as $}from"./CrKI66RF.js";import{_ as z}from"./4SHhHuHq.js";import{_ as E}from"./CpqkpWTA.js";import{_ as N}from"./DGPU2ZF4.js";import V from"./CDiLaDxH.js";import{u as j}from"./D9cbKXFb.js";import{h as O}from"./BmsEUx_s.js";import{u as T}from"./Caz6ZtR2.js";import{k as D,a as d,w as G,G as r,H as g,I,u as e,M as w,O as B,X as p,a1 as Q,Q as U}from"./BO9AmBA3.js";const W={key:0},X={class:"sm:hidden bg-yt-black w-full min-h-5 flex justify-between items-center relative z-8"},q={key:0,class:"hidden sm:flex bg-yt-black w-full min-h-5 justify-between items-center relative z-8"},A=B("div",{class:"min-w-50"},null,-1),F={key:1,class:"bg-yt-black w-full h-14"},se=D({__name:"LayoutHeaderBikenav",setup(J){const{currentCategory:a,isBikeCategory:u,isEmtbCategory:b,updateOverviewCategory:S,updateBikeCategories:x,updateModelCategories:M}=j(),l=d(),i=d(),o=d(),f=d();O();const{menu:m}=T(),h=d(!1);G(async()=>{var n,k,v,_;if(u.value||b.value){const c=u.value?"mtbCategory":"emtbCategory",C=u.value?"emtbCategory":"mtbCategory";if(a.value.parentId&&a.value.id){if(a.value.level===4){l.value=a.value;const t=(n=m.value[c].children)==null?void 0:n.find(s=>s.id===a.value.id);o.value=t==null?void 0:t.children}else if([5,6].includes(a.value.level)){const t=a.value.parent;l.value=t;const s=(k=m.value[c].children)==null?void 0:k.find(y=>y.id===(t==null?void 0:t.id));o.value=s==null?void 0:s.children}i.value=[...((v=m.value[c])==null?void 0:v.children)??[],...((_=m.value[C])==null?void 0:_.children)??[]],x(i.value),M(o.value),S(l.value)}}});const H=n=>{f.value=n,h.value=!0},L=()=>{h.value=!1};return(n,k)=>{const v=$,_=z,c=E,C=N,t=V;return r(),g(t,{duration:300},{default:I(()=>{var s,y;return[e(u)||e(b)?(r(),w("nav",W,[B("div",X,[e(o)?(r(),g(v,{key:0,"model-categories":e(o),"overview-category":e(l)},null,8,["model-categories","overview-category"])):p("",!0)]),e(i)?(r(),w("div",q,[e(i)?(r(),g(_,{key:0,"bike-categories":e(i),"overview-category":e(l),"current-category-id":e(a).id,"hide-logo":((s=e(o))==null?void 0:s.length)>6,class:Q(["relative",[e(o).length>6?"lg:min-w-50":"min-w-50"]])},null,8,["bike-categories","overview-category","current-category-id","hide-logo","class"])):p("",!0),e(o)?(r(),g(c,{key:1,"model-categories":e(o),"overview-category":e(l),"current-category-id":e(a).id,"selected-split-category-id":(y=e(f))==null?void 0:y.id,onUpdateSelectedSplitCategory:H},null,8,["model-categories","overview-category","current-category-id","selected-split-category-id"])):p("",!0),A])):(r(),w("div",F)),U(C,{class:"hidden sm:block","selected-category":e(f),"show-split-menu":e(h),onCloseSplitMenu:L},null,8,["selected-category","show-split-menu"])])):p("",!0)]}),_:1})}}});export{se as _};