var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function i(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n["throw"](t))}catch(t){a(t)}}function l(t){t.done?r(t.value):o(t.value).then(i,s)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(t){return function(e){return l([t,e])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,o&&(a=i[0]&2?o["return"]:i[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;if(o=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;o=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=e.call(t,r)}catch(t){i=[6,t];o=0}finally{n=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,g as getElement}from"./index-e3f64949.js";var balToastCss="@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.sc-bal-toast-h{display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-item-align:center;align-self:center;cursor:pointer;width:100%;-ms-flex-pack:center;justify-content:center;-ms-flex-positive:0 !important;flex-grow:0 !important}.sc-bal-toast-h .toast.sc-bal-toast{-ms-flex-item-align:center;align-self:center;display:-ms-inline-flexbox;display:inline-flex;-webkit-animation-duration:150ms;animation-duration:150ms;margin:0.5em 0;text-align:center;-webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);box-shadow:0 1px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);border-radius:3px;padding:20px 40px;pointer-events:auto;max-width:600px;-ms-flex-positive:1;flex-grow:1;font-size:0.9375rem;font-weight:700}.sc-bal-toast-h .toast.is-primary.sc-bal-toast{background:#009ee7;color:#ffffff}.sc-bal-toast-h .toast.is-info.sc-bal-toast{background:#003399;color:#fff}.sc-bal-toast-h .toast.is-success.sc-bal-toast{background:#3fc889;color:#ffffff}.sc-bal-toast-h .toast.is-warning.sc-bal-toast{background:#ff9900;color:#ffffff}.sc-bal-toast-h .toast.is-danger.sc-bal-toast{background:#ff3366;color:#ffffff}";var Toast=function(){function t(t){registerInstance(this,t);this.animationClass="fadeInDown";this.type="is-primary"}t.prototype.closeIn=function(t){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){this.timer=setTimeout((function(){return e.close()}),t);return[2]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){clearTimeout(this.timer);this.animationClass="fadeOut";this.timer=setTimeout((function(){t.element.remove();clearTimeout(t.timer)}),150);return[2]}))}))};t.prototype.render=function(){var t=this;return h(Host,{class:"container"},h("div",{role:"alert",onClick:function(){return t.close()},class:"toast "+this.animationClass+" "+this.type},h("bal-text",null,h("slot",null))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();Toast.style=balToastCss;export{Toast as bal_toast};