import{u as Be,i as Pe,a as $e,aw as Le,a7 as Te,c as Me,b as Fe,T as Ne,g as Se,m as Ve,_ as De,d as Re,ax as ze,e as Ie}from"./BDl4c6dV.js";import je from"./DIk2Sl4Y.js";import Ae from"./dmkV3TNJ.js";import{_ as Qe}from"./feT97mN1.js";import{_ as Ue,a as Ge}from"./BlmsPmoO.js";import{_ as Oe}from"./DrUHwdXW.js";import{j as qe,a as Ee,k as c,a6 as We,z as He,D,L as r,M as P,O as h,u as o,W as f,I as l,S as x,P as a,U as y,a5 as Je,a2 as oe}from"./DGQDO-VU.js";import{u as Ke}from"./C2MFhLIx.js";import{u as Xe}from"./BNfCQSfg.js";import"./By7gKsnr.js";import"./CcbNvuVW.js";import"./_MKtFqXF.js";import"./CByEd5-Q.js";import"./vscFxidx.js";import"./C6mNxbbv.js";import"./Cu5tR6Ux.js";import"./Dat28EeT.js";const Ye={key:1},Ze={class:"relative mb-5 flex items-center text-4xl lg:left-1/4 lg:mb-6 lg:ml-2 lg:text-6xl"},et={class:"line-height-1 block border-l border-black pl-4 lg:border-none lg:p-0"},tt={class:"mb-16 flex flex-col lg:flex-row"},ot={class:"order-2 lg:w-3/4"},st={class:"flex w-full flex-col justify-between bg-yellow-200 px-9 py-8 text-center md:aspect-[480/580] md:p-8"},nt=a("div",{class:"mb-6 text-xs uppercase leading-none tracking-widest"}," Volgen ",-1),at={class:"mb-2 text-5xl uppercase md:mb-6"},it={class:"mb-6"},lt={class:"block w-full overflow-hidden text-ellipsis"},rt={key:0,class:"flex w-full items-center"},ct=a("span",null,"Niet meer volgen",-1),ut={key:1,class:"flex w-full items-center"},dt=a("span",null,"Favoriet",-1),mt={key:2,class:"flex w-full items-center"},pt={class:"block overflow-hidden text-ellipsis"},_t={class:"order-1 mb-4 lg:w-1/4"},St=qe({name:"BrandDetailPage",__name:"[slug]",async setup(ft){let R,z;const{$i18n:$,$config:L}=Se(),T=Be(),I=T.query,g=T.params,se=Pe(),ne=e=>{se.replace(e)};$e();const{fetchBrandById:ae,brandById:s}=Le(g.slug),{rootCategories:ie,fetchRootCategories:le,fetchingRootCategories:re}=Ke(),k=Ee(!1),j=e=>{var b;const{sort:t,term:i,...u}=I;return{...e,children:e.children.map(j),path:`${e.path}?${new URLSearchParams({...i?{term:i}:{},...t?{sort:t}:{},...u,brand:(b=s.value)==null?void 0:b.id}).toString()}`}},ce={name:"Brand Product List",id:"BrandProductList"},A=c(()=>{var e,t;return((t=(e=s==null?void 0:s.value)==null?void 0:e.customData)==null?void 0:t.isOfflineBrand)||!1}),ue=c(()=>{var e;return(((e=ie.value)==null?void 0:e.categories)||[]).map(j)}),de=c(()=>A.value?g.slug:`merken/${g.slug}`),{data:n,fetchContent:me}=Xe(),{data:M,fetchByQuery:pe}=Te("page|offline-brand"),_e=c(()=>{var e,t;return"gbp_1_"+(((t=(e=n.value)==null?void 0:e.fields)==null?void 0:t.productListBannerPosition)||"banner-1x1")}),fe=c(()=>{var e,t;return"gbp_2_"+(((t=(e=n.value)==null?void 0:e.fields)==null?void 0:t.productListBannerPosition2)||"banner-1x1")}),ge=c(()=>{var e;return{category:"/",where:{attributes:[{key:"brand",type:"attributes",values:[(e=s.value)==null?void 0:e.id]}]},...I.sort?{}:{sort:{sortingKey:`merch-merken-${g.slug}`,direction:"asc"}}}}),ve=c(()=>(n==null?void 0:n.value)||(M==null?void 0:M.value)),v=c(()=>{var e,t,i;return((t=(e=n==null?void 0:n.value)==null?void 0:e.fields)==null?void 0:t.pageTitle)||((i=s==null?void 0:s.value)==null?void 0:i.name)||""});let C=g.slug;if(L.public.brandIdMapping[C]!==void 0&&(C=L.public.brandIdMapping[C]),[R,z]=We(()=>Promise.all([ae({id:C}),me({"fields.pageType":"Content","fields.slug":de.value,limit:1}),pe({"fields.pageType":"Content","fields.slug":"offline-brand"}),le()])),await R,z(),!s.value)throw Me({statusCode:404,statusMessage:"Page Not Found"});Fe(()=>{var B;const e="index,follow",t=$.t("plp.seo_description_short",{categoryName:v.value}),i=$.t("plp.seo_description_long",{categoryName:v.value}),u=((B=v.value)==null?void 0:B.length)>51?t:i,b=Ve({description:u,robots:e,canonical:`${L.public.baseUrl}${T.path}`});return{title:v.value,titleTemplate:S=>$.t("global.title_template_plp",{title:S}),meta:b}});const{favoriteBrands:w,getFavoriteBrands:be,toggleFavorite:he}=Ne(),F=c(()=>{var e,t;return!!((t=(e=w.value)==null?void 0:e.data)!=null&&t.find(i=>{var u;return i.id===`${(u=s==null?void 0:s.value)==null?void 0:u.id}`}))});return He(async()=>{await be()}),(e,t)=>{const i=D("CfComponent"),u=D("CfTopImage"),b=De,Q=Re,N=ze,B=je,S=Ae,U=D("CfProductGridBanner"),ke=Qe,xe=Ue,ye=Ie,Ce=Oe,we=Ge;return A.value?(r(),P(i,{key:0,data:ve.value},null,8,["data"])):(r(),h("div",Ye,[o(n)?(r(),P(u,{key:0,content:o(n),class:"mb-6 md:mb-16"},null,8,["content"])):f("",!0),l(Ce,null,{default:x(()=>{var G,O,q,E,W,H,J,K;return[a("h1",Ze,[l(Q,{to:"/merken/",class:"mr-4 flex items-center lg:hidden"},{default:x(()=>[l(b,{class:"size-4"})]),_:1}),a("span",et,y(v.value),1)]),a("div",tt,[a("div",ot,[(G=o(s))!=null&&G.id?(r(),P(ke,{key:0,"listing-meta-data":ce,"key-suffix":"brand-"+o(g).slug,conditions:ge.value,onRedirect:ne},Je({"gbp_1_banner-1x1":x(()=>{var d,m,p,_,X,Y;return[a("div",st,[nt,a("div",at," Volg "+y((d=o(s))==null?void 0:d.name),1),a("div",it," Jouw favorieten altijd gemakkelijk bovenaan in de merkfilter? Volg om "+y((m=o(s))==null?void 0:m.name)+" toe te voegen. ",1),(p=o(w))!=null&&p.data?f("",!0):(r(),h("button",{key:0,class:"btn btn-default",onClick:t[0]||(t[0]=oe(V=>e.$router.push("/account"),["prevent"]))},[l(N,{class:"size-3 stroke-black"}),a("span",lt,"Volg "+y((_=o(s))==null?void 0:_.name),1)])),(X=o(w))!=null&&X.data?(r(),h("button",{key:1,class:"btn btn-default",onClick:t[1]||(t[1]=oe(V=>{var Z,ee,te;return o(he)(`${(Z=o(s))==null?void 0:Z.id}`,((ee=o(s))==null?void 0:ee.name)||`${(te=o(s))==null?void 0:te.id}`),k.value=!1},["prevent"])),onMouseenter:t[2]||(t[2]=V=>k.value=!0),onMouseleave:t[3]||(t[3]=V=>k.value=!1)},[F.value&&k.value?(r(),h("span",rt,[l(B,{class:"mr-1.5 size-3 stroke-black"}),ct])):f("",!0),F.value&&!k.value?(r(),h("span",ut,[l(S,{class:"-mt-0.5 mr-1.5 size-3.5 fill-none stroke-black"}),dt])):f("",!0),F.value?f("",!0):(r(),h("span",mt,[l(N,{class:"mr-1.5 size-3 stroke-black"}),a("span",pt,"Volg "+y((Y=o(s))==null?void 0:Y.name),1)]))],32)):f("",!0)])]}),_:2},[(q=(O=o(n))==null?void 0:O.fields)!=null&&q.productListBanner&&!((E=o(w))!=null&&E.data)?{name:_e.value,fn:x(()=>{var d,m,p,_;return[l(U,{data:(m=(d=o(n))==null?void 0:d.fields)==null?void 0:m.productListBanner,"banner-format":(_=(p=o(n))==null?void 0:p.fields)==null?void 0:_.productListBannerPosition},null,8,["data","banner-format"])]}),key:"0"}:void 0,(H=(W=o(n))==null?void 0:W.fields)!=null&&H.productListBanner2?{name:fe.value,fn:x(()=>{var d,m,p,_;return[l(U,{data:(m=(d=o(n))==null?void 0:d.fields)==null?void 0:m.productListBanner2,"banner-format":(_=(p=o(n))==null?void 0:p.fields)==null?void 0:_.productListBannerPosition2},null,8,["data","banner-format"])]}),key:"1"}:void 0]),1032,["key-suffix","conditions"])):f("",!0)]),a("div",_t,[l(xe,{categories:ue.value,fetching:o(re),"show-nested-categories":"","key-suffix":"brand-"+o(g).slug},null,8,["categories","fetching","key-suffix"])])]),(K=(J=o(n))==null?void 0:J.fields)!=null&&K.seoText?(r(),P(ye,{key:0,document:o(n).fields.seoText,title:v.value},null,8,["document","title"])):f("",!0)]}),_:1}),l(we)]))}}});export{St as default};