import{T as R,M as j,L as P,H as z}from"./zIqud9eZ.js";import{_ as I}from"./DMpFASdz.js";import{_ as G}from"./DZydo-TU.js";import{_ as S}from"./D2dMp75J.js";import{_ as C,d as v,o as r,c as i,a as s,F as N,s as U,b as c,k as y,q as _,t as u,i as M,n as J,I as W,j as x,J as K,G as F,D as Q,v as X,h as B,E as Y,m as Z,p as $,l as tt}from"./DsBV9JcC.js";import{_ as et,a as ot,b as nt}from"./DCiUpcpX.js";import{_ as st}from"./7DFJNgfD.js";import{_ as at}from"./DpyUwKMj.js";import{_ as rt}from"./C1sj_R9p.js";import{_ as ct,a as lt}from"./CJLvlVQN.js";import{_ as it}from"./XVNHbJcA.js";import{_ as _t}from"./CIiW15y2.js";import{u as dt}from"./PQ3aXp20.js";import"./DK4lbHet.js";import"./6lI1mjPM.js";import"./m_LONng8.js";import"./CY9jtMDh.js";const ut={props:{category:{type:Object,default:{}}},setup(){const e=v(!1);return{showAll:e,toggle:o=>{o.stopImmediatePropagation(),e.value=!e.value}}}},pt={key:0,class:"category-list filter"},mt=["innerHTML"],gt={key:0,class:"subcategory"},ht=["innerHTML"],ft={key:1,class:"show-more"},yt={key:2,class:"show-more open"};function bt(e,n,o,t,d,g){const p=S;return o.category.children&&o.category.children.length?(r(),i("div",pt,[s("div",{class:"title",innerHTML:o.category.name},null,8,mt),(r(!0),i(N,null,U(o.category.children.sort((l,m)=>l.name.localeCompare(m.name)),(l,m)=>(r(),i(N,null,[l.count&&(t.showAll||m<5)?(r(),i("div",gt,[c(p,{to:l.url,title:l.name},{default:y(()=>[s("span",{innerHTML:l.name},null,8,ht)]),_:2},1032,["to","title"])])):_("",!0),m===5&&!t.showAll?(r(),i("div",ft,[s("span",{onClick:n[0]||(n[0]=(...h)=>t.toggle&&t.toggle(...h))},u(e.__("Show more")),1)])):_("",!0),m===4&&t.showAll?(r(),i("div",yt,[s("span",{onClick:n[1]||(n[1]=(...h)=>t.toggle&&t.toggle(...h))},u(e.__("Show less")),1)])):_("",!0)],64))),256))])):_("",!0)}const vt=C(ut,[["render",bt]]),kt={setup(){const e=K(),n=e.public.STORE_CODE,o=e.public.STORE_LANG.replace("_","-"),t=()=>{const d=document.querySelector(".trustpilot-widget");d&&window.Trustpilot!==void 0&&window.Trustpilot.loadFromElement(d)};return M(()=>{J(()=>{t()})}),W({script:[{hid:"trustpilot_widget",type:"text/javascript",src:"https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js",defer:!0,onload:t}]}),{locale:o,storeCode:n}}},wt={key:0,class:"trustpilot-sidebar-widget"},xt=["data-locale","data-review-languages"];function Ct(e,n,o,t,d,g){const p=st;return r(),x(p,null,{default:y(()=>{var l;return[t.storeCode==="dutch"?(r(),i("div",wt,[s("div",{class:"trustpilot-widget","data-locale":t.locale,"data-template-id":"539ad60defb9600b94d7df2c","data-businessunit-id":"4de6e24600006400050fd20c","data-style-height":"500px","data-style-width":"100%","data-theme":"light","data-stars":"5","data-review-languages":((l=t.locale)==null?void 0:l.split("-")[0])||"nl"},null,8,xt)])):_("",!0)]}),_:1})}const Tt=C(kt,[["render",Ct]]),Lt={props:{category:{type:Object,default:null}}},Ht={class:"top-category"},Nt=["innerHTML"];function St(e,n,o,t,d,g){const p=S;return r(),i("div",Ht,[c(p,{to:o.category.url,title:o.category.name},{default:y(()=>[s("span",{innerHTML:o.category.name},null,8,Nt)]),_:1},8,["to","title"])])}const Vt=C(Lt,[["render",St]]),de=F("/img/content/mouse.webp"),ue=F("/img/content/mouse.png"),Bt={props:{...dt,category:{type:Object,default:{}},products:{type:Object,default:{}},breadcrumbs:{type:Array,default:[]}},setup(e){const{$c:n}=tt(),o=Q(),t=X(),d=v(e.category),g=v(e.products),p=v(e.breadcrumbs),l=v(!1),m=B(()=>g.value.filters.find(a=>o.query[a.code])),h=B(()=>n.get("web/secure/pwa_base_url")+o.path.replace(/^\//,"")+(parseInt(o.query.p)>1?`?p=${o.query.p}`:"")),T=()=>{document.dispatchEvent(new CustomEvent("open-catalog-sidebar"))},L=a=>{a.preventDefault();let b={...o.query};g.value.filters.forEach(H=>{delete b[H.code]}),delete b.p,t.push({path:o.path,query:b})},k=()=>{window.localStorage.setItem("lastViewedCategory",`{
                    "id": "${d.value.id}",
                    "url": "${o.href}",
                    "name": "${d.value.name}"
                }`)},w=()=>{const a=document.querySelector(".description .text");a&&(document.querySelector(".description").classList.remove("open"),l.value=a.clientHeight===a.scrollHeight,a.parentElement.setAttribute("data-longer",a.clientHeight!==a.scrollHeight))};return M(()=>{window.scrollTo(0,0),k(),w()}),Y(()=>{const a=t.currentRoute.value.matched[0].props.default;a.category&&(d.value=a.category),a.breadcrumbs&&(p.value=a.breadcrumbs),a.products&&(g.value=a.products),k(),w()}),{canonicalLink:h,category:d,products:g,breadcrumbs:p,descriptionOpen:l,hasActiveFilters:m,TopCategory:Vt,openFilters:T,clearFilters:L}}};const Mt={class:"content box catalog-category"},Ft={class:"category-top-container"},At={key:0,class:"results"},Et={class:"grid grid--4@sm"},Ot={class:"col--9 col--12@md col--4@sm"},qt={class:"category-title"},Dt=["innerHTML"],Rt={key:2,class:"empty-result"},jt={class:"message"},Pt=["title"];const zt={class:"catalog-sidebar-trigger"},It={class:"mobile"},Gt={class:"desktop"},Ut=["innerHTML"];function Jt(e,n,o,t,d,g){const p=R,l=j,m=P,h=I,T=z,L=G,k=vt,w=et,a=Tt,b=ot,H=at,V=nt,A=rt,Wt=S,E=ct,O=it,q=lt,D=_t;return r(),x(D,null,{default:y(()=>[s("div",Mt,[c(T,null,{default:y(()=>[c(p,null,{default:y(()=>[Z(u(t.category?t.category.meta_title||t.category.name:null),1)]),_:1}),c(l,{name:"keywords",content:t.category.meta_keywords},null,8,["content"]),c(l,{name:"description",content:t.category.meta_description},null,8,["content"]),c(m,{rel:"canonical",href:t.canonicalLink},null,8,["href"]),c(h,{alternates:t.category.alternates},null,8,["alternates"])]),_:1}),s("div",Ft,[c(L,{breadcrumbs:t.breadcrumbs,breadcrumb:{title:t.category.name,url:t.category.url},"show-back-button":!0,type:"category"},null,8,["breadcrumbs","breadcrumb"]),t.products.count?(r(),i("span",At,u(e.__(":amount results",{amount:t.products.count})),1)):_("",!0)]),s("div",Et,[c(b,null,{default:y(()=>[c(k,{category:t.category},null,8,["category"]),c(w,{filters:t.products.filters,"hidden-filters":["keuzehulp"],"total-products":t.products.count},null,8,["filters","total-products"]),c(a)]),_:1}),s("main",Ot,[s("div",qt,[s("h1",null,u(t.category.name),1)]),t.category.description?(r(),i("div",{key:0,class:$(["description",{open:t.descriptionOpen}])},[t.category.description?(r(),i("div",{key:0,class:"text",innerHTML:t.category.description},null,8,Dt)):_("",!0),s("div",{class:"read-more",onClick:n[0]||(n[0]=f=>t.descriptionOpen=!0)},u(e.__("Continue reading")),1),s("div",{class:"read-less",onClick:n[1]||(n[1]=f=>t.descriptionOpen=!1)},u(e.__("Close")),1)],2)):_("",!0),t.category.use_page_builder?(r(),x(H,{key:1,data:t.category.page_builder},null,8,["data"])):_("",!0),t.products.count?(r(),i(N,{key:3},[t.category.top_categories.length?(r(),x(A,{key:0,id:"top-categories",class:"top-categories",slides:t.category.top_categories.map(f=>({category:f})),"slide-step":3,"show-arrows":!0,component:t.TopCategory,options:{slides:{perView:"auto",spacing:9}}},null,8,["slides","component"])):_("",!0),_("",!0),s("div",zt,[s("button",{class:"full",onClick:n[3]||(n[3]=(...f)=>t.openFilters&&t.openFilters(...f))},[s("span",It,u(e.__("Filter.")),1),s("span",Gt,u(e.__("Filter :count products",{count:t.products.count})),1)])]),c(E,{total:t.products.count,"default-sort":t.category.default_sort_by},null,8,["total","default-sort"]),c(V,{filters:t.products.filters,"hidden-filters":["keuzehulp"]},null,8,["filters"]),c(O,{class:"col--9 col--4@sm grid grid--9 grid--4@sm","tile-class":"col--3 col--2@sm",products:t.products.items},null,8,["products"]),c(q,{total:t.products.count},null,8,["total"]),t.category.seo_text?(r(),i("div",{key:2,class:"bottom-text",innerHTML:t.category.seo_text},null,8,Ut)):_("",!0)],64)):(r(),i("div",Rt,[c(V,{filters:t.products.filters,"hidden-filters":["keuzehulp"]},null,8,["filters"]),s("div",jt,[s("span",null,u(e.__("We can't find products matching the selection.")),1),t.hasActiveFilters?(r(),i("a",{key:0,href:"#",class:"underline",title:e.__("Clear filters"),onClick:n[2]||(n[2]=(...f)=>t.clearFilters&&t.clearFilters(...f))},u(e.__("Clear filters")),9,Pt)):_("",!0)])]))])])])]),_:1})}const pe=C(Bt,[["render",Jt]]);export{pe as default};