2 lines
7.9 KiB
JavaScript
2 lines
7.9 KiB
JavaScript
|
(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[5579],{6669:(e,r,t)=>{"use strict";t.r(r),t.d(r,{Block:()=>p,default:()=>m});var c=t(9196),n=t(4184),o=t.n(n),l=t(6805),a=t(4293),s=t(2864),i=t(3611),u=t(721);const p=e=>{var r,t;const{className:n,textAlign:u,isDescendentOfSingleProductTemplate:p}=e,m=(0,i.F)(e),{parentName:d,parentClassName:y}=(0,s.useInnerBlockLayoutContext)(),{product:v}=(0,s.useProductDataContext)(),g="woocommerce/all-products"===d,f=o()("wc-block-components-product-price",n,m.className,{[`${y}__product-price`]:y});if(!v.id&&!p){const e=(0,c.createElement)(l.Z,{align:u,className:f});return g?(0,c.createElement)("div",{className:"wp-block-woocommerce-product-price"},e):e}const b=v.prices,N=p?(0,a.getCurrencyFromPriceResponse)():(0,a.getCurrencyFromPriceResponse)(b),_="5000",k=b.price!==b.regular_price,P=o()({[`${y}__product-price__value`]:y,[`${y}__product-price__value--on-sale`]:k}),E=(0,c.createElement)(l.Z,{align:u,className:f,style:m.style,regularPriceStyle:m.style,priceStyle:m.style,priceClassName:P,currency:N,price:p?_:b.price,minPrice:null==b||null===(r=b.price_range)||void 0===r?void 0:r.min_amount,maxPrice:null==b||null===(t=b.price_range)||void 0===t?void 0:t.max_amount,regularPrice:p?_:b.regular_price,regularPriceClassName:o()({[`${y}__product-price__regular`]:y})});return g?(0,c.createElement)("div",{className:"wp-block-woocommerce-product-price"},E):E},m=e=>e.isDescendentOfSingleProductTemplate?(0,c.createElement)(p,{...e}):(0,u.withProductDataContext)(p)(e)},6805:(e,r,t)=>{"use strict";t.d(r,{Z:()=>m});var c=t(9196),n=t(5736),o=t(711),l=t(4184),a=t.n(l),s=t(4293),i=t(9307);t(5138);const u=({currency:e,maxPrice:r,minPrice:t,priceClassName:l,priceStyle:i={}})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)("span",{className:"screen-reader-text"},(0,n.sprintf)(/* translators: %1$s min price, %2$s max price */
|
||
|
(0,n.__)("Price between %1$s and %2$s","woocommerce"),(0,s.formatPrice)(t),(0,s.formatPrice)(r))),(0,c.createElement)("span",{"aria-hidden":!0},(0,c.createElement)(o.FormattedMonetaryAmount,{className:a()("wc-block-components-product-price__value",l),currency:e,value:t,style:i})," — ",(0,c.createElement)(o.FormattedMonetaryAmount,{className:a()("wc-block-components-product-price__value",l),currency:e,value:r,style:i}))),p=({currency:e,regularPriceClassName:r,regularPriceStyle:t,regularPrice:l,priceClassName:s,priceStyle:i,price:u})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Previous price:","woocommerce")),(0,c.createElement)(o.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,c.createElement)("del",{className:a()("wc-block-components-product-price__regular",r),style:t},e),value:l}),(0,c.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Discounted price:","woocommerce")),(0,c.createElement)(o.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,c.createElement)("ins",{className:a()("wc-block-components-product-price__value","is-discounted",s),style:i},e),value:u})),m=({align:e,className:r,currency:t,format:n="<price/>",maxPrice:l,minPrice:s,price:m,priceClassName:d,priceStyle:y,regularPrice:v,regularPriceClassName:g,regularPriceStyle:f,style:b})=>{const N=a()(r,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});n.includes("<price/>")||(n="<price/>",console.error("Price formats need to include the `<price/>` tag."));const _=v&&m&&m<v;let k=(0,c.createElement)("span",{className:a()("wc-block-components-product-price__value",d)});return _?k=(0,c.createElement)(p,{currency:t,price:m,priceClassName:d,priceStyle:y,regularPrice:v,regularPriceClassName:g,regularPriceStyle:f}):void 0!==s&&void 0!==l?k=(0,c.createElement)(u,{currency:t,maxPrice:l,minPrice:s,priceClassName:d,priceStyle:y}):m&&(k=(0,c.createElement)(o.FormattedMonetaryAmount,{className:a()("wc-block-components-product-price__value",d),currency:t,value:m,style:y})),(0,c.createElement)("span",{className:N,style:b},(0,i.createInterpolateElement)(n,{price:k}))}},3611:(e,r,t)=>{"use strict";t.d(r,{F:()=>i});var c=t(4184),n=t.n(c),o=t(7884),l=t(2646),a=t(1473),s=t(2661);const i=e=>{const r=(e=>{const r=(0,o.Kn)(e)?e:{style:{}};let t=r.style;return(0,l.H)(t)&&(t=JSON.parse(t)||{}),(0,o.Kn)(t)||(t={}),{...r,style:t}})(e),t=(0,s.vc)(r),c=(0,s.l8)(r),i=(0,s.su)(r),u=(0,a.f)(r);return{className:n()(u.className,t.className,c.className,i.className),style:{...u.style,...t.style,...c.style,...i.style}}}},1473:(e,r,t)=>{"use strict";t.d(r,{f:()=>o});var c=t(7884),n=t(2646);const o=e=>{const r=(0,c.Kn)(e.style.typography)?e.style.typography:{},t=(0,n.H)(r.fontFamily)?r.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:t,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:r.fontSize,fontStyle:r.fontStyle,fontWeight:r.fontWeight,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,textDecoration:r.textDecoration,textTransform:r.textTransform}}}},2661:(e,r,t)=>{"use strict";t.d(r,{l8:()=>p,su:()=>m,vc:()=>u});var c=t(4184),n=t.n(c),o=t(9784),l=t(2289),a=t(7884);function s(e={}){const r={};return(0,l.getCSSRules)(e,{selector:""}).forEach((e=>{r[e.key]=e.value})),r}function i(e,r){return e&&r?`has-${(0,o.o)(r)}-${e}`:""}function u(e){var r,t,c,o,l,u,p;const{backgroundColor:m,textColor:d,gradient:y,style:v}=e,g=i("background-color",m),f=i("color",d),b=function(e){if(e)return`has-${e}-gradient-background`}(y),N=b||(null==v||null===(r=v.color)||void 0===r?void 0:r.gradient);return{className:n()(f,b,{[g]:!N&&!!g,"has-text-color":d||(null==v||null===(t=v.color)||void 0===t?void 0:t.text),"has-background":m||(null==v||null===(c=v.color)||void 0===c?void 0:c.background)||y||(null==v||null===(o=v.color)||void 0===o?void 0:o.gradient),"has-link-color":(0,a.Kn)(null==v||null===(l=v.elements)||void 0===l?void 0:l.link)?null==v||null===(u=v.elements)||void 0===u||null===(p=u.link)||void 0===p?void 0:p.color:void 0}),s
|