import{R as t}from"./react-DAXU6W__.js";const e=t=>{let e;const s=new Set,n=(t,n)=>{const a="function"==typeof t?t(e):t;if(!Object.is(a,e)){const t=e;e=(null!=n?n:"object"!=typeof a||null===a)?a:Object.assign({},e,a),s.forEach(s=>s(e,t))}},a=()=>e,c={setState:n,getState:a,getInitialState:()=>o,subscribe:t=>(s.add(t),()=>s.delete(t))},o=e=t(n,a,c);return c},s=t=>t?e(t):e,n=t=>t;const a=e=>{const a=s(e),c=e=>function(e,s=n){const a=t.useSyncExternalStore(e.subscribe,t.useCallback(()=>s(e.getState()),[e,s]),t.useCallback(()=>s(e.getInitialState()),[e,s]));return t.useDebugValue(a),a}(a,e);return Object.assign(c,a),c},c=t=>t?a(t):a;export{c as a,s as c};
