(self.webpackChunkwebpackWcBlocksMainJsonp=self.webpackChunkwebpackWcBlocksMainJsonp||[]).push([[3706,5432],{4122:(e,t,o)=>{"use strict";o.d(t,{Z:()=>l});const l={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:o(6344).R.SINGLE},productId:{type:"number",default:0},isDescendentOfQueryLoop:{type:"boolean",default:!1},isDescendentOfSingleProductBlock:{type:"boolean",default:!1},width:{type:"string"},height:{type:"string"},scale:{type:"string",default:"cover"},aspectRatio:{type:"string"}}},2090:(e,t,o)=>{"use strict";o.d(t,{Z:()=>f});var l=o(9196),a=o(9307),n=o(5736),s=o(7608),c=o.n(s),r=o(4617),i=o(2864),d=o(947),u=o(721),m=o(8360),g=o(5863),p=(o(3030),o(6344));const h=e=>(0,l.createElement)("img",{...e,src:r.PLACEHOLDER_IMG_SRC,alt:"",width:void 0,height:void 0}),y=({image:e,loaded:t,showFullSize:o,fallbackAlt:n,width:s,scale:c,height:r,aspectRatio:i})=>{const{thumbnail:d,src:u,srcset:m,sizes:g,alt:p}=e||{},y={alt:p||n,hidden:!t,src:d,...o&&{src:u,srcSet:m,sizes:g}},f={height:r,width:s,objectFit:c,aspectRatio:i};return(0,l.createElement)(a.Fragment,null,y.src&&(0,l.createElement)("img",{style:f,"data-testid":"product-image",...y}),!e&&(0,l.createElement)(h,{style:f}))},f=(0,u.withProductDataContext)((e=>{const{className:t,imageSizing:o=p.R.SINGLE,showProductLink:s=!0,showSaleBadge:r,saleBadgeAlign:u="right",height:f,width:v,scale:b,aspectRatio:k,...w}=e,S=(0,d.F)(e),{parentClassName:N}=(0,i.useInnerBlockLayoutContext)(),{product:C,isLoading:_}=(0,i.useProductDataContext)(),{dispatchStoreEvent:E}=(0,m.n)();if(!C.id)return(0,l.createElement)("div",{className:c()(t,"wc-block-components-product-image",{[`${N}__product-image`]:N},S.className),style:S.style},(0,l.createElement)(h,null));const x=!!C.images.length,L=x?C.images[0]:null,F=s?"a":a.Fragment,R=(0,n.sprintf)(/* translators: %s is referring to the product name */ /* translators: %s is referring to the product name */
(0,n.__)("Link to %s","woocommerce"),C.name),z={href:C.permalink,...!x&&{"aria-label":R},onClick:()=>{E("product-view-link",{product:C})}};return delete w.style,(0,l.createElement)("div",{className:c()(t,"wc-block-components-product-image",{[`${N}__product-image`]:N},S.className),style:S.style},(0,l.createElement)(F,{...s&&z},!!r&&(0,l.createElement)(g.default,{align:u,...w}),(0,l.createElement)(y,{fallbackAlt:C.name,image:L,loaded:!_,showFullSize:o!==p.R.THUMBNAIL,width:v,height:f,scale:b,aspectRatio:k})))}))},6790:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>s});var l=o(721),a=o(2090),n=o(4122);const s=(0,l.withFilteredAttributes)(n.Z)(a.Z)},5863:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>u,default:()=>m});var l=o(9196),a=o(5736),n=o(7608),s=o.n(n),c=o(711),r=o(2864),i=o(947),d=o(721);o(3902);const u=e=>{const{className:t,align:o}=e,n=(0,i.F)(e),{parentClassName:d}=(0,r.useInnerBlockLayoutContext)(),{product:u}=(0,r.useProductDataContext)();if(!(u.id&&u.on_sale||e.isDescendentOfSingleProductTemplate))return null;const m="string"==typeof o?`wc-block-components-product-sale-badge--align-${o}`:"";return(0,l.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,m,{[`${d}__product-onsale`]:d},n.className),style:n.style},(0,l.createElement)(c.Label,{label:(0,a.__)("Sale","woocommerce"),screenReaderLabel:(0,a.__)("Product on sale","woocommerce")}))},m=(0,d.withProductDataContext)(u)},8360:(e,t,o)=>{"use strict";o.d(t,{n:()=>s});var l=o(2694),a=o(9818),n=o(9307);const s=()=>({dispatchStoreEvent:(0,n.useCallback)(((e,t={})=>{try{(0,l.doAction)(`experimental__woocommerce_blocks-${e}`,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:(0,n.useCallback)(((e,t={})=>{try{(0,l.doAction)(`experimental__woocommerce_blocks-checkout-${e}`,{...t,storeCart:(0,a.select)("wc/store/cart").getCartData()})}catch(e){console.error(e)}}),[])})},947:(e,t,o)=>{"use strict";o.d(t,{F:()=>r});var l=o(7608),a=o.n(l),n=o(6946),s=o(3392),c=o(172);const r=e=>{const t=(e=>{const t=(0,n.isObject)(e)?e:{style:{}};let o=t.style;return(0,n.isString)(o)&&(o=JSON.parse(o)||{}),(0,n.isObject)(o)||(o={}),{...t,style:o}})(e),o=(0,c.vc)(t),l=(0,c.l8)(t),r=(0,c.su)(t),i=(0,s.f)(t);return{className:a()(i.className,o.className,l.className,r.className),style:{...i.style,...o.style,...l.style,...r.style}}}},3392:(e,t,o)=>{"use strict";o.d(t,{f:()=>a});var l=o(6946);const a=e=>{const t=(0,l.isObject)(e.style.typography)?e.style.typography:{},o=(0,l.isString)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:o,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}}},172:(e,t,o)=>{"use strict";o.d(t,{l8:()=>u,su:()=>m,vc:()=>d});var l=o(7608),a=o.n(l),n=o(7427),s=o(2289),c=o(6946);function r(e={}){const t={};return(0,s.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function i(e,t){return e&&t?`has-${(0,n.o)(t)}-${e}`:""}function d(e){var t,o,l,n,s,d,u;const{backgroundColor:m,textColor:g,gradient:p,style:h}=e,y=i("background-color",m),f=i("color",g),v=function(e){if(e)return`has-${e}-gradient-background`}(p),b=v||(null==h||null===(t=h.color)||void 0===t?void 0:t.gradient);return{className:a()(f,v,{[y]:!b&&!!y,"has-text-color":g||(null==h||null===(o=h.color)||void 0===o?void 0:o.text),"has-background":m||(null==h||null===(l=h.color)||void 0===l?void 0:l.background)||p||(null==h||null===(n=h.color)||void 0===n?void 0:n.gradient),"has-link-color":(0,c.isObject)(null==h||null===(s=h.elements)||void 0===s?void 0:s.link)?null==h||null===(d=h.elements)||void 0===d||null===(u=d.link)||void 0===u?void 0:u.color:void 0}),style:r({color:(null==h?void 0:h.color)||{}})}}function u(e){var t;const o=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:function(e){var t;const{borderColor:o,style:l}=e,n=o?i("border-color",o):"";return a()({"has-border-color":!!o||!(null==l||null===(t=l.border)||void 0===t||!t.color),[n]:!!n})}(e),style:r({border:o})}}function m(e){var t;return{className:void 0,style:r({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}},3030:()=>{},3902:()=>{}}]);