var e=e=>{let t=document.createElement(`textarea`);return t.innerHTML=String(e||``),t.value.replace(/\u00a0/g,` `)},t=()=>window.BuyMeCoffeeAdmin||window.buymecoffee_general||{},n=n=>{let r=t(),i=r.currency_symbols||{},a=(n||r.default_currency||`USD`).toUpperCase();return e(i[a]||a+` `)},r=(e,t)=>e.replace(/\B(?=(\d{3})+(?!\d))/g,t),i=(e,i,a={})=>{let o=t(),s=o.formatting_settings||{},c=a.decimalSeparator||s.decimal_separator||`dot`,l=a.currencyPosition||s.currency_position||`before`,u=c===`comma`?`,`:`.`,d=u===`,`?`.`:`,`,f=(i||o.default_currency||s.currency||`USD`).toUpperCase(),p=n(f),m=Number(e||0),[h,g]=(Number.isFinite(m)?m.toFixed(2):`0.00`).split(`.`),_=r(h,d)+u+g;switch(l){case`after`:return _+p;case`iso_before`:return f+` `+_;case`iso_after`:return _+` `+f;case`symbool_before_iso`:return p+_+` `+f;case`symbool_after_iso`:return f+` `+_+p;case`symbool_and_iso`:return f+` `+p+_;default:return p+_}},a=(e,t,n={})=>(e==null||e===``)&&n.empty!==void 0?n.empty:i(Number(e||0)/100,t,n);export{i as n,n as r,a as t};