(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[38],{122:function(e,t){},135:function(e,t,c){"use strict";var o=c(0);c(191),t.a=()=>Object(o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},137:function(e,t,c){"use strict";var o=c(0),n=c(1),s=c(4),a=c.n(s),r=(c(193),c(135));t.a=e=>{let{children:t,className:c,screenReaderLabel:s,showSpinner:l=!1,isLoading:i=!0}=e;return Object(o.createElement)("div",{className:a()(c,{"wc-block-components-loading-mask":i})},i&&l&&Object(o.createElement)(r.a,null),Object(o.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":i}),"aria-hidden":i},t),i&&Object(o.createElement)("span",{className:"screen-reader-text"},s||Object(n.__)("Loading…","woocommerce")))}},191:function(e,t){},193:function(e,t){},196:function(e,t,c){"use strict";var o=c(0),n=c(15);const s=Object(o.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.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},200:function(e,t,c){"use strict";var o=c(11),n=c.n(o),s=c(0),a=c(4),r=c.n(a),l=c(1),i=c(105),u=c(196);c(122);var p=e=>{let{text:t,screenReaderText:c="",element:o="li",className:a="",radius:l="small",children:i=null,...u}=e;const p=o,b=r()(a,"wc-block-components-chip","wc-block-components-chip--radius-"+l),m=Boolean(c&&c!==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"},c),i)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:o=!1,onRemove:a=(()=>{}),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:o,onClick:a,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||a()}},v=b?j:{},k=b?{"aria-hidden":!0}:j;return Object(s.createElement)(p,n()({},O,v,{className:r()(c,"is-removable"),element:b?"button":O.element,screenReaderText:d,text:m}),Object(s.createElement)(g,n()({className:"wc-block-components-chip__remove"},k),Object(s.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},267:function(e,t,c){"use strict";c.d(t,"a",(function(){return b}));var o=c(1),n=c(7),s=c(5),a=c(18),r=c(31),l=c(0),i=c(245);const u=()=>{const{notices:e,createSnackbarNotice:t,removeSnackbarNotice:c,setIsSuppressed:o}=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||c(t.id)})},removeSnackbarNotice:c}),[c]),a=Object(l.useMemo)(()=>({addSnackbarNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(e,c)}}),[t]);return{notices:e,...s,...a,setIsSuppressed:o}};var p=c(194);const b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:c}=Object(r.a)(),{createErrorNotice:l}=Object(n.useDispatch)("core/notices"),{addSnackbarNotice:i}=u(),{setValidationErrors:b}=Object(p.b)(),m=Object(n.useSelect)((t,c)=>{let{dispatch:n}=c;const r=t(s.CART_STORE_KEY),u=r.isApplyingCoupon(),p=r.isRemovingCoupon(),{applyCoupon:m,removeCoupon:d,receiveApplyingCoupon:O}=n(s.CART_STORE_KEY);return{applyCoupon:e=>{m(e).then(t=>{!0===t&&i(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),e),{id:"coupon-form"})}).catch(e=>{b({coupon:{message:Object(a.decodeEntities)(e.message),hidden:!1}}),O("")})},removeCoupon:t=>{d(t).then(e=>{!0===e&&i(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('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:c,...m}}},305:function(e,t){},374:function(e,t,c){"use strict";var o=c(0),n=c(1),s=c(137),a=c(200),r=c(10),l=c(2);c(305);const i={context:"summary"};t.a=e=>{let{cartCoupons:t=[],currency:c,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(r.__experimentalApplyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:t});return Object(o.createElement)(r.TotalsItem,{className:"wc-block-components-totals-discount",currency:c,description:0!==v.length&&Object(o.createElement)(s.a,{screenReaderLabel:Object(n.__)("Removing coupon…","woocommerce"),isLoading:u,showSpinner:!1},Object(o.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},v.map(e=>Object(o.createElement)(a.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:"-"})}},459:function(e,t,c){"use strict";c.r(t);var o=c(0),n=c(374),s=c(37),a=c(31),r=c(267),l=c(10);const i=()=>{const{extensions:e,receiveCart:t,...c}=Object(a.a)(),n={extensions:e,cart:c,context:"woocommerce/checkout"};return Object(o.createElement)(l.ExperimentalDiscountsMeta.Slot,n)};t.default=e=>{let{className:t=""}=e;const{cartTotals:c,cartCoupons:u}=Object(a.a)(),{removeCoupon:p,isRemovingCoupon:b}=Object(r.a)("wc/checkout"),m=Object(s.getCurrencyFromPriceResponse)(c);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.TotalsWrapper,{className:t},Object(o.createElement)(n.a,{cartCoupons:u,currency:m,isRemovingCoupon:b,removeCoupon:p,values:c})),Object(o.createElement)(i,null))}}}]);