1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1240],{57171:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[...page]",function(){return l(48957)}])},24011:function(e,t,l){"use strict";l.d(t,{Z:function(){return u}});var i=l(85893),n=l(36340),r=l(43657),a=l(94184),o=l.n(a),s=l(41664),d=l.n(s),c=l(45555);function u(e){var t,l,a;let{color:s,productId:u,className:m,hideTitle:v,inline:h,onClick:x,path:p,imageWidth:g=128}=e,f=(0,r.Z)(s,u);if(!f)return(0,i.jsx)(i.Fragment,{});let j=p?d():x?"button":"div",b=p;return b&&s&&(b+="/"+(null!==(a=null==f?void 0:f.slug)&&void 0!==a?a:(0,n.l)(s))),(0,i.jsxs)(j,{href:b,onClick:x,className:o()({"mt-4 ml-4 w-[45%] sm:w-32":!h},m),children:[(0,i.jsx)("div",{style:{backgroundColor:null==f?void 0:f.color},className:o()("relative aspect-w-1 aspect-h-1 border",{"border-white":!(null==f?void 0:null===(t=f.color)||void 0===t?void 0:t.includes("fff")),"border-gray-200":null==f?void 0:null===(l=f.color)||void 0===l?void 0:l.includes("fff")}),children:(null==f?void 0:f.image)&&(0,i.jsx)(c.Z,{width:g,height:g,sizes:"128px",overrideImageMaxWidth:400,className:"w-full h-full",style:{objectFit:"cover"},sanityImage:null==f?void 0:f.image})}),!v&&(0,i.jsx)("div",{className:"mt-2 text-xs tracking-wider text-center uppercase",children:null==f?void 0:f.name})]})}},17452:function(e,t,l){"use strict";l.d(t,{Z:function(){return m}});var i=l(85893),n=l(67814),r=l(77668),a=l(64019),o=l(88480),s=l(60929),d=l(94184),c=l.n(d),u=l(67294);function m(e){let{isOpen:t,onClose:l,children:d,title:m,zIndex:v="default",hideCloseButton:h=!1,footer:x,fixedHeight:p=!1,titleClassName:g}=e;(0,s.Z)(t);let[f,j]=(0,u.useState)(!0),[b,y]=(0,u.useState)(!0),w=e=>{e&&(j(e.scrollTop<20),y(e.scrollHeight-e.scrollTop-e.clientHeight<20))};return(0,i.jsx)(a.u,{show:t,as:u.Fragment,children:(0,i.jsxs)(o.V,{onClose:l,children:[(0,i.jsx)(a.u.Child,{as:u.Fragment,enter:"transition-opacity ease-in duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,i.jsx)(o.V.Overlay,{className:c()("fixed inset-0 w-full h-full bg-black/50",{"z-40":"default"===v,"z-[70]":"high"===v})})}),(0,i.jsxs)(a.u.Child,{enter:"transition-transform duration-300",enterFrom:"translate-y-full",enterTo:"translate-y-0",leave:"transition duration-300",leaveFrom:"translate-x-0",leaveTo:"translate-y-full",className:c()("fixed inset-x-0 bottom-0 flex flex-col w-full text-base bg-cream-alt rounded-t-[24px] overflow-hidden",p?"h-[99vh] supports-[height:99dvh]:h-[99dvh]":"max-h-[90vh] supports-[height:100dvh]:max-h-[90dvh] lg:max-h-[50vh]",{"z-50":"default"===v,"z-[80]":"high"===v}),children:[m&&(0,i.jsx)(o.V.Title,{className:g||"font-sans text-center mt-4 mb-3 text-base font-bold",children:m}),!h&&(0,i.jsx)("button",{className:"flex absolute top-0 right-0 z-[60] justify-center items-center w-14 h-14 focus:outline-none",onClick:l,children:(0,i.jsx)(n.G,{className:"text-2xl",icon:r.NBC})}),(0,i.jsxs)("div",{className:"overflow-auto flex-1 w-full min-h-0",ref:e=>w(e),onScroll:e=>w(e.currentTarget),children:[(0,i.jsx)("div",{className:c()("fixed z-50 w-full h-4 bg-gradient-to-b from-black/10 to-transparent pointer-events-none transition-opacity ease-linear duration-150",{"opacity-0":f})}),d]}),(0,i.jsx)("div",{className:c()("-mt-4 z-50 w-full h-4 bg-gradient-to-t from-black/10 to-transparent pointer-events-none transition-opacity ease-linear duration-150",{"opacity-0":b})}),x]})]})})}},9713:function(e,t,l){"use strict";l.d(t,{Z:function(){return s}});var i=l(85893),n=l(67814),r=l(77668),a=l(48987),o=l(99606);function s(e){let{onClick:t}=e,l=(0,a.Z)();return(0,i.jsx)("div",{className:"flex justify-center mt-8",children:(0,i.jsxs)(o.Z,{block:!0,onClick:t,variant:"black",children:[(0,i.jsx)(n.G,{icon:r.r8p,className:"mr-2"}),l.general.more_results]})})}},89250:function(e,t,l){"use strict";l.d(t,{Z:function(){return s}});var i=l(85893),n=l(33818),r=l(6508),a=l(20400),o=l(11163);function s(e){var t,l;let{className:s}=e,d=null!==(t=(0,o.useRouter)().locale)&&void 0!==t?t:"sv",{showKlarna:c,showSwish:u,showZaver:m}=null!==(l=a.ZP[d])&&void 0!==l?l:a.ZP.sv,v=27.77777777777778*.5;return(0,i.jsxs)("div",{className:(0,r.cn)("flex items-center justify-center space-x-3 flex-nowrap",s),children:[c&&(0,i.jsx)(n.Z,{height:27.77777777777778,width:44.44444444444444,icon:"klarna"}),u&&(0,i.jsx)(n.Z,{className:"sm:mx-6",height:27.77777777777778,width:44.44444444444444,icon:"swish"}),m&&(0,i.jsx)(n.Z,{className:"sm:mx-6",height:v,width:566/150*v,icon:"zaver"}),(0,i.jsx)(n.Z,{height:27.77777777777778,icon:"visa"}),(0,i.jsx)(n.Z,{height:27.77777777777778,icon:"amex"}),(0,i.jsx)(n.Z,{height:27.77777777777778,icon:"master-card"}),(0,i.jsx)(n.Z,{width:44.44444444444444,icon:"paypal"})]})}},54599:function(e,t,l){"use strict";l.d(t,{Z:function(){return j}});var i=l(85893),n=l(67814),r=l(77668),a=l(14891),o=l(48987),s=l(94184),d=l.n(s),c=l(57681),u=l(70594),m=l(41664),v=l.n(m),h=l(11163),x=l(7321),p=l(56712);function g(e){let{product:t,groupedAsSections:l,groupVariantsAsOne:n}=e,r=(0,c.Z)(t),{locale:a}=(0,h.useRouter)(),o=!n&&r.length>0?(0,i.jsx)(i.Fragment,{children:r.map(e=>(0,i.jsx)(x.Z,{product:t,color:e},"".concat(t.id,"-").concat(e)))}):(0,i.jsx)(x.Z,{product:t});return l&&0!==r.length?(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"mb-4",children:(0,i.jsx)(v(),{href:(0,u.kG)(a,t),children:(0,i.jsx)(p.Z,{as:"h3",type:"section-title",children:t.displayTitle||t.title})})}),(0,i.jsx)("div",{className:d()("grid grid-cols-2 gap-4",r.length>4&&!n?"lg:grid-cols-5":"lg:grid-cols-4"),children:o})]}):o}var f=l(71994);function j(e){let{loading:t,products:l,className:s,groupedAsSections:c,groupVariantsAsOne:u}=e,m=(0,o.Z)(),v=!t&&!!(null==l?void 0:l.length);return(0,i.jsxs)("div",{className:s,children:[!t&&!(null==l?void 0:l.length)&&(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 space-y-4 bg-white lg:py-32",children:[(0,i.jsx)("div",{children:(0,i.jsx)(n.G,{icon:r.tho,className:"text-3xl text-gray-200"})}),(0,i.jsx)("div",{className:"text-sm font-medium sm:text-base",children:m.general.no_search_results})]}),(0,i.jsxs)("div",{children:[t&&(0,i.jsx)("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-5",children:(0,a.r)(6,e=>(0,i.jsx)(f.Z,{},e))}),v&&(0,i.jsx)("div",{className:d()({"space-y-12 sm:space-y-20":c,"grid grid-cols-2 gap-4 lg:grid-cols-5":!c}),children:l.map(e=>(0,i.jsx)(g,{product:e,groupVariantsAsOne:u,groupedAsSections:c},e.id))})]})]})}},89498:function(e,t,l){"use strict";l.d(t,{Q:function(){return i},t:function(){return n}});let i=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;function n(e,t){return Object.keys(e).forEach(l=>{t(l,{type:"root.serverError",message:e[l]}
1)})}},90533:function(e,t,l){"use strict";l.d(t,{Z:function(){return o}});var i=l(99313),n=l(81722),r=l(11163),a=l(67294);function o(){let{productColors:e}=(0,i.rV)(),{locale:t}=(0,r.useRouter)();return(0,a.useMemo)(()=>null==e?void 0:e.map(t=>({title:t.localizedName.sv,colors:e.filter(e=>e.colorGroupId===t._id).map(e=>(0,n.Pu)(e))})).filter(e=>e.colors.length>0),[e])}},25973:function(e,t,l){"use strict";l.d(t,{Z:function(){return v}});var i=l(97772),n=l(39231),r=l(61330),a=l(89922),o=l(1900),s=l(67294),d=l(99313),c=l(81722),u=l(11163),m=l(90533);function v(e,t,l,v){let h=function(e){var t;let{locale:l}=(0,u.useRouter)(),{productColors:i}=(0,d.rV)(),n=(0,m.Z)();if(!e)return[];let r=((null===(t=n.find(t=>t.title===e.baseName))||void 0===t?void 0:t.colors)||[]).map(e=>(0,c.v)(l,i,e));return[e,...r].filter(Boolean)}(t),[x]=(0,o.v1)("tag",o.Oi),p=null!=v?v:x;return(0,s.useMemo)(()=>{let t=!!h.length,o=e.map(e=>e.id),s=e.reduce((e,t)=>(e[t.id]=t,e),{}),d=new Set;return e.map(e=>t?e.options.find(e=>(0,a.u8)(e.name))?{...e,options:e.options.map(e=>{if(!(0,a.u8)(e.name))return e;let t=e.values.filter(e=>h.find(t=>t.name==e||t.baseName==e));return t.length?{...e,values:t}:null})}:null:e).map(e=>{var t;if(!e)return null;if(!l||!(null===(t=e.productGroup)||void 0===t?void 0:t.groupOnCard))return e;let a=(0,i.Z)(e.productGroup,o);if(!a)return e;let d=s[(0,r.xv)(a.productId)];return d?{...d,options:e.options,colorImages:(0,n.Z)({...d,options:e.options})}:e}).filter(e=>{var t,i,n,a,o,c;if(!e||e.options.includes(null))return!1;if(l&&(null===(t=e.productGroup)||void 0===t?void 0:t.groupOnCard)){let t=e.productGroup._id;if(d.has(t))return!1;d.add(t)}return!p||null!==(i=e.tags)&&void 0!==i&&!!i.includes(p)||!!l&&null!==(n=e.productGroup)&&void 0!==n&&!!n.groupOnCard&&(null!==(c=null===(o=e.productGroup)||void 0===o?void 0:null===(a=o.options)||void 0===a?void 0:a.map(e=>(0,r.xv)(e.productId)))&&void 0!==c?c:[]).some(e=>{var t,l;return null===(l=s[e])||void 0===l?void 0:null===(t=l.tags)||void 0===t?void 0:t.includes(p)})})},[h,e,l,p])}},9693:function(e,t,l){"use strict";l.d(t,{Z:function(){return n}});var i=l(49460);function n(){return(0,i.ac)("(min-width: 1024px)")}},39622:function(e,t,l){"use strict";l.d(t,{Z:function(){return r}});var i=l(11163),n=l(67294);function r(e,t){let l=(0,i.useRouter)(),r=l.query.p?parseInt(l.query.p,10):t;return{items:(0,n.useMemo)(()=>e.slice(0,r),[r,e]),showMore:()=>{l.replace({pathname:l.pathname,query:{...l.query,p:r+t}},void 0,{shallow:!0})},hasMore:e.length>r}}},51217:function(e,t,l){"use strict";l.d(t,{J:function(){return r},Z:function(){return d}});var i=l(40105),n=l(67294);let r=30;function a(e){let t=e=>String(e).padStart(2,"0");return"".concat(e.getFullYear(),"-").concat(t(e.getMonth()+1),"-").concat(t(e.getDate()))}function o(e){let t=new Date(e);t.setHours(0,0,0,0);let l=t.getDay();return t.setDate(t.getDate()-(l+6)%7),t}function s(e,t){let l=new Date(e);return l.setDate(l.getDate()+t),l}function d(e){var t;let{variantTitle:l,fetchDays:d=r,preferredDate:c=null,cartId:u=null}=e,[m,v]=(0,n.useState)(()=>({loading:!!l,error:null,slots:[],fromIso:null,toIso:null})),[h,x]=(0,n.useState)(0),p=(0,n.useRef)(null),g=(0,n.useRef)(null),f=(0,n.useMemo)(()=>{let e=new Date;e.setHours(0,0,0,0);let t=s(e,d);return{from:e,to:t}},[d]),j=(0,n.useCallback)(async e=>{var t,l,n;null===(t=p.current)||void 0===t||t.abort();let r=new AbortController;p.current=r,v(e=>({...e,loading:!0,error:null}));try{let t=await (0,i.K9)({variantTitle:e,from:a(f.from),to:a(f.to),cartId:u,signal:r.signal});if(r.signal.aborted)return;v({loading:!1,error:null,slots:t.data,fromIso:null!==(l=t.meta.from)&&void 0!==l?l:a(f.from),toIso:null!==(n=t.meta.to)&&void 0!==n?n:a(f.to)})}catch(e){if(r.signal.aborted)return;v({loading:!1,error:e instanceof Error?e.message:"Unknown error",slots:[],fromIso:null,toIso:null})}},[f,u]);(0,n.useEffect)(()=>{if(l&&g.current!==l)return g.current=l,j(l),()=>{var e;null===(e=p.current)||void 0===e||e.abort()}},[l,j]);let b=(0,n.useMemo)(()=>(function(e,t,l){var i,n;let r=new Map;for(let t of e){let e=null!==(i=r.get(t.date))&&void 0!==i?i:[];e.push(t),r.set(t.date,e)}
1r.forEach(e=>{e.sort((e,t)=>e.start_time<t.start_time?-1:1)});let d=[],c=o(t),u=o(l);for(;c.getTime()<=u.getTime();){let e=c,t=s(e,6),l=[];for(let t=0;t<7;t++){let i=s(e,t),o=a(i);l.push({date:o,label:i,slots:null!==(n=r.get(o))&&void 0!==n?n:[]})}d.push({start:e,end:t,days:l,hasAvailability:l.some(e=>e.slots.length>0)}),c=s(c,7)}return d})(m.slots,f.from,f.to),[m.slots,f.from,f.to]);(0,n.useEffect)(()=>{if(0===b.length)return;if(c){let e=b.findIndex(e=>e.days.some(e=>e.date===c));if(e>=0){x(e);return}}let e=b.findIndex(e=>e.hasAvailability);x(e>=0?e:0)},[b,c]);let y=null!==(t=b[h])&&void 0!==t?t:null,w=h<b.length-1,N=(0,n.useCallback)(()=>{x(e=>Math.max(0,e-1))},[]),_=(0,n.useCallback)(()=>{x(e=>Math.min(b.length-1,e+1))},[b.length]),k=(0,n.useCallback)(()=>{l&&(g.current=null,j(l))},[l,j]);return{loading:m.loading,error:m.error,weeks:b,currentWeek:y,weekIndex:h,canGoPrev:h>0,canGoNext:w,goPrev:N,goNext:_,refetch:k}}},48957:function(e,t,l){"use strict";l.r(t),l.d(t,{__N_SSG:function(){return iq},default:function(){return iA}});var i=l(85893),n=l(66469),r=l(70594),a=l(48987),o=l(11163),s=l(76395),d=l(94184),c=l.n(d),u=l(41664),m=l.n(u),v=l(56712);function h(e){let{parent:t,links:l,children:n}=e;if(!(l&&l.length>0))return(0,i.jsx)(i.Fragment,{children:n});let r=(null==t?void 0:t.href)?m():"div";return(0,i.jsxs)("div",{className:"lg:flex",children:[(0,i.jsx)("div",{className:"max-lg:hidden lg:min-h-screen flex justify-center lg:justify-start w-full lg:w-64 xl:w-[16.667vw] px-4 py-4 pb-0 lg:p-6 lg:py-14 lg:border-r border-black lg:flex-shrink-0",children:(0,i.jsx)("div",{className:"relative",children:(0,i.jsxs)("div",{className:"sticky flex flex-wrap items-center justify-center top-28 lg:items-start lg:justify-start lg:flex-col",children:[!!t&&(0,i.jsx)(r,{href:t.href,className:"p-1.5 lg:px-2 lg:py-3 hidden lg:inline-block",children:(0,i.jsx)(v.Z,{type:"heading-3",as:"div",children:t.title})},t.title),l.map(e=>{let t=c()("text-xs uppercase tracking-widest text-left underline-offset-4 hover:lg:underline decoration-current focus:outline-none inline-block py-2.5 px-1.5 lg:px-2 lg:py-3 h-8 leading-none lg:h-auto lg:leading-normal",{"font-medium text-black -mt-px":e.active,"text-gray-600":!e.active});return e.onClick?(0,i.jsx)("button",{className:t,onClick:e.onClick,children:e.title},e.title):(0,i.jsx)(m(),{href:e.href,target:e.newWindow?"_blank":void 0,className:t,children:e.title},e.title)})]})})}),(0,i.jsx)("div",{className:"overflow-hidden lg:flex-1",children:n})]})}function x(e){let{categories:t=[],children:l,vertical:n,articleIndex:d}=e,c=(0,o.useRouter)(),u=(0,a.Z)(),m=(0,r.sK)(c.locale,d._slug),v=(0,r.kG)(c.locale,d),x=Array.isArray(c.query.page)?c.query.page[c.query.page.length-1]:c.query.page,p=x||(0,r.sK)(c.locale,d._slug),g=t.find(e=>(0,r.sK)(c.locale,e._slug)===x),f=t.filter(e=>{var t,l;return!g||(null==e?void 0:null===(t=e.articleGroup)||void 0===t?void 0:t._id)===(null===(l=g.articleGroup)||void 0===l?void 0:l._id)}).map(e=>({href:(0,r.kG)(c.locale,e),active:(0,r.sK)(c.locale,e._slug)===p,title:e.title})),j=g?f:[{href:v,active:p===m,title:u.articles.all_categories},...f];if(!n)return(0,i.jsx)(s.Z,{links:j});let b={title:g?g.articleGroup.title:u.articles.guides,href:g?(0,r.kG)(c.locale,g):v};return(0,i.jsx)(h,{parent:b,links:j,children:l})}var p=l(77064),g=l(25821),f=l(82092),j=l(11695),b=l(65982),y=l(22528);function w(e){let{title:t,subtitle:l,collectionHtml:n,parent:a,parentTitle:s}=e,{locale:d}=(0,o.useRouter)();return(0,i.jsx)(b.Z,{children:(0,i.jsxs)(g.Z,{className:"flex flex-col items-center space-y-2 sm:space-y-3",children:[a&&!!s&&(0,i.jsx)(m(),{href:(0,r.kG)(d,a),className:"px-3 py-1 text-xs tracking-widest underline uppercase transition-all underline-offset-4 hover:decoration-black decoration-1 decoration-black/0",children:s}),t&&(0,i.jsx)(v.Z,{className:"text-center",type:"heading-1",children:t}),(0,i.jsx)(f.Z,{}),n?(0,i.jsx)(y.Z,{className:"max-w-2xl mx-auto text-center text-gray-700",children:(0,i.jsx)(j.Z,{size:"small",className:"text-center [&_*]:!text-center [&_*]:text-gray-700 [&_a]:text-gray-700 [&_p]:text-gray-700 [&_li]:text-gray-700 [&_li]:marker:text-gray-700 [&_span]:text-gray-700 [&_p]:!leading-[20px] [&_li]:!leading-[20px] [&_span]:!leading-[20px] [&_ol]:list-outside [&_ul]:list-outside [&_ol]:!pl-8 [&_ul]:!pl-8 [&_ol]:text-left [&_ul]:text-left [&_ol_li]:!text-left [&_ul_li]:!text-left",children:(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:n}})})}):l&&(0,i.jsx)(y.Z,{className:"max-w-2xl text-sm text-center text-gray-700",children:(0,i.jsx)("p",{children:(0,p.Z)(l,2)})})]})})}function N(e){let{children:t,...l}=e;return(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white gap gap-y-5 sm:py-12",children:[(0,i.jsx)(w,{...l}),t]})}var _=l(57242);function k(e){let{category:t,articles:l,categories:r,articleIndex:a}=e;return(0,i.jsx)(_.Z,{seo:t.seo,linkResolverData:t,children:(0,i.jsxs)(x,{articleIndex:a,categories:r,vertical:!0,children:[(0,i.jsx)(N,{title:t.title,subtitle:t.intro}),(0,i.jsx)(n.Z,{articles:l})]})})}function C(e){let{articleIndex:t,articles:l,categories:r}=e;return(0,i.jsx)(_.Z,{seo:t.seo,linkResolverData:t,children:(0,i.jsxs)(x,{articleIndex:t,categories:r,vertical:!0,children:[(0,i.jsx)(N,{title:t.title,subtitle:t.subtitle}),(0,i.jsx)(n.Z,{articles:l})]})})}k.getLayoutProps=()=>({solidNav:!0}),C.getLayoutProps=()=>({solidNav:!0});var Z=l(57866);function S(e){var t,l;let{article:n,articleIndex:r,categories:a}=e;return(0,i.jsx)(_.Z,{seo:n.seo,bgColor:null!==(l=n.bgColor)&&void 0!==l?l:"#F2EFEC",linkResolverData:n,children:(0,i.jsxs)(x,{articleIndex:r,categories:a,vertical:!0,children:[(0,i.jsx)(N,{parent:n.category,parentTitle:null===(t=n.category)||void 0===t?void 0:t.t
1itle,title:n.title}),(0,i.jsx)(Z.Z,{blocks:n.content})]})})}S.getLayoutProps=()=>({solidNav:!0});var I=l(99313),G=l(81722),M=l(67294),P=l(89922),z=l(90533);function R(e){let{locale:t}=(0,o.useRouter)(),{productColors:l}=(0,I.rV)(),i=(0,z.Z)();return(0,M.useMemo)(()=>{let n=(0,P.OH)(e).map(e=>(0,G.v)(t,l,e)).filter(Boolean).map(e=>{let n=i.find(t=>{var l;return null===(l=t.colors)||void 0===l?void 0:l.includes(e.baseName)});return n?(0,G.v)(t,l,n.title):e});return n.filter((e,t)=>n.findIndex(t=>t.slug===e.slug)===t).map(e=>({id:e.slug,title:e.name,color:e.color}))},[e,l,i,t])}var L=l(25973),F=l(39622),E=l(55667),T=l(15939),W=l(9008),V=l.n(W),O=l(45363);let B=(e,t)=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((e,l)=>({position:l+1,name:e.title,item:(0,r.wO)(t,e.href),"@type":"ListItem"}))});function D(e){let{links:t}=e,{locale:l}=(0,o.useRouter)(),n=B(t,l);return(0,i.jsx)(V(),{children:(0,i.jsx)("script",{...(0,O.h6)({...n})})})}var q=l(6508);function A(e){let{links:t,className:l}=e;return t.length<2?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(D,{links:t}),(0,i.jsx)("div",{className:(0,q.cn)("flex max-w-full space-x-1 overflow-auto text-gray-600 hide-scrollbar text-13 sm:text-sm whitespace-nowrap sm:space-x-2",l),children:null==t?void 0:t.map((e,t)=>(0,i.jsxs)(M.Fragment,{children:[0!==t&&(0,i.jsx)("div",{className:"text-gray-200",children:"/"}),(0,i.jsx)(m(),{className:"hover:underline",href:e.href||"/",children:e.title},t)]},e.href))})]})}var H=l(67814),K=l(77668);function U(e){let{collection:t,selected:l}=e,{locale:n}=(0,o.useRouter)();return(0,i.jsx)(m(),{href:(0,r.kG)(n,t),className:c()({"font-medium text-black -mt-px":l,"text-gray-600":!l},"text-[10px] whitespace-nowrap underline-offset-4 hover:lg:underline decoration-current focus:outline-none inline-block p-1 uppercase tracking-widest h-5 leading-none"),children:t.title})}function Q(e){var t;let{category:l}=e,[n,r]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[!n&&(0,i.jsxs)("button",{className:"text-[10px] whitespace-nowrap underline-offset-4 hover:lg:underline decoration-current focus:outline-none inline-block p-1 uppercase tracking-widest text-gray-600 h-5 leading-none",onClick:()=>{r(!n)},children:[(0,i.jsx)(H.G,{icon:K.r8p,className:"mr-1"}),l.title]}),!!n&&(null==l?void 0:null===(t=l.collections)||void 0===t?void 0:t.map(e=>(0,i.jsx)(U,{collection:e},e._id)))]})}function Y(e){var t;let{currentCollectionHandle:l,collectionCategories:n}=e,{collections:a}=(0,I.rV)(),{locale:s}=(0,o.useRouter)(),d=(0,M.useRef)(null),c=(0,M.useRef)(null);(0,M.useEffect)(()=>{if(c&&d){var e,t,l,i;null===(i=d.current)||void 0===i||i.scrollTo({top:0,left:(null===(e=c.current)||void 0===e?void 0:e.offsetLeft)-(null===(t=d.current)||void 0===t?void 0:t.clientWidth)/2+(null===(l=c.current)||void 0===l?void 0:l.clientWidth)/2,behavior:"auto"})}},[c]);let u={};a.forEach(e=>{u[(0,r.sK)(s,e._slug)]=e.title});let m=n.map(e=>({...e,collections:(e.collections||[]).map(e=>({...e,title:u[(0,r.sK)(s,e._slug)]}))})),v=null==m?void 0:null===(t=m.find(e=>e.collections.find(e=>(0,r.sK)(s,e._slug)===l)))||void 0===t?void 0:t.collections,h=m.filter(e=>!e.collections.find(e=>(0,r.sK)(s,e._slug)===l));return(0,i.jsxs)("div",{ref:d,className:"relative flex items-center max-w-7xl mt-0.5 py-0.5 md:mt-0 mx-auto overflow-x-auto md:justify-center md:flex-wrap",children:[null==v?void 0:v.map((e,t)=>(0,i.jsxs)("div",{ref:(0,r.sK)(s,e._slug)===l?c:null,className:"inline-flex items-center",children:[0!==t&&(0,i.jsx)("span",{className:"text-gray-600 text-[9px] pointer-events-none mx-1",children:"â¢"}),(0,i.jsx)(U,{collection:e,selected:(0,r.sK)(s,e._slug)===l})]},(0,r.sK)(s,e._slug))),h&&h.map(e=>(0,i.jsx)(Q,{category:e},e.title))]})}var J=l(38925),X=l(36340),$=l(48690),ee=l(1900);function et(e){let{color:t,title:l,selected:n,currentCollectionPath:r}=e,[a,o]=(0,ee.v1)("tag",ee.Oi),s="".concat(r,"/").concat((0,X.l)(l));return(a&&(s="".concat(s,"?tag=").concat(a)),t)?(0,i.jsx)(m(),{href:s,className:"block",children:(0,i.jsx)($.Z,{selected:n,color:l,size:"small",tooltip:!0})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(m(),{href:s,className:c()("px-3 py-2.5 text-xs uppercase font-medium focus:outline-none",{"bg-gray-100 text-black hover:bg-gray-200":!n,"bg-black text-white":n}),children:l})})}function el(e){let{options:t,selected:l,currentCollectionPath:n}=e;return(null==t?void 0:t.length)&&1!==t.length?(0,i.jsx)(J.Z,{variant:"filter",children:t.map(e=>(0,i.jsx)(et,{title:e.title,color:e.color,currentCollectionPath:n,selected:l===(0,X.l)(e.title)},e.id))}):(0,i.jsx)(i.Fragment,{})}function ei(e){let{products:t,currentColor:l,hideColorFilters:n,collection:a}=e,s=R(t),{locale:d}=(0,o.useRouter)();return n?(0,i.jsx)(i.Fragment,{}):(0,i.jsx)(el,{options:s,selected:null==l?void 0:l.slug,currentCollectionPath:(0,r.kG)(d,a)})}var en=l(53235),er=l(9713),ea=l(54599),eo=l(13555),es=l(19804),ed=l(64019),ec=l(24887);function eu(e){let{value:t,onChange:l}=e,n=(0,a.Z)(),r=[{value:void 0,label:n.sort_options.default}].concat(ec.a.map(e=>({value:e,label:n.sort_options[e]})));return(0,i.jsx)(es.R,{value:t,onChange:l,as:"div",className:"relative inline-block text-left",children:e=>{let{open:l}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(es.R.Button,{className:"flex items-center px-2 space-x-1 text-sm transition h-7 hover:bg-cream-80",children:[(0,i.jsx)("div",{children:t?n.sort_options[t]:n.general.sort_by}),(0,i.jsx)(H.G,{icon:K.ptq})]}),(0,i.jsx)(ed.u,{show:l,as:M.Fragment,children:(0,i.jsx)(es.R.Options,{className:"absolute right-0 z-30 w-48 mt-1 origin-top-right bg-white border border-black shadow-lg",children:r.map(e=>{let{value:t,label:l}=e;return(0,i.jsx)(es.R.Option,{value:t,className:e=>{let{active:t}=e;return c()("flex justify-between space-x-2 px-3 py-2 items-center text-sm w-full text-left cursor-pointer",{"bg-cream-80 text-gray-900":t,"text-gray-700":!t})},children:e=>{let{selected:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("input",{type:"radio",checked:t,className:"text-black pointer-events-none form-radio focus:ring-gray-300",disabled:!0}),(0,i.jsx)("div",{className:c()("flex-1",{"font-medium":t}),children:l})]})}},t||"default")})})})]})}})}
1function em(e){let{collection:t,sanityCollection:l,collectionCategories:n,colorFilterParam:s,collectionProducts:d}=e,{hasColorSpecificContent:c,title:u,shortDescription:m,longDescription:v,content:h,seo:x,index:p,colorResult:f,collectionHtml:j}=function(e,t,l){var i,n,r,a,s,d,c,u;let m=function(e,t){let{productColors:l}=(0,I.rV)(),{locale:i}=(0,o.useRouter)();return(0,M.useMemo)(()=>(0,G.xM)(i,l,e,void 0),[i,l,e,void 0])}(e),v=m?null===(i=t.filter)||void 0===i?void 0:i.find(e=>e.name===m.baseName):void 0,h=(null==v?void 0:v.title)||l.title,x=v?null==v?void 0:v.description:l.description,p=v?null==v?void 0:v.description_block:t.description,g=v?null==v?void 0:v.content:t.content,f={title:(null==v?void 0:null===(n=v.seo)||void 0===n?void 0:n.title)||(null==v?void 0:v.title)||(null==l?void 0:null===(r=l.seo)||void 0===r?void 0:r.title)||l.title,description:(null==v?void 0:null===(a=v.seo)||void 0===a?void 0:a.description)||(null==v?void 0:v.description)||(null==l?void 0:null===(s=l.seo)||void 0===s?void 0:s.description)||l.description,image:(null==v?void 0:null===(d=v.seo)||void 0===d?void 0:d.image)?{...v.seo.image,altText:null===(c=v.seo)||void 0===c?void 0:c.title}:l.image?{...l.image,altText:l.title}:null},j=null==v?void 0:v.index,b=!v&&(null===(u=l.descriptionHtml)||void 0===u?void 0:u.trim())?l.descriptionHtml:void 0;return{title:h,shortDescription:x,longDescription:p,content:g,seo:f,index:j,colorResult:m,hasColorSpecificContent:!!v,collectionHtml:b}}(s,l,t),[b,y]=(0,M.useState)(),w=function(e,t,l,i){let n=(0,M.useMemo)(()=>(t||[]).filter(e=>{let{productType:t}=e;return!(0,P.rf)(t)}),[t]),[r,a]=(0,M.useState)(!1),[s,d]=(0,M.useState)(),[c,u]=(0,M.useState)(n),{locale:m}=(0,o.useRouter)();return(0,M.useEffect)(()=>{if(s===l)return;u([]),a(!0);let t=!1;return(0,E.Z)(m,e,l).then(e=>{t||(d(l),a(!1),u(e.filter(e=>{let{productType:t}=e;return!(0,P.rf)(t)})))}),()=>{t=!0}},[s,l,e,m]),{loading:r||s!==l,results:c}}(t.handle,d,b),k=(0,L.Z)(w.results,f,!0),C=R(w.results||[]),S=!l.disableProductGrouping&&C.length>0&&!f,z=(0,F.Z)(k,S?4:18),W=(0,a.Z)(),V=function(e,t){let{locale:l}=(0,o.useRouter)(),{collections:i}=(0,I.rV)(),n=null==i?void 0:i.find(t=>(0,r.sK)(l,null==t?void 0:t._slug)===(0,r.sK)(l,null==e?void 0:e._slug)),a=null==i?void 0:i.find(t=>{var i;return(0,r.sK)(l,null==t?void 0:t._slug)===(0,r.sK)(l,null==e?void 0:null===(i=e.parentCategory)||void 0===i?void 0:i._slug)});return[{title:null==a?void 0:a.title,href:(0,r.kG)(l,a)},{title:null==n?void 0:n.title,href:(0,r.kG)(l,n)},{title:null==t?void 0:t.name,href:t?(0,r.kG)(l,n)+"/"+t.slug:void 0}].filter(e=>!!e.title&&!!e.href)}(l,f);return(0,i.jsxs)(_.Z,{seo:x,linkResolverData:l,color:f,noIndex:!1===p,children:[(0,i.jsx)(g.Z,{className:"pt-3 -mb-1 sm:-mb-3",children:(0,i.jsx)(A,{links:V})}),(0,i.jsx)(N,{title:u,subtitle:m,collectionHtml:j}),(0,i.jsxs)(g.Z,{className:"-mt-4 sm:-mt-6",children:[l.imageSubMenu&&0!==l.imageSubMenu.length?(0,i.jsx)(en.Z,{items:l.imageSubMenu}):(0,i.jsx)(Y,{currentCollectionHandle:t.handle,collectionCategories:n}),(0,i.jsx)("div",{className:"pt-2 mt-4 -mb-4 border-t border-gray-200 md:hidden",children:(0,i.jsx)(ei,{products:w.results,currentColor:f,hideColorFilters:l.hideColorFilters,collection:l})}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between py-2 mt-6 mb-8 border-gray-200 md:mt-10 md:py-3 border-y",children:[(0,i.jsx)("div",{className:"sm:w-48",children:(null==k?void 0:k.length)!==void 0?(0,i.jsxs)("div",{className:"text-sm text-gray-500 lowercase",children:[null==k?void 0:k.length," ",(null==k?void 0:k.length)===1?W.product.product:W.product.products]}):(0,i.jsx)(eo.Z,{width:100,height:18})}),(0,i.jsx)("div",{className:"hidden md:block",children:(0,i.jsx)(ei,{products:w.results,currentColor:f,hideColorFilters:l.hideColorFilters,collection:l})}),(0,i.jsx)("div",{className:"text-right sm:w-48",children:(0,i.jsx)(eu,{value:b,onChange:y})})]}),(0,i.jsx)(ea.Z,{groupedAsSections:S,groupVariantsAsOne:l.groupVariantsAsOne,loading:w.loading,products:z.items}),z.hasMore&&(0,i.jsx)(er.Z,{onClick:z.showMore}),!!v&&(0,i.jsx)("div",{id:"description",className:"pt-12",children:(0,i.jsx)(T.Z,{className:"mx-auto",blocks:v})}),l.imageSubMenu&&l.imageSubMenu.length>0&&(0,i.jsx)("div",{className:"my-2 sm:my-6",children:(0,i.jsx)(Y,{currentCollectionHandle:t.handle,collectionCategories:n})})]}),!!h&&(0,i.jsx)("div",{className:"pt-12",children:(0,i.jsx)(Z.Z,{blocks:h,noBottomMargin:!0})}),(0,i.jsx)("div",{className:"h-12"})]})}function ev(e){var t;let{curtainPlanning:l}=e;return(0,i.jsxs)(_.Z,{seo:l.seo,linkResolverData:l,children:[(0,i.jsx)(N,{title:l.title,subtitle:l.subtitle}),!!(null===(t=l.content)||void 0===t?void 0:t.length)&&(0,i.jsx)("div",{className:"py-2",children:(0,i.jsx)(Z.Z,{blocks:l.content||[]})})]})}em.getLayoutProps=()=>({solidNav:!0}),ev.getLayoutProps=()=>({solidNav:!0});var eh=l(7318),ex=l(36470),ep=l(41845),eg=l(70563),ef=l(15707),ej=l(23897),eb=l(60929),ey=l(99606);function ew(e){var t,l,n,r;
1let{line:a,variants:o,placeholderLabel:s,paid:d,disabled:u,onRemove:m}=e,v=a?o.find(e=>e.id===a.merchandise.id):void 0,h=v?"".concat((0,P.Y4)(null!==(r=null===(t=v.product)||void 0===t?void 0:t.title)&&void 0!==r?r:"")," - ").concat(null===(l=v.selectedOptions.find(e=>(0,P.u8)(e.name)))||void 0===l?void 0:l.value):void 0;return(0,i.jsx)("div",{className:"relative",children:(0,i.jsx)("div",{className:c()(a?"":"border border-dashed border-gray-400",d?"ring-1 ring-black ring-offset-1":"","flex items-center justify-center w-12 h-12 sm:w-8 sm:h-8 overflow-hidden text-sm leading-[14px] text-gray-400"),children:a?(0,i.jsxs)("button",{onClick:()=>m(a.merchandise.id),disabled:u,"data-tip":h,className:"lg:relative group",children:[(0,i.jsx)("div",{className:"absolute -right-1 rounded-full -bottom-1 h-1/2 w-1/2 lg:h-full lg:w-full lg:inset-0 flex items-center justify-center text-white lg:text-base text-sm transition lg:opacity-0 lg:group-hover:opacity-100 bg-red-700 lg:bg-black/50",children:(0,i.jsx)(H.G,{icon:K.XAH})}),!!(null==v?void 0:null===(n=v.image)||void 0===n?void 0:n.url)&&(0,i.jsx)("img",{src:v.image.url+"&width=48",alt:""})]}):(0,i.jsx)("span",{children:s})})})}function eN(e){let{variants:t,className:l}=e,n=(0,a.Z)(),{locale:r}=(0,o.useRouter)(),{cartLoading:s,setShowCart:d}=(0,eh.l8)(),{freeSamplesCount:u}=(0,ef.Z)(),m=(0,eg.Z)();(0,ej.Z)();let v=m.lines.filter(e=>(0,ep.wi)(e)),h=m.lines.filter(e=>!(0,ep.wi)(e)),x=Array.from({length:u},(e,t)=>
1({line:v[t],placeholderLabel:t+1})),p=[...v.slice(u).map(e=>({line:e,paid:!1})),...h.map(e=>({line:e,paid:!0}))],g=(0,ep.cY)(m.lines,u),f=(0,ep.gI)(p.map(e=>{let{line:t}=e;return t})),j=!!f&&Number(f.amount)>0,b=!t.some(e=>{var t;return Number(null===(t=e.price)||void 0===t?void 0:t.amount)>0})&&m.lines.length>=u;return(0,i.jsxs)("div",{className:c()("flex flex-col items-center w-full p-4 space-y-4 text-left bg-white shadow-lg pointer-events-auto sm:w-auto sm:inline-flex",l),children:[(0,i.jsxs)("div",{className:"flex flex-wrap justify-center gap-2 max-w-[280px] sm:max-w-[312px]",children:[x.map(e=>{var l;let{line:n,placeholderLabel:r}=e;return(0,i.jsx)(ew,{line:n,variants:t,placeholderLabel:r,disabled:s,onRemove:m.removeSamples},null!==(l=null==n?void 0:n.id)&&void 0!==l?l:"free-slot-".concat(r))}),p.map(e=>{let{line:l,paid:n}=e;return(0,i.jsx)(ew,{line:l,variants:t,paid:n,disabled:s,onRemove:m.removeSamples},l.id)})]}),(0,i.jsxs)("div",{className:"space-y-1 text-sm text-center",children:[(0,i.jsx)("p",{className:"text-black",dangerouslySetInnerHTML:{__html:n.curtain_samples.selected_samples.replace("[selected]","<strong>".concat(g,"</strong>")).replace("[total]","<strong>".concat(u,"</strong>"))}}),!!p.length&&j&&(0,i.jsx)("p",{className:"text-black",children:(1===p.length?n.curtain_samples.extra_samples_cost_one:n.curtain_samples.extra_samples_cost_multiple).replace("[count]",String(p.length)).replace("[amount]",(0,ex.l)(f,r))}),b&&(0,i.jsx)("p",{className:"text-gray-500",children:n.curtain_samples.max_samples_reached.replace("[total]",String(u))})]}),(0,i.jsx)(ey.Z,{disabled:0===m.lines.length,block:!0,loading:s,onClick:()=>d(!0),variant:"black",children:n.curtain_samples.to_cart})]})}function e_(e){let{variants:t}=e,{showHamburgerMenu:l}=(0,eh.l8)(),n=(0,eg.Z)(),[r,a]=(0,M.useState)(!1),o=!l&&r;return(0,eb.Z)(o),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"fixed z-30 xl:hidden pointer-events-none sm:bottom-[calc(env(safe-area-inset-bottom)+16px)] bottom-[calc(env(safe-area-inset-bottom)+24px)] inset-x-6 sm:inset-x-4 flex justify-start",children:(0,i.jsx)(ed.u,{show:!o,enter:"transition duration-300",enterFrom:"scale-0 opacity-0 origin-bottom-left",enterTo:"opacity-100 scale-100 ",leave:"transition duration-300",leaveFrom:"opacity-100 scale-100 ",leaveTo:"opacity-0 scale-0 origin-bottom-left",className:"sticky flex pointer-events-auto",children:(0,i.jsxs)("button",{onClick:()=>a(!0),className:"relative flex items-center justify-center text-white transition bg-black rounded-full shadow-md active:scale-95 w-14 h-14",children:[(0,i.jsx)(H.G,{icon:K.AVo,className:"text-2xl"}),n.lines.length>0&&(0,i.jsx)("div",{className:"absolute top-0 right-0 flex items-end justify-center w-5 h-5 text-xs text-white bg-red-700 rounded-full",children:n.lines.length})]})})}),(0,i.jsx)(ed.u,{show:o,enter:"transition duration-300",enterFrom:"scale-0 opacity-0",enterTo:"opacity-100 scale-100",leave:"transition duration-300",leaveFrom:"opacity-100 scale-100 ",leaveTo:"scale-0 opacity-0",className:"fixed xl:hidden z-40 origin-bottom-left w-full inset-x-0 pointer-events-none bottom-[calc(env(safe-area-inset-bottom)+24px)] sm:bottom-[calc(env(safe-area-inset-bottom)+16px)]",children:(0,i.jsxs)(g.Z,{className:"relative flex justify-end mx-2 sm:-mx-4",children:[(0,i.jsx)("button",{onClick:()=>a(!1),className:"absolute flex items-center justify-center w-12 h-12 pointer-events-auto -right-2 -top-2",children:(0,i.jsx)(H.G,{icon:K.NBC})}),(0,i.jsx)(eN,{variants:t})]})}),(0,i.jsx)(b.Z,{anchorPlacement:"top-bottom",animation:"fade-up",duration:700,delay:1500,className:"sticky pointer-events-none xl:block hidden z-30 w-full mb-8 mr-8 -mt-[170px] sm:bottom-8 inset-x-0 sm:inset-x-auto bottom-[calc(env(safe-area-inset-bottom)+16px)]",children:(0,i.jsx)(g.Z,{className:"relative flex justify-end",children:(0,i.jsx)(eN,{variants:t,className:"border border-black sm:mx-4"})})})]})}var ek=l(69781),eC=l(23642),eZ=l(76198),eS=l(21951),eI=l(57681);let eG="_color",eM="color:",eP="".concat(eM,"mixed");function ez(e){let{filters:t,groupedFilterValues:l,activeFilterValues:n,toggleFilter:r,clearAll:o,inlineMobileCategoryTriggers:s=!1}=e,d=(0,a.Z)();(0,ej.Z)();let{showFilterSidebar:u,setShowFilterSidebar:m}=(0,eh.l8)(),[v,h]=(0,M.useState)(null),x=(0,M.useCallback)(e=>{m(t=>{let l="function"==typeof e?e(t):e;return l||h(null),l})},[m]),p=(0,M.useCallback)(e=>{h(e),m(!0)},[m]);return l.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"relative z-[25]",children:[s&&(0,i.jsx)("div",{className:"flex w-full border-y border-black divide-x divide-black lg:hidden",children:l.map(e=>(0,i.jsxs)("button",{type:"button",onClick:()=>p(e._id),className:"flex flex-auto cursor-pointer items-center justify-center gap-x-1 px-3 py-2 text-center",children:[(0,i.jsx)("span",{className:"text-2xs font-medium uppercase tracking-wider",children:e.title}),(0,i.jsx)(H.G,{className:"shrink-0 text-xs",icon:K.gc2})]},e._id))}),(0,i.jsx)("div",{className:c()("border-gray-200 lg:inline",!s&&"max-lg:border-y"),children:(0,i.jsxs)(g.Z,{className:"flex flex-col lg:container lg:mx-auto",children:[!s&&(0,i.jsxs)("div",{className:"flex items-center py-1 lg:hidden",children:[(0,i.jsx)("div",{className:"flex-1"}),(0,i.jsx)("div",{className:"flex flex-1 justify-end",children:(0,i.jsxs)("button",{type:"button",onClick:()=>m(!0),className:"flex items-center px-4 py-2 text-xs font-medium tracking-wider up
1percase",children:[(0,i.jsx)("span",{children:d.general.filter}),(0,i.jsx)(H.G,{icon:K.G_j,className:"ml-2 text-2xs"})]})})]}),(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)("div",{className:"hidden relative border-t border-l border-black lg:flex",children:l.map(e=>(0,i.jsx)(ek.Z,{activeFilters:t,toggleFilter:r,category:e},e._id))})})]})}),(0,i.jsx)(g.Z,{className:"container mx-auto mt-4 sm:mt-6",children:(0,i.jsxs)("div",{className:c()("flex flex-wrap items-start justify-center gap-2 col-span-full empty:hidden"),children:[!!n.length&&(0,i.jsxs)("button",{type:"button",onClick:o,className:"flex group pl-2 gap-x-1 items-center pr-0.5 border border-black py-0.5 text-xs uppercase",children:[(0,i.jsx)("span",{className:"-mb-0.5",children:d.general.clear_filter}),(0,i.jsx)("div",{className:"grid place-content-center w-4 h-4 transition group-hover:bg-gray-200",children:(0,i.jsx)(H.G,{icon:K.xf2})})]}),n.map(e=>{let{_id:t,title:l,slug:n,color:a,isMixed:o}=e;return(0,i.jsxs)("button",{type:"button",onClick:()=>r(n),"data-tip":a?l:void 0,className:c()("flex group items-center pr-0.5 py-0.5 border border-gray-300 text-xs uppercase",{"pl-2 gap-x-1":!a,"pl-0.5 gap-x-0.5":a}),children:[o?(0,i.jsx)(eZ.Z,{className:"w-4 h-4"}):a?(0,i.jsx)("div",{className:c()("w-4 h-4",{"border border-gray-200":(0,eS.B)(a)}),style:{backgroundColor:a}}):(0,i.jsx)("span",{className:"-mb-0.5",children:l}),(0,i.jsx)("div",{className:"grid place-content-center w-4 h-4 transition group-hover:bg-gray-200",children:(0,i.jsx)(H.G,{icon:K.g82})})]},t)})]})})]}),(0,i.jsx)(eC.Z,{onClear:o,groupedFilterValues:l,activeFilters:t,toggleFilter:r,isShowing:u,setIsShowing:x,focusedCategoryId:s?v:null})]}):null}var eR=l(43657),eL=l(93818),eF=l(96747),eE=l(99891);function eT(e){var t,l,n,r;let{variant:s,sampleProduct:d,sectionProductBadge:c}=e,u=(0,a.Z)(),{locale:m}=(0,o.useRouter)(),v=null!==(r=null===(l=s.selectedOptions)||void 0===l?void 0:null===(t=l.find(e=>(0,P.u8)(e.name)))||void 0===t?void 0:t.value)&&void 0!==r?r:s.title,h=(0,eR.Z)(v,d.id),x=(0,eL.Z)(d,v),{isInCart:p,willBePaid:g,handleSelect:f,loading:j}=(0,eF.Z)(s),b=!s.availableForSale,y=j||b,w=(null==h?void 0:h.name)||v,N=g?"".concat(u.general.add_new," \xb7 ").concat((0,ex.l)(s.price,m)):void 0,_=b?u.curtain_samples.out_of_stock:p?u.curtain_samples.added:null!=N?N:u.general.add_new;return(0,i.jsxs)("div",{className:"flex flex-col group",children:[(0,i.jsx)("div",{className:"overflow-hidden relative w-full bg-gray-100 aspect-w-1 aspect-h-1",children:(0,i.jsxs)("button",{type:"button",onClick:f,disabled:y,"aria-label":"".concat(_," â ").concat(w),className:"block w-full h-full text-left disabled:cursor-not-allowed",children:[(null===(n=s.image)||void 0===n?void 0:n.url)&&(0,i.jsx)(eE.Ee,{src:s.image.url,width:500,sizes:"(max-width: 767px) 50vw, 25vw",alt:s.image.altText||v,className:"object-cover object-center w-full h-full"}),b&&(0,i.jsx)("div",{className:"absolute inset-0 z-[1] bg-white/60 pointer-events-none"}),(!!(null==c?void 0:c.trim())||!!(null==x?void 0:x.length))&&(0,i.jsxs)("div",{className:"pointer-events-none absolute left-2 top-2 z-10 flex max-w-[calc(100%-1rem)] flex-wrap content-start items-start gap-1",children:[!!(null==c?void 0:c.trim())&&(0,i.jsx)("div",{className:"px-2 py-1 text-xs font-medium tracking-wider uppercase bg-white shrink-0",children:c.trim()}),null==x?void 0:x.map((e,t)=>(0,i.jsx)("div",{className:"px-2 py-1 text-xs font-medium tracking-wider uppercase bg-white shrink-0",children:e},t))]}),(0,i.jsx)("div",{className:"absolute right-2 bottom-2 z-10 pointer-events-none",children:(0,i.jsxs)("div",{className:(0,q.cn)("inline-flex h-8 items-center overflow-hidden transition-colors duration-200",{"bg-black text-white":!p&&!b,"border border-gray-200 bg-white text-black":p,"border border-gray-300 bg-white text-gray-500":b&&!p}),children:[(0,i.jsx)("div",{className:"flex justify-center items-center w-8 h-8 shrink-0",children:(0,i.jsx)(H.G,{icon:j?K.AX7:p?K.LEp:K.r8p,className:(0,q.cn)({"animate-spin":j})})}),(0,i.jsx)("span",{className:(0,q.cn)("overflow-hidden whitespace-nowrap transition-[max-width,opacity] duration-300 ease-out","max-w-[12rem] opacity-100 md:max-w-0 md:opacity-0 md:group-hover:max-w-[12rem] md:group-hover:opacity-100"),children:(0,i.jsx)("span",{className:"block py-1 pr-3 text-xs tracking-wider leading-tight uppercase",children:_})})]})})]})}),(0,i.jsx)("button",{type:"button",onClick:f,disabled:y,className:(0,q.cn)("mt-2 self-start text-left font-normal text-black uppercase text-[11px] group-hover:underline disabled:cursor-not-allowed",{"text-gray-400":b}),children:w})]})}var eW=l(61330),eV=l(45555),eO=l(66410);function eB(e){let{selected:t,option:l,size:n="medium",className:r}=e;return(0,i.jsxs)("div",{className:c()("cursor-pointer group flex flex-col items-center",r),children:[(0,i.jsx)("div",{className:c()("overflow-hidden border-gray-200 transition-all relative bg-white",{"ring-1":"large"===n||"medium"===n,"ring-offset-cream-80":"large"===n||"medium"===n,"size-24 ring-offset-2":"large"===n,"ring-offset-1":"large"!==n,"size-[76px]":"medium"===n,"ring-black/20":!t,"ring-black ring-2":t,"group-hover:ring-black group-hover:z-10":!t}),children:"string"==typeof l.image?(0,i.jsx)(eO.Z,{src:l.image,alt:l.title,overrideImageMaxWidth:"large"===n?192:72,fill:!0,className:"object-cover"}):(0,i.jsx)(eV.Z,{width:"large"===n?96:72,height:"large"===n?96:72,overrideImageMaxWidth:"large"===n?192:144,sizes:"large"===n?"96px":"76px",className:"object-cover object-center w-full h-full",sanityImage:l.image})}),(0,i.jsx)("p",{className:c()("mt-2 text-2xs transition text-center max-w-[76px] leading-snug",{"text-gray-600":!t,"text-black":t}),children:l.title})]})}function eD(e){return!e.href&&"product"===e._type}function eq(e,t){var l;return null!==(l=e._key)&&void 0!==l?l:null!=e.productId?String(e.productId):"option-".concat(t)}function eA(e){let{productId:t,options:l,alignScroll:n="start",hrefSuffix:a,onOptionClick:s}=e,{locale:d}=(0,o.useRouter)(),c=(0,M.useRef)({}),u=(0,M.useRef)(null),[v,h]=(0,M.useState)(!0),[x,p]=(0,M.useState)(!1),[g,f]=(0,M.useState)(!1),j=(0,eW.fE)(t),b=l.findIndex(e=>null!=e&&null!=e.productId&&String(e.productId)===String(j)),y=b>=0?l[b]:void 0,w="end"===n&&!g;return((0,M.useEffect)(()=>
1{if(y&&u.current&&b>=0){let e=eq(y,b),t=c.current[e];if(!t)return;let l=u.current.offsetWidth,i=t.offsetWidth,n=t.offsetLeft;u.current.scrollLeft=n-l/2+i/2}},[y,b,l]),(0,M.useEffect)(()=>{let e=u.current;if(!e||!l.length)return;let t=()=>{let{scrollLeft:t,scrollWidth:l,clientWidth:i}=e,n=parseFloat(window.getComputedStyle(e).columnGap)||0;f(Math.ceil(Math.max(l,Array.from(e.children).reduce((e,t,l)=>{let i=window.getComputedStyle(t),r=(parseFloat(i.marginLeft)||0)+(parseFloat(i.marginRight)||0);return e+t.offsetWidth+r+(l>0?n:0)},0)))>Math.ceil(i)),h(t<=1),p(t+i>=l-1)};t();let i=new ResizeObserver(t);return i.observe(e),e.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",t),i.disconnect()}},[l,w]),l.length)?(0,i.jsxs)("div",{className:"-ml-4 -mr-4 overflow-x-hidden relative px-0.5",children:[(0,i.jsx)("div",{ref:u,className:(0,q.cn)("flex overflow-x-auto gap-3 items-start py-2 w-full hide-scrollbar snap-x",w&&"lg:justify-end"),children:l.map((e,t)=>{if(null==e)return null;let l=null!=e.productId&&String(e.productId)===String(j),n=eq(e,t),o=function(e,t,l){if(t.href)return t.href;if(t._type){let i=(0,r.kG)(e,t);return l&&eD(t)?"".concat(i).concat(l):i}return"#"}(d,e,a),u=s&&!l&&eD(e)?e=>s(e,o):void 0;return(0,i.jsx)(m(),{ref:e=>{c.current[n]=e},className:"first:ml-4 snap-center last:pr-6 lg:last:pr-4 focus:outline-none focus:ring-0",href:o,onClick:u,children:(0,i.jsx)(eB,{option:e,selected:l,size:"large"})},n)})}),g&&l.length>1&&(0,i.jsxs)(i.Fragment,{children:[!v&&(0,i.jsx)("button",{onClick:()=>{let e=u.current;e&&e.scrollBy({left:-e.clientWidth,behavior:"smooth"})},type:"button",className:"absolute left-0 top-0 bottom-0 w-12 bg-gradient-to-r from-white to-transparent z-20 pointer-events-auto flex items-start justify-start pl-1 lg:pl-0 pt-[40px]",children:(0,i.jsx)("div",{className:"grid place-content-center w-8 h-8 bg-white rounded-full shadow-md transition hover:bg-gray-100",children:(0,i.jsx)(H.G,{icon:K.A35,className:"text-base"})})}),!x&&(0,i.jsx)("button",{onClick:()=>{let e=u.current;e&&e.scrollBy({left:e.clientWidth,behavior:"smooth"})},type:"button",className:"absolute right-0 top-0 bottom-0 w-12 bg-gradient-to-l from-white to-transparent z-20 pointer-events-auto flex items-start justify-end pr-1 lg:pr-0 pt-[40px]",children:(0,i.jsx)("div",{className:"grid place-content-center w-8 h-8 bg-white rounded-full shadow-md transition hover:bg-gray-100",children:(0,i.jsx)(H.G,{icon:K._tD,className:"text-base"})})})]})]}):null}function eH(e){var t,l,n,r;let{section:o,sampleProduct:s,activeFilterValues:d,colorFilterMap:c}=e,u=(0,a.Z)(),[m,v]=(0,M.useState)(!1),h=(0,M.useRef)(null),x=()=>{let e=h.current;e&&setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"start"})},0)},p=(0,M.useMemo)(()=>d.filter(e=>e.category._id===eG).map(e=>e.slug),[d]),f=(0,M.useMemo)(()=>{let e=new Map;return d.filter(e=>e.category._id!==eG).forEach(t=>{var l;let i=null!==(l=e.get(t.category._id))&&void 0!==l?l:[];i.push(t.slug),e.set(t.category._id,i)}),e},[d]),j=(0,M.useMemo)(()=>s?s.variants.edges.map(e=>e.node).filter(e=>{var t,l,i;if(!p.length)return!0;let n=null===(l=e.selectedOptions)||void 0===l?void 0:null===(t=l.find(e=>(0,P.u8)(e.name)))||void 0===t?void 0:t.value;if(!n)return p.includes(eP);let r=null!==(i=c[(0,X.l)(n)])&&void 0!==i?i:eP;return p.includes(r)}).map(e=>({variant:e,product:s})):[],[s,p,c]),b=(0,M.useMemo)(()=>{var e;if(0===f.size)return!0;let t=null!==(e=o.filterValues)&&void 0!==e?e:[];return Array.from(f.entries()).every(e=>{let[l,i]=e;return i.some(e=>t.some(t=>t.slug===e&&t.category._id===l))})},[o.filterValues,f]);if(!s||!b||!j.length)return null;let y=(r=o.title||s.title).startsWith("Sample ")?r.slice(7):r.startsWith("Gardinprov ")?r.slice(11):r,w=!!(null===(t=o.description)||void 0===t?void 0:t.length),N=(null!==(n=null===(l=o.modelProducts)||void 0===l?void 0:l.length)&&void 0!==n?n:0)>0,_=w||N;return(0,i.jsxs)("section",{ref:h,className:"relative scroll-mt-16 xl:scroll-mt-24",children:[(0,i.jsx)("div",{className:"sticky top-16 z-20 bg-white border-b border-gray-200 xl:top-24",children:(0,i.jsx)(g.Z,{className:"flex flex-wrap gap-y-2 gap-x-3 justify-between items-center py-3",children:(0,i.jsxs)("div",{className:"flex flex-wrap flex-1 gap-y-1 gap-x-3 items-baseline min-w-0",children:[(0,i.jsx)("h2",{className:"text-sm uppercase",children:y}),_&&!m&&(0,i.jsxs)("button",{type:"button",onClick:()=>{v(!0),x()},className:"flex gap-1 items-center text-xs tracking-wider text-gray-600 normal-case transition hover:text-black",children:[(0,i.jsx)("span",{children:u.curtain_samples.read_more}),(0,i.jsx)(H.G,{icon:K.ptq,className:"transition-transform text-2xs"})]})]})})}),(0,i.jsx)(ed.u,{show:m&&_,className:"grid transition-all duration-300",enterFrom:"grid-rows-[0fr] opacity-0",enterTo:"grid-rows-[1fr] opacity-100",leaveFrom:"grid-rows-[1fr] opacity-100",leaveTo:"grid-rows-[0fr] opacity-0",children:(0,i.jsx)("div",{className:"overflow-hidden min-h-0",children:(0,i.jsxs)(g.Z,{className:"grid gap-6 py-6 lg:flex lg:items-start lg:gap-8",children:[(0,i.jsxs)("div",{className:"min-w-0
1w-full shrink-0 lg:max-w-lg",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>v(!1),className:"flex gap-1 items-center mb-3 text-xs tracking-wider text-gray-600 normal-case transition hover:text-black",children:[(0,i.jsx)("span",{children:u.curtain_samples.hide_description}),(0,i.jsx)(H.G,{icon:K.ptq,className:"transition-transform -rotate-180 text-2xs"})]}),w&&(0,i.jsx)(T.Z,{blocks:o.description,size:"small",prose:"default",className:"max-w-lg"})]}),N&&(0,i.jsx)("div",{className:"min-w-0 flex-1 w-full",children:(0,i.jsx)(eA,{productId:s.id,options:o.modelProducts,alignScroll:"end"})})]})})}),(0,i.jsx)(g.Z,{className:"grid grid-cols-2 gap-2 py-6 md:grid-cols-4 md:gap-3 sm:py-8",children:j.map(e=>{let{variant:t,product:l}=e;return(0,i.jsx)(eT,{variant:t,sampleProduct:l,sectionProductBadge:o.productBadge},t.id)})})]})}var eK=l(33818),eU=l(32042);function eQ(e){let{icon:t,link:l,direction:n="horizontal",mirrored:r,className:a,size:o="default",iconClassName:s="text-lg"}=e;return(0,i.jsxs)(eU.Z,{link:l,className:c()(a,"flex items-center transition-all duration-300 group",{"text-sm":"small"===o},"horizontal"===n?r?"flex-row-reverse":"flex-row":r?"flex-col-reverse":"flex-col"),children:[t&&(0,i.jsx)(eK.Z,{fixedWidth:!0,className:s,icon:t}),(0,i.jsxs)("p",{className:c()("pt-[2px]","flex items-center gap-1 flex-1 text-balance",{"group-hover:underline":(null==l?void 0:l.url)||(null==l?void 0:l.reference)},"horizontal"===n?r?"mr-2":"ml-2":r?"mb-2":"mt-2"),children:[null==l?void 0:l.title,((null==l?void 0:l.url)||(null==l?void 0:l.reference))&&(0,i.jsx)(H.G,{icon:K.nUK,className:"text-xs opacity-70"})]})]})}function eY(e){var t,l,n;let{curtainSamples:r,sampleProducts:s}=e,{filters:d,groupedFilterValues:c,activeFilterValues:u,colorFilterMap:m,toggleFilter:v,clearAll:h}=function(e){var t;let{sections:l,sampleProducts:i,filterCategories:n}=e,r=(0,a.Z)(),{locale:s}=(0,o.useRouter)(),{productColors:d}=(0,I.rV)(),c=(0,z.Z)(),[u,m]=(0,ee.v1)("filter",(0,ee.S$)(ee.Oi).withDefault([])),v=null!==(t=r.general.color)&&void 0!==t?t:"Color",{groupedFilterValues:h,colorFilterMap:x}=(0,M.useMemo)(()=>{let e=new Set;Object.values(i).forEach(t=>{(0,eI.Z)(t).forEach(t=>{t&&e.add(t)})});let t=new Map;Array.from(e).forEach(e=>{let l=(0,G.v)(s,d,e);if(!l){t.set(e,null);return}let i=c.find(e=>{var t,i;return null===(t=e.colors)||void 0===t?void 0:t.includes(null!==(i=l.baseName)&&void 0!==i?i:"")});if(i){var n;let r=null!==(n=(0,G.v)(s,d,i.title))&&void 0!==n?n:l;t.set(e,r)}else l.color?t.set(e,l):t.set(e,null)});let a={};t.forEach((e,t)=>{a[(0,X.l)(t)]=e?"".concat(eM).concat(e.slug):eP});let o=new Set,u=[],m=0;Array.from(e).sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:"base"})).forEach(e=>{var l;let i=t.get(e),n=i?"".concat(eM).concat(i.slug):eP;if(!o.has(n)){if(o.add(n),!i){u.push({_id:"".concat(eG,":mixed"),title:r.curtain_samples.mixed_color,color:"#e5e7eb",slug:eP,order:m++,isMixed:!0,category:{_id:eG,title:v,order:-1}});return}u.push({_id:"".concat(eG,":").concat(i.slug),title:i.name,color:null!==(l=i.color)&&void 0!==l?l:"#ffffff",slug:n,order:m++,category:{_id:eG,title:v,order:-1}})}});let h=[...u,...l.flatMap(e=>{var t;return null!==(t=e.filterValues)&&void 0!==t?t:[]}).filter(Boolean)].sort((e,t)=>e.order-t.order).filter((e,t,l)=>t===l.findIndex(t=>t._id===e._id)),x=new Map;n.forEach((e,t)=>x.set(e._id,t));let p=e=>{var t;return e===eG?-1:null!==(t=x.get(e))&&void 0!==t?t:Number.MAX_SAFE_INTEGER},g=new Map;return h.forEach(e=>{let t=e.category;if(!g.has(t._id)){var l;let e=n.find(e=>e._id===t._id);g.set(t._id,{...t,title:null!==(l=null==e?void 0:e.title)&&void 0!==l?l:t.title,values:[]})}g.get(t._id).values.push(e)}),{groupedFilterValues:Array.from(g.values()).filter(e=>e.values.length>0).sort((e,t)=>p(e._id)-p(t._id)),colorFilterMap:a}},[l,i,d,s,n,v,c,r.curtain_samples.mixed_color]),p=(0,M.useMemo)(()=>h.flatMap(e=>e.values.filter(e=>u.includes(e.slug))),[h,u]);return{filters:u,groupedFilterValues:h,activeFilterValues:p,colorFilterMap:x,toggleFilter:(0,M.useCallback)(e=>{e&&m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[m]),clearAll:(0,M.useCallback)(()=>{m([])},[m])}}({sections:r.sections,sampleProducts:s,filterCategories:null!==(n=r.filterCategories)&&void 0!==n?n:[]}),{sampleProductVariants:x}=function(e){var t;let{curtainSamples:l,products:i}=e;return{sampleProductVariants:(null!==(t=l.sections)&&void 0!==t?t:[]).map(e=>e.sampleProductId).filter(e=>!!e).map(e=>
1i[(0,eW.xv)(e)]).filter(Boolean).flatMap(e=>null==e?void 0:e.variants.edges.map(t=>({...t.node,product:e})))}}({curtainSamples:r,products:s});return(0,i.jsxs)(_.Z,{seo:r.seo,linkResolverData:r,children:[(0,i.jsx)(N,{title:r.title,children:(0,i.jsx)(g.Z,{children:(0,i.jsx)("div",{className:"flex flex-wrap justify-center gap-x-5 gap-y-3",children:null===(t=r.sellingPoints)||void 0===t?void 0:t.map(e=>(0,i.jsx)(eQ,{size:"small",link:e.link,className:"text-xs",iconClassName:"text-sm",icon:e.icon},e._key))})})}),(0,i.jsx)(ez,{filters:d,groupedFilterValues:c,activeFilterValues:u,toggleFilter:v,clearAll:h,inlineMobileCategoryTriggers:!0}),(0,i.jsx)("div",{className:"xl:mb-40",children:null===(l=r.sections)||void 0===l?void 0:l.map(e=>{let t=s[(0,eW.xv)(e.sampleProductId)];return(0,i.jsx)(eH,{section:e,sampleProduct:t,activeFilterValues:u,colorFilterMap:m},e._key)})}),(0,i.jsx)(e_,{variants:x})]})}eY.getLayoutProps=()=>({solidNav:!0});var eJ=l(43772),eX=l(4246);function e$(e){let{faq:t}=e,l=(0,o.useRouter)(),n=(0,r.kG)(l.locale,t),a=l.query.tab?Number(l.query.tab):void 0,s=e=>l.replace("".concat(n,"?tab=").concat(e),void 0,{shallow:!0}),d=t.categories.filter(e=>e.questions),c=d[a]?[d[a]]:d;return(0,i.jsxs)(_.Z,{seo:t.seo,linkResolverData:t,children:[(0,i.jsx)(eX.Z,{categories:d}),(0,i.jsxs)(h,{parent:{title:t.title,href:n},links:d.map((e,t)=>({title:e.title,active:a===t,onClick:()=>s(t)})),children:[(0,i.jsx)(N,{title:t.title}),(0,i.jsx)("div",{className:"pb-8 mt-8 space-y-12 md:space-y-16",children:null==c?void 0:c.map(e=>{var t;return(0,i.jsx)(eJ.Z,{data:{title:e.title,items:null===(t=e.questions)||void 0===t?void 0:t.map(e=>({_key:e._key,title:e.question,text:e.answer}))}},e._key)})})]})]})}e$.getLayoutProps=()=>({solidNav:!0});var e0=l(33937),e1=l(5798),e2=l(18200),e4=l(52730),e5=l(42708);function e3(e){let{images:t}=e,l=(0,a.Z)(),{isAboveBreakpoint:n,screenWidth:r}=(0,e4.Z)(),{inView:o,ref:s}=(0,e5.YD)();return(null==t?void 0:t.length)?(0,i.jsx)(b.Z,{animation:"fade-up",children:(0,i.jsx)("div",{id:"gallery",className:"max-w-full scroll-mt-40",ref:s,children:n("sm")?(0,i.jsx)(g.Z,{className:"hidden gap-0 -m-2 break-normal sm:-m-3 lg:-m-6 sm:block columns-2",children:t.map((e,t)=>(0,i.jsx)(b.Z,{animation:"fade-up",delay:100*t,className:c()("relative break-inside-avoid max-sm:w-screen sm:w-full"),style:{paddingBottom:(0,e2.tE)(e.aspectRatio)},children:(0,i.jsx)("div",{className:"absolute transition-opacity duration-500",style:{opacity:o?1:0},children:o&&(0,i.jsx)(e0.Z,{hotspotCrop:!0,overrideImageMaxWidth:1e3,withVideoFallback:!1,className:c()("w-full h-full",{"[&_video]:object-cover [&_video]:absolute [&_video]:inset-0 [&_video]:object-center [&_video]:h-full [&_video]:w-full":"video"===e.media.typeOfMedia,"object-cover object-center absolute inset-0":"image"===e.media.typeOfMedia||"hotspotArrayImage"===e.media.typeOfMedia}),sizes:"50vw",media:e.media})})},t))}):(0,i.jsx)(e1.Z,{showScrollbar:!0,slidingDistance:r,scrollSnap:!1,title:l.product.gallery,gapSize:"default",children:t.map((e,t)=>(0,i.jsxs)("div",{className:"relative",style:{width:"".concat(100*e.aspectRatio,"vw"),height:"100vw"},children:[(0,i.jsx)("div",{className:"absolute inset-0 transition-opacity duration-500",style:{opacity:o?1:0},children:o&&(0,i.jsx)(e0.Z,{overrideImageMaxWidth:1e3,withVideoFallback:!0,hotspotCrop:!0,className:c()("w-full h-full",{"[&_video]:object-cover [&_video]:absolute [&_video]:inset-0 [&_video]:object-center [&_video]:h-full [&_video]:w-full":"video"===e.media.typeOfMedia,"object-cover object-center absolute inset-0":"image"===e.media.typeOfMedia||"hotspotArrayImage"===e.media.typeOfMedia}),sizes:"50vw",media:e.media})}),(0,i.jsx)("div",{className:"absolute inset-0 opacity-0"})]},t))})})}):(0,i.jsx)(i.Fragment,{})}var e7=l(66122),e8=l(40972);function e6(e){var t,l,n,a,s;let{product:d,sanityProduct:c,color:u,image:m}=e,{locale:v}=(0,o.useRouter)(),h=(0,eR.Z)(u);if((0,M.useEffect)(()=>{let e=window.setTimeout(()=>{(0,e7.W5)()},350);return()=>{window.clearTimeout(e)}},[d.id,u]),!(null===(l=d.variants)||void 0===l?void 0:null===(t=l.edges)||void 0===t?void 0:t.length))return null;let x=null!==(a=null!==(n=u?(0,e8.JE)(d,u):void 0)&&void 0!==n?n:(0,e8.JE)(d))&&void 0!==a?a:d.variants.edges[0].node,p=(0,r.J2)(v,c),g=u?"".concat(p,"/").concat((0,X.l)(u)):p,f=(null==h?void 0:h.name)?"".concat(d.title," (").concat(h.name,")"):d.title,j=(0,eW.fE)(d.id);return(0,i.jsx)("div",{"aria-hidden":!0,style:{display:"none"},id:"lipscore-rating","data-ls-product-name":f,"data-ls-brand":d.vendor,"data-ls-product-id":j,"data-ls-product-url":g,"data-ls-mpn":(0,eW.ip)(x.id),"data-ls-variant-id":(0,eW.ip)(x.id),"data-ls-variant-name":null!==(s=null==h?void 0:h.name)&&void 0!==s?s:void 0,"data-ls-category":d.productType||void 0,"data-ls-image-url":m,"data-ls-description":d.description,"data-ls-price":d.priceRange.minVariantPrice.amount,"data-ls-price-currency":d.priceRange.minVariantPrice.currencyCode,"data-ls-availability":x.availableForSale?"in stock":"out of stock"})}function e9(e){var t,l,n;let{product:a,sanityProduct:s,image:d,lipscoreBottomline:c}=e,{locale:u}=(0,o.useRouter)();if(!(null===(l=a.variants)||void 0===l?void 0:null===(t=l.edges)||void 0===t?void 0:t.length))return(0,i.jsx)(i.Fragment,{});
1let m=(0,eW.fE)(a.id),v=(0,r.J2)(u,s),h=(null==c?void 0:c.total_ratings)?{"@type":"AggregateRating",ratingValue:c.average_score,ratingCount:c.total_ratings,bestRating:5,worstRating:1}:void 0,x=a.vendor?{"@type":"Brand",name:a.vendor}:void 0,p=(0,eI.Z)(a).flatMap(e=>{let t=(0,e8.JE)(a,e);return t?[{color:e,variant:t}]:[]});if(p.length){let e={"@context":"https://schema.org","@type":"ProductGroup",productGroupID:m,name:a.title,description:a.description,url:v,image:d,brand:x,aggregateRating:h,variesBy:["https://schema.org/color"],hasVariant:p.map(e=>{var t,l;let{color:i,variant:n}=e;return{"@type":"Product",sku:(0,eW.ip)(n.id),mpn:(0,eW.ip)(n.id),name:"".concat(a.title," (").concat(i,")"),color:i,description:a.description,url:"".concat(v,"/").concat((0,X.l)(i)),image:null!==(l=null===(t=n.image)||void 0===t?void 0:t.url)&&void 0!==l?l:d,brand:x,offers:{"@type":"Offer",price:n.price.amount,priceCurrency:n.price.currencyCode,itemCondition:"https://schema.org/NewCondition",availability:n.availableForSale?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}})};return(0,i.jsx)(V(),{children:(0,i.jsx)("script",{...(0,O.h6)(e)},"rich-snippet")})}let g=null!==(n=(0,e8.JE)(a))&&void 0!==n?n:a.variants.edges[0].node,f={"@context":"https://schema.org","@type":"Product",productID:(0,eW.ip)(g.id),mpn:(0,eW.ip)(g.id),name:a.title,description:a.description,url:v,image:d,brand:x,aggregateRating:h,offers:{"@type":"Offer",price:a.priceRange.minVariantPrice.amount,priceCurrency:a.priceRange.minVariantPrice.currencyCode,itemCondition:"https://schema.org/NewCondition",availability:g.availableForSale?"https://schema.org/InStock":"https://schema.org/OutOfStock"}};return(0,i.jsx)(V(),{children:(0,i.jsx)("script",{...(0,O.h6)(f)},"rich-snippet")})}var te=l(46167),tt=l(58177),tl=l(84971),ti=l(28282);function tn(e){var t;let{article:l,isShowing:n,setIsShowing:a,zIndex:s="default"}=e,{locale:d}=(0,o.useRouter)(),c=null!==(t=(0,r.sK)(d,l._slug))&&void 0!==t?t:"";return(0,i.jsx)(ti.Z,{enterFrom:"right",title:l.title,size:"large",isShowing:n,setIsShowing:a,zIndex:s,children:(0,i.jsx)("div",{className:"py-8",children:(0,i.jsx)(tl.Z,{slug:c})})})}var tr=l(13111),ta=l(25005),to=l(67204),ts=l(82609),td=l(48912),tc=l(15159),tu=l(31669);function tm(e){let{variant:t,productIds:l,icon:n="auto",className:r}=e,s=(0,a.Z)(),{locale:d}=(0,o.useRouter)(),{manufacturedProductIds:c}=(0,I.rV)(),{product:u,selectedVariant:m}=(0,ta.i)(),v=(null==u?void 0:u.availableForSale)===!1||(null==m?void 0:m.availableForSale)===!1,h=(0,M.useMemo)(()=>!!l.find(e=>c.includes(e)),[c,l]),x=(0,tr.Z)(h,l);if(v)return null;let p="auto"===n&&h?K.EQg:K.x0v,{dateLocale:g,pattern:f}="sv"===d?{dateLocale:ts.Z,pattern:"d MMMM"}:"de"===d?{dateLocale:td.Z,pattern:"d. MMMM"}:"us"===d?{dateLocale:tc.Z,pattern:"MMMM d"}:{dateLocale:tu.Z,pattern:"d MMMM"},j=x?(0,to.Z)(x,f,{locale:g}):void 0,b=null!=j?j:(0,i.jsx)(H.G,{icon:K.AX7,className:"mx-1 opacity-25 animate-spin"});return"banner"===t?(0,i.jsxs)("div",{className:(0,q.cn)("flex items-center justify-center gap-2.5 bg-[#dae8d1]/80 px-4 py-2 sm:px-6",r),children:[(0,i.jsx)(H.G,{icon:K.x0v,className:"text-sm text-[#61924B] shrink-0"}),(0,i.jsxs)("div",{className:"text-13 sm:text-sm text-gray-900 truncate",children:[s.product.shipping_slim_text," ",(0,i.jsx)("strong",{className:"font-bold whitespace-nowrap",children:b})]})]}):(0,i.jsxs)("div",{className:(0,q.cn)("flex items-center gap-3 bg-white px-3 py-2.5 border border-gray-200 max-w-[320px]",r),children:[(0,i.jsx)("div",{className:"flex justify-center items-center rounded-full bg-[#dae8d1] size-11 shrink-0",children:(0,i.jsx)(H.G,{icon:p,className:"text-base text-[#61924B]"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("div",{className:"text-2xs leading-none tracking-wider uppercase text-gray-600",children:s.product.shipping_card_overline}),(0,i.jsxs)("div",{className:"mt-[5px] text-13 leading-none font-bold text-gray-900",children:[s.product.shipping_card_ships_by," ",b]}),h&&(0,i.jsx)("div",{className:"mt-[3px] text-2xs leading-tight text-gray-500",children:s.product.shipping_card_subtext})]})]})}function tv(e){let{children:t,className:l}=e,[n,r]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{let e=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(e)},[]),(0,i.jsx)("div",{className:c()("grid transition-[grid-template-rows] duration-300 ease-out",n?"grid-rows-[1fr]":"grid-rows-[0fr]",l),children:(0,i.jsx)("div",{className:"flex overflow-hidden flex-col min-h-0",children:t})})}var th=l(4924),tx=l(58543),tp=l(17843);function tg(){let{product:e}=(0,ta.i)(),t=(t,l)=>{var i,n,r;return null===(r=e.variants)||void 0===r?void 0:null===(n=r.edges)||void 0===n?void 0:null===(i=n.filter(e=>{var i,n;if(t){let l=null===(i=e.node.selectedOptions.find(e=>(0,P.EW)(e.name)||(0,P.In)(e.name)))||void 0===i?void 0:i.value;if(!(0,tp.HH)(l,t))return!1}if(l){let t=null===(n=e.node.selectedOptions.find(e=>(0,P.jb)(e.name)||(0,P.vr)(e.name)))||void 0===n?void 0:n.value;if(!(0,tp.HH)(t,l))return!1}return!0}))||void 0===i?void 0:i.map(e=>Number(e.node.price.amount))};return{minPriceAtWidth:(l,i)=>{let n=t(l,i);return n&&n.length>0?Math.min(...n):e.priceRange.minVariantPrice.amount}}}function tf(e,t){var l,i,n;let{options:r}=(0,ta.i)(),{minPriceAtWidth:a}=tg(),{locale:s}=(0,o.useRouter)(),d=(null==t?void 0:t.productVisualization)==="curtain3D",c=null==r?void 0:r.some(e=>{var t;return(0,P.In)(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"")}),u=null==r?void 0:r.find(e=>{var t;return(0,P.EW)(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"")}),m=!c&&(null==u?void 0:null===(l=u.values)||void 0===l?void 0:l.length)?u.values.map(e=>parseInt(e,10)).filter(e=>!!e).sort((e,t)=>
1e-t):[];if(!d||0===m.length)return null;let v=null===(n=e.priceRange)||void 0===n?void 0:null===(i=n.minVariantPrice)||void 0===i?void 0:i.currencyCode,h=e=>(0,ex.l)({amount:String(a(e,void 0)),currencyCode:v},s),[x,p]=m;return{singleWidth:x,singlePrice:h(x),doubleWidth:p||void 0,doublePrice:p?h(p):void 0}}function tj(e){var t;let{product:l,sanityProduct:n,className:r}=e,o=(0,a.Z)(),{supportsInches:s}=(0,th.eY)(),d=tf(l,n);if(!(null==d?void 0:d.doublePrice))return null;let u=e=>s?"".concat(e," cm / ").concat(Math.round((0,tx.DY)(e))," in"):"".concat(e," cm"),m=[{label:o.product.card.single_width,price:d.singlePrice,width:d.singleWidth},{label:o.product.card.double_width,price:d.doublePrice,width:null!==(t=d.doubleWidth)&&void 0!==t?t:0}];return(0,i.jsx)("div",{className:c()("grid grid-cols-2 gap-2",r),children:m.map(e=>(0,i.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,i.jsxs)("p",{className:"text-xs leading-snug",children:[(0,i.jsx)("span",{className:"tracking-wider text-gray-600 uppercase",children:e.label})," ",(0,i.jsx)("span",{className:"text-gray-600",children:u(e.width)})]}),(0,i.jsx)("p",{className:"text-sm font-semibold text-black",children:e.price})]},e.label))})}var tb=l(81617),ty=l(89498),tw=l(12744),tN=l(86501),t_=l(20400),tk=l(87536);function tC(e){var t;let{product:l,variant:n,width:r,length:s,className:d}=e,c=(0,a.Z)(),u=(0,o.useRouter)(),v=u.locale,{loading:h,submitted:x,errors:p,submit:g}=function(){let[e,t]=(0,M.useState)(!1),[l,i]=(0,M.useState)(!1),[n,r]=(0,M.useState)({}),o=(0,a.Z)();return{loading:e,submitted:l,errors:n,submit:async function(e){r({}),t(!0);try{await (0,tw.Z)("POST","/back-in-stock",e),i(!0)}catch(e){var l;if((null==e?void 0:e.status)===422&&(null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.errors)){let t=function(e){let t={};for(let[l,i]of Object.entries(e))t[l]=Array.isArray(i)?i[0]:String(i);return t}(e.data.errors);r(t),t.email||tN.ZP.error(o.back_in_stock.error)}else tN.ZP.error(o.back_in_stock.error)}t(!1)}}}(),{register:f,handleSubmit:j,formState:{errors:b}}=(0,tk.cI)({defaultValues:{email:"",company:""}}),y=(null===(t=b.email)||void 0===t?void 0:t.message)||p.email;return x?(0,i.jsxs)("div",{className:(0,q.cn)("flex flex-col items-center justify-center border border-stone-200 bg-cream p-5 text-center",d),children:[(0,i.jsx)(H.G,{icon:K.LEp,className:"text-2xl"}),(0,i.jsx)("p",{className:"mt-2 text-sm font-medium",children:c.back_in_stock.success_title}),(0,i.jsx)("p",{className:"mt-1 text-sm text-black/60",children:c.back_in_stock.success_text})]}):(0,i.jsxs)("div",{className:(0,q.cn)("border border-stone-200 bg-cream p-5",d),children:[(0,i.jsx)("p",{className:"text-sm font-medium",children:c.back_in_stock.title}),(0,i.jsx)("p",{className:"mt-1 text-sm text-black/60",children:c.back_in_stock.description}),(0,i.jsxs)("form",{onSubmit:j(function(e){var t;let i={email:e.email,product_id:l.id,product_handle:l.handle,product_title:l.title,variant_id:null==n?void 0:n.id,variant_title:null==n?void 0:n.title,options:null!==(t=null==n?void 0:n.selectedOptions)&&void 0!==t?t:[],locale:v,country_code:t_.ZP[v].countryCode,url:u.asPath,company:e.company};null!=r&&(i.width=r),null!=s&&(i.length=s),g(i)}),className:"mt-3",noValidate:!0,children:[(0,i.jsx)(tb.Z,{name:"email",type:"email",autoComplete:"email",placeholder:c.back_in_stock.email_placeholder,register:f,options:{required:c.form.error.required,pattern:{value:ty.Q,message:c.account.email_form.validation.invalid}},error:y}),(0,i.jsx)("input",{type:"text",tabIndex:-1,autoComplete:"off","aria-hidden":"true",className:"absolute -left-[9999px] h-px w-px overflow-hidden",...f("company")}),(0,i.jsx)(ey.Z,{block:!0,type:"submit",variant:"black",fontWeight:"normal",loading:h,className:"mt-3",children:c.back_in_stock.submit})]}),(0,i.jsx)("p",{className:"mt-2 text-xs text-black/50",children:(0,i.jsx)(m(),{href:c.back_in_stock.privacy_href,className:"underline hover:no-underline",children:c.back_in_stock.privacy_link})})]})}var tZ=l(25675),tS=l.n(tZ);function tI(e){let{title:t,attributes:l,imageUrl:n,productUrl:r,quantity:a,unitPrice:s}=e,{locale:d}=(0,o.useRouter)(),c=n&&(0,i.jsx)("div",{className:"overflow-hidden w-12 h-12 bg-gray-100",children:(0,i.jsx)(tS(),{src:"".concat(n,"&width=96"),alt:t,width:48,height:48,className:"object-cover w-full h-full"})});return(0,i.jsxs)("div",{className:"flex gap-3 items-center",children:[c&&(r?(0,i.jsx)(m(),{href:r,target:"_blank",className:"flex-shrink-0",children:c}):(0,i.jsx)("div",{className:"flex-shrink-0",children:c})),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-[13px] leading-snug font-bold mb-0.5",children:r?(0,i.jsx)(m(),{href:r,target:"_blank",className:"hover:text-gray-500",children:t}):t}),(0,i.jsx)("div",{className:"text-[13px] leading-snug flex flex-wrap gap-x-3",children:l.map(e=>{let{label:t,value:l}=e;return(0,i.jsxs)("div",{children:[(0,i.jsxs)("span",{className:"text-gray-600 capitalize",children:[t,": "]}
1),(0,i.jsx)("span",{className:"text-black",children:l})]},t)})})]}),(0,i.jsxs)("div",{className:"flex-shrink-0 text-sm text-black whitespace-nowrap",children:[a," x ",(0,ex.T)(s,d)]})]})}function tG(e){var t,l,n,s;let{curtainPrice:d,curtainQuantity:c,width:u,length:m,widthInchesInput:v,lengthInchesInput:h,mountProductPrice:x,mountQuantity:p,mountLength:g,mountLengthInchesInput:f,mountType:j,curtainProduct:b,curtainSanityProduct:y,curtainVariant:w,curtainColor:N,mountProduct:_,mountSanityProduct:k,mountVariant:C,mountColor:Z}=e,S=(0,a.Z)(),{locale:I}=(0,o.useRouter)(),{isInches:G}=(0,th.eY)(),M=(e,t)=>e?G?(0,tx.cb)(e,!0,t):"".concat(e," cm"):"-",P=[{label:S.product.color,value:N||"-"},{label:S.product.choose_width_short,value:M(u,v)},{label:S.product.choose_length_short,value:M(m,h)}],z=[...Z?[{label:S.product.color,value:Z}]:[],{label:S.product.choose_length_short,value:M(g,f)}],R=(e,t)=>{if(!e)return;let l=(0,r.kG)(I,e);return t?"".concat(l,"/").concat((0,X.l)(t)):l},L=!!x&&p&&p>0;return(0,i.jsxs)("div",{className:"space-y-3 w-full",children:[(0,i.jsx)(tI,{title:b?b.title:S.configurator.curtains_with_dimensions.replace(":width",String(u||0)).replace(":length",String(m||0)),attributes:P,imageUrl:(null==w?void 0:null===(t=w.image)||void 0===t?void 0:t.url)||(null==b?void 0:null===(l=b.featuredImage)||void 0===l?void 0:l.url),productUrl:R(y,N),quantity:c,unitPrice:d/c}),L&&(0,i.jsx)(tI,{title:_?_.title:"rail"===j?S.configurator.curtain_rail:"rod"===j?S.configurator.curtain_rod:S.configurator.mounting_with_length.replace(":length",String(g||0)),attributes:z,imageUrl:(null==C?void 0:null===(n=C.image)||void 0===n?void 0:n.url)||(null==_?void 0:null===(s=_.featuredImage)||void 0===s?void 0:s.url),productUrl:R(k,Z),quantity:p,unitPrice:x})]})}function tM(e){let{colors:t,selectedColor:l,onColorChange:n,productId:r,className:a,compact:o=!1}=e,s=(0,M.useRef)({}),{isAboveBreakpoint:d}=(0,e4.Z)(),c=!d("lg"),u=(0,M.useRef)(null),[m,v]=(0,M.useState)(!1),[h,x]=(0,M.useState)(!1),p=()=>{if(!u.current||!c)return;let{scrollLeft:e,scrollWidth:t,clientWidth:l}=u.current;v(e>0),x(e<t-l-1)};return((0,M.useEffect)(()=>{if(l&&c&&u.current){let e=s.current[l];if(!e)return;let t=u.current.offsetWidth,i=e.offsetWidth,n=e.offsetLeft;u.current.scrollLeft=n-t/2+i/2}},[l,c]),(0,M.useEffect)(()=>{p();let e=u.current;if(e)return e.addEventListener("scroll",p),()=>e.removeEventListener("scroll",p)},[c,t]),o)?(0,i.jsx)("div",{className:(0,q.cn)("flex flex-wrap gap-2 items-center px-0.5",a),children:t.map(e=>(0,i.jsx)("button",{"aria-label":e,onClick:()=>n(e),className:"focus:outline-none focus:ring-0",children:(0,i.jsx)($.Z,{color:e,selected:l===e,size:"medium",tooltip:!0,productId:r})},e))}):(0,i.jsxs)("div",{className:(0,q.cn)("-mx-4 lg:mx-0 max-lg:overflow-x-hidden relative px-0.5",a),children:[!d("lg")&&(0,i.jsx)(i.Fragment,{children:["left","right"].map(e=>(0,i.jsx)("div",{style:{["right"===e?"left":"right"]:0,background:"linear-gradient(to ".concat(e,", rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))")},className:"absolute inset-y-0 w-12 pointer-events-none z-[1]"},e))}),c&&m&&(0,i.jsx)("button",{onClick:()=>{u.current&&u.current.scrollBy({left:-200,behavior:"smooth"})},className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 w-10 h-10 flex items-center justify-center bg-white/90 backdrop-blur-sm rounded-full shadow-md","aria-label":"Scroll left",children:(0,i.jsx)(H.G,{icon:K.A35,className:"text-sm"})}),c&&h&&(0,i.jsx)("button",{onClick:()=>{u.current&&u.current.scrollBy({left:200,behavior:"smooth"})},className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 w-10 h-10 flex items-center justify-center bg-white/90 backdrop-blur-sm rounded-full shadow-md","aria-label":"Scroll right",children:(0,i.jsx)(H.G,{icon:K._tD,className:"text-sm"})}),(0,i.jsx)("div",{ref:u,className:"flex items-center gap-3 hide-scrollbar max-lg:snap-x max-lg:w-full max-lg:overflow-x-auto max-lg:px-4 max-lg:py-2 lg:flex-wrap",children:t.map(e=>{let t=l===e;return(0,i.jsx)("button",{ref:t=>s.current[e]=t,"aria-label":e,onClick:()=>n(e),className:"max-lg:snap-center focus:outline-none lg:focus:outline focus:ring-0",children:c?(0,i.jsx)($.Z,{color:e,className:(0,q.cn)("lg:hidden",{"scale-95 transform":l&&!t}),selected:t,size:"xlarge",tooltip:!0,productId:r}):(0,i.jsx)($.Z,{color:e,className:(0,q.cn)("max-lg:hidden",{"scale-95 transform":l&&!t}),selected:t,size:"medium",tooltip:!0,productId:r})},e)})})]})}var tP=l(79243),tz=l(17452),tR=l(16905),tL=l(88623);function tF(e){var t;
1if(e){if("image"===e.typeOfMedia&&e.image.aspectRatio)return e.image.aspectRatio;if("video"===e.typeOfMedia&&(null===(t=e.video.data)||void 0===t?void 0:t.aspect_ratio)){let t=e.video.data.aspect_ratio;if("string"==typeof t&&t.includes(":")){let[e,l]=t.split(":").map(Number);return e/l}return parseFloat(t)}if("hotspotArrayImage"===e.typeOfMedia)return e.hotspotArrayImage.aspectRatio}}function tE(e){let{media:t,aspectRatio:l}=e;return t?(0,i.jsx)("div",{className:"overflow-hidden relative -mx-3 mt-1 rounded-t-3xl lg:rounded-t-none lg:mt-0",style:l?{aspectRatio:l.toString()}:void 0,children:(0,i.jsx)("div",{className:"overflow-hidden rounded",children:(0,i.jsx)(e0.Z,{media:t,imageWidth:600,sizes:"(max-width: 768px) 90vw, 500px",showControls:!0})})}):null}function tT(e){let{label:t,children:l,className:n="gap-2"}=e;return(0,i.jsxs)("div",{className:"flex flex-col items-start ".concat(n),children:[(0,i.jsx)("p",{className:"text-xs tracking-wider text-gray-600 uppercase",children:t}),l]})}function tW(e){let{content:t}=e;return t&&0!==t.length?(0,i.jsx)("div",{className:"max-w-none prose prose-sm",children:(0,i.jsx)(tL.Z,{blocks:t,size:"small"})}):null}function tV(e){let{children:t}=e;return(0,i.jsx)("div",{className:"divide-y divide-gray-200",children:t})}function tO(e){let{label:t,value:l}=e;return(0,i.jsxs)("div",{className:"flex gap-4 justify-between items-center py-2",children:[(0,i.jsx)("span",{className:"flex-1 text-xs tracking-wider uppercase break-all",children:t}),(0,i.jsx)("span",{className:"text-sm font-medium text-right",children:l})]})}function tB(e){let{title:t,placeholder:l,name:n,form:r,maxValue:a,placeholderTranslateClass:o,autoFocus:s,inputRef:d}=e;return(0,i.jsx)("div",{className:"py-1.5",children:(0,i.jsx)(tR.Z,{title:t,placeholder:l,name:n,form:r,maxValue:a,variant:"rounded",layout:"horizontal",placeholderTranslateClass:o,autoFocus:s,inputRef:d})})}var tD=l(61503),tq=l(45739),tA=l(98829);let tH={"rail-140":{parked:40,expanded:100,fabric:140},"rail-280":{parked:70,expanded:200,fabric:280},"rod-140":{parked:20,expanded:85,fabric:140},"rod-280":{parked:40,expanded:170,fabric:280}};function tK(e){var t,l,n;let{form:r,step:o,guideMountType:s,onGuideMountTypeChange:d,widths:u,isCustomWidth:m,maxWidth:v,maxLength:h,placeholderSize:x,guideData:p,verticalKind:g="length"}=e,f=(0,a.Z)(),{isInches:j}=(0,th.eY)(),b=(0,M.useRef)(null);(0,M.useEffect)(()=>{if("step2"!==o)return;let e=!1,t=requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!e){var t;null===(t=b.current)||void 0===t||t.focus()}})});return()=>{e=!0,cancelAnimationFrame(t)}},[o]);let y=(0,tk.qo)({control:r.control,name:"width"}),w=(0,tk.qo)({control:r.control,name:"length"}),N=(0,M.useMemo)(()=>{if(!p)return;if("step2"===o)return"rod"===s?p.rodLengthGuideMedia:p.railLengthGuideMedia;let e=140===y;return"rod"===s?e?p.rodWidthGuideMedia:p.rodWidthDoubleGuideMedia:e?p.railWidthGuideMedia:p.railWidthDoubleGuideMedia},[p,s,o,y]),_=(0,M.useMemo)(()=>{if(!p)return;if("step2"===o)return"rod"===s?p.rodLengthGuideContent:p.railLengthGuideContent;let e=140===y;return"rod"===s?e?p.rodWidthGuideContent:p.rodWidthDoubleGuideContent:e?p.railWidthGuideContent:p.railWidthDoubleGuideContent},[p,s,o,y]),k=(0,M.useMemo)(()=>tF(N),[N]),C=(0,M.useMemo)(()=>{var e;return"step1"===o&&y&&null!==(e=tH["".concat(s,"-").concat(y)])&&void 0!==e?e:null},[o,y,s]),Z=(0,M.useMemo)(()=>"step2"!==o||null==w?null:"rod"===s?w-1+2:w+2,[o,w,s]),S=e=>j?"".concat(Math.round((0,tx.DY)(e,1))," in (â ").concat(e," cm)"):"".concat(e," cm"),I=j?Math.round((0,tx.DY)(null!==(t=null==x?void 0:x.width)&&void 0!==t?t:120,1)):null!==(l=null==x?void 0:x.width)&&void 0!==l?l:120;j?(0,tx.DY)(null!==(n=null==x?void 0:x.length)&&void 0!==n?n:250,1):null==x||x.length;let G=!m&&u.length>0,P="rod"===s?f.measurement_guide.regular_length_input_sublabel_rod:f.measurement_guide.regular_length_input_sublabel,z=(0,i.jsx)("div",{className:"max-w-[220px] md:max-w-full text-balance",children:"height"===g?f.product.choose_height:P});return(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsx)(tE,{media:N,aspectRatio:k}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,i.jsx)(tT,{label:f.measurement_guide.mount_label,className:"gap-1",children:d?(0,i.jsx)(tD.Z,{size:"small",fluid:!0,options:[{value:"rail",label:f.configurator.curtain_rail_short},{value:"rod",label:f.configurator.curtain_rod_short}],value:s,onChange:d}):(0,i.jsx)("span",{className:"inline-block px-3 py-1 text-sm font-medium text-white bg-black rounded-full",children:"rod"===s?f.configurator.curtain_rod_short:f.configurator.curtain_rail_short})}),"step1"===o?G?(0,i.jsx)(tq.Z,{title:f.measurement_guide.width_label,control:r.control,name:"width",options:[...u].reverse(),variant:"switch",fluid:!0}):(0,i.jsx)(tR.Z,{title:f.measurement_guide.width_label,placeholder:String(I),maxValue:v,name:"width",form:r,variant:"rounded",fullWidth:!0}):null,(0,i.jsx)(tA.Z,{layout:"vertical",fluid:!0,size:"sm"})]}),(0,i.jsxs)("div",{children:["step1"===o&&C&&(0,i.jsxs)(tV,{children:[(0,i.jsx)(tO,{label:null==p?void 0:p.parkedWidthLabel,value:S(C.parked)}),(0,i.jsx)(tO,{label:f.measurement_guide.expanded_width,value:S(C.expanded)}),(0,i.jsx)(tO,{label:f.measurement_guide.fabric_consumption,value:S(C.fabric)})]}),"step2"===o&&(0,i.jsxs)(tV,{children:[(0,i.jsx)(tB,{title:z,placeholder:"",maxValue:h,name:"length",form:r,placeholderTranslateClass:"-translate-x-[0px] lg:-translate-x-[0px]",inputRef:b}),"rod"===s?(0,i.jsx)(tO,{label:f.measurement_guide.regular_clearance_below_rod,value:(e=>{if(j){let t=(0,tx.DY)(Math.abs(e),2),l=e<0?"â":"+";return"".concat(l).concat(t," in (â ").concat(e," cm)")}return"".concat(e," cm")})(-1)}):null,(0,i.jsx)(tO,{label:f.measurement_guide.regular_extra_height_for_pooling,value:j?"+".concat((0,tx.DY)(2,2)," in (â ").concat(2," cm)"):"+".concat(2," cm")}),(0,i.jsx)(tO,{label:f.measurement_guide.final_curtain_length,value:null!=Z?"= ".concat(S(Z)):"â"})]}),(0,i.jsx)("div",{className:c()("step1"===o&&C||"step2"===o?"border-t border-gray-200 pt-3":""),children:(0,i.jsx)(tW,{content:_})})]})]})}function tU(e){var t;let l=e.windowWidth+2;if("wall"===e.mounting)return"decorative"===e.look?{width:l,length:135}:{width:l,length:e.windowLength+15};let i=null!==(t=e.ceilingToTopOfLining)&&void 0!==t?t:0;return"functional"===e.look?{width:l,length:e.windowLength+i}:{width:l,length:i+120}}function tQ(e){let{form:t,step:l,mounting:n,onMountingChange:r,look:o,onLookChange:s,guideData:d}=e,c=(0,a.Z)(),{isInches:u}=(0,th.eY)(),m=(0,M.useRef)(null);(0,M.useEffect)(()=>
1{if("step1"!==l)return;let e=!1,t=requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!e){var t;null===(t=m.current)||void 0===t||t.focus()}})});return()=>{e=!0,cancelAnimationFrame(t)}},[l]);let v=(0,tk.qo)({control:t.control,name:"windowWidth"}),h=(0,tk.qo)({control:t.control,name:"windowLength"}),x=(0,tk.qo)({control:t.control,name:"ceilingToTopOfLining"}),p=(0,M.useMemo)(()=>{if(d)return"step1"===l?"ceiling"===n?d.romanBlindCeilingGuideMedia:d.romanBlindWallGuideMedia:"decorative"===o?d.romanBlindDecorativeGuideMedia:d.romanBlindFunctionalGuideMedia},[d,l,n,o]),g=(0,M.useMemo)(()=>{if(d)return"step1"===l?"ceiling"===n?d.romanBlindCeilingGuideContent:d.romanBlindWallGuideContent:"decorative"===o?d.romanBlindDecorativeGuideContent:d.romanBlindFunctionalGuideContent},[d,l,n,o]),f=(0,M.useMemo)(()=>tF(p),[p]),j=e=>u?"".concat(Math.round((0,tx.DY)(e,1))," in = ").concat(e," cm"):"".concat(e," cm"),b="ceiling"===n,y=(0,M.useMemo)(()=>null==v||null==h?null:tU({windowWidth:v,windowLength:h,look:o,mounting:n,ceilingToTopOfLining:null!=x?x:void 0}),[v,h,o,n,x]),w=(0,M.useMemo)(()=>!y||b&&null==x?null:y.length,[y,b,x]),N="ceiling"===n?(0,i.jsxs)(i.Fragment,{children:[null==d?void 0:d.romanBlindWindowHeightCeilingLabel,(0,i.jsx)("span",{className:"block font-normal tracking-normal text-gray-500 normal-case",children:null==d?void 0:d.romanBlindWindowHeightCeilingSublabel})]}):(0,i.jsxs)(i.Fragment,{children:[c.measurement_guide.window_length_label,(0,i.jsx)("span",{className:"block font-normal tracking-normal text-gray-500 normal-case",children:c.measurement_guide.window_length_sublabel})]}),_=(null==d?void 0:d.romanBlindWindowWidthSublabel)?(0,i.jsxs)(i.Fragment,{children:[c.measurement_guide.window_width_label,(0,i.jsx)("span",{className:"block font-normal tracking-normal text-gray-500 normal-case",children:d.romanBlindWindowWidthSublabel})]}):c.measurement_guide.window_width_label,k="step2"===l&&b;return(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsx)(tE,{media:p,aspectRatio:f}),"step1"===l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,i.jsx)(tT,{label:null==d?void 0:d.romanBlindMountingLabel,className:"gap-1.5",children:(0,i.jsx)(tD.Z,{size:"small",fluid:!0,options:[{value:"wall",label:c.measurement_guide.mounting_wall},{value:"ceiling",label:c.measurement_guide.mounting_ceiling}],value:n,onChange:r})}),(0,i.jsx)(tA.Z,{layout:"vertical",fluid:!0,size:"sm"})]}),(0,i.jsxs)(tV,{children:[(0,i.jsx)(tB,{title:_,placeholder:"120",name:"windowWidth",form:t,inputRef:m}),(0,i.jsx)(tB,{title:N,placeholder:"150",name:"windowLength",form:t})]}),(0,i.jsx)(tW,{content:g}),(0,i.jsx)("p",{className:"text-xs italic text-gray-500",children:c.measurement_guide.recommended_measurements_hint})]}),"step2"===l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,i.jsx)(tT,{label:null==d?void 0:d.romanBlindStyleLabel,className:"gap-1.5",children:(0,i.jsx)(tD.Z,{size:"small",fluid:!0,options:[{value:"functional",label:c.measurement_guide.look_functional},{value:"decorative",label:c.measurement_guide.look_decorative}],value:o,onChange:s})}),(0,i.jsx)(tA.Z,{layout:"vertical",fluid:!0,size:"sm"})]}),(0,i.jsxs)(tV,{children:[k&&(0,i.jsx)(tB,{title:c.measurement_guide.ceiling_to_top_of_lining_label,placeholder:"30",name:"ceilingToTopOfLining",form:t}),(0,i.jsx)(tO,{label:c.measurement_guide.window_width_summary,value:null!=v?j(v):"â"}),(0,i.jsx)(tO,{label:c.measurement_guide.window_height_summary,value:null!=h?j(h):"â"}),(0,i.jsx)(tO,{label:c.measurement_guide.final_blind_width,value:y?"= ".concat(j(y.width)):"â"}),(0,i.jsx)(tO,{label:c.measurement_guide.final_blind_length,value:null!=w?"= ".concat(j(w)):"â"})]}),(0,i.jsx)(tW,{content:g})]})]})}var tY=l(17971),tJ=l(20929),tX=l(65302),t$=l(98187);async function t0(e){let t='\n *[_type == "productConfigurator"][0]{\n rodWidthGuideMedia {\n '.concat(tY.P,'\n },\n "rodWidthGuideContent": ').concat((0,tX.U)("rodWidthGuideContent"),"[]{\n ").concat(tJ.C,"\n },\n rodWidthDoubleGuideMedia {\n ").concat(tY.P,'\n },\n "rodWidthDoubleGuideContent": ').concat((0,tX.U)("rodWidthDoubleGuideContent"),"[]{\n ").concat(tJ.C,"\n },\n rodLengthGuideMedia {\n ").concat(tY.P,'\n },\n "rodLengthGuideContent": ').concat((0,tX.U)("rodLengthGuideContent"),"[]{\n ").concat(tJ.C,"\n },\n railWidthGuideMedia {\n ").concat(tY.P,'\n },\n "railWidthGuideContent": ').concat((0,tX.U)("railWidthGuideContent"),"[]{\n ").concat(tJ.C,"\n },\n railWidthDoubleGuideMedia {\n ").concat(tY.P,'\n },\n "railWidthDoubleGuideContent": ').concat((0,tX.U)("railWidthDoubleGuideContent"),"[]{\n ").concat(tJ.C,"\n },\n railLengthGuideMedia {\n ").concat(tY.P,'\n },\n "railLengthGuideContent": ').concat((0,tX.U)("railLengthGuideContent"),"[]{\n ").concat(tJ.C,'\n },\n "romanBlindMountingLabel": ').concat((0,tX.U)("romanBlindMountingLabel"),',\n "romanBlindStyleLabel": ').concat((0,tX.U)("romanBlindStyleLabel"),',\n "romanBlindWindowWidthSublabel": ').concat((0,tX.U)("romanBlindWindowWidthSublabel"),',\n "romanBlindWindowHeightCeilingLabel": ').concat((0,tX.U)("romanBlindWindowHeightCeilingLabel"),',\n "romanBlindWindowHeightCeilingSublabel": ').concat((0,tX.U)("romanBlindWindowHeightCeilingSublabel"),',\n "parkedWidthLabel": ').concat((0,tX.U)("parkedWidthLabel"),",\n romanBlindWallGuideMedia {\n ").concat(tY.P,'\n },\n "romanBlindWallGuideContent": ').concat((0,tX.U)("romanBlindWallGuideContent"),"[]{\n ").concat(tJ.C,"\n },\n romanBlindCeilingGuideMedia {\n ").concat(tY.P,'\n },\n "romanBlindCeilingGuideContent": ').concat((0,tX.U)("romanBlindCeilingGuideContent"),"[]{\n ").concat(tJ.C,"\n },\n romanBlindFunctionalGuideMedia {\n ").concat(tY.P,'\n },\n "romanBlindFunctionalGuideContent": ').concat((0,tX.U)("romanBlindFunctionalGuideContent"),"[]{\n ").concat(tJ.C,"\n },\n romanBlindDecorativeGuideMedia {\n ").concat(tY.P,'\n },\n "romanBlindDecorativeGuideContent": ').concat((0,tX.U)("romanBlindDecorativeGuideContent"),"[]{\n ").concat(tJ.C,"\n }\n }\n "),l=await (0,t$.ZP)().fetch(t,{locale:t_.ZP[e].languageCode,localeFallback:t_.ZP[e].languageCodeFallback});return null!=l?l:null}var t1=l(59734),t2=l(9693);let t4=["romanBlindCurtain3D","softRomanBlindCurtain3D"];function t5(e){return"rod"===e?1:2}function t3(e){let{isOpen:t,onClose:l,step:n,guideMountType:r,onGuideMountTypeChange:s,parentForm:d,widths:u=[],isCustomWidth:m,maxWidth:v,maxLength:h,placeholderSize:x,onContinueToStep2:p,onContinueToStep1:g,onSave:f,productVisualization:j,verticalKind:b="length"}=e,y=(0,a.Z)(),w=t4.includes(j),N=u.includes(280)?280:u[0],[_,k]=(0,M.useState)(!1);(0,M.useEffect)(()=>{t&&!_&&k(!0)},[t,_]);let{data:C,isLoading:Z}=function(e){let{locale:t}=(0,o.useRouter)();
1return(0,t1.ZP)(e?["interactiveGuide",t]:null,()=>t0(null!=t?t:"sv"))}(_),S=(0,tk.cI)({defaultValues:{width:void 0,length:void 0,windowWidth:void 0,windowLength:void 0,ceilingToTopOfLining:void 0}}),[I,G]=(0,M.useState)("wall"),[P,z]=(0,M.useState)("functional"),R=(0,M.useRef)(!1);(0,M.useEffect)(()=>{if(t&&!R.current){var e;let t=d.getValues("length");S.setValue("width",w?d.getValues("width"):null!==(e=d.getValues("width"))&&void 0!==e?e:N),S.setValue("length",w?t:"number"==typeof t?Math.max(t-t5(r),0):void 0)}R.current=t},[t,d,S,w,N,r]);let L="step1"===n,F="step2"===n,E=w?"step1"===n?y.measurement_guide.roman_blind_guide_title_step1:y.measurement_guide.roman_blind_guide_title_step2:"step1"===n?y.measurement_guide.width_guide_title:y.measurement_guide.length_guide_title,T=w?y.measurement_guide.step_measurements:y.measurement_guide.step_width,W=w?y.measurement_guide.step_style:y.measurement_guide.step_length,V=(0,i.jsxs)("div",{className:"flex justify-evenly border-b border-white bg-yellow",style:{marginBottom:1},children:[(0,i.jsx)("button",{className:c()("text-center text-xs uppercase tracking-wider h-10 flex items-center justify-center font-medium text-black",!L&&"opacity-30"),onClick:()=>null==g?void 0:g(),children:T}),(0,i.jsx)("button",{className:c()("text-center text-xs uppercase tracking-wider h-10 flex items-center justify-center font-medium text-black",!F&&"opacity-30"),onClick:()=>null==p?void 0:p(),children:W})]}),O=(0,i.jsxs)("div",{className:"bg-yellow pb-[env(safe-area-inset-bottom)]",children:[V,(0,i.jsxs)("div",{className:"flex gap-px bg-white border-b border-white",children:[!L&&(0,i.jsx)(ey.Z,{variant:"yellow",onClick:()=>{L?l():null==g||g()},className:"flex-1 !h-10 !rounded-none !text-xs !py-0",uppercase:!0,fontWeight:"medium",children:y.measurement_guide.back}),(0,i.jsx)(ey.Z,{variant:"yellow",onClick:()=>{if(F){if(w){let e=S.getValues("windowWidth"),t=S.getValues("windowLength"),l=S.getValues("ceilingToTopOfLining");if(null!=e&&null!=t){let{width:i,length:n}=tU({windowWidth:e,windowLength:t,look:P,mounting:I,ceilingToTopOfLining:null!=l?l:void 0});f(i,n)}else f(void 0,void 0)}else{let e=S.getValues("length");f(S.getValues("width"),"number"==typeof e?e+t5(r):void 0)}l()}else null==p||p()},className:"flex-1 !h-10 !rounded-none !text-xs !py-0",uppercase:!0,fontWeight:"medium",children:F?y.measurement_guide.save:y.measurement_guide.forward})]})]}),B=(0,i.jsx)("div",{className:"px-4 pb-8 mx-auto space-y-6 max-w-lg lg:py-0",children:Z?(0,i.jsx)("div",{className:"flex justify-center items-center p-16",children:(0,i.jsx)(H.G,{className:"text-xl text-gray-500 animate-spin",icon:K.AX7})}):w?(0,i.jsx)(tQ,{form:S,step:n,mounting:I,onMountingChange:G,look:P,onLookChange:z,guideData:C}):(0,i.jsx)(tK,{form:S,step:n,guideMountType:r,onGuideMountTypeChange:s,widths:u,isCustomWidth:m,maxWidth:v,maxLength:h,placeholderSize:x,guideData:C,verticalKind:b})});return(0,t2.Z)()?(0,i.jsx)(ti.Z,{enterFrom:"right",title:E,size:"medium-wide",isShowing:t,setIsShowing:e=>{("function"==typeof e?e(t):e)||l()},zIndex:"high",variant:"new",footer:O,children:B}):(0,i.jsx)(tz.Z,{isOpen:t,onClose:l,zIndex:"high",fixedHeight:!0,footer:O,children:B})}var t7=l(26609),t8=l(58115),t6=l(78075);function t9(e){let{form:t,widths:l,maxWidth:n,maxLength:r,isCustomWidth:o,placeholderSize:s,widthGuide:d,lengthGuide:c,showGeneralGuide:u,className:m,quantity:v,onQuantityChange:h,productVisualization:x,mountType:p,onAddToCart:g,canAddToCart:f,isRomanBlind:j,romanBlindCordSide:b,onRomanBlindCordSideChange:y,guideWrapper:w,lengthError:N=!1,interactiveGuideOpen:_,onInteractiveGuideOpenChange:k,verticalKind:C="length"}=e,Z=(0,a.Z)();(0,ej.Z)();let[S,I]=(0,M.useState)(!1),[G,P]=(0,M.useState)(!1),[z,R]=(0,M.useState)(!1),L="curtain3D"===x||"romanBlindCurtain3D"===x||"softRomanBlindCurtain3D"===x,[F,E]=(0,M.useState)("step1"),[T,W]=(0,M.useState)(!1),V=e=>{W(e),null==k||k(e)},[O,B]=(0,M.useState)("rail"),D=e=>{E(e),V(!0)},A=(0,M.useCallback)(()=>{E("step2")},[]),U=(0,M.useCallback)(()=>{E("step1")},[]),Q=(e,t)=>(0,i.jsxs)("button",{className:"text-[11px]",tabIndex:-1,onClick:e,children:[(0,i.jsx)(H.G,{icon:K.
1cnt,className:"text-[11px] mr-1.5 text-gray-700"}),(0,i.jsx)("span",{className:"underline",children:t})]}),Y=e=>(0,i.jsx)("button",{className:"text-[11px]",tabIndex:-1,onClick:e,children:(0,i.jsx)(H.G,{icon:K.Fuz,className:"text-[11px] text-gray-700"})}),J=(e,t,l)=>L?Y(()=>D(e)):t?Q(l,Z.product.guide):void 0,X=J("step1",d,()=>P(!0)),$=J("step2",c,()=>R(!0)),ee=L&&!!(null==w?void 0:w.title),et=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"grid grid-cols-[auto_auto] items-center gap-x-4 gap-y-2 mb-2 mt-0.5 w-fit",children:[j&&b&&y&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"text-xs tracking-wider text-gray-700 uppercase",children:Z.product.roman_blind_cord_side}),(0,i.jsx)(tD.Z,{size:"small",options:[{value:"left",label:Z.product.left},{value:"right",label:Z.product.right}],value:b,onChange:y})]}),(0,i.jsx)(tA.Z,{size:"sm",fluid:!0,className:"!contents"})]}),(0,i.jsx)("div",{className:"flex flex-col gap-3",children:(0,i.jsx)(t8.Z,{maxLength:r,widths:[...l].reverse(),maxWidth:n,isCustomWidth:o,placeholderSize:s,form:t,compact:!0,lengthError:N,verticalKind:C,widthGuideButton:X,lengthGuideButton:$,measureGuideButton:!L&&u?Q(()=>I(!0),Z.product.size_guide):void 0})})]});return(0,i.jsxs)("div",{className:(0,q.cn)("space-y-4",m),children:[ee?(0,i.jsxs)("div",{className:"border border-gray-200",children:[(0,i.jsxs)("div",{role:"button",onClick:()=>D("step1"),className:"flex gap-3 items-center px-3 py-3 border-b border-gray-200 bg-cream",children:[(0,i.jsx)("div",{className:"flex justify-center items-center rounded-full bg-yellow size-8",children:(0,i.jsx)(H.G,{icon:K.KxN,className:"text-lg text-gray-700"})}),(0,i.jsxs)("div",{className:"text-sm",children:[(0,i.jsx)("div",{className:"font-medium",children:null==w?void 0:w.title}),(null==w?void 0:w.subtitle)&&(0,i.jsx)("div",{className:"text-2xs mt-0.5",children:w.subtitle})]}),(0,i.jsx)(H.G,{icon:t6.yOZ,className:"ml-auto text-sm text-gray-700"})]}),(0,i.jsx)("div",{className:"flex-1 space-y-3 px-3 py-4 border-gray-200",children:et})]}):et,(0,i.jsx)("div",{className:"hidden mt-4 lg:block",children:(0,i.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{className:"text-sm text-black",children:Z.product.choose_number_of_curtains}),(0,i.jsxs)("span",{className:"text-2xs text-gray-400 cursor-help","data-tip":Z.product.quantity_info_tooltip,children:[(0,i.jsx)(H.G,{icon:K.Fuz,className:"mr-0.5 size-2.5"}),Z.product.sold_individually]})]}),(0,i.jsx)(t7.Z,{value:v,setValue:e=>h(e>0?e:1),border:"none",size:"sm"})]})}),L&&(0,i.jsx)(t3,{isOpen:null!=_?_:T,onClose:()=>V(!1),step:F,guideMountType:p||O,onGuideMountTypeChange:p?void 0:B,parentForm:t,widths:l,isCustomWidth:o,maxWidth:n,maxLength:r,placeholderSize:s,onContinueToStep2:A,onContinueToStep1:U,onSave:(e,l)=>{t.setValue("width",e),t.setValue("length",l)},onAddToCart:g,canAddToCart:f,productVisualization:x}),!L&&u&&(0,i.jsx)(tP.Z,{isShowing:S,setIsShowing:I,zIndex:"high"}),!L&&d&&(0,i.jsx)(tn,{isShowing:G,setIsShowing:P,article:d,zIndex:"high"}),!L&&c&&(0,i.jsx)(tn,{isShowing:z,setIsShowing:R,article:c,zIndex:"high"})]})}var le=l(31513),lt=l(7321),ll=l(71994),li=l(19494),ln=l(73935);function lr(e){var t,l;
1let{productConfigurator:n,selectedMountProductId:s,selectedMountColor:d,onMountProductSelect:c,className:u}=e,v=(0,a.Z)(),{locale:h}=(0,o.useRouter)(),[x,p]=(0,M.useState)(null),[g,f]=(0,M.useState)(!1);(0,M.useEffect)(()=>{f(!0)},[]);let j=(0,M.useMemo)(()=>{var e,t;let l=null!==(e=null==n?void 0:n.railMountProducts)&&void 0!==e?e:[],i=null!==(t=null==n?void 0:n.rodMountProducts)&&void 0!==t?t:[];return"rail"===x?l.map(e=>(0,eW.xv)(e.productId)):"rod"===x?i.map(e=>(0,eW.xv)(e.productId)):[]},[x,n]),{data:b,isLoading:y}=(0,li.Z)(null!=h?h:"sv",j,!0),w=(0,M.useMemo)(()=>b?Object.values(b):[],[b]),N=s?(0,eW.xv)(s):null,{data:_,isLoading:k}=(0,li.Z)(null!=h?h:"sv",N?[N]:[],!0),C=N?null==_?void 0:_[N]:void 0,Z=(0,eI.Z)(C),S=(0,eR.Z)(d,null==C?void 0:C.id),I=(0,M.useMemo)(()=>{if(s&&n)return[...n.railMountProducts||[],...n.rodMountProducts||[]].find(e=>e.productId==s)},[s,n]),G=I?d&&Z.length>1?(0,r.kG)(h,I)+"/"+(0,X.l)(d):(0,r.kG)(h,I):void 0,P=(e,t)=>{x&&(c(e,t),p(null))};return(0,i.jsxs)("div",{className:(0,q.cn)("w-full space-y-4",u),children:[!s&&(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(ey.Z,{block:!0,variant:"hollow-black",size:"small",onClick:()=>p("rod"),children:v.configurator.curtain_rod}),(0,i.jsx)(ey.Z,{block:!0,variant:"hollow-black",size:"small",onClick:()=>p("rail"),children:v.configurator.curtain_rail})]}),(0,i.jsxs)("div",{className:"w-full empty:hidden",children:[s&&k&&(0,i.jsxs)("div",{className:"flex items-center gap-3 p-2 border border-gray-200",children:[(0,i.jsx)(eo.Z,{width:48,height:48,className:"flex-shrink-0"}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(eo.Z,{width:"70%",height:16})})]}),C&&!k&&(0,i.jsxs)("div",{className:"flex items-center gap-3 p-2 border border-gray-200",children:[G?(0,i.jsx)(m(),{href:G,className:"relative flex-shrink-0 w-12 h-12 overflow-hidden bg-gray-200",children:(null===(t=C.featuredImage)||void 0===t?void 0:t.url)&&(0,i.jsx)(eO.Z,{src:C.featuredImage.url,fill:!0,style:{objectFit:"cover"},alt:C.title,sizes:"48px",overrideImageMaxWidth:96})}):(0,i.jsx)("div",{className:"relative flex-shrink-0 w-12 h-12 overflow-hidden bg-gray-200",children:(null===(l=C.featuredImage)||void 0===l?void 0:l.url)&&(0,i.jsx)(eO.Z,{src:C.featuredImage.url,fill:!0,style:{objectFit:"cover"},alt:C.title,sizes:"48px",overrideImageMaxWidth:96})}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[G?(0,i.jsxs)(m(),{href:G,target:"_blank",className:"block text-sm truncate hover:underline",children:[C.title,d&&Z.length>1&&(0,i.jsxs)(i.Fragment,{children:[" ",(null==S?void 0:S.name)||d]})]}):(0,i.jsxs)("p",{className:"text-sm truncate",children:[C.title,d&&Z.length>1&&(0,i.jsxs)(i.Fragment,{children:[" ",(null==S?void 0:S.name)||d]})]}),(0,i.jsx)(le.Z,{product:C,simple:!0,className:"text-xs"})]}),(0,i.jsx)("button",{onClick:()=>{c(void 0,void 0)},className:"flex-shrink-0 p-1 text-gray-400 transition hover:text-gray-600","aria-label":"Remove product",children:(0,i.jsx)(H.G,{icon:K.NBC,className:"text-lg"})})]})]}),g&&(0,ln.createPortal)((0,i.jsx)(ti.Z,{enterFrom:"right",isShowing:null!==x,setIsShowing:e=>{e||p(null)},title:"rod"===x?v.configurator.curtain_rod:"rail"===x?v.configurator.curtain_rail:"",size:"medium",zIndex:"high",children:(0,i.jsx)("div",{className:"p-4",children:y?(0,i.jsx)("div",{className:(0,q.cn)("grid grid-cols-2 gap-4"),children:Array(6).fill("").map((e,t)=>(0,i.jsx)(ll.Z,{},t))}):w.length>0?(0,i.jsx)("div",{className:(0,q.cn)("grid grid-cols-2 gap-4"),children:w.flatMap(e=>{let t=(0,eI.Z)(e);return t.length>0?t.map(t=>(0,i.jsx)(lt.Z,{product:e,color:t,onSelect:(e,t)=>P(e,t)},"".concat(e.id,"-").concat(t))):(0,i.jsx)(lt.Z,{product:e,onSelect:e=>P(e)},e.id)})}):(0,i.jsx)("p",{className:"text-sm text-gray-500",children:v.configurator.no_products_available})})}),document.body)]})}function la(e){var t,l;let{shopifyProduct:n,selectedColor:r,onColorChange:o,className:s}=e,d=(0,a.Z)(),c=null===(t=n.options)||void 0===t?void 0:t.find(e=>(0,P.u8)(null==e?void 0:e.name)),u=(null!==(l=null==c?void 0:c.values)&&void 0!==l?l:[]).filter(e=>!!e);return(null==c?void 0:c.name)&&!(u.length<=1)?(0,i.jsxs)("div",{className:s,children:[(0,i.jsx)("p",{className:"pb-2 text-xs tracking-wider up
1percase",children:d.general.color}),(0,i.jsx)(tM,{colors:u,selectedColor:r,onColorChange:o,productId:n.id,compact:!0})]}):null}function lo(e){let{label:t,onClick:l,block:n=!1,className:r}=e;return(0,i.jsxs)("button",{type:"button",onClick:l,className:c()("inline-flex gap-2 justify-center items-center px-4 py-4 text-xs/none tracking-widest uppercase transition border border-transparent bg-cream hover:bg-yellow/40",n&&"w-full",r),children:[(0,i.jsx)(H.G,{icon:K.KxN,className:"text-xs"}),(0,i.jsx)("span",{children:t})]})}function ls(e){let{length:t,onLengthChange:l,onLengthInchesInputChange:n,maxLength:r,mountingGuide:o,mountType:s,className:d,mountQuantity:c,onMountQuantityChange:u,lengthError:m=!1,mountingGuideOpen:v,onMountingGuideOpenChange:h}=e,x=(0,a.Z)();(0,ej.Z)();let p=void 0!==v,[g,f]=(0,M.useState)(!1),j=null!=v?v:g,b=e=>{let t="function"==typeof e?e(j):e;f(t),null==h||h(t)},y=(0,tk.cI)({defaultValues:{length:null!=t?t:void 0,lengthInchesInput:void 0}}),w=x.configurator.mounting_same_measurements_tooltip,N=y.watch("length"),_=y.watch("lengthInchesInput");(0,M.useEffect)(()=>
1{l(null!=N?Number(N):void 0)},[N,l]),(0,M.useEffect)(()=>{null==n||n(_)},[_,n]);let k=(0,i.jsx)("button",{type:"button",className:"text-[11px] text-gray-700 transition hover:text-gray-900","data-tip":w,"aria-label":w,tabIndex:-1,children:(0,i.jsx)(H.G,{icon:K.sqG,className:"text-[11px]"})});return(0,i.jsxs)("div",{className:d,children:[(0,i.jsx)("div",{className:"max-w-[205px]",children:(0,i.jsx)(tR.Z,{variant:"default",title:x.product.choose_length_short,placeholder:x.product.placeholder_size.replace(":size",String(300)),form:y,name:"length",maxValue:r,allowMath:!1,guideButton:k,error:m})}),o&&!p&&(0,i.jsx)(lo,{label:x.product.measurement_guide,onClick:()=>b(!0),className:"mt-2"}),(0,i.jsx)("div",{className:"hidden lg:block mt-4",children:(0,i.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,i.jsx)("span",{className:"text-sm text-black",children:"rail"===s?x.configurator.choose_number_of_rails:"rod"===s?x.configurator.choose_number_of_rods:x.configurator.choose_number_of_mounting}),(0,i.jsx)(t7.Z,{value:c,setValue:e=>u(e>0?e:1),border:"none",size:"sm"})]})}),o&&(0,i.jsx)(tn,{isShowing:j,setIsShowing:b,article:o,zIndex:"high"})]})}function ld(e){let{gp:t,mountLengthError:l=!1,mountingGuideOpen:n,onMountingGuideOpenChange:r}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lr,{productConfigurator:t.productConfigurator,selectedMountProductId:t.mountProductId,selectedMountColor:t.mountColor,onMountProductSelect:(e,l)=>t.selectMountProduct(e?(0,eW.fE)(e):void 0,l)}),t.mountProductId&&(0,i.jsxs)("div",{className:"flex flex-wrap gap-x-6 gap-y-4 items-start mt-4",children:[t.mountProductHasColors&&t.mountShopifyProduct&&(0,i.jsx)(la,{shopifyProduct:t.mountShopifyProduct,selectedColor:t.mountColor,onColorChange:t.setMountColor,className:"flex-[0.33]"}),t.mountProductHasLength&&(0,i.jsx)(ls,{className:"flex-[0.66]",length:t.mountLength,onLengthChange:t.setMountLength,onLengthInchesInputChange:t.setMountLengthInchesInput,maxLength:t.mountProductMaxLength,mountingGuide:t.currentMountingGuide,mountType:t.selectedMountType,mountQuantity:t.mountQuantity,onMountQuantityChange:t.setMountQuantity,lengthError:l,mountingGuideOpen:n,onMountingGuideOpenChange:r})]})]})}let lc=new Set;var lu=l(61359);function lm(e){let{isRomanBlind:t,cordSide:l,cordSideLabel:i,cordSideLeftLabel:n,cordSideRightLabel:r,trim:a}=e,o=[];return t&&o.push({key:i,value:"left"===l?n:r},{key:P.c2,value:l}),a&&o.push(...(0,lu.dz)(a.slug,a.sanityProduct,a.locale,a.fallbackLabel)),o}function lv(e,t,l){let{isReady:i}=(0,o.useRouter)();(0,M.useEffect)(()=>{i&&!e.formState.isDirty&&e.reset({...e.getValues(),width:t,length:l})},[i,t,l])}var lh=l(63358);function lx(){let{selectedOptions:e,options:t}=(0,ta.i)(),l=t.find(e=>(0,P.u8)(e.name)&&!(0,P.Ue)(e.name));return{currentColor:l?e[l.name]:void 0,colorOption:l}}function lp(e,t,l,i,n,r,o,s,d,c,u,m){let v=arguments.length>12&&void 0!==arguments[12]?arguments[12]:"length",h=(0,a.Z)(),{addLinesToCart:x,setShowCart:p}=(0,eh.l8)(),{isInches:g}=(0,th.eY)();return{addToCart:a=>{if(!e){alert("Invalid product");return}let f=null==d?void 0:d(),j=[{key:"height"===v?h.general.height:h.general.length,value:(0,tx.cb)(i,g,null==f?void 0:f.length)}];o&&j.push({key:h.general.width,value:(0,tx.cb)(l,g,null==f?void 0:f.width)}),c&&j.push({key:h.planning.room,value:c}),(null==u?void 0:u.length)&&j.push(...u);let b=n.map(e=>{var i,n,r;let a=s[(0,eW.xv)(e.productId)],o=null==a?void 0:null===(r=a.variants)||void 0===r?void 0:null===(n=r.edges)||void 0===n?void 0:null===(i=n.find(t=>{let{node:l}=t;return l.id===(0,eW.ll)(e.variantId)}))||void 0===i?void 0:i.node,d=(0,tp.hx)(e,t,l?l.toString():void 0);return{merchandiseId:o.id,quantity:d}});x([{merchandiseId:e,quantity:t,attributes:j}].concat(b,null!=m?m:[]),()=>{p(!0),a(),r()})}}}var lg=l(8832);function lf(e,t,l,i,n){return(0,M.useMemo)(()=>{let r=t*e;return i&&i.forEach(e=>{var i,a,o;let s=n[(0,eW.xv)(e.productId)],d=null==s?void 0:null===(o=s.variants)||void 0===o?void 0:null===(a=o.edges)||void 0===a?void 0:null===(i=a.find(t=>{let{node:l}=t;return l.id===(0,eW.ll)(e.variantId)}))||void 0===i?void 0:i.node;d&&(r+=Number(d.price.amount)*(0,tp.hx)(e,t,l?l.toString():void 0))}),r},[e,t,l,i,n])}var lj=l(83178),lb=l(571);function ly(e,t){var l,i,n,r;let a=(0,o.useRouter)().locale,s=null===(r=null==t?void 0:t.availableForSale)||void 0===r||r,d=s?void 0:null==e?void 0:e.id,{shopifyProduct:c}=(0,lb.Z)(a,d);if(!t||s)return!0;let u=null==c?void 0:null===(n=c.variants)||void 0===n?void 0:null===(i=n.edges)||void 0===i?void 0:null===(l=i.find(e=>e.node.id===t.id))||void 0===l?void 0:l.node;return u?u.availableForSale:s}var lw=l(60678);function lN(e,t,l){var i,n,r,s,d,c,u,m;let{selectedVariant:v,options:h,setSelectedOption:x}=(0,ta.i)(),{currentColor:p}=lx(),g=(0,a.Z)(),{locale:f}=(0,o.useRouter)(),{isInches:j}=(0,th.eY)(),b=null==h?void 0:h.find(e=>{var t;return(0,P.u8)(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"")}),y=(null!==(c=null==b?void 0:b.values)&&void 0!==c?c:[]).filter(e=>
1!!e),{width:w,setWidth:N,widths:_,maxWidth:k,isCustomWidth:C}=(0,lj.Z)(),{length:Z,setLength:S,maxLength:I}=(0,lg.Z)(),G=(0,tk.cI)({defaultValues:{width:w,length:Z}});lv(G,w,Z);let z=G.watch("width"),R=G.watch("length"),L=(0,M.useRef)(w),F=(0,M.useRef)(Z);(0,M.useEffect)(()=>{z!==L.current&&(L.current=z,N(z))},[z]),(0,M.useEffect)(()=>{R!==F.current&&(F.current=R,S(R))},[R]);let E=(0,M.useRef)({}),T=(0,M.useCallback)(()=>E.current,[]);(0,M.useEffect)(()=>{let e=G.watch(e=>{E.current={width:e.widthInchesInput,length:e.lengthInchesInput}});return()=>e.unsubscribe()},[G]);let[W,V]=(0,M.useState)(2),O=t.productConfigurator,B=!!((null==O?void 0:null===(i=O.railMountProducts)||void 0===i?void 0:i.length)||(null==O?void 0:null===(n=O.rodMountProducts)||void 0===n?void 0:n.length)),[D,q]=(0,M.useState)(),[A,H]=(0,M.useState)(),[K,U]=(0,M.useState)(),[Q,Y]=(0,M.useState)(1),[J,X]=(0,M.useState)(),{selectedMountType:$,currentMountingGuide:ee,mountSanityProduct:et,mountShopifyProduct:el,mountProductHasColors:ei,mountProductHasLength:en,mountProductMaxLength:er,mountProductVariant:ea,mountProductPrice:eo}=function(e){var t,l,i,n;
1let{productConfigurator:r,mountProductId:a,mountColor:o,mountLength:s,locale:d}=e,c=(0,M.useMemo)(()=>{var e,t;if(!a||!r)return;let l=null===(e=r.railMountProducts)||void 0===e?void 0:e.some(e=>e.productId==a),i=null===(t=r.rodMountProducts)||void 0===t?void 0:t.some(e=>e.productId==a);return l?"rail":i?"rod":void 0},[a,r]),u="rail"===c?null==r?void 0:r.railMountingGuide:"rod"===c?null==r?void 0:r.rodMountingGuide:void 0,m=(0,M.useMemo)(()=>{if(a&&r)return[...r.railMountProducts||[],...r.rodMountProducts||[]].find(e=>e.productId==a)},[a,r]),v=a?(0,eW.xv)(a):null,{data:h}=(0,li.Z)(null!=d?d:"sv",v?[v]:[],!0),x=v?null==h?void 0:h[v]:void 0,p=null==x?void 0:null===(t=x.options)||void 0===t?void 0:t.find(e=>(0,P.u8)(null==e?void 0:e.name)),g=!!p&&(null!==(n=null===(l=p.values)||void 0===l?void 0:l.length)&&void 0!==n?n:0)>1,f=null==x?void 0:null===(i=x.options)||void 0===i?void 0:i.find(e=>(0,P.jb)(null==e?void 0:e.name)),j=!!f,b=(0,M.useMemo)(()=>{if(!(null==f?void 0:f.values))return;let e=(0,lh.Z)(f.values);return e.length>0?e[e.length-1].to:void 0},[f]),y=!!(s&&b&&s>b),w=(0,M.useMemo)(()=>{var e,t;if(!x||!a)return;let l=null===(e=x.variants.edges.find(e=>{let t=!0;if(o&&(null==p?void 0:p.name)){let l=e.node.selectedOptions.find(e=>e.name===p.name);t=(null==l?void 0:l.value)===o}let l=!0;if(s&&(null==f?void 0:f.name)){let t=e.node.selectedOptions.find(e=>(0,P.jb)(e.name)||(0,P.vr)(e.name));l=!t||(0,tp.HH)(t.value,s)}return t&&l}))||void 0===e?void 0:e.node;return null!=l?l:null===(t=x.variants.edges[0])||void 0===t?void 0:t.node},[x,a,o,p,s,f]),N=w?Number(w.price.amount):0;return{selectedMountType:c,currentMountingGuide:u,mountSanityProduct:m,mountShopifyProduct:x,mountProductHasColors:g,mountProductHasLength:j,mountProductMaxLength:b,isMountLengthTooLong:y,mountProductVariant:w,mountProductPrice:N}}({productConfigurator:O,mountProductId:D,mountColor:A,mountLength:K,locale:f}),es=(0,M.useCallback)(()=>{q(void 0),H(void 0),U(void 0),Y(1)},[]),ed=(0,M.useCallback)((e,t)=>{e?(q(e),H(t)):es()},[es]),{minPriceAtWidth:ec}=tg(),eu=lf(Number(null!==(m=null!==(u=null==v?void 0:null===(r=v.price)||void 0===r?void 0:r.amount)&&void 0!==u?u:ec(null!=w?w:0,null!=Z?Z:0))&&void 0!==m?m:0),W,null!=w?w:0,[],void 0),em=eu+eo*Q,ev=null===(d=e.priceRange)||void 0===d?void 0:null===(s=d.minVariantPrice)||void 0===s?void 0:s.currencyCode,eh=(0,M.useMemo)(()=>{if(!D||!ea)return;let e=[];return K&&e.push({key:g.general.length,value:(0,tx.cb)(K,j,J)}),{merchandiseId:ea.id,quantity:Q,attributes:e}},[D,ea,K,J,Q,j,g.general.length]),{addToCart:ex}=lp(null==v?void 0:v.id,W,null!=w?w:0,null!=Z?Z:0,[],l,C,void 0,T,void 0,lm({isRomanBlind:!1,cordSide:"right",cordSideLabel:"",cordSideLeftLabel:"",cordSideRightLabel:""}),eh?[eh]:[]),ep=(0,M.useCallback)(t=>{if(null==v?void 0:v.id){let t=eh?{type:$,productId:D,productTitle:null==el?void 0:el.title,quantity:Q}:void 0;(0,lw.os)(e.id,e.title,em,ev,t)}ex(t)},[ex,null==v?void 0:v.id,e.id,e.title,em,ev,eh,$,D,null==el?void 0:el.title,Q]),eg=ly(e,v),ef=!!v&&!eg,ej=!!(p&&w&&Z)&&!ef;return(0,M.useEffect)(()=>{if(ej){var t,l;t=e.id,l=()=>(0,lw.xn)(e.id,e.title,p,null!=w?w:void 0,null!=Z?Z:void 0),lc.has(t)||(lc.add(t),l())}},[ej,e.id,e.title,p,w,Z]),{colors:y,currentColor:p,handleColorChange:e=>{(null==b?void 0:b.name)&&x(b.name,e)},form:G,width:w,length:Z,widths:_,maxWidth:k,maxLength:I,isCustomWidth:C,quantity:W,setQuantity:V,getInchesInputs:T,productConfigurator:O,showMount:B,mountProductId:D,mountColor:A,setMountColor:H,mountLength:K,setMountLength:U,setMountLengthInchesInput:X,mountLengthInchesInput:J,mountQuantity:Q,setMountQuantity:Y,clearMount:es,selectMountProduct:ed,selectedMountType:$,currentMountingGuide:ee,mountSanityProduct:et,mountShopifyProduct:el,mountProductHasColors:ei,mountProductHasLength:en,mountProductMaxLength:er,mountProductVariant:ea,mountProductPrice:eo,curtainPrice:eu,totalPrice:em,currencyCode:ev,selectedVariant:v,addToCart:ep,canAddToCart:ej,isVariantUnavailable:ef}}var l_=l(25260);
1let lk="53px",lC="324px",lZ=[lk,lC];function lS(e){let{product:t,sanityProduct:l,onClose:n,configureParam:r,onMinimizedChange:s}=e,d=(0,a.Z)();(0,ej.Z)();let{locale:c}=(0,o.useRouter)(),u=lN(t,l,n),[m,v]=(0,M.useState)(0),[h,x]=(0,M.useState)(!1),[p,g]=(0,M.useState)(!1),[f,j]=(0,M.useState)(!1),[b,y]=(0,M.useState)(!1),[w,N]=(0,M.useState)(lC),_=e=>{N(e),null==s||s(e===lk)};(0,M.useEffect)(()=>{"1"===r&&N(lC)},[r]);let k=(0,M.useMemo)(()=>{let e=[{id:"color",title:d.configurator.choose_color},{id:"measurements",title:d.configurator.enter_measurements}];return u.showMount&&e.push({id:"mount",title:d.configurator.select_mount}),e.push({id:"summary",title:d.configurator.summary_step}),e},[d,u.showMount]),C=Math.min(m,k.length-1),Z=k[C],S=C===k.length-1,I="color"===Z.id||"measurements"===Z.id,G="mount"===Z.id&&!!u.mountProductId,P="mount"===Z.id&&!u.mountProductId,z="rail"===u.selectedMountType?d.configurator.choose_number_of_rails:"rod"===u.selectedMountType?d.configurator.choose_number_of_rods:d.configurator.choose_number_of_mounting,R="color"===Z.id?!u.currentColor:"measurements"===Z.id?!u.length:"mount"===Z.id&&!!u.mountProductId&&u.mountProductHasLength&&!u.mountLength,L=()=>{if(R){x(!0);return}x(!1),v(e=>Math.min(k.length-1,e+1))},F="mount"===Z.id?u.mountProductPrice*u.mountQuantity:u.totalPrice,E=(0,ex.l)({amount:String(F),currencyCode:u.currencyCode},c),T="curtain3D"===l.productVisualization||"romanBlindCurtain3D"===l.productVisualization||"softRomanBlindCurtain3D"===l.productVisualization,W="measurements"===Z.id&&T?{label:d.product.measurement_guide,open:()=>g(!0)}:"mount"===Z.id&&u.mountProductId&&u.mountProductHasLength&&u.currentMountingGuide?{label:d.product.measurement_guide,open:()=>j(!0)}:void 0,V=u.isVariantUnavailable?(0,i.jsx)(tC,{product:t,variant:u.selectedVariant,width:u.width,length:u.length}):(0,i.jsx)(ey.Z,{block:!0,variant:"black",disabled:!u.canAddToCart,onClick:()=>{if(!u.canAddToCart){x(!0);return}x(!1),u.addToCart(()=>void 0)},children:(0,i.jsxs)("div",{className:"flex gap-2 justify-center items-center w-full leading-none pointer-events-none",children:[(0,i.jsx)("span",{children:d.product.add_to_cart}),(0,i.jsx)(H.G,{className:"-mt-0.5 text-sm",icon:K.Diu})]})});return(0,i.jsx)(l_.dy.Root,{open:!0,onOpenChange:e=>{e||n()},modal:!1,dismissible:!1,snapPoints:lZ,activeSnapPoint:w,setActiveSnapPoint:_,snapToSequentialPoint:!0,children:(0,i.jsx)(l_.dy.Portal,{children:(0,i.jsxs)(l_.dy.Content,{className:"fixed inset-x-0 bottom-0 z-40 h-full outline-none lg:hidden",children:[w===lk&&(0,i.jsx)("button",{type:"button","aria-label":d.configurator.order_in_your_size,className:"absolute inset-x-0 top-0 z-10 h-[60px]",onClick:()=>_(lC)}),(0,i.jsxs)("div",{className:"flex flex-col h-[324px] bg-white rounded-t-2xl border-t border-gray-200 shadow-[0_-8px_24px_rgba(0,0,0,0.08)] transition-transform duration-300 ease-in ".concat(b?"translate-y-full pointer-events-none":"translate-y-0"),onTransitionEnd:e=>{b&&"transform"===e.propertyName&&e.target===e.currentTarget&&n()},children:[(0,i.jsx)(l_.dy.Handle,{className:"my-2 shrink-0"}),(0,i.jsx)(l_.dy.Title,{className:"sr-only",children:d.configurator.order_in_your_size}),(0,i.jsxs)("div",{className:"flex gap-2 items-center px-4 mb-1 shrink-0",children:[(0,i.jsxs)("div",{className:"flex gap-1 items-center w-16",children:[(0,i.jsx)("button",{type:"button",disabled:0===C,onClick:()=>{x(!1),v(e=>Math.max(0,e-1))},className:"flex justify-center items-center text-gray-700 transition size-7 disabled:opacity-30","aria-label":d.general.back,children:(0,i.jsx)(H.G,{icon:t6.EyR})}),(0,i.jsx)("button",{type:"button",disabled:S,onClick:L,className:"flex justify-center items-center text-gray-700 transition size-7 disabled:opacity-30","aria-label":d.general.next_step,children:(0,i.jsx)(H.G,{icon:t6.yOZ})})]}),(0,i.jsxs)("div",{className:"flex-1 text-sm font-medium text-center",children:[Z.title,(0,i.jsxs)("span",{className:"ml-1.5 font-normal text-gray-400",children:[C+1,"/",k.length]}),h&&R&&"color"===Z.id&&(0,i.jsx)("span",{className:"ml-1.5 text-xs font-normal text-red-600",children:d.general.required})]}),(0,i.jsx)("div",{className:"flex justify-end w-16",children:(0,i.jsx)("button",{type:"button",onClick:()=>y(!0),className:"flex justify-center items-center text-gray-700 transition size-7","aria-label":d.general.close,children:(0,i.jsx)(H.G,{icon:t6.g82})})})]}),(0,i.jsx)("div",{className:"overflow-y-auto flex-1 px-4 min-h-0",children:(()=>{switch(Z.id){case"color":return(0,i.jsx)(tM,{colors:u.colors,selectedColor:u.currentColor,onColorChange:u.handleColorChange,productId:t.id});case"measurements":var e,n;return(0,i.jsx)(t9,{form:u.form,widths:u.widths,maxWidth:u.maxWidth,maxLength:u.maxLength,isCustomWidth:u.isCustomWidth,placeholderSize:l.placeholderSize,widthGuide:null===(e=l.sanityCategory)||void 0===e?void 0:e.widthOptionGuide,lengthGuide:null===(n=l.sanityCategory)||void 0===n?void 0:n.lengthOptionGuide,quantity:u.quantity,onQuantityChange:u.setQuantity,productVisualization:l.productVisualization,lengthError:h&&!u.length,interactiveGuideOpen:p,onInteractiveGuideOpenChange:g});case"mount":return(0,i.jsx)(ld,{gp:u,mountLengthError:h&&R,mountingGuideOpen:f,onMountingGuideOpenChange:j});case"summary":return(0,i.jsx)("div",{className:"mt-2",children:(0,i.jsx)(tG,{curtainPrice:u.curtainPrice,curtainQuantity:u.quantity,width:u.width,length:u.length,widthInchesInput:u.getInchesInput
1s().width,lengthInchesInput:u.getInchesInputs().length,mountProductPrice:u.mountProductPrice,mountQuantity:u.mountQuantity,mountLength:u.mountLength,mountLengthInchesInput:u.mountLengthInchesInput,mountType:u.selectedMountType,curtainProduct:t,curtainSanityProduct:l,curtainVariant:u.selectedVariant,curtainColor:u.currentColor,mountProduct:u.mountShopifyProduct,mountSanityProduct:u.mountSanityProduct,mountVariant:u.mountProductVariant,mountColor:u.mountColor})});default:return null}})()}),(0,i.jsxs)("div",{className:"px-4 pt-3 pb-4 border-t border-gray-200 shrink-0",children:[!("mount"===Z.id&&!u.mountProductId)&&(0,i.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[I||G?(0,i.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{className:"text-xs text-gray-700",children:G?z:d.product.choose_number_of_curtains}),I&&(0,i.jsxs)("span",{className:"text-2xs text-gray-400 cursor-help","data-tip":d.product.quantity_info_tooltip,children:[(0,i.jsx)(H.G,{icon:K.Fuz,className:"mr-0.5 size-2.5"}),d.product.sold_individually]})]}),(0,i.jsx)(t7.Z,{value:G?u.mountQuantity:u.quantity,setValue:e=>G?u.setMountQuantity(e>0?e:1):u.setQuantity(e>0?e:1),border:"none",size:"sm"})]}):(0,i.jsx)("span",{className:"text-sm text-gray-700 capitalize",children:d.product.total}),(0,i.jsx)("span",{className:"text-sm font-medium",children:E})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[W&&(0,i.jsx)(lo,{label:W.label,onClick:W.open}),(0,i.jsx)("div",{className:"flex-1",children:S?V:P?(0,i.jsxs)("button",{type:"button",onClick:L,className:"flex gap-1.5 justify-center items-center py-2.5 w-full text-sm text-gray-600",children:[(0,i.jsx)("span",{className:"underline",children:d.configurator.skip_without_mount}),(0,i.jsx)(H.G,{className:"text-xs",icon:t6.yOZ})]}):(0,i.jsx)(ey.Z,{block:!0,variant:"black",onClick:L,children:(0,i.jsxs)("div",{className:"flex gap-2 justify-center items-center w-full leading-none pointer-events-none",children:[(0,i.jsx)("span",{children:d.general.next_step}),(0,i.jsx)(H.G,{className:"-mt-0.5 text-sm",icon:t6.yOZ})]})})})]})]})]})]})})})}var lI=l(89250);function lG(e){var t,l,n,r;let{product:s,sanityProduct:d,onClose:c,onColorErrorChange:u}=e,m=(0,a.Z)(),{locale:v}=(0,o.useRouter)(),h=lN(s,d,c),[x,p]=(0,M.useState)(!1),g=!h.currentColor,f=!h.length,j=!!h.mountProductId&&h.mountProductHasLength&&!h.mountLength,b=g||f||j;return(0,M.useEffect)(()=>(null==u||u(x&&g),()=>null==u?void 0:u(!1)),[x,g,u]),(0,i.jsxs)("div",{className:"flex flex-col flex-1 gap-6 pt-6",children:[(0,i.jsxs)("section",{children:[(0,i.jsxs)("h3",{className:"mb-2 text-sm font-medium",children:["2. ",m.configurator.enter_measurements]}),(0,i.jsx)(t9,{form:h.form,widths:h.widths,maxWidth:h.maxWidth,maxLength:h.maxLength,isCustomWidth:h.isCustomWidth,placeholderSize:d.placeholderSize,widthGuide:null===(t=d.sanityCategory)||void 0===t?void 0:t.widthOptionGuide,lengthGuide:null===(l=d.sanityCategory)||void 0===l?void 0:l.lengthOptionGuide,quantity:h.quantity,onQuantityChange:h.setQuantity,productVisualization:d.productVisualization,guideWrapper:{title:null===(n=h.productConfigurator)||void 0===n?void 0:n.measurementGuideStepByStepTitle,subtitle:null===(r=h.productConfigurator)||void 0===r?void 0:r.measurementGuideStepByStepSubtitle},lengthError:x&&f})]}),h.showMount&&(0,i.jsxs)("section",{children:[(0,i.jsxs)("h3",{className:"mb-2 text-sm font-medium",children:["3. ",m.configurator.select_mount]}),(0,i.jsx)(ld,{gp:h,mountLengthError:x&&j})]}),(0,i.jsx)("section",{className:"pt-6 border-t border-gray-200",children:(0,i.jsx)(tG,{curtainPrice:h.curtainPrice,curtainQuantity:h.quantity,width:h.width,length:h.length,widthInchesInput:h.getInchesInputs().width,lengthInchesInput:h.getInchesInputs().length,mountProductPrice:h.mountProductPrice,mountQuantity:h.mountQuantity,mountLength:h.mountLength,mountLengthInchesInput:h.mountLengthInchesInput,mountType:h.selectedMountType,curtainProduct:s,curtainSanityProduct:d,curtainVariant:h.selectedVariant,curtainColor:h.currentColor,mountProduct:h.mountShopifyProduct,mountSanityProduct:h.mountSanityProduct,mountVariant:h.mountProductVariant,mountColor:h.mountColor})}),(0,i.jsxs)("div",{className:"",children:[(0,i.jsxs)("div",{className:"flex justify-between items-baseline mb-2 text-sm",children:[(0,i.jsx)("span",{className:"text-gray-700 capitalize",children:m.product.total}),(0,i.jsx)("span",{className:"font-medium",children:(0,ex.l)({amount:String(h.totalPrice),currencyCode:h.currencyCode},v)})]}),h.isVariantUnavailable?(0,i.jsx)(tC,{product:s,variant:h.selectedVariant,width:h.width,length:h.length}):(0,i.jsx)(ey.Z,{block:!0,variant:"black",onClick:()=>
1{if(b||!h.canAddToCart){p(!0);return}p(!1),h.addToCart(()=>void 0)},children:(0,i.jsxs)("div",{className:"flex gap-2 justify-center items-center w-full leading-none pointer-events-none",children:[(0,i.jsx)("span",{children:m.product.add_to_cart}),(0,i.jsx)(H.G,{className:"-mt-0.5 text-sm",icon:K.Diu})]})}),(0,i.jsx)(ey.Z,{block:!0,variant:"hollow-black",onClick:c,className:"mt-2",children:m.configurator.quit_customization}),!h.isVariantUnavailable&&(0,i.jsx)("div",{className:"mt-2 text-black/50",children:(0,i.jsx)(lI.Z,{})})]})]})}function lM(e){let t,{shopifyProduct:l,sanityColorFilter:n,className:r}=e;return(null==n?void 0:n.description)||l.descriptionHtml?(0,i.jsx)("div",{className:(0,q.cn)("text-sm [&_a]:underline [&_a>strong]:font-normal [&_p:first-child]:mt-0 [&_p:last-child]:mb-0 [&_p]:mt-2 leading-normal","[&_ul]:my-4 [&_ul]:space-y-2 [&_ul]:list-disc [&_ul]:list-inside","[&_ol]:my-4 [&_ol]:space-y-2 [&_ol]:list-decimal [&_ol]:list-inside",r),children:(null==n?void 0:n.description)?(0,i.jsx)(T.Z,{blocks:n.description,prose:"custom",size:"small"}):(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:l.descriptionHtml.replace(/<div (.*?)>/gi,"<div>").replace(/<p (.*?)>/gi,"<p>").replace(/<span (.*?)>/gi,"<span>").replace(/<div>/gi,"").replace(/<\/div>/gi,"").replace(/<br>/gi,"").replace(/<\/br>/gi,"").replace(/<span>/gi,"").replace(/<\/span>/gi,"")}})}):null}var lP=l(38799);function lz(e){let{product:t,sanityProduct:l}=e,n=(0,a.Z)(),r=tf(t,l);return r?(0,i.jsxs)("div",{className:"flex gap-1 items-baseline font-sans tracking-tight",children:[(0,i.jsx)("span",{className:"text-xs font-normal text-gray-500",children:n.general.from}),(0,i.jsx)("span",{className:"text-[15px] font-medium leading-tight sm:text-lg",children:r.singlePrice})]}):(0,i.jsx)("div",{className:"text-sm tracking-tight text-gray-500",children:(0,i.jsx)(lP.Z,{product:t})})}var lR=l(32133);function lL(e){let{bottomline:t,hideCount:l,size:n="default",...r}=e,o=(0,a.Z)();return t?(0,i.jsxs)("div",{className:"flex items-center space-x-2",...r,children:[(0,i.jsx)("div",{className:"flex space-x-[1px] text-black/10 ".concat("small"===n?"text-xs":"text-sm"),children:[0,1,2,3,4].map(e=>(0,i.jsx)(H.G,{style:{color:(0,lR.ol)(e,null==t?void 0:t.average_score)},icon:(0,lR.Dl)(e,null==t?void 0:t.average_score)},e))}),!l&&(null==t?void 0:t.total_ratings)&&(0,i.jsx)("div",{className:"text-black/70 pt-1 text-[13px]",children:o.product.review_amount_multiple.replace(":amount",t.total_ratings+"")})]}):(0,i.jsx)(i.Fragment,{})}let lF=e=>{var t;null===(t=document.querySelector(e))||void 0===t||t.scrollIntoView({behavior:"smooth"})};function lE(e){var t,l,n;let{product:r,path:s,sanityProduct:d,color:u,hideReviews:m,hidePrice:v,lipscoreBottomline:h,colorLabel:x,asHeading:p=!0,onReviewsClick:g}=e,f=(0,eR.Z)(u),j=!!(null==h?void 0:h.total_ratings)&&!m,b=d.subtitle,y=d.customHeadline||r.title;(0,a.Z)();let{locale:w,query:N}=(0,o.useRouter)(),{options:_,selectedOptions:k}=(0,ta.i)(),C=null==_?void 0:_.find(e=>(0,P.Ue)(e.name)),Z=C?null==k?void 0:k[C.name]:void 0,S=N.trim,I=S?(()=>{var e,t,l,i;let n=null===(e=d.trimColorOptions)||void 0===e?void 0:e.find(e=>{var t,l,i,n;return(0,X.l)(null!==(n=null!==(i=null===(t=e.color.localizedName)||void 0===t?void 0:t[null!=w?w:"sv"])&&void 0!==i?i:null===(l=e.color.localizedName)||void 0===l?void 0:l.sv)&&void 0!==n?n:"")===S});return null!==(i=null==n?void 0:null===(t=n.color.localizedName)||void 0===t?void 0:t[null!=w?w:"sv"])&&void 0!==i?i:null==n?void 0:null===(l=n.color.localizedName)||void 0===l?void 0:l.sv})():void 0,G=(0,eR.Z)(null!=Z?Z:I),M=null==G?void 0:G.name,z=(null==f?void 0:f.name)&&M&&M!==f.name?"".concat(f.name,"/").concat(M):null==f?void 0:f.name,R=(null!==(n=null===(l=r.variants)||void 0===l?void 0:null===(t=l.edges)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>1,L=u?"".concat(s,"/").concat((0,X.l)(u)):s;return(0,i.jsxs)("div",{className:"relative",children:[x&&(0,i.jsx)("p",{className:c()("inline-block px-2 py-1 mb-2 text-xs tracking-wider uppercase bottom-4 right-4 ",{"bg-black/5 text-black":"normal"===x.type||!x.type,"bg-gotain-red/5 text-gotain-red":"warning"===x.type}),children:x.label}),(0,i.jsxs)("div",{className:"flex gap-2 items-start",children:[(0,i.jsxs)("div",{className:"flex-1",children:[p?(0,i.jsx)("h1",{className:"font-sans text-[15px] font-medium tracking-tight leading-tight sm:text-lg",children:(0,i.jsxs)("a",{href:L,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:[y,!!z&&" "+z]})}):(0,i.jsx)("div",{className:"font-sans text-[15px] font-medium tracking-tight leading-tight sm:text-lg",children:(0,i.jsxs)("a",{href:L,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:[y,!!z&&" "+z]})}),!!b&&(0,i.jsx)("p",{className:"text-xs sm:text-sm text-gray-700 mt-0.5 tracking-tight leading-tight",children:b})]}),(0,i.jsxs)("div",{className:"flex flex-col items-end gap-1 ",children:[R&&!v&&(0,i.jsx)(lz,{product:r,sanityProduct:d}),j&&(0,i.jsxs)("button",{type:"button",onClick:null!=g?g:()=>lF("#reviews"),className:"flex items-center gap-1 text-left",children:[(0,i.jsx)(lL,{bottomline:h,hideCount:!0,size:"small",className:"sm:hidden"}),(0,i.jsx)(lL,{bottomline:h,hideCount:!0,className:"hidden sm:block"}),(0,i.jsxs)("span",{className:"text-xs text-black/70 mt-0.5",children:["(",h.total_ratings,")"]})]})]})]})]})}function lT(e){let{cartItem:t,className:l,onClose:n}=e,r=(0,a.Z)();return t?(0,i.jsx)("div",{className:c()("px-4 py-3 bg-[#dcd5cf] border-white text-black",l),children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"flex-shrink-0",children:(0,i.jsx)(H.G,{size:"1x",icon:K.IwR})}),(0,i.jsxs)("p",{className:"flex-1 ml-3 text-sm",children:[r.product.you_are_editing," ",(0,i.jsxs)("span",{className:"font-bold",children:[" ",t.quantity," x ",t.merchandise.product.title]})," ",r.product.in_your_cart]}),(0,i.jsx)("button",{className:"flex-shrink-0",onClick:n,children:(0,i.jsx)(H.G,{size:"1x",icon:K.NBC})})]})}):(0,i.jsx)(i.Fragment,{})}var lW=l(45082),lV=l(98570),lO=l(40105),lB=l(83691),lD=l(25934);let lq=(0,M.createContext)(null);function lA(e){let{children:t}=e,[l,n]=(0,M.useState)(null),[r,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(null),{addLinesToCart:d,removeLinesFromCart:c,setShowCart:u}=(0,eh.l8)(),{selectedVariant:m}=(0,ta.i)(),v=(0,lB.jD)(),h=(0,M.useCallback)(async e=>{if(!l)return s("no_slot"),!1;if(!(null==m?void 0:m.id)||!m.title)return s("generic"),!1;a(!0),s(null);try{var t,i,r,o,h;let s=(null!==(r=v.lines)&&void 0!==r?r:[]).find(t=>{var l,i,n;return!!t&&(null===(i=t.merchandise)||void 0===i?void 0:null===(l=i.product)||void 0===l?void 0:l.handle)===e&&(null!==(n=t.attributes)&&void 0!==n?n:[]).some(e=>(null==e?void 0:e.key)===lV.W.reservationId)}),x=null!==(o=null==s?void 0:null===(i=s.attributes)||void 0===i?void 0:null===(t=i.find(e=>(null==e?void 0:e.key)===lV.W.reservationId))||void 0===t?void 0:t.value)&&void 0!==o?o:null,p=null!==(h=null==s?void 0:s.id)&&void 0!==h?h:null,g=(0,lD.Z)(),f=(await (0,lO.Tc)({cartId:g,variantTitle:m.title,startsAt:l.starts_at,endsAt:l.ends_at})).data;if(await new Promise(e=>{d([{merchandiseId:m.id,quantity:1,attributes:[{key:lV.W.date,value:l.date},{key:lV.W.slot,value:(0,lV.CW)(l.start_time,l.end_time)},{key:lV.W.reservedUntil,value:(0,lV.qg)(f.expires_at)},{key:lV.W.reservationId,value:g}]}],()=>e())}),p&&await new Promise(e=>{c([p],()=>e())}),x)try{await (0,lO.Se)({cartId:x})}catch(e){console.warn("[MeasurementBookingContext] Failed to delete prior reservation",e)}return a(!1),u(!0),n(null),!0}catch(e){if(a(!1),e instanceof lO._I&&(409===e.status||422===e.status))return s("slot_taken"),n(null),!1;return s("generic"),!1}},[l,null==m?void 0:m.id,null==m?void 0:m.title,v.lines,d,c,u]),x=(0,M.useMemo)(()=>({selectedSlot:l,setSelectedSlot:n,committing:r,commitError:o,setCommitError:s,commit:h}),[l,r,o,h]);return(0,i.jsx)(lq.Provider,{value:x,children:t})}function lH(){return(0,M.useContext)(lq)}var lK=l(29737);function lU(){let e=(0,o.useRouter)(),t=(0,lB.jD)(),l=(0,M.useMemo)(()=>{var l;return null==t?void 0:null===(l=t.lines)||void 0===l?void 0:l.find(t=>
1t.id===e.query.edit)},[null==t?void 0:t.lines,e.query.edit]);return e.isReady?{isEditingCartItem:!!l,cartItem:l}:{isEditingCartItem:!1,cartItem:void 0}}let lQ=["edit","w","l","qty","trim","configure"];function lY(){let{edit:e,w:t,l,qty:i,trim:n,configure:r}=(0,o.useRouter)().query;return(0,M.useMemo)(()=>{let a={edit:e,w:t,l,qty:i,trim:n,configure:r},o=lQ.map(e=>{let t=a[e];return t?"trim"===e?"".concat(e,"=").concat(encodeURIComponent(String(t))):"".concat(e,"=").concat(t):null}).filter(Boolean).join("&");return o.length?"?".concat(o):""},[e,t,l,i,n,r])}function lJ(e){let{groups:t,currentProductId:l,layout:n="standalone"}=e,{locale:a}=(0,o.useRouter)(),{currentColor:s}=lx(),d=lY(),c=(0,eW.fE)(l);return(null==t?void 0:t.length)?(0,i.jsx)(i.Fragment,{children:t.map(e=>{var t,l;if(!(null==e?void 0:null===(t=e.values)||void 0===t?void 0:t.length))return null;let o=e.values.map(e=>{if(!e)return null;let t=function(e,t,l,i){if(!t.reference)return null;let n=(0,r.kG)(e,t.reference);if(!n)return null;let a=l?"/".concat((0,X.l)(l)):"";return"".concat(n).concat(a).concat(i)}(a,e,s,d);return{value:e._key,label:e.title,href:null!=t?t:void 0,disabled:!t,productId:e.productId}}).filter(e=>null!==e);if(!o.length)return null;let u=o.find(e=>null!=e.productId&&String(e.productId)===String(c)),m=null!==(l=null==u?void 0:u.value)&&void 0!==l?l:"",v=(0,i.jsx)("span",{className:"text-xs tracking-wider text-gray-700 uppercase",children:e.label}),h=(0,i.jsx)(tD.Z,{size:"small",fluid:!0,options:o.map(e=>{let{value:t,label:l,href:i,disabled:n}=e;return{value:t,label:l,href:i,disabled:n}}),value:m,onChange:()=>{}});return"grid-cells"===n?(0,i.jsxs)(M.Fragment,{children:[v,h]},e._key):(0,i.jsxs)("div",{className:"grid grid-cols-[auto_auto] items-center gap-x-4 gap-y-2 w-fit",children:[v,h]},e._key)})}):null}function lX(e){let{product:t,isEditingCartItem:l,loading:n,disabled:r,onPurchase:o,canAddToCart:s,variant:d=l?"yellow":"black",width:c,length:u,className:m,children:v}=e,h=(0,a.Z)(),x=(0,M.useRef)(null);return(0,i.jsxs)("div",{className:(0,q.cn)("w-full",m),ref:x,children:[(0,i.jsx)(ey.Z,{block:!0,disabled:r,allowDisabledClick:r&&!s,loading:n,onClick:o,variant:d,fontWeight:"normal",children:(0,i.jsxs)("div",{className:"flex justify-center items-center gap-3 w-full leading-none",children:[(0,i.jsx)(H.G,{className:"-mt-0.5 text-sm",icon:K.Diu}),(0,i.jsx)("span",{children:l?h.product.update_cart:h.product.add_to_cart})]})}),v,(0,i.jsx)("div",{className:"mt-2 text-black/50",children:(0,i.jsx)(lI.Z,{})})]})}function l$(e){let{quantity:t,setQuantity:l,totalPrice:n,hideQuantity:r=!1,isCurtain:s=!1,hideSoldIndividually:d=!1,className:c,border:u="none"}=e,m=(0,a.Z)();(0,ej.Z)();let{locale:v}=(0,o.useRouter)(),h=t_.ZP[v],x=h.usesVat,p=h.exclVat;return(0,i.jsxs)("div",{className:(0,q.cn)("flex items-center justify-between",c),children:[(0,i.jsx)("div",{className:"flex flex-row items-center space-x-1.5",children:!r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"text-xs tracking-wider uppercase",children:m.product.choose_amount}),(0,i.jsx)(t7.Z,{value:t,border:u,setValue:e=>l(e>0?e:1)}),s&&!d&&(0,i.jsxs)("span",{className:"text-gray-700 text-2xs cursor-help","data-tip":m.product.quantity_info_tooltip,children:[(0,i.jsx)(H.G,{icon:K.FDd,className:"mr-0.5 size-2.5"}),m.product.quantity_info]})]})}),(0,i.jsx)("div",{children:(0,i.jsxs)("p",{className:"text-sm font-medium whitespace-nowrap",children:[(0,ex.l)({amount:n,currencyCode:h.currencyNameShort},v),(0,i.jsx)("span",{className:"text-[11px] font-normal text-gray-700",children:x&&p&&" ".concat(m.general.excl_vat)})]})})]})}function l0(e){var t,l,n,r;let{sanityProduct:s,product:d,path:u}=e,m=(0,o.useRouter)(),[v,h]=(0,M.useState)(!1);(0,M.useRef)(null);let x=(0,a.Z)(),{addLinesToCart:p,removeLinesFromCart:g,setShowCart:f}=(0,eh.l8)(),[j,b]=(0,M.useState)(!1),{selectedVariant:y,selectedOptions:w,setSelectedOption:N,options:_}=(0,ta.i)(),k=null==_?void 0:_.some(e=>(0,P.u8)(e.name)),C=(0,lK.i)(null==d?void 0:d.metafields,"customer_text_input",""),Z=!!C,[S,I]=(0,ee.v1)("qty",ee.U.withDefault(1).withOptions({shallow:!0})),[G,z]=(0,ee.v1)("trim",ee.Oi.withOptions({shallow:!0})),[R,L]=(0,M.useState)(""),F=(0,lB.jD)(),{cartItem:E,isEditingCartItem:T}=lU(),W=s.hideQuantitySelector,V=W&&(null==F?void 0:null===(t=F.lines)||void 0===t?void 0:t.some(e=>{var t;return(null===(t=e.merchandise)||void 0===t?void 0:t.id)===(null==y?void 0:y.id)})),O=y&&y.availableForSale,B=!!(null===(l=s.trimColorOptions)||void 0===l?void 0:l.length)&&!G,D=j&&(!O||B),q=(0,M.useRef)(!1),A=(0,M.useRef)(d.id);A.current!==d.id&&(A.current=d.id,q.current=!1);let H=(0,M.useRef)(null);(0,M.useEffect)(()=>{var e,t;if(W&&I(1),!(null==E?void 0:E.id)){H.current=null;return}if(H.current!==E.id&&(H.current=E.id,q.current=!0,I(W?1:E.quantity),null===(t=E.merchandise)||void 0===t||null===(e=t.selectedOptions)||void 0===e||e.forEach(e
1=>{N(e.name,e.value)}),Z&&E.attributes)){let e=E.attributes.find(e=>e.key===C);e&&L(e.value||"")}},[E,N,I,W,Z,C]);let K=(0,M.useRef)(null);(0,M.useEffect)(()=>{if(!(null==E?void 0:E.id)){K.current=null;return}if(K.current===E.id)return;K.current=E.id;let e=(0,lu.HR)(E.attributes,s,m.locale);e&&z(e)},[E,s,m.locale,z]);let U=(0,lV.cq)(d.handle),Q=(0,P.Rk)(d.productType),Y=lH(),J=ly(d,y),X=!!y&&!J&&!Q&&!U,$=(d.variants.edges.length>1||Q)&&_&&!U?_.filter(e=>e&&!(0,P.u8)(e.name)&&!(0,P.Ue)(e.name)):[],et=(0,M.useMemo)(()=>{let e={};for(let t of $)e[t.name]=function(e,t){let l=new Set;for(let{node:n}of e.variants.edges)if(n.availableForSale){var i;let e=null===(i=n.selectedOptions)||void 0===i?void 0:i.find(e=>e.name===t);e&&l.add(e.value)}return l}(d,t.name);return e},[d,$]);(0,M.useEffect)(()=>{if(!q.current&&w)for(let e of $){if((0,P.TR)(e.name))continue;let t=et[e.name],l=w[e.name];if(l&&!t.has(l)){let l=e.values.find(e=>t.has(e));l&&N(e.name,l)}}},[$,et,w,N]);let el=null==s?void 0:null===(n=s.customOptionGroups)||void 0===n?void 0:n.filter(e=>"aboveShopifyOptions"===e.position),ei=null==s?void 0:null===(r=s.customOptionGroups)||void 0===r?void 0:r.filter(e=>"aboveShopifyOptions"!==e.position);return(0,i.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,i.jsx)(lT,{onClose:()=>m.replace(m.asPath.replace(/\?.*$/,"")),cartItem:E}),!!(null==el?void 0:el.length)&&(0,i.jsx)("div",{className:"mb-5",children:(0,i.jsx)(lJ,{groups:el,currentProductId:d.id})}),($.length||Z&&!U)&&(0,i.jsxs)("div",{className:c()("relative flex flex-col flex-1 space-y-5",{"p-4 bg-yellow/10":E}),children:[$.map(e=>{var t;let l=et[e.name],n=e.values;if(0===n.length)return null;let r=(0,P.TR)(e.name),a=(0,P.JK)(e),o=r?x.product.choose_zone:x.product.choose_option.replace(":option",e.name),s=a?null!==(t=null==w?void 0:w[e.name])&&void 0!==t?t:"":null==w?void 0:w[e.name];return(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"mb-1.5 text-xs tracking-wider uppercase",children:e.name}),(0,i.jsxs)("select",{className:"px-4 pr-12 w-full h-10 text-sm border-black transition form-select focus:outline-none focus:border-black focus:ring-1 focus:ring-black",value:s,onChange:t=>{q.current=!0,(0,lw.$P)(e.name,t.target.value),N(e.name,t.target.value)},children:[a&&(0,i.jsx)("option",{value:"",disabled:!0,children:o}),n.map(t=>{let n=!l.has(t);return(0,i.jsxs)("option",{id:"option[".concat(e.name,"][").concat(t,"]"),value:t,disabled:n&&Q,children:[t,n?" â ".concat(x.product.out_of_stock):""]},t)})]})]},e.name)}),Z&&!U&&(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"customer-text-input",className:"block mb-1.5 text-xs tracking-wider uppercase",children:C}),(0,i.jsx)("input",{id:"customer-text-input",className:c()("w-full h-10 px-4 text-sm transition bg-white border border-black rounded-none focus:outline-none focus:border-black focus:ring-1 focus:ring-black"),type:"text",value:R,onChange:e=>L(e.target.value)})]})]}),!!(null==ei?void 0:ei.length)&&(0,i.jsx)("div",{className:c()({"mt-5":$.length||Z}),children:(0,i.jsx)(lJ,{groups:ei,currentProductId:d.id})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(l$,{className:$.length||Z||(null==ei?void 0:ei.length)?"mt-6":"",quantity:S,setQuantity:I,isCurtain:(0,P.Gg)(d.productType),hideSoldIndividually:s.hideSoldIndividually,totalPrice:y?Number(y.price.amount)*S:Number(d.priceRange.minVariantPrice.amount),hideQuantity:W}),X?(0,i.jsx)(tC,{className:"mt-2.5",product:d,variant:y}):(0,i.jsx)(lX,{className:"mt-2.5",product:d,isEditingCartItem:T,loading:U&&Y?Y.committing:v,disabled:U&&Y?j&&!Y.selectedSlot:D,onPurchase:()=>{if(U&&Y){if(!Y.selectedSlot){Y.setCommitError("no_slot"),b(!0);return}Y.commit(d.handle);return}if(!O||B){b(!0);return}if(b(!1),V&&!T){f(!0);return}h(!0);let e=[...Z&&R?[{key:C,value:R}]:[],...(0,lu.dz)(G,s,m.locale,x.product.trim_color_label)];p([{merchandiseId:y.id,quantity:S,...e.length&&{attributes:e}}],()=>{if(T){g([E.id]);let{edit:e,quantity:t,...l}=m.query;m.replace("/")}f(!0),h(!1)})},canAddToCart:U&&Y?!!Y.selectedSlot&&!!O:O,children:!s.hideEstimatedShipping&&(0,i.jsx)(tm,{variant:"card",icon:"truck",productIds:[parseInt((0,eW.fE)(d.id),10)],className:"mt-2.5 w-full max-w-none lg:hidden"})}),j&&!y&&k&&(0,i.jsx)("div",{className:"flex justify-center mt-3 h-5",children:(0,i.jsx)(lW.Z,{children:x.product.choose_color})}),j&&!!y&&B&&(0,i.jsx)("div",{className:"flex justify-center mt-3 h-5",children:(0,i.jsx)(lW.Z,{children:x.product.tooltip.select_trim_color})}),j&&!y&&(null==_?void 0:_.some(e=>(0,P.TR)(e.name)))&&(0,i.jsx)("div",{className:"flex justify-center mt-3 h-5",children:(0,i.jsx)(lW.Z,{children:x.product.choose_zone})}),j&&!y&&!(null==_?void 0:_.some(e=>(0,P.TR)(e.name)))&&(()=>{let e=$.find(e=>(0,P.JK)(e)&&!(null==w?void 0:w[e.name]));return e?(0,i.jsx)("div",{className:"flex justify-center mt-3 h-5",children:(0,i.jsx)(lW.Z,{children:x.product.choose_option.replace(":option",e.name)})}):null})(),!X&&y&&!y.availableForSale&&(0,i.jsx)("div",{className:"flex justify-center mt-3 h-5",children:(0,i.jsx)(lW.Z,{children:x.product.unavailable})})]})]})}function l1(e){let{product:t,addToCart:l,width:n,length:r,error:s,showErrors:d,className:c,children:u}=e,m=(0,a.Z)(),[v,h]=(0,M.useState)(!1),x=(0,o.useRouter)(),p=t.availableForSale?s:m.product.unavailable,{removeLinesFromCart:g}=(0,eh.l8)(),{isEditingCartItem:f,cartItem:j}=lU(),{selectedVariant:b}=(0,ta.i)(),y=ly(t,b),w=!!b&&!y;if(!t.availableForSale||w){var N,_,k;let e=null===(k=t.variants)||void 0===k?void 0:null===(_=k.edges)||void 0===_?void 0:null===(N=_[0])||void 0===N?void 0:N.node;return(0,i.jsx)(tC,{product:t,variant:null!=b?b:e,width:n,length:r,className:c})}return(0,i.jsx)(lX,{product:t,isEditingCartItem:f,loading:v,disabled:!!p&&d,onPurchase:()=>{h(!0),l(e=>{if(f&&!e){g([j.id]),tN.Am.success(m.product.cart_updated);let{edit:e,quantity:t,...l}=x.query;x.replace("/")}h(!1)})},canAddToCart:!p,width:n,length:r,className:c,children:u})}var l2=function(){let[e,t]=(0,M.useState)(window.location.hash);return(0,M.useEffect)(()=>{let e=()=>t(window.location.hash);return window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]),e},l4=l(96923);function l5(e){var t,l,n,r,s,d,u,m,v,h,x,p,g,f,j;let{sanityProduct:b,product:y,path:w,useConfigurator:N=!1,lipscoreBottomline:_}=e,k=l2(),C=(0,o.useRouter)(),[Z,S]=(0,M.useState)(!1),[I,G]=(0,M.useState)(!1),[z,R]=(0,M.useState)(!1),[L,F]=(0,M.useState)(!1),[E,T]=(0,M.useState)("step1"),[W,V]=(0,M.useState)("rail"),O=(0,M.useCallback)(e=>{T(e),F(!0)},[]),B=(0,M.useCallback)(()=>{T("step2")},[]),D=(0,M.useCallback)(()=>{T("step1")},[]),q=(0,a.Z)(),{supportsInches:A,isInches:U}=(0,th.eY)(),Q=null!==(x=q.product.roman_blind_cord_side)&&void 0!==x?x:"Cord side",Y=null!==(p=q.product.left)&&void 0!==p?p:"Left",J=null!==(g=q.product.right)&&void 0!==g?g:"Right",X=(0,tp.Lk)(b.productVisualization),[$,et]=(0,ee.v1)("configure",ee.Oi.withOptions({shallow:!0})),el=!!$,ei=(0,M.useCallback)(()=>{var e;(0,lw.d3)(y.id,y.title),e=y.id,lc.delete(e),et("1")},[y.id,y.title,et]),en={quantity:"curtain3D"===b.productVisualization&&el?2:1,width:X.width,length:X.length},[er,ea]=(0,ee.v1)("qty",ee.U.withDefault(en.quantity).withOptions({shallow:!0})),[eo,es]=(0,M.useState)("right"),[ed,ec]=(0,ee.v1)("trim",ee.Oi.withOptions({shallow:!0})),[eu,em]=(0,M.useState)(!1),ev=(0,M.useMemo)(()=>
1{if(!$)return null;try{let e=$.split(","),t={};return e.forEach(e=>{let[l,i]=e.split(":");l&&i&&(t[l]=i)}),{color:t.color||void 0,width:t.width?parseInt(t.width):void 0,length:t.length?parseInt(t.length):void 0,room:t.room||void 0,mountProductId:t.mountProductId||void 0,mountColor:t.mountColor||void 0,mountLength:t.mountLength?parseInt(t.mountLength):void 0,mountQuantity:t.mountQuantity?parseInt(t.mountQuantity):void 0,cordSide:t.cordSide||void 0}}catch(e){return null}},[$]),{selectedVariant:eh,selectedOptions:ex,options:ep}=(0,ta.i)(),eg=null==ep?void 0:ep.find(e=>(0,P.u8)(null==e?void 0:e.name));null==eg||eg.values;let ef=eg&&(null==eg?void 0:eg.name)?null==ex?void 0:ex[null==eg?void 0:eg.name]:void 0,{width:ej,setWidth:eb,widths:ew,isCustomWidth:eN,isWidthTooLong:e_,maxWidth:ek}=(0,lj.Z)({initialValue:null==ev?void 0:ev.width,disableQueryState:el}),eC=(0,M.useMemo)(()=>[...ew].reverse(),[ew]),eZ=null===(t=b.customOptionGroups)||void 0===t?void 0:t.filter(e=>"aboveShopifyOptions"===e.position),eS=null===(l=b.customOptionGroups)||void 0===l?void 0:l.filter(e=>"aboveShopifyOptions"!==e.position),{minPriceAtWidth:eI}=tg(),{length:eG,setLength:eM,isLengthTooLong:eP,maxLength:ez,verticalKind:eR}=(0,lg.Z)({initialValue:null==ev?void 0:ev.length,disableQueryState:el}),{cartItem:eL}=lU(),eF=/hissgardin|rullgardin/i.test(null!==(f=b.title)&&void 0!==f?f:""),eE=b.hideQuantitySelector,eT=(0,l4.Z)({color:ef,width:ej,length:eG,isLengthTooLong:eP,isWidthTooLong:e_,variant:eh,maxLength:ez,maxWidth:ek,hasWidth:ew.length>0,hasColor:!!eg,verticalKind:eR}),eV=!!(null===(n=b.trimColorOptions)||void 0===n?void 0:n.length),eO=null!=eT?eT:eV&&!ed?q.product.tooltip.select_trim_color:void 0,eB=()=>{eb(void 0),eM(void 0),ea(en.quantity),C.replace(w||"/",void 0,{shallow:!0})},eD=lf(Number(eh?null===(r=eh.price)||void 0===r?void 0:r.amount:null!==(j=eI(ej,eG))&&void 0!==j?j:0),er,ej||en.width,[],void 0),eq=(0,M.useRef)({}),{addToCart:eA}=lp(null==eh?void 0:eh.id,er,ej||en.width,eG||en.length,[],eB,eN,void 0,()=>eq.current,void 0,lm({isRomanBlind:eF,cordSide:eo,cordSideLabel:Q,cordSideLeftLabel:Y,cordSideRightLabel:J,trim:{slug:ed,sanityProduct:b,locale:C.locale,fallbackLabel:q.product.trim_color_label}}),void 0,eR);(0,M.useEffect)(()=>{"#curtain-guide"===k&&S(!0)},[k]);let eH=(0,tk.cI)({defaultValues:{width:ej,length:eG}}),eK=eH.watch("width"),eU=eH.watch("length");(0,M.useEffect)(()=>{let e=eH.watch(e=>{eq.current={width:e.widthInchesInput,length:e.lengthInchesInput}});return()=>e.unsubscribe()},[eH]);let eQ=(0,M.useRef)(null);(0,M.useEffect)(()=>{(null==eL?void 0:eL.id)&&void 0!==ej&&void 0!==eG?eQ.current!==eL.id&&(eQ.current=eL.id,eH.reset({width:ej,length:eG})):eL||(eQ.current=null)},[eL,ej,eG,eH]),(0,M.useEffect)(()=>{var e,t,l,i,n,r;if(!eF){es("right");return}let a=null!==(n=null==eL?void 0:null===(t=eL.attributes)||void 0===t?void 0:null===(e=t.find(e=>e.key===P.c2))||void 0===e?void 0:e.value)&&void 0!==n?n:null==eL?void 0:null===(i=eL.attributes)||void 0===i?void 0:null===(l=i.find(e=>(0,P.mK)(e.key)))||void 0===l?void 0:l.value;es(null!==(r=(0,P.EF)(a))&&void 0!==r?r:"right")},[eL,eF]);let eY=(0,M.useRef)(null);(0,M.useEffect)(()=>{if(!(null==eL?void 0:eL.id)){eY.current=null;return}if(eY.current===eL.id)return;eY.current=eL.id;let e=(0,lu.HR)(eL.attributes,b,C.locale);e&&ec(e)},[eL,ec,b.trimColorOptions,C.locale]),(0,M.useEffect)(()=>{var e;if(!eF||!$)return;let t=null==ev?void 0:ev.cordSide;if(!t)return;let l=null!==(e=(0,P.EF)(t))&&void 0!==e?e:"left"===t||"right"===t?t:void 0;l&&es(l)},[$,eF,null==ev?void 0:ev.cordSide]),lv(eH,ej,eG),(0,M.useEffect)(()=>{eK!=ej&&eb(eK)},[eK]),(0,M.useEffect)(()=>{eU!=eG&&eM(eU)},[eU]);let eJ=!!(null===(s=b.sanityCategory)||void 0===s?void 0:s.widthOptionGuide),eX=!!(null===(d=b.sanityCategory)||void 0===d?void 0:d.lengthOptionGuide),e$=eJ||eX,e0=!!b.hideInteractiveGuide,e1=!e0&&("curtain3D"===b.productVisualization||"romanBlindCurtain3D"===b.productVisualization||"softRomanBlindCurtain3D"===b.productVisualization),e2="curtainValance3D"===b.productVisualization&&eJ?"width":"cafeCurtain3D"===b.productVisualization&&eX?"length":void 0,e4=e1||!!e2,e5=!e4&&(0,P.Gg)(y.productType)&&!b.hideCurtainGuide&&!e$,e3=(e,t)=>
1(0,i.jsxs)("button",{className:"text-[11px]",tabIndex:-1,onClick:e,children:[(0,i.jsx)(H.G,{icon:K.cnt,className:"text-[11px] mr-1.5 text-gray-700"}),(0,i.jsx)("span",{className:"underline",children:t})]}),e7=e=>(0,i.jsx)("button",{className:"text-[11px]",tabIndex:-1,onClick:e,children:(0,i.jsx)(H.G,{icon:K.Fuz,className:"text-[11px] text-gray-700"})}),e8=!e0&&"curtain3D"===b.productVisualization,e6=N&&e8,e9=!e0&&"curtain3D"===b.productVisualization,te=(e,t,l,i)=>e9?e7(()=>O(t)):e1||e2===e?void 0:l?e3(i,q.product.guide):void 0,tt=te("width","step1",eJ,()=>G(!0)),tl=te("length","step2",eX,()=>R(!0)),ti=b.productConfigurator,tr="curtain3D"!==b.productVisualization||b.hideLengthGuideText?void 0:b.lengthGuideText||(null==ti?void 0:ti.lengthGuideText);return(0,i.jsxs)(i.Fragment,{children:[e1&&(0,i.jsx)(t3,{isOpen:L,onClose:()=>F(!1),step:E,guideMountType:W,onGuideMountTypeChange:V,parentForm:eH,widths:ew,isCustomWidth:eN,maxWidth:ek,maxLength:ez,placeholderSize:b.placeholderSize,onContinueToStep2:B,onContinueToStep1:D,onSave:(e,t)=>{eH.setValue("width",e),eH.setValue("length",t),e6&&!el&&(e&&eb(e),t&&eM(t),ei())},productVisualization:b.productVisualization,verticalKind:eR}),!e1&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tP.Z,{isShowing:Z,setIsShowing:S}),(null===(u=b.sanityCategory)||void 0===u?void 0:u.widthOptionGuide)&&(0,i.jsx)(tn,{isShowing:I,setIsShowing:G,article:b.sanityCategory.widthOptionGuide}),(null===(m=b.sanityCategory)||void 0===m?void 0:m.lengthOptionGuide)&&(0,i.jsx)(tn,{isShowing:z,setIsShowing:R,article:b.sanityCategory.lengthOptionGuide})]}),(0,i.jsx)(lT,{onClose:eB,cartItem:eL}),(0,i.jsxs)("div",{className:c()("flex flex-1 flex-col gap-2.5",{"bg-[#e
16e0da] p-6":eL}),children:[!e6&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:c()({"border border-gray-200":e4}),children:[e4&&(0,i.jsxs)("div",{role:"button",onClick:()=>{if(e1){O("step1");return}if("length"===e2){R(!0);return}G(!0)},className:"flex gap-3 items-center px-3 py-3 border-b border-gray-200 bg-cream",children:[(0,i.jsx)("div",{className:"flex justify-center items-center rounded-full bg-yellow size-8",children:(0,i.jsx)(H.G,{icon:K.KxN,className:"text-lg text-gray-700"})}),(0,i.jsxs)("div",{className:"text-sm",children:[(0,i.jsx)("div",{className:"font-medium",children:null==ti?void 0:ti.measurementGuideStepByStepTitle}),(0,i.jsx)("div",{className:"text-2xs mt-0.5",children:null==ti?void 0:ti.measurementGuideStepByStepSubtitle})]}),(0,i.jsx)(H.G,{icon:t6.yOZ,className:"ml-auto text-sm text-gray-700"})]}),(0,i.jsxs)("div",{className:c()("flex-1 space-y-3",{"px-3 py-4 border-gray-200":e4}),children:[(A||eF||!!(null==eZ?void 0:eZ.length))&&(0,i.jsxs)("div",{className:"grid grid-cols-[auto_auto] items-center gap-x-4 gap-y-2 w-fit",children:[eF&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"text-xs tracking-wider text-gray-700 uppercase",children:Q}),(0,i.jsx)(tD.Z,{size:"small",options:[{value:"left",label:Y},{value:"right",label:J}],value:eo,onChange:e=>es(e)})]}),A&&(0,i.jsx)(tA.Z,{size:"sm",fluid:!0,className:"!contents"}),(0,i.jsx)(lJ,{groups:eZ,currentProductId:y.id,layout:"grid-cells"})]}),(0,i.jsx)(t8.Z,{maxLength:ez,widths:eC,maxWidth:ek,isCustomWidth:eN,placeholderSize:b.placeholderSize,form:eH,editing:!!eL,verticalKind:eR,widthGuideButton:tt,lengthGuideButton:tl,lengthGuideText:tr,singleWidthInfo:null===(v=b.productConfigurator)||void 0===v?void 0:v.singleWidthInfo,doubleWidthInfo:null===(h=b.productConfigurator)||void 0===h?void 0:h.doubleWidthInfo,measureGuideButton:e5?e3(()=>S(!0),q.product.size_guide):void 0}),(0,i.jsx)(lJ,{groups:eS,currentProductId:y.id})]})]}),(0,i.jsx)(l$,{quantity:er,setQuantity:ea,border:"gray",isCurtain:(0,P.Gg)(y.productType),hideSoldIndividually:b.hideSoldIndividually,totalPrice:eD,hideQuantity:eE,className:c()(U&&"mt-1.5 md:mt-2.5")}),eu&&!!eO&&(0,i.jsx)("div",{className:"flex justify-center min-h-5",children:(0,i.jsx)(lW.Z,{children:eO})})]}),e6?(0,i.jsxs)(i.Fragment,{children:[e1&&(0,i.jsx)(lo,{block:!0,label:q.product.measurement_guide,onClick:()=>O("step1")}),(0,i.jsx)(ey.Z,{block:!0,variant:"black",onClick:ei,children:q.configurator.order_in_your_size})]}):(0,i.jsx)(l1,{product:y,addToCart:e=>{if(eO){em(!0),e(eO);return}em(!1),eA(e)},width:ej||en.width,length:eG||en.length,error:eO,showErrors:eu,children:!b.hideEstimatedShipping&&(0,i.jsx)(tm,{variant:"card",icon:"truck",productIds:[parseInt((0,eW.fE)(y.id),10)],className:"mt-2.5 w-full max-w-none lg:hidden"})})]})]})}function l3(e){var t,l,n,a,s,d,c,u,m,v;let{product:h,sanityProduct:x,color:p,wrapperClassName:g,isVisible:f=!0}=e,j=(0,o.useRouter)(),b=(0,e7._K)(j.locale),y=(0,eR.Z)(p);(0,M.useEffect)(()=>{if(!f)return;let e=window.setTimeout(()=>{(0,e7.W5)()},350);return()=>{window.clearTimeout(e)}},[b,h.id,p,f]);let w=null!==(u=p?null===(n=h.variants)||void 0===n?void 0:null===(l=n.edges)||void 0===l?void 0:null===(t=l.find(e=>{let{node:t}=e;return t.selectedOptions.find(e=>(0,P.u8)(e.name)&&e.value===p)}))||void 0===t?void 0:t.node:void 0)&&void 0!==u?u:null===(d=h.variants)||void 0===d?void 0:null===(s=d.edges)||void 0===s?void 0:null===(a=s[0])||void 0===a?void 0:a.node,N=(0,r.J2)(j.locale,x),_=p?"".concat(N,"/").concat((0,X.l)(p)):N,k=(0,eW.fE)(h.id),C=(null==y?void 0:y.name)?"".concat(h.title," (").concat(y.name,")"):h.title;return(0,i.jsx)("div",{className:null!=g?g:"pt-6 mt-4 border-t scroll-mt-40",id:"reviews",children:(0,i.jsx)("div",{className:"lipscore-review-list",id:"lipscore-review-list","data-ls-product-name":C,"data-ls-brand":h.vendor,"data-ls-product-id":k,"data-ls-product-url":_,"data-ls-mpn":w?(0,eW.ip)(w.id):void 0,"data-ls-variant-id":w?(0,eW.ip)(w.id):void 0,"data-ls-variant-name":null!==(m=null==y?void 0:y.name)&&void 0!==m?m:void 0,"data-ls-category":h.productType||void 0,"data-ls-description":h.description,"data-ls-image-url":null===(c=h.featuredImage)||void 0===c?void 0:c.url,"data-ls-price":h.priceRange.minVariantPrice.amount,"data-ls-price-currency":h.priceRange.minVariantPrice.currencyCode,"data-ls-availability":(null!==(v=null==w?void 0:w.availableForSale)&&void 0!==v?v:h.availableForSale)?"in stock":"out of stock","data-ls-translate-to-lang":b})})}var l7=l(55498),l8=l(95866),l6=l(51217);let l9=["Serviceomr\xe5de","Service area","Zon","Zone"];function ie(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function it(e){var t,l,n,r,s,d,u,m,v,h,x,p,g,f,j,b,y,w,N,_,k,C,Z,S,I,G,P,z,R;let{product:L}=e,F=(0,a.Z)(),E=null!==(d=(0,o.useRouter)().locale)&&void 0!==d?d:"sv",T=(0,lB.jD)(),{selectedVariant:W,selectedOptions:V,setSelectedOption:O,o
1ptions:B}=(0,ta.i)(),D=lH(),q=null!==(u=F.measurement_booking)&&void 0!==u?u:{},A=(0,M.useMemo)(()=>{var e,t;return B&&null!==(t=null!==(e=B.find(e=>e&&l9.includes(e.name)))&&void 0!==e?e:B.find(e=>{var t,l;return e&&(null!==(l=null===(t=e.values)||void 0===t?void 0:t.length)&&void 0!==l?l:0)>1}))&&void 0!==t?t:null},[B]),U=A&&null!==(m=null==V?void 0:V[A.name])&&void 0!==m?m:null,Q=null!==(h=null!==(v=null==W?void 0:W.title)&&void 0!==v?v:U)&&void 0!==h?h:null,Y=(0,M.useMemo)(()=>{var e;return(null!==(e=T.lines)&&void 0!==e?e:[]).find(e=>{var t,l,i;return!!e&&(null===(l=e.merchandise)||void 0===l?void 0:null===(t=l.product)||void 0===t?void 0:t.handle)===L.handle&&(null!==(i=e.attributes)&&void 0!==i?i:[]).some(e=>(null==e?void 0:e.key)===lV.W.reservationId)})},[T.lines,L.handle]),J=(0,M.useMemo)(()=>{var e,t,l,i,n;if(!Y)return null;let r=null!==(i=null===(e=Y.merchandise)||void 0===e?void 0:e.title)&&void 0!==i?i:null;if(r&&Q&&r!==Q)return null;let a=null!==(n=Y.attributes)&&void 0!==n?n:[],o=null===(t=a.find(e=>(null==e?void 0:e.key)===lV.W.date))||void 0===t?void 0:t.value,s=null===(l=a.find(e=>(null==e?void 0:e.key)===lV.W.slot))||void 0===l?void 0:l.value;if(!o||!s)return null;let d=s.match(/(\d{2}:\d{2})\s*-\s*(\d{2}:\d{2})/);if(!d)return null;let{starts_at:c,ends_at:u}=function(e,t,l){let i=e=>e.slice(0,5),n="Europe/Stockholm";return{starts_at:(0,l8.Z)("".concat(e," ").concat(i(t),":00"),n).toISOString(),ends_at:(0,l8.Z)("".concat(e," ").concat(i(l),":00"),n).toISOString()}}(o,d[1],d[2]);return{date:o,start_time:d[1],end_time:d[2],zone_id:0,zone_name:"",starts_at:c,ends_at:u}},[Y,Q]),X=(0,M.useMemo)(()=>{var e,t,l;return null!==(l=null==Y?void 0:null===(t=Y.attributes)||void 0===t?void 0:null===(e=t.find(e=>(null==e?void 0:e.key)===lV.W.reservationId))||void 0===e?void 0:e.value)&&void 0!==l?l:null},[Y]),$=(0,M.useMemo)(()=>{var e,t,l;return null!==(l=null==Y?void 0:null===(t=Y.attributes)||void 0===t?void 0:null===(e=t.find(e=>(null==e?void 0:e.key)===lV.W.reservedUntil))||void 0===e?void 0:e.value)&&void 0!==l?l:null},[Y]);(0,l7.w)({lineId:null==Y?void 0:Y.id,reservationId:X,reservedUntilRaw:$,enabled:!!Y,subscribeToNow:!1});let{loading:ee,error:et,weeks:el,currentWeek:ei,canGoPrev:en,canGoNext:er,goPrev:ea,goNext:eo,refetch:es}=(0,l6.Z)({variantTitle:Q,preferredDate:null!==(x=null==J?void 0:J.date)&&void 0!==x?x:null,cartId:X}),ed=(0,M.useRef)(null);(0,M.useEffect)(()=>{if(D){if(null===ed.current){ed.current=Q;return}ed.current!==Q&&(ed.current=Q,D.setSelectedSlot(null),D.setCommitError(null))}},[Q,D]);let ec=(0,M.useRef)(void 0);(0,M.useEffect)(()=>{if(void 0===ec.current){ec.current=X;return}ec.current!==X&&(ec.current=X,es())},[X,es]);let eu=new Date,em=(0,M.useMemo)(()=>{if(!ei)return null;if(!J)return ei;let e=ei.days.findIndex(e=>e.date===J.date);if(-1===e)return ei;let t=ei.days[e];if(t.slots.some(e=>e.start_time===J.start_time&&e.end_time===J.end_time))return ei;let l=[...t.slots,J].sort((e,t)=>e.start_time<t.start_time?-1:1),i=ei.days.map((t,i)=>i===e?{...t,slots:l}:t);return{...ei,days:i,hasAvailability:!0}},[ei,J]),ev=(0,M.useMemo)(()=>{if(!em)return[];let e=new Map;for(let t of em.days)for(let l of t.slots){let t="".concat(l.start_time,"-").concat(l.end_time);e.has(t)||e.set(t,{start_time:l.start_time,end_time:l.end_time})}return Array.from(e.values()).sort((e,t)=>e.start_time<t.start_time?-1:1)},[em]),eh=null!==(p=null==D?void 0:D.selectedSlot)&&void 0!==p?p:null,ex=null!==(g=null==D?void 0:D.committing)&&void 0!==g&&g,ep=null!==(f=null==D?void 0:D.commitError)&&void 0!==f?f:null,eg=e=>!!J&&e.date===J.date&&e.start_time===J.start_time,ef=e=>{if(D){if(eg(e)){D.setCommitError(null),D.setSelectedSlot(null);return}D.setCommitError(null),D.setSelectedSlot(e)}};return A||Q?(0,i.jsxs)("div",{className:"flex flex-col w-full max-w-[460px] text-sm",children:[A&&(null!==(j=null===(t=A.values)||void 0===t?void 0:t.length)&&void 0!==j?j:0)>1&&(0,i.jsxs)("div",{className:"mb-3",children:[(0,i.jsx)("p",{className:"mb-1 text-xs tracking-wider uppercase",children:null!==(b=q.zone_label)&&void 0!==b?b:A.name}),(0,i.jsxs)("select",{className:"w-full px-3 text-sm border border-black rounded-none h-9 form-select focus:outline-none focus:ring-1 focus:ring-black",value:null!=U?U:"",onCh
1ange:e=>O(A.name,e.target.value),children:[(0,i.jsx)("option",{value:"",disabled:!0,children:F.product.choose_zone}),A.values.map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),U&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.jsx)("button",{type:"button",disabled:!en||ee,onClick:ea,"aria-label":null!==(y=q.prev_week)&&void 0!==y?y:"Previous week",className:"grid transition place-content-center w-7 h-7 disabled:opacity-30 disabled:cursor-not-allowed hover:bg-gray-100",children:(0,i.jsx)(H.G,{icon:K.A35,className:"text-xs"})}),(0,i.jsx)("div",{className:"flex-1 text-xs text-center text-gray-700",children:ei?function(e,t,l){let i={day:"numeric",month:"short"};return"".concat(e.toLocaleDateString(l,i)," â ").concat(t.toLocaleDateString(l,i))}(ei.start,ei.end,E):null!==(w=q.loading)&&void 0!==w?w:"..."}),(0,i.jsx)("button",{type:"button",disabled:!er||ee,onClick:eo,"aria-label":null!==(N=q.next_week)&&void 0!==N?N:"Next week",className:"grid transition place-content-center w-7 h-7 disabled:opacity-30 disabled:cursor-not-allowed hover:bg-gray-100",children:(0,i.jsx)(H.G,{icon:K._tD,className:"text-xs"})})]}),(0,i.jsxs)("div",{className:"relative overflow-x-auto border border-gray-200 sm:overflow-visible",children:[ee&&(0,i.jsxs)("div",{className:"flex items-center justify-center p-6 text-xs text-gray-500",children:[(0,i.jsx)(H.G,{icon:K.AX7,className:"mr-2 animate-spin"}),null!==(_=q.loading)&&void 0!==_?_:"Loading..."]}),!ee&&et&&(0,i.jsx)("div",{className:"p-4 text-xs text-center text-red-600",children:et}),!ee&&!et&&em&&!em.hasAvailability&&(0,i.jsx)("div",{className:"p-4 text-xs text-center text-gray-500",children:null!==(k=q.no_slots_this_week)&&void 0!==k?k:"No available times this week."}),!ee&&!et&&!em&&0===el.length&&(0,i.jsx)("div",{className:"p-4 text-xs text-center text-gray-500",children:null!==(C=q.no_slots_period)&&void 0!==C?C:"No available times in the next ".concat(l6.J," days.")}),!ee&&em&&em.hasAvailability&&(0,i.jsx)("ul",{className:"divide-y divide-gray-100 min-w-max sm:min-w-0",children:em.days.filter(e=>e.slots.length>0).map(e=>(0,i.jsxs)("li",{className:"flex items-center py-1.5 pr-2",children:[(0,i.jsxs)("div",{className:"sticky left-0 z-10 self-stretch w-16 px-2 pt-1 text-xs bg-white shrink-0 sm:static sm:w-20",children:[(0,i.jsx)("div",{className:c()("font-medium capitalize",{"text-black":ie(e.label,eu),"text-gray-700":!ie(e.label,eu)}),children:e.label.toLocaleDateString(E,{weekday:"short"})}),(0,i.jsx)("div",{className:"text-[11px] text-gray-500",children:e.label.toLocaleDateString(E,{day:"numeric",month:"short"})})]}),(0,i.jsx)("div",{className:"flex gap-1 shrink-0 sm:flex-wrap sm:flex-1 sm:shrink",children:ev.map(t=>{var l;let n=e.slots.find(e=>e.start_time===t.start_time&&e.end_time===t.end_time),r=(0,lV.CW)(t.start_time,t.end_time);if(!n)return(0,i.jsx)("span",{"aria-hidden":!0,className:"invisible px-2 py-1 text-xs border border-transparent",children:r},"".concat(e.date,"-").concat(t.start_time,"-empty"));let a=eg(n),o=!a&&!!eh&&eh.date===n.date&&eh.start_time===n.start_time;return(0,i.jsx)("button",{type:"button",disabled:ex,onClick:()=>ef(n),"aria-pressed":o||a,"aria-label":a?"".concat(r," â ").concat(null!==(l=q.in_cart_aria)&&void 0!==l?l:"in cart"):r,className:c()("px-2 py-1 text-xs transition border focus:outline-none",a?"text-white bg-green-700 border-green-700":o?"text-white bg-black border-black":"border-black hover:bg-black hover:text-white","disabled:opacity-50 disabled:cursor-wait"),children:r},"".concat(n.date,"-").concat(n.start_time))})})]},e.date))})]}),(0,i.jsx)("div",{className:"mt-2 min-h-[20px] text-[11px] text-gray-500",children:"slot_taken"===ep?(0,i.jsx)(lW.Z,{children:null!==(Z=q.error_slot_taken)&&void 0!==Z?Z:"This time is no longer available."}):"generic"===ep?(0,i.jsx)(lW.Z,{children:null!==(S=q.error_generic)&&void 0!==S?S:"Something went wrong."}):"no_slot"===ep?(0,i.jsx)(lW.Z,{children:null!==(I=q.error_no_slot)&&void 0!==I?I:"Please pick a time first."}):eh?(0,i.jsx)("span",{children:null!==(G=null===(l=q.hint_selected_pending)||void 0===l?void 0:l.replace(":time",(0,lV.CW)(eh.start_time,eh.end_time)))&&void 0!==G?G:""}):Y?(0,i.jsx)("span",{children:null!==(z=null===(s=q.hint_in_cart)||void 0===s?void 0:s.replace(":time",null!==(P=null===(r=Y.attributes)||void 0===r?void 0:null===(n=r.find(e=>(null==e?void 0:e.key)===lV.W.reservedUntil))||void 0===n?void 0:n.value)&&void 0!==P?P:""))&&void 0!==z?z:""}):(0,i.jsx)("span",{children:null!==(R=q.hint_idle)&&void 0!==R?R:""})})]})]}):null}var il=l(85253),ii=l(29456);function ir(e){let{asset:t,onClick:l,sizes:n,id:r,cursorZoom:a=!0}=e;return(0,i.jsx)("div",{id:r,className:"relative w-full h-full",children:(0,i.jsx)("div",{onClick:l,className:(0,q.cn)("relative w-full h-full bg-gray-50",{"curs
1or-zoom-in":a}),children:"string"==typeof t?(0,i.jsx)(eO.Z,{src:t,sizes:n,alt:"",fill:!0,className:"object-cover object-center w-full h-full pointer-events-none",overrideImageMaxWidth:1e3}):t?(0,i.jsx)(il.Z,{media:t,sizes:n,alt:(0,ii.Z)(t.alt).color,fill:!0,className:"object-cover object-center w-full h-full pointer-events-none",overrideImageMaxWidth:1e3}):null})})}var ia=l(66387);function io(e){var t;let l=null==e?void 0:null===(t=e.references)||void 0===t?void 0:t.edges;return(null==l?void 0:l.length)?l.map(e=>e.node).filter(e=>(null==e?void 0:e.__typename)==="MediaImage"||(null==e?void 0:e.__typename)==="Video"):null}function is(){var e,t,l,i,n,r,a,s;let{product:d,selectedVariant:c}=(0,ta.i)(),{currentColor:u,colorOption:m}=lx(),v=function(e,t){var l,i,n,r;let a=(0,eR.Z)(t,null==e?void 0:e.id);if(!e)return[];let o=null!==(r=null==a?void 0:null===(l=a.baseName)||void 0===l?void 0:l.toLowerCase())&&void 0!==r?r:null==t?void 0:t.toLowerCase(),s=(null==e?void 0:null===(n=e.media)||void 0===n?void 0:null===(i=n.edges)||void 0===i?void 0:i.map(e=>e.node))||[],d=(0,eI.Z)(e).map(e=>e.toLowerCase()).filter(e=>e!==o),c=t=>!!t&&e.variants.edges.some(e=>{var l;return(null===(l=e.node.image)||void 0===l?void 0:l.url)===t}),u=s.filter(e=>{var t;return!c(null==e?void 0:null===(t=e.image)||void 0===t?void 0:t.url)});return d.length?u.filter(e=>{var t;return!!(0,ii.Z)(null===(t=e.alt)||void 0===t?void 0:t.toLowerCase()).color.includes(o)}):u}(d,u),{productColors:h}=(0,I.rV)(),{locale:x}=(0,o.useRouter)(),p=(0,eR.Z)(u,null==d?void 0:d.id),g=io(d.productGallery),f=function(e,t,l){var i;if(!t||!l)return null;let n=null===(i=e.variants.edges.find(e=>{var i;return(null===(i=e.node.selectedOptions.find(e=>e.name===l))||void 0===i?void 0:i.value)===t&&e.node.variantImages}))||void 0===i?void 0:i.node;return n?io(n.variantImages):null}(d,u,null==m?void 0:m.name);if(m&&!u){if(g&&g.length>0)return g;if(d.media.edges.length<10)return d.media.edges.map(e=>e.node);let e=d.media.edges.filter(e=>(0,ii.Z)(e.node.alt).partOfGallery);if(e.length>0)return e.map(e=>e.node);let n=null!==(i=null===(l=m.values)||void 0===l?void 0:null===(t=l.map(e=>{var t;return null===(t=(0,G.v)(x,h,e,d.id))||void 0===t?void 0:t.baseName}))||void 0===t?void 0:t.filter(Boolean))&&void 0!==i?i:[],r=d.media.edges.map(e=>{var t,l;let i=n.includes((0,ii.Z)(e.node.alt).color),r="MediaImage"===e.node.__typename&&(null===(t=e.node.image)||void 0===t?void 0:t.url)===(null==d?void 0:null===(l=d.featuredImage)||void 0===l?void 0:l.url);return e.node.alt||r?i&&!r?(n.splice(n.indexOf((0,ii.Z)(e.node.alt).color),1),e.node):null:e.node}).filter(e=>null!==e);return n.forEach(e=>{let t=(0,e2.ZV)(d,void 0,e);t&&r.push(t)}),r}if(u){if(f&&f.length>0)return f;let e=null==d?void 0:null===(a=d.variants)||void 0===a?void 0:null===(r=a.edges)||void 0===r?void 0:null===(n=r.find(e=>{var t,l,i,n,r,a,o,s,d;let c=(null==e?void 0:null===(i=e.node)||void 0===i?void 0:null===(l=i.selectedOptions)||void 0===l?void 0:null===(t=l.find(e=>(null==e?void 0:e.name)===(null==m?void 0:m.name)))||void 0===t?void 0:t.value)===u,v=null!==(d=null==p?void 0:null===(n=p.baseName)||void 0===n?void 0:n.toLowerCase())&&void 0!==d?d:null==u?void 0:u.toLowerCase(),h=null==e||null===(a=e.node)||void 0===a||null===(r=a.image)||void 0===r||!r.altText||(0,ii.Z)(null==e?void 0:null===(s=e.node)||void 0===s?void 0:null===(o=s.image)||void 0===o?void 0:o.altText).color.toLocaleLowerCase()===v;return!!c&&!!h}))||void 0===n?void 0:n.node;return[e?(0,e2.oN)(e.image):null,...v].filter(e=>null!==e)}let j=!!(null===(e=d.options)||void 0===e?void 0:e.some(e=>(0,P.JK)(e)));if(!m&&c&&j){let e=null===(s=d.variants.edges.find(e=>e.node.id===c.id))||void 0===s?void 0:s.node,t=io(null==e?void 0:e.variantImages);if(t&&t.length>0)return t}if(!m&&(null==c?void 0:c.image))return d.variants.edges.every(e=>{var t,l;return(null===(t=e.node.image)||void 0===t?void 0:t.url)===(null===(l=c.image)||void 0===l?void 0:l.url)})?d.media.edges.map(e=>e.node):[(0,e2.oN)(c.image)].filter(e=>null!==e);if(!m&&!c&&j){if(g&&g.length>0)return g;let e=new Set(d.variants.edges.map(e=>{var t;return null===(t=e.node.image)||void 0===t?void 0:t.url}).filter(e=>!!e));return d.media.edges.map(e=>e.node).filter(t=>{var l,i;return"MediaImage"!==t.__typename||!e.has(null!==(i=null===(l=t.image)||void 0===l?void 0:l.url)&&void 0!==i?i:"")})}return d.media.edges.map(e=>e.node)}var id=l(89382),ic=l(73460),iu=l(58354);let im=(0,M.forwardRef)((e,t)=>{let{shopifyProduct:l}=e,[n,r]=(0,M.useState)(0),[a,o]=(0,M.useState)(!1),[s,d]=(0,M.useState)(0),c=is(),u=(null==c?void 0:c.length)<=1,[m,v]=(0,ic.Z)({polyfill:iu.do}),h=.667*v.height,x=h>
10?Math.min(30,Math.max(6,2*Math.ceil(v.width/h))):6,[p,g]=(0,id.Z)({loop:!u,skipSnaps:u,dragFree:!1,containScroll:"trimSnaps",align:"start"},[]),f=(0,M.useCallback)(()=>{g&&g.scrollPrev()},[g]),j=(0,M.useCallback)(()=>{g&&g.scrollNext()},[g]),b=(0,M.useCallback)(e=>{g&&g.scrollTo(e)},[g]),y=(0,M.useCallback)(()=>{g&&d(g.selectedScrollSnap())},[g]);(0,M.useImperativeHandle)(t,()=>({slideLeft(){f()},slideRight(){j()},slideToIndex(e){b(e)},carouselDisabled:u}));let w=(0,M.useMemo)(()=>{var e;let t=null!==(e=null==c?void 0:c.map((e,t)=>{var l;return(0,i.jsx)(ir,{index:t,id:"asset-"+t,sizes:"33vw",asset:e,onClick:()=>{(0,lw.Sr)(t),o(!0),r(t)}},"".concat(null!==(l=e.__typename)&&void 0!==l?l:"asset","-").concat(t))}))&&void 0!==e?e:[];if((null==t?void 0:t.length)===1)for(let e=0;e<=x-((null==t?void 0:t.length)-1);e++)t.push((0,i.jsx)("div",{className:"relative w-full h-full px-1 xl:px-2",children:(0,i.jsx)("div",{className:"w-full h-full bg-gray-50"})},"placeholder"+e));for(;(null==t?void 0:t.length)>1&&(null==t?void 0:t.length)<x;)t=t.concat(t);return[t.slice(-1)[0],...t.slice(0,-1)]},[c,x]);return(0,M.useEffect)(()=>{g&&(y(),g.on("select",y),g.on("reInit",y))},[g,y]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ia.Z,{show:a,setShow:o,data:{type:"shopify",images:c},selectedImage:n}),(0,i.jsx)("div",{ref:m,className:"relative h-full",children:(0,i.jsx)("div",{className:"embla h-full overflow-hidden",ref:p,children:(0,i.jsx)("div",{className:"embla__container h-full flex",children:w.map((e,t)=>(0,i.jsx)("div",{className:"embla__slide flex-[0_0_auto] h-[calc(100vh_-_10rem)] w-[calc((100vh_-_10rem)_*_1334_/_2000)] px-1 xl:px-2",children:e},t))})})})]})});function iv(e){let{shopifyProduct:t,carouselRef:l}=e,{isAboveBreakpoint:n,loaded:r}=(0,e4.Z)();return(0,i.jsx)("div",{className:"hidden absolute inset-0 pt-4 xl:pb-0 lg:block",children:(0,i.jsx)("div",{className:"sticky overflow-hidden w-full top-28 h-[calc(100vh-10rem)]",children:(0,i.jsx)("div",{className:"-mx-[15vw] w-[calc(100%+30vw)] h-full",children:(!r||n("lg"))&&(0,i.jsx)(im,{ref:l,shopifyProduct:t})})})})}im.displayName="ProductCarousel";var ih=l(40229);function ix(e){let{shopifyProduct:t}=e,l=is(),{isAboveBreakpoint:n,loaded:r}=(0,e4.Z)();return(0,i.jsx)("div",{className:"relative block aspect-w-3 aspect-h-4 lg:hidden",children:(0,i.jsx)("div",{children:(!r||!n("lg"))&&(0,i.jsx)(ih.Z,{data:{type:"shopify",images:l},lightBoxOptOut:!0,onImageClick:lw.Sr})})})}function ip(e){let{path:t,color:l,colors:n,className:r,productId:a}=e,{isAboveBreakpoint:o}=(0,e4.Z)(),s=!o("lg"),d=lY();return(0,i.jsx)(J.Z,{className:r,children:n.map(e=>{let n=l===e;return(0,i.jsx)(m(),{onClick:()=>(0,lw.$P)("color",e),className:"focus:outline-none lg:focus:outline focus:ring-0 max-lg:p-1 lg:w-full lg:aspect-square",href:"".concat(t,"/").concat((0,X.l)(e))+d,children:s?(0,i.jsx)($.Z,{color:e,className:c()("lg:hidden",{"scale-95 transform":l&&!n}),selected:n,size:"large",tooltip:!0,productId:a}):(0,i.jsx)($.Z,{color:e,className:c()("max-lg:hidden lg:size-full",{"scale-95 transform":l&&!n}),selected:n,size:"pdp",tooltip:!0,productId:a})},e)})})}var ig=l(40525),ij=l(75321);function ib(e){var t,l,n,r,a,s,d,c,u;let{shopifyProduct:m,sanityProduct:v,path:h}=e,{locale:x}=(0,o.useRouter)(),{currentColor:p}=lx(),{options:g,selectedOptions:f,setSelectedOption:j}=(0,ta.i)(),{cartItem:b}=lU(),y=null==g?void 0:g.find(e=>(0,P.u8)(null==e?void 0:e.name)&&!(0,P.Ue)(null==e?void 0:e.name)),w=null!==(n=null==y?void 0:y.values)&&void 0!==n?n:[],N=null==g?void 0:g.find(e=>(0,P.Ue)(null==e?void 0:e.name)),_=null!==(r=null===(t=v.trimColorOptions)||void 0===t?void 0:t.map(e=>{var t,l,i,n;return null!==(n=null!==(i=null===(t=e.color.localizedName)||void 0===t?void 0:t[null!=x?x:"sv"])&&void 0!==i?i:null===(l=e.color.localizedName)||void 0===l?void 0:l.sv)&&void 0!==n?n:""}).filter(Boolean))&&void 0!==r?r:[],k={};for(let e of null!==(a=v.trimColorOptions)&&void 0!==a?a:[]){let t=null!==(c=null===(s=e.color.localizedName)||void 0===s?void 0:s[null!=x?x:"sv"])&&void 0!==c?c:null===(d=e.color.localizedName)||void 0===d?void 0:d.sv;t&&e.image&&(k[t]=e.image)}let[C,Z]=(0,ee.v1)("trim",ee.Oi.withOptions({shallow:!0})),S=null!==(u=null==N?void 0:N.values)&&void 0!==u?u:_,I=!!N,G=I&&p&&S.includes(p)?p:void 0,z=C?S.find(e=>(0,X.l)(e)===C):void 0,R=null!=z?z:G,L=(0,M.useRef)(null);(0,M.useEffect)(()=>{var e,t,l,i;if(!I||!N||!y)return;if(!(null==b?void 0:b.id)){L.current=null;return}if(L.current===b.id||C)return;L.current=b.id;let n=null!==(i=null===(e=b.merchandise)||void 0===e?void 0:e.selectedOptions)&&void 0!==i?i:[],r=null===(t=n.find(e=>e.name===N.name))||void 0===t?void 0:t.value,a=null===(l=n.find(e=>e.name===y.name))||void 0===l?void 0:l.value;r&&r!==a&&Z((0,X.l)(r))},[b,I,N,y,C,Z]),(0,M.useEffect)(()=>
1{if(!I||!N)return;let e=b?void 0:G,t=null!=R?R:e;t&&(null==f?void 0:f[N.name])!==t&&j(N.name,t)},[b,I,N,R,G,f,j]);let F=S.length>0;if(!y||0===w.length)return null;let E=v.colorLabelOverride||y.name,T=v.trimColorLabel,W=v.trimColorImageProductId?String(v.trimColorImageProductId):m.id,V=v.sanityCategory,O=!!((null==V?void 0:V.fabricSampleCopy)||(null==V?void 0:null===(l=V.parentCategory)||void 0===l?void 0:l.fabricSampleCopy)),B=(0,P.Gg)(m.productType)?(0,i.jsx)(ig.Z,{product:m,color:p,curtainSampleProductId:v.curtainSampleProductId,className:"mt-4",displayVariant:"legacy",homeAccessory:O}):null;return(0,i.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,i.jsxs)("div",{children:[F&&(0,i.jsx)("p",{className:"mb-1.5 text-xs tracking-wider uppercase",children:E}),(0,i.jsx)(ip,{colors:w,color:p||"",path:h,productId:m.id})]}),O&&B,F&&(0,i.jsx)(ij.Z,{colors:S,selectedColor:R,onSelect:e=>{I&&j(N.name,e),Z((0,X.l)(e))},productId:W,imageOverrides:k,label:T}),!O&&B]})}function iy(e){var t;let{productId:l,group:n,alignScroll:r="start"}=e,{currentColor:a}=lx(),o=a?"/".concat((0,X.l)(a)):"",s=(0,M.useCallback)((e,t)=>{e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),window.location.assign(t))},[]);return(null===(t=n.options)||void 0===t?void 0:t.length)?(0,i.jsx)(eA,{productId:l,options:n.options,alignScroll:r,hrefSuffix:o,onOptionClick:s}):null}var iw=l(45826);let iN=(e,t)=>"tab-".concat(e._id,"-").concat(t);function i_(e){let{tabs:t,materialTabContent:l,reviewTrigger:n}=e,r=(0,o.useRouter)().locale,a=null==(t=t.filter(e=>{var t;return!(null===(t=e.hiddenForMarkets)||void 0===t?void 0:t[r])}))?void 0:t.find(e=>e.title||e.body),[s,d]=(0,M.useState)(void 0);if(!a&&!n)return(0,i.jsx)(i.Fragment,{});let c=e=>null==e?void 0:e.toLowerCase().includes("material"),u=t.findIndex(e=>c(e.title));return(0,i.jsx)("div",{children:(0,i.jsxs)("div",{className:"",children:[t.map((e,t)=>{let n=iN(e,t),r=l&&u===t;return(0,i.jsxs)("div",{children:[(0,i.jsxs)("button",{onClick:()=>{s===n?((0,lw.BS)(e.title),d(void 0)):((0,lw.Fk)(e.title),d(n))},className:"flex items-center justify-between w-full py-5 text-sm font-bold transition focus:outline-none hover:text-gray-500",children:[(0,i.jsx)("span",{children:e.title}),(0,i.jsx)(H.G,{icon:s===n?K.Kl4:K.r8p})]}),(0,i.jsx)(iw.Z,{className:"",show:s===n,children:(0,i.jsxs)("div",{className:"pl-2",children:[r?(0,i.jsx)("div",{className:"pb-8",children:l}):null,(0,i.jsx)(T.Z,{size:"small",blocks:e.body})]})})]},n)}),n]})})}var ik=l(24011);function iC(e){var t,l;let{colorData:n,colors:r,productId:a}=e,[s,d]=(0,M.useState)(!1),[u,m]=(0,M.useState)(0),v=function(e){var t;let{product:l}=(0,ta.i)(),{colorOption:i}=lx(),{productColors:n}=(0,I.rV)(),{locale:r}=(0,o.useRouter)();return(null!==(t=null==i?void 0:i.values)&&void 0!==t?t:[]).map(e=>{let t=(0,G.v)(r,n,e,l.id);return null==t?void 0:t.image}).filter(Boolean)}(),h=n?!!n.image:v.length>0,x=e=>{m(null!=e?e:0),d(!0)};return n?(0,i.jsxs)("div",{className:"relative",children:[h&&(0,i.jsx)(ia.Z,{show:s,setShow:d,data:{type:"sanity",images:[n.image]},selectedImage:u}),(0,i.jsx)(h?"button":"div",{onClick:h?()=>x():void 0,style:{backgroundColor:null==n?void 0:n.color},className:c()("relative aspect-w-1 aspect-h-1 w-full border focus:outline-none block",{"border-white":!(null==n?void 0:null===(t=n.color)||void 0===t?void 0:t.includes("fff")),"border-gray-200":null==n?void 0:null===(l=n.color)||void 0===l?void 0:l.includes("fff")}),children:(null==n?void 0:n.image)&&(0,i.jsx)(eV.Z,{width:320,height:320,overrideImageMaxWidth:320,className:"w-full h-full",style:{objectFit:"cover"},sanityImage:null==n?void 0:n.image})}),(0,i.jsx)("p",{className:"absolute right-2 bottom-2 px-2 py-1 text-xs tracking-wider text-white uppercase bg-black",children:null==n?void 0:n.name})]}):null}function iZ(e){var t,l,n;let{shopifyProduct:r,sanityProduct:o,colors:s,colorData:d,path:u,hasColorOption:m}=e,[v,h]=(0,M.useState)(!1),x=(0,a.Z)(),p=null!==(n=o.attributeValueReferences)&&void 0!==n?n:[];return null==p||p.length,(0,i.jsx)("div",{children:(0,i.jsxs)("div",{className:"flex flex-row gap-3 items-center w-full text-13",children:[!!d&&(0,i.jsxs)("div",{className:"mr-3 w-32",children:[m&&s&&(0,i.jsx)(iC,{productId:null==r?void 0:r.id,colors:s,colorData:d}),!m&&!!o.fallbackDetailImage&&(0,i.jsx)("div",{className:c()("relative aspect-w-1 aspect-h-1 w-full border focus:outline-none block",{"border-white":!(null==d?void 0:null===(t=d.color)||void 0===t?void 0:t.includes("fff")),"border-gray-200":null==d?void 0:null===(l=d.color)||void 0===l?void 0:l.includes("fff")}),children:(0,i.jsx)(eV.Z,{width:320,height:320,className:"w-full h-full",style:{objectFit:"cover"},sanityImage:o.fallbackDetailImage})}),s&&s.length>1&&d&&(0,i.jsxs)("div",{className:"mt-2 leading-relaxed",children:[(0,i.jsxs)("p",{children:[x.product.available_in," ",(0,i.jsx)("span",{role:"button",onClick:()=>h(!0),className:"underline",children:!s||s.length<=1?null:"".concat(s.length," ").concat(2==s.length?x.product.color:x.general.colors.toLowerCase())})]}),(0,i.jsx)(tz.Z,{title:r.title,isOpen:v,onClose:()=>h(!1),children:(0,i.jsx)(g.Z,{className:"flex justify-center pb-10 -mt-4 -ml-4",children:(0,i.jsx)("div",{className:"flex flex-wrap justify-center w-full",children:s.map((e,t)=>(0,i.jsx)(ik.Z,{className:"transition hover:opacity-75",onClick:()=>{h(!1)},path:u||"",color:e,productId:null==r?void 0:r.id,imageWidth:240},e+t))})})})]})]}),(0,i.jsx)("div",{className:"flex flex-col items-start -mr-5 -mb-5 sm:flex-row",children:(0,i.jsx)("div",{className:"space-y-4 mr-5 flex-1 mb-5 leading-normal [&_a]:underline text-13",children:p.map(e=>{var t;return(0,i.jsxs)("div",{children:[!!(null===(t=e.attributeCategory)||void 0===t?void 0:t.t
1itle)&&(0,i.jsx)("div",{className:"text-xs font-bold tracking-wide uppercase",children:e.attributeCategory.title}),(0,i.jsx)("div",{className:"max-w-[200px]",children:e.value})]},e._id)})})})]})})}function iS(e){var t,l,n;let{shopifyProduct:r,color:a,sanityProduct:o,path:s,reviewTrigger:d}=e,{colorOption:c}=lx(),u=(0,eR.Z)(a,null==r?void 0:r.id),m=null==c?void 0:null===(t=c.values)||void 0===t?void 0:t.filter(e=>!!e),v=null!==(l=o.attributeValueReferences)&&void 0!==l?l:[],h=(null==v?void 0:v.length)||c||o.fallbackDetailImage?(0,i.jsx)(iZ,{shopifyProduct:r,sanityProduct:o,colors:m,colorData:u,path:s,hasColorOption:!!c}):void 0;return(0,i.jsx)(i_,{tabs:null!==(n=o.sections)&&void 0!==n?n:[],materialTabContent:h,reviewTrigger:d})}function iI(e){var t;let{sellingPoints:l,className:n,onOpenArticle:r,...a}=e,{general:o}=(0,I.rV)();return(null==(l=l.concat(null!==(t=o.productSellingpoints)&&void 0!==t?t:[]))?void 0:l.length)?(0,i.jsx)("div",{...a,className:c()("grid gap-2","grid-cols-2",2===l.length?"lg:grid-cols-2":3===l.length?"lg:grid-cols-3":4===l.length?"lg:grid-cols-2":"lg:grid-cols-3",n),children:M.Children.toArray(l.map(e=>"article"===(e.linkType||"link")&&e.article&&e._key?(0,i.jsxs)("div",{onClick:()=>null==r?void 0:r(e._key),className:"flex items-center px-3 py-2 text-xs text-left bg-gray-50 transition-colors cursor-pointer hover:bg-gray-100",children:[e.icon&&(0,i.jsx)(eK.Z,{fixedWidth:!0,className:"mr-2 text-sm",icon:e.icon}),(0,i.jsxs)("p",{className:"pt-[2px] flex items-center gap-1 flex-1 text-balance group-hover:underline",children:[e.article.title,(0,i.jsx)(H.G,{icon:K.nUK,className:"text-xs opacity-70"})]})]},e._key):e.link?(0,i.jsx)(eQ,{size:"small",link:e.link,className:"px-3 py-2 text-xs text-left bg-gray-50",iconClassName:"text-sm",direction:"horizontal",icon:e.icon},e._key):null))}):(0,i.jsx)(i.Fragment,{})}var iG=l(53241),iM=l(31955),iP=l(4298),iz=l.n(iP);let iR="01KRDZX4WXJ95WS7G4ADZ8SVKZ";var iL=l(52176);let iF="https://ai-widgets.gotolstoy.com/".concat("27ceec44-2fc3-4b49-acdb-38ffcffe99e6","/").concat(iR,"/latest/dist/widget.iife.js?v=").concat("2026-05-26"),iE="tolstoy-anonymousId";function iT(e){let{productId:t}=e,l=(0,a.Z)(),{acceptedMarketingCookies:n}=(0,iL.Z)(),r=(0,M.useRef)(null),[o,s]=(0,M.useState)(!1),[d,c]=(0,M.useState)(!1);return((0,M.useEffect)(()=>{n||function(){iM.Z.remove(iE,{path:"/"});try{localStorage.removeItem(iE)}catch(e){}}()},[n]),(0,M.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>{var e,l;let i=r.current;!i||i.__tolstoyMounted||i.childNodes.length>0||(null!==(l=null===(e=i.shadowRoot)||void 0===e?void 0:e.childNodes.length)&&void 0!==l?l:0)>0||(iG.uT("Tolstoy widget failed to mount",{level:"warning",tags:{feature:"tolstoy-ugc"},extra:{productId:t,bundleUrl:iF}}),c(!0))},8e3);return()=>clearTimeout(e)},[t,o]),!n||d)?null:(0,i.jsxs)("section",{"aria-label":l.product.shared_by_community,className:"mt-6 mb-3",children:[(0,i.jsx)(v.Z,{type:"overline",className:"mb-2.5",children:l.product.shared_by_community}),(0,i.jsx)(iz(),{src:iF,strategy:"afterInteractive",onReady:()=>s(!0),onError:()=>c(!0)}),(0,i.jsx)("div",{className:"min-h-[173px] lg:min-h-[149px] [&>tolstoy-widget]:block",children:(0,i.jsx)("tolstoy-widget",{ref:r,"data-tolstoy-widget-id":iR,"data-product-id":t})})]})}function iW(e){var t,l,n,s,d,u,m,h,x,p;let{shopifyProduct:g,sanityProduct:f,lipscoreBottomline:j,path:b,sanityColorFilter:y,hasTolstoyUgc:w}=e,{productBackgroundColor:N}=(0,I.rV)(),{currentColor:_}=lx(),k=(0,eR.Z)(_),C=(0,M.useRef)(null),Z=(0,a.Z)(),S=(0,o.useRouter)(),G=(0,t2.Z)(),[P,z]=(0,M.useState)(!1),[R,L]=(0,M.useState)(!1),[F,E]=(0,M.useState)(!1),T=null!==(p=S.locale)&&void 0!==p?p:"sv",W=!!(null===(t=t_.ZP[T])||void 0===t?void 0:t.pdpConfiguratorEnabled)&&!S.query.edit,[V,O]=(0,ee.v1)("configure",ee.Oi.withOptions({shallow:!0})),B=W&&S.isReady&&"curtain3D"===f.productVisualization&&!!V,D=P&&G,q=B&&!D;(0,M.useEffect)(()=>{z(!0)},[]);let U=(0,M.useRef)(null);(0,M.useEffect)(()=>{B&&!D&&"1"===V&&"1"!==U.current&&window.scrollTo({top:66,behavior:"smooth"}),U.current=V},[B,V,D]);let[Q,Y]=(0,M.useState)(!1);(0,M.useEffect)(()=>{q&&Y(!1)},[q]);let[J,$]=(0,M.useState)(new Set),et=e=>{$(t=>new Set(t).add(e))},el=e=>{$(t=>{let l=new Set(t);return l.delete(e),l})},ei=null===(l=C.current)||void 0===l?void 0:l.carouselDisabled,en=[parseInt((0,eW.fE)(g.id),10)],er=(0,tp.N2)(g),ea=f.buyButton?"buyButton":f.customHtml?"customHtml":er?"wizard":null,eo=function(e,t,l){let{locale:i}=(0,o.useRouter)(),{collections:n}=(0,I.rV)(),a=null==n?void 0:n.find(t=>{var l;return(0,r.sK)(i,null==t?void 0:t._slug)===(0,r.sK)(i,null==e?void 0:null===(l=e.sanityCategory)||void 0===l?void 0:l._slug)}),s=null==n?void 0:n.find(t=>{var l,n;return(0,r.sK)(i,null==t?void 0:t._slug)===(0,r.sK)(i,null==e?void 0:null===(n=e.sanityCategory)||void 0===n?void 0:null===(l=n.parentCategory)||void 0===l?void 0:l._slug)});return[{title:null==s?void 0:s.title,href:s?(0,r.kG)(i,s):void 0},{title:null==a?void 0:a.title,href:a?(0,r.kG)(i,a):void 0}
1,{title:null==t?void 0:t.title,href:e?(0,r.kG)(i,e):void 0},,{title:null==l?void 0:l.name,href:l&&e?(0,r.kG)(i,e)+"/".concat(null==l?void 0:l.slug):void 0}].filter(e=>e.title&&e.href)}(f,g,k?{slug:(0,X.l)(_),name:k.name}:void 0),es=((null===(n=g.media)||void 0===n?void 0:n.edges)||(null===(s=g.images)||void 0===s?void 0:s.edges)||[]).length>0,ed=!!(null==j?void 0:j.total_ratings)&&!f.hideReviews;(0,M.useEffect)(()=>{ed&&S.asPath.includes("#reviews")&&L(!0)},[ed,S.asPath]);let ec=()=>L(!0),eu=(0,lV.cq)(g.handle),em=(0,i.jsxs)("div",{children:[B&&D&&(0,i.jsx)(tv,{children:(0,i.jsxs)("h3",{className:"mb-2 text-sm font-medium",children:["1. ",Z.configurator.choose_color,F&&(0,i.jsx)("span",{className:"ml-1.5 text-xs font-normal text-red-600",children:Z.general.required})]})}),(0,i.jsx)(ib,{shopifyProduct:g,sanityProduct:f,path:b})]}),ev=(0,i.jsxs)("div",{id:"carousel",className:"relative w-full",children:[(0,i.jsx)("div",{className:"relative z-[10] px-4 pt-2.5 -mb-1.5 bg-white lg:hidden sm:px-6",children:(0,i.jsx)(A,{links:eo})}),(0,i.jsx)("div",{className:"sticky top-16 shadow-sm z-[9] px-4 pt-2.5 pb-2.5 bg-white lg:hidden sm:px-6",children:(0,i.jsx)(lE,{product:g,sanityProduct:f,lipscoreBottomline:j,path:b,color:_,hideReviews:f.hideReviews,onReviewsClick:ec,colorLabel:null===(d=f.colorLabels)||void 0===d?void 0:d.find(e=>e.color===_),asHeading:!P||!G})}),!f.hideEstimatedShipping&&(0,i.jsx)("div",{className:"lg:hidden",children:(0,i.jsx)(tm,{variant:"banner",productIds:en})}),es&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iv,{shopifyProduct:g,carouselRef:C},"desktop-".concat(g.id,"-").concat(_)),(0,i.jsx)(ix,{shopifyProduct:g},"mobile-".concat(g.id,"-").concat(_))]}),(0,i.jsxs)("div",{className:"relative flex items-stretch justify-between h-full pointer-events-none lg:pt-4 lg:space-x-4 lg:px-8",children:[(0,i.jsx)("div",{className:"relative flex-1 hidden lg:block",children:(0,i.jsxs)("div",{className:"h-[calc(100vh-10rem)] w-full sticky top-28",children:[(0,i.jsx)("button",{disabled:ei,onClick:()=>{C.current&&C.current.slideLeft()},className:"absolute left-0 grid w-8 h-8 transition -translate-y-1/2 bg-white rounded-full shadow-sm pointer-events-auto top-1/2 place-content-center disabled:opacity-0 disabled:pointer-events-none hover:bg-gray-100",children:(0,i.jsx)(H.G,{icon:K.A35,className:"text-base"})}),(0,i.jsx)("button",{disabled:ei,onClick:()=>{C.current&&C.current.slideRight()},className:"absolute right-0 grid w-8 h-8 transition -translate-y-1/2 bg-white rounded-full shadow-sm pointer-events-auto top-1/2 place-content-center disabled:opacity-0 disabled:pointer-events-none hover:bg-gray-100",children:(0,i.jsx)(H.G,{icon:K._tD,className:"text-base"})}),!f.hideEstimatedShipping&&(0,i.jsx)("div",{className:"absolute top-4 right-0 z-20 pointer-events-auto",children:(0,i.jsx)(tm,{variant:"card",productIds:en})})]})}),(0,i.jsx)("div",{style:{backgroundColor:N},className:c()("w-full flex lg:z-20 flex-col lg:max-w-md xl:max-w-lg lg:min-h-[min(calc(100vh-128px-64px),800px)] pointer-events-auto border-white lg:border-x-4"),children:(0,i.jsxs)("div",{className:"flex flex-col flex-1 p-4 sm:px-6 sm:py-4",children:[(0,i.jsx)("div",{className:"hidden mb-2 lg:block",children:(0,i.jsx)(A,{links:eo})}),(0,i.jsx)("div",{className:"hidden lg:block",children:(0,i.jsx)(lE,{product:g,sanityProduct:f,lipscoreBottomline:j,path:b,color:_,hideReviews:f.hideReviews,onReviewsClick:ec,colorLabel:null===(u=f.colorLabels)||void 0===u?void 0:u.find(e=>e.color===_),asHeading:P&&G})}),(0,i.jsxs)("div",{className:"flex flex-col gap-4 lg:gap-6 lg:mt-6",children:[!q&&(Q?(0,i.jsx)(tv,{children:em}):em),!(B&&D)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lM,{shopifyProduct:g,sanityColorFilter:y}),(0,i.jsx)(tj,{product:g,sanityProduct:f}),"wizard"===ea&&(0,i.jsx)("div",{className:"flex flex-col",children:(0,i.jsx)(l5,{sanityProduct:f,product:g,path:b,useConfigurator:W,lipscoreBottomline:j})})]})]}),B&&D&&(0,i.jsx)(tv,{className:"flex-1",children:(0,i.jsx)(lG,{product:g,sanityProduct:f,onClose:()=>O(null),onColorErrorChange:E})}),B&&!D&&(0,i.jsx)(lS,{product:g,sanityProduct:f,onClose:()=>{Y(!0),O(null)},configureParam:V,onMinimizedChange:e=>O(e?"min":"1")}),!(B&&D)&&(0,i.jsxs)(i.Fragment,{children:["buyButton"===ea&&(0,i.jsx)("div",{className:"pt-6 lg:mt-auto",children:(0,i.jsx)(ey.Z,{block:!0,link:f.buyButton,variant:"black",children:(0,i.jsxs)("div",{className:"flex justify-between w-full",children:[(0,i.jsx)("span",{children:f.buyButton.title}),(0,i.jsx)(H.G,{className:"text-sm",icon:K.eFW})]})})}),"customHtml"===ea&&(0,i.jsx)(tt.Z,{children:(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:f.customHtml.code}})}),!ea&&(0,i.jsxs)("div",{className:"flex flex-col mt-6",children:[(0,lV.cq)(g.handle)&&(0,i.jsx)(it,{product:g}),(0,i.jsx)(l0,{sanityProduct:f,product:g,path:b})]}),f.sellingPoints&&(0,i.jsx)(iI,{sellingPoints:f.sellingPoints,className:"mt-6",onOpenArticle:et}),!!(null==f?void 0:null===(h=f.productGroup)||void 0===h?void 0:null===(m=h.options)||void 0===m?void 0:m.length)&&(0,i.jsxs)("div",{className:"mt-6 mb-3",children:[(0,i.jsx)(v.Z,{type:"overline",className:"mb-2.5",children:f.productGroup.title}),(0,i.jsx)(iy,{productId:g.id,group:f.productGroup})]}),w&&!f.hideUgcWidget&&(0,i.jsx)(iT,{productId:(0,eW.fE)(g.id)}),(0,i.jsx)(iS,{color:_,sanityProduct:f,path:b,shopifyProduct:g,reviewTrigger:ed?(0,i.jsxs)("button",{type:"button",onClick:ec,className:"flex items-center justify-between w-full py-5 text-sm font-bold transition focus:outline-none hover:text-gray-500",children:[(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{children:Z.product.reviews}),(0,i.jsxs)("div",{className:"flex gap-1 items-baseline pt-0.5",children:[(0,i.jsx)(lL,{bottomline:j,hideCount:!0,size:"small"}),(0,i.jsxs)("span",{className:"text-xs font-normal text-black/70",children:["(",j.total_ratings,")"]})]})]}),(0,i.jsx)(H.G,{icon:K.r8p}
1)]}):void 0})]})]})})]}),null===(x=f.sellingPoints)||void 0===x?void 0:x.map(e=>{if("article"===(e.linkType||"link")&&e.article&&e._key){let t=J.has(e._key);return(0,i.jsx)(tn,{isShowing:t,setIsShowing:t=>{t?et(e._key):el(e._key)},article:e.article},e._key)}return null}),(0,i.jsx)(ti.Z,{enterFrom:"right",title:Z.product.reviews,isShowing:R,setIsShowing:L,children:(0,i.jsx)("div",{className:"px-5 py-6 sm:px-6",children:(0,i.jsx)(l3,{product:g,sanityProduct:f,color:_,wrapperClassName:"pt-0 mt-0 border-0",isVisible:R})})})]});return eu?(0,i.jsx)(lA,{children:ev}):ev}function iV(e){let{shopifyProduct:t,sanityProduct:l,sellingPoints:n,colorName:r,sanityColorFilter:a,lipscoreBottomline:o,hasTolstoyUgc:s,path:d}=e,{selectedVariant:c,setSelectedOption:u}=(0,ta.i)(),{currentColor:m,colorOption:v}=lx();return(0,M.useEffect)(()=>{(null==v?void 0:v.name)&&u(v.name,r)},[r,v,u]),(0,M.useEffect)(()=>{if(c){var e,l;let i=null===(e=((null==t?void 0:null===(l=t.variants)||void 0===l?void 0:l.edges)||[]).find(e=>e.node.id===c.id))||void 0===e?void 0:e.node;(0,lw.Q4)(t,i)}},[t,c]),(0,i.jsx)(iW,{shopifyProduct:t,sanityProduct:l,lipscoreBottomline:o,hasTolstoyUgc:s,path:d,sanityColorFilter:a})}function iO(e){var t,l,n,s,d,u;let{product:m,shopifyProduct:v,relatedProductIds:h,accessoryProducts:x,colorFilter:p,lipscoreBottomline:g,shopifyCategory:f,hasTolstoyUgc:j}=e,b=(0,a.Z)(),y=(0,o.useRouter)(),w=function(e,t){var l,i,n;let{query:r,isReady:a}=(0,o.useRouter)(),s=t;return a&&(null===(l=r.page)||void 0===l?void 0:l.length)&&r.page[r.page.length-1]!==e.handle&&(s=r.page[r.page.length-1]),((null==e?void 0:null===(n=e.options)||void 0===n?void 0:null===(i=n.find(e=>{let{name:t}=e;return(0,P.u8)(t)}))||void 0===i?void 0:i.values)||[]).find(e=>(0,X.l)(e)===s)}
1(v,p),N=function(e,t){let{productColors:l}=(0,I.rV)(),{locale:i}=(0,o.useRouter)();return(0,M.useMemo)(()=>(0,G.qU)(i,l,e,t),[i,l,e,t])}(w,v.id),k=N.find(e=>e.colorGroupId)||N.find(e=>e.image)||N[0],C=k?null==m?void 0:null===(t=m.filter)||void 0===t?void 0:t.find(e=>e.name===k.baseName):void 0,S=(0,P.Nm)(v,null!=w?w:"",{leaveUnselectedForChoosableOptions:!0}),z=S?v.variants.edges.find(e=>e.node.id===S):void 0,R=(0,r.kG)(y.locale,m),L=C&&z?z.node.image:v.featuredImage,F=(v.options||[]).find(e=>(0,P.u8)(e.name)),E=null==F?void 0:F.values,T=(null==E?void 0:E.length)===1?E[0]:void 0;return(0,M.useEffect)(()=>{T&&w!==T&&y.replace("".concat(R,"/").concat((0,X.l)(T)))},[T,y,R,w]),(0,i.jsxs)(_.Z,{linkResolverData:m,color:k,seo:{title:(null==C?void 0:null===(l=C.seo)||void 0===l?void 0:l.title)||v.seo.title||v.title,description:(null==C?void 0:null===(n=C.seo)||void 0===n?void 0:n.description)||v.seo.description||v.description,image:C&&z?{...L,altText:(null==C?void 0:null===(s=C.seo)||void 0===s?void 0:s.title)||v.title}:{...L,altText:v.title}},noIndex:p&&!w,children:[(0,i.jsx)(e9,{product:v,sanityProduct:m,image:null==L?void 0:L.url,lipscoreBottomline:g},v.id),(0,i.jsx)(e6,{product:v,sanityProduct:m,color:w,image:null==L?void 0:L.url}),(0,i.jsx)(ta.G,{data:v,initialVariantId:S,children:(0,i.jsxs)("div",{className:c()("space-y-8 sm:space-y-24",{"pb-12 sm:pb-16":(null===(d=m.content)||void 0===d?void 0:d.length)||!m.hideReviews||!m.hideInstagram||!m.hideRelatedProducts||h.length}),children:[(0,i.jsx)(iV,{sellingPoints:m.sellingPoints,shopifyProduct:v,sanityProduct:m,colorName:w,sanityColorFilter:C,accessoryProducts:x,lipscoreBottomline:g,hasTolstoyUgc:j,path:R}),(0,i.jsx)(e3,{images:m.masonGrid}),!!(null===(u=m.content)||void 0===u?void 0:u.length)&&(0,i.jsx)(Z.Z,{blocks:m.content,noBottomMargin:!0}),!m.hideRelatedProducts&&h.length>0&&(0,i.jsx)(te.Z,{title:b.product.related_products,productIds:h,color:w})]})})]},v.handle)}function iB(e){var t,l,n,a,s,d;let{page:c}=e,{locale:u}=(0,o.useRouter)(),m=(null===(t=c.parent)||void 0===t?void 0:t.children)&&c.parent.children.length>1;return(0,i.jsx)(_.Z,{seo:c.seo,bgColor:c.bgColor,linkResolverData:c,children:(0,i.jsxs)(h,{parent:m?{title:null!==(s=null===(l=c.parent)||void 0===l?void 0:l.title)&&void 0!==s?s:"",href:c.parent?(0,r.kG)(null!=u?u:"sv",c.parent):""}:void 0,links:m?(null!==(d=null===(n=c.parent)||void 0===n?void 0:n.children)&&void 0!==d?d:[]).map(e=>{var t;return{title:null!==(t=e.title)&&void 0!==t?t:"",href:c.parent?(0,r.kG)(null!=u?u:"sv",e):"",active:(0,r.sK)(u,e._slug)===(0,r.sK)(u,c._slug)}}):[],children:[!c.hideTitleBanner&&(0,i.jsx)(N,{parent:c.parent,parentTitle:null===(a=c.parent)||void 0===a?void 0:a.title,title:c.title}),(0,i.jsx)(Z.Z,{blocks:c.content,allowH1:!!c.hideTitleBanner})]})})}iO.getLayoutProps=()=>({solidNav:!0}),iB.getLayoutProps=()=>({solidNav:!0});let iD={collection:em,product:iO,page:iB,articleIndex:C,articleCategory:k,article:S,curtainPlanning:ev,faq:e$,curtainSamples:eY};var iq=!0;function iA(e){let{page:t,type:l,data:n,...r}=e,a=iD[l];return(0,i.jsx)(a,{...n,...r},"object"==typeof r.slug?r.slug.join("-"):r.slug)}}},function(e){e.O(0,[7198,2962,419,4374,2813,7831,9804,3162,4729,7866,1603,2888,9774,179],function(){return e(e.s=57171)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.