PageSourceSearch

https://www.braunhousehold.com/mobify/bundle/276/pages-cart.js

js braunhousehold.com collected 2026-09-24 18:32:16 UTC 116,169 bytes, 2 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[5788],{2140:(e,t,n)=>{n.d(t,{k:()=>i});var r=n(28407),a=n(77810),l=n(90031),o=n(7711);const i=({basket:e,onValidationFail:t,redirectAfterClear:n}={})=>{const i=(0,o.A)(),u=(0,l.useShopperBasketsMutation)("removeItemFromBasket"),[c,d]=(0,a.useState)(!1);return{validateWarrantyBeforeAction:(0,a.useCallback)((()=>{const{ok:n,errors:r}=(e=>{const t=[],n=[],r=(null==e?void 0:e.productItems)||[];if(!r.length)return{ok:!0,errors:t,itemsToRemove:[]};r.forEach((e=>{if(e.c_isWarranty&&!e.c_UUIDWarranty){const r=`Warranty item ${e.productId} is missing required UUIDWarranty`;t.push(r),n.push({productId:e.productId,uuid:null})}}));const a={};return r.forEach((e=>{const t=e.c_UUIDWarranty;t&&(a[t]||(a[t]=[]),a[t].push(e))})),Object.entries(a).forEach((([e,r])=>{if(2!==r.length){const a=`UUID ${e} must have exactly one product and one warranty`;return t.push(a),void r.forEach((t=>{n.push({productId:t.productId,uuid:e})}))}const a=r.some((e=>!e.c_isWarranty)),l=r.some((e=>e.c_isWarranty));if(!a||!l){const a=`UUID ${e} must have both a product and a warranty`;return t.push(a),void r.forEach((t=>{n.push({productId:t.productId,uuid:e})}))}r.forEach((r=>{if(1!==r.quantity){const a=`${r.c_isWarranty?"warranty":"product"} quantity must be 1 (UUID ${e})`;t.push(a),n.push({productId:r.productId,uuid:e})}}))})),{ok:0===t.length,errors:t,itemsToRemove:n}})(e);return!!n||(console.error("Warranty consistency validation failed:",r),null==t||t(),!1)}),[e,t]),clearBasket:(0,a.useCallback)((0,r.A)((function*(){if(null!=e&&e.basketId){d(!0);try{const t=(null==e?void 0:e.productItems)||[];yield Promise.all(t.map((t=>u.mutateAsync({parameters:{basketId:e.basketId,itemId:t.itemId}}).catch((e=>{console.warn("Error removing basket item:",t.itemId,e)}))))),n&&i(n)}finally{d(!1)}}})),[e,u,n,i]),isClearingBasket:c}}},81308:(e,t,n)=>{n.d(t,{A:()=>h});var r=n(64180),a=n(18801),l=n(77810),o=n(17015),i=n(73352),u=n(60097),c=n(75011),d=n(73295),s=n(28387),m=n(45915),p=n(36287),v=n(40133),y=n(25635),f=n(75826),b=n.n(f);const E=["title","description","optionalText","isOpen","onAlternateAction"],g=e=>{let{title:t,description:n,optionalText:f,isOpen:b,onAlternateAction:g=o.lQ}=e,h=(0,a.A)(e,E);const I=(0,i.Vl)("ConfirmationModal"),_=()=>{g()};return l.createElement(u.L,(0,r.A)({isOpen:b,isCentered:!0,onClose:_},h),l.createElement(c.m,null),l.createElement(u.E,null,l.createElement(d.s,{"data-testid":"close-icon",onClick:_}),l.createElement(s.c,null,l.createElement(m.s,I.container,l.createElement(p.az,I.iconContainer,l.createElement(y.AlertIcon,I.alertIcon)),l.createElement(m.s,I.textContainer,l.createElement(v.E,(0,r.A)({},I.text,{textStyle:"body-xlarge"}),t),l.createElement(v.E,(0,r.A)({},I.text,{textStyle:"body-medium"}),n),f&&l.createElement(v.E,(0,r.A)({},I.text,{textStyle:"body-xsmall"}),f))))))};g.propTypes={title:b().string,description:b().string,optionalText:b().string,isOpen:b().bool,onAlternateAction:b().func};const h=g},88737:(e,t,n)=>{n.d(t,{A:()=>g});var r=n(64180),a=n(18801),l=n(77810),o=n(75826),i=n.n(o),u=n(41863),c=n(73352),d=n(36287),s=n(40133),m=n(14893),p=n(58493),v=n(70987),y=n(52668),f=n(68066);const b=["form","prefix"],E=e=>{let{form:t,prefix:n=""}=e,o=(0,a.A)(e,b);const i=(0,v.A)({form:t,prefix:n}),E=(0,c.o5)("OrderSummary",{}),{locale:g}=(0,f.A)(),{promoCode:h}=E,I=t.watch("code");return l.createElement(d.az,(0,r.A)({},null==h?void 0:h.inputContainer,{"aria-labelledby":"code-feedback"},o),l.createElement(s.E,null==h?void 0:h.inputContainerHeader,l.createElement(u.A,{id:"use_promo_code_fields.label.promo_code",defaultMessage:[{type:0,value:"Promo Code"}]})),l.createElement(y.A,(0,r.A)({inputProps:null==h?void 0:h.inputProps},i.code,{shouldDisplaySuccess:!1,enableMcpContainer:!0}),l.createElement(m.$,(0,r.A)({type:"submit"},null==h?void 0:h.applyButton,{isLoading:t.formState.isSubmitting,disabled:(null==I?void 0:I.length)<3}),l.createElement(u.A,{defaultMessage:[{type:0,value:"Apply"}],id:"promo_code_fields.button.apply"}))),"en-gb"===(null==g?void 0:g.alias)&&l.createElement(p.N,(0,r.A)({},null==h?void 0:h.referralLink,{href:"https://mention-me.com/me/referee/referee_search_integration/mm0dcc4f72/9ea2fa82715022d3a1a5ec2243323ec7f5d4e5d0/p/checkout?implementation=link&locale=en_GB",isExternal:!0}),l.createElement(s.E,null,l.createElement(u.A,{defaultMessage:[{type:0,value:"Been referred by a friend?"}],id:"promo_code_fields.referral_link"}))))};E.propTypes={form:i().object.isRequired,prefix:i().string};const g=E},82990:(e,t,n)=>{n.d(t,{A:()=>Ae});var r=n(28407),a=n(13682),l=n(18801),o=n(68175),i=n(64180),u=n(77810),c=n(75826),d=n.n(c),s=n(34692),m=n(41863),p=n(16602),v=n(73352),y=n(36287),f=n(40133),b=n(75712),E=n(45915),g=n(86400),h=n(64194),I=n(78539),_=n(70482),A=n(14893),k=n(49785),C=n(88737),O=n(90031),P=n(54957);const S=()=>{const{formatMessage:e}=(0,s.A)(),{data:t}=(0,P.X)(),n=(0,k.mN)(),a=(0,O.useShopperBasketsMutation)("addCouponToBasket"),l=(0,O.useShopperBasketsMutation)("removeCouponFromBasket"),o=function(){var l=(0,r.A)((function*({code:r}){try{yield a.mutateAsync({parameters:{basketId:null==t?void 0:t.basketId},body:{code:r}}),n.reset({code:""})}catch(t){n.setError("code",{type:"manual",message:e({defaultMessage:[{type:0,value:"Check the code and try again, it may already be applied or the promo has expired."}],id:"use_promocode.error.check_the_code"})},{shouldFocus:!0})}}));return function(e){return l.apply(this,arguments)}}();return{form:n,submitPromoCode:o,removePromoCode:function(){var e=(0,r.A)((function*(e){l.mutate({parameters:{basketId:null==t?void 0:t.basketId,couponItemId:e}})}));return function(t){return e.apply(this,arguments)}}()}},w=({form:e,submitPromoCode:t})=>{const n=(0,v.o5)("OrderSummary",{}),{promo:r}=n;return u.createElement(y.az,(0,i.A)({},null==r?void 0:r.promoContainer,{"data-testid":"promo-code-form",as:"form",onSubmit:e.handleSubmit(t)}),u.createElement(C.A,{form:e}))};w.propTypes={form:d().object.isRequired,submitPromoCode:d().func.isRequired,itemProps:d().object,promoStyle:d().object};var M=n(77054),x=n(52668);const T=["form","prefix"];function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?j(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const D=e=>{var t,n;let{form:r,prefix:a=""}=e,o=(0,l.A)(e,T);const c=function({form:{control:e,formState:{errors:t}},prefix:n=""}){const{formatMessage:r}=(0,s.A)();return{code:{name:`${n}code`,label:r({defaultMessage:[{type:0,value:"Zip Code"}],id:"use_zip_code_zipcode.label.zip_code"}),type:"text",defaultValue:"",rules:{required:r({defaultMessage:[{type:0,value:"Please provide a valid zip code."}],id:"use_zip_code_fields.error.required_zip_code"})},error:t[`${n}code`],control:e,dataCsMask:!0}}}({form:r,prefix:a}),d=(0,v.o5)("OrderSummary",{}),{zipCode:p}=d,f=r.watch("code"),{formatMessage:b}=(0,s.A)(),E=b({defaultMessage:[{type:0,value:"Zip Code"}],id:"use_zip_code_zipcode.label.zip_code"});return u.createElement(y.az,(0,i.A)({},null===(t=d.zipCode)||void 0===t?void 0:t.zipInputContainer,{"aria-labelledby":"code-feedback"},o),u.createElement(M.s6,{as:"label",htmlFor:"code"},E),u.createElement(x.A,(0,i.A)({inputProps:z(z({},(null==p?void 0:p.zipCodeInput)||{}),{},{"aria-label":E})},c.code,{shouldDisplaySuccess:!1}),u.createElement(A.$,(0,i.A)({type:"submit"},null===(n=d.promoCode)||void 0===n?void 0:n.applyButton,{isLoading:r.formState.isSubmitting,disabled:(null==f?void 0:f.length)<3}),u.createElement(m.A,{defaultMessage:[{type:0,value:"Apply"}],id:"zip_code_fields.button.apply"}))))};D.propTypes={form:d().object.isRequired,prefix:d().string};const B=D;var F=n(68066),q=n(11117),N=n(25635);const L=()=>{const{site:e,locale:t}=(0,F.A)(),{formatMessage:n}=(0,s.A)(),{data:a}=(0,P.X)(),l=(0,k.mN)(),{l10n:o}=e,i=t.preferredCurrency||o.defaultCurrency,u=(0,O.useShopperBasketsMutation)("updateBasket"),c=function(){var e=(0,r.A)((function*({code:e}){try{const t=yield u.mutateAsync({parameters:{basketId:a.basketId},body:{currency:i,c_zipCodePreview:e}});return l.reset({code:e}),!(!t||null==t||!t.c_taxPreviewAmount)||(l.setError("code",{type:"manual",message:n({defaultMessage:[{type:0,value:"Check the code and try again."}],id:"use_zipcode.error.check_the_code"})},{shouldFocus:!0}),!1)}catch(e){return l.setError("code",{type:"manual",message:n({defaultMessage:[{type:0,value:"Check the code and try again."}],id:"use_zipcode.error.check_the_code"})},{shouldFocus:!0}),!1}}));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=(0,r.A)((function*(){try{yield u.mutateAsync({parameters:{basketId:null==a?void 0:a.basketId},body:{currency:i,c_taxPreviewAmount:null}})}catch(e){l.setError("code",{type:"manual",message:n({defaultMessage:[{type:0,value:"Check the code and try again."}],id:"use_zipcode.error.check_the_code"})},{shouldFocus:!0})}}));return function(){return e.apply(this,arguments)}}();return{form:l,submitZipCode:c,removeZipCode:d}},R=({form:e,submitZipCode:t,removeZipCode:n,basket:a,step:l})=>{var o;const c=(0,v.o5)("OrderSummary",{}),{formatMessage:d}=(0,s.A)(),{zipCode:p}=c,[y,b]=(0,u.useState)(!0),g=l||null,I=function(){var e=(0,r.A)((function*(e){const n=yield t(e);b(!n)}));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=(0,r.A)((function*(e){yield n(e),b(!0)}));return function(t){return e.apply(this,arguments)}}();return u.createElement(h.z,(0,i.A)({},null==p?void 0:p.zipCodeContainer,{"data-testid":"zip-code-form",as:"form",gap:"xsmall.base",onSubmit:e.handleSubmit(I)}),u.createElement(E.s,null==p?void 0:p.zipCodeInfoContainer,u.createElement(f.E,null==p?void 0:p.zipCodeText,u.createElement(m.A,{id:"use_zip_code_fields.label.zip_code",defaultMessage:[{type:0,value:"Tax"}]})),u.createElement(q.A,{variant:"top-right",trigger:u.createElement(N.InfoIcon,(0,i.A)({},null==c||null===(o=c.subtotalSection)||void 0===o?void 0:o.infoIcon,{"aria-hidden":"true",tabIndex:0,focusable:"true"})),openTooltipOn:"hover",title:d({id:"order_summary.taxPreview.info.title",defaultMessage:[{type:0,value:"Tax Preview Information"}]}),description:d({id:"order_summary.taxPreview.info.description",defaultMessage:[{type:0,value:"Tax estimation based on zip code."}]})})),y&&3!==g&&4!==g?u.createElement(B,{form:e}):u.createElement(E.s,(0,i.A)({},null==p?void 0:p.zipCodeEditContainer,{as:"form",onSubmit:e.handleSubmit(n)}),g&&1!==g&&2!==g?u.createElement(f.E,null,null==a?void 0:a.c_avalaraTaxAmount):u.createElement(u.Fragment,null,u.createElement(f.E,null==p?void 0:p.zipCodeText,null==a?void 0:a.c_taxPreviewAmount),u.createElement(A.$,(0,i.A)({},null==p?void 0:p.zipCodeEdit,{isLoading:e.formState.isSubmitting,onClick:()=>_()}),u.createElement(N.EditIcon,null==p?void 0:p.zipCodeEditIcon)))))};function W(e){const{form:t,submitZipCode:n,removeZipCode:r}=L(),{basket:a}=(0,P.X)();return u.createElement(R,(0,i.A)({form:t,submitZipCode:n,removeZipCode:r,basket:a},e))}R.propTypes={form:d().object.isRequired,submitZipCode:d().func.isRequired,removeZipCode:d().func.isRequired,itemProps:d().object,promoStyle:d().object,basket:d().object,step:d().any};var U=n(64965),$=n(70581),G=n(38321),V=n(24961),H=n(26069),Q=n(53302),K=n(74941),Y=n(45456);const X=["includeQuantity","currency","includeVariables","associatedWarranty"];function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?Z(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ee=e=>{var t,n,r,a,o,c;let{includeQuantity:d,currency:v,includeVariables:b=!0,associatedWarranty:h=null}=e,I=(0,l.A)(e,X);const _=(0,$.e)(),{data:A}=(0,P.X)(),{currency:k}=(0,Q.H2)(),C=null==_||null===(t=_.priceAdjustments)||void 0===t?void 0:t.filter((e=>"weeeFee"!==(null==e?void 0:e.promotionId))),S=(null==C?void 0:C.map((e=>e.promotionId)))??[],w=(0,s.A)(),{data:M}=(0,O.usePromotions)({parameters:{ids:S.join(",")}},{enabled:S.length>0}),x=(null==M?void 0:M.data)||[],T=(0,K.mx)(null==_?void 0:_.variationAttributes,null==_?void 0:_.variationValues),j=(null==_||null===(n=_.bundledProductItems)||void 0===n?void 0:n.map((({productId:e})=>e)).join(","))??"",{data:z,isLoading:D}=(0,O.useProducts)({parameters:{ids:j,expand:["availability","images"]},headers:{"x-debug":"item-attr-index"}},{enabled:Boolean((null==_||null===(r=_.type)||void 0===r?void 0:r.bundle)&&j),select:e=>{var t;return null==e||null===(t=e.data)||void 0===t?void 0:t.map((e=>{var t;const n=null==_||null===(t=_.bundledProductItems.find((t=>t.productId===e.id)))||void 0===t?void 0:t.quantity;return J(J({},e),{},{quantity:n,variationValues:(0,K.mx)(null==e?void 0:e.variationAttributes,null==e?void 0:e.variationValues)})}))}}),{data:B,isLoading:F}=(0,O.useProduct)({parameters:{id:null==_?void 0:_.id,allImages:!1,currency:v||(null==A?void 0:A.currency)||k}},{enabled:Boolean((null==_||null===(a=_.type)||void 0===a?void 0:a.bundle)&&!j)}),q=(0,Y.gV)(null==h?void 0:h.c_serviceGroupName,null==h?void 0:h.c_serviceDuration,w.formatMessage);return u.createElement(g.B,(0,i.A)({spacing:1.5,flex:1},I),b&&T&&(null===(o=Object.keys(T))||void 0===o?void 0:o.map((e=>u.createElement(f.E,{key:`${e}: ${T[e]}`},e,": ",T[e])))),d&&u.createElement(f.E,null,u.createElement(m.A,{defaultMessage:[{type:0,value:"Quantity: "},{type:1,value:"quantity"}],values:{quantity:_.quantity},id:"item_attributes.label.quantity"})),!F&&B&&!z&&u.createElement(y.az,null,null==B||null===(c=B.bundledProducts)||void 0===c?void 0:c.map((({product:e,quantity:t})=>u.createElement(y.az,{marginTop:2,key:e.id},u.createElement(f.E,{as:"b"},(null==e?void 0:e.c_variantIdentifier)||(null==e?void 0:e.name)||(null==e?void 0:e.productName)),u.createElement(f.E,null,w.formatMessage({defaultMessage:[{type:0,value:"Qty"}],id:"add_to_cart_modal.label.quantity"}),": ",t))))),!D&&z&&u.createElement(y.az,null,u.createElement(f.E,{fontSize:15,marginTop:3,fontWeight:"medium"},w.formatMessage({defaultMessage:[{type:0,value:"Selected Options"}],id:"item_attributes.label.selected_options"}),":"),null==z?void 0:z.map((({variationValues:e,name:t,quantity:n,id:r})=>{var a;return u.createElement(y.az,{key:r,marginTop:2},u.createElement(f.E,{as:"b"},t),u.createElement(f.E,null,w.formatMessage({defaultMessage:[{type:0,value:"Qty"}],id:"add_to_cart_modal.label.quantity"}),": ",n),null===(a=Object.keys(e))||void 0===a?void 0:a.map((t=>{const n=`${t}: ${e[t]}`;return u.createElement(f.E,{key:n},n)})))}))),(null==C?void 0:C.length)>0&&u.createElement(E.s,{alignItems:"center"},u.createElement(f.E,{lineHeight:1,color:"gray.700",fontSize:"sm"},u.createElement(m.A,{defaultMessage:[{type:0,value:"Promotions"}],id:"item_attributes.label.promotions"}),": ",u.createElement(f.E,{as:"span",color:"green.700"},u.createElement(p.Gr,{style:"currency",currency:v||(null==A?void 0:A.currency)||k,value:C.reduce(((e,t)=>e+(t.price??0)),0)}))),u.createElement(H.A,{ml:2},u.createElement(g.B,null,null==x?void 0:x.map((e=>u.createElement(f.E,{key:null==e?void 0:e.id,fontSize:"sm"},null==e?void 0:e.calloutMsg)))))),h&&u.createElement(u.Fragment,null,u.createElement(f.E,{as:"span",fontWeight:"bold"},"+ ",q)," ",u.createElement(f.E,{as:"span",fontWeight:"bold",ml:"1"},u.createElement(p.Gr,{style:"currency",currency:null==A?void 0:A.currency,value:h.price||0}))))};ee.propTypes={includeQuantity:d().bool,includeVariables:d().bool,currency:d().string,associatedWarranty:d().object};const te=ee;n(55981);var ne=n(18809);const re=()=>u.createElement(y.az,{w:"100%3rem",h:"0.125rem",bg:"white",marginX:"-1.5rem"});var ae=n(45957),le=n(58987),oe=n(35597),ie=n(68644),ue=n(88530),ce=n(28467);const de=({variant:e,basket:t,isEstimate:n=!1,isVATFlag:r})=>{var a,l,o,c,d,s;const b=(0,v.o5)("OrderSummary",{variant:e});return u.createElement(y.az,null,u.createElement(y.az,(0,i.A)({},null==b||null===(a=b.checkoutSection)||void 0===a?void 0:a.checkoutContainer,null==b||null===(l=b.checkoutSection)||void 0===l?void 0:l.checkoutTotalContainer),n?u.createElement(E.s,null,u.createElement(f.E,null==b||null===(o=b.checkoutSection)||void 0===o?void 0:o.totalText,u.createElement(m.A,{defaultMessage:[{type:0,value:"TOTAL"}],id:"order_summary.label.estimated_total"})),u.createElement(f.E,null==b||null===(c=b.checkoutSection)||void 0===c?void 0:c.vatInCheckoutButton,r&&u.createElement(oe.A,{textStyle:"body-xxsmall",amount:null==t?void 0:t.taxTotal,hideVatRate:!0}))):u.createElement(f.E,null==b||null===(d=b.checkoutSection)||void 0===d?void 0:d.totalText,u.createElement(m.A,{defaultMessage:[{type:0,value:"Order Total"}],id:"order_summary.label.order_total"})),u.createElement(f.E,null==b||null===(s=b.checkoutSection)||void 0===s?void 0:s.totalText,u.createElement(p.Gr,{style:"currency",currency:null==t?void 0:t.currency,value:(null==t?void 0:t.orderTotal)||(null==t?void 0:t.productTotal)}))))};de.propTypes={basket:d().object,variant:d().string,isEstimate:d().bool,fontSize:d().oneOf(["xs","sm","md","lg","xl"]),isVATFlag:d().bool};const se=de;var me=n(7711),pe=n(32120),ve=n(87916),ye=n(58884),fe=n(67358),be=n(50415);const Ee=["removePromoCode"];function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function he(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ge(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ie=({basket:e,productsByItemId:t})=>{var n,r,a;const l=(null==e||null===(n=e.productItems)||void 0===n?void 0:n.reduce(((e,t)=>e+t.quantity),0))||0,o=(0,U.useLocation)(),{isCart:c}=(0,ie.A)().currentPage(o.pathname),{formatMessage:d}=(0,s.A)(),p=(0,v.o5)("OrderSummary",{basketLength:null==e||null===(r=e.productItems)||void 0===r?void 0:r.length}),h=null!=e&&e.c_allSubscriptionsDetails?JSON.parse(e.c_allSubscriptionsDetails):{};return u.createElement(y.az,{sx:p.cartItems.container},c&&u.createElement(f.E,p.cartItems.itemsText,u.createElement(m.A,{defaultMessage:[{type:0,value:"Items ("},{type:1,value:"totalItems"},{type:0,value:")"}],id:"order_summary.cart_items.link.items_in_cart",values:{totalItems:l}})),Object.entries(h).map((([e,t])=>u.createElement(y.az,(0,i.A)({key:e},p.cartItems.itemsContainer),u.createElement(ye.A,{details:t,variant:"subscriptionsOrderSummary"}),u.createElement(b.c,{mt:"medium.base"})))),null===(a=e.productItems)||void 0===a?void 0:a.filter((e=>!e.c_isWarranty)).map(((n,r)=>{var a;if("true"===(null==n?void 0:n.c_isSubscription))return;const l=he(he(he({},n),t&&t[n.itemId]),{},{price:null==n?void 0:n.price,quantity:null==n?void 0:n.quantity}),o=(0,be.Ke)(l),c=(0,be.Kp)(l,d.locale||"it-IT"),s=null==e||null===(a=e.productItems)||void 0===a?void 0:a.find((e=>!0===e.c_isWarranty&&e.c_UUIDWarranty===n.c_UUIDWarranty)),v=(o.isPreorder||o.isBackorder)&&c;return u.createElement(y.az,(0,i.A)({key:r},p.cartItems.itemsContainer),u.createElement($.A,{index:r,variant:l},u.createElement(E.s,p.cartItems.innerItemContainer,u.createElement(G.A,{imageProps:{width:"6.8125rem"},boxWidth:"6.8125rem",minWidth:"6.8125rem"}),u.createElement(g.B,p.cartItems.stack,u.createElement(V.A,p.cartItems.itemVariant),v&&u.createElement(f.E,{textStyle:"body-xsmall",fontWeight:"normal",color:"text.default"},u.createElement(m.A,{id:"order_summary.message.available_from",defaultMessage:[{type:0,value:"This item will be available from "},{type:1,value:"date"}],values:{date:u.createElement(f.E,{as:"span",fontWeight:"bold"},c)}})),u.createElement(E.s,p.cartItems.stackContent,u.createElement(ne.A,{currency:null==e?void 0:e.currency,styles:{},direction:"row",showOmnibusLabel:!1,styleVariant:"checkout"}),u.createElement(te,(0,i.A)({includeQuantity:!0,includeVariables:!1,associatedWarranty:s},p.cartItems.itemVariantAttributes)))))),u.createElement(b.c,{mt:"medium.base"}))})))};Ie.propTypes={basket:d().object,productsByItemId:d().object};const _e=({basket:e,showCartItems:t=!1,isEstimate:n=!1,showPromoCodeForm:o=!0,variant:c,productsByItemId:d,handleUnavailableProducts:b,showSubscriptionsCheck:k=!1,step:C,validateWarrantyBeforeAction:P})=>{var M,x,T,j,z,D,B,R,$,G,V,H,Q,K,Y,X,Z,J,ee,te,ne,de,ye,ge,he,_e,Ae,ke,Ce,Oe,Pe,Se;const we=S(),{removePromoCode:Me}=we,xe=(0,l.A)(we,Ee),Te=L(),je=(0,i.A)({},((0,a.A)(Te),Te)),ze=(0,v.o5)("OrderSummary",{variant:c}),De=(0,U.useLocation)(),Be=(0,ce.I8)("showVATFlag"),Fe=(0,ce.I8)("avalaraStorefrontPreference"),qe=null!==Fe&&Fe,Ne=(0,me.A)(),{formatMessage:Le}=(0,s.A)(),[Re,We]=(0,u.useState)(!1),[Ue,$e]=(0,u.useState)(!1),Ge=(0,u.useRef)(null),Ve=(null==e||null===(M=e.c_additionalData)||void 0===M?void 0:M.allBundlesDetails)||{},{locale:He}=(0,F.A)(),{refetch:Qe}=(0,O.useProducts)({parameters:{ids:null==e||null===(x=e.productItems)||void 0===x?void 0:x.map((e=>e.productId)).join(","),allImages:!1},headers:{"x-debug":"order-summary-index"}},{enabled:!1}),Ke=(null==e||null===(T=e.productItems)||void 0===T?void 0:T.reduce(((e,t)=>(t.priceAdjustments&&e.push(...t.priceAdjustments.filter((e=>{var t;return!(null!==(t=e.promotionId)&&void 0!==t&&t.startsWith("bundle"))}))),e)),[]))??[],Ye=Ke.filter((e=>"weeeFee"===e.promotionId)).reduce(((e,t)=>e+t.price),0),Xe=[...Ke??[],...(null==e?void 0:e.orderPriceAdjustments)??[]],Ze=Xe.map((e=>null==e?void 0:e.promotionId)),{data:Je}=(0,O.usePromotions)({parameters:{ids:Ze.join(",")}},{enabled:Ze.length>0}),{isCart:et,isCheckout:tt}=(0,ie.A)().currentPage(De.pathname),nt=(null==e||null===(j=e.productItems)||void 0===j?void 0:j.filter((e=>e.c_isWarranty)))||[],rt=(null==nt?void 0:nt.length)>0?null==nt?void 0:nt.reduce(((e,t)=>e+t.price),0):null;if(!(null!=e&&e.basketId||null!=e&&e.orderNo))return null;const at=function(){var t=(0,r.A)((function*(){var t,n,r,a;if(k&&!Re)return $e(!0),void(null===(a=Ge.current)||void 0===a||a.scrollIntoView({behavior:"smooth",block:"center"}));if(P&&!P())return;const l=null==e||null===(t=e.productItems)||void 0===t?void 0:t.map((e=>e.productId)),o=yield Qe(),i=[],u=[];null==o||null===(n=o.data)||void 0===n||null===(r=n.data)||void 0===r||r.forEach((t=>{i.push(t.id);const n=e.productItems.find((e=>e.productId===t.id)),r=!(null==n||!n.type),a=(0,be.Ke)(t),l=null==a?void 0:a.isPreorder,o=null==a?void 0:a.isBackorder;var c,d;r||l||o||(null===(c=t.inventory)||void 0===c||!c.orderable||null!==(d=t.inventory)&&void 0!==d&&d.orderable&&n.quantity>t.inventory.stockLevel)&&u.push(t.id)}));const c=l.filter((e=>!i.includes(e)||u.includes(e)));c.length>0?b(c):Ne("/checkout")}));return function(){return t.apply(this,arguments)}}();return u.createElement(y.az,null==ze?void 0:ze.orderSummaryBox,et&&u.createElement(u.Fragment,null,k&&u.createElement(y.az,null==ze?void 0:ze.subscriptionsContainer,u.createElement(E.s,{ref:Ge},u.createElement(y.az,null,u.createElement(pe.A,{variant:"secondary",onChange:e=>{We(e.target.checked),$e(!1)},isError:Ue})),u.createElement(E.s,null==ze?void 0:ze.subscriptionsTextsContainer,u.createElement(f.E,null==ze?void 0:ze.subscriptionsText,u.createElement(m.A,{id:"order_summary.subscriptions.accept_text",defaultMessage:[{type:0,value:"I accept the"}]})),u.createElement(ve.A,{to:`${null==He?void 0:He.saleTermsAndConditions}`},u.createElement(f.E,null==ze?void 0:ze.subscriptionsLink,u.createElement(m.A,{id:"order_summary.subscriptions.accept_link",defaultMessage:[{type:0,value:"terms and conditions of sale"}]}))))),Ue&&u.createElement(f.E,null==ze?void 0:ze.errorText,u.createElement(m.A,{id:"order_summary.subscriptions.terms_error",defaultMessage:[{type:0,value:"*Obbligatory field"}]}))),o?u.createElement(y.az,{w:"full"},u.createElement(w,xe)):u.createElement(g.B,ze.promo.promoContainer,u.createElement(f.E,ze.promoCode.inputContainerHeader,u.createElement(m.A,{id:"use_promo_code_fields.label.promo_code",defaultMessage:[{type:0,value:"Promo Code"}]})),(null==e||null===(z=e.couponItems)||void 0===z?void 0:z.length)>0&&u.createElement(E.s,ze.promoCode.textContainer,u.createElement(E.s,ze.promoCode.couponSuccessContainer,u.createElement(N.CheckIcon,ze.promoCode.couponSuccessIcon),u.createElement(f.E,null==ze||null===(D=ze.promoCode)||void 0===D?void 0:D.textCoupon,u.createElement(m.A,{id:"order_summary.coupon",defaultMessage:[{type:0,value:"Coupon"}]}),": ",null===(B=e.couponItems[0])||void 0===B?void 0:B.code)),!e.orderNo&&u.createElement(N.DeleteIcon,{cursor:"pointer",onClick:()=>{var t;return Me(null===(t=e.couponItems[0])||void 0===t?void 0:t.couponItemId)},"aria-label":Le({id:"order_summary.promo_code.remove.aria_label",defaultMessage:[{type:0,value:"Remove promo code"}]}),role:"button"})))),u.createElement(g.B,(0,i.A)({},null==ze?void 0:ze.summaryContainer,{"data-testid":"sf-order-summary"}),u.createElement(y.az,null==ze?void 0:ze.innerSummaryContainer,u.createElement(y.az,null==ze||null===(R=ze.summaryHeader)||void 0===R?void 0:R.itemContainer,u.createElement(f.E,(0,i.A)({},null==ze||null===($=ze.summaryHeader)||void 0===$?void 0:$.headerText,{id:"order-summary-heading"}),u.createElement(m.A,{defaultMessage:[{type:0,value:"Order Review"}],id:"order_summary.heading.order_review"}))),t&&et&&u.createElement(u.Fragment,null,u.createElement(re,null),u.createElement(Ie,{basket:e,productsByItemId:d}),u.createElement(re,null)),u.createElement(y.az,null==ze||null===(G=ze.subtotalSection)||void 0===G?void 0:G.subtotalContainer,u.createElement(h.z,null==ze||null===(V=ze.subtotalSection)||void 0===V?void 0:V.subtotalStackContainer,u.createElement(f.E,null==ze||null===(H=ze.subtotalSection)||void 0===H?void 0:H.subtotalText,u.createElement(m.A,{defaultMessage:[{type:0,value:"Subtotal"}],id:"order_summary.label.subtotal"})),u.createElement(f.E,null==ze||null===(Q=ze.subtotalSection)||void 0===Q?void 0:Q.subtotalText,u.createElement(p.Gr,{style:"currency",currency:null==e?void 0:e.currency,value:(e=>{let t=0;if(null!=e&&e.productItems)for(let r of e.productItems){var n;(null===(n=r.priceAdjustments)||void 0===n?void 0:n.some((e=>{var t;return"bonus"===(null===(t=e.appliedDiscount)||void 0===t?void 0:t.type)})))||(t+=r.price)}return t||0})(e)})))),u.createElement(I.T,null==ze||null===(K=ze.subtotalSection)||void 0===K?void 0:K.shippingContainer,u.createElement(h.z,null==ze||null===(Y=ze.subtotalSection)||void 0===Y?void 0:Y.subtotalStackContainer,u.createElement(h.z,null,u.createElement(f.E,null==ze||null===(X=ze.subtotalSection)||void 0===X?void 0:X.subtotalText,u.createElement(m.A,{defaultMessage:[{type:0,value:"Delivery"}],id:"order_summary.label.shipping"})),u.createElement(y.az,null==ze||null===(Z=ze.subtotalSection)||void 0===Z?void 0:Z.infoIconContainer,u.createElement(q.A,{variant:"top-right",trigger:u.createElement(N.InfoIcon,(0,i.A)({},null==ze||null===(J=ze.subtotalSection)||void 0===J?void 0:J.infoIcon,{"aria-hidden":"true",tabIndex:0,focusable:"true"})),openTooltipOn:"hover",title:Le({id:"order_summary.delivery.info.title",defaultMessage:[{type:0,value:"Delivery Information"}]}),description:Le({id:"order_summary.delivery.info.description",defaultMessage:[{type:0,value:"Delivery details and estimated arrival time"}]})}))),(null==e?void 0:e.shippingTotal)>
10?u.createElement(f.E,null==ze||null===(ee=ze.subtotalSection)||void 0===ee?void 0:ee.subtotalText,u.createElement(p.Gr,{value:e.shippingTotal,style:"currency",currency:null==e?void 0:e.currency})):u.createElement(f.E,null==ze||null===(te=ze.subtotalSection)||void 0===te?void 0:te.freeShippingText,u.createElement(m.A,{defaultMessage:[{type:0,value:"Free shipping"}],id:"order_summary.label.free_shipping"}))),u.createElement(fe.A,{basket:e,style:ze})),rt&&rt>0&&u.createElement(h.z,(0,i.A)({},null==ze||null===(ne=ze.subtotalSection)||void 0===ne?void 0:ne.subtotalStackContainer,{paddingTop:"0.5rem"}),u.createElement(f.E,null==ze||null===(de=ze.subtotalSection)||void 0===de?void 0:de.subtotalText,u.createElement(m.A,{defaultMessage:[{type:0,value:"Product Services"}],id:"order_summary.label.product_services"})),u.createElement(f.E,null==ze||null===(ye=ze.subtotalSection)||void 0===ye?void 0:ye.subtotalText,u.createElement(p.Gr,{style:"currency",currency:null==e?void 0:e.currency,value:rt}))),Xe.map((t=>{var n,r,a,l,o;return"weeeFee"!==t.promotionId&&!(null!==(n=t.promotionId)&&void 0!==n&&n.startsWith("Klarna0tax_"))&&u.createElement(y.az,(0,i.A)({key:t.priceAdjustmentId},ze.subtotalSection.subtotalPriceContainer),u.createElement(f.E,null==ze||null===(r=ze.subtotalSection)||void 0===r?void 0:r.subtotalText,u.createElement(f.E,null==ze||null===(a=ze.subtotalSection)||void 0===a?void 0:a.subtotalText,null==Je||null===(l=Je.data)||void 0===l||null===(o=l.find((e=>e.id===t.promotionId)))||void 0===o?void 0:o.calloutMsg)),u.createElement(f.E,ze.subtotalSection.subtotalText,u.createElement(p.Gr,{style:"currency",currency:null==e?void 0:e.currency,value:t.price})))})),Ve&&Object.entries(Ve).map((([t,n])=>{const r=(null==n?void 0:n.totalPrice)-(null==n?void 0:n.totalDiscountedPrice)||0;var a;if(r>0)return u.createElement(y.az,(0,i.A)({key:t},ze.subtotalSection.subtotalPriceContainer),u.createElement(f.E,null==ze||null===(a=ze.subtotalSection)||void 0===a?void 0:a.subtotalText,null==n?void 0:n.bundleName),u.createElement(f.E,ze.subtotalSection.subtotalText,u.createElement(p.Gr,{style:"currency",currency:null==e?void 0:e.currency,value:-1*r})))})),Ye>0&&u.createElement(ue.A,{price:Ye,variant:"orderSummary"}),qe&&u.createElement(y.az,null,u.createElement(W,(0,i.A)({"flex-direction":"column"},je,{basket:e},ze.zipCode.zipCodeContainer,{step:C,key:`${null==e?void 0:e.productSubTotal} ${C&&1!==C&&2!==C?"notShowInputStep":"showInputStep"}`})))),u.createElement(re,null),(et||tt)&&u.createElement(y.az,null==ze||null===(ge=ze.checkoutSection)||void 0===ge?void 0:ge.checkoutContainer,n?u.createElement(f.E,null==ze||null===(he=ze.checkoutSection)||void 0===he?void 0:he.totalText,u.createElement(m.A,{defaultMessage:[{type:0,value:"TOTAL"}],id:"order_summary.label.estimated_total"})):u.createElement(f.E,null==ze||null===(_e=ze.checkoutSection)||void 0===_e?void 0:_e.totalText,u.createElement(m.A,{defaultMessage:[{type:0,value:"Order Total"}],id:"order_summary.label.order_total"})),u.createElement(f.E,null==ze||null===(Ae=ze.checkoutSection)||void 0===Ae?void 0:Ae.totalText,u.createElement(p.Gr,{style:"currency",currency:null==e?void 0:e.currency,value:(null==e?void 0:e.orderTotal)||(null==e?void 0:e.productTotal)}))),(et||tt)&&u.createElement(y.az,{gap:"0.5rem",pb:tt&&4},Be&&u.createElement(oe.A,{amount:null==e?void 0:e.taxTotal,hideVatRate:!0}),et&&u.createElement(u.Fragment,null,u.createElement(ae.A,{price:{currentPrice:null==e?void 0:e.orderTotal},variant:"cart"}),u.createElement(le.A,{price:null==e?void 0:e.orderTotal,placement:"cart"}))),et&&u.createElement(_.Z,null,u.createElement(y.az,(0,i.A)({},null==ze||null===(ke=ze.checkoutSection)||void 0===ke?void 0:ke.goToCheckoutButtonContainer,{position:"relative",zIndex:-1,display:{base:"block",lg:"none"}}),u.createElement(se,{isEstimate:n,isVATFlag:Be,basket:e}),u.createElement(A.$,(0,i.A)({as:"button","data-cs-label":"startCheckout",onClick:at},null==ze||null===(Ce=ze.checkoutSection)||void 0===Ce?void 0:Ce.goToCheckout,{variant:"primary","aria-label":Le({id:"order_summary.checkout_button.aria_label",defaultMessage:[{type:0,value:"Proceed to checkout"}]}),sx:{touchAction:"manipulation","& > *":{pointerEvents:"none"}}}),u.createElement(f.E,null,u.createElement(m.A,{id:"order_summary.checkout_button",defaultMessage:[{type:0,value:"Go to Checkout"}]}))))),et&&u.createElement(y.az,(0,i.A)({},null==ze||null===(Oe=ze.checkoutSection)||void 0===Oe?void 0:Oe.goToCheckoutButtonContainer,null==ze||null===(Pe=ze.checkoutSection)||void 0===Pe?void 0:Pe.goToCheckoutButtonContainerSticky),u.createElement(se,{isEstimate:n,isVATFlag:Be,basket:e}),u.createElement(A.$,(0,i.A)({as:"button","data-cs-label":"startCheckout"},null==ze||null===(Se=ze.checkoutSection)||void 0===Se?void 0:Se.goToCheckout,{onClick:(0,r.A)((function*(){at()})),variant:"primary","aria-label":Le({id:"order_summary.checkout_button.aria_label",defaultMessage:[{type:0,value:"Proceed to checkout"}]}),sx:{touchAction:"manipulation","& > *":{pointerEvents:"none"}}}),u.createElement(f.E,null,u.createElement(m.A,{id:"order_summary.checkout_button",defaultMessage:[{type:0,value:"Go to Checkout"}]})))),t&&tt&&u.createElement(u.Fragment,null,u.createElement(re,null),u.createElement(Ie,{basket:e,productsByItemId:d}))))};
1_e.propTypes={basket:d().object,variant:d().string,showPromoCodeForm:d().bool,showCartItems:d().bool,isEstimate:d().bool,fontSize:d().oneOf(["xs","sm","md","lg","xl"]),totalItems:d().number,productsByItemId:d().object,handleUnavailableProducts:d().func,showSubscriptionsCheck:d().bool,step:d().any,validateWarrantyBeforeAction:d().func};const Ae=_e},25673:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(28407),a=n(77810),l=n(75826),o=n.n(l),i=n(34692),u=n(44879),c=n(81308);const d=(0,a.forwardRef)((({handleClearBasket:e},t)=>{const{formatMessage:n}=(0,i.A)(),{isOpen:l,onOpen:o,onClose:d}=(0,u.j)();(0,a.useImperativeHandle)(t,(()=>({onOpen:o})));const s=function(){var t=(0,r.A)((function*(){d(),yield e()}));return function(){return t.apply(this,arguments)}}();return a.createElement(c.A,{"data-testid":"warranty-consistency-modal",onAlternateAction:s,title:n({defaultMessage:[{type:0,value:"Warranty Consistency Error"}],id:"cart.warranty_consistency_modal.error_title"}),description:n({defaultMessage:[{type:0,value:"Your basket contains warranty inconsistencies. All products will be removed. Please add items again."}],id:"cart.warranty_consistency_modal.error_description"}),isOpen:l})}));d.propTypes={handleClearBasket:o().func.isRequired},d.displayName="WarrantyConsistencyErrorModal";const s=d},34406:(e,t,n)=>{n.d(t,{A:()=>x});var r=n(64180),a=n(68175),l=n(28407),o=n(77810),i=n(75826),u=n.n(i),c=n(34692),d=n(73352),s=n(36287),m=n(77054),p=n(55939),v=n(64194),y=n(66170),f=n(87916),b=n(25635),E=n(86639),g=n(71954),h=n(2887),I=n(68066),_=n(20877),A=n(20922),k=n(45456),C=n(77214),O=n(28467),P=n(34302);function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){(0,a.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const M=({dynamicImageProps:e={widths:["50vw","50vw","20vw","20vw","25vw"]},enableFavourite:t,product:n,productUrl:a,compactView:i,priceData:u,variant:f,customImage:I,selectItemTileEventGtm:S,isOfficina:M=!1,isCorporateSale:x=!1,corporateSaleLabelName:j="",isFromHelpMeChoose:z=!1,productIndex:D,isDragging:B=!1,height:F="auto",imageStyle:q={},isFromProductList:N=!1,isInformativeLabelActive:L=!0,bundleFirstElement:R=!1,isFetchPriority:W=!1})=>{var U,$,G,V;const H=(0,d.o5)("ProductTile",{variant:f||(i?"compact":"default")}),Q=(0,o.useRef)(!1),[K,Y]=(0,o.useState)(null),{data:X}=(0,g.T)(),{toggleWishlistItem:Z,isProductInWishlist:J}=(0,h.G)(X),ee=J((null==n?void 0:n.c_subModelIdentifier)??(null==n?void 0:n.productId)),te=(0,O.I8)("hideAccount"),ne=null!==te&&te,{formatMessage:re}=(0,c.A)(),{addLayer:ae}=(0,_.W)(),le=(null==n?void 0:n.c_variantIdentifier)||(null==n?void 0:n.name)||(null==n?void 0:n.productName),oe=(0,C.Uk)(n,I),ie=(0,k.y8)(n),ue=function(){var e=(0,l.A)((function*(){var e,t,r,a;!z&&!N||ee||(yield ae(A.I1.bind(void 0,{event:"add_to_wishlist",currency:null==n?void 0:n.currency,items:[{item_name:(null==n?void 0:n.c_defaultName)||"",item_id:null==n||null===(e=n.representedProduct)||void 0===e?void 0:e.id,item_category:null==n?void 0:n.c_defaultCategoryName,item_variant:null==n?void 0:n.productId,price:((null==ie?void 0:ie.price)/(1+(null==n?void 0:n.c_taxRate)/100)).toFixed(2),fullprice:null!==(t=(0,k.mY)(n))&&void 0!==t&&t.isOnSale?"reduced":"fullprice",rating_points:"",erp_category:null==n||null===(r=n.representedProduct)||void 0===r?void 0:r.c_materialGroup,prdha_category:null==n?void 0:n.c_prdha_category,index:D+1,stock_status:(null==n||null===(a=n.c_extendVariant)||void 0===a?void 0:a.stock)>0?"in-stock":"out-of-stock"}]}))),yield Z(n,Q);const l=re(ee?{id:"product_tile.screen_reader_alert.removed_from_wishlist",defaultMessage:[{type:1,value:"product"},{type:0,value:" removed from wishlist"}]}:{id:"product_tile.screen_reader_alert.added_to_wishlist",defaultMessage:[{type:1,value:"product"},{type:0,value:" added to wishlist"}]},{product:le});Y(l),setTimeout((()=>Y(null)),1e3)}));return function(){return e.apply(this,arguments)}}(),ce=[(null==n?void 0:n.c_categoryName)||(null==n?void 0:n.c_defaultCategoryName),(null==n?void 0:n.productName)||(null==n?void 0:n.c_defaultName),null==n||null===(U=n.representedProduct)||void 0===U?void 0:U.id].filter(
1Boolean).join(", ");return o.createElement(s.az,(0,r.A)({},H.imageWrapper,{"data-testid":"product-tile-image-wrapper"}),o.createElement(m.s6,null,o.createElement(s.az,{role:"status","aria-live":"assertive","aria-atomic":"true"},K)),o.createElement(p.g,(0,r.A)({},H.image,R?H.firstBundleImage:{},"bundle"===f?w({},H.braunBundleBorderRadius):{}),a&&!B?o.createElement(T,{productUrl:a,isOfficina:M,selectItemTileEventGtm:S,productName:le},o.createElement(o.Fragment,null,o.createElement(P.A,(0,r.A)({"data-testid":"product-tile-image",src:`${oe}[?sw={width}&q=60]`,imageProps:w({height:F,alt:ce,loading:"lazy"},null==e?void 0:e.imageProps),isFetchPriority:W},q)),o.createElement(s.az,H.imageOverlay))):o.createElement(o.Fragment,null,oe&&o.createElement(P.A,(0,r.A)({"data-testid":"product-tile-image",src:`${oe}[?sw={width}&q=60]`,imageProps:w({height:F,alt:"",loading:"lazy"},null==e?void 0:e.imageProps),isFetchPriority:W},q)),o.createElement(s.az,H.imageOverlay))),o.createElement(v.z,H.badgeGroup,L&&o.createElement(E.Y,{product:(null==n?void 0:n.representedProduct)??n,priceData:u,isCorporateSale:x,corporateSaleLabelName:j})),t&&o.createElement(s.az,{onClick:e=>{e.preventDefault()}},!ne&&o.createElement(y.K,(0,r.A)({"data-testid":"wishlist-button","data-cs-label":"plp-favourite","aria-label":re(ee?{id:"product_tile.assistive_msg.remove_from_wishlist",defaultMessage:[{type:0,value:"Remove "},{type:1,value:"product"},{type:0,value:" from wishlist"}]}:{id:"product_tile.assistive_msg.add_to_wishlist",defaultMessage:[{type:0,value:"Add "},{type:1,value:"product"},{type:0,value:" to wishlist"}]},{product:le}),icon:ee?o.createElement(b.FavouriteFilledIcon,(0,r.A)({},H.favSvgSolid,{"data-product-code":null==n||null===($=n.representedProduct)||void 0===$?void 0:$.id})):o.createElement(b.FavouriteIcon,(0,r.A)({},H.favSvg,{"data-product-code":null==n||null===(G=n.representedProduct)||void 0===G?void 0:G.id}))},H.favIcon,{onClick:ue,className:"js-wishlist-add","data-product-code":null==n||null===(V=n.representedProduct)||void 0===V?void 0:V.id}))))};M.propTypes={badgeDetails:u().array,dynamicImageProps:u().object,enableFavourite:u().bool,isFavourite:u().bool,onFavouriteToggle:u().func,imageViewType:u().string,product:u().object,productUrl:u().string,selectableAttributeId:u().string,compactView:u().bool,priceData:u().object,variant:u().string,customImage:u().string,isOfficina:u().bool,isCorporateSale:u().bool,corporateSaleLabelName:u().string,selectItemTileEventGtm:u().func,isFromHelpMeChoose:u().bool,productIndex:u().number,isDragging:u().bool,height:u().string,imageStyle:u().object,isFromProductList:u().bool,isInformativeLabelActive:u().bool,bundleFirstElement:u().bool,isFetchPriority:u().bool};const x=M,T=({productUrl:e,isOfficina:t,selectItemTileEventGtm:n,productName:r,children:a})=>{const{locale:l}=(0,I.A)(),i=(0,c.A)(),u=null==l?void 0:l.alias,d=i.formatMessage({id:"product_tile.view_product.aria_label",defaultMessage:[{type:0,value:"View "},{type:1,value:"productName"}]},{productName:r});return t?o.createElement("a",{href:`/${u}${e}`,"aria-label":d,onClick:n},a):o.createElement(f.A,{to:e,"aria-label":d,onClick:n},a)};T.propTypes={productUrl:u().string,children:u().node,isOfficina:u().bool,selectItemTileEventGtm:u().func,productName:u().string}},7146:(e,t,n)=>{n.d(t,{A:()=>E});var r=n(64180),a=n(18801),l=n(77810),o=n(75826),i=n.n(o),u=n(37180),c=n(75011),d=n(21466),s=n(73295),m=n(28387),p=n(32998),v=n(95106),y=n(34692);const f=["product","isOpen","onClose"],b=e=>{var t;let{product:n,isOpen:o,onClose:i}=e,b=(0,a.A)(e,f);const E=(0,v.h)(n),g=(0,y.A)().formatMessage({defaultMessage:[{type:0,value:"Edit modal for "},{type:1,value:"productName"}],id:"cart.product_edit_modal.modal_label"},{productName:null==E||null===(t=E.product)||void 0===t?void 0:t.name});return l.createElement(u.aF,{size:"4xl",isOpen:o,onClose:i},l.createElement(c.m,null),l.createElement(d.$,{containerProps:{"data-testid":"product-view-modal"},"aria-label":g},l.createElement(s.s,null),l.createElement(m.c,{pb:8,bg:"white",paddingBottom:6,marginTop:6},l.createElement(p.A,(0,r.A)({showFullLink:!0,imageSize:"sm",product:E.product,isLoading:E.isFetching},b)))))};b.propTypes={isOpen:i().bool.isRequired,onOpen:i().func.isRequired,onClose:i().func.isRequired,product:i().object,isLoading:i().bool};const E=b},7597:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Bt});var r=n(64180),a=n(28407),l=n(68175),o=n(77810),i=n(34692),u=n(16602),c=n(44879),d=n(14893),s=n(46946),m=n(73352),p=n(36287),v=n(86400),y=n(10577),f=n(68624),b=n(45915),E=n(17815),g=n(34039),h=n(82990),I=n(75826),_=n.n(I),A=n(41863),k=n(72030),C=n(40133),O=n(54019),P=n(64194),S=n(77054),w=n(75712),M=n(89408),x=n(66569),T=n(79162),j=n(2540),z=n(87916),D=n(38321),B=n(24961),F=n(41663),q=n(17015),N=n(53302),L=n(69123),R=n(13506),W=n(8174),U=n(25635),$=n(91332),G=n(86639),V=n(35597),H=n(62004),Q=n(70581),K=(n(55981),n(50415)),Y=n(28467),X=n(20877),Z=n(20922),J=n(45456),ee=n(14905),te=n(8884),ne=n(64243),re=n(96411),ae=n(58493),le=n(32120),oe=n(54957),ie=n(90031);const ue=({warranties:e,product:t,warrantyTermsAndConditionsLink:n=null})=>{var l,c;const d=(0,m.o5)("WarrantySectionCart",{}),{formatMessage:s}=(0,i.A)(),{data:p}=(0,oe.X)(),{addItemToNewOrExistingBasket:y}=(0,ie.useShopperBasketsMutationHelper)(),f=(0,ie.useShopperBasketsMutation)("updateItemInBasket"),E=(0,ie.useShopperBasketsMutation)("removeItemFromBasket"),g=null==p||null===(l=p.productItems)||void 0===l?void 0:l.find((e=>(null==e?void 0:e.c_UUIDWarranty)===(null==t?void 0:t.c_UUIDWarranty)&&!0===(null==e?void 0:e.c_isWarranty))),h=null==g?void 0:g.productId,[I,_]=(0,o.useState)(h||null),[k,O]=(0,o.useState)(!1),S=function(){var e=(0,a.A)((function*(e){const n={productId:e,quantity:1,c_isWarranty:!0,c_parentProductId:(null==t?void 0:t.productId)||
1(null==t?void 0:t.id)};yield y([n])}));return function(t){return e.apply(this,arguments)}}(),w=!(null==t||!t.c_UUIDWarranty||null==p||null===(c=p.productItems)||void 0===c||!c.some((e=>!0===(null==e?void 0:e.c_isWarranty)&&!0===(null==e?void 0:e.bonusProductLineItem)&&(null==e?void 0:e.c_UUIDWarranty)===t.c_UUIDWarranty))),M=function(){var e=(0,a.A)((function*(){null!=g&&g.itemId&&null!=p&&p.basketId&&(yield E.mutateAsync({parameters:{basketId:p.basketId,itemId:g.itemId}}))}));return function(){return e.apply(this,arguments)}}(),x=function(){var e=(0,a.A)((function*(e){if(null==g||!g.itemId||null==p||!p.basketId||null==t||!t.c_UUIDWarranty)return;const n={productId:e,quantity:1,c_isWarranty:!0,c_UUIDWarranty:t.c_UUIDWarranty};yield f.mutateAsync({parameters:{basketId:p.basketId,itemId:g.itemId},body:n})}));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=(0,a.A)((function*(e,t){if(!k&&!w){O(!0);try{if(!t&&I===e)return yield M(),void _(null);h&&h!==e?yield x(e):h||(yield S(e)),_(e)}finally{O(!1)}}}));return function(t,n){return e.apply(this,arguments)}}();return(0,o.useEffect)((()=>{_(h||null)}),[h,null==p?void 0:p.productItems]),null!=t&&t.c_isWarranty||!e||0===(null==e?void 0:e.length)?null:o.createElement(o.Fragment,null,k&&o.createElement(ee.A,null),o.createElement(b.s,d.outterContainer,o.createElement(b.s,d.container,n&&o.createElement(b.s,d.termsAndConditionsContainer,o.createElement(U.InfoIcon,{boxSize:"iconsSize.small"}),o.createElement(ae.N,{href:n,isExternal:!0,_hover:{textDecoration:"none"},textDecoration:"underline"},o.createElement(A.A,{defaultMessage:[{type:0,value:"Termini e condizioni"}],id:"warranty_selector.warranty_terms_and_conditions_link"})))),o.createElement(v.B,d.outterRadioContainer,e.map((e=>e.options.map((t=>{const n=t.id||t.productId,a=(0,J.gV)(e.groupName,t.serviceDuration,s),l=t.price,i=I===n;return o.createElement(P.z,(0,r.A)({key:n},d.radioContainer),o.createElement(b.s,d.itemContainer,o.createElement(le.A,{isChecked:i,isDisabled:w||k,onChange:e=>T(n,e.target.checked)}),o.createElement(b.s,d.textContainer,o.createElement(C.E,(0,r.A)({as:"span"},d.warrantyName),a)," ",o.createElement(C.E,d.price,"+ ",o.createElement(u.Gr,{style:"currency",currency:null==p?void 0:p.currency,value:l||0})))))}))))))," ")};ue.propTypes={warranties:_().array.isRequired,product:_().object.isRequired,warrantyTermsAndConditionsLink:_().string};const ce=ue;var de=void 0;const se=({product:e,primaryAction:t,secondaryActions:n,onItemQuantityChange:l=q.lQ,showLoading:c=!1,officinaEditParams:s,officinaImage:y,index:f,isCart:E=!1,onAddToCartModalOpen:g=q.lQ})=>{var h,I,_;const{quantity:ae,stepQuantity:le,setQuantity:oe}=(0,L.K)(e),{currency:ie}=(0,N.H2)(),{formatMessage:ue}=(0,i.A)(),se=(0,m.Vl)("ProductItem"),{addLayer:me}=(0,X.W)(),pe="braun"===te.UK?U.InfoLabelIcon:U.InfoIcon,ve="braun"===te.UK?U.CloseLabelIcon:U.CloseIcon,ye="braun"===te.UK?"braun-out-of-stock":"outOfStock",fe="braun"===te.UK?"braun-last-few-items":"lastFewItems",{isCorporateSale:be,corporateSaleLabelName:Ee}=(0,ne.A)(e),{productUrl:ge,priceData:he}=(0,H.Ay)(e),Ie=(0,K.Ke)(e),_e=(0,K.Kp)(e,ue.locale||"en-GB"),{getMaxQuantity:Ae}=(0,re.v)(),ke=null==e||null===(h=e.c_recommendations)||void 0===h?void 0:h.filter((e=>{var t;return 5===(null==e||null===(t=e.recommendationType)||void 0===t?void 0:t.value)&&e.warrantyGroupId})),Ce=(0,Y.mE)("warrantyTermsAndConditionsLink"),Oe=null==ke?void 0:ke.map((e=>{const t=(e.variants||[]).filter((e=>e&&e.productId)).map((e=>({id:e.productId,name:e.productName,price:e.price,serviceDuration:e.serviceDuration})));return 0===t.length?null:{groupName:e.warrantyGroupName,groupId:e.warrantyGroupId,options:t}})).filter(Boolean),Pe=Oe&&Oe.length>0,Se=(0,H.YA)(ge,[{name:"tkcsid",value:s}]),we=!(null==he||!he.tieredPrice)&&(null==he?void 0:he.currentPrice)/(null==e?void 0:e.quantity)<(null==he?void 0:he.listPrice),Me=!(null==e||!e.bonusProductLineItem),xe=Ie.isPreorder||Ie.isBackorder?Ae(e)||2:null==e||null===(I=e.inventory)||void 0===I?void 0:I.stockLevel,Te=(0,Y._d)("showLastItemThreshold"),je=(0,Y.I8)("showVATFlag"),ze=0===(null==e?void 0:e.priceAfterItemDiscount)||0===(null==e?void 0:e.priceAfterOrderDiscount),De=function(){var t=(0,a.A)((function*(){var t;yield me(Z.$x.bind(de)),yield me(Z.I1.bind(de,{event:"select_item",item_list_name:null==e?void 0:e.c_defaultCategoryName,items:[{item_name:null==e?void 0:e.c_defaultName,item_id:(null==e?void 0:e.productId)||
1(null==e?void 0:e.id),item_category:null==e?void 0:e.c_defaultCategoryName,item_variant:(null==e?void 0:e.productId)||(null==e?void 0:e.id),price:((null==e?void 0:e.price)-(null==e?void 0:e.tax)).toFixed(2),fullprice:null!==(t=(0,J.mY)(e))&&void 0!==t&&t.isOnSale?"reduced":"fullprice",rating_points:"",erp_category:null==e?void 0:e.c_materialGroup,prdha_category:(null==e?void 0:e.c_prdhaCategory)||(null==e?void 0:e.c_prdha_category),index:f+1,stock_status:"in-stock"}]}))}));return function(){return t.apply(this,arguments)}}();return o.createElement(p.az,(0,r.A)({},null==se?void 0:se.itemContainer,{"data-testid":`sf-cart-item-${e.productId?e.productId:e.id}`}),o.createElement(Q.A,{variant:e},c&&o.createElement(ee.A,null),o.createElement(b.s,null==se?void 0:se.flexContainer,y&&s?o.createElement("a",{href:Se,"aria-label":ue({id:"product_item.link.officina.label",defaultMessage:[{type:0,value:"View personalized product"}]})},o.createElement(p.az,(0,r.A)({position:"relative"},null==se?void 0:se.cartImage),o.createElement(k._,(0,r.A)({alt:s,src:y,ignoreFallback:!0},null==se?void 0:se.cartImage,{role:"img"})))):o.createElement(z.A,{to:ge,onClick:De,"aria-label":ue({id:"product_item.link.product.label",defaultMessage:[{type:0,value:"View product details for product"}]})},o.createElement(D.A,(0,r.A)({},null==se?void 0:se.cartImage,{imageProps:null==se?void 0:se.cartImage}))),o.createElement(p.az,null==se?void 0:se.detailContainer,o.createElement(b.s,null==se?void 0:se.infoLabelContainer,o.createElement(G.Y,{product:(null==e?void 0:e.representedProduct)??e,priceData:he,showPromotions:!0,isFreeGift:ze,isCorporateSale:be,corporateSaleLabelName:Ee})),o.createElement(p.az,(0,r.A)({},null==se?void 0:se.headerStack,{gap:"0.5rem"}),o.createElement(z.A,{to:ge,onClick:De,className:"dln-cartItem__title","aria-label":ue({id:"product_item.link.product.label",defaultMessage:[{type:0,value:"product name"}]})},o.createElement(B.A,null==se?void 0:se.itemName)),o.createElement(p.az,null==se?void 0:se.removeIcon,n)),o.createElement(p.az,null==se?void 0:se.omniAndPrice,ze?o.createElement(o.Fragment,null,o.createElement(u.Gr,{style:"currency",currency:ie,value:0}),o.createElement(p.az,null==se?void 0:se.omnibus,o.createElement(p.az,null==se?void 0:se.suggestedPrice,o.createElement(R.A,{currency:ie,hasStrikethrough:!0})),o.createElement(C.E,null==se?void 0:se.suggestedText,ue({id:"item_variant.suggested_price",defaultMessage:[{type:0,value:"Suggested Price"}]})))):o.createElement(o.Fragment,null,o.createElement(R.A,{currency:ie,style:null==se?void 0:se.itemPrice,isCart:!0}),we&&!Me&&o.createElement(p.az,null==se?void 0:se.omnibus,he.showOmnibusPriceDiscount?o.createElement($.A,{priceData:he,currency:ie,omnibusExpandedView:!0,variant:"recommended",showDiscount:!1}):he.listPrice?o.createElement(o.Fragment,null,o.createElement(p.az,null==se?void 0:se.suggestedPrice,o.createElement(R.A,{currency:ie,hasStrikethrough:!0,isCart:E})),o.createElement(C.E,null==se?void 0:se.suggestedText,ue({id:"item_variant.suggested_price",defaultMessage:[{type:0,value:"Suggested Price"}]}))):o.createElement(O.E,{h:"2rem",w:"100%"})))),je&&!ze&&o.createElement(p.az,null==se?void 0:se.vatDetails,o.createElement(P.z,null,o.createElement(V.A,{price:(null==he?void 0:he.pricePerUnit)||he.currentPrice,vatRate:100*(null==e?void 0:e.taxRate),variant:"vatNoWrap"}))),"true"===(null==e?void 0:e.c_isOfficina)&&o.createElement(p.az,null==se?void 0:se.officinaLink,o.createElement(P.z,{fontWeight:"bold"},o.createElement("a",{href:Se},ue({id:"item_variant.edit_personalization",defaultMessage:[{type:0,value:"Edit personalization"}]})))),xe>0&&xe<=Te&&!Ie.isPreorder&&!Ie.isBackorder&&o.createElement(W.A,{variant:fe,icon:o.createElement(pe,{circleColor:"transparent"}),textMessage:o.createElement(A.A,{id:"use_product.message.low_stock",defaultMessage:[{type:0,value:"Last "},{type:1,value:"quantity"},{type:0,value:" "},{type:1,value:"itemLabel"}],values:{quantity:xe,itemLabel:1===xe?o.createElement(A.A,{id:"global.message.item",defaultMessage:[{type:0,value:"item"}]}):o.createElement(A.A,{id:"global.message.items",defaultMessage:[{type:0,value:"items"}]})}})}),0!==xe||Ie.isPreorder||Ie.isBackorder?o.createElement(o.Fragment,null,!Me&&o.createElement(p.az,(0,r.A)({},null==se?void 0:se.quantSelContainer,{className:"dln-orderSumm__contentRow"}),o.createElement(C.E,(0,r.A)({},null==se?void 0:se.textQuantity,{"aria-label":ue({id:"item_variant.quantity.label",defaultMessage:[{type:0,value:"Quantity selector for "},{type:1,value:"productName"},{type:0,value:". Selected quantity is "},{type:1,value:"quantity"}]},{quantity:null==e?void 0:e.quantity,productName:(null==e?void 0:e.c_variantIdentifier)||(null==e?void 0:e.name)||(null==e?void 0:e.productName)})}),o.createElement(A.A,{defaultMessage:[{type:0,value:"Quantity:"}],id:"product_item.label.quantity"})),o.createElement(F.A,{step:le,value:ae,min:0,max:xe,clampValueOnBlur:!1,onBlur:t=>{const{value:n}=t.target;n||oe(e.quantity)},onChange:(e,t)=>
1{t>=0?l(t).then((e=>e&&oe(t))):""===e&&oe(e)},productName:(null==e?void 0:e.c_variantIdentifier)||(null==e?void 0:e.name)||(null==e?void 0:e.productName)}),o.createElement(S.s6,{role:"status"},(null==e?void 0:e.c_variantIdentifier)||(null==e?void 0:e.name)||(null==e?void 0:e.productName),ue({id:"item_variant.assistive_msg.quantity",defaultMessage:[{type:0,value:"Quantity "},{type:1,value:"quantity"}]},{quantity:null==e?void 0:e.quantity}))),Pe&&o.createElement(b.s,se.warrantyDesktopContainer,o.createElement(w.c,null),o.createElement(b.s,(0,r.A)({},se.warrantyTitle,{paddingTop:"1rem"}),o.createElement(A.A,{id:"warranty_section.label.extend_warranty",defaultMessage:[{type:0,value:"Extend your warranty"}]})),o.createElement(ce,{warranties:Oe,product:e,warrantyTermsAndConditionsLink:Ce}))):o.createElement(W.A,{variant:ye,icon:o.createElement(ve,null),textMessage:o.createElement(A.A,{id:"use_product.message.out_of_stock",defaultMessage:[{type:0,value:"Out of stock"}]})}),Ie.isPreorder&&_e&&o.createElement(b.s,null==se?void 0:se.preorderCartContainer,o.createElement(C.E,null==se?void 0:se.preorderCartTitleText,o.createElement(A.A,{id:"product_item.label.preorder",defaultMessage:[{type:0,value:"Preorder:"}]})),o.createElement(C.E,null==se?void 0:se.preorderCartDescriptionText,o.createElement(A.A,{id:"order_summary.message.available_from",defaultMessage:[{type:0,value:"This item will be available from "},{type:1,value:"date"}],values:{date:o.createElement(C.E,(0,r.A)({as:"span"},null==se?void 0:se.preorderCartDateText),_e)}}))),Ie.isBackorder&&_e&&o.createElement(b.s,null==se?void 0:se.backorderCartContainer,o.createElement(C.E,null==se?void 0:se.backorderCartTitleText,o.createElement(A.A,{id:"product_item.label.backorder",defaultMessage:[{type:0,value:"Backorder:"}]})),o.createElement(C.E,null==se?void 0:se.backorderCartDescriptionText,o.createElement(A.A,{id:"order_summary.message.available_from",defaultMessage:[{type:0,value:"This item will be available from "},{type:1,value:"date"}],values:{date:o.createElement(C.E,(0,r.A)({as:"span"},null==se?void 0:se.backorderCartDateText),_e)}}))),t&&o.createElement(v.B,null,o.createElement(p.az,{display:["none","block","block","block"]},t)),(null==e||null===(_=e.c_recommendations)||void 0===_?void 0:_.find((e=>{var t;return 4===(null==e||null===(t=e.recommendationType)||void 0===t?void 0:t.value)})))&&o.createElement(o.Fragment,null,o.createElement(C.E,null==se?void 0:se.subAndSaveText,o.createElement(A.A,{defaultMessage:[{type:0,value:"Subscribe and save"}],id:"product_item.subscription.label.subscribe_and_save"})),o.createElement(d.$,(0,r.A)({variant:"secondary",onClick:()=>g({itemsAdded:[{product:e,quantity:1}],isSubscription:!0})},null==se?void 0:se.subAndSaveButton),o.createElement(A.A,{defaultMessage:[{type:0,value:"Buy in subscription"}],id:"product_item.subscription.button.buy_subscription"}))))),Pe&&o.createElement(b.s,{display:{base:"block",md:"none"},width:"100%"},o.createElement(M.n,{allowToggle:!0},o.createElement(x.A,se.warrantyAccordionItem,(({isExpanded:t})=>o.createElement(o.Fragment,null,o.createElement(T.J,se.warrantyButtonAccordion,o.createElement(A.A,{id:"warranty_section.label.extend_warranty",defaultMessage:[{type:0,value:"Extend your warranty"}]}),t?o.createElement(U.ChevronUp,null):o.createElement(U.ChevronDown,null)),o.createElement(j.v,se.warrantyAccordionPanel,o.createElement(ce,{warranties:Oe,product:e,warrantyTermsAndConditionsLink:Ce}))))))),t&&o.createElement(p.az,{display:["block","none","none","none"],w:"full"},t)))};se.propTypes={product:_().object,onItemQuantityChange:_().func,onAddItemToCart:_().func,showLoading:_().bool,isWishlistItem:_().bool,primaryAction:_().node,secondaryActions:_().node,officinaEditParams:_().string,officinaImage:_().string,index:_().number,isCart:_().bool,onAddToCartModalOpen:_().func};const me=se;var pe=n(81323),ve=n(62768),ye=n(4722);const fe=()=>{const e=(0,m.o5)("Cart",{}),{header:t}=e,{formatMessage:n}=(0,i.A)(),r=(0,ye.g)();return o.createElement(p.az,null==t?void 0:t.headerContainer,o.createElement(P.z,null==t?void 0:t.stack,o.createElement(C.E,null==t?void 0:t.t
1itle,n({defaultMessage:[{type:0,value:"Basket"}],id:"cart_title.title.cart_title"})),o.createElement(C.E,null==t?void 0:t.quantity,1===r?o.createElement(A.A,{defaultMessage:[{type:0,value:"("},{type:1,value:"itemCount"},{type:0,value:" item)"}],id:"cart_title.title.cart_num_of_items",values:{itemCount:r}}):o.createElement(A.A,{defaultMessage:[{type:0,value:"("},{type:1,value:"itemCount"},{type:0,value:" items)"}],id:"cart_title.title.cart_num_of_items_plural",values:{itemCount:r}}))))};var be=n(18584),Ee=n(81308),ge=n(60309),he=n(68644),Ie=void 0;const _e={dialogTitle:(0,u.zR)({defaultMessage:[{type:0,value:"Confirm Remove Item"}],id:"confirmation_modal.remove_cart_item.title.confirm_remove"}),confirmationMessage:(0,u.zR)({defaultMessage:[{type:0,value:"Are you sure you want to remove this item from your cart?"}],id:"confirmation_modal.remove_cart_item.message.sure_to_remove"}),primaryActionLabel:(0,u.zR)({defaultMessage:[{type:0,value:"Yes, remove item"}],id:"confirmation_modal.remove_cart_item.action.yes"}),primaryActionAriaLabel:(0,u.zR)({defaultMessage:[{type:0,value:"Yes, remove item"}],id:"confirmation_modal.remove_cart_item.assistive_msg.yes"}),alternateActionLabel:(0,u.zR)({defaultMessage:[{type:0,value:"No, keep item"}],id:"confirmation_modal.remove_cart_item.action.no"}),alternateActionAriaLabel:(0,u.zR)({defaultMessage:[{type:0,value:"No, keep item"}],id:"confirmation_modal.remove_cart_item.assistive_msg.no"}),onPrimaryAction:q.lQ},Ae=({onAddToWishlistClick:e=q.lQ,hasBonusProduct:t,onRemoveItemClick:n=q.lQ,productData:l})=>{const u=(0,Q.e)(),{currency:s}=(0,N.H2)(),{data:y}=(0,ge.J)(),{addLayer:f}=(0,X.W)(),b=(0,c.j)(),{formatMessage:E}=(0,i.A)(),g=(0,m.o5)("CartSecondaryButtonGroup",{}),h=function(){var e=(0,a.A)((function*(){var e;yield f(Z.$x.bind(Ie)),yield f(Z.I1.bind(Ie,{event:"remove_from_cart",currency:s,bundle:"false",items:[{item_name:null==l?void 0:l.c_defaultName,item_id:null==l?void 0:l.productId,item_category:null==l?void 0:l.c_defaultCategoryName,item_variant:null==l?void 0:l.c_subModelIdentifier,price:parseFloat((((null==l?void 0:l.price)-(null==l?void 0:l.tax))/(null==l?void 0:l.quantity)).toFixed(2)),fullprice:null!==(e=(0,J.mY)(l))&&void 0!==e&&e.isOnSale?"reduced":"fullprice",rating_points:"",erp_category:null==l?void 0:l.c_MaterialGroup,prdha_category:null==l?void 0:l.c_prdhaCategory,quantity:null==l?void 0:l.quantity}]})),n(u)}));return function(){return e.apply(this,arguments)}}(),{isCart:I}=(0,he.A)().currentPage(location.pathname);return o.createElement(o.Fragment,null,o.createElement(v.B,(0,r.A)({},null==g?void 0:g.outerStack,{divider:o.createElement(w.c,{display:{base:"block",lg:"none"}})}),o.createElement(p.az,{as:"span"},o.createElement(be.e,{spacing:"6"},!t&&o.createElement(d.$,{onClick:h,"data-testid":"cart-item-remove-button",className:"js-personalization-remove-button","data-product-code":null==l?void 0:l.productId,"aria-label":E({id:"cart_secondary_button_group.action.remove.aria_label",defaultMessage:[{type:0,value:"Remove from cart"}]})},o.createElement(U.DeleteIcon,(0,r.A)({},null==g?void 0:g.deleteIcon,{"data-product-code":null==l?void 0:l.productId,role:"img","aria-hidden":"true"}))),y.isRegistered&&!I&&o.createElement(d.$,{variant:"link",size:"sm",onClick:()=>e(u),"aria-label":E({id:"cart_secondary_button_group.action.wishlist.aria_label",defaultMessage:[{type:0,value:"Add "},{type:1,value:"productName"},{type:0,value:" to wishlist"}],values:{productName:(null==l?void 0:l.c_defaultName)||"item"}})},o.createElement(A.A,{defaultMessage:[{type:0,value:"Add to Wishlist"}],id:"cart_secondary_button_group.action.added_to_wishlist"}))))),o.createElement(Ee.A,(0,r.A)({},_e,{onPrimaryAction:h},b)))};Ae.propTypes={onClick:_().func,onEditClick:_().func,onAddToWishlistClick:_().func,onRemoveItemClick:_().func,onIsAGiftChange:_().func,isAGift:_().bool,hasBonusProduct:_().bool,productData:_().object};const ke=Ae;var Ce=n(33443);const Oe=({onClose:e})=>{const t=(0,m.o5)("Cart",{}),{shipping:n}=t,{formatMessage:a}=(0,i.A)(),l="braun"===te.UK?o.createElement(A.A,{id:"cart_default.cart_shipping.message.braun",defaultMessage:[{type:0,value:"Shipping Message"}]}):o.createElement(A.A,{id:"cart_default.cart_shipping.message",defaultMessage:[{type:0,value:"Free shipping for orders over 30€"}]});return o.createElement(p.az,null==n?void 0:n.shippingContainer,o.createElement(P.z,null==n?void 0:n.shippingContent,o.createElement(U.ShippingIcon,null==n?void 0:n.shippingIcon),o.createElement(C.E,null==n?void 0:n.shippingText,l)),o.createElement(p.az,null,o.createElement(U.CloseIcon,(0,r.A)({onClick:()=>{e()}},null==n?void 0:n.closeIcon,{role:"button","aria-label":a({id:"cart_shipping.button.close.label",defaultMessage:[{type:0,value:"Close shipping information"}]}),tabIndex:0}))))},Pe=Oe;Oe.propTypes={onClose:_().func.isRequired};var Se=n(64965),we=n(87275),Me=n(68066),xe=n(35714);function Te({onClose:e,message:t}){return o.createElement(p.az,{"data-testid":"cart-remove-warning"},o.createElement(xe.A,{message:t,variant:"removeFeedback",status:"success",enableIcon:!1,onClose:e}))}Te.propTypes={onClose:_().func,isOpen:_().bool,message:_().string,messageDuration:_().number};var je=n(4026),ze=n(54752);const De=({removeMessages:e=[]})=>{var t,n,a,l,c,s,y,f,b,E,g,h,I;const _=(0,m.o5)("Cart",{removeMessagesLength:e.length}),{locale:k}=(0,Me.A)(),{formatMessage:O}=(0,i.A)(),{customParams:P}=(0,je.getConfig)(),S=(0,Se.useLocation)(),w="https://"+P.currentHost+S.pathname,M=(0,u.zR)({defaultMessage:[{type:0,value:"Basket"}],id:"cart_title.title.cart_title"}),x={"@context":"https://schema.org/","@type":"WebPage",name:O(M),description:O(M),url:w};return o.createElement(p.az,(0,r.A)({"data-testid":"sf-cart-empty"},null==_||null===(t=_.emptyCart)||void 0===t?void 0:t.pageContainer,{"data-gtm":"cart-page"}),o.createElement(ze.Helmet,null,o.createElement("script",{type:"application/ld+json"},JSON.stringify(x,null,2))),o.createElement(fe,null),o.createElement(p.az,null==_||null===(n=_.emptyCart)||void 0===n?void 0:n.cartContainer,o.createElement(v.B,null==_||null===(a=_.emptyCart)||void 0===a?void 0:a.leftStack,e.length>0&&o.createElement(p.az,null==_||null===(l=_.emptyCart)||void 0===l?void 0:l.removeMessagesBox,e.map((e=>o.createElement(Te,{key:e.id,message:e.text})))),o.createElement(p.az,null==_||null===(c=_.emptyCart)||void 0===c?void 0:c.cartContent,o.createElement(U.CartIcon,(0,r.A)({},null==_||null===(s=_.emptyCart)||void 0===s?void 0:s.emptyIcon,{"aria-hidden":"true"})),o.createElement(v.B,null==_||null===(y=_.emptyCart)||void 0===y?void 0:y.emptyStack,o.createElement(C.E,null==_||null===(f=_.emptyCart)||void 0===f?void 0:f.emptyText,o.createElement(A.A,{defaultMessage:[{type:0,value:"Your basket is empty."}],id:"empty_cart.description.empty_cart"})),o.createElement(d.$,(0,r.A)({variant:"primary",as:we.Link,to:`/${null==k?void 0:k.alias}`},null==_||null===(b=_.emptyCart)||void 0===b?void 0:b.discoverMoreButton,{"aria-label":O({id:"empty_cart.button.discover.label",defaultMessage:[{type:0,value:"Continue shopping and discover more products"}]})}),o.createElement(A.A,{defaultMessage:[{type:0,value:"Discover More"}],id:"cart_default.cart_support.discover_more_button"}))))),o.createElement(v.B,null==_||null===(E=_.emptyCart)||void 0===E?void 0:E.
1checkoutContainer,o.createElement(p.az,null==_||null===(g=_.cart)||void 0===g?void 0:g.checkoutItem,o.createElement(pe.A,null)),o.createElement(p.az,null==_||null===(h=_.cart)||void 0===h?void 0:h.checkoutItemWhite,o.createElement(ve.A,null)),o.createElement(p.az,null==_||null===(I=_.cart)||void 0===I?void 0:I.checkoutItemWhite,o.createElement(Ce.A,null)))),o.createElement(p.az,{id:"cart_product_recommendations",overflowX:"hidden"}))};De.propTypes={isRegistered:_().bool,removeMessages:_().array};const Be=De;var Fe=n(7711),qe=n(71954),Ne=n(10947),Le=n(32105),Re=n(76396),We=n(24503),Ue=n.n(We),$e=n(74941),Ge=n(11424),Ve=n(1714);const He=({bundleItems:e,bundleDetails:t,handleRemoveItem:n})=>{const{currency:a}=(0,N.H2)(),l=(0,m.Vl)("Bundle"),{formatMessage:c}=(0,i.A)(),s=(0,Y.I8)("showVATFlag"),v=(null==t?void 0:t.discountPercentage)||"0%",y=Math.round(parseFloat(v.replace("%",""))),f=`${c({id:"item_variant.discountLabel",defaultMessage:[{type:0,value:"Discount"}]})} ${y}%`,E=null==e?void 0:e.reduce(((e,t)=>{var n;return e+((null==t||null===(n=t.priceAdjustments)||void 0===n?void 0:n.reduce(((e,t)=>"weeeFee"===(null==t?void 0:t.promotionId)?e+(t.price||0):e),0))||0)}),0),g=Number(null==t?void 0:t.totalPrice)===Number(null==t?void 0:t.totalDiscountedPrice),h=e=>{var t;if(null==e||!e.priceAfterItemDiscount)return null==e?void 0:e.price;const n=(null==e||null===(t=e.priceAdjustments)||void 0===t?void 0:t.reduce(((e,t)=>"weeeFee"===(null==t?void 0:t.promotionId)?e+(t.price||0):e),0))||0;return e.priceAfterItemDiscount-n};return o.createElement(p.az,l.cartBundleContainer,o.createElement(b.s,l.cartHeaderContainer,o.createElement(b.s,l.cartHeaderInfoContainer,o.createElement(C.E,l.cartBundleName,null==t?void 0:t.bundleName),o.createElement(b.s,l.cartHeaderPriceContainer,o.createElement(C.E,{"data-testid":"price"},o.createElement(u.Gr,{style:"currency",currency:a,value:(null==t?void 0:t.totalDiscountedPrice)-E})),!g&&o.createElement(o.Fragment,null,o.createElement(C.E,l.cartSuggestedPrice,o.createElement(u.Gr,{style:"currency",currency:a,value:null==t?void 0:t.totalPrice})),o.createElement(G.A,{label:f,variant:"light"})))),o.createElement(d.$,{onClick:n,"data-testid":"cart-item-remove-button",className:"js-personalization-remove-button","data-product-code":e.map((e=>e.productId)).join(",")},o.createElement(U.DeleteIcon,{w:"16px",h:"16px","data-product-code":e.map((e=>e.productId)).join(",")}))),e.map(((e,t)=>{const n={isOnSale:e.priceAfterItemDiscount<e.price,listPrice:e.price,unitPrice:e.priceAfterItemDiscount},i=(0,Ve.ec)(e);return o.createElement(Q.A,{variant:e,key:t},o.createElement(b.s,l.cartBundleItemContainer,o.createElement(z.A,{to:i},o.createElement(D.A,(0,r.A)({},l.cartBundleItemImage,{imageProps:null==l?void 0:l.cartImage}))),o.createElement(p.az,l.cartItemDetailContainer,o.createElement(b.s,l.infoLabelContainer,o.createElement(G.Y,{product:e,priceData:n,isBundle:!0})),o.createElement(p.az,l.cartItemHeaderStack,o.createElement(z.A,{to:i},o.createElement(B.A,l.cartItemName))),0===n.unitPrice?o.createElement(p.az,l.bundleFreeGiftLabel,o.createElement(A.A,{defaultMessage:[{type:0,value:"Free Gift"}],id:"bundle_free_gift.text"})):o.createElement(p.az,l.cartItemOmniAndPrice,o.createElement(C.E,null,o.createElement(u.Gr,{style:"currency",currency:a,value:h(e)})),n.isOnSale&&o.createElement(b.s,{gap:"0.5rem"},o.createElement(C.E,l.cartSuggestedPrice,o.createElement(u.Gr,{style:"currency",currency:a,value:e.price})),o.createElement(C.E,(0,r.A)({},l.cartSuggestedText,{color:"success.100"}),c({id:"item_variant.suggested_price",defaultMessage:[{type:0,value:"Suggested Price"}]})))),s&&o.createElement(p.az,l.cartItemVatDetails,o.createElement(P.z,null,o.createElement(V.A,{price:null==e?void 0:e.price,vatRate:null==e?void 0:e.c_taxRate}))))))})))};He.propTypes={bundleItems:_().arrayOf(_().object).isRequired,bundleDetails:_().shape({totalPrice:_().number,totalDiscountedPrice:_().number,discountPercentage:_().string,bundleName:_().string}),handleRemoveItem:_().func};const Qe=He;var Ke=n(11266),Ye=n(58884),Xe=n(43756),Ze=n(7146),Je=n(18801),et=n(37180),tt=n(75011),nt=n(21466),rt=n(73295),at=n(28387),lt=n(78539),ot=n(95106),it=n(29130),ut=n(32998);const ct=["product","isOpen","onClose","updateCart"];function dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function st(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?dt(Object(n),!0).forEach((function(t){(0,l.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const mt=e=>{var t,n,a,l;let{product:u,isOpen:c,onClose:d,updateCart:m}=e,v=(0,Je.A)(e,ct);const y=(0,ot.h)(u),{variationParams:f}=(0,L.K)(u),E=(0,o.useRef)({}),[g,h]=(0,o.useState)({}),[I,_]=(0,o.useState)([]),[A,k]=(0,o.useState)(null==y||null===(t=y.product)||void 0===t?void 0:t.quantity),C=(0,s.A)({base:!0,lg:!1});let O=null===(n=y.product)||void 0===n||null===(a=n.bundledProductItems)||void 0===a?void 0:a.map((({productId:e})=>e)).join(",");const P=I.map((({variant:e})=>e.productId)).join(",");(null==P?void 0:P.length)>0&&P!==O&&(O=P);const{data:S,isLoading:w}=(0,ie.useProducts)({parameters:{ids:O,expand:["availability","images"]},headers:{"x-debug":"bundle-product-index"}},{enabled:Boolean(O),keepPreviousData:!0}),M=(0,i.A)().formatMessage({defaultMessage:[{type:0,value:"Edit modal for "},{type:1,value:"productName"}],id:"cart.product_edit_modal.modal_label"},{productName:null==y||null===(l=y.product)||void 0===l?void 0:l.name});return o.createElement(et.aF,{size:"4xl",isOpen:c,onClose:d},o.createElement(tt.m,null),o.createElement(nt.$,{containerProps:{"data-testid":"product-view-modal"},"aria-label":M},o.createElement(rt.s,null),o.createElement(at.c,{pb:8,bg:"white",paddingBottom:6,marginTop:6},o.createElement(b.s,{direction:["column","column","column","row"]},o.createElement(p.az,{flex:1,mr:[0,0,0,6,6],display:["none","none","none","block"]},u?o.createElement(o.Fragment,null,o.createElement(it.A,{size:"sm",imageGroups:u.imageGroups,selectedVariationAttributes:f})):o.createElement(it.E,null)),o.createElement(lt.T,{align:"stretch",flex:1},o.createElement(p.az,{marginBottom:6},o.createElement(ut.A,(0,r.A)({showFullLink:!1,showImageGallery:C,product:y.product,isLoading:y.isFetching,updateCart:(e,t)=>m(e,t,I),validateOrderability:()=>Object.values(E.current).every((({validateOrderability:e})=>e())),childProductOrderability:g,setSelectedBundleQuantity:k},v))),S&&S.data.map(((e,t)=>{const n=st(st({},e),y.product.bundledProductItems[t]),r=n.quantity/u.quantity;return o.createElement(ut.A,{key:t,ref:function(e){E.current[n.itemId]={ref:e,validateOrderability:this.validateOrderability}},showImageGallery:!1,isProductPartOfBundle:!0,showFullLink:!1,product:n,isLoading:w,setChildProductOrderability:h,childOfBundleQuantity:r,selectedBundleParentQuantity:A,onVariantSelected:(e,n,r)=>{_((a=>{const l=a.slice(0);return l[t]={product:e,variant:n,quantity:r},l}))}})})))))))};mt.propTypes={isOpen:_().bool.isRequired,onOpen:_().func.isRequired,onClose:_().func.isRequired,product:_().object,isLoading:_().bool,updateCart:_().func};const pt=mt;function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const yt=({onOpen:e,promo:t,setSelectedPromotion:n,selectedFreeItems:a})=>{const i=(0,m.o5)("FreeItemPromo"),{promoBanner:u}=i||{},c=(null==t?void 0:t.maxBonusItems)||0,s=((null==a?void 0:a.items)||[]).reduce(((e,t)=>e+(t.quantity||1)),0),p=()=>{n(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){(0,l.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t)),e()},v=()=>o.createElement(o.Fragment,null,c>1&&(0===s||void 0===(null==a?void 0:a.items))?o.createElement(b.s,null==u?void 0:u.messageContainer,o.createElement(C.E,null==u?void 0:u.bannerText,o.createElement(A.A,{id:"cart.free_item_promo.banner_message_plural",defaultMessage:[{type:0,value:"You got "},{type:1,value:"count"},{type:0,value:" free products!"}],values:{count:c}})),o.createElement(d.$,(0,r.A)({onClick:()=>p(),variant:"text-button"},null==u?void 0:u.bannerButton),o.createElement(A.A,{id:"cart.free_item_promo.banner_button_plural",defaultMessage:[{type:0,value:"Add them!"}]}
1))):c>1&&s>0&&s<c?o.createElement(b.s,null==u?void 0:u.messageContainer,o.createElement(C.E,null==u?void 0:u.bannerText,c-s==1?o.createElement(A.A,{id:"cart.free_item.promo.banner_message_plural_intermediate",defaultMessage:[{type:0,value:"You can add another free product!"}]}):o.createElement(A.A,{id:"cart.free_item.promo.banner_message_plural_intermediate_count",defaultMessage:[{type:0,value:"You can add "},{type:1,value:"count"},{type:0,value:" more free products!"}],values:{count:c-s}})),o.createElement(d.$,(0,r.A)({onClick:()=>p(),variant:"text-button"},null==u?void 0:u.bannerButton),o.createElement(A.A,{id:"cart.free_item_promo.banner_button",defaultMessage:[{type:0,value:"Add it!"}]}))):o.createElement(b.s,null==u?void 0:u.messageContainer,o.createElement(C.E,null==u?void 0:u.bannerText,o.createElement(A.A,{id:"cart.free_item_promo.banner_message",defaultMessage:[{type:0,value:"You got a free product!"}]})),o.createElement(d.$,(0,r.A)({onClick:()=>p(),variant:"text-button"},null==u?void 0:u.bannerButton),o.createElement(A.A,{id:"cart.free_item_promo.banner_button",defaultMessage:[{type:0,value:"Add it!"}]})))),y=()=>o.createElement(b.s,null==u?void 0:u.container,o.createElement(C.E,null==u?void 0:u.labelText,o.createElement(A.A,{id:"carr.free_item_promo.banner_label",defaultMessage:[{type:0,value:"FREE GIFT"}]})));let f=null;return f=s>=c?o.createElement(o.Fragment,null):o.createElement(b.s,{w:"100%"},o.createElement(xe.A,{message:o.createElement(v,null),variant:"freeItemPromo",enableIcon:!1,enableCloseIcon:!1,promoLabel:o.createElement(y,null)})),f},ft=yt;yt.propTypes={onOpen:_().func,allowedItems:_().number,promo:_().object,setSelectedPromotion:_().func,selectedFreeItems:_().object};var bt=n(35677),Et=n(13155),gt=n(25610),ht=n(86375),It=n(4259),_t=n(14326),At=n(60505),kt=n(34406);const Ct=({product:e,actionButton:t,isGrey:n=!1})=>{const a=(0,m.o5)("FreeItemPromo"),l=(0,m.Vl)("ProductItem"),{promoTile:i}=a||{},{currency:c}=(0,N.H2)();return o.createElement(b.s,(0,r.A)({},null==i?void 0:i.container,{opacity:n?"0.5":"unset"}),o.createElement(Q.A,{variant:e},o.createElement(b.s,null==i?void 0:i.imageContainer,o.createElement(kt.A,{product:e,variant:"freeItemPromo",isInformativeLabelActive:!1})),o.createElement(b.s,null==i?void 0:i.subContainer,o.createElement(b.s,null==i?void 0:i.infoContainer,o.createElement(C.E,(0,r.A)({isTruncated:!0},null==i?void 0:i.productName),(null==e?void 0:e.c_variantIdentifier)||(null==e?void 0:e.name)||(null==e?void 0:e.productName)),o.createElement(b.s,{flexDir:"row",justifyContent:"center",alignItems:"center",gap:"xsmall.base"},o.createElement(u.Gr,{style:"currency",currency:c,value:0}),o.createElement(p.az,{display:"flex",flexDir:"row",justifyContent:"center",alignItems:"center",gap:"xsmall.base"},o.createElement(p.az,null==l?void 0:l.suggestedPrice,o.createElement(R.A,{currency:c,hasStrikethrough:!0,isFreeItemPromo:!0}))))),o.createElement(b.s,{flexShrink:"0",alignItems:"center"},t))))},Ot=Ct;function Pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function St(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(n),!0).forEach((function(t){(0,l.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ct.propTypes={product:_().object,useRadio:_().bool,actionButton:_().object,isGrey:_().bool};const wt=({onClose:e,isOpen:t,setSelectedFreeItems:n,selectedPromotion:l={},basketItems:i=[],handleRemoveItem:u})=>{var c;const{addItemToNewOrExistingBasket:y}=(0,ie.useShopperBasketsMutationHelper)(),{refetch:f}=(0,oe.X)(),E=(0,ie.useCommerceApi)(),{getTokenWhenReady:g}=(0,ie.useAccessToken)(),h=(0,m.Vl)("ProductFilterDrawer",{variant:"freeItemPromo"}),I=(0,s.A)({base:"bottom",md:"right"}),[_,k]=(0,o.useState)([]),[O,P]=(0,o.useState)([]),[S,w]=(0,o.useState)(!1),M=function(){var e=(0,a.A)((function*(){try{var e;w(!0);const t=((e,t=24)=>{const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n})((null==l||null===(e=l.bonusProducts)||void 0===e?void 0:e.map((e=>null==e?void 0:e.productId)))||[],24),n=yield g(),r=(yield Promise.all(t.map((e=>E.shopperProducts.getProducts({parameters:{ids:e.join(",")},expand:["availability","images"],headers:{Authorization:`Bearer ${n}`}}))))).flatMap((e=>(null==e?void 0:e.data)||[])),a=null==r?void 0:r.filter((e=>{var t;return(null==e||null===(t=e.inventory)||void 0===t?void 0:t.stockLevel)>0}));return w(!1),a}catch(e){return w(!1),console.error("Error getting products for promotion",e),[]}}
1));return function(){return e.apply(this,arguments)}}(),x=function(){var e=(0,a.A)((function*(){try{yield f()}catch(e){console.error("Failed to refresh basket",e)}}));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((()=>{null!=l&&l.id&&function(){var e=(0,a.A)((function*(){yield x();const e=yield M();null!=e&&e.length&&k(e)}));return function(){return e.apply(this,arguments)}}()()}),[l]),(0,o.useEffect)((()=>{if(null==l||!l.id||!_.length)return;const e=i.filter((e=>(null==e?void 0:e.bonusDiscountLineItemId)===l.id)),t={};for(const n of e)t[n.productId]=(t[n.productId]||0)+1;const n=Object.entries(t).map((([e,t])=>{const n=_.find((t=>t.id===e));return n?St(St({},n),{},{quantity:t}):{id:e,quantity:t}}));P(n)}),[null==l?void 0:l.id,i,_]);const T=(null==l?void 0:l.id)||"",j=(null==l?void 0:l.maxBonusItems)||0,z=1===j,D=O.reduce(((e,t)=>e+(t.quantity||1)),0),B=e=>{z?P([St(St({},e),{},{quantity:1})]):q(e,1)},q=(e,t)=>{P((n=>{const r=n.find((t=>t.id===e.id)),a=(r?r.quantity||1:0)+t;if(a<0)return n;if(n.reduce(((t,n)=>n.id===e.id?t:t+(n.quantity||1)),0)+a>j)return n;if(0===a){const t=i.find((t=>t.productId===e.id&&(null==t?void 0:t.bonusDiscountLineItemId)===T));return t&&u(t,(null==t?void 0:t.c_variantIdentifier)||(null==t?void 0:t.name)||(null==t?void 0:t.productName),100,!1),n.filter((t=>t.id!==e.id))}return r?n.map((t=>t.id===e.id?St(St({},t),{},{quantity:a}):t)):[...n,St(St({},e),{},{quantity:a})]}))},N=function(){var t=(0,a.A)((function*(){const t=O||[];if(!t.length)return;const r=t.flatMap((e=>{const t=e.id||e.productId,n=(e.quantity||1)-i.filter((e=>e.productId===t&&(null==e?void 0:e.bonusDiscountLineItemId)===T)).length;return n<=0?[]:Array.from({length:n},(()=>({productId:t,price:e.price,quantity:1,bonusDiscountLineItemId:T,bonusProductLineItem:null==e?void 0:e.bonusProductLineItem,c_MaterialGroup:null==e?void 0:e.c_MaterialGroup,c_subModelIdentifier:null==e?void 0:e.c_subModelIdentifier})))}));try{r.length&&(yield y(r)),n((e=>St(St({},e),{},{[T]:St(St({},e[T]),{},{items:O})})))}catch(e){console.error("Failed to add free items to basket",e)}finally{yield f(),e()}}));return function(){return t.apply(this,arguments)}}();return o.createElement(bt._,{variant:"filter",isOpen:t,onClose:e,placement:I,closeOnEsc:!0,closeOnOverlayClick:!0},o.createElement(tt.m,null),o.createElement(Et.z,null,z&&o.createElement(gt.r,null==h?void 0:h.header,o.createElement(b.s,null==h?void 0:h.titleContainer,o.createElement(C.E,(0,r.A)({},null==h?void 0:h.headerText,{w:"100%"}),o.createElement(A.A,{id:"cart.free_item_promo_drawer.header_title",defaultMessage:[{type:0,value:"Select a free product!"}]})),o.createElement(U.CloseIcon,(0,r.A)({"data-testid":"close-icon",onClick:e},null==h?void 0:h.closeButton)))),!z&&o.createElement(gt.r,null==h?void 0:h.headerMulti,o.createElement(b.s,{flexDirection:"column",w:"100%"},o.createElement(b.s,null==h?void 0:h.titleContainerMulti,o.createElement(C.E,(0,r.A)({},null==h?void 0:h.headerText,{w:"100%"}),o.createElement(A.A,{id:"cart.free_item_promo_drawer.header_title_plural",defaultMessage:[{type:0,value:"Select "},{type:1,value:"count"},{type:0,value:" free products!"}],values:{count:j}})),o.createElement(U.CloseIcon,(0,r.A)({"data-testid":"close-icon",onClick:e},null==h?void 0:h.closeButton))),o.createElement(b.s,{flexDirection:"column",w:"100%",gap:"1rem"},o.createElement(b.s,{position:"relative",h:"1rem",borderRadius:"0.5rem",bg:"background.light",alignItems:"center"},0===D?o.createElement(p.az,{w:"0.75rem",h:"0.75rem",ml:"0.125rem",borderRadius:"50%",bg:"background.dark",flexShrink:0}):o.createElement(ht.k,{value:D/j*100,h:"0.75rem",w:"100%",bg:"transparent",mx:"0.125rem",sx:{"& > div":{backgroundColor:"background.dark",borderRadius:"0.375rem"}}})),D<j?o.createElement(C.E,null==h?void 0:h.remainingText,o.createElement(A.A,{id:"cart.free_item_promo_drawer.remaining_count",defaultMessage:[{type:0,value:"You can still select "},{type:1,value:"count"},{type:0,value:" "},{type:6,value:"count",options:{one:{value:[{type:0,value:"product"}]},other:{value:[{type:0,value:"products"}]}},offset:0,pluralType:"cardinal"}],values:{count:j-D}})):o.createElement(C.E,null==h?void 0:h.remainingText,o.createElement(A.A,{id:"cart.free_item_promo_drawer.all_selected",defaultMessage:[{type:0,value:"You have selected all "},{type:1,value:"count"},{type:0,value:" free gift products"}],values:{count:j}}
1))))),o.createElement(at.c,null==h?void 0:h.body,S?o.createElement(ee.A,null):z&&(null==_?void 0:_.length)>0?o.createElement(It.z,{value:(null===(c=O[0])||void 0===c?void 0:c.id)||"",width:"100%",onChange:e=>{const t=_.find((t=>t.id===e));t&&B(t)}},o.createElement(v.B,{gap:"1rem",paddingTop:"1rem"},_.map((e=>o.createElement(b.s,{key:`${T}-${e.id}`,onClick:t=>{var n;null!=t&&null!==(n=t.target)&&void 0!==n&&n.closest("[data-stop-propagation]")||B(e)}},o.createElement(Ot,{product:e,actionButton:o.createElement(_t.s,{value:e.id,display:"inline-flex",height:{base:"44px",lg:"24px"},borderWidth:"0.0375rem",isChecked:O.some((t=>t.id===e.id)),"data-stop-propagation":!0,onClick:e=>e.stopPropagation()})})))))):o.createElement(v.B,{gap:"1rem",paddingTop:"1rem",width:"100%"},_.map((e=>{const t=(e=>{const t=O.find((t=>t.id===e));return(null==t?void 0:t.quantity)||0})(e.id),n=0===t&&D>=j;return o.createElement(b.s,{key:`${T}-${e.id}`},o.createElement(Ot,{product:e,actionButton:n?null:o.createElement(F.A,{value:t,min:0,max:t+(j-D),step:1,onChange:(n,r)=>{const a=r-t;0!==a&&q(e,a)},productName:(null==e?void 0:e.c_variantIdentifier)||(null==e?void 0:e.name)||(null==e?void 0:e.productName),variant:"freeItemPromo"})}))})))),o.createElement(At.j,{display:"block",width:"full",height:"auto"},o.createElement(v.B,null,o.createElement(d.$,{width:"full",variant:"primary",isDisabled:D<j,onClick:N},o.createElement(A.A,{id:"cart.free_item_promo_drawer.footer.button_text",defaultMessage:[{type:0,value:"Return to the cart"}]}))))))},Mt=wt;wt.propTypes={onClose:_().func,isOpen:_().bool,promoProducts:_().array,setSelectedFreeItems:_().func,selectedPromotion:_().object,basketItems:_().array,basketId:_().string,handleRemoveItem:_().func};var xt=n(25673),Tt=n(2140);function jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(n),!0).forEach((function(t){(0,l.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Dt=()=>{var e,t,n,l,I,_,A,k,C,O,P,S,w;const{data:M,isLoading:x}=(0,oe.X)(),T=(0,Fe.A)(),j=(0,Y.I8)("notShoppableCountry"),z=(0,Y._d)("wazzupConfiguration"),{addLayer:D}=(0,X.W)(),{isOpen:B,onOpen:F,onClose:q}=(0,Xe.SM)(),N=(0,o.useRef)(!1),[L,R]=(0,o.useState)(!1),W=(null==M||null===(e=M.productItems)||void 0===e?void 0:e.map((({productId:e})=>e)).join(","))??"",U=((null==M?void 0:M.bonusDiscountLineItems)||[]).filter((e=>null==e?void 0:e.promotionId.includes("Bonus_product"))),{data:$,isLoading:G}=(0,ie.useProducts)({parameters:{ids:W,perPricebook:!0,expand:["availability","images","prices","promotions"]},headers:{"x-debug":"cart-index"}},{enabled:Boolean(W),select:e=>{var t;return null==e||null===(t=e.data)||void 0===t?void 0:t.reduce(((e,t)=>(e[t.id]=t,e)),{})}}),{data:V}=(0,ge.J)(),{customerId:H,isRegistered:Q}=V,ee=(0,Se.useLocation)(),te=new URLSearchParams(ee.search),ne=te.get("isBalanceExceeded"),ae=te.get("balanceDataError"),{isOpen:le,onOpen:ue,onClose:ce}=(0,c.j)(),{isOpen:de,onOpen:se,onClose:ye}=(0,c.j)(),{isQuantityAllowed:be,getMaxQuantityErrorMessage:he,getMaxQuantity:Ie}=(0,re.v)(),{formatMessage:_e}=(0,i.A)(),{customParams:Ae}=(0,je.getConfig)(),Oe="https://"+Ae.currentHost+ee.pathname,we=(0,u.zR)({defaultMessage:[{type:0,value:"Basket"}],id:"cart_title.title.cart_title"}),Me={"@context":"https://schema.org/","@type":"WebPage",name:_e(we),description:_e(we),url:Oe},[xe,De]=(0,o.useState)({}),[We,Ve]=(0,o.useState)({});(0,o.useEffect)((()=>{const e=localStorage.getItem("promoSelectedFreeItems");e&&De(JSON.parse(e))}),[]),(0,o.useEffect)((()=>{j&&T("/")}),[j,T]);const He=(0,o.useRef)({}),Je=(0,o.useMemo)((()=>{if(null==M||!M.productItems)return[];const e={},t=[];for(const n of M.productItems){const r=null==n?void 0:n.bonusDiscountLineItemId;r?(e[r]||(e[r]=[]),e[r].push(n)):t.push(n)}const n=He.current,r=[];for(const[t,a]of Object.entries(e)){const e=n[t]||[];(a.length!==e.length||a.some(((t,n)=>{var r;return t.id!==(null===(r=e[n])||void 0===r?void 0:r.id)})))&&r.push(t)}const a=r.flatMap((t=>e[t])),l=Object.entries(e).filter((([e])=>!r.includes(e))).flatMap((([,e])=>e));return He.current=e,[...a.reverse(),...l.reverse(),...t]}),[null==M?void 0:M.productItems]),et=(0,Ke.W6)();(0,o.useEffect)((()=>{B&&q()}),[ee.pathname]),(0,o.useEffect)((()=>{(ae||ne)&&(ue(),te.delete("isBalanceExceeded"),et.replace({search:te.toString()}))}),[ae,ne,te,T]),(0,o.useEffect)((()=>{localStorage.setItem("promoSelectedFreeItems",JSON.stringify(xe))}),[xe]),(0,o.useEffect)((()=>
1{if(null==M||!M.productItems)return;const e={};for(const t of M.productItems){const n=null==t?void 0:t.bonusDiscountLineItemId;n&&(e[n]||(e[n]={}),e[n][t.productId]=(e[n][t.productId]||0)+1)}De((t=>{const n=zt({},t);let r=!1;for(const t of Object.keys(n)){var a;const l=e[t]||{},o=(null===(a=n[t])||void 0===a?void 0:a.items)||[],i=o.map((e=>{const t=l[e.id]||0;return 0===t?null:(e.quantity||1)!==t?zt(zt({},e),{},{quantity:t}):e})).filter(Boolean);(i.length!==o.length||i.some(((e,t)=>{var n;return(e.quantity||1)!==((null===(n=o[t])||void 0===n?void 0:n.quantity)||1)})))&&(n[t]=zt(zt({},n[t]),{},{items:i}),r=!0)}return r?n:t}))}),[null==M?void 0:M.productItems]);const tt=[];null==M||null===(t=M.productItems)||void 0===t||t.forEach((e=>{var t;null==e||null===(t=e.bundledProductItems)||void 0===t||t.forEach((e=>{tt.push(e.productId)}))}));const{data:nt}=(0,ie.useProducts)({parameters:{ids:null==tt?void 0:tt.join(","),expand:["availability","images","prices","promotions"],perPricebook:!0,select:"(data.(id,inventory,type))"},headers:{"x-debug":"cart2-index"}},{enabled:(null==tt?void 0:tt.length)>0,keepPreviousData:!0,select:e=>{var t;return null==e||null===(t=e.data)||void 0===t?void 0:t.reduce(((e,t)=>(e[t.id]=t,e)),{})}}),rt=(0,o.useMemo)((()=>{var e;const t={};return null==M||null===(e=M.productItems)||void 0===e||e.forEach((e=>{let n=null==$?void 0:$[null==e?void 0:e.productId];if(null!=e&&e.bundledProductItems&&nt){var r,a,l;let t=(null===(r=n)||void 0===r||null===(a=r.inventory)||void 0===a?void 0:a.stockLevel)??Number.MAX_SAFE_INTEGER,o="";null==e||e.bundledProductItems.forEach((e=>{var n,r;const a=(null==nt||null===(n=nt[e.productId])||void 0===n||null===(r=n.inventory)||void 0===r?void 0:r.stockLevel)??Number.MAX_SAFE_INTEGER;t=Math.min(t,a),t===a&&(o=e.productName)})),null!==(l=n)&&void 0!==l&&l.inventory&&(n=zt(zt({},n),{},{inventory:zt(zt({},n.inventory),{},{stockLevel:t,lowestStockLevelProductName:o})}))}t[e.itemId]=n})),t}),[M,$,nt]);(0,o.useEffect)((()=>{var e,t;N.current||!rt||x||(D(Z.$x.bind(void 0)),D(Z.I1.bind(void 0,{event:"view_cart",currency:null==M?void 0:M.currency,value:(null==M?void 0:M.orderTotal)||(null==M?void 0:M.productTotal),items:null!=M&&null!==(e=M.productItems)&&void 0!==e&&e.length?null==M||null===(t=M.productItems)||void 0===t?void 0:t.map((e=>{var t;const n=zt(zt(zt({},e),rt&&rt[e.itemId]),{},{price:null==e?void 0:e.price,quantity:st[e.itemId]?st[e.itemId]:e.quantity});return{item_name:null==n?void 0:n.c_defaultName,item_id:(null==n?void 0:n.id)||(null==n?void 0:n.productId),item_category:null==n?void 0:n.c_defaultCategoryName,item_variant:null==n?void 0:n.c_subModelIdentifier,price:parseFloat((((null==n?void 0:n.price)-(null==n?void 0:n.tax))/(null==n?void 0:n.quantity)).toFixed(2)),fullprice:null!==(t=(0,J.mY)(n))&&void 0!==t&&t.isOnSale?"reduced":"fullprice",rating_points:"",erp_category:null==n?void 0:n.c_MaterialGroup,prdha_category:null==n?void 0:n.c_prdhaCategory,quantity:null==n?void 0:n.quantity}})):[]})),N.current=!0)}),[x,rt]);const at=(0,ie.useShopperBasketsMutation)("updateItemInBasket"),lt=(0,ie.useShopperBasketsMutation)("updateItemsInBasket"),ot=(0,ie.useShopperBasketsMutation)("removeItemFromBasket"),it=(0,ie.useShopperBasketsMutation)("updateShippingMethodForShipment"),{addItemToNewOrExistingBasket:ut}=(0,ie.useShopperBasketsMutationHelper)(),[ct,dt]=(0,o.useState)(void 0),[st,mt]=(0,o.useState)({}),[vt,yt]=(0,o.useState)({}),[bt,Et]=(0,o.useState)(!1),gt=(0,o.useRef)(null),{validateWarrantyBeforeAction:ht,clearBasket:It}=(0,Tt.k)({basket:M,onValidationFail:()=>{var e;return null===(e=gt.current)||void 0===e?void 0:e.onOpen()}}),{isOpen:_t,onOpen:At,onClose:kt}=(0,c.j)(),{isOpen:Ct,onClose:Ot}=(0,c.j)({defaultIsOpen:!0}),Pt=(0,Ne.d)(),St=(0,c.j)(),wt=(0,o.useRef)(!1),{data:jt}=(0,ie.useShippingMethodsForShipment)({parameters:{basketId:null==M?void 0:M.basketId,shipmentId:"me"}},{enabled:!(null==M||!M.basketId)&&!1===wt.current});(0,o.useEffect)((()=>{null!=jt&&jt.defaultShippingMethodId&&(it.mutate({parameters:{basketId:null==M?void 0:M.basketId,shipmentId:"me"},body:{id:null==jt?void 0:jt.defaultShippingMethodId}}),wt.current=true)}),[jt]);const Dt=()=>{L||(R(!0),Pt({title:_e(Le.gS),status:"error"})),setTimeout((()=>{R(!1)}),5e3)},{data:Bt}=(0,qe.T)(),Ft=(0,ie.useShopperCustomersMutation)("createCustomerProductListItem"),qt=function(){var e=(0,a.A)((function*(e){try{var t;if(!H||!Bt)return;(null==Bt||null===(t=Bt.customerProductListItems)||void 0===t?void 0:t.find((t=>t.productId===(null==e?void 0:e.id))))?Pt({title:_e(Le.p7),status:"info",action:o.createElement(d.$,{"aria-label":_e({id:"cart.button.view_wishlist.label",defaultMessage:[{type:0,value:"View Wishlist"}]}),variant:"link",onClick:()=>T("/account/wishlist")},_e(Le.D$))}):(yield Ft.mutateAsync({parameters:{listId:Bt.id,customerId:H},body:{quantity:e.quantity,productId:e.productId,public:!0,priority:1,type:"product"}}),Pt({title:_e(Re.FD,{quantity:1}),status:"success"}))}catch{Dt()}}));return function(t){return e.apply(this,arguments)}}(),Nt=function(){var e=(0,a.A)((function*(e,t){kt();try{var n;Et(!0);const r=null==M||null===(n=M.productItems)||void 0===n?void 0:n.map((({productId:e})=>e));
1if(ct.id!==e.productId&&!r.includes(e.productId)){const n={productId:e.productId,quantity:t,price:e.price};return yield at.mutateAsync({parameters:{basketId:M.basketId,itemId:ct.itemId},body:n})}if(ct.id!==e.productId&&r.includes(e.productId)){yield ot.mutateAsync({parameters:{basketId:M.basketId,itemId:ct.itemId}});const n=M.productItems.find((({productId:t})=>t===e.productId)),r=t+n.quantity;return yield Vt(r,n)}if(ct.quantity!==t)return yield Vt(t,ct)}catch{Dt()}finally{Et(!1),dt(void 0)}}));return function(t,n){return e.apply(this,arguments)}}(),Lt=function(){var e=(0,a.A)((function*(e,t,n){kt();try{Et(!0);const r=(0,$e.NM)(e,n);e.quantity!==t&&r.unshift({itemId:e.itemId,productId:e.productId,quantity:t}),r.length&&(yield lt.mutateAsync({method:"PATCH",parameters:{basketId:M.basketId},body:r}))}catch{Dt()}finally{Et(!1),dt(void 0)}}));return function(t,n,r){return e.apply(this,arguments)}}(),Rt=function(){var e=(0,a.A)((function*(e,t){try{const n=vt[e.itemId];yt(zt(zt({},vt),{},{[e.itemId]:t})),Et(!0),dt(e),yield at.mutateAsync({parameters:{basketId:null==M?void 0:M.basketId,itemId:e.itemId},body:{productId:e.id,quantity:parseInt(e.quantity),gift:t}},{onSettled:()=>{Et(!1),dt(void 0)},onSuccess:()=>{yt(zt(zt({},vt),{},{[e.itemId]:void 0}))},onError:()=>{yt(zt(zt({},vt),{},{[e.itemId]:n})),Dt()}})}catch(e){Dt()}finally{Et(!1),dt(void 0)}}));return function(t,n){return e.apply(this,arguments)}}(),Wt=function(){var e=(0,a.A)((function*(e){var t;const n=null==M||null===(t=M.productItems)||void 0===t?void 0:t.filter((t=>null==e?void 0:e.includes(t.productId)));yield Promise.all(n.map(function(){var e=(0,a.A)((function*(e){yield Jt(e)}));return function(t){return e.apply(this,arguments)}}()))}));return function(t){return e.apply(this,arguments)}}(),Ut={},$t=(null==M||null===(n=M.c_additionalData)||void 0===n?void 0:n.allBundlesDetails)||{};null==M||null===(l=M.productItems)||void 0===l||l.forEach((e=>{e.c_isBundle&&e.c_UUIDBundle&&(Ut[e.c_UUIDBundle]||(Ut[e.c_UUIDBundle]={items:[],details:$t[e.c_UUIDBundle]||{}}),Ut[e.c_UUIDBundle].items.push((e=>zt(zt(zt({},e),rt&&rt[e.itemId]),{},{isProductUnavailable:G?void 0:!(null!=rt&&rt[e.itemId]),price:e.price,quantity:st[e.itemId]?st[e.itemId]:e.quantity}))(e)))}));const Gt=null!=M&&M.c_allSubscriptionsDetails?JSON.parse(M.c_allSubscriptionsDetails):{},Vt=Ue()(function(){var e=(0,a.A)((function*(e,t){const n=st[t.itemId]||t.quantity;var r;mt(zt(zt({},st),{},{[t.itemId]:e})),Et(!0),dt(t),yield at.mutateAsync({parameters:{basketId:null==M?void 0:M.basketId,itemId:t.itemId},body:{productId:t.id,quantity:parseInt(e)}},{onSettled:()=>{Et(!1),dt(void 0)},onSuccess:(r=(0,a.A)((function*(r){var a;mt(zt(zt({},st),{},{[t.itemId]:void 0}));const l=null==r||null===(a=r.productItems)||void 0===a?void 0:a.find((e=>e.itemId===t.itemId)),o=((null==l?void 0:l.quantity)||e)-n;if(0!==o){var i;const e=o>0?"add_to_cart":"remove_from_cart",r=(null==rt?void 0:rt[t.itemId])||{};yield D(Z.$x),yield D(Z.I1.bind(void 0,{event:e,currency:null==M?void 0:M.currency,bundle:"false",items:[{item_name:(null==r?void 0:r.c_defaultName)||(null==t?void 0:t.productName),item_id:(null==t?void 0:t.id)||(null==t?void 0:t.productId),item_category:(null==r?void 0:r.c_defaultCategoryName)||(null==t?void 0:t.c_categoryName),item_variant:(null==r?void 0:r.c_subModelIdentifier)||(null==t?void 0:t.c_subModelIdentifier),price:parseFloat((((null==t?void 0:t.price)-((null==t?void 0:t.tax)||0))/n).toFixed(2)),fullprice:null!==(i=(0,J.mY)(r))&&void 0!==i&&i.isOnSale?"reduced":"fullprice",rating_points:"",erp_category:(null==r?void 0:r.c_materialGroup)||(null==t?void 0:t.c_MaterialGroup),prdha_category:(null==r?void 0:r.c_prdhaCategory)||(null==t?void 0:t.c_prdhaCategory),quantity:Math.abs(o)}]}))}})),function(e){return r.apply(this,arguments)}),onError:()=>{mt(zt(zt({},st),{},{[t.itemId]:n})),Dt()}})}));return function(t,n){return e.apply(this,arguments)}}(),750),Ht=function(){var e=(0,a.A)((function*(e){yield ut([{productId:e.productId,quantity:1}])}));return function(t){return e.apply(this,arguments)}}(),Qt=function(){var e=(0,a.A)((function*(e,t){const n=null==rt?void 0:rt[e.itemId],r=(0,K.Ke)(n);let a;var l,o;a=r.isPreorder||r.isBackorder?Ie(n)||2:(null==rt||null===(l=rt[e.itemId])||void 0===l||null===(o=l.inventory)||void 0===o?void 0:o.stockLevel)??1;const i=t>e.quantity;if(Boolean(null==e?void 0:e.c_UUIDWarranty)&&i){Vt.cancel(),dt(e),Et(!0);try{return yield Ht(e),!1}catch(e){return Dt(),!1}finally{Et(!1),dt(void 0)}}if(i&&!be(n,0,t)){const e=Ie(n);return Pt({title:he(e),status:"error"}),!1}return 0===t?(Vt.flush(),dt(e),St.onOpen(),!1):(Vt.cancel(),t>a||t===e.quantity||Vt(t,e),!0)}));return function(t,n){return e.apply(this,arguments)}}(),{onOpen:Kt,onClose:Yt}=(0,c.j)(),[Xt,Zt]=(0,o.useState)([]),Jt=function(){var e=(0,a.A)((function*(e,t,n=0,r=!0){const l=`${(null==e?void 0:e.c_variantIdentifier)||(null==e?void 0:e.name)||(null==e?void 0:e.productName)||t||(null==e?void 0:e.c_defaultName)} ${_e({id:"cart_default.remove_message.deleteMessage",defaultMessage:[{type:0,value:"is being removed"}]})}
1`,o=(null==e?void 0:e.productId)||(null==e?void 0:e.id);r&&(((e,t)=>{Zt((n=>{const r=n.some((e=>e.id===t));return r?n:[...n,{id:t,text:e}]})),setTimeout((()=>{Zt((e=>e.filter((e=>e.id!==t))))}),5e3)})(l,o),Kt()),dt(e),setTimeout((0,a.A)((function*(){try{yield ot.mutateAsync({parameters:{basketId:M.basketId,itemId:e.itemId}},{onSettled:()=>{Et(!1),dt(void 0)},onError:()=>{Dt()}}),null!=e&&e.bonusDiscountLineItemId&&(t=null==e?void 0:e.bonusDiscountLineItemId,n=null==e?void 0:e.productId,De((e=>{var r;const a=(null===(r=e[t])||void 0===r?void 0:r.items)||[],l=a.find((e=>e.id===n));let o;return o=l&&(l.quantity||1)>1?a.map((e=>e.id===n?zt(zt({},e),{},{quantity:(e.quantity||1)-1}):e)):a.filter((e=>e.id!==n)),zt(zt({},e),{},{[t]:zt(zt({},e[t]),{},{items:o})})})))}catch(e){Et(!1),Dt()}var t,n})),n)}));return function(t,n){return e.apply(this,arguments)}}(),en=()=>{dt(null),Zt([]),Yt()};(0,o.useEffect)((()=>{var e;window._etmc=window._etmc||[],window._etmc&&M&&(null==M?void 0:M.productItems)&&window._etmc.push(["trackCart",null==M||null===(e=M.productItems)||void 0===e?void 0:e.map((e=>({item:null==e?void 0:e.productId,quantity:null==e?void 0:e.quantity,price:null==e?void 0:e.price,unique_id:null==e?void 0:e.productId,category:"placeholder"})))])}),[null==V?void 0:V.email,M]);const tn=(0,s.A)({base:"base",md:"md",lg:"lg"}),nn=(0,m.o5)("Cart",{});return x?o.createElement(g.A,null):x||null!=M&&null!==(I=M.productItems)&&void 0!==I&&I.length?o.createElement(p.az,(0,r.A)({},null==nn||null===(_=nn.cart)||void 0===_?void 0:_.boxContainer,{"data-testid":"sf-cart-container",layerStyle:"page","data-gtm":"cart-page"}),o.createElement(ze.Helmet,null,o.createElement("script",{type:"application/ld+json"},JSON.stringify(Me,null,2))),Ct?o.createElement(Pe,{onClose:Ot}):null,o.createElement(v.B,{w:"100%"},o.createElement(fe,null),o.createElement(y.x,null==nn||null===(A=nn.cart)||void 0===A?void 0:A.containerGrid,o.createElement(f.E,null,Xt.length>0&&o.createElement(p.az,{pb:"medium.base"},Xt.map((e=>o.createElement(Te,{key:e.id,onClose:en,message:e.text})))),U.length>0&&o.createElement(b.s,{w:"100%",gap:"small.base",flexDir:"column",paddingBottom:"medium.base"},U.map((e=>o.createElement(ft,{onOpen:se,key:null==e?void 0:e.id,promo:e,setSelectedPromotion:Ve,selectedFreeItems:xe[null==e?void 0:e.id]||{}})))),o.createElement(E.r,{gap:"medium.base"},Object.entries(Ut).map((([e,{items:t,details:n}],r)=>o.createElement(Qe,{key:`${e}-${r}`,bundleItems:t,bundleDetails:n,handleRemoveItem:()=>Jt(null==t?void 0:t[0])}))),Object.entries(Gt).map((([e,t],n)=>{const r=null==M?void 0:M.productItems.find((t=>(null==t?void 0:t.c_UUIDSubscription)===e)),a=zt(zt({},t),{},{master:r});return o.createElement(Ye.A,{key:`${e}-${n}`,details:t,handleRemoveItem:()=>Jt(null==a?void 0:a.master,null==t?void 0:t.subscriptionName)})})),null==Je?void 0:Je.map(((e,t)=>{if(!(null!=e&&e.c_isBundle||null!=e&&e.c_isSubscription||null!=e&&e.c_isWarranty))return o.createElement(me,{key:null!=e&&e.bonusProductLineItem&&null!=e&&e.bonusDiscountLineItemId?`${e.productId}-${null==e?void 0:e.bonusDiscountLineItemId}-${t}`:e.itemId,index:t,secondaryActions:o.createElement(ke,{isAGift:vt[e.itemId]?vt[e.itemId]:e.gift,onIsAGiftChange:Rt,onAddToWishlistClick:qt,onEditClick:e=>{dt(e),At()},onRemoveItemClick:()=>{const t=rt?rt[e.itemId]:{};Jt(zt(zt({},e),{},{name:(null==t?void 0:t.c_variantIdentifier)||(null==t?void 0:t.name)||(null==t?void 0:t.productName)}))},productData:e}),product:zt(zt(zt({},e),rt&&rt[e.itemId]),{},{isProductUnavailable:G?void 0:!(null!=rt&&rt[e.itemId]),price:e.price,quantity:st[e.itemId]?st[e.itemId]:e.quantity}),onItemQuantityChange:Qt.bind(void 0,e),showLoading:bt&&(null==ct?void 0:ct.itemId)===e.itemId,handleRemoveItem:Jt,officinaEditParams:null==e?void 0:e.c_officinaConfigurationId,officinaImage:null==e?void 0:e.c_officinaConfigurationImage,isCart:!0,onAddToCartModalOpen:F})})),"lg"===tn?o.createElement(p.az,{id:"cart_product_recommendations",overflowX:"hidden"}):o.createElement(o.Fragment,null)),o.createElement(p.az,null,_t&&!ct.bundledProductItems&&o.createElement(Ze.A,{isOpen:_t,onOpen:At,onClose:kt,product:ct,updateCart:(e,t)=>Nt(e,t)}),_t&&ct.bundledProductItems&&o.createElement(pt,{isOpen:_t,onOpen:At,onClose:kt,product:ct,updateCart:(e,t,n)=>Lt(e,t,n)}))),o.createElement(f.E,null,o.createElement(v.B,null==nn||null===(k=nn.cart)||void 0===k?void 0:k.orderSummaryContainer,o.createElement(h.A,{showPromoCodeForm:!(null!=M&&null!==(C=M.couponItems)&&void 0!==C&&C.length),isEstimate:!0,basket:M,handleUnavailableProducts:Wt,showSubscriptionsCheck:null==M?void 0:M.c_containsSubscription,validateWarrantyBeforeAction:ht}),o.createElement(p.az,null==nn||null===(O=nn.cart)||void 0===O?void 0:O.checkoutItem,o.createElement(pe.A,null)),o.createElement(p.az,null==nn||null===(P=nn.cart)||void 0===P?void 0:P.checkoutItemWhite,o.createElement(ve.A,null)),o.createElement(p.az,null==nn||null===(S=nn.cart)||void 0===S?void 0:S.checkoutItemWhite,o.createElement(Ce.A,null)))),"md"===tn||"base"===tn||"sm"===tn?o.createElement(f.E,{overflowX:"hidden",id:"cart_product_recommendations"}):o.createElement(o.Fragment,null))),o.createElement(Ge.A,{productItems:null==M?void 0:M.productItems,handleUnavailableProducts:Wt}),o.createElement(xt.A,{ref:gt,handleClearBasket:It}),o.createElement(Ee.A,{"data-testid":"excedd-employee-balance-modal",onAlternateAction:(0,a.A)((function*(){ce()})),title:_e({defaultMessage:[{type:0,value:"Error"}],id:"confirmation_employee_modal.title"}),description:_e({defaultMessage:[{type:0,value:"Some products exceed the employee balance"}],id:"confirmation_employee_modal.description"}),isOpen:le}),o.createElement(Mt,{isOpen:de,onClose:ye,setSelectedFreeItems:De,selectedPromotion:We,basketItems:null==M?void 0:M.productItems,basketId:M.basketId,handleRemoveItem:Jt,productsByItemId:rt}),z&&o.createElement(o.Fragment,null,o.createElement("div",{className:"w-cart-page"}),null==M||null===(w=M.productItems)||void 0===w?void 0:w.map((e=>{var t,n,r,a,l;const i=(null==rt?void 0:rt[e.itemId])||{},u=null===(t=i.imageGroups)||void 0===t||null===(n=t[0])||void 0===n||null===(r=n.images)||void 0===r?void 0:r[0],c=`https://${Ae.currentHost}`,d=(null==u?void 0:u.disBaseLink)||(null==u?void 0:u.link)||"",s=`${c}/s/${e.productId}`,m=(null===(a=e.c_variationValues)||void 0===a?void 0:a.color)||"-",p=(null===(l=e.c_variationValues)||void 0===l?void 0:l.size)||"
1-";return o.createElement("div",{key:e.itemId,className:"w-cart",code:e.productId,name:i.name||e.productName,color:m,ref:e=>{e&&e.setAttribute("size",p)},price:e.price,image:d,link:s})})))):o.createElement(Be,{isRegistered:Q,removeMessages:Xt})};Dt.getTemplateName=()=>"cart";const Bt=Dt},33443:(e,t,n)=>{n.d(t,{A:()=>b});var r=n(64180),a=n(77810),l=n(34692),o=n(73352),i=n(78539),u=n(45915),c=n(40133),d=n(72030),s=n(54957),m=n(28467),p=n(25635),v=n(68066);const y=[{key:"applepay",icon:p.ApplepayIcon,label:{id:"payment_methods.applepay.label",defaultMessage:"Apple Pay payment method"}},{key:"amex",icon:p.AmericanexpressIcon,label:{id:"payment_methods.amex.label",defaultMessage:"American Express payment method"}},{key:"mastercard",icon:p.MastercardIcon,label:{id:"payment_methods.mastercard.label",defaultMessage:"Mastercard payment method"}},{key:"paypal",icon:p.PaypalIcon,label:{id:"payment_methods.paypal.label",defaultMessage:"PayPal payment method"}},{key:"klarna",icon:p.KlarnaIcon,label:{id:"payment_methods.klarna.label",defaultMessage:"Klarna payment method"}},{key:"visa",icon:p.VisaIcon,label:{id:"payment_methods.visa.label",defaultMessage:"Visa payment method"}},{key:"twint",icon:p.TwintIcon,label:{id:"payment_methods.twint.label",defaultMessage:"Twint payment method"}}],f=["mastercard","visa","amex"],b=()=>{var e;const t=(0,o.o5)("Cart",{}),{formatMessage:n}=(0,l.A)(),{paymentMethods:p}=t,{data:b}=(0,s.X)(),{locale:E}=(0,v.A)(),g=(0,m.mE)("paymentLogosOrderSummary"),h=null==b||null===(e=b.productItems)||void 0===e?void 0:e.some((e=>null==e?void 0:e.c_isSubscription));let I;return I=h?y.filter((e=>f.includes(e.key))):g?Object.entries(g).map((([e,t])=>({key:e,src:t}))):y.filter((e=>"twint"!==e.key||"fr-ch"===E.alias||"de-ch"===E.alias)),a.createElement(a.Fragment,null,a.createElement(i.T,null==p?void 0:p.stack,a.createElement(u.s,null==p?void 0:p.headerContainer,a.createElement(c.E,null==p?void 0:p.header,n({id:"cart_default.cart_cta.header",defaultMessage:[{type:0,value:"Payment Methods available"}]}))),a.createElement(u.s,null==p?void 0:p.iconContainer,g&&!h?I.map((({key:e,src:t})=>a.createElement(d._,(0,r.A)({key:e,src:t,alt:e},null==p?void 0:p.icon)))):I.map((({key:e,icon:t,label:l})=>a.createElement(t,(0,r.A)({key:e},null==p?void 0:p.icon,{"aria-label":n(l)})))))))}},81323:(e,t,n)=>{n.d(t,{A:()=>f});var r=n(64180),a=n(77810),l=n(73352),o=n(78539),i=n(64194),u=n(40133),c=n(58493),d=n(25635),s=n(34692),m=n(68644),p=n(68066),v=n(89240),y=n(28467);const f=()=>{const e=(0,l.o5)("Cart",{}),{formatMessage:t}=(0,s.A)(),{policies:n}=e,{isCart:f}=(0,m.A)().currentPage(location.pathname),{buildUrl:b}=(0,p.A)(),E=(0,y._d)("showNoteFlag");return a.createElement(o.T,null==n?void 0:n.policiesContainer,f&&"true"===(null==E?void 0:E.showNoteFlag)&&a.createElement(o.T,null==n?void 0:n.section,a.createElement(i.z,null==n?void 0:n.header,a.createElement(d.EmailIcon,(0,r.A)({},null==n?void 0:n.icon,{"aria-hidden":"true"})),a.createElement(u.E,null==n?void 0:n.title,t({id:"cart_default.cart_policies.gift_title",defaultMessage:[{type:0,value:"Gift Note"}]}))),a.createElement(u.E,null==n?void 0:n.message,t({id:"cart_default.cart_policies.gift_message",defaultMessage:[{type:0,value:"If it’s a gift, you can write a personalized greeting card at the checkout"}]}))),a.createElement(o.T,null==n?void 0:n.section,a.createElement(i.z,null==n?void 0:n.header,a.createElement(d.ReturnIcon,(0,r.A)({},null==n?void 0:n.icon,{"aria-hidden":"true"})),a.createElement(u.E,null==n?void 0:n.title,t({id:"cart_default.cart_policies.return_title",defaultMessage:[{type:0,value:"Return"}]}))),a.createElement(u.E,null==n?void 0:n.message,t({id:"cart_default.cart_policies.return_message",defaultMessage:[{type:0,value:"You can return items purchased on our official website within 30 days of their shipment for a full refund of the purchase price. "},{type:1,value:"link"}]},{link:a.createElement(c.N,(0,r.A)({},null==n?void 0:n.link,{href:b(v.A.FAQ_PATH),"aria-label":t({id:"cart_default.cart_policies.faq_link",defaultMessage:[{type:0,value:"Read more about our return policy in FAQ"}]})}),"FAQ")}))))}},62768:(e,t,n)=>{n.d(t,{A:()=>y});var r=n(64180),a=n(77810),l=n(73352),o=n(78539),i=n(64194),u=n(40133),c=n(14893),d=n(58493),s=n(25635),m=n(68066),p=n(34692),v=n(28467);const y=()=>{const e=(0,l.o5)("Cart",{}),{support:t}=e,{formatMessage:n}=(0,p.A)(),{buildUrl:y}=(0,m.A)(),f=(0,v.I8)("showSupportChatSection");return a.createElement(o.T,null==t?void 0:t.supportContainer,a.createElement(i.z,null==t?void 0:t.supportEmailSection,a.createElement(i.z,null==t?void 0:t.innerEmailStack,a.createElement(s.EmailIcon,(0,r.A)({},null==t?void 0:t.supportIcon,{"aria-hidden":"true"})),a.createElement(u.E,null==t?void 0:t.text,n({id:"cart_default.cart_support.email_message",defaultMessage:[{type:0,value:"Send us an email by filling out the contact form"}]}))),a.createElement(c.$,(0,r.A)({as:d.N,href:y("/contact-us"),variant:"text-button","aria-label":n({id:"cart_support.button.contact.label",defaultMessage:[{type:0,value:"Go to contact form"}]})},null==t?void 0:t.discoverMoreButton),n({id:"cart_default.cart_support.discover_more_button",defaultMessage:[{type:0,value:"Discover More"}]}))),f&&a.createElement(i.z,null==t?void 0:t.supportChatSection,a.createElement(s.AdviceIcon,(0,r.A)({},null==t?void 0:t.supportIcon,{role:"img","aria-label":n({id:"cart_support.icon.chat.label",defaultMessage:[{type:0,value:"Chat support icon"}]})})),a.createElement(u.E,null==t?void 0:t.text,n({id:"cart_default.cart_support.chat_message",defaultMessage:[{type:0,value:"Chat with us!Mon-Fri 8:00-18:30Sat 8:00-12:00"}]}))))}},11424:(e,t,n)=>{n.d(t,{A:()=>f});var r=n(28407),a=n(77810),l=n(44879),o=n(75826),i=n.n(o),u=n(90031),c=n(81308),d=n(34692),s=n(17015),m=n(68066),p=n(
150415),v=n(28467);const y=({productIds:e=[],productItems:t=[],handleUnavailableProducts:n})=>{var o;const i=(0,a.useRef)(null),y=e.length?e:t.map((e=>e.productId)),{formatMessage:f}=(0,d.A)(),{site:b}=(0,m.A)(),E=(0,v._d)("preorderSaleLimits"),g=(0,v._d)("backorderSaleLimits"),h=(0,u.useCustomerId)(),{usid:I}=(0,u.useUsid)(),{data:_}=(0,u.useShopperContext)({parameters:{usid:I,siteId:b.id}},{enabled:!s.S$}),{data:A}=(0,u.useCustomer)({parameters:{customerId:h}},{enabled:!!h&&!s.S$}),k="true"===(null==_||null===(o=_.customQualifiers)||void 0===o?void 0:o.isCorporate),C=null==A?void 0:A.c_isEmployee;(0,u.useProducts)({parameters:{ids:null==y?void 0:y.join(","),allImages:!1},headers:{"x-debug":"unav-prod-index"}},{enabled:(null==y?void 0:y.length)>0,onSuccess:e=>{var n;const r=[],a=[];null===(n=e.data)||void 0===n||n.forEach((e=>{const n={c_skuEnabledForCountry:"true"};if(r.push(e.id),t.length){var l;const r=t.find((t=>t.productId===e.id)),c=!(null==r||!r.type);(null===(l=r.priceAdjustments)||void 0===l?void 0:l.some((e=>e.appliedDiscount&&"bonus"===e.appliedDiscount.type)))||"true"===e.c_isPDPOnlyPurchasable||(n.c_skuIsPDPOnly="false"),k&&(n.c_visibleByCorporate="true"),C&&(n.c_visibleByEmployee="true"),k||C||(n.c_visibleByAll="true");const d=Object.keys(n).every((t=>e[t]===n[t])),s=(0,p.Ke)(e),m=s.isPreorder,v=s.isBackorder;let y=!1;if(m||v){var o;const t=m?E:g,n=e.id,a=null==t||null===(o=t.products)||void 0===o?void 0:o[n],l=a?Number(a):2;(null==r?void 0:r.quantity)>l&&(y=!0)}else{var i,u;(!d||null===(i=e.inventory)||void 0===i||!i.orderable||null!==(u=e.inventory)&&void 0!==u&&u.orderable&&(null==r?void 0:r.quantity)>e.inventory.stockLevel)&&(y=!0)}!c&&y&&a.push(e.id)}}));const l=y.filter((e=>!r.includes(e)||a.includes(e)));i.current=l}});const{onOpen:O,onClose:P,isOpen:S}=(0,l.j)();return(0,a.useEffect)((()=>{var e;(null===(e=i.current)||void 0===e?void 0:e.length)>0&&O()}),[i.current]),a.createElement(c.A,{"data-testid":"unavailable-product-modal",onAlternateAction:(0,r.A)((function*(){P(),yield n(i.current),i.current=null})),title:f({defaultMessage:[{type:0,value:"Error"}],id:"confirmation_modal.title"}),description:f({defaultMessage:[{type:0,value:"The item is no longer available and it needs to be removed from the cart"}],id:"confirmation_modal.description"}),isOpen:S})};y.propTypes={productItems:i().array,productIds:i().array,handleUnavailableProducts:i().func};const f=y},11266:(e,t,n)=>{function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var a=n(64965),l=r(n(77810)),o=n(56805);n(75826),n(55811);var i=r(n(24290));function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){e.prototype=Object.create(t.prototype),d(e.prototype.constructor=e,t)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],0<=t.indexOf(n)||(a[n]=e[n]);return a}(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=o.createBrowserHistory(t.props),t}c(t,e),t.prototype.render=function(){return l.createElement(a.Router,{history:this.history,children:this.props.children})}})(l.Component),function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=o.createHashHistory(t.props),t}c(t,e),t.prototype.render=function(){return l.createElement(a.Router,{history:this.history,children:this.props.children})}}(l.Component);var m=function(e,t){return"function"==typeof e?e(t):e},p=function(e,t){return"string"==typeof e?o.createLocation(e,null,null,t):e},v=function(e){return e},y=l.forwardRef;void 0===y&&(y=v);var f=y((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,o=s(e,["innerRef","navigate","onClick"]),i=o.target,c=u({},o,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||i&&"_self"!==i||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=v!==y&&t||n,l.createElement("a",c)})),b=y((function(e,t){var n=e.component,r=void 0===n?f:n,c=e.replace,d=e.to,b=e.innerRef,E=s(e,["component","replace","to","innerRef"]);return l.createElement(a.__RouterContext.Consumer,null,(function(e){e||i(!1);var n=e.history,a=p(m(d,e.location),e.location),s=a?n.createHref(a):"",f=u({},E,{href:s,navigate:function(){var t=m(d,e.location),r=o.createPath(e.location)===o.createPath(p(t));(c||r?n.replace:n.push)(t)}});return v!==y?f.ref=t||b:f.innerRef=b,l.createElement(r,f)}))})),E=function(e){return e},g=l.forwardRef;void 0===g&&(g=E);g((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,c=void 0===o?"active":o,d=e.activeStyle,v=e.className,y=e.exact,f=e.isActive,h=e.location,I=e.sensitive,_=e.strict,A=e.style,k=e.to,C=e.innerRef,O=s(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return l.createElement(a.__RouterContext.Consumer,null,(function(e){e||i(!1);var n=h||e.location,o=p(m(k,n),n),s=o.pathname,P=s&&s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),S=P?a.matchPath(n.pathname,{path:P,exact:y,sensitive:I,strict:_}):null,w=!!(f?f(S,n):S),M="function"==typeof v?v(w):v,x="function"==typeof A?A(w):A;w&&(M=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(M,c),x=u({},x,d));var T=u({"aria-current":w&&r||null,className:M,style:x,to:o},O);return E!==g?T.ref=t||C:T.innerRef=C,l.createElement(b,T)}))}
1));Object.defineProperty(t,"W6",{enumerable:!0,get:function(){return a.useHistory}}),Object.defineProperty(t,"zy",{enumerable:!0,get:function(){return a.useLocation}})}}]);
2//# sourceMappingURL=pages-cart.js.map

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.