"use strict";const store=require("./store-ce062aec.js"),isBusy=()=>["loading","busy","redirecting"].includes(store.state.loading),getExitUrl=()=>{var t,e;return(null===(e=null===(t=null===store.state||void 0===store.state?void 0:store.state.checkout)||void 0===t?void 0:t.metadata)||void 0===e?void 0:e.success_url)||store.state.success_url||null},getDiscountedAmount=t=>{var e,o;return null!==(o=null===(e=null===store.state||void 0===store.state?void 0:store.state.line_item)||void 0===e?void 0:e.total_amount)&&void 0!==o?o:t},getScratchAmount=t=>{var e,o,i;return(null===(e=null===store.state||void 0===store.state?void 0:store.state.line_item)||void 0===e?void 0:e.total_savings_amount)?-(null===(o=null===store.state||void 0===store.state?void 0:store.state.line_item)||void 0===o?void 0:o.total_savings_amount)+(null===(i=null===store.state||void 0===store.state?void 0:store.state.line_item)||void 0===i?void 0:i.total_amount):t},getUpsellRemainingTime=(t="seconds")=>{var e;const o=null===(e=store.state.checkout)||void 0===e?void 0:e.upsells_expire_at;if(!o)return null;const i=Date.now(),s=Math.floor((1e3*o-i)/1e3);return s<0?0:"seconds"===t?s:"minutes"===t?Math.floor(s/60):"hours"===t?Math.floor(s/60/60):void 0},formatTimeUnit=t=>t<10?`0${t}`:`${t}`,getFormattedRemainingTime=()=>{var t;if(!(null===(t=store.state.checkout)||void 0===t?void 0:t.upsells_expire_at))return"--:--";const e=getUpsellRemainingTime("seconds"),o=Math.floor(e/86400),i=Math.floor(e%86400/3600),s=Math.floor(e%3600/60),r=Math.floor(e%60);return o>0?`${formatTimeUnit(o)}:${formatTimeUnit(i)}:${formatTimeUnit(s)}:${formatTimeUnit(r)}`:i>0?`${formatTimeUnit(i)}:${formatTimeUnit(s)}:${formatTimeUnit(r)}`:`${formatTimeUnit(s)}:${formatTimeUnit(r)}`},isUpsellExpired=()=>{const t=getUpsellRemainingTime();return null!==getUpsellRemainingTime()&&t<=0};exports.getDiscountedAmount=getDiscountedAmount,exports.getExitUrl=getExitUrl,exports.getFormattedRemainingTime=getFormattedRemainingTime,exports.getScratchAmount=getScratchAmount,exports.isBusy=isBusy,exports.isUpsellExpired=isUpsellExpired;