(()=>{"use strict";var e={d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{formatPrice:()=>c,getCurrency:()=>n,getCurrencyFromPriceResponse:()=>i});const t=window.wp.htmlEntities,o=window.wc.wcSettings,i=e=>{if(null==e||!e.currency_code)return o.SITE_CURRENCY;const{currency_code:r,currency_symbol:t,currency_thousand_separator:i,currency_decimal_separator:n,currency_minor_unit:c,currency_prefix:a,currency_suffix:s}=e;return{code:r||o.SITE_CURRENCY.code,symbol:t||o.SITE_CURRENCY.symbol,thousandSeparator:"string"==typeof i?i:o.SITE_CURRENCY.thousandSeparator,decimalSeparator:"string"==typeof n?n:o.SITE_CURRENCY.decimalSeparator,minorUnit:Number.isFinite(c)?c:o.SITE_CURRENCY.minorUnit,prefix:"string"==typeof a?a:o.SITE_CURRENCY.prefix,suffix:"string"==typeof s?s:o.SITE_CURRENCY.suffix}},n=(e={})=>({...o.SITE_CURRENCY,...e}),c=(e,r)=>{if(""===e||void 0===e)return"";const o="number"==typeof e?e:parseInt(e,10);if(!Number.isFinite(o))return"";const i=n(r),{minorUnit:c,prefix:a,suffix:s,decimalSeparator:u,thousandSeparator:p}=i,f=o/10**c,{beforeDecimal:d,afterDecimal:y}=(e=>{const r=e.split(".");return{beforeDecimal:r[0],afterDecimal:r[1]||""}})(f.toString()),l=`${a}${((e,r)=>e.replace(/\B(?=(\d{3})+(?!\d))/g,r))(d,p)}${((e,r,t)=>e?`${r}${e.padEnd(t,"0")}`:t>0?`${r}${"0".repeat(t)}`:"")(y,u,c)}${s}`;return(0,t.decodeEntities)(l)};(this.wc=this.wc||{}).priceFormat=r})();