'use client'; System.register(["react","jotai/vanilla"],function(C){"use strict";var S,b,h,A,p,y,P,j,k,m,w;return{setters:[function(u){S=u.createContext,b=u.useContext,h=u.useRef,A=u.createElement,p=u.default,y=u.useReducer,P=u.useEffect,j=u.useDebugValue,k=u.useCallback},function(u){m=u.getDefaultStore,w=u.createStore}],execute:function(){C({useAtom:T,useAtomValue:E,useSetAtom:R});const u=S(void 0),v=t=>{const e=b(u);return(t==null?void 0:t.store)||e||m()};C({useStore:v,Provider:({children:t,store:e})=>{const r=h(void 0);return!e&&!r.current&&(r.current=w()),A(u.Provider,{value:e||r.current},t)}});const d=t=>typeof(t==null?void 0:t.then)=="function",x=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},V=p.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(x(t),t)}),g=new WeakMap,D=t=>{let e=g.get(t);return e||(e=new Promise((r,a)=>{let i=t;const f=s=>n=>{i===s&&r(n)},c=s=>n=>{i===s&&a(n)},o=s=>{"onCancel"in s&&typeof s.onCancel=="function"&&s.onCancel(n=>{d(n)?(g.set(n,e),i=n,n.then(f(n),c(n)),o(n)):r(n)})};t.then(f(t),c(t)),o(t)}),g.set(t,e)),e};function E(t,e){const r=v(e),[[a,i,f],c]=y(n=>{const l=r.get(t);return Object.is(n[0],l)&&n[1]===r&&n[2]===t?n:[l,r,t]},void 0,()=>[r.get(t),r,t]);let o=a;(i!==r||f!==t)&&(c(),o=r.get(t));const s=e==null?void 0:e.delay;if(P(()=>{const n=r.sub(t,()=>{if(typeof s=="number"){const l=r.get(t);d(l)&&x(D(l)),setTimeout(c,s);return}c()});return c(),n},[r,t,s]),j(o),d(o)){const n=D(o);return V(n)}return o}function R(t,e){const r=v(e);return k((...a)=>r.set(t,...a),[r,t])}function T(t,e){return[E(t,e),R(t,e)]}}}});