import{L as Q,r as Y,M as R,G as Z,N as tt,I as nt,O as P,P as J,Q as U,R as et,S as st,J as ot,U as ct,p as V,v as rt,V as at}from"./runtime-dom.esm-bundler-CnPoR0UW.chunk.mjs";let W;const I=t=>W=t,q=Symbol();function A(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var w;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(w||(w={}));function dt(){const t=Q(!0),o=t.run(()=>Y({}));let e=[],n=[];const r=R({install(i){I(r),r._a=i,i.provide(q,r),i.config.globalProperties.$pinia=r,n.forEach(a=>e.push(a)),n=[]},use(i){return this._a?e.push(i):n.push(i),this},_p:e,_a:null,_e:t,_s:new Map,state:o});return r}const z=()=>{};function G(t,o,e,n=z){t.add(o);const r=()=>{t.delete(o)&&n()};return!e&&et()&&st(r),r}function m(t,...o){t.forEach(e=>{e(...o)})}const it=t=>t(),L=Symbol(),M=Symbol();function F(t,o){t instanceof Map&&o instanceof Map?o.forEach((e,n)=>t.set(n,e)):t instanceof Set&&o instanceof Set&&o.forEach(t.add,t);for(const e in o){if(!o.hasOwnProperty(e))continue;const n=o[e],r=t[e];A(r)&&A(n)&&t.hasOwnProperty(e)&&!P(n)&&!J(n)?t[e]=F(r,n):t[e]=n}return t}const ut=Symbol();function ft(t){return!A(t)||!Object.prototype.hasOwnProperty.call(t,ut)}const{assign:p}=Object;function lt(t){return!!(P(t)&&t.effect)}function pt(t,o,e,n){const{state:r,actions:i,getters:a}=o,j=e.state.value[t];let h;function d(){j||(e.state.value[t]=r?r():{});const y=ct(e.state.value[t]);return p(y,i,Object.keys(a||{}).reduce((b,v)=>(b[v]=R(V(()=>{I(e);const _=e._s.get(t);return a[v].call(_,_)})),b),{}))}return h=B(t,d,o,e,n,!0),h}function B(t,o,e={},n,r,i){let a;const j=p({actions:{}},e),h={deep:!0};let d,y,b=new Set,v=new Set,_;const S=n.state.value[t];!i&&!S&&(n.state.value[t]={});let N;function k(s){let c;d=y=!1,typeof s=="function"?(s(n.state.value[t]),c={type:w.patchFunction,storeId:t,events:_}):(F(n.state.value[t],s),c={type:w.patchObject,payload:s,storeId:t,events:_});const u=N=Symbol();ot().then(()=>{N===u&&(d=!0)}),y=!0,m(b,c,n.state.value[t])}const D=i?function(){const{state:s}=e,c=s?s():{};this.$patch(u=>{p(u,c)})}:z;function H(){a.stop(),b.clear(),v.clear(),n._s.delete(t)}const C=(s,c="")=>{if(L in s)return s[M]=c,s;const u=function(){I(n);const E=Array.from(arguments),$=new Set,x=new Set;function T(f){$.add(f)}function X(f){x.add(f)}m(v,{args:E,name:u[M],store:l,after:T,onError:X});let g;try{g=s.apply(this&&this.$id===t?this:l,E)}catch(f){throw m(x,f),f}return g instanceof Promise?g.then(f=>(m($,f),f)).catch(f=>(m(x,f),Promise.reject(f))):(m($,g),g)};return u[L]=!0,u[M]=c,u},K={_p:n,$id:t,$onAction:G.bind(null,v),$patch:k,$reset:D,$subscribe(s,c={}){const u=G(b,s,c.detached,()=>E()),E=a.run(()=>rt(()=>n.state.value[t],$=>{(c.flush==="sync"?y:d)&&s({storeId:t,type:w.direct,events:_},$)},p({},h,c)));return u},$dispose:H},l=nt(K);n._s.set(t,l);const O=(n._a&&n._a.runWithContext||it)(()=>n._e.run(()=>(a=Q()).run(()=>o({action:C}))));for(const s in O){const c=O[s];if(P(c)&&!lt(c)||J(c))i||(S&&ft(c)&&(P(c)?c.value=S[s]:F(c,S[s])),n.state.value[t][s]=c);else if(typeof c=="function"){const u=C(c,s);O[s]=u,j.actions[s]=c}}return p(l,O),p(U(l),O),Object.defineProperty(l,"$state",{get:()=>n.state.value[t],set:s=>{k(c=>{p(c,s)})}}),n._p.forEach(s=>{p(l,a.run(()=>s({store:l,app:n._a,pinia:n,options:j})))}),S&&i&&e.hydrate&&e.hydrate(l.$state,S),d=!0,y=!0,l}function yt(t,o,e){let n;const r=typeof o=="function";n=r?e:o;function i(a,j){const h=tt();return a=a||(h?Z(q,null):null),a&&I(a),a=W,a._s.has(t)||(r?B(t,o,n,a):pt(t,n,a)),a._s.get(t)}return i.$id=t,i}function bt(t){const o=U(t),e={};for(const n in o){const r=o[n];r.effect?e[n]=V({get:()=>t[n],set(i){t[n]=i}}):(P(r)||J(r))&&(e[n]=at(t,n))}return e}export{dt as c,yt as d,bt as s};
//# sourceMappingURL=pinia-CAJsRK22.chunk.mjs.map
