import{Host,h}from"@stencil/core";import{getFormattedRemainingTime}from"../../../../store/upsell/getters";export class ScUpsellCountdownTimer{constructor(){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 is(){return"sc-upsell-countdown-timer"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-upsell-countdown-timer.css"]}}static get styleUrls(){return{$:["sc-upsell-countdown-timer.css"]}}static get properties(){return{showIcon:{type:"boolean",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether to show the icon."},attribute:"show-icon",reflect:!1,defaultValue:"true"}}}static get states(){return{timeRemaining:{},formattedTime:{}}}}