import{E as a,s as y,F as m,G as q,H as w}from"./index-ef7ebca2.js";const o=[];function z(n,i){return{subscribe:A(n,i).subscribe}}function A(n,i=a){let u;const t=new Set;function f(e){if(y(n,e)&&(n=e,u)){const r=!o.length;for(const s of t)s[1](),o.push(s,n);if(r){for(let s=0;s{t.delete(s),t.size===0&&(u(),u=null)}}return{set:f,update:l,subscribe:b}}function E(n,i,u){const t=!Array.isArray(n),f=t?[n]:n,l=i.length<2;return z(u,b=>{let e=!1;const r=[];let s=0,d=a;const g=()=>{if(s)return;d();const c=i(t?r[0]:r,b);l?b(c):d=w(c)?c:a},_=f.map((c,p)=>m(c,h=>{r[p]=h,s&=~(1<{s|=1<