import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{b as getFormattedRemainingTime}from"./getters.js";import{d as defineCustomElement$2}from"./sc-icon2.js";const scUpsellCountdownTimerCss=":host{display:flex;justify-content:var(--sc-upsell-countdown-timer-justify-content, center);align-items:var(--sc-upsell-countdown-timer-align-items, center);text-align:var(--sc-upsell-countdown-timer-text-align, center);flex-wrap:wrap;gap:var(--sc-upsell-countdown-timer-gap, 0.5em);line-height:1;padding:var(--sc-upsell-countdown-timer-padding, var(--sc-spacing-medium));border-radius:var(--sc-upsell-countdown-timer-border-radius, var(--sc-border-radius-pill));background-color:var(--sc-upsell-countdown-timer-background-color, rgb(226, 249, 235));color:var(--sc-upsell-countdown-timer-color, rgb(71, 91, 80))}",ScUpsellCountdownTimerStyle0=scUpsellCountdownTimerCss,ScUpsellCountdownTimer$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.timeRemaining=1/0,this.formattedTime=void 0,this.showIcon=!0}componentDidLoad(){this.updateCountdown()}updateCountdown(){this.formattedTime=getFormattedRemainingTime(),setInterval((()=>{this.formattedTime=getFormattedRemainingTime()}),1e3)}render(){return h(Host,{key:"3494bf984bd24e5fac3d8d2c30cb88ac225a36ca",role:"timer",class:{"sc-upsell-countdown-timer":!0}},this.showIcon&&h("sc-icon",{key:"cbc5fab4d5152f10a549ac869cfa8e36f42bbe0c",name:"clock"}),h("span",{key:"6341a0a1df3542dc60b973b06c8ebe2b0f8df13e"},h("slot",{key:"6e9d40ed94611a86810ba6c1fee82eb512a566ee",name:"offer-expire-text"})," ",h("strong",{key:"6690bdd080931561c855d508d311f0e27660322a"},this.formattedTime)))}static get style(){return ScUpsellCountdownTimerStyle0}},[1,"sc-upsell-countdown-timer",{showIcon:[4,"show-icon"],timeRemaining:[32],formattedTime:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["sc-upsell-countdown-timer","sc-icon"].forEach((e=>{switch(e){case"sc-upsell-countdown-timer":customElements.get(e)||customElements.define(e,ScUpsellCountdownTimer$1);break;case"sc-icon":customElements.get(e)||defineCustomElement$2()}}))}const ScUpsellCountdownTimer=ScUpsellCountdownTimer$1,defineCustomElement=defineCustomElement$1;export{ScUpsellCountdownTimer,defineCustomElement};