import{_ as lt}from"./CAQNniay.js";import{u as Ne,_ as je,a as ct,c as Ie,b as ut,d as dt,e as mt,f as pt,g as ft,h as gt,i as _t,j as ht,A as Ae}from"./Cfh3kXIQ.js";import{_ as vt}from"./B5Zp2Vr1.js";import{l as G,E as a,F as p,N as y,L as D,H as V,V as j,P as f,J as x,Z as B,Q as q,U as v,b as de,k as _,R as yt,_ as kt,$ as bt,u as e,O as wt,a0 as Q,w as Pt,c as ce,D as ue}from"./DEIzhR9A.js";import{_ as $t}from"./Cmn_vM4N.js";import{_ as Ft}from"./DdY_a9Gh.js";import{u as Ct}from"./Cjs1FLPk.js";import{u as Be,a as Dt,_ as xt,t as It,g as At,b as Lt,c as Et,d as Ot,s as Nt}from"./BQ6r7dx2.js";import{_ as jt}from"./34nD6Z6R.js";import{s as Bt}from"./vY_KiDi_.js";import{m as Vt,R as Le}from"./BD6iv5wT.js";import{u as Rt,a as Tt,D as zt}from"./C3UJvzSh.js";import{u as St,a as Wt,b as Kt}from"./wx5q-daT.js";import{u as Ut}from"./DHW4fqPo.js";import{u as Ht}from"./CZbE8ko0.js";import{u as Mt}from"./DiIdhs-Z.js";import{c as Qt}from"./B8i0axnd.js";import{i as Ee}from"./BNS08PCs.js";import"./C5qvglTP.js";import"./ArJcqVXA.js";import"./B_tyb2-9.js";import"./DObx2S2v.js";import"./Dqvtgzyr.js";import"./BJFSaJwp.js";import"./C_YNEQWT.js";import"./AQgvJZua.js";import"./APZTHeFf.js";import"./DAoAjQ1Z.js";import"./-3Z1Icp3.js";import"./B7jNADEc.js";import"./DpUJxqoL.js";import"./_ECBCnJP.js";import"./CYLXjrQd.js";import"./-IL9qb0M.js";import"./CZjMpD9W.js";import"./BlYltdjn.js";import"./CSqzEET8.js";import"./BQKfvuZz.js";import"./DW-wVgF4.js";import"./CzEXYf9D.js";import"./CI0YNt9a.js";import"./BrvZKvXP.js";const qt=n=>(n==null?void 0:n.map(s=>({value:"categoryName"in s?s.categoryName:s.name,to:"categoryName"in s?s.categoryUrl:s.slug})))||[],Gt=(n,s)=>{if(!n)return[];const o=[],u=d=>{var g,m;((g=d.children)!=null&&g.length||(s==null?void 0:s.id)===d.id)&&(o.push({value:d.name,to:d.path}),(m=d==null?void 0:d.children)==null||m.forEach(k=>u(k)))};return u(n),o},Xt=(n,s)=>Array.isArray(n)?qt(n):Gt(n,s),Jt=G({__name:"ProductListBreadcrumbs",props:{breadcrumbs:{type:Array,required:!0}},setup(n){const s=o=>{const{isExactActive:u}=Ne({to:o});return u.value};return(o,u)=>{const d=je,g=ct,m=vt;return a(),p(m,{items:n.breadcrumbs,"align-items":"start"},{default:y(({items:k})=>[D(d,{"only-exact-active":"",to:"/",size:"sm",hover:"underline"},{default:y(()=>u[0]||(u[0]=[V(" Home ")])),_:1}),u[1]||(u[1]=j("span",{class:"text-sm leading-none"}," / ",-1)),(a(!0),f(x,null,B(k,(F,P)=>(a(),f(x,null,[P!==0?(a(),p(d,{key:`breadcrumb-${P}`,to:F.to,size:"sm",hover:"underline",class:"mb-4","only-exact-active":""},{default:y(()=>[s(F.to)?(a(),p(g,{key:0,size:"sm",type:"loud",class:"!mb-0"},{default:y(()=>[V(q(F.value),1)]),_:2},1024)):(a(),f(x,{key:1},[V(q(F.value),1)],64))]),_:2},1032,["to"])):v("",!0),o.$helpers.ui.showDividerTag(P,k.length)&&P!==0?(a(),f("span",{key:`span-${F.value}`,class:"text-sm leading-none"}," / ")):v("",!0)],64))),256))]),_:1},8,["items"])}}}),Zt={class:"flex items-center space-x-4 overflow-y-auto pb-2 scrollbar-thin md:flex-wrap md:justify-center md:overflow-y-hidden md:pb-0"},Yt=G({__name:"CategoryItems",props:{items:{type:Array,default:()=>[]},currentDepth:{type:Number,default:void 0},limit:{type:Number,required:!0},isExpanded:{type:Boolean,default:!1}},setup(n){const s=n,o=u=>s.isExpanded||u<s.limit&&!s.isExpanded;return(u,d)=>{const g=je;return a(),f("div",Zt,[(a(!0),f(x,null,B(n.items,(m,k)=>(a(),f(x,null,[o(k)?(a(),p(g,{key:`quick-filter-item-${m.id}`,class:"block shrink-0",to:m.path,size:"sm"},{default:y(()=>[V(q(m.name),1)]),_:2},1032,["to"])):v("",!0)],64))),256))])}}}),es={key:0,class:"flex items-center justify-center space-x-4"},ts=G({__name:"ProductQuickCategoryNavigation",props:{loading:{type:Boolean,default:!1},categories:{type:Object,default:()=>{}},limit:{type:Number,default:8},currentDepth:{type:Number,default:void 0}},emits:["expanded"],setup(n,{emit:s}){const o=n,u=s,d=Ct(),g=de(!1),m=_(()=>{var L;let I=Ie.getQuickCategoryItems(((L=o.categories)==null?void 0:L.children)??[],o.currentDepth+1);return!I.length&&o.currentDepth>1&&(I=Ie.getQuickCategoryItems(o.categories.children??[],o.currentDepth)),I}),k=()=>{g.value=!0,u("expanded",!0)},F=()=>{g.value=!1,u("expanded",!1)},P=_(()=>m.value.length>=o.limit),X=_(()=>m.value.length<=5);return(I,L)=>{const J=ut,Z=Yt,Y=$t,ee=Ft;return n.loading?(a(),f("div",es,[yt(I.$slots,"loading",kt(bt(n.loading)),()=>[(a(),f(x,null,B(4,R=>D(J,{key:R,type:"link"})),64))])])):(a(),p(ee,{key:1,"spaced-items":"",class:wt([{"justify-start":e(P),"justify-center":e(X)},"min-w-full items-center sm:flex-wrap sm:justify-center"])},{default:y(()=>[D(Z,{limit:e(d).isDesktop?n.limit:e(m).length,"current-depth":n.currentDepth,items:e(m),"is-expanded":e(g)},null,8,["limit","current-depth","items","is-expanded"]),e(d).isDesktop&&e(P)?(a(),p(Y,{key:0,type:"ghost",class:"shrink-0 whitespace-nowrap",size:"sm","no-padding":"",onClick:L[0]||(L[0]=R=>e(g)?F():k())},{default:y(()=>[V(q(I.$t("is_expanded",e(g)?1:2)),1)]),_:1})):v("",!0)]),_:1},8,["class"]))}}}),ss=async(...n)=>{const s=await Be(...n),o=s.fetchProducts;return{...s,fetchProductsDresslife:o}},is={class:"mb-20 sm:flex"},as={key:0,class:"w-full"},rs={class:"items-center justify-between md:flex"},os={key:0,class:"hidden w-1/4 items-start md:flex"},ns={class:"flex w-full justify-center md:w-2/4"},ls={class:"mt-4 flex w-full items-center justify-between md:mt-0 md:w-1/4 md:justify-end"},cs={class:"relative mt-4"},Oe=24,Zs=G({__name:"[...category]",async setup(n){var Fe,Ce;let s,o;const u={name:"Category Product List",id:"CategoryProductList"},d=dt(),{$alert:g,$helpers:m,$i18n:k}=mt(),F=gt(),P=([s,o]=Q(()=>Kt()),s=await s,o(),s),{trackViewItemList:X,trackAddToWishlist:I,trackRemoveFromWishlist:L,trackFilterApply:J,trackSelectItem:Z}=St(),{setPageState:Y}=Wt(),{toggle:ee}=Ut("FilterSlideIn"),{listingColumns:R,setColumns:Ve}=Ht(),{trackOpenPLP:Re,trackFiltersApplied:Te,trackProductsViewed:ze}=Rt(),te=_(()=>Array.isArray(d.params.category)?`${d.params.category.join("/")}`:`${d.params.category}`),me=_(()=>({includedFilters:["sale","isNew","styleGroup"],with:{product:{attributes:{withKey:["colorDetail","brand","name","baseCategories","editedOnlineExclusive","editedPremium",...Bt]},variants:{attributes:{withKey:["price"]},lowestPriorPrice:!0},siblings:{attributes:{withKey:["colorDetail"]}},categories:{properties:{withName:["baseCategories"]}},images:{attributes:{withKey:["imageType","imageView","imageBackground","imageKind"]}},priceRange:!0,lowestPriorPrice:!0}},initialPath:"/"})),{products:se,productsFetching:pe,categories:fe,categoriesFetching:Se,selectedCategory:h,pagination:b,filters:ie,fetchProducts:ge,refreshProductCount:We,productCountData:_e,categoriesError:ae,productError:re,filterError:oe}=([s,o]=Q(()=>Be({key:`useFacet-${te.value}`,params:me.value})),s=await s,o(),s),he=_(()=>(re==null?void 0:re.value)||(oe==null?void 0:oe.value)||(ae==null?void 0:ae.value));Pt(()=>{if(he.value)throw _t({...he.value,statusCode:404,fatal:!0})});const{fetchProductsDresslife:ve}=([s,o]=Q(()=>ss({key:`useFacet-${te.value}`,params:me.value})),s=await s,o(),s),{applyFilters:Ke,activeFilters:T,isActiveFilter:Ue,productConditions:ne,resetFilterUrl:He}=Dt(),Me=pt(zt),ye=Tt(),ke=F.public.dresslife.sortingEnabled,le=_(()=>({path:`/${te.value}`,...ne.value,where:{...ne.value.where},sort:{...ne.value.sort},perPage:Oe,dresslifeClientId:Me.value})),{fetchBySlug:Qe,fetching:be}=Mt(),E=de(),z=d.params.category.includes("lookbooks"),qe=async()=>{var c;await(ke&&ye.value?ve:ge)(le.value);const r=await Qe(`${z?"lookbooks":"categories"}/${(c=h.value)==null?void 0:c.id}`);E.value=r},A=_(()=>{if(h.value!==void 0)return Xt(fe.value,h.value)});ce(()=>Qt(le.value),t=>{const i=ke&&ye.value?ve:ge;return Promise.resolve(i(t)).then(()=>{var r;(r=le.value)!=null&&r.page?we():Ge()})});const we=()=>{var r,c;const t=((((r=b.value)==null?void 0:r.page)||1)-1)*24,i=(c=A==null?void 0:A.value)==null?void 0:c.map(w=>w.value.toLowerCase()).join("-");Re(i,t,se.value)},Ge=()=>{var r,c;const t=(r=A.value)==null?void 0:r.map(w=>w.value.toLowerCase()).join("-"),i=(c=Object.entries(T.value))==null?void 0:c.map(([w,C])=>({key:w,value:String(C)}));Te(i,se.value,t,"category_page")},S=de(!1);ce(T,()=>{S.value=!Ee(T.value)});const Xe=_(()=>{var t;return(t=h.value)==null?void 0:t.name}),l=(Ce=(Fe=E==null?void 0:E.value)==null?void 0:Fe.content)==null?void 0:Ce.SEO,Je=_(()=>S.value?Le.NOINDEX_FOLLOW:Le.INDEX_FOLLOW),Pe=Vt({description:l==null?void 0:l.description,robots:Je.value,socialCards:{twitterCard:l==null?void 0:l.twitter_description,twitterTitle:l==null?void 0:l.twitter_title,twitterImage:l==null?void 0:l.twitter_image,ogTitle:l==null?void 0:l.title,ogDescription:l==null?void 0:l.og_description,ogImage:l==null?void 0:l.og_image}});ft(()=>({title:(l==null?void 0:l.title)??Xe.value,meta:Pe.meta,link:Pe.link}));const Ze=[],Ye=({items:t})=>{var r,c;const i=((((r=b.value)==null?void 0:r.page)||1)-1)*24;X({items:t,listingMetaData:u,paginationOffset:i,source:`category|${(c=h.value)==null?void 0:c.id}`}),et(t),Ze.push(...t)},et=t=>{ze(t,"category_page")},tt=(t,i)=>{var c,w,C,O;const r=((((c=b.value)==null?void 0:c.page)||1)-1)*24;Z({product:t,category:{name:((w=h.value)==null?void 0:w.name)||"",id:(C=h.value)==null?void 0:C.id},listingMetaData:u,index:r+i+1,source:`category|${(O=h.value)==null?void 0:O.id}`,position:r+i+1,soldOut:t.isSoldOut})},st=t=>{Ee(t)||Object.keys(t).forEach(i=>{const r=Array.isArray(t[i])?t[i].join("|"):t[i];J(i,r)}),Ke(t)},it=(t,i)=>{var K,U,H;const r=((K=ht(t.attributes,"name"))==null?void 0:K.label)||k.t("wishlist.product");P.toggleItem({productId:t.id});const c=!P.findItem({productId:t.id}),w=c?k.t("wishlist.notification.add_to_wishlist",{productName:r}):k.t("wishlist.notification.remove_from_wishlist",{productName:r}),C={product:t,listingMetaData:{...u,index:i},category:{id:(U=h.value)==null?void 0:U.id,name:(H=h.value)==null?void 0:H.name}};c?I(C):L(C);const O=c?Ae.route:Ae.confirm;g.show(w.toString(),O,c?m.route.routes.wishlist.path:void 0)},at=async t=>{await We({where:{...It(t)}})},rt=_(()=>Object.values(At(Nt))),ot=_(()=>{var t,i;return(i=(t=E.value)==null?void 0:t.content)==null?void 0:i.listing}),W=_(()=>{var t,i;return(i=(t=E.value)==null?void 0:t.content)==null?void 0:i.pre_listing_content}),$e=_(()=>{var t,i;return(i=(t=E.value)==null?void 0:t.content)==null?void 0:i.post_listing_content}),{isExactActive:nt}=Ne({to:m.route.routes.account.path});return[s,o]=Q(()=>qe().then(()=>{we()})),await s,o(),ce(()=>{var t;return(t=h.value)==null?void 0:t.id},t=>t&&Y("typeId",String(t)),{immediate:!0}),(t,i)=>{var De;const r=lt,c=Jt,w=ts,C=Lt,O=jt,K=Et,U=Ot,H=xt;return a(),f("div",null,[e(W)&&((De=e(b))==null?void 0:De.page)===1&&!e(S)&&e(z)?(a(!0),f(x,{key:0},B(e(W),N=>(a(),p(r,{key:N._uid,"placeholder-ratio":t.$device.isMobile?"1/1":"16/9",ssr:""},{default:y(()=>[(a(),p(ue(N.component),{blok:N},null,8,["blok"]))]),_:2},1032,["placeholder-ratio"]))),128)):v("",!0),D(H,null,{default:y(()=>{var N,xe;return[j("div",is,[e(nt)?v("",!0):(a(),f("div",as,[e(z)?v("",!0):(a(),p(r,{key:0,ssr:""},{default:y(()=>[j("div",rs,[e(A)?(a(),f("div",os,[D(c,{breadcrumbs:e(A)},null,8,["breadcrumbs"])])):v("",!0),j("div",ns,[D(w,{"current-depth":e(h)?e(h).depth:1,loading:e(Se),categories:e(fe)},null,8,["current-depth","loading","categories"])]),j("div",ls,[e(A)?(a(),p(c,{key:0,class:"hidden sm:block md:hidden",breadcrumbs:e(A)},null,8,["breadcrumbs"])):v("",!0),D(C,{"onClick:filter":e(ee),"onClick:selectedColumn":e(Ve)},null,8,["onClick:filter","onClick:selectedColumn"])])])]),_:1})),e(W)&&((N=e(b))==null?void 0:N.page)===1&&!e(S)&&!e(z)?(a(!0),f(x,{key:1},B(e(W),$=>(a(),p(r,{key:$._uid,"placeholder-ratio":t.$device.isMobile?"1/1":"16/9",ssr:""},{default:y(()=>[(a(),p(ue($.component),{blok:$},null,8,["blok"]))]),_:2},1032,["placeholder-ratio"]))),128)):v("",!0),j("div",cs,[D(O,{refreshing:e(pe)||e(be),loading:e(pe)||e(be),columns:e(R),products:e(se),"per-page":Oe,disruptors:e(ot),"is-in-wishlist":(xe=e(P))==null?void 0:xe.findItem,"onClick:toggleProductWishlist":i[0]||(i[0]=($,M)=>it($,M)),"onClick:product":tt,"onIntersect:row":Ye},null,8,["refreshing","loading","columns","products","disruptors","is-in-wishlist"]),e(ie)&&e(ie).length?(a(),p(K,{key:0,filters:e(ie),sorting:e(rt),"active-filters":e(T),"product-count":e(_e)?e(_e).count:e(b)&&e(b).total,"is-active-filter":e(Ue),onFilter:st,onFilterStateChanged:i[1]||(i[1]=$=>at($)),onReset:e(He)},null,8,["filters","sorting","active-filters","product-count","is-active-filter","onReset"])):v("",!0)]),D(r,null,{default:y(()=>[e(b)?(a(),p(U,{key:0,"current-page":e(b).page,"first-page":e(b).first,"last-page":e(b).last},null,8,["current-page","first-page","last-page"])):v("",!0)]),_:1}),(a(!0),f(x,null,B(e($e),$=>(a(),p(r,{key:$._uid,"placeholder-ratio":"16/9"},{default:y(()=>{var M;return[e($e)&&((M=e(b))==null?void 0:M.page)===1?(a(),p(ue($.component),{key:0,blok:$},null,8,["blok"])):v("",!0)]}),_:2},1024))),128))]))])]}),_:1})])}}});export{Zs as default};