import{_ as D}from"./D87SlFqb.js";import{u as S,a as A,w as B,t as R,c as j,d as N,e as V,s as $,b as z,r as w,h as a,f as P,g as k,k as x,j as F,l as L,E as O,q as C,v as G,o as E}from"./B7moA0Zy.js";import{u as H}from"./CQOTW_ES.js";import"./CdxtG-CO.js";import"./CM9z76KS.js";import"./CnjcqSsV.js";const J={key:0},ee={__name:"[slug]",async setup(K){var i,p,y,m,_,v,d,g;let r,u;const{locale:I}=S(),o=A(),{data:e,error:c}=([r,u]=B(()=>L({key:`collections-${o.params.slug}`,query:O,variables:{site:I.value,slug:o.params.slug,section:"collections"},route:o})),r=await r,u(),r);(c.value||e.value&&!e.value.entry)&&R(c.value),H((i=e.value.entry)==null?void 0:i.seo,((p=e.value.entry)==null?void 0:p.tagline)||((y=e.value.entry)==null?void 0:y.title),(m=e.value.entry)==null?void 0:m.description,(v=(_=e.value.entry.mainImage)==null?void 0:_[0])==null?void 0:v.url),j((d=e.value)==null?void 0:d.entry),N()(V((g=e.value)==null?void 0:g.entry));const{avoidScroll:l}=$(z());async function b(f){const t=Object.values(f.categories),s=t[0],n=t[1];t.length===1&&(l.value=!0,await C({query:{productTypes:s.slug}},{replace:!0})),t.length===2&&s.slug==="shower"&&n.slug==="tub"&&(l.value=!0,await C({query:{productTypes:s.slug}},{replace:!0}))}return(f,t)=>{var h;const s=D,n=G,T=w("space"),q=w("lay");return(h=a(e))!=null&&h.entry?P((E(),k("main",J,[x(s,{data:{...a(e).entry}},null,8,["data"]),P((E(),k("section",null,[x(n,{type:"products",onArchiveReady:b,data:{collections:[a(e).entry.slug],filters:["productTypes","features"],types:a(e).entry.types,sortingProducts:a(e).entry.sortingProducts,finishings:!0,groupBy:!0,hideIfEmpty:!0}},null,8,["data"])])),[[T,{x:"m"}]])])),[[q,{gap:"xl"}]]):F("",!0)}}};export{ee as default};