import{o as b,q as $,E as K,v as R,w as z,x as j,y as ee,g as U,z as ne,H as re,A as X,B as L,C as F,D as fe,F as ae,G as y,I as ie,J as w,K as q,L as le,M as se,N as ue,O as oe,P as V,Q as te,R as de,d as ve,S as G,T as ce,U as pe,V as P,W as Q,X as Y,Y as ge,Z as _e,_ as he,$ as Ee,a0 as me,a1 as Te,a2 as we}from"./template.CyUWgh-J.js";function Ne(e,r){return r}function Ae(e,r,s){for(var o=[],c=r.length,l,i=r.length,p=0;p{if(l){if(l.pending.delete(h),l.done.add(h),l.pending.size===0){var t=e.outrogroups;B(e,V(l.done)),t.delete(l),t.size===0&&(e.outrogroups=null)}}else i-=1},!1)}if(i===0){var a=o.length===0&&s!==null;if(a){var v=s,f=v.parentNode;Ee(f),f.append(v),e.items.clear()}B(e,r,!a)}else l={pending:new Set(r),done:new Set},(e.outrogroups??=new Set).add(l)}function B(e,r,s=!0){var o;if(e.pending.size>0){o=new Set;for(const i of e.pending.values())for(const p of i)o.add(e.items.get(p).e)}for(var c=0;c{var d=s();return oe(d)?d:d==null?[]:V(d)}),t,E=new Map,m=!0;function x(d){(C.effect.f&pe)===0&&(C.pending.delete(d),C.fallback=f,Ce(C,t,i,r,o),f!==null&&(t.length===0?(f.f&w)===0?P(f):(f.f^=w,k(f,null,i)):Q(f,()=>{f=null})))}function n(d){C.pending.delete(d)}var u=$(()=>{t=U(h);var d=t.length;let _=!1;if(R){var H=ne(i)===re;H!==(d===0)&&(i=X(),z(i),L(!1),_=!0)}for(var S=new Set,g=ie,D=se(),I=0;Il(i)):(f=q(()=>l(J??=b())),f.f|=w)),d>S.size&&le(),R&&d>0&&z(X()),!m)if(E.set(g,S),D){for(const[W,Z]of p)S.has(W)||g.skip_effect(Z.e);g.oncommit(x),g.ondiscard(n)}else x(g);_&&L(!0),U(h)}),C={effect:u,items:p,pending:E,outrogroups:null,fallback:f};m=!1,R&&(i=F)}function M(e){for(;e!==null&&(e.f&_e)===0;)e=e.next;return e}function Ce(e,r,s,o,c){var l=(o&he)!==0,i=r.length,p=e.items,a=M(e.effect.first),v,f=null,h,t=[],E=[],m,x,n,u;if(l)for(u=0;u0){var I=(o&K)!==0&&i===0?s:null;if(l){for(u=0;u{if(h!==void 0)for(n of h)n.nodes?.a?.apply()})}function Se(e,r,s,o,c,l,i,p){var a=(i&te)!==0?(i&de)===0?ve(s,!1,!1):G(s):null,v=(i&ce)!==0?G(c):null;return{v:a,i:v,e:q(()=>(l(r,a??s,v??c,p),()=>{e.delete(o)}))}}function k(e,r,s){if(e.nodes)for(var o=e.nodes.start,c=e.nodes.end,l=r&&(r.f&w)===0?r.nodes.start:s;o!==null;){var i=we(o);if(l.before(o),o===c)return;o=i}}function N(e,r,s){r===null?e.effect.first=s:r.next=s,s===null?e.effect.last=r:s.prev=r}export{xe as e,Ne as i};