1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1781],{49339:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return CartSidebar_CartSidebar}});var r=n(90849),i=n(65218),a=n.n(i),o=n(12279),c=n(56995),l=n(29935),s=n(27378),u=n(96957),d=n(34264),useCheckoutButton=()=>{var{isValidating:e,id:t}=(0,u.jD)();return{onClick:n=>{n.preventDefault(),e||(0,d.V)(t)},disabled:e,"data-testid":"checkout-button"}},b=n(90194),h=n(30847),p=n.n(h),f=n(24246);function ownKeys(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 _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){(0,r.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var m=a()(()=>Promise.all([n.e(7310),n.e(4078),n.e(3919),n.e(5906)]).then(n.bind(n,54078)).then(e=>e.Button),{ssr:!1,loadableGenerated:{webpack:()=>[null]}}),j=a()(()=>Promise.all([n.e(7310),n.e(4078),n.e(3919),n.e(5906)]).then(n.bind(n,54078)).then(e=>e.CartSidebarFooter),{ssr:!1,loadableGenerated:{webpack:()=>[null]}}),w=a()(()=>Promise.all([n.e(7310),n.e(4078),n.e(3919),n.e(5906)]).then(n.bind(n,54078)).then(e=>e.CartSidebarList),{ssr:!1,loadableGenerated:{webpack:()=>[null]}}),O=a()(()=>Promise.all([n.e(7310),n.e(4078),n.e(3919),n.e(5906)]).then(n.bind(n,54078)).then(e=>e.CartSidebar),{ssr:!1,loadableGenerated:{webpack:()=>[null]}}),k=a()(()=>n.e(1724).then(n.bind(n,50469)),{ssr:!1,loadableGenerated:{webpack:()=>[50469]}}),x=a()(()=>n.e(2985).then(n.bind(n,19462)),{ssr:!1,loadableGenerated:{webpack:()=>[19462]}}),v=a()(()=>n.e(549).then(n.bind(n,58642)),{ssr:!1,loadableGenerated:{webpack:()=>[58642]}}),y=a()(()=>n.e(2553).then(n.bind(n,97427)),{ssr:!1,loadableGenerated:{webpack:()=>[97427]}}),CartSidebar_CartSidebar=function(e){var{title:t,alert:{icon:{icon:r,alt:i},text:a},checkoutButton:{label:d,loadingLabel:h,icon:{icon:_,alt:g}},quantitySelector:P,taxesConfiguration:C}=e,S=useCheckoutButton(),{items:D,gifts:G,totalItems:T,isValidating:F,subTotal:M,total:U,subTotalWithTaxes:B,totalWithTaxes:E}=(0,u.jD)({useUnitMultiplier:null==P?void 0:P.useUnitMultiplier}),{cart:I,closeCart:N}=(0,o.l8)(),{fadeOut:L}=(0,c.b)(),{sendViewCartEvent:V}=function(){var{currency:{code:e}}=(0,b.kP)(),{items:t,gifts:r,total:i}=(0,u.jD)(),a=JSON.stringify(r),o=JSON.stringify(t),c=(0,s.useCallback)(()=>{n.e(1504).then(n.bind(n,29590)).then(n=>{var{sendAnalyticsEvent:a}=n;return a({name:"view_cart",params:{currency:e,value:i,items:t.concat(r).map(t=>({item_id:t.itemOffered.isVariantOf.productGroupID,item_name:t.itemOffered.isVariantOf.name,item_brand:t.itemOffered.brand.name,item_variant:t.itemOffered.sku,quantity:t.quantity,price:t.price,discount:t.listPrice-t.price,currency:e,item_variant_name:t.itemOffered.name,product_reference_id:t.itemOffered.gtin}))}})})},[e,a,o,i]);return(0,s.useMemo)(()=>({sendViewCartEvent:c}),[c])}(),K=(0,s.useMemo)(()=>0===D.length,[D]);return(0,s.useEffect)(()=>{I&&V()},[I,V]),(0,f.jsx)(f.Fragment,{children:I&&(0,f.jsx)(O,{overlayProps:{className:"section ".concat(p().section," section-cart-sidebar")},title:t,totalItems:T,alertIcon:(0,f.jsx)(l.Z,{name:r,"aria-label":i}),alertText:a,onClose:L,children:K?(0,f.jsx)(k,{onDismiss:N}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(w,{children:[D.map(e=>{var t;return(0,f.jsx)("li",{children:(0,f.jsx)(v,{item:e,taxesConfiguration:C,useUnitMultiplier:null!==(t=null==P?void 0:P.useUnitMultiplier)&&void 0!==t&&t})},e.id)}),G.length>0&&(0,f.jsx)(f.Fragment,{children:G.map(e=>(0,f.jsx)("li",{children:(0,f.jsx)(x,{item:e})},e.id))})]}),(0,f.jsx)(j,{children:(0,f.jsx)(y,{subTotal:null!=C&&C.usePriceWithTaxes?B:M,total:null!=C&&C.usePriceWithTaxes?E:U,includeTaxes:null==C?void 0:C.usePriceWithTaxes,includeTaxesLabel:null==C?void 0:C.taxesLabel,numberOfItems:T,checkoutButton:(0,f.jsx)(m,_objectSpread(_objectSpread({variant:"primary",icon:!F&&(0,f.jsx)(l.Z,{name:_,"aria-label":g,width:18,height:18}),iconPosition:"right"},S),{},{children:F?h:d}))})})]})})})}},34264:function(e,t,n){"use strict";n.d(t,{V:function(){return redirectToCheckout}});var r=n(6570),i=n.n(r),redirectToCheckout=e=>{(window.location.host.includes(".vtex.app")||window.location.host.includes("localhost"))&&e?window.location.href="".concat(i().checkoutUrl,"?orderFormId=").concat(e):window.location.href="".concat(i().checkoutUrl)}},30847:function(e){e.exports={section:"section_section__yzDFp"}}}]);
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.