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:"9a9efb0825555f64b0e1065138fe9358309b2a3b",role:"timer",class:{"sc-upsell-countdown-timer":!0}},this.showIcon&&h("sc-icon",{key:"cb68f938472b6955f5f7ed0105c5a8cada231e79",name:"clock"}),h("span",{key:"6c13e82c3709e2895d4617590de4e8ef6f27824a"},h("slot",{key:"b38c01b8b89ad649cbeaad2b7a6e63665a19aa72",name:"offer-expire-text"})," ",h("strong",{key:"af31554277d95a58c265f830045946ddbd1c19ed"},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:{}}}}