(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[21],{103:function(e,t,o){"use strict";var c=o(0);t.a=function(e){let{icon:t,size:o=24,...n}=e;return Object(c.cloneElement)(t,{width:o,height:o,...n})}},119:function(e,t){},193:function(e,t,o){"use strict";var c=o(0),n=o(14);const s=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=s},197:function(e,t,o){"use strict";var c=o(11),n=o.n(c),s=o(0),r=o(4),a=o.n(r),l=o(1),i=o(103),u=o(193);o(119);var p=e=>{let{text:t,screenReaderText:o="",element:c="li",className:r="",radius:l="small",children:i=null,...u}=e;const p=c,b=a()(r,"wc-block-components-chip","wc-block-components-chip--radius-"+l),m=Boolean(o&&o!==t);return Object(s.createElement)(p,n()({className:b},u),Object(s.createElement)("span",{"aria-hidden":m,className:"wc-block-components-chip__text"},t),m&&Object(s.createElement)("span",{className:"screen-reader-text"},o),i)};t.a=e=>{let{ariaLabel:t="",className:o="",disabled:c=!1,onRemove:r=(()=>{}),removeOnAnyClick:b=!1,text:m,screenReaderText:d="",...O}=e;const g=b?"span":"button";if(!t){const e=d&&"string"==typeof d?d:m;t="string"!=typeof e?
/* translators: Remove chip. */
Object(l.__)("Remove","woocommerce"):Object(l.sprintf)(
/* translators: %s text of the chip to remove. */
Object(l.__)('Remove "%s"',"woocommerce"),e)}const j={"aria-label":t,disabled:c,onClick:r,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||r()}},v=b?j:{},_=b?{"aria-hidden":!0}:j;return Object(s.createElement)(p,n()({},O,v,{className:a()(o,"is-removable"),element:b?"button":O.element,screenReaderText:d,text:m}),Object(s.createElement)(g,n()({className:"wc-block-components-chip__remove"},_),Object(s.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},264:function(e,t,o){"use strict";o.d(t,"a",(function(){return b}));var c=o(1),n=o(7),s=o(5),r=o(17),a=o(30),l=o(0),i=o(242);const u=()=>{const{notices:e,createSnackbarNotice:t,removeSnackbarNotice:o,setIsSuppressed:c}=Object(i.b)(),n=Object(l.useRef)(e);Object(l.useEffect)(()=>{n.current=e},[e]);const s=Object(l.useMemo)(()=>({removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;n.current.forEach(t=>{null!==e&&t.status!==e||o(t.id)})},removeSnackbarNotice:o}),[o]),r=Object(l.useMemo)(()=>({addSnackbarNotice:function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(e,o)}}),[t]);return{notices:e,...s,...r,setIsSuppressed:c}};var p=o(191);const b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:o}=Object(a.a)(),{createErrorNotice:l}=Object(n.useDispatch)("core/notices"),{addSnackbarNotice:i}=u(),{setValidationErrors:b}=Object(p.b)(),m=Object(n.useSelect)((t,o)=>{let{dispatch:n}=o;const a=t(s.CART_STORE_KEY),u=a.isApplyingCoupon(),p=a.isRemovingCoupon(),{applyCoupon:m,removeCoupon:d,receiveApplyingCoupon:O}=n(s.CART_STORE_KEY);return{applyCoupon:e=>{m(e).then(t=>{!0===t&&i(Object(c.sprintf)(
/* translators: %s coupon code. */
Object(c.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),e),{id:"coupon-form"})}).catch(e=>{b({coupon:{message:Object(r.decodeEntities)(e.message),hidden:!1}}),O("")})},removeCoupon:t=>{d(t).then(e=>{!0===e&&i(Object(c.sprintf)(
/* translators: %s coupon code. */
Object(c.__)('Coupon code "%s" has been removed from your cart.',"woocommerce"),t),{id:"coupon-form"})}).catch(t=>{l(t.message,{id:"coupon-form",context:e}),O("")})},isApplyingCoupon:u,isRemovingCoupon:p}},[l,i]);return{appliedCoupons:t,isLoading:o,...m}}},302:function(e,t){},371:function(e,t,o){"use strict";var c=o(0),n=o(1),s=o(134),r=o(197),a=o(10),l=o(2);o(302);const i={context:"summary"};t.a=e=>{let{cartCoupons:t=[],currency:o,isRemovingCoupon:u,removeCoupon:p,values:b}=e;const{total_discount:m,total_discount_tax:d}=b,O=parseInt(m,10);if(!O&&0===t.length)return null;const g=parseInt(d,10),j=Object(l.getSetting)("displayCartPricesIncludingTax",!1)?O+g:O,v=Object(a.__experimentalApplyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:t});return Object(c.createElement)(a.TotalsItem,{className:"wc-block-components-totals-discount",currency:o,description:0!==v.length&&Object(c.createElement)(s.a,{screenReaderLabel:Object(n.__)("Removing coupon…","woocommerce"),isLoading:u,showSpinner:!1},Object(c.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},v.map(e=>Object(c.createElement)(r.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(n.sprintf)(
/* translators: %s Coupon code. */
Object(n.__)("Coupon: %s","woocommerce"),e.label),disabled:u,onRemove:()=>{p(e.code)},radius:"large",ariaLabel:Object(n.sprintf)(
/* translators: %s is a coupon code. */
Object(n.__)('Remove coupon "%s"',"woocommerce"),e.label)})))),label:j?Object(n.__)("Discount","woocommerce"):Object(n.__)("Coupons","woocommerce"),value:j?-1*j:"-"})}},449:function(e,t,o){"use strict";o.r(t);var c=o(0),n=o(371),s=o(37),r=o(30),a=o(264),l=o(10);const i=()=>{const{extensions:e,receiveCart:t,...o}=Object(r.a)(),n={extensions:e,cart:o,context:"woocommerce/cart"};return Object(c.createElement)(l.ExperimentalDiscountsMeta.Slot,n)};t.default=e=>{let{className:t}=e;const{cartTotals:o,cartCoupons:u}=Object(r.a)(),{removeCoupon:p,isRemovingCoupon:b}=Object(a.a)("wc/cart"),m=Object(s.getCurrencyFromPriceResponse)(o);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.TotalsWrapper,{className:t},Object(c.createElement)(n.a,{cartCoupons:u,currency:m,isRemovingCoupon:b,removeCoupon:p,values:o})),Object(c.createElement)(i,null))}}}]);