1import{s as e}from"./rolldown-runtime.js";import{t}from"./react.js";import{i as n}from"./factory.js";import{d as r}from"./MantineThemeProvider.js";import{t as i}from"./random-id.js";import{t as a}from"./Toast.js";import{t as o}from"./CheckIcon2.js";import{n as s}from"./colors.js";var c=e(t(),1);function l(e){let t=e,n=!1,r=new Set;return{getState(){return t},updateState(e){t=typeof e==`function`?e(t):e},setState(e){this.updateState(e),r.forEach(e=>e(t))},initialize(e){n||=(t=e,!0)},subscribe(e){return r.add(e),()=>r.delete(e)}}}function u(e){return(0,c.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState())}function d(e,t,n){let r=[],i=[],a={};for(let o of e){let e=o.position||t;a[e]=a[e]||0,a[e]+=1,a[e]<=n?i.push(o):r.push(o)}return{notifications:i,queue:r}}var f=l({notifications:[],queue:[],defaultPosition:`bottom-right`,limit:5}),p=(e=f)=>u(e);function m(e,t){let n=e.getState(),r=d(t([...n.notifications,...n.queue]),n.defaultPosition,n.limit);e.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function h(e,t=f){let n=e.id||i();return m(t,t=>e.id&&t.some(t=>t.id===e.id)?t:[...t,{...e,id:n}]),n}function g(e,t=f){return m(t,t=>t.filter(t=>t.id!==e||(t.onClose?.(t),!1))),e}function _(e,t=f){return m(t,t=>t.map(t=>t.id===e.id?{...t,...e}:t)),e.id}function v(e=f){m(e,()=>[])}
1function y(e=f){m(e,t=>t.slice(0,e.getState().limit))}var b={show:h,hide:g,update:_,clean:v,cleanQueue:y,updateState:m},x=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20fill='none'%20viewBox='0%200%2020%2020'%3e%3cpath%20stroke='currentColor'%20stroke-miterlimit='10'%20stroke-width='1.25'%20d='M19.002%2010a1%201%200%200%200-18%200%201%201%200%200%200%2018%200Z'/%3e%3cpath%20stroke='currentColor'%20stroke-width='1.25'%20d='M13.644%206.342l-7.2%207.2'/%3e%3cpath%20stroke='currentColor'%20stroke-width='1.25'%20d='M13.56%2013.542l-7.2-7.2'/%3e%3c/svg%3e`,S=r();function C({style:e,...t}){return(0,S.jsx)(n,{style:{borderRadius:`100%`,display:`inline-block`,background:`url("${x}")`,width:20,height:20,content:``,...e},...t})}function w(e){return(0,S.jsxs)(`svg`,{"aria-label":`info`,xmlns:`http://www.w3.org/2000/svg`,width:16,height:16,fill:`none`,...e,children:[(0,S.jsx)(`path`,{stroke:`currentColor`,strokeMiterlimit:10,d:`M8 .5a7.5 7.5 0 1 1 0 15 7.5 7.5 0 0 1 0-15Z`}),(0,S.jsx)(`path`,{stroke:`currentColor`,d:`M5.5 12h5M8 12V8a1 1 0 0 0-1-1H6`}),(0,S.jsx)(`circle`,{cx:8,cy:4.5,r:.5,stroke:`currentColor`})]})}function T(e){return(0,S.jsxs)(`svg`,{"aria-label":`info`,width:`20`,height:`21`,viewBox:`0 0 20 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,S.jsx)(`path`,{d:`M19.002 10.5C19.002 5.52944 14.9725 1.5 10.002 1.5C5.03139 1.5 1.00195 5.52944 1.00195 10.5C1.00195 15.4706 5.03139 19.5 10.002 19.5C14.9725 19.5 19.002 15.4706 19.002 10.5Z`,stroke:`var(--pr-dark)`,strokeWidth:`1.25`,strokeMiterlimit:`10`}),(0,S.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.30057 14.0028V15.2108H13.1006V14.0028H10.8886V9.78523C10.8886 9.35448 10.7808 9.01305 10.5478 8.78002C10.3147 8.54698 9.97332 8.43923 9.54257 8.43923H7.53857V9.64723H9.26257C9.36382 9.64723 9.42139 9.67247 9.45436 9.70544C9.48732 9.7384 9.51257 9.79598 9.51257 9.89723V14.0028H7.30057Z`,fill:`var(--pr-dark)`}),(0,S.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.34586 6.7255C9.5525 6.93214 9.81183 7.03479 10.1166 7.03479C10.4126 7.03479 10.6666 6.93173 10.8724 6.72636C11.0869 6.52173 11.1966 6.27217 11.1966 5.98279C11.1966 5.68548 11.0878 5.43487 10.8715 5.23831C10.6659 5.03354 10.4122 4.93079 10.1166 4.93079C9.81228 4.93079 9.55326 5.03313 9.34676 5.23917C9.13973 5.4363 9.03657 5.68673 9.03657 5.98279C9.03657 6.27094 9.14065 6.52029 9.34586 6.7255ZM11.0508 6.27468C11.062 6.24116 11.0711 6.20686 11.0782 6.17179L11.0508 6.27468Z`,fill:`var(--pr-dark)`})]})}function E({size:e,...t}){switch(e){case`sm`:return(0,S.jsx)(w,{...t});default:return(0,S.jsx)(T,{...t})}}var D=function(e){return e[e.INFO=0]=`INFO`,e[e.SUCCESS=1]=`SUCCESS`,e[e.ERROR=2]=`ERROR`,e[e.TOAST=3]=`TOAST`,e}({}),O=e=>{switch(e){case 0:return{icon:(0,S.jsx)(E,{})};case 1:return{icon:(0,S.jsx)(o,{fill:`var(--mantine-primary-color-4)`})};case 2:return{autoClose:!1,icon:(0,S.jsx)(C,{style:{backgroundColor:s.red[0]},"aria-hidden":!0})};case 3:return{autoClose:!1}}},k=({title:e,message:t,icon:n,...r},i,o,s)=>{let{icon:c,...l}=O(i);b.show({...l,...o&&{autoClose:!1},...r,...s&&{"data-testid":s},message:(0,S.jsx)(a,{title:e,actions:o,icon:n??c,children:t})})};export{g as a,p as c,C as i,k as n,b as o,E as r,f as s,D as t}; 2//# sourceMappingURL=appNotifications.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.