import{_ as p}from"./tslib.es6-1173d062-BGVaTf34.js";import{L as u,h as o,l as _,c as h,e as k,F as C}from"./index-BeCeuELg.js";import{c as L}from"./clsx-09a06a12-B-dksMZM.js";import{t as c}from"./i18n-43b7aa72-DSS4ELtF.js";const n=({ariaLabel:e,icon:a})=>o(C,null,o("span",{class:"visually-hidden"},e),o(k,{class:"heading-icon",_label:"",_icons:a})),T=({type:e,label:a})=>{switch(e){case"error":return o(n,{ariaLabel:c("kol-error"),icon:"codicon codicon-error",label:a});case"info":return o(n,{ariaLabel:c("kol-info"),icon:"codicon codicon-info",label:a});case"warning":return o(n,{ariaLabel:c("kol-warning"),icon:"codicon codicon-warning",label:a});case"success":return o(n,{ariaLabel:c("kol-success"),icon:"codicon codicon-pass",label:a});default:return o(n,{ariaLabel:c("kol-message"),icon:"codicon codicon-comment",label:a})}},I=(e,a)=>{const{class:g={},type:r="default",variant:s="msg",label:l,hasCloser:t,alert:d,onAlertTimeout:i,onCloserClick:v,level:b}=e,m=p(e,["class","type","variant","label","hasCloser","alert","onAlertTimeout","onCloserClick","level"]);if(d){try{u.debug(["Navigator should vibrate ...",navigator.vibrate([100,75,100,75,100])])}catch{u.debug("Navigator does not support vibration.")}setTimeout(()=>{i?.()},1e4)}const f=Object.assign({class:L("kol-alert-wc","alert",r,s,{hasCloser:!!t},g)},m);return o("div",Object.assign({},f,{role:d?"alert":void 0}),o("div",{class:"heading"},o(T,{label:l,type:r}),o("div",{class:"heading-content"},l?o(_,{_label:l,_level:b}):null,s==="msg"&&o("div",{class:"content"},a)),t&&o(h,{class:"close",_ariaDescription:l?.trim()||"",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:c("kol-close-alert"),_on:{onClick:v},_tooltipAlign:"left"})),s==="card"&&o("div",{class:"content"},a))};export{I as K};
//# sourceMappingURL=Alert-733b0883-Df5pVzCu.js.map
