import{s as n}from"./p-86fd1a31.js";const t=()=>["loading","busy","redirecting"].includes(n.loading),o=()=>{var o,r;return(null===(r=null===(o=null==n?void 0:n.checkout)||void 0===o?void 0:o.metadata)||void 0===r?void 0:r.success_url)||n.success_url||null},s=(o="seconds")=>{var r;const s=null===(r=n.checkout)||void 0===r?void 0:r.upsells_expire_at;if(!s)return null;const l=Date.now(),t=Math.floor((1e3*s-l)/1e3);return t<0?0:"seconds"===o?t:"minutes"===o?Math.floor(t/60):"hours"===o?Math.floor(t/60/60):void 0},r=o=>o<10?`0${o}`:`${o}`,i=()=>{var o;if(!(null===(o=n.checkout)||void 0===o?void 0:o.upsells_expire_at))return"--:--";const l=s("seconds"),t=Math.floor(l/86400),e=Math.floor(l%86400/3600),u=Math.floor(l%3600/60),a=Math.floor(l%60);return t>0?`${r(t)}:${r(e)}:${r(u)}:${r(a)}`:e>0?`${r(e)}:${r(u)}:${r(a)}`:`${r(u)}:${r(a)}`},e=()=>{const o=s();return null!==s()&&o<=0};export{t as a,i as b,o as g,e as i};