/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as o}from"./tslib.es6-2e5096f8.js";import{h as a,F as e}from"./index-5d2ba3a9.js";import{c as l}from"./clsx-09a06a12.js";import{t as c}from"./i18n-5fe08f1c.js";import{g as s,b as i,c as n}from"./component-names-6ca7e863.js";import{L as r}from"./dev.utils-fab45cbc.js";const t=({ariaLabel:o,icon:l})=>a(e,null,a("span",{class:"visually-hidden"},o),a(s,{class:"heading-icon",_label:"",_icons:l})),d=({type:o,label:e})=>{switch(o){case"error":return a(t,{ariaLabel:c("kol-error"),icon:"codicon codicon-error",label:e});case"info":return a(t,{ariaLabel:c("kol-info"),icon:"codicon codicon-info",label:e});case"warning":return a(t,{ariaLabel:c("kol-warning"),icon:"codicon codicon-warning",label:e});case"success":return a(t,{ariaLabel:c("kol-success"),icon:"codicon codicon-pass",label:e});default:return a(t,{ariaLabel:c("kol-message"),icon:"codicon codicon-comment",label:e})}},b=d,u=(e,s)=>{const{class:t={},type:d="default",variant:m="msg",label:u,hasCloser:v,alert:f,onAlertTimeout:g,onCloserClick:p,level:h}=e,_=o(e,["class","type","variant","label","hasCloser","alert","onAlertTimeout","onCloserClick","level"]);if(f){try{r.debug(["Navigator should vibrate ...",navigator.vibrate([100,75,100,75,100])])}catch(a){r.debug("Navigator does not support vibration.")}setTimeout((()=>{null==g||g()}),1e4)}const k=Object.assign({class:l("kol-alert-wc","alert",d,m,{hasCloser:!!v},t),role:f?"alert":void 0},_);return a("div",Object.assign({},k),a("div",{class:"heading"},a(b,{label:u,type:d}),a("div",{class:"heading-content"},u?a(i,{_label:u,_level:h}):null,"msg"===m&&a("div",{class:"content"},s)),v&&a(n,{class:"close",_ariaDescription:(null==u?void 0:u.trim())||"",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:c("kol-close-alert"),_on:{onClick:p},_tooltipAlign:"left"})),"card"===m&&a("div",{class:"content"},s))},m=u;export{m as K};