import{aI as te,d as ae,e as ne,ax as se,aJ as A,_ as re}from"./BmsEUx_s.js";import{_ as ie}from"./Bgk-2nau.js";import{_ as oe}from"./CaS-jcgw.js";import{k as le,l as y,r as de,a as ce,b as F,G as s,M as i,O as o,V as c,u as l,P as b,a7 as w,H as S,I as v,a3 as H,a1 as p,Q as C,X as f,aK as pe,ay as ue,az as me,aA as ge,aL as he,aE as fe,ax as xe,aB as be}from"./BO9AmBA3.js";import{r as we}from"./CmjS35KU.js";import{g as ve,b as _e}from"./CUL2_9oX.js";const ke={class:"cms-element-yt-woc-categories max-w-screen-2xl container grid lg:grid-rows-[auto_1fr] lg:grid-cols-[1fr_3fr] md:px-4 mx-auto my-5 md:my-20"},Ne={class:"w-fit max-w-100 mx-auto lg:ml-10.5 lg:mr-0"},ye={class:"text-center lg:text-left text-7 lg:text-9 text-yt-white font-bebasneuebold leading-tight tracking-extra whitespace-nowrap mb-6 lg:mb-6"},Ce={class:"flex flex-row justify-center lg:justify-start mb-6 lg:mb-8"},Ie={class:"row-start-3 lg:row-start-2 w-full flex flex-col items-center lg:items-start"},Se=["aria-label","onClick"],$e={class:"flex items-center gap-x-2.5"},Te={class:"font-bebasneue font-500 uppercase tracking-[2px]"},Be={key:0,class:"para-4 tracking-extra"},Ee={key:1,class:"para-4 tracking-extra"},Pe={class:"row-start-2 lg:row-span-2 lg:col-start-2 overflow-hidden"},Ve={class:"max-w-100 mx-auto"},Me={class:"flex justify-center mt-5 book-4 text-yt-white tracking-widest"},We={key:1},ze=["aria-label"],Le=["aria-label"],Ue=le({__name:"CmsElementYtWocCategories",props:{content:{}},setup(D){var M,W,z,L;const Y=ve(),$=D,B=te(A).greaterOrEqual("lg"),G=ae();ne(G);const{getConfigValue:U}=se($.content),q=y(()=>U("title")),J=y(()=>{var t;return(t=$.content.data)==null?void 0:t.dividerLogo}),T=y(()=>{var t;return(t=$.content.data)==null?void 0:t.categories.sort((a,n)=>{const g=a.position||Number.POSITIVE_INFINITY,x=n.position||Number.POSITIVE_INFINITY;return gT.value?T.value.reduce((a,n)=>(n.parent&&!a.includes(n.parent)&&a.push(n.parent),a),[]).map(a=>{var n;return{parentName:a,categories:((n=T.value)==null?void 0:n.filter(g=>g.parent===a))||[]}}):[]),d=de({parentName:(W=(M=u.value)==null?void 0:M[0])==null?void 0:W.parentName,expandedCategory:(L=(z=u.value)==null?void 0:z[0])==null?void 0:L.categories[0]}),_=t=>d.parentName===t.parentName,m=t=>d.expandedCategory===t,k=ce(new Map),K=(t,a)=>{const n=new Map(k.value);n.set(t,a),k.value=n},E=t=>{const a=k.value.get(d.parentName);if(a){const n=a.slides.findIndex(g=>g.dataset.categoryPath===t.path);n!==-1&&a.slideTo(n)}},P=t=>{d.parentName=t.parentName,d.expandedCategory=t.categories[0]||null,E(d.expandedCategory)},Q=t=>{d.expandedCategory=t,E(t)},X=({realIndex:t})=>{const a=u.value.find(_),n=d.expandedCategory?a==null?void 0:a.categories.indexOf(d.expandedCategory):-1;a&&n!==t&&(d.expandedCategory=a==null?void 0:a.categories[t])};F(()=>k.value,t=>{t.forEach((a,n)=>{a==null||a.on("activeIndexChange",X)})}),F(()=>u,()=>{var t;P((t=u.value)==null?void 0:t[0])});const V=y(()=>k.value.get(d.parentName)),R=[ue,me,ge,he,fe];return(t,a)=>{const n=re,g=ie,x=oe,Z=xe,ee=be;return s(),i("div",ke,[o("div",Ne,[o("h2",ye,c(l(q)),1),o("div",Ce,[(s(!0),i(b,null,w(l(u),r=>(s(),S(n,{key:`parent-${r.parentName}`,class:"!b-yt-white !py-1 !mx-0 whitespace-nowrap",theme:_(r)?"white":"black",size:"large",fullWidth:!0,onClick:e=>P(r),"aria-label":r.parentName},{default:v(()=>[H(c(r.parentName),1)]),_:2},1032,["theme","onClick","aria-label"]))),128))])]),o("div",Ie,[(s(!0),i(b,null,w(l(u),r=>(s(),i("div",{key:`details-${r.parentName}`},[(s(!0),i(b,null,w(r.categories,e=>{var N,I,h,j,O;return s(),i("div",{key:`details-${e.path}`,class:p([_(r)?"flex-col":"invisible h-0 opacity-0",m(e)?"flex items-center lg:items-start":"hidden lg:flex"])},[o("button",{class:"group flex flex-col lg:flex-row text-left items-center bg-transparent","aria-label":t.$t("ytWoc.categories.selectCategory"),onClick:Oe=>Q(e)},[C(g,{class:p(["w-9 lg:w-8 h-auto object-cover rounded-full transition-all duration-300 ease-in-out lg:mr-2.5",m(e)?"mb-1 lg:mb-2.5":"lg:mb-1.5 pr-2 scale-70 opacity-20 group-hover:opacity-100"]),src:(N=e.ridingStyleIcon)==null?void 0:N.url,alt:e.name,width:(h=(I=e.ridingStyleIcon)==null?void 0:I.metaData)==null?void 0:h.width,height:(O=(j=e.ridingStyleIcon)==null?void 0:j.metaData)==null?void 0:O.height},null,8,["class","src","alt","width","height"]),o("div",$e,[o("div",{class:p(["leading-none tracking-[5px] py-4 transition-all duration-300 ease-in-out",m(e)?"book-2 text-white":"text-lg font-bebasneuebook text-[#969696] group-hover:text-white"])},c(("removeBrandName"in t?t.removeBrandName:l(we))(e.name)),3),e.isNew?(s(),i("div",{key:0,class:p(["flex items-center justify-center text-center bg-yt-red-400 text-yt-black transition-all duration-300 ease-in-out",m(e)?"h-5.5 md:h-7.5 px-1.5 md:px-2.75 text-md md:text-lg line-height-[18px]":"h-5.5 px-1.5 text-md line-height-[16px]"])},[o("span",Te,c(t.$t("ytWoc.categories.new")),1)],2)):f("",!0)])],8,Se),o("div",{class:p(["flex flex-col items-center lg:items-start gap-y-5 transition-all duration-600 ease-in-out lg:ml-10.5",m(e)?"h-auto pt-3":"h-0 overflow-hidden"])},[o("div",{class:p(["text-center lg:text-left text-yt-red-400 transition-all duration-600 ease-in-out",!m(e)&&"opacity-0"])},[e.productBrandName?(s(),i("span",Be,c(`${e.productBrandName} `),1)):f("",!0),e.brandSlogan?(s(),i("span",Ee,c(`${e.productBrandName?"// ":""}${e.brandSlogan}`),1)):f("",!0)],2),C(n,{class:p(["!b-yt-white !py-2 !mx-0 transition-all duration-600 ease-in-out",!m(e)&&"opacity-0"]),theme:"black",size:"large",to:l(_e)(e.path+"/",l(Y)),"aria-label":e.buttonText||t.$t("ytWoc.categories.discover",{name:e.name})},{default:v(()=>[H(c(e.buttonText||t.$t("ytWoc.categories.discover",{name:e.name})),1)]),_:2},1032,["class","to","aria-label"])],2)],2)}),128))]))),128))]),o("div",Pe,[C(pe,{name:"wocswiperlist",tag:"div"},{default:v(()=>[(s(!0),i(b,null,w(l(u).filter(_),r=>(s(),S(ee,{key:`slide-${r.parentName}`,class:p(["relative transition-all duration-600 ease-in-out",_(r)?"h-auto":"opacity-0 h-0"]),onSwiper:e=>K(r.parentName,e),modules:R,slidesPerView:1,loop:!0,speed:450,effect:"creative",breakpoints:{[l(A).lg]:{noSwiping:!0,noSwipingClass:"swiper-slide"}},creativeEffect:{prev:{translate:l(B)?["-15%",0,0]:[0,0,0],opacity:0},next:{translate:l(B)?["-15%",0,0]:[0,0,0],opacity:0}}},{"container-end":v(()=>{var e,N;return[((e=r.categories)==null?void 0:e.length)>1?(s(),i("button",{key:0,type:"button",class:"button-prev lg:hidden absolute z-2 w-4.5 h-full p-5 bg-transparent bg-center bg-no-repeat left-1 top-0 outline-none","aria-label":t.$t("ytWoc.categories.previous"),onClick:a[0]||(a[0]=I=>{var h;return(h=l(V))==null?void 0:h.slidePrev()})},null,8,ze)):f("",!0),((N=r.categories)==null?void 0:N.length)>1?(s(),i("button",{key:1,type:"button",class:"button-next lg:hidden absolute z-2 w-4.5 h-full p-5 bg-transparent bg-center bg-no-repeat right-1 top-0 outline-none","aria-label":t.$t("ytWoc.categories.next"),onClick:a[1]||(a[1]=I=>{var h;return(h=l(V))==null?void 0:h.slideNext()})},null,8,Le)):f("",!0)]}),default:v(()=>[(s(!0),i(b,null,w(r.categories,e=>(s(),S(Z,{key:`image-${e.path}`,class:"px-4 md:px-auto","data-category-path":e.path},{default:v(()=>[C(x,{autoHeight:!0,content:{data:{media:e.highlightedProductImage,url:e.path+"/",newTab:!1},config:{}}},null,8,["content"])]),_:2},1032,["data-category-path"]))),128)),(s(!0),i(b,null,w(r.categories,e=>(s(),i("div",{key:`label-${e.path}`,class:p(["hidden lg:block transition-all duration-300 ease-in-out",m(e)?"h-auto":"h-0 opacity-0"])},[o("div",Ve,[C(x,{class:"filter-invert-[.9]",autoHeight:!0,content:{data:{media:e.brandLogo},config:{}}},null,8,["content"])]),o("div",Me,[o("span",null,c(`${e.frontTravel} MM`),1),e.rearTravel!==0?(s(),S(x,{key:0,class:"!w-9 !mx-4",autoHeight:!0,content:{data:{media:l(J)},config:{}}},null,8,["content"])):f("",!0),e.rearTravel!==0?(s(),i("span",We,c(`${e.rearTravel} MM`),1)):f("",!0)])],2))),128))]),_:2},1032,["class","onSwiper","breakpoints","creativeEffect"]))),128))]),_:1})])])}}});export{Ue as default};