/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as o}from"./tslib.es6-1173d062.js";import{h as l}from"./index-91489a9f.js";import{c as a}from"./clsx-09a06a12.js";import{t as e}from"./i18n-5fe08f1c.js";import{d as n,a as i}from"./component-names-a18a51c8.js";import{K as c}from"./Heading-0459992b.js";const t=({ariaLabel:o,icon:a})=>l(n,{class:"kol-alert__heading-icon",_label:o,_icons:a}),r=({type:o,label:a})=>{switch(o){case"error":return l(t,{ariaLabel:e("kol-error"),icon:"codicon codicon-error",label:a});case"info":return l(t,{ariaLabel:e("kol-info"),icon:"codicon codicon-info",label:a});case"warning":return l(t,{ariaLabel:e("kol-warning"),icon:"codicon codicon-warning",label:a});case"success":return l(t,{ariaLabel:e("kol-success"),icon:"codicon codicon-pass",label:a});default:return l(t,{ariaLabel:e("kol-message"),icon:"codicon codicon-comment",label:a})}},s=r,d=(t,n)=>{var r,d;const{class:v={},type:b="default",variant:m="msg",label:_,hasCloser:u,alert:k,onAlertTimeout:g,onCloserClick:f,level:p}=t,h=o(t,["class","type","variant","label","hasCloser","alert","onAlertTimeout","onCloserClick","level"]);k&&((null===(r=navigator.userActivation)||void 0===r?void 0:r.hasBeenActive)&&(null===(d=null===navigator||void 0===navigator?void 0:navigator.vibrate)||void 0===d||d.call(navigator,[100,75,100,75,100])),setTimeout((()=>{null==g||g()}),1e4));const j=Object.assign({class:a("kol-alert",`kol-alert--${b}`,`kol-alert--${m}`,{"kol-alert--hasCloser":!!u},v),role:k?"alert":void 0},h);return l("div",Object.assign({},j),l("div",{class:"kol-alert__container"},l(s,{label:_,type:b}),l("div",{class:"kol-alert__container-content"},_?l(c,{class:"kol-alert__heading",level:p},_):null,"msg"===m&&l("div",{class:"kol-alert__content"},n)),u&&l(i,{class:"kol-alert__close-button close","data-testid":"alert-close-button",_ariaDescription:(null==_?void 0:_.trim())||"",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:e("kol-close-alert"),_on:{onClick:f},_tooltipAlign:"left"})),"card"===m&&l("div",{class:"kol-alert__content"},n))},v=d;export{v as K};