import{s as r,a as e,_ as a}from"./p-8415f806.js";import"./p-fd56940f.js";const t=e=>(null==e?void 0:e.amount_off)&&(null==e?void 0:e.currency)?s({amount:e.amount_off,currency:e.currency}):(null==e?void 0:e.percent_off)?r(a("%1d%% off","surecart"),0|e.percent_off):"",s=({amount:r,currency:e})=>{const a=((r,e)=>["bif","clp","djf","gnf","jpy","kmf","krw","xaf"].includes(e)?r:r/100)(r,e);return`${new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(parseFloat(a.toFixed(2)))}`},n=(r="usd")=>{const[e]=new Intl.NumberFormat(void 0,{style:"currency",currency:r}).formatToParts(0);return null==e?void 0:e.value},c=(t,s,n=a("every","surecart"),c=a("once","surecart"),u=!1)=>{switch(s){case"day":return`${n} ${r(e(u?"%d day":"day","%d days",t,"surecart"),t)}`;case"week":return`${n} ${r(e(u?"%d week":"week","%d weeks",t,"surecart"),t)}`;case"month":return`${n} ${r(e(u?"%d month":"month","%d months",t,"surecart"),t)}`;case"year":return`${n} ${r(e(u?"%d year":"year","%d years",t,"surecart"),t)}`;default:return c}},u=(r,e={})=>{if(!r)return"";const{showOnce:t,labels:s,abbreviate:n}=e,{interval:c=a("every","surecart")}=s||{};return`${d(r,c,t?a("once","surecart"):"",n)} ${o(r,n)}`},d=(t,s,n=a("once","surecart"),u=!1)=>t.recurring_interval_count&&t.recurring_interval?u?((t,s,n=a("once","surecart"),c=!1)=>{switch(s){case"day":return` / ${r(e(c?"%d day":"day","%d days",t,"surecart"),t)}`;case"week":return` / ${r(e(c?"%d wk":"wk","%d wks",t,"surecart"),t)}`;case"month":return` / ${r(c?e("%d mo","%d months",t,"surecart"):e("mo","%d mos",t,"surecart"),t)}`;case"year":return` / ${r(e(c?"%d yr":"yr","%d yrs",t,"surecart"),t)}`;default:return n}})(t.recurring_interval_count,t.recurring_interval,n):c(t.recurring_interval_count,t.recurring_interval,` ${s}`,n):"",o=(a,t=!1)=>(null==a?void 0:a.recurring_period_count)?t?`x ${a.recurring_period_count}`:` (${r(e("%d payment","%d payments",a.recurring_period_count,"surecart"),a.recurring_period_count)})`:"",y=a=>r(e("%d payment remaining","%d payments remaining",a,"surecart"),a);export{y as a,n as b,t as g,u as i,c as t}