/*!
 * KoliBri - The accessible HTML-Standard
 */
import{s as i,K as s}from"./component-names-61247f2f.js";import{_ as o}from"./index-0489af72.js";import{i as t,c as e}from"./i18n-fddf0324.js";let n=!1;const l=async(a,s,l)=>{var r,d,m;await t(null===(r=null==l?void 0:l.translation)||void 0===r?void 0:r.name),await e(null!==(m=null===(d=null==l?void 0:l.translation)||void 0===d?void 0:d.name)&&void 0!==m?m:"de",null==l?void 0:l.translations),(null==l?void 0:l.transformTagName)&&i(null==l?void 0:l.transformTagName);const c=await o(a,s,l);return n=!0,c},r=l,d=()=>n;class a{constructor(t,e){this.document=t,this.options=e,console.log("create",s),console.trace(),this.toastContainerElement=this.document.createElement(s),this.document.body.prepend(this.toastContainerElement)}static getInstance(t,e){if(!d())throw new Error("Toaster: Call KoliBri bootstrap/register method first.");let n=this.instances.get(t);return n||(n=new a(t,e),this.instances.set(t,n)),n}dispose(){const t=this.toastContainerElement;t?(this.toastContainerElement=void 0,t.remove()):console.warn("Toaster service is already disposed.")}enqueue(t){var e,n;if(this.toastContainerElement&&"function"==typeof this.toastContainerElement.enqueue)return!t.alertVariant&&(null===(e=this.options)||void 0===e?void 0:e.defaultAlertVariant)&&(t.alertVariant=null===(n=this.options)||void 0===n?void 0:n.defaultAlertVariant),this.toastContainerElement.enqueue(t)}closeAll(){this.toastContainerElement&&"function"==typeof this.toastContainerElement.closeAll&&this.toastContainerElement.closeAll()}}a.instances=new Map;export{a as T,l as b,r};