import{r as t,h as o}from"./p-c87337b7.js";import"./p-74149bb1.js";import{e as i}from"./p-8fcbeb79.js";const s=class{constructor(o){t(this,o)}onTrigger(t){"close"==t.detail.name&&(t.stopPropagation(),this.notice=void 0)}onUpdatedNotice(t){this.timer&&(window.clearTimeout(this.timer),this.timer=void 0),null==t||i.is(t)&&t.remain||(this.timer=window.setTimeout(()=>{this.notice=void 0,this.timer=void 0},i.is(t)&&t.timeout?t.timeout:5e3))}onNotice(t){this.notice=t.detail}render(){const t=this.notice?"string"==typeof this.notice?JSON.parse(this.notice):this.notice:void 0,i=t&&"default"!=t.type?t.type:"primary";return null==t?o("slot",null):[o("slot",null),o("aside",{class:t.type},o("p",null,t.message,o("smoothly-trigger",{color:i,fill:"clear",name:"close"},o("smoothly-icon",{name:"close-circle",color:i}))))]}static get watchers(){return{notice:["onUpdatedNotice"]}}static get style(){return".sc-smoothly-notifier-h{display:block}[hidden].sc-smoothly-notifier-h{display:none}smoothly-trigger.sc-smoothly-notifier{display:inline-block;vertical-align:middle}aside.sc-smoothly-notifier{text-align:center;vertical-align:middle;width:100%-2em;padding-left:1em;padding-right:1em;border-style:solid;border-width:1px;border-radius:5px}aside.warning.sc-smoothly-notifier{background-color:rgb(var(--smoothly-warning-tint));border-color:rgb(var(--smoothly-warning-shade));color:rgb(var(--smoothly-warning-contrast))}aside.success.sc-smoothly-notifier{background-color:rgb(var(--smoothly-success-color));border-color:rgb(var(--smoothly-success-shade));color:rgb(var(--smoothly-success-contrast))}aside.danger.sc-smoothly-notifier{background-color:rgb(var(--smoothly-danger-tint));border-color:rgb(var(--smoothly-danger-shade));color:rgb(var(--smoothly-danger-contrast))}aside.default.sc-smoothly-notifier{background-color:rgb(var(--smoothly-primary-tint));border-color:rgb(var(--smoothly-primary-shade));color:rgb(var(--smoothly-primary-contrast))}"}};export{s as smoothly_notifier};