import{l as v,m as a,n as _,u as g,o as l,v as c,w as m,x,y,z as h,A as k,B as b,C as w}from"./runtime.BHiCNJhu.js";import{a as z}from"./entry.DRATS3pn.js";function C(e=!1){const s=_,n=s.l.u;if(!n)return;let r=()=>x(s.s);if(e){let u=0,t={};const d=y(()=>{let i=!1;const f=s.s;for(const o in f)f[o]!==t[o]&&(t[o]=f[o],i=!0);return i&&u++,u});r=()=>c(d)}n.b.length&&v(()=>{p(s,r),l(n.b)}),a(()=>{const u=g(()=>n.m.map(m));return()=>{for(const t of u)typeof t=="function"&&t()}}),n.a.length&&a(()=>{p(s,r),l(n.a)})}function p(e,s){if(e.l.s)for(const n of e.l.s)c(n);s()}function j(e,s,n){const r=n[s]??(n[s]={store:null,source:k(void 0),unsubscribe:b});if(r.store!==e)if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=b;else{var u=!0;r.unsubscribe=z(e,t=>{u?r.source.v=t:w(r.source,t)}),u=!1}return c(r.source)}function q(){const e={};return h(()=>{for(var s in e)e[s].unsubscribe()}),e}export{j as a,C as i,q as s};
