import{ai as b,ac as $,i as y,aj as G,P as j,ak as w,L as B,al as ee,am as ne,an as X,ao as ae,R as re,ap as V,aq as fe,ar as ie,as as le,at as K,au as se,av as ue,aw as J,ax as Q,ay as z,a8 as oe,az as te,aA as ve,aB as de,aC as ce,K as pe,H as R,ag as L,aD as ge,I as _e,ae as he,aE as Ee,af as P,aa as q,ah as O,aF as me,aG as Te,aH as we}from"./custom-element.js";function Ne(e,a){return a}function Ae(e,a,s){for(var o=[],c=a.length,l,i=a.length,p=0;p<c;p++){let h=a[p];Q(h,()=>{if(l){if(l.pending.delete(h),l.done.add(h),l.pending.size===0){var t=e.outrogroups;Y(e,V(l.done)),t.delete(l),t.size===0&&(e.outrogroups=null)}}else i-=1},!1)}if(i===0){var f=o.length===0&&s!==null;if(f){var d=s,r=d.parentNode;de(r),r.append(d),e.items.clear()}Y(e,a,!f)}else l={pending:new Set(a),done:new Set},(e.outrogroups??=new Set).add(l)}function Y(e,a,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<a.length;c++){var l=a[c];if(o?.has(l)){l.f|=w;const i=document.createDocumentFragment();ce(l,i)}else pe(a[c],s)}}var U;function xe(e,a,s,o,c,l=null){var i=e,p=new Map,f=(a&X)!==0;if(f){var d=e;i=R?L(ge(d)):d.appendChild(b())}R&&_e();var r=null,h=ae(()=>{var v=s();return re(v)?v:v==null?[]:V(v)}),t,E=new Map,m=!0;function x(v){(C.effect.f&ue)===0&&(C.pending.delete(v),C.fallback=r,Ce(C,t,i,a,o),r!==null&&(t.length===0?(r.f&w)===0?J(r):(r.f^=w,H(r,null,i)):Q(r,()=>{r=null})))}function n(v){C.pending.delete(v)}var u=$(()=>{t=y(h);var v=t.length;let _=!1;if(R){var M=he(i)===Ee;M!==(v===0)&&(i=P(),L(i),q(!1),_=!0)}for(var S=new Set,g=j,D=ne(),I=0;I<v;I+=1){R&&O.nodeType===me&&O.data===Te&&(i=O,_=!0,q(!1));var T=t[I],F=o(T,I),A=m?null:p.get(F);A?(A.v&&G(A.v,T),A.i&&G(A.i,I),D&&g.unskip_effect(A.e)):(A=Se(p,m?i:U??=b(),T,F,I,c,a,s),m||(A.e.f|=w),p.set(F,A)),S.add(F)}if(v===0&&l&&!r&&(m?r=B(()=>l(i)):(r=B(()=>l(U??=b())),r.f|=w)),v>S.size&&ee(),R&&v>0&&L(P()),!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);_&&q(!0),y(h)}),C={effect:u,items:p,pending:E,outrogroups:null,fallback:r};m=!1,R&&(i=O)}function k(e){for(;e!==null&&(e.f&te)===0;)e=e.next;return e}function Ce(e,a,s,o,c){var l=(o&ve)!==0,i=a.length,p=e.items,f=k(e.effect.first),d,r=null,h,t=[],E=[],m,x,n,u;if(l)for(u=0;u<i;u+=1)m=a[u],x=c(m,u),n=p.get(x).e,(n.f&w)===0&&(n.nodes?.a?.measure(),(h??=new Set).add(n));for(u=0;u<i;u+=1){if(m=a[u],x=c(m,u),n=p.get(x).e,e.outrogroups!==null)for(const T of e.outrogroups)T.pending.delete(n),T.done.delete(n);if((n.f&w)!==0)if(n.f^=w,n===f)H(n,null,s);else{var C=r?r.next:f;n===e.effect.last&&(e.effect.last=n.prev),n.prev&&(n.prev.next=n.next),n.next&&(n.next.prev=n.prev),N(e,r,n),N(e,n,C),H(n,C,s),r=n,t=[],E=[],f=k(r.next);continue}if((n.f&z)!==0&&(J(n),l&&(n.nodes?.a?.unfix(),(h??=new Set).delete(n))),n!==f){if(d!==void 0&&d.has(n)){if(t.length<E.length){var v=E[0],_;r=v.prev;var M=t[0],S=t[t.length-1];for(_=0;_<t.length;_+=1)H(t[_],v,s);for(_=0;_<E.length;_+=1)d.delete(E[_]);N(e,M.prev,S.next),N(e,r,M),N(e,S,v),f=v,r=S,u-=1,t=[],E=[]}else d.delete(n),H(n,f,s),N(e,n.prev,n.next),N(e,n,r===null?e.effect.first:r.next),N(e,r,n),r=n;continue}for(t=[],E=[];f!==null&&f!==n;)(d??=new Set).add(f),E.push(f),f=k(f.next);if(f===null)continue}(n.f&w)===0&&t.push(n),r=n,f=k(n.next)}if(e.outrogroups!==null){for(const T of e.outrogroups)T.pending.size===0&&(Y(e,V(T.done)),e.outrogroups?.delete(T));e.outrogroups.size===0&&(e.outrogroups=null)}if(f!==null||d!==void 0){var g=[];if(d!==void 0)for(n of d)(n.f&z)===0&&g.push(n);for(;f!==null;)(f.f&z)===0&&f!==e.fallback&&g.push(f),f=k(f.next);var D=g.length;if(D>0){var I=(o&X)!==0&&i===0?s:null;if(l){for(u=0;u<D;u+=1)g[u].nodes?.a?.measure();for(u=0;u<D;u+=1)g[u].nodes?.a?.fix()}Ae(e,g,I)}}l&&oe(()=>{if(h!==void 0)for(n of h)n.nodes?.a?.apply()})}function Se(e,a,s,o,c,l,i,p){var f=(i&fe)!==0?(i&ie)===0?le(s,!1,!1):K(s):null,d=(i&se)!==0?K(c):null;return{v:f,i:d,e:B(()=>(l(a,f??s,d??c,p),()=>{e.delete(o)}))}}function H(e,a,s){if(e.nodes)for(var o=e.nodes.start,c=e.nodes.end,l=a&&(a.f&w)===0?a.nodes.start:s;o!==null;){var i=we(o);if(l.before(o),o===c)return;o=i}}function N(e,a,s){a===null?e.effect.first=s:a.next=s,s===null?e.effect.last=a:s.prev=a}export{xe as e,Ne as i};
//# sourceMappingURL=each.js.map
