import{_}from"./tslib.es6-1173d062-BAJoBDh7.js";import{L as u,h as o,l as f,c as h,e as k,F as C}from"./index-DJsSmExJ.js";import{c as L}from"./clsx-09a06a12-BT_IL7Fz.js";import{t as s}from"./i18n-3dd5729d-BpkfrZlH.js";/*!
 * KoliBri - The accessible HTML-Standard
 */const c=({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(c,{ariaLabel:s("kol-error"),icon:"codicon codicon-error",label:a});case"info":return o(c,{ariaLabel:s("kol-info"),icon:"codicon codicon-info",label:a});case"warning":return o(c,{ariaLabel:s("kol-warning"),icon:"codicon codicon-warning",label:a});case"success":return o(c,{ariaLabel:s("kol-success"),icon:"codicon codicon-pass",label:a});default:return o(c,{ariaLabel:s("kol-message"),icon:"codicon codicon-comment",label:a})}},I=(e,a)=>{const{class:g={},type:r="default",variant:i="msg",label:l,hasCloser:d,alert:n,onAlertTimeout:t,onCloserClick:v,level:b}=e,m=_(e,["class","type","variant","label","hasCloser","alert","onAlertTimeout","onCloserClick","level"]);if(n){try{u.debug(["Navigator should vibrate ...",navigator.vibrate([100,75,100,75,100])])}catch{u.debug("Navigator does not support vibration.")}setTimeout(()=>{t?.()},1e4)}const p=Object.assign({class:L("kol-alert-wc","alert",r,i,{hasCloser:!!d},g)},m);return o("div",Object.assign({},p,{"aria-live":n?"assertive":"polite",role:n?"alert":"status"}),o("div",{class:"heading"},o(T,{label:l,type:r}),o("div",{class:"heading-content"},l?o(f,{_label:l,_level:b}):null,i==="msg"&&o("div",{class:"content"},a)),d&&o(h,{class:"close",_ariaDescription:l?.trim()||"",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:s("kol-close-alert"),_on:{onClick:v},_tooltipAlign:"left"})),i==="card"&&o("div",{class:"content"},a))};export{I as K};
//# sourceMappingURL=Alert-95f2c21b-B9ESgkaq.js.map
