import{x as L,k,ac as le,ad as z,o as se,v as oe,g as Z,a2 as ue,ae as te,H as de,y as $,z as q,af as F,ag as ve,ah as ce,B as y,K as pe,ai as P,aj as ge,ak as ee,al as Y,am as me,C as j,m as he,an as _e,ao as Ee,ap as Te,aq as T,ar as re,as as ae,at as B,A as we,au as be,av as Ae,aw as Ce,ax as Ie,h as Ne,i as Se,r as xe,b as Re,c as ke}from"./4Xd67fio.mjs";import"./E-vkuI0X.mjs";import"./DoxTZSDF.mjs";import{s as Me}from"./MDPyFyai.mjs";import{q as De,r as He}from"./BTt3VLuJ.mjs";import{p as Oe}from"./B7xFKswI.mjs";import{r as Fe,g as Le}from"./DC2aKjHe.mjs";function We(e,a){return a}function ze(e,a,l){var p;for(var t=[],g=a.length,s,o=a.length,c=0;c<g;c++){let d=a[c];ae(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var v=e.outrogroups;V(Y(s.done)),v.delete(s),v.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var n=t.length===0&&l!==null;if(n){var u=l,f=u.parentNode;Ce(f),f.append(u),e.items.clear()}V(a,!n)}else s={pending:new Set(a),done:new Set},((p=e.outrogroups)!=null?p:e.outrogroups=new Set).add(s)}function V(e,a=!0){for(var l=0;l<e.length;l++)Ie(e[l],a)}var M;function Ze(e,a,l,t,g,s=null){var o=e,c=new Map,n=(a&ee)!==0;if(n){var u=e;o=k?L(le(u)):u.appendChild(z())}k&&se();var f=null,p=ue(()=>{var i=l();return me(i)?i:i==null?[]:Y(i)}),d,v=!0;function b(){r.fallback=f,qe(r,d,o,a,t),f!==null&&(d.length===0?(f.f&T)===0?re(f):(f.f^=T,D(f,null,o)):ae(f,()=>{f=null}))}var I=oe(()=>{d=Z(p);var i=d.length;let N=!1;if(k){var S=te(o)===de;S!==(i===0)&&(o=$(),L(o),q(!1),N=!0)}for(var _=new Set,A=pe,x=ge(),m=0;m<i;m+=1){k&&F.nodeType===ve&&F.data===ce&&(o=F,N=!0,q(!1));var C=d[m],R=t(C,m),h=v?null:c.get(R);h?(h.v&&y(h.v,C),h.i&&y(h.i,m),x&&A.skipped_effects.delete(h.e)):(h=Be(c,v?o:M!=null?M:M=z(),C,R,m,g,a,l),v||(h.e.f|=T),c.set(R,h)),_.add(R)}if(i===0&&s&&!f&&(v?f=P(()=>s(o)):(f=P(()=>s(M!=null?M:M=z())),f.f|=T)),k&&i>0&&L($()),!v)if(x){for(const[H,O]of c)_.has(H)||A.skipped_effects.add(O.e);A.oncommit(b),A.ondiscard(()=>{})}else b();N&&q(!0),Z(p)}),r={effect:I,items:c,outrogroups:null,fallback:f};v=!1,k&&(o=F)}function qe(e,a,l,t,g){var h,H,O,K,U,X,G,J,Q;var s=(t&Ae)!==0,o=a.length,c=e.items,n=e.effect.first,u,f=null,p,d=[],v=[],b,I,r,i;if(s)for(i=0;i<o;i+=1)b=a[i],I=g(b,i),r=c.get(I).e,(r.f&T)===0&&((H=(h=r.nodes)==null?void 0:h.a)==null||H.measure(),(p!=null?p:p=new Set).add(r));for(i=0;i<o;i+=1){if(b=a[i],I=g(b,i),r=c.get(I).e,e.outrogroups!==null)for(const E of e.outrogroups)E.pending.delete(r),E.done.delete(r);if((r.f&T)!==0)if(r.f^=T,r===n)D(r,null,l);else{var N=f?f.next:n;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),w(e,f,r),w(e,r,N),D(r,N,l),f=r,d=[],v=[],n=f.next;continue}if((r.f&B)!==0&&(re(r),s&&((K=(O=r.nodes)==null?void 0:O.a)==null||K.unfix(),(p!=null?p:p=new Set).delete(r))),r!==n){if(u!==void 0&&u.has(r)){if(d.length<v.length){var S=v[0],_;f=S.prev;var A=d[0],x=d[d.length-1];for(_=0;_<d.length;_+=1)D(d[_],S,l);for(_=0;_<v.length;_+=1)u.delete(v[_]);w(e,A.prev,x.next),w(e,f,A),w(e,x,S),n=S,f=x,i-=1,d=[],v=[]}else u.delete(r),D(r,n,l),w(e,r.prev,r.next),w(e,r,f===null?e.effect.first:f.next),w(e,f,r),f=r;continue}for(d=[],v=[];n!==null&&n!==r;)(u!=null?u:u=new Set).add(n),v.push(n),n=n.next;if(n===null)continue}(r.f&T)===0&&d.push(r),f=r,n=r.next}if(e.outrogroups!==null){for(const E of e.outrogroups)E.pending.size===0&&(V(Y(E.done)),(U=e.outrogroups)==null||U.delete(E));e.outrogroups.size===0&&(e.outrogroups=null)}if(n!==null||u!==void 0){var m=[];if(u!==void 0)for(r of u)(r.f&B)===0&&m.push(r);for(;n!==null;)(n.f&B)===0&&n!==e.fallback&&m.push(n),n=n.next;var C=m.length;if(C>0){var R=(t&ee)!==0&&o===0?l:null;if(s){for(i=0;i<C;i+=1)(G=(X=m[i].nodes)==null?void 0:X.a)==null||G.measure();for(i=0;i<C;i+=1)(Q=(J=m[i].nodes)==null?void 0:J.a)==null||Q.fix()}ze(e,m,R)}}s&&we(()=>{var E,W;if(p!==void 0)for(r of p)(W=(E=r.nodes)==null?void 0:E.a)==null||W.apply()})}function Be(e,a,l,t,g,s,o,c){var n=(o&Ee)!==0?(o&Te)===0?he(l,!1,!1):j(l):null,u=(o&_e)!==0?j(g):null;return{v:n,i:u,e:P(()=>(s(a,n!=null?n:l,u!=null?u:g,c),()=>{e.delete(t)}))}}function D(e,a,l){if(e.nodes)for(var t=e.nodes.start,g=e.nodes.end,s=a&&(a.f&T)===0?a.nodes.start:l;t!==null;){var o=be(t);if(s.before(t),t===g)return;t=o}}function w(e,a,l){a===null?e.effect.first=l:a.next=l,l===null?e.effect.last=a:l.prev=a}var Pe=Ne("<div><!></div>");function $e(e,a){let l=Oe(a,"class",8,"");var t=Pe(),g=Se(t);Me(g,a,"default",{}),xe(t),Re(()=>{var s;return De(t,1,`row ${(s=l())!=null?s:""}`,"svelte-1owbchr")}),ke(e,t)}function ne(){return{isDark:document.documentElement.classList.contains("night-mode")}}let fe=null;const ie=Fe(ne(),e=>{fe=e});Le(ie);const Ve=new MutationObserver((e,a)=>{fe(ne())});Ve.observe(document.documentElement,{attributeFilter:["class"]});He("anki/theme",{pageTheme:ie});export{$e as R,Ze as e,We as i,ie as p};
