(()=>{"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:()=>i,getCurrency:()=>n,getCurrencyFromPriceResponse:()=>o});const t=window.wc.wcSettings,o=e=>((e,r)=>{if(!e?.currency_code)return r;const{currency_code:t,currency_symbol:o,currency_thousand_separator:n,currency_decimal_separator:i,currency_minor_unit:c,currency_prefix:a,currency_suffix:u}=e;return{code:t||r.code,symbol:o||r.symbol,thousandSeparator:"string"==typeof n?n:r.thousandSeparator,decimalSeparator:"string"==typeof i?i:r.decimalSeparator,minorUnit:Number.isFinite(c)?c:r.minorUnit,prefix:"string"==typeof a?a:r.prefix,suffix:"string"==typeof u?u:r.suffix}})(e,t.SITE_CURRENCY),n=(e={})=>({...t.SITE_CURRENCY,...e}),i=(e,r)=>((e,r,t)=>{if(""===e||void 0===e)return"";const o="number"==typeof e?e:parseInt(e,10);return Number.isFinite(o)?((e,r)=>{const{minorUnit:t,prefix:o,suffix:n,decimalSeparator:i,thousandSeparator:c}=r,a=e/10**t,{beforeDecimal:u,afterDecimal:s}=(e=>{const r=e.split(".");return{beforeDecimal:r[0],afterDecimal:r[1]||""}})(a.toString()),p=`${o}${((e,r)=>e.replace(/\B(?=(\d{3})+(?!\d))/g,r))(u,c)}${((e,r,t)=>e?`${r}${e.padEnd(t,"0")}`:t>0?`${r}${"0".repeat(t)}`:"")(s,i,t)}${n}`,f=document.createElement("textarea");return f.innerHTML=p,f.value})(o,{...r,...t}):""})(e,n(r));(this.wc=this.wc||{}).priceFormat=r})();