(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[20],{114:function(t,e,c){"use strict";c.d(e,"b",(function(){return O})),c.d(e,"a",(function(){return f}));var o=c(0),n=(c(10),c(13)),s=c(50),r=c(44),a=c(5),i=c.n(a),l=c(4),d=c.n(l),u=c(504);c(145);const b=t=>{let{status:e="default"}=t;switch(e){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""};var p=t=>{let{className:e,notices:c,removeNotice:n}=t;const s=c.filter(t=>"snackbar"!==t.type);if(!s.length)return null;const r=d()(e,"wc-block-components-notices");return Object(o.createElement)("div",{className:r},s.map(t=>Object(o.createElement)(u.a,i()({key:"store-notice-"+t.id},t,{className:d()("wc-block-components-notices__notice",b(t)),onRemove:()=>{t.isDismissible&&n(t.id)}}),t.content)))};const m=Object(o.createContext)({notices:[],createNotice:(t,e,c)=>{},removeNotice:(t,e)=>{},setIsSuppressed:t=>{},context:"wc/core"}),O=()=>Object(o.useContext)(m),f=t=>{let{children:e,className:c="",createNoticeContainer:a=!0,context:i="wc/core"}=t;const{createNotice:l,removeNotice:d}=Object(n.useDispatch)("core/notices"),[u,b]=Object(o.useState)(!1),{dispatchStoreEvent:O}=Object(s.a)(),{isEditor:f}=Object(r.b)(),j=Object(o.useCallback)((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};l(t,e,{...c,context:c.context||i}),O("store-notice-create",{status:t,content:e,options:c})}),[l,O,i]),y=Object(o.useCallback)((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;d(t,e)}),[d,i]),{notices:N}=Object(n.useSelect)(t=>({notices:t("core/notices").getNotices(i)}),[i]),g={notices:N,createNotice:j,removeNotice:y,context:i,setIsSuppressed:b},v=u?null:Object(o.createElement)(p,{className:c,notices:g.notices,removeNotice:g.removeNotice,isEditor:f});return Object(o.createElement)(m.Provider,{value:g},a&&v,e)}},145:function(t,e){},271:function(t,e,c){"use strict";c.r(e);var o=c(5),n=c.n(o),s=c(0),r=(c(10),c(4)),a=c.n(r),i=c(1),l=c(50),d=c(328),u=c(17),b=c(22),p=c(2),m=c(28),O=c(57),f=(c(321),c(41));const j=t=>{let{product:e,colorStyles:c,borderStyles:o,typographyStyles:r,spacingStyles:m}=t;const{id:O,permalink:f,add_to_cart:j,has_options:y,is_purchasable:N,is_in_stock:g}=e,{dispatchStoreEvent:v}=Object(l.a)(),{cartQuantity:h,addingToCart:w,addToCart:_}=Object(d.a)(O),S=Number.isFinite(h)&&h>0,k=!y&&N&&g,E=Object(u.decodeEntities)((null==j?void 0:j.description)||""),C=S?Object(i.sprintf)(
/* translators: %s number of products in cart. */
Object(i._n)("%d in cart","%d in cart",h,'woocommerce'),h):Object(u.decodeEntities)((null==j?void 0:j.text)||Object(i.__)("Add to cart",'woocommerce')),x=k?"button":"a",I={};return k?I.onClick=()=>{_(),v("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=Object(p.getSetting)("productsSettings");t&&(window.location.href=b.d)}:(I.href=f,I.rel="nofollow",I.onClick=()=>{v("product-view-link",{product:e})}),Object(s.createElement)(x,n()({"aria-label":E,className:a()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",c.className,o.className,{loading:w,added:S}),style:{...c.style,...o.style,...r.style,...m.style},disabled:w},I),C)},y=t=>{let{colorStyles:e,borderStyles:c,typographyStyles:o,spacingStyles:n}=t;return Object(s.createElement)("button",{className:a()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",e.className,c.className),style:{...e.style,...c.style,...o.style,...n.style},disabled:!0})};e.default=Object(O.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(m.useInnerBlockLayoutContext)(),{product:o}=Object(m.useProductDataContext)(),n=Object(f.b)(t),r=Object(f.a)(t),i=Object(f.d)(t),l=Object(f.c)(t);return Object(s.createElement)("div",{className:a()(e,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},o.id?Object(s.createElement)(j,{product:o,colorStyles:n,borderStyles:r,typographyStyles:i,spacingStyles:l}):Object(s.createElement)(y,{colorStyles:n,borderStyles:r,typographyStyles:i,spacingStyles:l}))})},321:function(t,e){},328:function(t,e,c){"use strict";c.d(e,"a",(function(){return d}));var o=c(0),n=c(13),s=c(15),r=c(17),a=c(38),i=c(45);const l=(t,e)=>{const c=t.find(t=>{let{id:c}=t;return c===e});return c?c.quantity:0},d=t=>{const{addItemToCart:e}=Object(n.useDispatch)(s.CART_STORE_KEY),{cartItems:c,cartIsLoading:d}=Object(a.a)(),{addErrorNotice:u,removeNotice:b}=Object(i.a)(),[p,m]=Object(o.useState)(!1),O=Object(o.useRef)(l(c,t));return Object(o.useEffect)(()=>{const e=l(c,t);e!==O.current&&(O.current=e)},[c,t]),{cartQuantity:Number.isFinite(O.current)?O.current:0,addingToCart:p,cartIsLoading:d,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return m(!0),e(t,c).then(()=>{b("add-to-cart")}).catch(t=>{u(Object(r.decodeEntities)(t.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{m(!1)})}}}},45:function(t,e,c){"use strict";c.d(e,"a",(function(){return s}));var o=c(0),n=c(114);const s=()=>{const{notices:t,createNotice:e,removeNotice:c,setIsSuppressed:s}=Object(n.b)(),r=Object(o.useRef)(t);Object(o.useEffect)(()=>{r.current=t},[t]);const a=Object(o.useMemo)(()=>({hasNoticesOfType:t=>r.current.some(e=>e.type===t),removeNotices:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;r.current.forEach(e=>{null!==t&&e.status!==t||c(e.id)})},removeNotice:c}),[c]),i=Object(o.useMemo)(()=>({addDefaultNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("default",t,{...c})},addErrorNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("error",t,{...c})},addWarningNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("warning",t,{...c})},addInfoNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("info",t,{...c})},addSuccessNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("success",t,{...c})}}),[e]);return{notices:t,...a,...i,setIsSuppressed:s}}}}]);