var ke=Object.defineProperty;var $e=(e,t,s)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var $=(e,t,s)=>($e(e,typeof t!="symbol"?t+"":t,s),s);import{D as T,E as B,x as c,h as f,I as L,J as O,C as l,U as F,T as p,k as g,l as b,z as M,L as C,M as D,F as P,n as j,j as w,a5 as R,Q as ue,a6 as oe,a7 as Oe,P as x,O as Ce,v as Me}from"./CLkPlaab.js";import{u as fe,f as Pe,P as Te}from"./DDp4Oosk.js";import{f as pe,a as ge,m as Ae,b as je}from"./Bu7c2All.js";import{f as se}from"./CXnv8yYB.js";const De=B({name:"CatalogCategorySetter",props:["data","categoryType"],setup(e){return{userStore:fe()}},created(){this.categoryType==="all"?(this.userStore.unsetActiveProductMainCategory(),this.userStore.unsetActiveProductSubCategory()):this.categoryType==="main"?(this.userStore.unsetActiveProductSubCategory(),this.userStore.setActiveProductMainCategory(this.data)):this.categoryType==="sub"&&this.userStore.setActiveProductSubCategory(this.data)}},"$wFvseT681c");function Be(e,t,s,o,i,n){return c(),f("div")}const Hs=T(De,[["render",Be]]),Re=B({name:"LappsetMultiSelect",components:{FontAwesomeIcon:L},props:["options","selectedOptions","fieldKey","label","type"],data(){return{isCategorySelectOpen:!1,open:!1,chevUp:pe.faChevronUp,chevDown:ge.faChevronDown}},beforeMount(){document.addEventListener("click",this.close)},beforeUnmount(){document.removeEventListener("click",this.close)},methods:{close(e){this.$el.contains(e.target)||(this.open=!1)},toggleOpen(e){this.open=!this.open},toggleOption(e){this.$emit("togglefilter",{key:this.fieldKey,type:this.type,value:e})}}},"$JZcWhVyc37"),Le=["id"],Ne={class:"flex justify-between"},Ie={class:"flex-shrink truncate"},Ge={key:0,class:"font-semibold"},Ve={class:"z-20 absolute top-14 w-full bg-white drop-shadow-md max-h-96 overflow-y-auto max-w-xs"},_e=["onClick"];function Ee(e,t,s,o,i,n){const r=O("font-awesome-icon");return c(),f("div",{class:"relative",id:e.fieldKey},[l("div",{class:M(["bg-white p-3 cursor-pointer rounded-md",e.isCategorySelectOpen?"border-2 border-lappset-sky-900":"border border-gray-400 "]),onClick:t[0]||(t[0]=(...a)=>e.toggleOpen&&e.toggleOpen(...a))},[l("div",Ne,[l("span",Ie,[F(p(e.label)+" ",1),e.selectedOptions&&e.selectedOptions.length?(c(),f("span",Ge,p(`(${e.selectedOptions.length})`),1)):g("",!0)]),l("span",null,[b(r,{class:"px-2 h-4 inline",icon:e.open?e.chevUp:e.chevDown},null,8,["icon"])])])],2),C(l("div",Ve,[(c(!0),f(P,null,j(e.options,(a,u)=>(c(),f("div",{key:u,class:M(["py-2 px-4 cursor-pointer hover:bg-gray-100 border border-gray-50 break-words",e.selectedOptions.includes(a.term)?"bg-lappset-sky-200 font-semibold":""]),onClick:m=>e.toggleOption(a.term)},p(a.term),11,_e))),128))],512),[[D,e.open]])],8,Le)}const he=T(Re,[["render",Ee]]),He=B({name:"LappsetRangeSlider",components:{Slider:Ae},props:["value","max","step"],computed:{rangeValue:{get(){return this.value},set(e){this.$emit("on-range-value-change",e)}}}},"$zuGfHxaYpF");function Ue(e,t,s,o,i,n){const r=O("Slider");return c(),w(r,{modelValue:e.rangeValue,"onUpdate:modelValue":t[0]||(t[0]=a=>e.rangeValue=a),max:e.max,classes:{target:"relative box-border select-none touch-none tap-highlight-transparent touch-callout-none disabled:cursor-not-allowed mt-2",handle:"absolute rounded-full bg-white border-0 shadow-slider cursor-grab focus:outline-none h:w-4 h:h-4 h:-top-1.5 h:-right-2 txt-rtl-h:-left-2 txt-rtl-h:right-auto v:w-4 v:h-4 v:-top-2 v:-right-1.25 focus:ring focus:ring-blue-200 focus:ring-opacity-30",tooltip:"absolute block text-sm font-semibold whitespace-nowrap py-1 px-1.5 min-w-5 text-center text-white rounded bg-lappset-sky-900 border-lappset-sky-900 transform h:-translate-x-1/2 h:left-1/2 v:-translate-y-1/2 v:top-1/2 merge-h:translate-x-1/2 merge-h:left-auto merge-v:-translate-x-4 merge-v:top-auto tt-focus:hidden tt-focused:block tt-drag:hidden tt-dragging:block",tooltipTop:"bottom-6 h:arrow-bottom merge-h:bottom-3.5 bg-lappset-sky-900",connect:"absolute z-1 top-0 right-0 transform-origin-0 transform-style-flat h-full w-full bg-lappset-sky-900 cursor-pointer tap:duration-300 tap:transition-transform",base:"w-full h-full relative z-1 bg-gray-300 rounded cursor-pointer"},"show-tooltip":"drag",step:e.step},null,8,["modelValue","max","step"])}const ze=T(He,[["render",Ue]]);var ne={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="far",s="ban",o=512,i=512,n=[128683,"cancel"],r="f05e",a="M385.1 419.1L92.9 126.9C64.8 162.3 48 207.2 48 256c0 114.9 93.1 208 208 208c48.8 0 93.7-16.8 129.1-44.9zm33.9-33.9C447.2 349.7 464 304.8 464 256c0-114.9-93.1-208-208-208c-48.8 0-93.7 16.8-129.1 44.9L419.1 385.1zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z";e.definition={prefix:t,iconName:s,icon:[o,i,n,r,a]},e.faBan=e.definition,e.prefix=t,e.iconName=s,e.width=o,e.height=i,e.ligatures=n,e.unicode=r,e.svgPathData=a,e.aliases=n})(ne);const qe=B({name:"CatalogFilterDrawer",components:{LappsetRangeSlider:ze,LappsetMultiSelect:he,FontAwesomeIcon:L},props:["open","facets","selectedFilters","metadata","locale"],emits:["close","on-checkbox-change","on-range-slider-change","on-multiselect-change","on-range-slider-clear"],data(){return{icons:{banIcon:ne.faBan,xIcon:se.faX}}},computed:{inclusiveValue:{get(){var e;return(e=this.selectedFilters)==null?void 0:e.isInclusive},set(e){this.$emit("on-checkbox-change",{key:"isInclusive",type:"boolean",value:e})}},expressValue:{get(){var e;return(e=this.selectedFilters)==null?void 0:e.isExpress},set(e){this.$emit("on-checkbox-change",{key:"isExpress",type:"boolean",value:e})}}},methods:{toggleFilter({key:e,value:t}){this.$emit("on-multiselect-change",{key:e,type:"text",value:t})},onRangeSliderValueChange(e,t){this.$emit("on-range-slider-change",{key:e,type:"number",value:t})},showPriceFilter(){return!!R[this.locale]},formatPrice(e){return ue(e,this.locale,R[this.locale])}}},"$6VVe0Lpdy1"),Xe={key:0,id:"slideover-container",class:"filterdrawer fixed inset-0 w-full h-full z-40"},Ke={class:"block px-4 flex"},We={class:"text-center heading h5 inline-block"},Qe=l("hr",null,null,-1),Ye={id:"filter-checkbox-container",class:"p-4"},Je={key:0,class:"form-check"},Ze={class:"form-check-label inline-block text-gray-800",for:"flexCheckDefault"},xe={key:1,class:"form-check"},et={class:"form-check-label inline-block text-gray-800",for:"flexCheckChecked"},tt=l("hr",null,null,-1),st={key:0,id:"price-filter",class:"p-4"},nt={for:"priceRange",class:"form-label w-full pb-5"},it={key:1,class:"p-4"},ot={for:"impactAreaRange",class:"form-label w-full pb-5"},lt={key:2,class:"p-4"},rt={for:"fallHeightRange",class:"form-label w-full pb-5"},at=l("hr",{class:"mb-4"},null,-1);function ct(e,t,s,o,i,n){var m,y,v,S,A,N,I,G,V,_,E,H,U,z,q,X,K,W,Q;const r=O("font-awesome-icon"),a=O("LappsetRangeSlider"),u=O("LappsetMultiSelect");return e.open?(c(),f("div",Xe,[l("div",{id:"slideover-bg",class:M(["absolute inset-0 w-full h-full bg-gray-900 duration-300 ease-out transition-all",e.open?"opacity-50":" opacity-0"]),onClick:t[0]||(t[0]=h=>e.$emit("close"))},null,2),l("div",{id:"slideover",class:M(["absolute w-full xs:w-96 h-full bg-white right-0 top-0 duration-300 ease-out transition-all",e.open?"":"translate-x-full"])},[l("div",Ke,[l("button",{onClick:t[1]||(t[1]=h=>e.$emit("close"))},[b(r,{size:"lg",icon:e.icons.xIcon,class:"pr-4 h-4 inline"},null,8,["icon"])]),l("span",We,p(e.$t("Filters")),1)]),Qe,l("div",Ye,[(m=e.facets)!=null&&m.isInclusive?(c(),f("div",Je,[C(l("input",{id:"flexCheckDefault","onUpdate:modelValue":t[2]||(t[2]=h=>e.inclusiveValue=h),class:"filter-checkbox",type:"checkbox"},null,512),[[oe,e.inclusiveValue]]),l("label",Ze,p(e.$t("isInclusive")),1)])):g("",!0),(y=e.facets)!=null&&y.isExpress?(c(),f("div",xe,[C(l("input",{id:"flexCheckChecked","onUpdate:modelValue":t[3]||(t[3]=h=>e.expressValue=h),class:"filter-checkbox",type:"checkbox"},null,512),[[oe,e.expressValue]]),l("label",et,p(e.$t("isExpress")),1)])):g("",!0)]),tt,e.showPriceFilter()?(c(),f("div",st,[l("label",nt,p(`${e.$t("priceRange")}: ${e.formatPrice(e.selectedFilters.priceRangeMin/100)} - ${e.formatPrice(e.selectedFilters.priceRangeMax/100)}`),1),b(a,{id:"priceRange",max:e.metadata.highestPrice,value:[e.selectedFilters.priceRangeMin,e.selectedFilters.priceRangeMax],onOnRangeValueChange:t[4]||(t[4]=h=>e.onRangeSliderValueChange("priceRange",h))},null,8,["max","value"]),C(l("button",{class:"inline-table text-black font-bold mt-3",onClick:t[5]||(t[5]=h=>e.$emit("on-range-slider-clear","priceRange"))},[F(p(e.$t("clearPriceRange"))+" ",1),b(r,{icon:e.icons.banIcon,class:"h-4 inline"},null,8,["icon"])],512),[[D,e.selectedFilters.priceRangeMin||e.selectedFilters.priceRangeMax]])])):g("",!0),(v=e.facets)!=null&&v.impactArea?(c(),f("div",it,[l("label",ot,p(`${e.$t("impactArea")}: ${e.selectedFilters.impactAreaMin} - ${e.selectedFilters.impactAreaMax} m²`),1),b(a,{id:"impactAreaRange",max:500,value:[e.selectedFilters.impactAreaMin,e.selectedFilters.impactAreaMax],onOnRangeValueChange:t[6]||(t[6]=h=>e.onRangeSliderValueChange("impactArea",h))},null,8,["value"]),C(l("button",{class:"inline-table text-black font-bold mt-3",onClick:t[7]||(t[7]=h=>e.$emit("on-range-slider-clear","impactArea"))},[F(p(e.$t("clearImpactArea"))+" ",1),b(r,{icon:e.icons.banIcon,class:"h-4 inline"},null,8,["icon"])],512),[[D,e.selectedFilters.impactAreaMin||e.selectedFilters.impactAreaMax]])])):g("",!0),(S=e.facets)!=null&&S.fallHeight?(c(),f("div",lt,[l("label",rt,p(`${e.$t("fallHeight")}: ${e.selectedFilters.fallHeightMin} - ${e.selectedFilters.fallHeightMax} m`),1),b(a,{id:"fallHeightRange",max:((I=(N=(A=e.facets)==null?void 0:A.fallHeight)==null?void 0:N.ranges[0])==null?void 0:I.max)/1e3||3,step:-1,value:[e.selectedFilters.fallHeightMin,e.selectedFilters.fallHeightMax],onOnRangeValueChange:t[8]||(t[8]=h=>e.onRangeSliderValueChange("fallHeight",h))},null,8,["max","value"]),C(l("button",{class:"inline-table text-black font-bold mt-3",onClick:t[9]||(t[9]=h=>e.$emit("on-range-slider-clear","fallHeight"))},[F(p(e.$t("clearFallHeight"))+" ",1),b(r,{icon:e.icons.banIcon,class:"h-4 inline"},null,8,["icon"])],512),[[D,e.selectedFilters.fallHeightMin||e.selectedFilters.fallHeightMax]])])):g("",!0),at,(G=e.facets)!=null&&G.productGroup?(c(),w(u,{key:3,"field-key":"productGroup",label:e.$t("product-groups"),type:e.facets.productGroup.dataType,options:e.facets.productGroup.terms||[],"selected-options":((V=e.selectedFilters)==null?void 0:V.productGroup)||[],class:"px-4 py-1",onTogglefilter:t[10]||(t[10]=h=>e.toggleFilter(h))},null,8,["label","type","options","selected-options"])):g("",!0),(_=e.facets)!=null&&_.mountingOptions?(c(),w(u,{key:4,"field-key":"mountingOptions",label:e.$t("product-mounting-options"),type:e.facets.mountingOptions.dataType,options:e.facets.mountingOptions.terms||[],"selected-options":((E=e.selectedFilters)==null?void 0:E.mountingOptions)||[],class:"px-4 py-1",onTogglefilter:t[11]||(t[11]=h=>e.toggleFilter(h))},null,8,["label","type","options","selected-options"])):g("",!0),(H=e.facets)!=null&&H.mainMaterial?(c(),w(u,{key:5,"field-key":"mainMaterial",label:e.$t("Material"),type:e.facets.mainMaterial.dataType,options:e.facets.mainMaterial.terms||[],"selected-options":((U=e.selectedFilters)==null?void 0:U.mainMaterial)||[],class:"px-4 py-1",onTogglefilter:t[12]||(t[12]=h=>e.toggleFilter(h))},null,8,["label","type","options","selected-options"])):g("",!0),(z=e.facets)!=null&&z.enStandard?(c(),w(u,{key:6,"field-key":"enStandard",label:e.$t("en-standard"),type:e.facets.enStandard.dataType,options:e.facets.enStandard.terms||[],"selected-options":((q=e.selectedFilters)==null?void 0:q.enStandard)||[],class:"px-4 py-1",onTogglefilter:t[13]||(t[13]=h=>e.toggleFilter(h))},null,8,["label","type","options","selected-options"])):g("",!0),(X=e.facets)!=null&&X.constructionAssessment?(c(),w(u,{key:7,"field-key":"constructionAssessment",label:e.$t("constructionAssessment"),type:e.facets.constructionAssessment.dataType,options:e.facets.constructionAssessment.terms||[],"selected-options":((K=e.selectedFilters)==null?void 0:K.constructionAssessment)||[],class:"px-4 py-1",onTogglefilter:t[14]||(t[14]=h=>e.toggleFilter(h))},null,8,["label","type","options","selected-options"])):g("",!0),(W=e.facets)!=null&&W.ageGroup?(c(),w(u,{key:8,"field-key":"ageGroup",label:e.$t("ageGroup"),type:e.facets.ageGroup.dataType,options:e.facets.ageGroup.terms||[],"selected-options":((Q=e.selectedFilters)==null?void 0:Q.ageGroup)||[],class:"px-4 py-1",onTogglefilter:t[15]||(t[15]=h=>e.toggleFilter(h))},null,8,["label","type","options","selected-options"])):g("",!0)],2)])):g("",!0)}const dt=T(qe,[["render",ct]]),ut=B({name:"LappsetSingleSelect",components:{FontAwesomeIcon:L},props:["options","fieldKey","label","sortObject"],data(){return{open:!1,chevUp:pe.faChevronUp,chevDown:ge.faChevronDown}},mounted(){this.fieldKey==="sortOrder"&&!this.sortObject.sortOrder&&(this.open=!0)},beforeUnmount(){document.removeEventListener("click",this.close)},methods:{close(e){this.$el.contains(e.target)||(this.open=!1)},toggleOpen(e){this.open=!this.open},selectOption(e){this.$emit("onSelectSortBy",{key:this.fieldKey,type:"text",value:e}),this.open=!1}}},"$K9aqKpEAhJ"),ft=["id"],pt={class:"flex justify-between"},gt={class:"flex-shrink truncate"},ht={class:"top-14 w-full bg-white drop-shadow-md max-h-96 overflow-y-auto"},mt=["onClick"];function bt(e,t,s,o,i,n){const r=O("font-awesome-icon");return c(),f("div",{class:"relative",id:e.fieldKey},[l("div",{class:M(["bg-white p-3 cursor-pointer rounded-md",e.open?"border-2 border-lappset-sky-900":"border border-gray-400 "]),onClick:t[0]||(t[0]=(...a)=>e.toggleOpen&&e.toggleOpen(...a))},[l("div",pt,[l("span",gt,p(e.$t(e.label)),1),l("span",null,[b(r,{class:"px-2 h-4 inline",icon:e.open?e.chevUp:e.chevDown},null,8,["icon"])])])],2),C(l("div",ht,[(c(!0),f(P,null,j(e.options,(a,u)=>(c(),f("div",{key:u,class:"py-2 px-4 cursor-pointer hover:bg-gray-100 border border-gray-50 break-words",onClick:m=>e.selectOption(a)},p(e.$t(a.label)),9,mt))),128))],512),[[D,e.open]])],8,ft)}const yt=T(ut,[["render",bt]]);var me={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="far",s="arrow-rotate-left",o=512,i=512,n=[8634,"arrow-left-rotate","arrow-rotate-back","arrow-rotate-backward","undo"],r="f0e2",a="M40 224c-13.3 0-24-10.7-24-24V56c0-13.3 10.7-24 24-24s24 10.7 24 24v80.1l20-23.5C125 63.4 186.9 32 256 32c123.7 0 224 100.3 224 224s-100.3 224-224 224c-50.4 0-97-16.7-134.4-44.8c-10.6-8-12.7-23-4.8-33.6s23-12.7 33.6-4.8C179.8 418.9 216.3 432 256 432c97.2 0 176-78.8 176-176s-78.8-176-176-176c-54.3 0-102.9 24.6-135.2 63.4l-.1 .2 0 0L93.1 176H184c13.3 0 24 10.7 24 24s-10.7 24-24 24H40z";e.definition={prefix:t,iconName:s,icon:[o,i,n,r,a]},e.faArrowRotateLeft=e.definition,e.prefix=t,e.iconName=s,e.width=o,e.height=i,e.ligatures=n,e.unicode=r,e.svgPathData=a,e.aliases=n})(me);const le=[{label:"Ascending",value:"asc"},{label:"Descending",value:"desc"}],vt=B({name:"CatalogSortDrawer",components:{FontAwesomeIcon:L},props:["open","selectedSorting","locale"],data(){let e=[{label:"Product number",value:"variants.sku"},{label:"Newest",value:"variants.attributes.product-new"}];return this.showPriceSort()&&e.push({label:"Price",value:"variants.scopedPrice.currentValue.centAmount"}),{icons:{banIcon:ne.faBan,xIcon:se.faX,resetIcon:me.faArrowRotateLeft},options:e,sortOrderOptions:le,sortObject:{sortBy:null,sortOrder:null}}},mounted(){var e;(e=this.selectedSorting)!=null&&e.sort&&this.initializeSortBy(this.selectedSorting)},methods:{selectFilterBy(e){if(this.sortObject[e.key]=e.value,this.sortObject.sortBy.label==="Newest"){this.sortObject.sortOrder={label:"Descending",value:"desc"},this.$emit("onDropdownSelectChange",this.sortObject);return}if(this.sortObject.sortBy&&this.sortObject.sortOrder){this.$emit("onDropdownSelectChange",this.sortObject);return}},clearSortBy(){this.sortObject={sortBy:"",sortOrder:""},this.$emit("onDropdownSelectChange",this.sortObject)},initializeSortBy({...e}){const[t,s]=e.sort.split(" ");this.sortObject={sortBy:this.options.find(o=>o.value===t),sortOrder:le.find(o=>o.value===s)}},showPriceSort(){return!!R[this.locale]}}},"$MItDUVel9e"),wt={key:0,id:"slideover-container",class:"sortdrawer fixed inset-0 w-full h-full z-40"},St={class:"block px-4 flex"},Ft={class:"text-center heading h5 inline-block"},kt=l("hr",null,null,-1),$t=l("hr",{class:"mb-4"},null,-1),Ot={class:"mr-1"};function Ct(e,t,s,o,i,n){const r=O("font-awesome-icon"),a=yt;return e.open?(c(),f("div",wt,[l("div",{id:"slideover-bg",class:M(["absolute inset-0 w-full h-full bg-gray-900 duration-300 ease-out transition-all",e.open?"opacity-50":" opacity-0"]),onClick:t[0]||(t[0]=u=>e.$emit("close"))},null,2),l("div",{id:"slideover",class:M(["absolute w-full xs:w-96 h-full bg-white right-0 top-0 duration-300 ease-out transition-all",e.open?"":"translate-x-full"])},[l("div",St,[l("button",{onClick:t[1]||(t[1]=u=>e.$emit("close"))},[b(r,{size:"lg",icon:e.icons.xIcon,class:"pr-4 h-4 inline"},null,8,["icon"])]),l("span",Ft,p(e.$t("Sort by")),1)]),kt,$t,b(a,{"field-key":"sortBy",label:e.sortObject.sortBy?e.sortObject.sortBy.label:e.$t("Attribute"),options:e.options,sortObject:e.sortObject,class:"px-4 py-1",onOnSelectSortBy:t[2]||(t[2]=u=>e.selectFilterBy(u))},null,8,["label","options","sortObject"]),e.sortObject.sortBy&&e.sortObject.sortBy.label!="Newest"?(c(),w(a,{key:0,"field-key":"sortOrder",label:e.sortObject.sortOrder?e.sortObject.sortOrder.label:e.$t("Order"),options:e.sortOrderOptions,class:"px-4 py-1",sortObject:e.sortObject,onOnSelectSortBy:t[3]||(t[3]=u=>e.selectFilterBy(u))},null,8,["label","options","sortObject"])):g("",!0),e.sortObject.sortOrder?(c(),f("button",{key:1,onClick:t[4]||(t[4]=(...u)=>e.clearSortBy&&e.clearSortBy(...u)),class:"px-4 py-2 w-full text-right inline-table text-black font-bold my-2"},[l("span",Ot,[b(r,{icon:e.icons.resetIcon,class:"h-5 inline"},null,8,["icon"])]),F(" "+p(e.$t("Reset")),1)])):g("",!0)],2)])):g("",!0)}const Mt=T(vt,[["render",Ct]]);var Pt=typeof global=="object"&&global&&global.Object===Object&&global,Tt=typeof self=="object"&&self&&self.Object===Object&&self,At=Pt||Tt||Function("return this")(),Z=At.Symbol,be=Object.prototype,jt=be.hasOwnProperty,Dt=be.toString,Y=Z?Z.toStringTag:void 0;function Bt(e){var t=jt.call(e,Y),s=e[Y];try{e[Y]=void 0;var o=!0}catch{}var i=Dt.call(e);return o&&(t?e[Y]=s:delete e[Y]),i}var Rt=Object.prototype,Lt=Rt.toString;function Nt(e){return Lt.call(e)}var It="[object Null]",Gt="[object Undefined]",re=Z?Z.toStringTag:void 0;function Vt(e){return e==null?e===void 0?Gt:It:re&&re in Object(e)?Bt(e):Nt(e)}function _t(e){return e!=null&&typeof e=="object"}var Et="[object Boolean]";function Ht(e){return e===!0||e===!1||_t(e)&&Vt(e)==Et}var ye={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="far",s="arrow-left",o=448,i=512,n=[8592],r="f060",a="M7.4 273.4C2.7 268.8 0 262.6 0 256s2.7-12.8 7.4-17.4l176-168c9.6-9.2 24.8-8.8 33.9 .8s8.8 24.8-.8 33.9L83.9 232 424 232c13.3 0 24 10.7 24 24s-10.7 24-24 24L83.9 280 216.6 406.6c9.6 9.2 9.9 24.3 .8 33.9s-24.3 9.9-33.9 .8l-176-168z";e.definition={prefix:t,iconName:s,icon:[o,i,n,r,a]},e.faArrowLeft=e.definition,e.prefix=t,e.iconName=s,e.width=o,e.height=i,e.ligatures=n,e.unicode=r,e.svgPathData=a,e.aliases=n})(ye);var ee={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="far",s="bars",o=448,i=512,n=["navicon"],r="f0c9",a="M0 88C0 74.7 10.7 64 24 64H424c13.3 0 24 10.7 24 24s-10.7 24-24 24H24C10.7 112 0 101.3 0 88zM0 248c0-13.3 10.7-24 24-24H424c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24zM448 408c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24s10.7-24 24-24H424c13.3 0 24 10.7 24 24z";e.definition={prefix:t,iconName:s,icon:[o,i,n,r,a]},e.faBars=e.definition,e.prefix=t,e.iconName=s,e.width=o,e.height=i,e.ligatures=n,e.unicode=r,e.svgPathData=a,e.aliases=n})(ee);var te={},ve={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="far",s="xmark",o=384,i=512,n=[128473,10005,10006,10060,215,"close","multiply","remove","times"],r="f00d",a="M345 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-119 119L73 103c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l119 119L39 375c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l119-119L311 409c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-119-119L345 137z";e.definition={prefix:t,iconName:s,icon:[o,i,n,r,a]},e.faXmark=e.definition,e.prefix=t,e.iconName=s,e.width=o,e.height=i,e.ligatures=n,e.unicode=r,e.svgPathData=a,e.aliases=n})(ve);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ve;e.definition={prefix:t.prefix,iconName:t.iconName,icon:[t.width,t.height,t.aliases,t.unicode,t.svgPathData]},e.faTimes=e.definition,e.prefix=t.prefix,e.iconName=t.iconName,e.width=t.width,e.height=t.height,e.ligatures=t.aliases,e.unicode=t.unicode,e.svgPathData=t.svgPathData,e.aliases=t.aliases})(te);var Ut={exports:{}};(function(e,t){(function(s,o){e.exports=o()})(Oe,function(){return function(s){var o={};function i(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return s[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=s,i.c=o,i.d=function(n,r,a){i.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:a})},i.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},i.t=function(n,r){if(1&r&&(n=i(n)),8&r||4&r&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),2&r&&typeof n!="string")for(var u in n)i.d(a,u,(function(m){return n[m]}).bind(null,u));return a},i.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return i.d(r,"a",r),r},i.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},i.p="dist",i(i.s=0)}([function(s,o,i){var n;function r(a){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(a)}(function(){function a(u,m){var y,v,S;a.installed||(a.installed=!0,m&&m.lodash?(u.lodash=m.lodash,u._=m.lodash,Object.defineProperties(u.prototype,{lodash:{get:function(){return m.lodash}},_:{get:function(){return m.lodash}}}),m.name&&(u[m.name]=m.lodash,Object.defineProperties(u.prototype,(y={},v=m.name,S={get:function(){return m.lodash}},v in y?Object.defineProperty(y,v,{value:S,enumerable:!0,configurable:!0,writable:!0}):y[v]=S,y)))):console.error("You have to install lodash"))}r(o)=="object"?s.exports=a:(n=(function(){return a}).apply(o,[]))===void 0||(s.exports=n)})()}])})})(Ut);const zt={name:"CatalogFilters",components:{FontAwesomeIcon:L},props:["mainCategory","categories","facets","selectedFilters","selectedSorting","categoryType","loadingFacets","metadata","locale"],emits:["set-selected-filter","clear-filters"],setup(){return{userStore:fe()}},data(){return{icons:{faArrowLeft:ye.faArrowLeft,faX:se.faX,faFilter:je.faFilter,faBars:ee.faBars,faTimes:te.faTimes,faSort:Pe.faSort},isCategorySelectOpen:!1,isFilterDrawerOpen:!1,isSortDrawerOpen:!1}},computed:{currentIcon(){return this.isCategorySelectOpen?te.faTimes:ee.faBars},showClearFilters(){return this.selectedFilters.productGroup.length>0||this.selectedFilters.mountingOptions.length>0||this.selectedFilters.mainMaterial.length>0||this.selectedFilters.enStandard.length>0||this.selectedFilters.constructionAssessment.length>0||this.selectedFilters.ageGroup.length>0||this.selectedFilters.isInclusive||this.selectedFilters.isExpress||this.selectedFilters.fallHeightMin||this.selectedFilters.fallHeightMax||this.selectedFilters.impactAreaMin||this.selectedFilters.impactAreaMax||this.selectedFilters.priceRangeMin||this.selectedFilters.priceRangeMax},displayLocale(){return{"nn-NO":"en-GB","da-DK":"en-GB","es-ES":"en-GB"}[this.$i18n.locale]||this.$i18n.locale}},methods:{isBoolean(e){return Ht(e)},toggleCategorySelectOpen(){this.isCategorySelectOpen=!this.isCategorySelectOpen},navigateToCatalogIndexPage(){const e=`/${this.$i18n.locale}/${x.pageCatalog[this.$i18n.locale]}`;this.navigateWithRouterQueryParams(e)},navigateToMainCategoryPage(e){this.userStore.setActiveProductMainCategory(e);const t=e==null?void 0:e.slug[this.$i18n.locale],s=`${x.pageCatalog[this.$i18n.locale]}/${t}`;this.navigateWithRouterQueryParams(s)},navigateToSubCategoryPage(e){this.userStore.setActiveProductMainCategory(this.mainCategory),this.userStore.setActiveProductSubCategory(e);const t=`${this.mainCategory.slug[this.$i18n.locale]}/${e.slug[this.displayLocale]}`;this.navigateWithRouterQueryParams(t)},navigateBackToMainCategoryPage(e){this.userStore.setActiveProductMainCategory();const t=e==null?void 0:e.slug[this.$i18n.locale],s=this.localePath(`/${x.pageCatalog[this.$i18n.locale]}/${t}`);this.navigateWithRouterQueryParams(s)},toggleFilter({key:e,type:t,value:s}){this.$emit("set-selected-filter",{key:e,type:t,value:s})},clearValue({key:e,type:t,value:s}){this.$emit("set-selected-filter",{key:e,type:t,value:s})},onCheckboxChange({key:e,type:t,value:s}){this.$emit("set-selected-filter",{key:e,type:t,value:s})},onRangeSliderFilterChange({key:e,type:t,value:s}){this.$emit("set-selected-filter",{key:e,type:t,value:s})},clearSliderMinMax(e){this.$emit("set-selected-filter",{key:e,type:"number",value:[0,0]})},isValueTruthy(e){return e?!(Array.isArray(e)&&e.length<1):!1},categoryName(e){var t,s,o,i;return e?((t=e==null?void 0:e.name)==null?void 0:t[this.$i18n.locale])||((s=e==null?void 0:e.name)==null?void 0:s[Ce[this.$i18n.locale]])||((o=e==null?void 0:e.name)==null?void 0:o.en)||((i=e==null?void 0:e.name)==null?void 0:i["en-GB"]):"main category"},navigateWithRouterQueryParams(e){this.$router.push({path:e,query:this.$route.query})},formTheSortString(e){return e.sortBy?`${e.sortBy.value} ${e.sortOrder.value}`:null},onSortUpdate({...e}){const t={key:e.sortBy.label,type:"text",value:this.formTheSortString(e)};this.$emit("sortProductsDisplayed",t)},showPriceFilter(){return!!R[this.locale]},formatPrice(e){const t=this.$i18n.locale;if(!R[t])return e;const s=e/100;return ue(s,t,R[this.locale])}}},qt={class:"relative mx-2"},Xt={id:"category-filters-select-container",class:"flex flex-row flex-wrap md:flex-nowrap gap-1 my-2"},Kt={class:"flex justify-between"},Wt={class:"z-10 absolute top-14 bg-white w-full p-3 drop-shadow-md"},Qt={key:0,class:"flex flex-wrap gap-2"},Yt=["onClick"],Jt={key:1},Zt={class:"flex items-center justify-between"},xt={class:"w-full"},es=l("hr",{class:"my-2"},null,-1),ts={class:"flex flex-wrap gap-2 mt-2"},ss=["onClick"],ns={key:2},is={class:"flex items-center justify-between"},os={class:"w-full"},ls=l("hr",{class:"my-2"},null,-1),rs={class:"flex flex-wrap gap-2 mt-2"},as={class:"flex justify-between px-2 mt-4 flex-wrap md:flex-nowrap md:flex-row-reverse"},cs={id:"selected-filters-container",class:"flex flex-wrap gap-1 mt-1 grow-2 order-2 md:order-1"},ds={key:0,class:"flex flex-wrap gap-1"},us=["onClick"],fs={key:1,class:"flex flex-wrap gap-1"},ps=["onClick"],gs={key:2,class:"flex flex-wrap gap-1"},hs=["onClick"],ms={key:0},bs={key:1},ys={class:"flex justify-center py-1 md:justify-between w-full max-w-md"},vs={class:"mr-1"},ws={class:"flex justify-between px-2 my-4 flex-wrap md:flex-nowrap"},Ss={key:0,class:"px-3 my-2"},Fs={class:"mr-1"},ks={class:"text-sm font-light"};function $s(e,t,s,o,i,n){var y,v,S,A,N,I,G,V,_,E,H,U,z,q,X,K,W,Q,h,ie;const r=O("font-awesome-icon"),a=he,u=dt,m=Mt;return c(),f(P,null,[l("div",qt,[l("div",Xt,[s.loadingFacets?g("",!0):(c(),f("div",{key:0,ref:"categoryButton",class:M(["bg-white border-solid w-full md:w-1/4 p-3 cursor-pointer rounded-md",i.isCategorySelectOpen?"border-2 border-lappset-sky-900":"border border-gray-400"]),onClick:t[0]||(t[0]=(...d)=>n.toggleCategorySelectOpen&&n.toggleCategorySelectOpen(...d))},[l("div",Kt,[l("span",null,p(e.$t("Categories")),1),l("span",null,[b(r,{icon:n.currentIcon,class:"h-4 inline"},null,8,["icon"])])])],2)),(v=(y=s.facets)==null?void 0:y.mainFacets)!=null&&v.productGroup?(c(),w(a,{key:1,"field-key":"productGroup",label:e.$t("product-groups"),type:s.facets.mainFacets.productGroup.dataType,"selected-count":23,options:s.facets.mainFacets.productGroup.terms||[],"selected-options":((S=s.selectedFilters)==null?void 0:S.productGroup)||[],class:"w-full md:w-1/4",onTogglefilter:t[1]||(t[1]=d=>n.toggleFilter(d))},null,8,["label","type","options","selected-options"])):g("",!0),(N=(A=s.facets)==null?void 0:A.mainFacets)!=null&&N.mountingOptions?(c(),w(a,{key:2,"field-key":"mountingOptions",label:e.$t("product-mounting-options"),type:s.facets.mainFacets.mountingOptions.dataType,options:s.facets.mainFacets.mountingOptions.terms||[],"selected-options":((I=s.selectedFilters)==null?void 0:I.mountingOptions)||[],class:"w-full md:w-1/4",onTogglefilter:t[2]||(t[2]=d=>n.toggleFilter(d))},null,8,["label","type","options","selected-options"])):g("",!0),(V=(G=s.facets)==null?void 0:G.mainFacets)!=null&&V.mainMaterial?(c(),w(a,{key:3,"field-key":"mainMaterial",label:e.$t("Material"),type:s.facets.mainFacets.mainMaterial.dataType,options:s.facets.mainFacets.mainMaterial.terms||[],"selected-options":((_=s.selectedFilters)==null?void 0:_.mainMaterial)||[],class:"w-full md:w-1/4",onTogglefilter:t[3]||(t[3]=d=>n.toggleFilter(d))},null,8,["label","type","options","selected-options"])):g("",!0),(H=(E=s.facets)==null?void 0:E.mainFacets)!=null&&H.enStandard?(c(),w(a,{key:4,"field-key":"enStandard",label:e.$t("en-standard"),type:s.facets.mainFacets.enStandard.dataType,options:s.facets.mainFacets.enStandard.terms||[],"selected-options":((U=s.selectedFilters)==null?void 0:U.enStandard)||[],class:"w-full md:w-1/4",onTogglefilter:t[4]||(t[4]=d=>n.toggleFilter(d))},null,8,["label","type","options","selected-options"])):g("",!0),(q=(z=s.facets)==null?void 0:z.mainFacets)!=null&&q.constructionAssessment?(c(),w(a,{key:5,"field-key":"constructionAssessment",label:e.$t("constructionAssessment"),type:s.facets.mainFacets.constructionAssessment.dataType,options:s.facets.mainFacets.constructionAssessment.terms||[],"selected-options":((X=s.selectedFilters)==null?void 0:X.constructionAssessment)||[],class:"w-full md:w-1/4",onTogglefilter:t[5]||(t[5]=d=>n.toggleFilter(d))},null,8,["label","type","options","selected-options"])):g("",!0),(W=(K=s.facets)==null?void 0:K.mainFacets)!=null&&W.ageGroup?(c(),w(a,{key:6,"field-key":"ageGroup",label:e.$t("ageGroup"),type:s.facets.mainFacets.ageGroup.dataType,options:s.facets.mainFacets.ageGroup.terms||[],"selected-options":((Q=s.selectedFilters)==null?void 0:Q.ageGroup)||[],class:"w-full md:w-1/4",onTogglefilter:t[6]||(t[6]=d=>n.toggleFilter(d))},null,8,["label","type","options","selected-options"])):g("",!0)]),C(l("div",Wt,[s.categoryType==="all-products"?(c(),f("div",Qt,[(c(!0),f(P,null,j(s.categories,d=>(c(),f("div",{key:d.id},[l("div",{class:"p-2 rounded min-w-min cursor-pointer bg-gray-100 hover:bg-gray-300",onClick:k=>n.navigateToMainCategoryPage(d)},p(d.name[n.displayLocale]||d.key),9,Yt)]))),128))])):s.categoryType==="main-category"?(c(),f("div",Jt,[l("div",Zt,[l("div",xt,[l("button",{class:"hover:underline font-bold",onClick:t[7]||(t[7]=(...d)=>n.navigateToCatalogIndexPage&&n.navigateToCatalogIndexPage(...d))},[b(r,{icon:i.icons.faArrowLeft,class:"mr-2 h-4 inline"},null,8,["icon"]),F(" "+p(e.$t("Back to all products")),1)])])]),es,l("div",ts,[(c(!0),f(P,null,j(s.categories,d=>(c(),f("div",{key:d.id},[l("div",{class:"p-2 rounded min-w-min cursor-pointer bg-gray-100 hover:bg-gray-300",onClick:k=>n.navigateToSubCategoryPage(d)},p(d.name[n.displayLocale]||d.key),9,ss)]))),128))])])):s.categoryType==="sub-category"?(c(),f("div",ns,[l("div",is,[l("div",os,[l("button",{class:"hover:underline font-bold",onClick:t[8]||(t[8]=d=>n.navigateBackToMainCategoryPage(s.mainCategory))},[b(r,{icon:i.icons.faArrowLeft,class:"mr-2 h-4 inline"},null,8,["icon"]),F(" "+p(`${e.$t("Back to ")}${n.categoryName(s.mainCategory)}`),1)])])]),ls,l("div",rs,[l("em",null,p(e.$t("No subcategories")),1)])])):g("",!0)],512),[[D,i.isCategorySelectOpen]])]),Object.keys((h=s.facets)==null?void 0:h.drawerFacets).length>0?(c(),w(u,{key:0,open:i.isFilterDrawerOpen,facets:s.facets.drawerFacets,"selected-filters":s.selectedFilters,metadata:s.metadata,locale:s.locale,onClose:t[9]||(t[9]=d=>i.isFilterDrawerOpen=!i.isFilterDrawerOpen),onOnCheckboxChange:t[10]||(t[10]=d=>n.onCheckboxChange(d)),onOnRangeSliderChange:t[11]||(t[11]=d=>n.onRangeSliderFilterChange(d)),onOnMultiselectChange:t[12]||(t[12]=d=>n.toggleFilter(d)),onOnRangeSliderClear:t[13]||(t[13]=d=>n.clearSliderMinMax(d))},null,8,["open","facets","selected-filters","metadata","locale"])):g("",!0),Object.keys((ie=s.facets)==null?void 0:ie.drawerFacets).length>0?(c(),w(m,{key:1,open:i.isSortDrawerOpen,facets:s.facets.drawerFacets,"selected-filters":s.selectedFilters,"selected-sorting":s.selectedSorting,locale:s.locale,onClose:t[14]||(t[14]=d=>i.isSortDrawerOpen=!i.isSortDrawerOpen),onOnDropdownSelectChange:t[15]||(t[15]=d=>n.onSortUpdate(d))},null,8,["open","facets","selected-filters","selected-sorting","locale"])):g("",!0),l("div",as,[l("div",cs,[l("div",null,[n.showClearFilters?(c(),f("div",{key:0,class:"p-2 py-3 min-w-min cursor-pointer border-gray-400 bg-gray-300 text-sm hover:bg-red-300 rounded-md",onClick:t[16]||(t[16]=d=>e.$emit("clear-filters"))},p(e.$t("Clear filters")),1)):g("",!0)]),(c(!0),f(P,null,j(s.selectedFilters,(d,k,Se)=>C((c(),f("div",{key:Se},[Array.isArray(d)&&d.length>0?(c(),f("div",ds,[(c(!0),f(P,null,j(d,(J,Fe)=>(c(),f("div",{key:Fe,class:"p-2 min-w-min cursor-pointer border border-gray-400 text-sm hover:bg-gray-300 rounded-md",onClick:Ns=>n.toggleFilter({key:k,type:"text",value:J})},[F(p(J)+" ",1),b(r,{icon:i.icons.faX,class:"ml-1 text-sm h-5 inline"},null,8,["icon"])],8,us))),128))])):n.isBoolean(d)&&d?(c(),f("div",fs,[l("div",{class:"p-2 min-w-min cursor-pointer border border-gray-400 text-sm hover:bg-gray-300 rounded-md",onClick:J=>n.toggleFilter({key:k,type:"boolean",value:!1})},[F(p(e.$t(k))+" ",1),b(r,{icon:i.icons.faX,class:"ml-1 text-sm h-4 inline"},null,8,["icon"])],8,ps)])):typeof d=="number"?(c(),f("div",gs,[l("div",{class:"p-2 min-w-min cursor-pointer border border-gray-400 text-sm hover:bg-gray-300 rounded-md",onClick:J=>n.toggleFilter({key:k,type:"number",value:0})},[(k==="priceRangeMin"||k==="priceRangeMax")&&n.showPriceFilter()?(c(),f("span",ms,p(`${e.$t(k)}: ${n.formatPrice(d)}`),1)):(c(),f("span",bs,p(`${e.$t(k)}: ${d}`),1)),b(r,{icon:i.icons.faX,class:"ml-1 text-sm h-5"},null,8,["icon"])],8,hs)])):g("",!0)])),[[D,n.isValueTruthy(d)]])),128))]),l("div",ys,[l("button",{class:"px-1 inline-table text-black font-bold my-2 md:ml-auto",onClick:t[17]||(t[17]=d=>i.isFilterDrawerOpen=!i.isFilterDrawerOpen)},[l("span",vs,[b(r,{icon:i.icons.faFilter,class:"h-5 inline"},null,8,["icon"])]),F(" "+p(e.$t("More filters")),1)])])]),l("div",ws,[s.metadata?(c(),f("div",Ss,p(s.metadata.total+e.$t(" Results")),1)):g("",!0),l("button",{class:"px-1 inline-table text-black font-bold my-2 md:ml-auto",onClick:t[18]||(t[18]=d=>i.isSortDrawerOpen=!i.isSortDrawerOpen)},[l("span",Fs,[b(r,{icon:i.icons.faSort,class:"h-5 inline"},null,8,["icon"])]),F(" "+p(s.selectedSorting.label?e.$t("Sorted by"):e.$t("Sort by"))+" ",1),l("span",ks,p(s.selectedSorting.label?`${e.$t(s.selectedSorting.label)}`:""),1)])])],64)}const Us=T(zt,[["render",$s]]);var we={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="fas",s="arrow-up",o=384,i=512,n=[8593],r="f062",a="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z";e.definition={prefix:t,iconName:s,icon:[o,i,n,r,a]},e.faArrowUp=e.definition,e.prefix=t,e.iconName=s,e.width=o,e.height=i,e.ligatures=n,e.unicode=r,e.svgPathData=a,e.aliases=n})(we);const Os=B({name:"CatalogProductList",components:{ProductCard:Te,FontAwesomeIcon:L},data(){return{icons:{arrowUpicon:we.faArrowUp}}},props:["products","metadata","loading","currentCategory"],computed:{disableLoadMore(){return this.metadata.count+this.metadata.offset>=this.metadata.total||this.loading}},methods:{loadMoreProducts(){this.$emit("loadmore")},scrollToTop(){window.scroll({top:0,left:0,behavior:"smooth"})}}},"$XhnHxidkya"),Cs={id:"product-list-container"},Ms={key:0,class:"my-5 max-w-screen-xl mx-auto"},Ps={id:"product-card-results-container",class:"grid grid-cols-1 gap-5 mx-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"},Ts={class:"text-center p-5"},As={class:"w-full"},js=["disabled"],Ds={key:1,class:"my-10 max-w-screen-xl mx-auto text-center"},Bs={key:2,class:"text-right max-w-screen-xl mx-auto pb-2"},Rs={class:"mr-1"};function Ls(e,t,s,o,i,n){const r=O("ProductCard"),a=O("font-awesome-icon");return c(),f("div",Cs,[e.products.length?(c(),f("div",Ms,[l("div",Ps,[(c(!0),f(P,null,j(e.products,(u,m)=>(c(),f("div",{key:m},[b(r,{class:"regular-card",fields:u},null,8,["fields"])]))),128))]),l("div",Ts,[l("p",As,p(e.metadata.count+e.metadata.offset+"/"+e.metadata.total),1),l("button",{class:M(["text-white font-semibold p-3 rounded-md",e.disableLoadMore?"bg-gray-300":"bg-lappset-sky-900"]),disabled:e.disableLoadMore,onClick:t[0]||(t[0]=(...u)=>e.loadMoreProducts&&e.loadMoreProducts(...u))},p(e.$t("ShowMore")),11,js)])])):(c(),f("div",Ds,p(e.$t("No results")),1)),e.products.length>12&&!e.loading?(c(),f("div",Bs,[l("button",{id:"scroll-to-top-button",class:"px-2 inline-table text-black font-bold my-2",onClick:t[1]||(t[1]=(...u)=>e.scrollToTop&&e.scrollToTop(...u))},[l("span",Rs,[b(a,{icon:e.icons.arrowUpicon,class:"h-4 inline"},null,8,["icon"])]),F(" "+p(e.$t("Back to top")),1)])])):g("",!0)])}const zs=T(Os,[["render",Ls]]),ae="text",ce="number",de="boolean";class qs{constructor(t,s,o,i){$(this,"selectedFilters");$(this,"selectedSorting");$(this,"router");$(this,"route");$(this,"hasUrlFilters");$(this,"defaultFilters",{productGroup:[],mountingOptions:[],mainMaterial:[],enStandard:[],constructionAssessment:[],ageGroup:[],isInclusive:!1,isExpress:!1,fallHeightMin:0,fallHeightMax:0,impactAreaMin:0,impactAreaMax:0,priceRangeMin:0,priceRangeMax:0});this.selectedFilters=t,this.selectedSorting=s,this.router=i,this.route=o,this.hasUrlFilters=!1}setSelectedFilter({key:t,type:s,value:o}){switch(s){case ae:if(this.selectedFilters[t].includes(o))this.selectedFilters[t]=this.selectedFilters[t].filter(i=>i!==o);else{const i=[...this.selectedFilters[t]];i.push(o),this.selectedFilters[t]=i}break;case ce:if(Array.isArray(o)&&o.length>1)this.selectedFilters[`${t}Min`]=o[0],this.selectedFilters[`${t}Max`]=o[1];else if(this.selectedFilters[`${t}`]=o,!o){const i=t.replace("Min","").replace("Max","");return this.selectedFilters[`${t}Min`]=0,this.selectedFilters[`${t}Max`]=0,this.updateUrl(i,null)}break;case de:this.selectedFilters[t]=o;break}this.updateUrl(t,o)}setSelectedSorting({key:t,value:s}){const o=s||"";this.selectedSorting.sort=o,this.selectedSorting.label=t,this.updateUrl("sort",o)}updateUrl(t,s){const o={...this.route.query};if(!s){delete o[t],this.router.push({query:o});return}o.hasOwnProperty(t)?(o[t]=Array.isArray(s)?s:this.updateQueryValue(o[t],t,s),o[t]||delete o[t]):o[t]=s,this.router.push({query:o})}updateQueryValue(t,s,o){const i=t.split(","),n=i.indexOf(o);return n>-1?i.splice(n,1):s==="sort"?i[0]=o:i.push(o),i.join(",")}turnQueryParamsIntoFilters(){if(this.route.query){this.hasUrlFilters=!0;for(const t in this.route.query)switch(t){case"fallHeight":this.selectedFilters.fallHeightMin=parseInt(this.route.query[t][0]),this.selectedFilters.fallHeightMax=parseInt(this.route.query[t][1]);break;case"priceRange":this.selectedFilters.priceRangeMin=parseInt(this.route.query[t][0]),this.selectedFilters.priceRangeMax=parseInt(this.route.query[t][1]);break;case"impactArea":this.selectedFilters.impactAreaMin=parseInt(this.route.query[t][0]),this.selectedFilters.impactAreaMax=parseInt(this.route.query[t][1]);break;case"isInclusive":case"isExpress":this.selectedFilters[t]=this.route.query[t]==="true";break;case"sort":const s=this.route.query[t];this.selectedSorting.sort=s,s.indexOf("product-new")>-1?this.selectedSorting.label="Newest":s.indexOf("sku")>-1&&(this.selectedSorting.label="Product number");break;case"mainMaterial":case"productGroup":case"mountingOptions":case"ageGroup":this.selectedFilters[t]=this.route.query[t].split(",");break;default:console.error(`${t} is not a valid filter`);break}}}setupFacets(t,s){var o;for(const i in t){const n=t[i];if((n==null?void 0:n.total)!==0){if(n.dataType===ae&&(n.terms.sort((r,a)=>r.term.localeCompare(a.term)),Object.keys(s.value.mainFacets).length>=3?s.value.drawerFacets[i]=n:s.value.mainFacets[i]=n),n.dataType===ce){if(((o=n.ranges[0])==null?void 0:o.count)<1)continue;s.value.drawerFacets[i]=n}n.dataType===de&&(s.value.drawerFacets[i]=n)}}}}class Xs{constructor(t,s){$(this,"locale");$(this,"runtimeConfig");$(this,"localeMap",{"nn-NO":"en-GB","da-DK":"en-GB","es-ES":"en-GB"});this.locale=this.localeMap[t]??t,this.runtimeConfig=s}async fetchProductsData(t,s,o,i,n,r=null,a=null){try{const{data:u,pending:m}=await Me(()=>{const y=r?`&category=${r}`:"",v=a?`&sort=${a}`:"";return $fetch(`commercetools-products?locale=${this.locale}&limit=${i}${v}&offset=${n}${y}`,{method:"POST",body:{facets:s?o:[],...t},baseURL:`${this.runtimeConfig.public.AWS_API_ENDPOINT}/${this.runtimeConfig.public.AWS_API_ENV}/`})},{server:!1},"$eoDunPWeXO");if(!m.value){const{results:y,metaData:v}=u.value,{facets:S,...A}=v;return{results:y,facets:S,rest:A,pending:m.value}}}catch(u){return{error:u}}}async fetchProductsNonReactive(t,s,o,i,n,r=null){try{const a=await fetch(`${this.runtimeConfig.public.AWS_API_ENDPOINT}/${this.runtimeConfig.public.AWS_API_ENV}/commercetools-products?locale=${this.locale}&limit=${i}&offset=${n}${r?`&category=${r}`:""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({facets:s?o:[],...t})}),u=await a.json();if(a.ok){const{results:m,metaData:y}=u,{facets:v,...S}=y;return{results:m,facets:v,rest:S}}}catch(a){return{error:a}}}}export{qs as C,Xs as P,Us as _,Hs as a,zs as b};