(globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[]).push([[2388],{1308:(e,r,c)=>{"use strict";c.r(r),c.d(r,{Block:()=>m,default:()=>d});var t=c(4921),s=c(6711),o=c(910),a=c(415),n=c(371),l=c(1616),i=c(5703),p=c(790);const u=(e,r,c="0")=>{const t=10**r.minorUnit;return(Number.parseFloat(null!=e?e:c)*t).toString()},m=e=>{var r;const{className:c,textAlign:l,isDescendentOfSingleProductTemplate:m,isAdmin:d,product:y,isExperimentalWcRestApiEnabled:_}=e,g=(0,n.p)(e),{parentName:x,parentClassName:N}=(0,a.useInnerBlockLayoutContext)(),{product:f}=(0,a.useProductDataContext)(_?{isAdmin:d,product:y}:void 0),b="woocommerce/all-products"===x,h=m&&!("woocommerce/add-to-cart-with-options-grouped-product-item"===x),P=(0,t.A)("wc-block-components-product-price",c,g.className,{[`${N}__product-price`]:N});if(!f?.id&&!m){const e=(0,p.jsx)(s.A,{align:l,className:P});return b?(0,p.jsx)("div",{className:"wp-block-woocommerce-product-price",children:e}):e}let k=null!==(r=f?.prices)&&void 0!==r?r:{};const v=h?(0,o.getCurrencyFromPriceResponse)():(0,o.getCurrencyFromPriceResponse)(k);_&&(k={price:u(f?.price,v),...f?.sale_price?{sale_price:u(f?.sale_price,v)}:{},...f?.regular_price?{regular_price:u(f?.regular_price,v)}:{},currency_minor_unit:i.SITE_CURRENCY.minorUnit,price_range:f?.__experimental_max_price&&f?.__experimental_min_price?{min_amount:u(f.__experimental_min_price,v),max_amount:u(f.__experimental_max_price,v)}:null});const S="5000",j=k.price!==k.regular_price,w=(0,t.A)({[`${N}__product-price__value`]:N,[`${N}__product-price__value--on-sale`]:j}),A=(0,p.jsx)(s.A,{align:l,className:P,style:g.style,regularPriceStyle:g.style,priceStyle:g.style,priceClassName:w,currency:v,price:h?S:k.price,minPrice:k?.price_range?.min_amount,maxPrice:k?.price_range?.max_amount,regularPrice:h?S:k.regular_price,regularPriceClassName:(0,t.A)({[`${N}__product-price__regular`]:N})});return b?(0,p.jsx)("div",{className:"wp-block-woocommerce-product-price",children:A}):A},d=e=>e.isDescendentOfSingleProductTemplate?(0,p.jsx)(m,{...e}):(0,l.withProductDataContext)(m)(e)},6711:(e,r,c)=>{"use strict";c.d(r,{A:()=>u});var t=c(7723),s=c(4656),o=c(4921),a=c(910),n=c(6087),l=(c(8501),c(790));const i=({currency:e,maxPrice:r,minPrice:c,priceClassName:n,priceStyle:i={}})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"screen-reader-text",children:(0,t.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,t.__)("Price between %1$s and %2$s","woocommerce"),(0,a.formatPrice)(c),(0,a.formatPrice)(r))}),(0,l.jsxs)("span",{"aria-hidden":!0,children:[(0,l.jsx)(s.FormattedMonetaryAmount,{className:(0,o.A)("wc-block-components-product-price__value",n),currency:e,value:c,style:i})," — ",(0,l.jsx)(s.FormattedMonetaryAmount,{className:(0,o.A)("wc-block-components-product-price__value",n),currency:e,value:r,style:i})]})]}),p=({currency:e,regularPriceClassName:r,regularPriceStyle:c,regularPrice:a,priceClassName:n,priceStyle:i,price:p})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"screen-reader-text",children:(0,t.__)("Previous price:","woocommerce")}),(0,l.jsx)(s.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,l.jsx)("del",{className:(0,o.A)("wc-block-components-product-price__regular",r),style:c,children:e}),value:a}),(0,l.jsx)("span",{className:"screen-reader-text",children:(0,t.__)("Discounted price:","woocommerce")}),(0,l.jsx)(s.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,l.jsx)("ins",{className:(0,o.A)("wc-block-components-product-price__value","is-discounted",n),style:i,children:e}),value:p})]}),u=({align:e,className:r,currency:c,format:t="