(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).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),n=o(9307),a=o(5736),s=o(3849),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:a,width:s,scale:c,height:r,aspectRatio:i})=>{const{thumbnail:d,src:u,srcset:m,sizes:g,alt:p}=e||{},y={alt:p||a,hidden:!t,src:d,...o&&{src:u,srcSet:m,sizes:g}},f={height:r,width:s,objectFit:c,aspectRatio:i};return(0,l.createElement)(n.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,F=x?C.images[0]:null,L=s?"a":n.Fragment,R=(0,a.sprintf)(/* translators: %s is referring to the product name */ /* translators: %s is referring to the product name */
(0,a.__)("Link to %s","woocommerce"),C.name),$={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)(L,{...s&&$},!!r&&(0,l.createElement)(g.default,{align:u,...w}),(0,l.createElement)(y,{fallbackAlt:C.name,image:F,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),n=o(2090),a=o(4122);const s=(0,l.withFilteredAttributes)(a.Z)(n.Z)},5863:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>u,default:()=>m});var l=o(9196),n=o(5736),a=o(3849),s=o.n(a),c=o(711),r=o(2864),i=o(947),d=o(721);o(3902);const u=e=>{const{className:t,align:o}=e,a=(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},a.className),style:a.style},(0,l.createElement)(c.Label,{label:(0,n.__)("Sale","woocommerce"),screenReaderLabel:(0,n.__)("Product on sale","woocommerce")}))},m=(0,d.withProductDataContext)(u)},8360:(e,t,o)=>{"use strict";o.d(t,{n:()=>s});var l=o(2694),n=o(9818),a=o(9307);const s=()=>({dispatchStoreEvent:(0,a.useCallback)(((e,t={})=>{try{(0,l.doAction)(`experimental__woocommerce_blocks-${e}`,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:(0,a.useCallback)(((e,t={})=>{try{(0,l.doAction)(`experimental__woocommerce_blocks-checkout-${e}`,{...t,storeCart:(0,n.select)("wc/store/cart").getCartData()})}catch(e){console.error(e)}}),[])})},947:(e,t,o)=>{"use strict";o.d(t,{F:()=>i});var l=o(3849),n=o.n(l),a=o(7998),s=o(3243),c=o(3392),r=o(172);const i=e=>{const t=(e=>{const t=(0,a.Kn)(e)?e:{style:{}};let o=t.style;return(0,s.H)(o)&&(o=JSON.parse(o)||{}),(0,a.Kn)(o)||(o={}),{...t,style:o}})(e),o=(0,r.vc)(t),l=(0,r.l8)(t),i=(0,r.su)(t),d=(0,c.f)(t);return{className:n()(d.className,o.className,l.className,i.className),style:{...d.style,...o.style,...l.style,...i.style}}}},3392:(e,t,o)=>{"use strict";o.d(t,{f:()=>a});var l=o(7998),n=o(3243);const a=e=>{const t=(0,l.Kn)(e.style.typography)?e.style.typography:{},o=(0,n.H)(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(3849),n=o.n(l),a=o(7427),s=o(2289),c=o(7998);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,a.o)(t)}-${e}`:""}function d(e){var t,o,l,a,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:n()(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===(a=h.color)||void 0===a?void 0:a.gradient),"has-link-color":(0,c.Kn)(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,a=o?i("border-color",o):"";return n()({"has-border-color":!!o||!(null==l||null===(t=l.border)||void 0===t||!t.color),[a]:!!a})}(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)||{}})}}},2893:(e,t,o)=>{"use strict";o.d(t,{F:()=>l});const l=e=>null===e},7998:(e,t,o)=>{"use strict";o.d(t,{$n:()=>a,Kn:()=>n,Qr:()=>s});var l=o(2893);const n=e=>!(0,l.F)(e)&&e instanceof Object&&e.constructor===Object;function a(e,t){return n(e)&&t in e}const s=e=>0===Object.keys(e).length},3243:(e,t,o)=>{"use strict";o.d(t,{H:()=>l});const l=e=>"string"==typeof e},3030:()=>{},3902:()=>{}}]);