import{__spreadArray as o,__assign as i}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as n}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{v4 as e}from"uuid";import{Notifications as u}from"./Notifications.js";var c=function(){var c=t([]),f=c[0],a=c[1],s=function(i){a((function(n){return o(o([],n,!0),[i],!1)}))},m=function(o){a((function(i){return i.filter((function(i){return i.id!==o}))}))},N=function(o,n,t){void 0===t&&(t={});var r=i({autoHideDuration:3e3,content:n||{info:"Info",error:"Error",warning:"Warning",success:"Success",neutral:"Neutral"}[o]||"info",id:e(),variant:o},t);return s(r),r.id},d=function(o,i){return N("success",o,i)},l=function(o,i){return N("error",o,i)},w=function(o,i){return N("warning",o,i)},v=function(o,i){return N("info",o,i)},p=function(o,i){return N("neutral",o,i)};return r((function(){window[Symbol.for("notificationToasts")]={createNotification:s,removeNotification:m,showErrorNotification:l,showInfoNotification:v,showNeutralNotification:p,showSuccessNotification:d,showWarningNotification:w}}),[]),n(u,{notifications:f,removeNotification:m})};export{c as NotificationsContainer};
