!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="59aa9b98-bf4e-4a9e-8fd7-41d0b9b32dd8",e._sentryDebugIdIdentifier="sentry-dbid-59aa9b98-bf4e-4a9e-8fd7-41d0b9b32dd8")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[257],{92288:function(e,n,l){l.d(n,{Z:function(){return a}});var i=l(29282),t=l(14481),o=l(1037);async function a(e){let{locale:n,lineItems:l,items:a,contextToken:r}=e;try{var u;let e=null!==(u=null==l?void 0:l.map(e=>{var n,l;let t="bundle"===e.type?e.id:null,o="mixedPaint"===e.type?e.productId:e.id;return{id:t,referencedId:o,quantity:e.lineItemQuantity,type:(0,i.Lj)(e.type),colorId:null!==(l=null===(n=e.mixedPaint)||void 0===n?void 0:n.colorId)&&void 0!==l?l:null}}))&&void 0!==u?u:a;if(!e)return null;let t=await o.b.post("/cart/add-line-items",{items:e,locale:n,contextToken:r},{headers:{"Content-Type":"application/json"}});return await t.data}catch(e){return(0,t.Z)(e,"Error while readding cart items"),null}}},30935:function(e,n,l){l.d(n,{Z:function(){return Z}});var i=l(67294),t=l(40780),o=l(11163),a=l(41141),r=l(67027),u=l(92288),d=l(95752),c=l(62662),s=l(14481),v=l(32697);let m=async e=>{let{password:n,username:l,locale:i=c.al}=e,{invoke:t}=(0,v.T)({callType:v.r.CLIENT,locale:i});return t.post("/store-api/account/login",{password:n,username:l}).then(e=>({redirectUrl:e.data.redirectUrl||"",contextToken:e.headers["sw-context-token"]||e.data.contextToken})).catch(e=>((0,s.Z)(e,"Error while logging in"),null))};var p=l(79848),f=l(21964),y=l(2540),g=l(98397),b=l(94362),h=l(126),x=l(72042);let I=()=>"/store-api/checkout/cart";async function P(e){try{return(await e.invoke.delete("".concat(I()))).data}catch(e){return(0,s.Z)(e,"Error while clearing cart"),null}}var k=l(30463),w=l(72115);function Z(){let{push:e,query:n}=(0,o.useRouter)(),{useStartSession:l,useSetContextToken:c,useSetSwCustomer:v}=(0,x.Z)(),I=v(),Z=l(),_=c(),{useToggleTaxIncluded:R}=(0,h.Z)(),C=(0,g.Z)(),T=R(),{cart:j,setCart:N}=(0,f.Z)(),E=(0,b.Z)();return(0,i.useCallback)(async l=>{let{emailAddress:i,password:o}=l;try{var c,v;let l=localStorage.getItem(w.n),f=null!==(c=null==j?void 0:j.lineItems)&&void 0!==c?c:[],g=await m({password:o,username:i});if(null==g?void 0:g.contextToken){_(g.contextToken),Z();let o=(null==n?void 0:n.redirectUrl)||p.H1.ACCOUNT_OVERVIEW,c=await (0,k.O)(y.V,E);if(c&&(I(c),l)){let e=JSON.parse(null!=l?l:"")||[];(0,t.zp)(e,E),localStorage.removeItem(w.n)}let m=!(null==c?void 0:c.company);if(T(m),f&&f.length>0)try{await P(E);let e=await (0,d.Z)({locale:C,contextToken:g.contextToken||""});(null==e?void 0:null===(v=e.lineItems)||void 0===v?void 0:v.length)||(e=await (0,u.Z)({lineItems:f,locale:C,contextToken:g.contextToken||""})),e&&N(e)}catch(e){(0,s.Z)(e,"Error while clearing cart during login")}return(0,r.Z)({user_id:null==c?void 0:c.id,event:"login",method:"login-method"}),i&&(0,a.O)(i,null==c?void 0:c.firstName,null==c?void 0:c.lastName),await e(Array.isArray(o)?o[0]:o),!0}}catch(e){return(0,s.Z)(e,"Error while logging in"),e}return null},[j,_,Z,null==n?void 0:n.redirectUrl,E,T,e,I,C,N])}},29282:function(e,n,l){l.d(n,{Lj:function(){return s},w6:function(){return b}});var i=l(38910),t=l(56112),o=l(96955),a=l(44958);let r={minPurchase:1,maxPurchase:200,purchaseSteps:1},u=(e,n)=>{var l;return(null==n?void 0:null===(l=n.find(n=>n.id===e))||void 0===l?void 0:l.name)||""},d=e=>e?{link:e.seoPathInfo,isCanonical:e.isCanonical,languageId:e.languageId}:{link:"",isCanonical:!1,languageId:""},c=e=>{switch(e){case"promotion":return"promotion";case"huebbundling":return"bundle";case"mixed_paint":return"mixedPaint";default:return"product"}},s=e=>{switch(e){case"promotion":return"promotion";case"bundle":return"huebbundling";case"mixedPaint":return"mixed_paint";default:return"product"}},v=e=>{var n,l;let{price:i,quantity:o,taxRules:a}=e;return{unitPrice:(0,t.GN)(null!=i?i:0,null!==(l=null==a?void 0:null===(n=a[0])||void 0===n?void 0:n.taxRate)&&void 0!==l?l:0),quantity:null!=o?o:0,listPrice:null,regulationPrice:null,discount:null,calculatedPrices:[]}},m=e=>{var n,l,i,o,a,r,u;let{price:d,quantity:c}=e,s=null!==(a=null===(l=d.calculatedTaxes)||void 0===l?void 0:null===(n=l[0])||void 0===n?void 0:n.taxRate)&&void 0!==a?a:0,v=(0,t.GN)(d.unitPrice,s),m=(null===(i=d.listPrice)||void 0===i?void 0:i.price)?(0,t.GN)(d.listPrice.price,s):null,p=(null===(o=d.regulationPrice)||void 0===o?void 0:o.price)?(0,t.GN)(d.regulationPrice.price,s):null,f=null!==(r=(0,t.$R)(d.listPrice,s,c))&&void 0!==r?r:(0,t.$R)(d.regulationPrice,s,c);return{unitPrice:v,quantity:null!==(u=null==d?void 0:d.quantity)&&void 0!==u?u:0,listPrice:m,regulationPrice:p,discount:f,calculatedPrices:[]}},p=e=>e?{colorId:e.colorId,colorCollectionId:e.colorCollectionId,code:e.code,name:e.name,colorHexCode:e.rgb}:null,f=e=>Object.entries(e).filter(e=>{let[n]=e;return"apiAlias"!==n}).map(e=>{let[n,l]=e;return l}),y=(e,n,l)=>{var t,s,m,y,g,b,h,x,I,P,k,w,Z,_,R;let C=n||null,T=d({seoPathInfo:null!==(y=e.payload.seoPathInfo)&&void 0!==y?y:"",isCanonical:!1,languageId:""}),j=c(e.type),N=(0,o.X)({customFields:e.payload.customFields,unitPrice:null!==(g=null===(t=e.priceDefinition)||void 0===t?void 0:t.price)&&void 0!==g?g:0,stock:null!==(b=e.payload.stock)&&void 0!==b?b:0}),E={price:e.unitPrice,quantity:null!==(h=null==e?void 0:e.quantity)&&void 0!==h?h:0,taxRules:[{taxRate:0}]},q=v(!(0,a.Q)(e.priceDefinition)&&e.priceDefinition?e.priceDefinition:E),D=e.cover?{media:e.cover}:null,L=(0,i.wy)(D,{alt:e.label}),O=p(e.payload.mixedPaint),U=null!==(x=e.quantityInformation)&&void 0!==x?x:r,A=null==C?void 0:C.find(e=>"bundle_discount"===e.name),F=null!==(I=null==A?void 0:A.bundleDiscount)&&void 0!==I?I:null,G=null!==(P=e.payload.manufacturerId)&&void 0!==P?P:"",Q=u(G,l),S=(null===(s=e.extensions)||void 0===s?void 0:s.labels)?f(null===(m=e.extensions)||void 0===m?void 0:m.labels):null,V=null!==(k=null==e?void 0:e.quantity)&&void 0!==k?k:0,z="bundle_discount"===e.label?{gross:q.unitPrice.gross,net:q.unitPrice.net}:{gross:q.unitPrice.gross*V,net:q.unitPrice.net*V};return{id:e.id,productId:null!==(w=e.referencedId)&&void 0!==w?w:"no-product-id-for-".concat(e.id),name:e.label,seoUrl:T,type:j,sku:null!==(Z=e.payload.productNumber)&&void 0!==Z?Z:"",lineItemQuantity:V,manufacturer:{id:G,name:Q},isRemovable:e.removable,availability:N,price:q,totalPrice:z,quantityInformation:U,cover:L,categoryIds:null!==(_=e.payload.categoryIds)&&void 0!==_?_:[],mixedPaint:O,bundleProducts:C,bundleDiscount:F,isRemoved:null!==(R=e.isRemoved)&&void 0!==R&&R,marketingLabels:S||null}},g=(e,n,l)=>{var a,s,v,y,g,b,h,x,I,P,k,w,Z,_,R,C;let T=n||null,j=d(null===(a=e.extensions)||void 0===a?void 0:a.seoUrl),N=c((null===(s=e.payload.mixedPaint)||void 0===s?void 0:s.colorId)?"mixed_paint":e.type),E=(0,o.X)({customFields:e.payload.customFields,unitPrice:e.price.unitPrice,stock:null!==(h=e.payload.stock)&&void 0!==h?h:0}),q=m(e),D=e.cover?{media:e.cover}:null,L=(0,i.wy)(D,{alt:e.label}),O=p(e.payload.mixedPaint),U=null!==(x=e.quantityInformation)&&void 0!==x?x:r,A=null==T?void 0:T.find(e=>"bundle_discount"===e.name),F=null!==(I=null==A?void 0:A.bundleDiscount)&&void 0!==I?I:null,G=(0,t.GN)(e.price.totalPrice,null!==(P=null===(y=e.price.calculatedTaxes)||void 0===y?void 0:null===(v=y[0])||void 0===v?void 0:v.taxRate)&&void 0!==P?P:0),Q=null!==(k=e.payload.manufacturerId)&&void 0!==k?k:"",S=u(Q,l),V=(null===(g=e.extensions)||void 0===g?void 0:g.labels)?f(null===(b=e.extensions)||void 0===b?void 0:b.labels):null;return{id:e.id,productId:null!==(w=e.referencedId)&&void 0!==w?w:"no-product-id-for-".concat(e.id),name:e.label,seoUrl:j,type:N,sku:null!==(Z=e.payload.productNumber)&&void 0!==Z?Z:"",lineItemQuantity:null!==(_=null==e?void 0:e.quantity)&&void 0!==_?_:0,manufacturer:{id:Q,name:S},isRemovable:e.removable,availability:E,price:q,totalPrice:G,quantityInformation:U,cover:L,categoryIds:null!==(R=e.payload.categoryIds)&&void 0!==R?R:[],mixedPaint:O,bundleProducts:T,bundleDiscount:F,isRemoved:null!==(C=e.isRemoved)&&void 0!==C&&C,marketingLabels:V||null}},b=(e,n)=>{var l,i,t,o;let a=null;return"order_line_item"===e.apiAlias?((null===(i=e.children)||void 0===i?void 0:i.length)&&(a=null===(t=e.children)||void 0===t?void 0:t.map(e=>y(e,null,n.manufacturers))),y(e,a,n.manufacturers)):((null===(l=e.children)||void 0===l?void 0:l.length)&&(a=null===(o=e.children)||void 0===o?void 0:o.map(e=>g(e,null,n.manufacturers))),g(e,a,n.manufacturers))}},77536:function(e,n,l){var i=l(85893),t=l(11752),o=l.n(t),a=l(9008),r=l.n(a),u=l(11163),d=l(78462),c=l(81913),s=l(46909),v=l(36830),m=l(24645);n.Z=function(e){let{page:{seoTitle:n,seoDescription:l}={},children:t=null}=e,{publicRuntimeConfig:a}=o()(),{locale:p,locales:f,asPath:y}=(0,u.useRouter)(),g=(0,v.Z)(),b=(0,s.V)(a.brand),h=!a.genesys.v2;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r(),{children:[(0,i.jsx)("title",{children:n||g("default.page.title")}),(0,i.jsx)("meta",{name:"description",content:l}),(0,i.jsx)("meta",{name:"robots",content:"index, follow"}),(0,i.jsx)("link",{rel:"icon",href:b.favicon.ico,sizes:"any"}),b.favicon.svg&&(0,i.jsx)("link",{rel:"icon",href:b.favicon.svg,type:"image/svg+xml"}),f&&f.filter(e=>e!==p).map(e=>{let n=(0,m.n)({languageCode:e,path:y});return(0,i.jsx)("link",{rel:"alternate",hrefLang:e,href:n},"default-link-".concat(e))})]}),(0,i.jsx)(d.PQ,{children:t}),h&&(0,i.jsx)(c.Z,{})]})}}}]);