File "price.js"

Full Path: /home/vantageo/public_html/cache/cache/cache/cache/.wp-cli/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/atomic-block-components/price.js
File size: 5.6 KB
MIME-type: text/plain
Charset: utf-8

(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{146:function(e,r,c){"use strict";var t=c(4),a=c.n(t),n=c(0),o=c(1),l=c(53),i=c(7),u=c.n(i),s=(c(2),c(153)),p=(c(223),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,o=e.priceStyle;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{className:u()("wc-block-components-product-price__value",a),currency:r,value:t,style:o})," — ",Object(n.createElement)(l.a,{className:u()("wc-block-components-product-price__value",a),currency:r,value:c,style:o}))}),m=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,i=e.priceClassName,s=e.priceStyle,p=e.price;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:",'woocommerce')),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("del",{className:u()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:",'woocommerce')),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",i),style:s},e)},value:p}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,o=e.format,i=void 0===o?"<price/>":o,b=e.maxPrice,d=void 0===b?null:b,y=e.minPrice,O=void 0===y?null:y,f=e.price,g=void 0===f?null:f,v=e.priceClassName,j=e.priceStyle,_=e.regularPrice,P=e.regularPriceClassName,N=e.regularPriceStyle,S=u()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var C=_&&g!==_,w=Object(n.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return C?w=Object(n.createElement)(m,{currency:t,price:g,priceClassName:v,priceStyle:j,regularPrice:_,regularPriceClassName:P,regularPriceStyle:N}):null!==O&&null!==d?w=Object(n.createElement)(p,{currency:t,maxPrice:d,minPrice:O,priceClassName:v,priceStyle:j}):null!==g&&(w=Object(n.createElement)(l.a,{className:u()("wc-block-components-product-price__value",v),currency:t,value:g,style:j})),Object(n.createElement)("span",{className:S},Object(s.a)(i,{price:w}))}},189:function(e,r){},223:function(e,r){},53:function(e,r,c){"use strict";var t=c(10),a=c.n(t),n=c(4),o=c.n(n),l=c(23),i=c.n(l),u=c(0),s=c(181),p=c(7),m=c.n(p);c(189);function b(e,r){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),c.push.apply(c,t)}return c}function d(e){for(var r=1;r<arguments.length;r++){var c=null!=arguments[r]?arguments[r]:{};r%2?b(Object(c),!0).forEach((function(r){o()(e,r,c[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):b(Object(c)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(c,r))}))}return e}r.a=function(e){var r=e.className,c=e.value,t=e.currency,n=e.onValueChange,o=e.displayType,l=void 0===o?"text":o,p=i()(e,["className","value","currency","onValueChange","displayType"]),b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;var y=b/Math.pow(10,t.minorUnit);if(!Number.isFinite(y))return null;var O=m()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),f=d(d(d({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(t)),{},{value:void 0,currency:void 0,onValueChange:void 0}),g=n?function(e){var r=e.value*Math.pow(10,t.minorUnit);n(r)}:function(){};return Object(u.createElement)(s.a,a()({className:O,displayType:l},f,{value:y,onValueChange:g}))}},530:function(e,r,c){"use strict";c.r(r);var t=c(4),a=c.n(t),n=c(0),o=(c(2),c(7)),l=c.n(o),i=c(146),u=c(58),s=c(38),p=c(22),m=c(14),b=c(69);r.default=Object(b.withProductDataContext)((function(e){var r,c,t,o,b,d,y,O=e.className,f=e.align,g=e.fontSize,v=e.customFontSize,j=e.saleFontSize,_=e.customSaleFontSize,P=e.color,N=e.customColor,S=e.saleColor,C=e.customSaleColor,w=Object(s.useInnerBlockLayoutContext)().parentClassName,x=Object(s.useProductDataContext)().product,E=l()(O,a()({},"".concat(w,"__product-price"),w));if(!x.id)return Object(n.createElement)(i.a,{align:f,className:E});var h=Object(p.getColorClassName)("color",P),k=Object(p.getFontSizeClass)(g),z=Object(p.getColorClassName)("color",S),F=Object(p.getFontSizeClass)(j),D=l()((r={"has-text-color":P||N,"has-font-size":g||v},a()(r,h,h),a()(r,k,k),r)),T=l()((c={"has-text-color":S||C,"has-font-size":j||_},a()(c,z,z),a()(c,F,F),c)),V={color:N,fontSize:v},B={color:C,fontSize:_},U=x.prices,I=Object(u.getCurrencyFromPriceResponse)(U),J=U.price!==U.regular_price,M=J?l()((t={},a()(t,"".concat(w,"__product-price__value"),w),a()(t,T,Object(m.o)()),t)):l()((o={},a()(o,"".concat(w,"__product-price__value"),w),a()(o,D,Object(m.o)()),o)),W=J?B:V;return Object(n.createElement)(i.a,{align:f,className:E,currency:I,price:U.price,priceClassName:M,priceStyle:Object(m.o)()?W:{},minPrice:null==U||null===(b=U.price_range)||void 0===b?void 0:b.min_amount,maxPrice:null==U||null===(d=U.price_range)||void 0===d?void 0:d.max_amount,regularPrice:U.regular_price,regularPriceClassName:l()((y={},a()(y,"".concat(w,"__product-price__regular"),w),a()(y,D,Object(m.o)()),y)),regularPriceStyle:Object(m.o)()?V:{}})}))}}]);