diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 7d91865f..67835f4c 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,27 +1,27 @@ -var ql = Object.defineProperty; -var oa = (e) => { +var zl = Object.defineProperty; +var la = (e) => { throw TypeError(e); }; -var Vl = (e, t, n) => t in e ? ql(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var ce = (e, t, n) => Vl(e, typeof t != "symbol" ? t + "" : t, n), es = (e, t, n) => t.has(e) || oa("Cannot " + n); -var v = (e, t, n) => (es(e, t, "read from private field"), n ? n.call(e) : t.get(e)), H = (e, t, n) => t.has(e) ? oa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), V = (e, t, n, r) => (es(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), be = (e, t, n) => (es(e, t, "access private method"), n); -var za; -typeof window < "u" && ((za = window.__svelte ?? (window.__svelte = {})).v ?? (za.v = /* @__PURE__ */ new Set())).add("5"); -const zl = 1, Hl = 2, Xa = 4, Yl = 8, Bl = 16, Xl = 1, Wl = 4, Ul = 8, Gl = 16, Kl = 1, jl = 2, Ns = "[", Fi = "[!", ks = "]", fr = {}, Te = Symbol(), Wa = "http://www.w3.org/1999/xhtml", os = !1; -var Ua = Array.isArray, Jl = Array.prototype.indexOf, cr = Array.prototype.includes, Ii = Array.from, $i = Object.keys, Ai = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Zl = Object.getOwnPropertyDescriptors, Ql = Object.prototype, eu = Array.prototype, Ga = Object.getPrototypeOf, la = Object.isExtensible; -const tu = () => { +var Hl = (e, t, n) => t in e ? zl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var pe = (e, t, n) => Hl(e, typeof t != "symbol" ? t + "" : t, n), es = (e, t, n) => t.has(e) || la("Cannot " + n); +var v = (e, t, n) => (es(e, t, "read from private field"), n ? n.call(e) : t.get(e)), z = (e, t, n) => t.has(e) ? la("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), q = (e, t, n, r) => (es(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), be = (e, t, n) => (es(e, t, "access private method"), n); +var Ha; +typeof window < "u" && ((Ha = window.__svelte ?? (window.__svelte = {})).v ?? (Ha.v = /* @__PURE__ */ new Set())).add("5"); +const Yl = 1, Bl = 2, Wa = 4, Xl = 8, Wl = 16, Ul = 1, Gl = 4, Kl = 8, jl = 16, Jl = 1, Zl = 2, Ns = "[", Di = "[!", ks = "]", cr = {}, Re = Symbol(), Ua = "http://www.w3.org/1999/xhtml", os = !1; +var Ga = Array.isArray, Ql = Array.prototype.indexOf, hr = Array.prototype.includes, Oi = Array.from, xi = Object.keys, bi = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, eu = Object.getOwnPropertyDescriptors, tu = Object.prototype, nu = Array.prototype, Ka = Object.getPrototypeOf, ua = Object.isExtensible; +const ru = () => { }; -function nu(e) { +function iu(e) { for (var t = 0; t < e.length; t++) e[t](); } -function Ka() { +function ja() { var e, t, n = new Promise((r, i) => { e = r, t = i; }); return { promise: n, resolve: e, reject: t }; } -function ru(e, t) { +function su(e, t) { if (Array.isArray(e)) return e; if (!(Symbol.iterator in e)) @@ -31,91 +31,91 @@ function ru(e, t) { if (n.push(r), n.length === t) break; return n; } -const Re = 2, Fr = 4, Li = 8, ja = 1 << 24, hn = 16, Ct = 32, En = 64, Ja = 128, gt = 512, Ae = 1024, Se = 2048, Tt = 4096, at = 8192, ln = 16384, yr = 32768, hr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, iu = 1 << 20, an = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Pr = Symbol("$state"), Qa = Symbol("legacy props"), su = Symbol(""), kn = new class extends Error { +const Ce = 2, Lr = 4, Fi = 8, Ja = 1 << 24, cn = 16, Tt = 32, An = 64, Za = 128, ht = 512, Ae = 1024, Ne = 2048, Et = 4096, nt = 8192, on = 16384, wr = 32768, dr = 65536, fa = 1 << 17, Qa = 1 << 18, jn = 1 << 19, au = 1 << 20, sn = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, yn = 1 << 23, Or = Symbol("$state"), eo = Symbol("legacy props"), ou = Symbol(""), kn = new class extends Error { constructor() { super(...arguments); - ce(this, "name", "StaleReactionError"); - ce(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + pe(this, "name", "StaleReactionError"); + pe(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); -var Ha; -const au = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; -function ou(e) { +var Ya; +const lu = ((Ya = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ya.contentType.includes("xml")) ?? !1, Kr = 3, xr = 8; +function uu(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function lu() { +function fu() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function uu(e, t, n) { +function cu(e, t, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function fu(e) { +function hu(e) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function cu() { +function du() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function hu(e) { +function pu(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function du() { +function vu() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function pu() { +function gu() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function vu(e) { +function _u(e) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function gu() { +function mu() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function _u() { +function yu() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function mu() { +function wu() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function yu() { +function xu() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function qi(e) { +function Ii(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function wu() { +function bu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let j = !1; -function on(e) { +function an(e) { j = e; } -let W; -function Ve(e) { +let X; +function Ie(e) { if (e === null) - throw qi(), fr; - return W = e; + throw Ii(), cr; + return X = e; } -function Vi() { - return Ve(/* @__PURE__ */ Yt(W)); +function Li() { + return Ie(/* @__PURE__ */ Ht(X)); } -function Le(e) { +function Oe(e) { if (j) { - if (/* @__PURE__ */ Yt(W) !== null) - throw qi(), fr; - W = e; + if (/* @__PURE__ */ Ht(X) !== null) + throw Ii(), cr; + X = e; } } function us(e = 1) { if (j) { - for (var t = e, n = W; t--; ) + for (var t = e, n = X; t--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Yt(n); - W = n; + /* @__PURE__ */ Ht(n); + X = n; } } -function Ei(e = !0) { - for (var t = 0, n = W; ; ) { - if (n.nodeType === wr) { +function $i(e = !0) { + for (var t = 0, n = X; ; ) { + if (n.nodeType === xr) { var r = ( /** @type {Comment} */ n.data @@ -123,40 +123,40 @@ function Ei(e = !0) { if (r === ks) { if (t === 0) return n; t -= 1; - } else (r === Ns || r === Fi || // "[1", "[2", etc. for if blocks + } else (r === Ns || r === Di || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Yt(n) + /* @__PURE__ */ Ht(n) ); e && n.remove(), n = i; } } -function eo(e) { - if (!e || e.nodeType !== wr) - throw qi(), fr; +function to(e) { + if (!e || e.nodeType !== xr) + throw Ii(), cr; return ( /** @type {Comment} */ e.data ); } -function to(e) { +function no(e) { return e === this.v; } -function xu(e, t) { +function $u(e, t) { return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } -function no(e) { - return !xu(e, this.v); +function ro(e) { + return !$u(e, this.v); } -let bu = !1, lt = null; -function dr(e) { - lt = e; +let Au = !1, it = null; +function pr(e) { + it = e; } -function zi(e, t = !1, n) { - lt = { - p: lt, +function qi(e, t = !1, n) { + it = { + p: it, i: !1, c: null, e: null, @@ -165,52 +165,52 @@ function zi(e, t = !1, n) { l: null }; } -function Hi(e) { +function Vi(e) { var t = ( /** @type {ComponentContext} */ - lt + it ), n = t.e; if (n !== null) { t.e = null; for (var r of n) - Ro(r); + Co(r); } - return e !== void 0 && (t.x = e), t.i = !0, lt = t.p, e ?? /** @type {T} */ + return e !== void 0 && (t.x = e), t.i = !0, it = t.p, e ?? /** @type {T} */ {}; } -function ro() { +function io() { return !0; } let Mn = []; -function io() { +function so() { var e = Mn; - Mn = [], nu(e); + Mn = [], iu(e); } -function xn(e) { - if (Mn.length === 0 && !Dr) { +function wn(e) { + if (Mn.length === 0 && !Fr) { var t = Mn; queueMicrotask(() => { - t === Mn && io(); + t === Mn && so(); }); } Mn.push(e); } -function $u() { +function Eu() { for (; Mn.length > 0; ) - io(); + so(); } -function so(e) { +function ao(e) { var t = J; if (t === null) - return X.f |= wn, e; - if ((t.f & yr) === 0 && (t.f & Fr) === 0) + return B.f |= yn, e; + if ((t.f & wr) === 0 && (t.f & Lr) === 0) throw e; - pr(e, t); + vr(e, t); } -function pr(e, t) { +function vr(e, t) { for (; t !== null; ) { - if ((t.f & Ja) !== 0) { - if ((t.f & yr) === 0) + if ((t.f & Za) !== 0) { + if ((t.f & wr) === 0) throw e; try { t.b.error(e); @@ -223,78 +223,78 @@ function pr(e, t) { } throw e; } -const Au = -7169; -function de(e, t) { - e.f = e.f & Au | t; +const Tu = -7169; +function ge(e, t) { + e.f = e.f & Tu | t; } function Ps(e) { - (e.f & gt) !== 0 || e.deps === null ? de(e, Ae) : de(e, Tt); + (e.f & ht) !== 0 || e.deps === null ? ge(e, Ae) : ge(e, Et); } -function ao(e) { +function oo(e) { if (e !== null) for (const t of e) - (t.f & Re) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, ao( + (t.f & Ce) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, oo( /** @type {Derived} */ t.deps )); } -function oo(e, t, n) { - (e.f & Se) !== 0 ? t.add(e) : (e.f & Tt) !== 0 && n.add(e), ao(e.deps), de(e, Ae); +function lo(e, t, n) { + (e.f & Ne) !== 0 ? t.add(e) : (e.f & Et) !== 0 && n.add(e), oo(e.deps), ge(e, Ae); } -const ri = /* @__PURE__ */ new Set(); -let K = null, Ce = null, Ge = [], Yi = null, fs = !1, Dr = !1; -var rr, ir, Fn, sr, Hr, Yr, In, en, ar, Ht, cs, hs, lo; +const ti = /* @__PURE__ */ new Set(); +let K = null, Se = null, Ue = [], zi = null, fs = !1, Fr = !1; +var ir, sr, Fn, ar, Br, Xr, In, Qt, or, zt, cs, hs, uo; const Js = class Js { constructor() { - H(this, Ht); - ce(this, "committed", !1); + z(this, zt); + pe(this, "committed", !1); /** * The current values of any sources that are updated in this batch * They keys of this map are identical to `this.#previous` * @type {Map} */ - ce(this, "current", /* @__PURE__ */ new Map()); + pe(this, "current", /* @__PURE__ */ new Map()); /** * The values of any sources that are updated in this batch _before_ those updates took place. * They keys of this map are identical to `this.#current` * @type {Map} */ - ce(this, "previous", /* @__PURE__ */ new Map()); + pe(this, "previous", /* @__PURE__ */ new Map()); /** * When the batch is committed (and the DOM is updated), we need to remove old branches * and append new ones by calling the functions added inside (if/each/key/etc) blocks * @type {Set<() => void>} */ - H(this, rr, /* @__PURE__ */ new Set()); + z(this, ir, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - H(this, ir, /* @__PURE__ */ new Set()); + z(this, sr, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - H(this, Fn, 0); + z(this, Fn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - H(this, sr, 0); + z(this, ar, 0); /** * A deferred that resolves when the batch is committed, used with `settled()` * TODO replace with Promise.withResolvers once supported widely enough * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} */ - H(this, Hr, null); + z(this, Br, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - H(this, Yr, /* @__PURE__ */ new Set()); + z(this, Xr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - H(this, In, /* @__PURE__ */ new Set()); + z(this, In, /* @__PURE__ */ new Set()); /** * A map of branches that still exist, but will be destroyed when this batch * is committed — we skip over these during `process`. @@ -302,19 +302,19 @@ const Js = class Js { * so they can be rescheduled if the branch survives. * @type {Map} */ - H(this, en, /* @__PURE__ */ new Map()); - ce(this, "is_fork", !1); - H(this, ar, !1); + z(this, Qt, /* @__PURE__ */ new Map()); + pe(this, "is_fork", !1); + z(this, or, !1); } is_deferred() { - return this.is_fork || v(this, sr) > 0; + return this.is_fork || v(this, ar) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ skip_effect(t) { - v(this, en).has(t) || v(this, en).set(t, { d: [], m: [] }); + v(this, Qt).has(t) || v(this, Qt).set(t, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -322,13 +322,13 @@ const Js = class Js { * @param {Effect} effect */ unskip_effect(t) { - var n = v(this, en).get(t); + var n = v(this, Qt).get(t); if (n) { - v(this, en).delete(t); + v(this, Qt).delete(t); for (var r of n.d) - de(r, Se), At(r); + ge(r, Ne), $t(r); for (r of n.m) - de(r, Tt), At(r); + ge(r, Et), $t(r); } } /** @@ -337,19 +337,19 @@ const Js = class Js { */ process(t) { var i; - Ge = [], this.apply(); + Ue = [], this.apply(); var n = [], r = []; for (const s of t) - be(this, Ht, cs).call(this, s, n, r); + be(this, zt, cs).call(this, s, n, r); if (this.is_deferred()) { - be(this, Ht, hs).call(this, r), be(this, Ht, hs).call(this, n); - for (const [s, a] of v(this, en)) - ho(s, a); + be(this, zt, hs).call(this, r), be(this, zt, hs).call(this, n); + for (const [s, a] of v(this, Qt)) + po(s, a); } else { - for (const s of v(this, rr)) s(); - v(this, rr).clear(), v(this, Fn) === 0 && be(this, Ht, lo).call(this), K = null, fa(r), fa(n), (i = v(this, Hr)) == null || i.resolve(); + for (const s of v(this, ir)) s(); + v(this, ir).clear(), v(this, Fn) === 0 && be(this, zt, uo).call(this), K = null, ca(r), ca(n), (i = v(this, Br)) == null || i.resolve(); } - Ce = null; + Se = null; } /** * Associate a change to a given source with the current @@ -358,63 +358,63 @@ const Js = class Js { * @param {any} value */ capture(t, n) { - n !== Te && !this.previous.has(t) && this.previous.set(t, n), (t.f & wn) === 0 && (this.current.set(t, t.v), Ce == null || Ce.set(t, t.v)); + n !== Re && !this.previous.has(t) && this.previous.set(t, n), (t.f & yn) === 0 && (this.current.set(t, t.v), Se == null || Se.set(t, t.v)); } activate() { K = this, this.apply(); } deactivate() { - K === this && (K = null, Ce = null); + K === this && (K = null, Se = null); } flush() { - if (this.activate(), Ge.length > 0) { - if (uo(), K !== null && K !== this) + if (this.activate(), Ue.length > 0) { + if (fo(), K !== null && K !== this) return; } else v(this, Fn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const t of v(this, ir)) t(this); - v(this, ir).clear(); + for (const t of v(this, sr)) t(this); + v(this, sr).clear(); } /** * * @param {boolean} blocking */ increment(t) { - V(this, Fn, v(this, Fn) + 1), t && V(this, sr, v(this, sr) + 1); + q(this, Fn, v(this, Fn) + 1), t && q(this, ar, v(this, ar) + 1); } /** * * @param {boolean} blocking */ decrement(t) { - V(this, Fn, v(this, Fn) - 1), t && V(this, sr, v(this, sr) - 1), !v(this, ar) && (V(this, ar, !0), xn(() => { - V(this, ar, !1), this.is_deferred() ? Ge.length > 0 && this.flush() : this.revive(); + q(this, Fn, v(this, Fn) - 1), t && q(this, ar, v(this, ar) - 1), !v(this, or) && (q(this, or, !0), wn(() => { + q(this, or, !1), this.is_deferred() ? Ue.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const t of v(this, Yr)) - v(this, In).delete(t), de(t, Se), At(t); + for (const t of v(this, Xr)) + v(this, In).delete(t), ge(t, Ne), $t(t); for (const t of v(this, In)) - de(t, Tt), At(t); + ge(t, Et), $t(t); this.flush(); } /** @param {() => void} fn */ oncommit(t) { - v(this, rr).add(t); + v(this, ir).add(t); } /** @param {(batch: Batch) => void} fn */ ondiscard(t) { - v(this, ir).add(t); + v(this, sr).add(t); } settled() { - return (v(this, Hr) ?? V(this, Hr, Ka())).promise; + return (v(this, Br) ?? q(this, Br, ja())).promise; } static ensure() { if (K === null) { const t = K = new Js(); - ri.add(K), Dr || xn(() => { + ti.add(K), Fr || wn(() => { K === t && t.flush(); }); } @@ -423,7 +423,7 @@ const Js = class Js { apply() { } }; -rr = new WeakMap(), ir = new WeakMap(), Fn = new WeakMap(), sr = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), In = new WeakMap(), en = new WeakMap(), ar = new WeakMap(), Ht = new WeakSet(), /** +ir = new WeakMap(), sr = new WeakMap(), Fn = new WeakMap(), ar = new WeakMap(), Br = new WeakMap(), Xr = new WeakMap(), In = new WeakMap(), Qt = new WeakMap(), or = new WeakMap(), zt = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root @@ -433,31 +433,31 @@ rr = new WeakMap(), ir = new WeakMap(), Fn = new WeakMap(), sr = new WeakMap(), cs = function(t, n, r) { t.f ^= Ae; for (var i = t.first, s = null; i !== null; ) { - var a = i.f, o = (a & (Ct | En)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & at) !== 0 || v(this, en).has(i); + var a = i.f, o = (a & (Tt | An)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & nt) !== 0 || v(this, Qt).has(i); if (!u && i.fn !== null) { - o ? i.f ^= Ae : s !== null && (a & (Fr | Li | ja)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & hn) !== 0 && v(this, In).add(i), gr(i)); + o ? i.f ^= Ae : s !== null && (a & (Lr | Fi | Ja)) !== 0 ? s.b.defer_effect(i) : (a & Lr) !== 0 ? n.push(i) : jr(i) && ((a & cn) !== 0 && v(this, In).add(i), _r(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var p = i.parent; - for (i = i.next; i === null && p !== null; ) - p === s && (s = null), i = p.next, p = p.parent; + var d = i.parent; + for (i = i.next; i === null && d !== null; ) + d === s && (s = null), i = d.next, d = d.parent; } }, /** * @param {Effect[]} effects */ hs = function(t) { for (var n = 0; n < t.length; n += 1) - oo(t[n], v(this, Yr), v(this, In)); -}, lo = function() { + lo(t[n], v(this, Xr), v(this, In)); +}, uo = function() { var i; - if (ri.size > 1) { + if (ti.size > 1) { this.previous.clear(); - var t = Ce, n = !0; - for (const s of ri) { + var t = Se, n = !0; + for (const s of ti) { if (s === this) { n = !1; continue; @@ -475,111 +475,111 @@ hs = function(t) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Ge; - Ge = []; + var r = Ue; + Ue = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - fo(f, o, l, u); - if (Ge.length > 0) { + co(f, o, l, u); + if (Ue.length > 0) { K = s, s.apply(); - for (const f of Ge) - be(i = s, Ht, cs).call(i, f, [], []); + for (const f of Ue) + be(i = s, zt, cs).call(i, f, [], []); s.deactivate(); } - Ge = r; + Ue = r; } } - K = null, Ce = t; + K = null, Se = t; } - this.committed = !0, ri.delete(this); + this.committed = !0, ti.delete(this); }; -let un = Js; -function re(e) { - var t = Dr; - Dr = !0; +let ln = Js; +function ne(e) { + var t = Fr; + Fr = !0; try { for (var n; ; ) { - if ($u(), Ge.length === 0 && (K == null || K.flush(), Ge.length === 0)) - return Yi = null, /** @type {T} */ + if (Eu(), Ue.length === 0 && (K == null || K.flush(), Ue.length === 0)) + return zi = null, /** @type {T} */ n; - uo(); + fo(); } } finally { - Dr = t; + Fr = t; } } -function uo() { +function fo() { fs = !0; var e = null; try { - for (var t = 0; Ge.length > 0; ) { - var n = un.ensure(); + for (var t = 0; Ue.length > 0; ) { + var n = ln.ensure(); if (t++ > 1e3) { var r, i; - Eu(); + Ru(); } - n.process(Ge), bn.clear(); + n.process(Ue), xn.clear(); } } finally { - Ge = [], fs = !1, Yi = null; + Ue = [], fs = !1, zi = null; } } -function Eu() { +function Ru() { try { - du(); + vu(); } catch (e) { - pr(e, Yi); + vr(e, zi); } } -let xt = null; -function fa(e) { +let wt = null; +function ca(e) { var t = e.length; if (t !== 0) { for (var n = 0; n < t; ) { var r = e[n++]; - if ((r.f & (ln | at)) === 0 && Gr(r) && (xt = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ko(r), (xt == null ? void 0 : xt.size) > 0)) { - bn.clear(); - for (const i of xt) { - if ((i.f & (ln | at)) !== 0) continue; + if ((r.f & (on | nt)) === 0 && jr(r) && (wt = /* @__PURE__ */ new Set(), _r(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Mo(r), (wt == null ? void 0 : wt.size) > 0)) { + xn.clear(); + for (const i of wt) { + if ((i.f & (on | nt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - xt.has(a) && (xt.delete(a), s.push(a)), a = a.parent; + wt.has(a) && (wt.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (ln | at)) === 0 && gr(l); + (l.f & (on | nt)) === 0 && _r(l); } } - xt.clear(); + wt.clear(); } } - xt = null; + wt = null; } } -function fo(e, t, n, r) { +function co(e, t, n, r) { if (!n.has(e) && (n.add(e), e.reactions !== null)) for (const i of e.reactions) { const s = i.f; - (s & Re) !== 0 ? fo( + (s & Ce) !== 0 ? co( /** @type {Derived} */ i, t, n, r - ) : (s & (Ms | hn)) !== 0 && (s & Se) === 0 && co(i, t, r) && (de(i, Se), At( + ) : (s & (Ms | cn)) !== 0 && (s & Ne) === 0 && ho(i, t, r) && (ge(i, Ne), $t( /** @type {Effect} */ i )); } } -function co(e, t, n) { +function ho(e, t, n) { const r = n.get(e); if (r !== void 0) return r; if (e.deps !== null) for (const i of e.deps) { - if (cr.call(t, i)) + if (hr.call(t, i)) return !0; - if ((i.f & Re) !== 0 && co( + if ((i.f & Ce) !== 0 && ho( /** @type {Derived} */ i, t, @@ -593,80 +593,80 @@ function co(e, t, n) { } return n.set(e, !1), !1; } -function At(e) { - for (var t = Yi = e; t.parent !== null; ) { +function $t(e) { + for (var t = zi = e; t.parent !== null; ) { t = t.parent; var n = t.f; - if (fs && t === J && (n & hn) !== 0 && (n & Za) === 0) + if (fs && t === J && (n & cn) !== 0 && (n & Qa) === 0) return; - if ((n & (En | Ct)) !== 0) { + if ((n & (An | Tt)) !== 0) { if ((n & Ae) === 0) return; t.f ^= Ae; } } - Ge.push(t); + Ue.push(t); } -function ho(e, t) { - if (!((e.f & Ct) !== 0 && (e.f & Ae) !== 0)) { - (e.f & Se) !== 0 ? t.d.push(e) : (e.f & Tt) !== 0 && t.m.push(e), de(e, Ae); +function po(e, t) { + if (!((e.f & Tt) !== 0 && (e.f & Ae) !== 0)) { + (e.f & Ne) !== 0 ? t.d.push(e) : (e.f & Et) !== 0 && t.m.push(e), ge(e, Ae); for (var n = e.first; n !== null; ) - ho(n, t), n = n.next; + po(n, t), n = n.next; } } -function Tu(e) { +function Su(e) { let t = 0, n = Un(0), r; return () => { - Fs() && (x(n), Ls(() => (t === 0 && (r = Wi(() => e(() => Or(n)))), t += 1, () => { - xn(() => { - t -= 1, t === 0 && (r == null || r(), r = void 0, Or(n)); + Fs() && ($(n), Ls(() => (t === 0 && (r = Bi(() => e(() => Ir(n)))), t += 1, () => { + wn(() => { + t -= 1, t === 0 && (r == null || r(), r = void 0, Ir(n)); }); }))); }; } -var Cu = hr | jn | Ja; -function Ru(e, t, n) { - new Su(e, t, n); +var Cu = dr | jn | Za; +function Nu(e, t, n) { + new ku(e, t, n); } -var it, Br, Ot, Ln, Ft, dt, We, It, tn, yn, qn, nn, or, Vn, lr, ur, rn, Di, ve, po, vo, ds, ci, hi, ps; -class Su { +var et, Wr, Dt, Ln, Ot, ut, Xe, Ft, en, mn, qn, tn, lr, Vn, ur, fr, nn, Mi, me, vo, go, ds, ui, fi, ps; +class ku { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(t, n, r) { - H(this, ve); + z(this, me); /** @type {Boundary | null} */ - ce(this, "parent"); - ce(this, "is_pending", !1); + pe(this, "parent"); + pe(this, "is_pending", !1); /** @type {TemplateNode} */ - H(this, it); + z(this, et); /** @type {TemplateNode | null} */ - H(this, Br, j ? W : null); + z(this, Wr, j ? X : null); /** @type {BoundaryProps} */ - H(this, Ot); + z(this, Dt); /** @type {((anchor: Node) => void)} */ - H(this, Ln); + z(this, Ln); /** @type {Effect} */ - H(this, Ft); + z(this, Ot); /** @type {Effect | null} */ - H(this, dt, null); + z(this, ut, null); /** @type {Effect | null} */ - H(this, We, null); + z(this, Xe, null); /** @type {Effect | null} */ - H(this, It, null); + z(this, Ft, null); /** @type {DocumentFragment | null} */ - H(this, tn, null); + z(this, en, null); /** @type {TemplateNode | null} */ - H(this, yn, null); - H(this, qn, 0); - H(this, nn, 0); - H(this, or, !1); - H(this, Vn, !1); + z(this, mn, null); + z(this, qn, 0); + z(this, tn, 0); + z(this, lr, !1); + z(this, Vn, !1); /** @type {Set} */ - H(this, lr, /* @__PURE__ */ new Set()); + z(this, ur, /* @__PURE__ */ new Set()); /** @type {Set} */ - H(this, ur, /* @__PURE__ */ new Set()); + z(this, fr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -674,38 +674,38 @@ class Su { * calls followed by no-op flushes * @type {Source | null} */ - H(this, rn, null); - H(this, Di, Tu(() => (V(this, rn, Un(v(this, qn))), () => { - V(this, rn, null); + z(this, nn, null); + z(this, Mi, Su(() => (q(this, nn, Un(v(this, qn))), () => { + q(this, nn, null); }))); - V(this, it, t), V(this, Ot, n), V(this, Ln, r), this.parent = /** @type {Effect} */ - J.b, this.is_pending = !!v(this, Ot).pending, V(this, Ft, qs(() => { + q(this, et, t), q(this, Dt, n), q(this, Ln, r), this.parent = /** @type {Effect} */ + J.b, this.is_pending = !!v(this, Dt).pending, q(this, Ot, qs(() => { if (J.b = this, j) { - const s = v(this, Br); - Vi(), /** @type {Comment} */ - s.nodeType === wr && /** @type {Comment} */ - s.data === Fi ? be(this, ve, vo).call(this) : (be(this, ve, po).call(this), v(this, nn) === 0 && (this.is_pending = !1)); + const s = v(this, Wr); + Li(), /** @type {Comment} */ + s.nodeType === xr && /** @type {Comment} */ + s.data === Di ? be(this, me, go).call(this) : (be(this, me, vo).call(this), v(this, tn) === 0 && (this.is_pending = !1)); } else { - var i = be(this, ve, ds).call(this); + var i = be(this, me, ds).call(this); try { - V(this, dt, vt(() => r(i))); + q(this, ut, ct(() => r(i))); } catch (s) { this.error(s); } - v(this, nn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; + v(this, tn) > 0 ? be(this, me, fi).call(this) : this.is_pending = !1; } return () => { var s; - (s = v(this, yn)) == null || s.remove(); + (s = v(this, mn)) == null || s.remove(); }; - }, Cu)), j && V(this, it, W); + }, Cu)), j && q(this, et, X); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(t) { - oo(t, v(this, lr), v(this, ur)); + lo(t, v(this, ur), v(this, fr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class Su { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Ot).pending; + return !!v(this, Dt).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -724,108 +724,108 @@ class Su { * @param {1 | -1} d */ update_pending_count(t) { - be(this, ve, ps).call(this, t), V(this, qn, v(this, qn) + t), !(!v(this, rn) || v(this, or)) && (V(this, or, !0), xn(() => { - V(this, or, !1), v(this, rn) && vr(v(this, rn), v(this, qn)); + be(this, me, ps).call(this, t), q(this, qn, v(this, qn) + t), !(!v(this, nn) || v(this, lr)) && (q(this, lr, !0), wn(() => { + q(this, lr, !1), v(this, nn) && gr(v(this, nn), v(this, qn)); })); } get_effect_pending() { - return v(this, Di).call(this), x( + return v(this, Mi).call(this), $( /** @type {Source} */ - v(this, rn) + v(this, nn) ); } /** @param {unknown} error */ error(t) { - var n = v(this, Ot).onerror; - let r = v(this, Ot).failed; + var n = v(this, Dt).onerror; + let r = v(this, Dt).failed; if (v(this, Vn) || !n && !r) throw t; - v(this, dt) && (ze(v(this, dt)), V(this, dt, null)), v(this, We) && (ze(v(this, We)), V(this, We, null)), v(this, It) && (ze(v(this, It)), V(this, It, null)), j && (Ve( + v(this, ut) && (Le(v(this, ut)), q(this, ut, null)), v(this, Xe) && (Le(v(this, Xe)), q(this, Xe, null)), v(this, Ft) && (Le(v(this, Ft)), q(this, Ft, null)), j && (Ie( /** @type {TemplateNode} */ - v(this, Br) - ), us(), Ve(Ei())); + v(this, Wr) + ), us(), Ie($i())); var i = !1, s = !1; const a = () => { if (i) { - wu(); + bu(); return; } - i = !0, s && yu(), un.ensure(), V(this, qn, 0), v(this, It) !== null && Yn(v(this, It), () => { - V(this, It, null); - }), this.is_pending = this.has_pending_snippet(), V(this, dt, be(this, ve, ci).call(this, () => (V(this, Vn, !1), vt(() => v(this, Ln).call(this, v(this, it)))))), v(this, nn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; + i = !0, s && xu(), ln.ensure(), q(this, qn, 0), v(this, Ft) !== null && Yn(v(this, Ft), () => { + q(this, Ft, null); + }), this.is_pending = this.has_pending_snippet(), q(this, ut, be(this, me, ui).call(this, () => (q(this, Vn, !1), ct(() => v(this, Ln).call(this, v(this, et)))))), v(this, tn) > 0 ? be(this, me, fi).call(this) : this.is_pending = !1; }; - xn(() => { + wn(() => { try { s = !0, n == null || n(t, a), s = !1; } catch (o) { - pr(o, v(this, Ft) && v(this, Ft).parent); + vr(o, v(this, Ot) && v(this, Ot).parent); } - r && V(this, It, be(this, ve, ci).call(this, () => { - un.ensure(), V(this, Vn, !0); + r && q(this, Ft, be(this, me, ui).call(this, () => { + ln.ensure(), q(this, Vn, !0); try { - return vt(() => { + return ct(() => { r( - v(this, it), + v(this, et), () => t, () => a ); }); } catch (o) { - return pr( + return vr( o, /** @type {Effect} */ - v(this, Ft).parent + v(this, Ot).parent ), null; } finally { - V(this, Vn, !1); + q(this, Vn, !1); } })); }); } } -it = new WeakMap(), Br = new WeakMap(), Ot = new WeakMap(), Ln = new WeakMap(), Ft = new WeakMap(), dt = new WeakMap(), We = new WeakMap(), It = new WeakMap(), tn = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), nn = new WeakMap(), or = new WeakMap(), Vn = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), rn = new WeakMap(), Di = new WeakMap(), ve = new WeakSet(), po = function() { +et = new WeakMap(), Wr = new WeakMap(), Dt = new WeakMap(), Ln = new WeakMap(), Ot = new WeakMap(), ut = new WeakMap(), Xe = new WeakMap(), Ft = new WeakMap(), en = new WeakMap(), mn = new WeakMap(), qn = new WeakMap(), tn = new WeakMap(), lr = new WeakMap(), Vn = new WeakMap(), ur = new WeakMap(), fr = new WeakMap(), nn = new WeakMap(), Mi = new WeakMap(), me = new WeakSet(), vo = function() { try { - V(this, dt, vt(() => v(this, Ln).call(this, v(this, it)))); + q(this, ut, ct(() => v(this, Ln).call(this, v(this, et)))); } catch (t) { this.error(t); } -}, vo = function() { - const t = v(this, Ot).pending; - t && (V(this, We, vt(() => t(v(this, it)))), xn(() => { - var n = be(this, ve, ds).call(this); - V(this, dt, be(this, ve, ci).call(this, () => (un.ensure(), vt(() => v(this, Ln).call(this, n))))), v(this, nn) > 0 ? be(this, ve, hi).call(this) : (Yn( +}, go = function() { + const t = v(this, Dt).pending; + t && (q(this, Xe, ct(() => t(v(this, et)))), wn(() => { + var n = be(this, me, ds).call(this); + q(this, ut, be(this, me, ui).call(this, () => (ln.ensure(), ct(() => v(this, Ln).call(this, n))))), v(this, tn) > 0 ? be(this, me, fi).call(this) : (Yn( /** @type {Effect} */ - v(this, We), + v(this, Xe), () => { - V(this, We, null); + q(this, Xe, null); } ), this.is_pending = !1); })); }, ds = function() { - var t = v(this, it); - return this.is_pending && (V(this, yn, ot()), v(this, it).before(v(this, yn)), t = v(this, yn)), t; + var t = v(this, et); + return this.is_pending && (q(this, mn, rt()), v(this, et).before(v(this, mn)), t = v(this, mn)), t; }, /** * @param {() => Effect | null} fn */ -ci = function(t) { - var n = J, r = X, i = lt; - zt(v(this, Ft)), mt(v(this, Ft)), dr(v(this, Ft).ctx); +ui = function(t) { + var n = J, r = B, i = it; + Vt(v(this, Ot)), pt(v(this, Ot)), pr(v(this, Ot).ctx); try { return t(); } catch (s) { - return so(s), null; + return ao(s), null; } finally { - zt(n), mt(r), dr(i); + Vt(n), pt(r), pr(i); } -}, hi = function() { +}, fi = function() { const t = ( /** @type {(anchor: Node) => void} */ - v(this, Ot).pending + v(this, Dt).pending ); - v(this, dt) !== null && (V(this, tn, document.createDocumentFragment()), v(this, tn).append( + v(this, ut) !== null && (q(this, en, document.createDocumentFragment()), v(this, en).append( /** @type {TemplateNode} */ - v(this, yn) - ), Do(v(this, dt), v(this, tn))), v(this, We) === null && V(this, We, vt(() => t(v(this, it)))); + v(this, mn) + ), Oo(v(this, ut), v(this, en))), v(this, Xe) === null && q(this, Xe, ct(() => t(v(this, et)))); }, /** * Updates the pending count associated with the currently visible pending snippet, * if any, such that we can replace the snippet with content once work is done @@ -834,22 +834,22 @@ ci = function(t) { ps = function(t) { var n; if (!this.has_pending_snippet()) { - this.parent && be(n = this.parent, ve, ps).call(n, t); + this.parent && be(n = this.parent, me, ps).call(n, t); return; } - if (V(this, nn, v(this, nn) + t), v(this, nn) === 0) { + if (q(this, tn, v(this, tn) + t), v(this, tn) === 0) { this.is_pending = !1; - for (const r of v(this, lr)) - de(r, Se), At(r); for (const r of v(this, ur)) - de(r, Tt), At(r); - v(this, lr).clear(), v(this, ur).clear(), v(this, We) && Yn(v(this, We), () => { - V(this, We, null); - }), v(this, tn) && (v(this, it).before(v(this, tn)), V(this, tn, null)); + ge(r, Ne), $t(r); + for (const r of v(this, fr)) + ge(r, Et), $t(r); + v(this, ur).clear(), v(this, fr).clear(), v(this, Xe) && Yn(v(this, Xe), () => { + q(this, Xe, null); + }), v(this, en) && (v(this, et).before(v(this, en)), q(this, en, null)); } }; -function Nu(e, t, n, r) { - const i = Bi; +function Mu(e, t, n, r) { + const i = Hi; var s = e.filter((h) => !h.settled); if (n.length === 0 && s.length === 0) { r(t.map(i)); @@ -858,13 +858,13 @@ function Nu(e, t, n, r) { var a = K, o = ( /** @type {Effect} */ J - ), l = ku(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; + ), l = Pu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; function f(h) { l(); try { r(h); - } catch (d) { - (o.f & ln) === 0 && pr(d, o); + } catch (p) { + (o.f & on) === 0 && vr(p, o); } a == null || a.deactivate(), vs(); } @@ -872,38 +872,38 @@ function Nu(e, t, n, r) { u.then(() => f(t.map(i))); return; } - function p() { - l(), Promise.all(n.map((h) => /* @__PURE__ */ Mu(h))).then((h) => f([...t.map(i), ...h])).catch((h) => pr(h, o)); + function d() { + l(), Promise.all(n.map((h) => /* @__PURE__ */ Du(h))).then((h) => f([...t.map(i), ...h])).catch((h) => vr(h, o)); } - u ? u.then(p) : p(); + u ? u.then(d) : d(); } -function ku() { - var e = J, t = X, n = lt, r = K; +function Pu() { + var e = J, t = B, n = it, r = K; return function(s = !0) { - zt(e), mt(t), dr(n), s && (r == null || r.activate()); + Vt(e), pt(t), pr(n), s && (r == null || r.activate()); }; } function vs() { - zt(null), mt(null), dr(null); + Vt(null), pt(null), pr(null); } // @__NO_SIDE_EFFECTS__ -function Bi(e) { - var t = Re | Se, n = X !== null && (X.f & Re) !== 0 ? ( +function Hi(e) { + var t = Ce | Ne, n = B !== null && (B.f & Ce) !== 0 ? ( /** @type {Derived} */ - X + B ) : null; return J !== null && (J.f |= jn), { - ctx: lt, + ctx: it, deps: null, effects: null, - equals: to, + equals: no, f: t, fn: e, reactions: null, rv: 0, v: ( /** @type {V} */ - Te + Re ), wv: 0, parent: n ?? J, @@ -911,12 +911,12 @@ function Bi(e) { }; } // @__NO_SIDE_EFFECTS__ -function Mu(e, t, n) { +function Du(e, t, n) { let r = ( /** @type {Effect | null} */ J ); - r === null && lu(); + r === null && fu(); var i = ( /** @type {Boundary} */ r.b @@ -926,78 +926,78 @@ function Mu(e, t, n) { void 0 ), a = Un( /** @type {V} */ - Te - ), o = !X, l = /* @__PURE__ */ new Map(); - return Hu(() => { - var d; - var u = Ka(); + Re + ), o = !B, l = /* @__PURE__ */ new Map(); + return Bu(() => { + var p; + var u = ja(); s = u.promise; try { Promise.resolve(e()).then(u.resolve, u.reject).then(() => { f === K && f.committed && f.deactivate(), vs(); }); - } catch (y) { - u.reject(y), vs(); + } catch (_) { + u.reject(_), vs(); } var f = ( /** @type {Batch} */ K ); if (o) { - var p = i.is_rendered(); - i.update_pending_count(1), f.increment(p), (d = l.get(f)) == null || d.reject(kn), l.delete(f), l.set(f, u); + var d = i.is_rendered(); + i.update_pending_count(1), f.increment(d), (p = l.get(f)) == null || p.reject(kn), l.delete(f), l.set(f, u); } - const h = (y, b = void 0) => { - if (f.activate(), b) - b !== kn && (a.f |= wn, vr(a, b)); + const h = (_, x = void 0) => { + if (f.activate(), x) + x !== kn && (a.f |= yn, gr(a, x)); else { - (a.f & wn) !== 0 && (a.f ^= wn), vr(a, y); - for (const [m, $] of l) { - if (l.delete(m), m === f) break; - $.reject(kn); + (a.f & yn) !== 0 && (a.f ^= yn), gr(a, _); + for (const [y, b] of l) { + if (l.delete(y), y === f) break; + b.reject(kn); } } - o && (i.update_pending_count(-1), f.decrement(p)); + o && (i.update_pending_count(-1), f.decrement(d)); }; - u.promise.then(h, (y) => h(null, y || "unknown")); - }), qu(() => { + u.promise.then(h, (_) => h(null, _ || "unknown")); + }), zu(() => { for (const u of l.values()) u.reject(kn); }), new Promise((u) => { - function f(p) { + function f(d) { function h() { - p === s ? u(a) : f(s); + d === s ? u(a) : f(s); } - p.then(h, h); + d.then(h, h); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function vn(e) { - const t = /* @__PURE__ */ Bi(e); - return Oo(t), t; +function Sn(e) { + const t = /* @__PURE__ */ Hi(e); + return Fo(t), t; } // @__NO_SIDE_EFFECTS__ -function go(e) { - const t = /* @__PURE__ */ Bi(e); - return t.equals = no, t; +function _o(e) { + const t = /* @__PURE__ */ Hi(e); + return t.equals = ro, t; } -function Pu(e) { +function Ou(e) { var t = e.effects; if (t !== null) { e.effects = null; for (var n = 0; n < t.length; n += 1) - ze( + Le( /** @type {Effect} */ t[n] ); } } -function Du(e) { +function Fu(e) { for (var t = e.parent; t !== null; ) { - if ((t.f & Re) === 0) - return (t.f & ln) === 0 ? ( + if ((t.f & Ce) === 0) + return (t.f & on) === 0 ? ( /** @type {Effect} */ t ) : null; @@ -1007,43 +1007,43 @@ function Du(e) { } function Ds(e) { var t, n = J; - zt(Du(e)); + Vt(Fu(e)); try { - e.f &= ~Wn, Pu(e), t = qo(e); + e.f &= ~Wn, Ou(e), t = Vo(e); } finally { - zt(n); + Vt(n); } return t; } -function _o(e) { +function mo(e) { var t = Ds(e); - if (!e.equals(t) && (e.wv = Io(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { - de(e, Ae); + if (!e.equals(t) && (e.wv = Lo(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { + ge(e, Ae); return; } - An || (Ce !== null ? (Fs() || K != null && K.is_fork) && Ce.set(e, t) : Ps(e)); + $n || (Se !== null ? (Fs() || K != null && K.is_fork) && Se.set(e, t) : Ps(e)); } -function Ou(e) { +function Iu(e) { var t, n; if (e.effects !== null) for (const r of e.effects) - (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(kn), r.teardown = tu, r.ac = null, Ir(r, 0), Vs(r)); + (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(kn), r.teardown = ru, r.ac = null, qr(r, 0), Vs(r)); } -function mo(e) { +function yo(e) { if (e.effects !== null) for (const t of e.effects) - t.teardown && gr(t); + t.teardown && _r(t); } let gs = /* @__PURE__ */ new Set(); -const bn = /* @__PURE__ */ new Map(); -let yo = !1; +const xn = /* @__PURE__ */ new Map(); +let wo = !1; function Un(e, t) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: e, reactions: null, - equals: to, + equals: no, rv: 0, wv: 0 }; @@ -1052,78 +1052,78 @@ function Un(e, t) { // @__NO_SIDE_EFFECTS__ function $e(e, t) { const n = Un(e); - return Oo(n), n; + return Fo(n), n; } // @__NO_SIDE_EFFECTS__ -function wo(e, t = !1, n = !0) { +function xo(e, t = !1, n = !0) { const r = Un(e); - return t || (r.equals = no), r; + return t || (r.equals = ro), r; } -function he(e, t, n = !1) { - X !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function ve(e, t, n = !1) { + B !== null && // since we are untracking the function inside `$inspect.with` we need to add this check // to ensure we error if state is set inside an inspect effect - (!Et || (X.f & ua) !== 0) && ro() && (X.f & (Re | hn | Ms | ua)) !== 0 && (_t === null || !cr.call(_t, e)) && mu(); + (!At || (B.f & fa) !== 0) && io() && (B.f & (Ce | cn | Ms | fa)) !== 0 && (dt === null || !hr.call(dt, e)) && wu(); let r = n ? Pn(t) : t; - return vr(e, r); + return gr(e, r); } -function vr(e, t) { +function gr(e, t) { if (!e.equals(t)) { var n = e.v; - An ? bn.set(e, t) : bn.set(e, n), e.v = t; - var r = un.ensure(); - if (r.capture(e, n), (e.f & Re) !== 0) { + $n ? xn.set(e, t) : xn.set(e, n), e.v = t; + var r = ln.ensure(); + if (r.capture(e, n), (e.f & Ce) !== 0) { const i = ( /** @type {Derived} */ e ); - (e.f & Se) !== 0 && Ds(i), Ps(i); + (e.f & Ne) !== 0 && Ds(i), Ps(i); } - e.wv = Io(), xo(e, Se), J !== null && (J.f & Ae) !== 0 && (J.f & (Ct | En)) === 0 && (ht === null ? Xu([e]) : ht.push(e)), !r.is_fork && gs.size > 0 && !yo && Fu(); + e.wv = Lo(), bo(e, Ne), J !== null && (J.f & Ae) !== 0 && (J.f & (Tt | An)) === 0 && (lt === null ? Uu([e]) : lt.push(e)), !r.is_fork && gs.size > 0 && !wo && Lu(); } return t; } -function Fu() { - yo = !1; +function Lu() { + wo = !1; for (const e of gs) - (e.f & Ae) !== 0 && de(e, Tt), Gr(e) && gr(e); + (e.f & Ae) !== 0 && ge(e, Et), jr(e) && _r(e); gs.clear(); } -function Or(e) { - he(e, e.v + 1); +function Ir(e) { + ve(e, e.v + 1); } -function xo(e, t) { +function bo(e, t) { var n = e.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & Se) === 0; - if (o && de(s, t), (a & Re) !== 0) { + var s = n[i], a = s.f, o = (a & Ne) === 0; + if (o && ge(s, t), (a & Ce) !== 0) { var l = ( /** @type {Derived} */ s ); - Ce == null || Ce.delete(l), (a & Wn) === 0 && (a & gt && (s.f |= Wn), xo(l, Tt)); - } else o && ((a & hn) !== 0 && xt !== null && xt.add( + Se == null || Se.delete(l), (a & Wn) === 0 && (a & ht && (s.f |= Wn), bo(l, Et)); + } else o && ((a & cn) !== 0 && wt !== null && wt.add( /** @type {Effect} */ s - ), At( + ), $t( /** @type {Effect} */ s )); } } function Pn(e) { - if (typeof e != "object" || e === null || Pr in e) + if (typeof e != "object" || e === null || Or in e) return e; - const t = Ga(e); - if (t !== Ql && t !== eu) + const t = Ka(e); + if (t !== tu && t !== nu) return e; - var n = /* @__PURE__ */ new Map(), r = Ua(e), i = /* @__PURE__ */ $e(0), s = Bn, a = (o) => { + var n = /* @__PURE__ */ new Map(), r = Ga(e), i = /* @__PURE__ */ $e(0), s = Bn, a = (o) => { if (Bn === s) return o(); - var l = X, u = Bn; - mt(null), da(s); + var l = B, u = Bn; + pt(null), pa(s); var f = o(); - return mt(l), da(u), f; + return pt(l), pa(u), f; }; return r && n.set("length", /* @__PURE__ */ $e( /** @type {any[]} */ @@ -1133,35 +1133,35 @@ function Pn(e) { e, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && gu(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && mu(); var f = n.get(l); return f === void 0 ? a(() => { - var p = /* @__PURE__ */ $e(u.value); - return n.set(l, p), p; - }) : he(f, u.value, !0), !0; + var d = /* @__PURE__ */ $e(u.value); + return n.set(l, d), d; + }) : ve(f, u.value, !0), !0; }, deleteProperty(o, l) { var u = n.get(l); if (u === void 0) { if (l in o) { - const f = a(() => /* @__PURE__ */ $e(Te)); - n.set(l, f), Or(i); + const f = a(() => /* @__PURE__ */ $e(Re)); + n.set(l, f), Ir(i); } } else - he(u, Te), Or(i); + ve(u, Re), Ir(i); return !0; }, get(o, l, u) { - var d; - if (l === Pr) + var p; + if (l === Or) return e; - var f = n.get(l), p = l in o; - if (f === void 0 && (!p || (d = Hn(o, l)) != null && d.writable) && (f = a(() => { - var y = Pn(p ? o[l] : Te), b = /* @__PURE__ */ $e(y); - return b; + var f = n.get(l), d = l in o; + if (f === void 0 && (!d || (p = Hn(o, l)) != null && p.writable) && (f = a(() => { + var _ = Pn(d ? o[l] : Re), x = /* @__PURE__ */ $e(_); + return x; }), n.set(l, f)), f !== void 0) { - var h = x(f); - return h === Te ? void 0 : h; + var h = $(f); + return h === Re ? void 0 : h; } return Reflect.get(o, l, u); }, @@ -1169,10 +1169,10 @@ function Pn(e) { var u = Reflect.getOwnPropertyDescriptor(o, l); if (u && "value" in u) { var f = n.get(l); - f && (u.value = x(f)); + f && (u.value = $(f)); } else if (u === void 0) { - var p = n.get(l), h = p == null ? void 0 : p.v; - if (p !== void 0 && h !== Te) + var d = n.get(l), h = d == null ? void 0 : d.v; + if (d !== void 0 && h !== Re) return { enumerable: !0, configurable: !0, @@ -1184,188 +1184,188 @@ function Pn(e) { }, has(o, l) { var h; - if (l === Pr) + if (l === Or) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Te || Reflect.has(o, l); + var u = n.get(l), f = u !== void 0 && u.v !== Re || Reflect.has(o, l); if (u !== void 0 || J !== null && (!f || (h = Hn(o, l)) != null && h.writable)) { u === void 0 && (u = a(() => { - var d = f ? Pn(o[l]) : Te, y = /* @__PURE__ */ $e(d); - return y; + var p = f ? Pn(o[l]) : Re, _ = /* @__PURE__ */ $e(p); + return _; }), n.set(l, u)); - var p = x(u); - if (p === Te) + var d = $(u); + if (d === Re) return !1; } return f; }, set(o, l, u, f) { - var M; - var p = n.get(l), h = l in o; + var N; + var d = n.get(l), h = l in o; if (r && l === "length") - for (var d = u; d < /** @type {Source} */ - p.v; d += 1) { - var y = n.get(d + ""); - y !== void 0 ? he(y, Te) : d in o && (y = a(() => /* @__PURE__ */ $e(Te)), n.set(d + "", y)); + for (var p = u; p < /** @type {Source} */ + d.v; p += 1) { + var _ = n.get(p + ""); + _ !== void 0 ? ve(_, Re) : p in o && (_ = a(() => /* @__PURE__ */ $e(Re)), n.set(p + "", _)); } - if (p === void 0) - (!h || (M = Hn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ $e(void 0)), he(p, Pn(u)), n.set(l, p)); + if (d === void 0) + (!h || (N = Hn(o, l)) != null && N.writable) && (d = a(() => /* @__PURE__ */ $e(void 0)), ve(d, Pn(u)), n.set(l, d)); else { - h = p.v !== Te; - var b = a(() => Pn(u)); - he(p, b); + h = d.v !== Re; + var x = a(() => Pn(u)); + ve(d, x); } - var m = Reflect.getOwnPropertyDescriptor(o, l); - if (m != null && m.set && m.set.call(f, u), !h) { + var y = Reflect.getOwnPropertyDescriptor(o, l); + if (y != null && y.set && y.set.call(f, u), !h) { if (r && typeof l == "string") { - var $ = ( + var b = ( /** @type {Source} */ n.get("length") - ), D = Number(l); - Number.isInteger(D) && D >= $.v && he($, D + 1); + ), O = Number(l); + Number.isInteger(O) && O >= b.v && ve(b, O + 1); } - Or(i); + Ir(i); } return !0; }, ownKeys(o) { - x(i); - var l = Reflect.ownKeys(o).filter((p) => { - var h = n.get(p); - return h === void 0 || h.v !== Te; + $(i); + var l = Reflect.ownKeys(o).filter((d) => { + var h = n.get(d); + return h === void 0 || h.v !== Re; }); for (var [u, f] of n) - f.v !== Te && !(u in o) && l.push(u); + f.v !== Re && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - _u(); + yu(); } } ); } -var ca, bo, $o, Ao; +var ha, $o, Ao, Eo; function _s() { - if (ca === void 0) { - ca = window, bo = /Firefox/.test(navigator.userAgent); + if (ha === void 0) { + ha = window, $o = /Firefox/.test(navigator.userAgent); var e = Element.prototype, t = Node.prototype, n = Text.prototype; - $o = Hn(t, "firstChild").get, Ao = Hn(t, "nextSibling").get, la(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), la(n) && (n.__t = void 0); + Ao = Hn(t, "firstChild").get, Eo = Hn(t, "nextSibling").get, ua(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), ua(n) && (n.__t = void 0); } } -function ot(e = "") { +function rt(e = "") { return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ -function fn(e) { +function un(e) { return ( /** @type {TemplateNode | null} */ - $o.call(e) + Ao.call(e) ); } // @__NO_SIDE_EFFECTS__ -function Yt(e) { +function Ht(e) { return ( /** @type {TemplateNode | null} */ - Ao.call(e) + Eo.call(e) ); } -function Xe(e, t) { +function Be(e, t) { if (!j) - return /* @__PURE__ */ fn(e); - var n = /* @__PURE__ */ fn(W); + return /* @__PURE__ */ un(e); + var n = /* @__PURE__ */ un(X); if (n === null) - n = W.appendChild(ot()); - else if (t && n.nodeType !== Ur) { - var r = ot(); - return n == null || n.before(r), Ve(r), r; + n = X.appendChild(rt()); + else if (t && n.nodeType !== Kr) { + var r = rt(); + return n == null || n.before(r), Ie(r), r; } - return t && Xi( + return t && Yi( /** @type {Text} */ n - ), Ve(n), n; + ), Ie(n), n; } -function _n(e, t = !1) { +function gn(e, t = !1) { if (!j) { - var n = /* @__PURE__ */ fn(e); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Yt(n) : n; + var n = /* @__PURE__ */ un(e); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ht(n) : n; } if (t) { - if ((W == null ? void 0 : W.nodeType) !== Ur) { - var r = ot(); - return W == null || W.before(r), Ve(r), r; + if ((X == null ? void 0 : X.nodeType) !== Kr) { + var r = rt(); + return X == null || X.before(r), Ie(r), r; } - Xi( + Yi( /** @type {Text} */ - W + X ); } - return W; + return X; } -function nt(e, t = 1, n = !1) { - let r = j ? W : e; +function Ze(e, t = 1, n = !1) { + let r = j ? X : e; for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Yt(r); + /* @__PURE__ */ Ht(r); if (!j) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Ur) { - var s = ot(); - return r === null ? i == null || i.after(s) : r.before(s), Ve(s), s; + if ((r == null ? void 0 : r.nodeType) !== Kr) { + var s = rt(); + return r === null ? i == null || i.after(s) : r.before(s), Ie(s), s; } - Xi( + Yi( /** @type {Text} */ r ); } - return Ve(r), r; + return Ie(r), r; } -function Eo(e) { +function To(e) { e.textContent = ""; } -function To() { +function Ro() { return !1; } function Os(e, t, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Wa, e, void 0) + document.createElementNS(Ua, e, void 0) ); } -function Xi(e) { +function Yi(e) { if ( /** @type {string} */ e.nodeValue.length < 65536 ) return; let t = e.nextSibling; - for (; t !== null && t.nodeType === Ur; ) + for (; t !== null && t.nodeType === Kr; ) t.remove(), e.nodeValue += /** @type {string} */ t.nodeValue, t = e.nextSibling; } -function Co(e) { - var t = X, n = J; - mt(null), zt(null); +function So(e) { + var t = B, n = J; + pt(null), Vt(null); try { return e(); } finally { - mt(t), zt(n); + pt(t), Vt(n); } } -function Iu(e) { - J === null && (X === null && hu(), cu()), An && fu(); +function qu(e) { + J === null && (B === null && pu(), du()), $n && hu(); } -function Lu(e, t) { +function Vu(e, t) { var n = t.last; n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } -function Bt(e, t, n) { +function Yt(e, t, n) { var r = J; - r !== null && (r.f & at) !== 0 && (e |= at); + r !== null && (r.f & nt) !== 0 && (e |= nt); var i = { - ctx: lt, + ctx: it, deps: null, nodes: null, - f: e | Se | gt, + f: e | Ne | ht, first: null, fn: t, last: null, @@ -1379,93 +1379,93 @@ function Bt(e, t, n) { }; if (n) try { - gr(i); + _r(i); } catch (o) { - throw ze(i), o; + throw Le(i), o; } - else t !== null && At(i); + else t !== null && $t(i); var s = i; if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child - (s.f & jn) === 0 && (s = s.first, (e & hn) !== 0 && (e & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && Lu(s, r), X !== null && (X.f & Re) !== 0 && (e & En) === 0)) { + (s.f & jn) === 0 && (s = s.first, (e & cn) !== 0 && (e & dr) !== 0 && s !== null && (s.f |= dr)), s !== null && (s.parent = r, r !== null && Vu(s, r), B !== null && (B.f & Ce) !== 0 && (e & An) === 0)) { var a = ( /** @type {Derived} */ - X + B ); (a.effects ?? (a.effects = [])).push(s); } return i; } function Fs() { - return X !== null && !Et; + return B !== null && !At; } -function qu(e) { - const t = Bt(Li, null, !1); - return de(t, Ae), t.teardown = e, t; +function zu(e) { + const t = Yt(Fi, null, !1); + return ge(t, Ae), t.teardown = e, t; } function Is(e) { - Iu(); + qu(); var t = ( /** @type {Effect} */ J.f - ), n = !X && (t & Ct) !== 0 && (t & yr) === 0; + ), n = !B && (t & Tt) !== 0 && (t & wr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - lt + it ); (r.e ?? (r.e = [])).push(e); } else - return Ro(e); + return Co(e); } -function Ro(e) { - return Bt(Fr | iu, e, !1); +function Co(e) { + return Yt(Lr | au, e, !1); } -function Vu(e) { - un.ensure(); - const t = Bt(En | jn, e, !0); +function Hu(e) { + ln.ensure(); + const t = Yt(An | jn, e, !0); return () => { - ze(t); + Le(t); }; } -function zu(e) { - un.ensure(); - const t = Bt(En | jn, e, !0); +function Yu(e) { + ln.ensure(); + const t = Yt(An | jn, e, !0); return (n = {}) => new Promise((r) => { n.outro ? Yn(t, () => { - ze(t), r(void 0); - }) : (ze(t), r(void 0)); + Le(t), r(void 0); + }) : (Le(t), r(void 0)); }); } -function So(e) { - return Bt(Fr, e, !1); +function No(e) { + return Yt(Lr, e, !1); } -function Hu(e) { - return Bt(Ms | jn, e, !0); +function Bu(e) { + return Yt(Ms | jn, e, !0); } function Ls(e, t = 0) { - return Bt(Li | t, e, !0); + return Yt(Fi | t, e, !0); } -function Qt(e, t = [], n = [], r = []) { - Nu(r, t, n, (i) => { - Bt(Li, () => e(...i.map(x)), !0); +function Zt(e, t = [], n = [], r = []) { + Mu(r, t, n, (i) => { + Yt(Fi, () => e(...i.map($)), !0); }); } function qs(e, t = 0) { - var n = Bt(hn | t, e, !0); + var n = Yt(cn | t, e, !0); return n; } -function vt(e) { - return Bt(Ct | jn, e, !0); +function ct(e) { + return Yt(Tt | jn, e, !0); } -function No(e) { +function ko(e) { var t = e.teardown; if (t !== null) { - const n = An, r = X; - ha(!0), mt(null); + const n = $n, r = B; + da(!0), pt(null); try { t.call(null); } finally { - ha(n), mt(r); + da(n), pt(r); } } } @@ -1473,49 +1473,49 @@ function Vs(e, t = !1) { var n = e.first; for (e.first = e.last = null; n !== null; ) { const i = n.ac; - i !== null && Co(() => { + i !== null && So(() => { i.abort(kn); }); var r = n.next; - (n.f & En) !== 0 ? n.parent = null : ze(n, t), n = r; + (n.f & An) !== 0 ? n.parent = null : Le(n, t), n = r; } } -function Yu(e) { +function Xu(e) { for (var t = e.first; t !== null; ) { var n = t.next; - (t.f & Ct) === 0 && ze(t), t = n; + (t.f & Tt) === 0 && Le(t), t = n; } } -function ze(e, t = !0) { +function Le(e, t = !0) { var n = !1; - (t || (e.f & Za) !== 0) && e.nodes !== null && e.nodes.end !== null && (Bu( + (t || (e.f & Qa) !== 0) && e.nodes !== null && e.nodes.end !== null && (Wu( e.nodes.start, /** @type {TemplateNode} */ e.nodes.end - ), n = !0), Vs(e, t && !n), Ir(e, 0), de(e, ln); + ), n = !0), Vs(e, t && !n), qr(e, 0), ge(e, on); var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) s.stop(); - No(e); + ko(e); var i = e.parent; - i !== null && i.first !== null && ko(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; + i !== null && i.first !== null && Mo(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; } -function Bu(e, t) { +function Wu(e, t) { for (; e !== null; ) { - var n = e === t ? null : /* @__PURE__ */ Yt(e); + var n = e === t ? null : /* @__PURE__ */ Ht(e); e.remove(), e = n; } } -function ko(e) { +function Mo(e) { var t = e.parent, n = e.prev, r = e.next; n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n)); } function Yn(e, t, n = !0) { var r = []; - Mo(e, r, !0); + Po(e, r, !0); var i = () => { - n && ze(e), t && t(); + n && Le(e), t && t(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1524,31 +1524,31 @@ function Yn(e, t, n = !0) { } else i(); } -function Mo(e, t, n) { - if ((e.f & at) === 0) { - e.f ^= at; +function Po(e, t, n) { + if ((e.f & nt) === 0) { + e.f ^= nt; var r = e.nodes && e.nodes.t; if (r !== null) for (const o of r) (o.is_global || n) && t.push(o); for (var i = e.first; i !== null; ) { - var s = i.next, a = (i.f & hr) !== 0 || // If this is a branch effect without a block effect parent, + var s = i.next, a = (i.f & dr) !== 0 || // If this is a branch effect without a block effect parent, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. - (i.f & Ct) !== 0 && (e.f & hn) !== 0; - Mo(i, t, a ? n : !1), i = s; + (i.f & Tt) !== 0 && (e.f & cn) !== 0; + Po(i, t, a ? n : !1), i = s; } } } function zs(e) { - Po(e, !0); + Do(e, !0); } -function Po(e, t) { - if ((e.f & at) !== 0) { - e.f ^= at, (e.f & Ae) === 0 && (de(e, Se), At(e)); +function Do(e, t) { + if ((e.f & nt) !== 0) { + e.f ^= nt, (e.f & Ae) === 0 && (ge(e, Ne), $t(e)); for (var n = e.first; n !== null; ) { - var r = n.next, i = (n.f & hr) !== 0 || (n.f & Ct) !== 0; - Po(n, i ? t : !1), n = r; + var r = n.next, i = (n.f & dr) !== 0 || (n.f & Tt) !== 0; + Do(n, i ? t : !1), n = r; } var s = e.nodes && e.nodes.t; if (s !== null) @@ -1556,86 +1556,86 @@ function Po(e, t) { (a.is_global || t) && a.in(); } } -function Do(e, t) { +function Oo(e, t) { if (e.nodes) for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Yt(n); + var i = n === r ? null : /* @__PURE__ */ Ht(n); t.append(n), n = i; } } -let di = !1, An = !1; -function ha(e) { - An = e; +let ci = !1, $n = !1; +function da(e) { + $n = e; } -let X = null, Et = !1; -function mt(e) { - X = e; +let B = null, At = !1; +function pt(e) { + B = e; } let J = null; -function zt(e) { +function Vt(e) { J = e; } -let _t = null; -function Oo(e) { - X !== null && (_t === null ? _t = [e] : _t.push(e)); +let dt = null; +function Fo(e) { + B !== null && (dt === null ? dt = [e] : dt.push(e)); } -let Ke = null, rt = 0, ht = null; -function Xu(e) { - ht = e; +let Ge = null, Qe = 0, lt = null; +function Uu(e) { + lt = e; } -let Fo = 1, Dn = 0, Bn = Dn; -function da(e) { +let Io = 1, Dn = 0, Bn = Dn; +function pa(e) { Bn = e; } -function Io() { - return ++Fo; +function Lo() { + return ++Io; } -function Gr(e) { +function jr(e) { var t = e.f; - if ((t & Se) !== 0) + if ((t & Ne) !== 0) return !0; - if (t & Re && (e.f &= ~Wn), (t & Tt) !== 0) { + if (t & Ce && (e.f &= ~Wn), (t & Et) !== 0) { for (var n = ( /** @type {Value[]} */ e.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Gr( + if (jr( /** @type {Derived} */ s - ) && _o( + ) && mo( /** @type {Derived} */ s ), s.wv > e.wv) return !0; } - (t & gt) !== 0 && // During time traveling we don't want to reset the status so that + (t & ht) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Ce === null && de(e, Ae); + Se === null && ge(e, Ae); } return !1; } -function Lo(e, t, n = !0) { +function qo(e, t, n = !0) { var r = e.reactions; - if (r !== null && !(_t !== null && cr.call(_t, e))) + if (r !== null && !(dt !== null && hr.call(dt, e))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Re) !== 0 ? Lo( + (s.f & Ce) !== 0 ? qo( /** @type {Derived} */ s, t, !1 - ) : t === s && (n ? de(s, Se) : (s.f & Ae) !== 0 && de(s, Tt), At( + ) : t === s && (n ? ge(s, Ne) : (s.f & Ae) !== 0 && ge(s, Et), $t( /** @type {Effect} */ s )); } } -function qo(e) { - var b; - var t = Ke, n = rt, r = ht, i = X, s = _t, a = lt, o = Et, l = Bn, u = e.f; - Ke = /** @type {null | Value[]} */ - null, rt = 0, ht = null, X = (u & (Ct | En)) === 0 ? e : null, _t = null, dr(e.ctx), Et = !1, Bn = ++Dn, e.ac !== null && (Co(() => { +function Vo(e) { + var x; + var t = Ge, n = Qe, r = lt, i = B, s = dt, a = it, o = At, l = Bn, u = e.f; + Ge = /** @type {null | Value[]} */ + null, Qe = 0, lt = null, B = (u & (Tt | An)) === 0 ? e : null, dt = null, pr(e.ctx), At = !1, Bn = ++Dn, e.ac !== null && (So(() => { e.ac.abort(kn); }), e.ac = null); try { @@ -1643,172 +1643,172 @@ function qo(e) { var f = ( /** @type {Function} */ e.fn - ), p = f(); - e.f |= yr; - var h = e.deps, d = K == null ? void 0 : K.is_fork; - if (Ke !== null) { - var y; - if (d || Ir(e, rt), h !== null && rt > 0) - for (h.length = rt + Ke.length, y = 0; y < Ke.length; y++) - h[rt + y] = Ke[y]; + ), d = f(); + e.f |= wr; + var h = e.deps, p = K == null ? void 0 : K.is_fork; + if (Ge !== null) { + var _; + if (p || qr(e, Qe), h !== null && Qe > 0) + for (h.length = Qe + Ge.length, _ = 0; _ < Ge.length; _++) + h[Qe + _] = Ge[_]; else - e.deps = h = Ke; - if (Fs() && (e.f & gt) !== 0) - for (y = rt; y < h.length; y++) - ((b = h[y]).reactions ?? (b.reactions = [])).push(e); - } else !d && h !== null && rt < h.length && (Ir(e, rt), h.length = rt); - if (ro() && ht !== null && !Et && h !== null && (e.f & (Re | Tt | Se)) === 0) - for (y = 0; y < /** @type {Source[]} */ - ht.length; y++) - Lo( - ht[y], + e.deps = h = Ge; + if (Fs() && (e.f & ht) !== 0) + for (_ = Qe; _ < h.length; _++) + ((x = h[_]).reactions ?? (x.reactions = [])).push(e); + } else !p && h !== null && Qe < h.length && (qr(e, Qe), h.length = Qe); + if (io() && lt !== null && !At && h !== null && (e.f & (Ce | Et | Ne)) === 0) + for (_ = 0; _ < /** @type {Source[]} */ + lt.length; _++) + qo( + lt[_], /** @type {Effect} */ e ); if (i !== null && i !== e) { if (Dn++, i.deps !== null) - for (let m = 0; m < n; m += 1) - i.deps[m].rv = Dn; + for (let y = 0; y < n; y += 1) + i.deps[y].rv = Dn; if (t !== null) - for (const m of t) - m.rv = Dn; - ht !== null && (r === null ? r = ht : r.push(.../** @type {Source[]} */ - ht)); + for (const y of t) + y.rv = Dn; + lt !== null && (r === null ? r = lt : r.push(.../** @type {Source[]} */ + lt)); } - return (e.f & wn) !== 0 && (e.f ^= wn), p; - } catch (m) { - return so(m); + return (e.f & yn) !== 0 && (e.f ^= yn), d; + } catch (y) { + return ao(y); } finally { - e.f ^= ls, Ke = t, rt = n, ht = r, X = i, _t = s, dr(a), Et = o, Bn = l; + e.f ^= ls, Ge = t, Qe = n, lt = r, B = i, dt = s, pr(a), At = o, Bn = l; } } -function Wu(e, t) { +function Gu(e, t) { let n = t.reactions; if (n !== null) { - var r = Jl.call(n, e); + var r = Ql.call(n, e); if (r !== -1) { var i = n.length - 1; i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (t.f & Re) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (t.f & Ce) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it - (Ke === null || !cr.call(Ke, t))) { + (Ge === null || !hr.call(Ge, t))) { var s = ( /** @type {Derived} */ t ); - (s.f & gt) !== 0 && (s.f ^= gt, s.f &= ~Wn), Ps(s), Ou(s), Ir(s, 0); + (s.f & ht) !== 0 && (s.f ^= ht, s.f &= ~Wn), Ps(s), Iu(s), qr(s, 0); } } -function Ir(e, t) { +function qr(e, t) { var n = e.deps; if (n !== null) for (var r = t; r < n.length; r++) - Wu(e, n[r]); + Gu(e, n[r]); } -function gr(e) { +function _r(e) { var t = e.f; - if ((t & ln) === 0) { - de(e, Ae); - var n = J, r = di; - J = e, di = !0; + if ((t & on) === 0) { + ge(e, Ae); + var n = J, r = ci; + J = e, ci = !0; try { - (t & (hn | ja)) !== 0 ? Yu(e) : Vs(e), No(e); - var i = qo(e); - e.teardown = typeof i == "function" ? i : null, e.wv = Fo; + (t & (cn | Ja)) !== 0 ? Xu(e) : Vs(e), ko(e); + var i = Vo(e); + e.teardown = typeof i == "function" ? i : null, e.wv = Io; var s; - os && bu && (e.f & Se) !== 0 && e.deps; + os && Au && (e.f & Ne) !== 0 && e.deps; } finally { - di = r, J = n; + ci = r, J = n; } } } -function x(e) { - var t = e.f, n = (t & Re) !== 0; - if (X !== null && !Et) { - var r = J !== null && (J.f & ln) !== 0; - if (!r && (_t === null || !cr.call(_t, e))) { - var i = X.deps; - if ((X.f & ls) !== 0) - e.rv < Dn && (e.rv = Dn, Ke === null && i !== null && i[rt] === e ? rt++ : Ke === null ? Ke = [e] : Ke.push(e)); +function $(e) { + var t = e.f, n = (t & Ce) !== 0; + if (B !== null && !At) { + var r = J !== null && (J.f & on) !== 0; + if (!r && (dt === null || !hr.call(dt, e))) { + var i = B.deps; + if ((B.f & ls) !== 0) + e.rv < Dn && (e.rv = Dn, Ge === null && i !== null && i[Qe] === e ? Qe++ : Ge === null ? Ge = [e] : Ge.push(e)); else { - (X.deps ?? (X.deps = [])).push(e); + (B.deps ?? (B.deps = [])).push(e); var s = e.reactions; - s === null ? e.reactions = [X] : cr.call(s, X) || s.push(X); + s === null ? e.reactions = [B] : hr.call(s, B) || s.push(B); } } } - if (An && bn.has(e)) - return bn.get(e); + if ($n && xn.has(e)) + return xn.get(e); if (n) { var a = ( /** @type {Derived} */ e ); - if (An) { + if ($n) { var o = a.v; - return ((a.f & Ae) === 0 && a.reactions !== null || zo(a)) && (o = Ds(a)), bn.set(a, o), o; + return ((a.f & Ae) === 0 && a.reactions !== null || Ho(a)) && (o = Ds(a)), xn.set(a, o), o; } - var l = (a.f & gt) === 0 && !Et && X !== null && (di || (X.f & gt) !== 0), u = (a.f & yr) === 0; - Gr(a) && (l && (a.f |= gt), _o(a)), l && !u && (mo(a), Vo(a)); + var l = (a.f & ht) === 0 && !At && B !== null && (ci || (B.f & ht) !== 0), u = (a.f & wr) === 0; + jr(a) && (l && (a.f |= ht), mo(a)), l && !u && (yo(a), zo(a)); } - if (Ce != null && Ce.has(e)) - return Ce.get(e); - if ((e.f & wn) !== 0) + if (Se != null && Se.has(e)) + return Se.get(e); + if ((e.f & yn) !== 0) throw e.v; return e.v; } -function Vo(e) { - if (e.f |= gt, e.deps !== null) +function zo(e) { + if (e.f |= ht, e.deps !== null) for (const t of e.deps) - (t.reactions ?? (t.reactions = [])).push(e), (t.f & Re) !== 0 && (t.f & gt) === 0 && (mo( + (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ce) !== 0 && (t.f & ht) === 0 && (yo( /** @type {Derived} */ t - ), Vo( + ), zo( /** @type {Derived} */ t )); } -function zo(e) { - if (e.v === Te) return !0; +function Ho(e) { + if (e.v === Re) return !0; if (e.deps === null) return !1; for (const t of e.deps) - if (bn.has(t) || (t.f & Re) !== 0 && zo( + if (xn.has(t) || (t.f & Ce) !== 0 && Ho( /** @type {Derived} */ t )) return !0; return !1; } -function Wi(e) { - var t = Et; +function Bi(e) { + var t = At; try { - return Et = !0, e(); + return At = !0, e(); } finally { - Et = t; + At = t; } } -const Ho = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); -function Uu(e) { +const Yo = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); +function Ku(e) { for (var t = 0; t < e.length; t++) - Ho.add(e[t]); + Yo.add(e[t]); for (var n of ms) n(e); } -let pa = null; -function va(e) { - var m; +let va = null; +function ga(e) { + var y; var t = this, n = ( /** @type {Node} */ t.ownerDocument - ), r = e.type, i = ((m = e.composedPath) == null ? void 0 : m.call(e)) || [], s = ( + ), r = e.type, i = ((y = e.composedPath) == null ? void 0 : y.call(e)) || [], s = ( /** @type {null | Element} */ i[0] || e.target ); - pa = e; - var a = 0, o = pa === e && e.__root; + va = e; + var a = 0, o = va === e && e.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (t === document || t === /** @type {any} */ @@ -1823,62 +1823,62 @@ function va(e) { } if (s = /** @type {Element} */ i[a] || e.target, s !== t) { - Ai(e, "currentTarget", { + bi(e, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = X, p = J; - mt(null), zt(null); + var f = B, d = J; + pt(null), Vt(null); try { - for (var h, d = []; s !== null; ) { - var y = s.assignedSlot || s.parentNode || /** @type {any} */ + for (var h, p = []; s !== null; ) { + var _ = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var b = s["__" + r]; - b != null && (!/** @type {any} */ + var x = s["__" + r]; + x != null && (!/** @type {any} */ s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well // -> the target could not have been disabled because it emits the event in the first place - e.target === s) && b.call(s, e); - } catch ($) { - h ? d.push($) : h = $; + e.target === s) && x.call(s, e); + } catch (b) { + h ? p.push(b) : h = b; } - if (e.cancelBubble || y === t || y === null) + if (e.cancelBubble || _ === t || _ === null) break; - s = y; + s = _; } if (h) { - for (let $ of d) + for (let b of p) queueMicrotask(() => { - throw $; + throw b; }); throw h; } } finally { - e.__root = t, delete e.currentTarget, mt(f), zt(p); + e.__root = t, delete e.currentTarget, pt(f), Vt(d); } } } -var Ya, Ba; -const ts = (Ba = (Ya = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ya.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ba.createPolicy( +var Ba, Xa; +const ts = (Xa = (Ba = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ba.trustedTypes) == null ? void 0 : /* @__PURE__ */ Xa.createPolicy( "svelte-trusted-html", { /** @param {string} html */ createHTML: (e) => e } ); -function Gu(e) { +function ju(e) { return ( /** @type {string} */ (ts == null ? void 0 : ts.createHTML(e)) ?? e ); } -function Yo(e, t = !1) { +function Bo(e, t = !1) { var n = Os("template"); - return e = e.replaceAll("", ""), n.innerHTML = t ? Gu(e) : e, n.content; + return e = e.replaceAll("", ""), n.innerHTML = t ? ju(e) : e, n.content; } -function $n(e, t) { +function bn(e, t) { var n = ( /** @type {Effect} */ J @@ -1886,77 +1886,77 @@ function $n(e, t) { n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Xt(e, t) { - var n = (t & Kl) !== 0, r = (t & jl) !== 0, i, s = !e.startsWith(""); +function Bt(e, t) { + var n = (t & Jl) !== 0, r = (t & Zl) !== 0, i, s = !e.startsWith(""); return () => { if (j) - return $n(W, null), W; - i === void 0 && (i = Yo(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ - /* @__PURE__ */ fn(i))); + return bn(X, null), X; + i === void 0 && (i = Bo(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + /* @__PURE__ */ un(i))); var a = ( /** @type {TemplateNode} */ - r || bo ? document.importNode(i, !0) : i.cloneNode(!0) + r || $o ? document.importNode(i, !0) : i.cloneNode(!0) ); if (n) { var o = ( /** @type {TemplateNode} */ - /* @__PURE__ */ fn(a) + /* @__PURE__ */ un(a) ), l = ( /** @type {TemplateNode} */ a.lastChild ); - $n(o, l); + bn(o, l); } else - $n(a, a); + bn(a, a); return a; }; } // @__NO_SIDE_EFFECTS__ -function Ku(e, t, n = "svg") { +function Ju(e, t, n = "svg") { var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; return () => { if (j) - return $n(W, null), W; + return bn(X, null), X; if (!s) { var a = ( /** @type {DocumentFragment} */ - Yo(i, !0) + Bo(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ fn(a) + /* @__PURE__ */ un(a) ); s = /** @type {Element} */ - /* @__PURE__ */ fn(o); + /* @__PURE__ */ un(o); } var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return $n(l, l), l; + return bn(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function ju(e, t) { - return /* @__PURE__ */ Ku(e, t, "svg"); +function Zu(e, t) { + return /* @__PURE__ */ Ju(e, t, "svg"); } -function ga(e = "") { +function _a(e = "") { if (!j) { - var t = ot(e + ""); - return $n(t, t), t; + var t = rt(e + ""); + return bn(t, t), t; } - var n = W; - return n.nodeType !== Ur ? (n.before(n = ot()), Ve(n)) : Xi( + var n = X; + return n.nodeType !== Kr ? (n.before(n = rt()), Ie(n)) : Yi( /** @type {Text} */ n - ), $n(n, n), n; + ), bn(n, n), n; } -function Ue(e, t) { +function We(e, t) { if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ J ); - ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = W), Vi(); + ((n.f & wr) === 0 || n.nodes.end === null) && (n.nodes.end = X), Li(); return; } e !== null && e.before( @@ -1964,119 +1964,119 @@ function Ue(e, t) { t ); } -const Ju = ["touchstart", "touchmove"]; -function Zu(e) { - return Ju.includes(e); +const Qu = ["touchstart", "touchmove"]; +function ef(e) { + return Qu.includes(e); } -function mn(e, t) { +function _n(e, t) { var n = t == null ? "" : typeof t == "object" ? t + "" : t; n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + ""); } -function Bo(e, t) { - return Xo(e, t); +function Xo(e, t) { + return Wo(e, t); } -function Qu(e, t) { +function tf(e, t) { _s(), t.intro = t.intro ?? !1; - const n = t.target, r = j, i = W; + const n = t.target, r = j, i = X; try { - for (var s = /* @__PURE__ */ fn(n); s && (s.nodeType !== wr || /** @type {Comment} */ + for (var s = /* @__PURE__ */ un(n); s && (s.nodeType !== xr || /** @type {Comment} */ s.data !== Ns); ) - s = /* @__PURE__ */ Yt(s); + s = /* @__PURE__ */ Ht(s); if (!s) - throw fr; - on(!0), Ve( + throw cr; + an(!0), Ie( /** @type {Comment} */ s ); - const a = Xo(e, { ...t, anchor: s }); - return on(!1), /** @type {Exports} */ + const a = Wo(e, { ...t, anchor: s }); + return an(!1), /** @type {Exports} */ a; } catch (a) { if (a instanceof Error && a.message.split(` `).some((o) => o.startsWith("https://svelte.dev/e/"))) throw a; - return a !== fr && console.warn("Failed to hydrate: ", a), t.recover === !1 && pu(), _s(), Eo(n), on(!1), Bo(e, t); + return a !== cr && console.warn("Failed to hydrate: ", a), t.recover === !1 && gu(), _s(), To(n), an(!1), Xo(e, t); } finally { - on(r), Ve(i); + an(r), Ie(i); } } -const ii = /* @__PURE__ */ new Map(); -function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { +const ni = /* @__PURE__ */ new Map(); +function Wo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { _s(); - var o = /* @__PURE__ */ new Set(), l = (p) => { - for (var h = 0; h < p.length; h++) { - var d = p[h]; - if (!o.has(d)) { - o.add(d); - var y = Zu(d); - for (const $ of [t, document]) { - var b = ii.get($); - b === void 0 && (b = /* @__PURE__ */ new Map(), ii.set($, b)); - var m = b.get(d); - m === void 0 ? ($.addEventListener(d, va, { passive: y }), b.set(d, 1)) : b.set(d, m + 1); + var o = /* @__PURE__ */ new Set(), l = (d) => { + for (var h = 0; h < d.length; h++) { + var p = d[h]; + if (!o.has(p)) { + o.add(p); + var _ = ef(p); + for (const b of [t, document]) { + var x = ni.get(b); + x === void 0 && (x = /* @__PURE__ */ new Map(), ni.set(b, x)); + var y = x.get(p); + y === void 0 ? (b.addEventListener(p, ga, { passive: _ }), x.set(p, 1)) : x.set(p, y + 1); } } } }; - l(Ii(Ho)), ms.add(l); - var u = void 0, f = zu(() => { - var p = n ?? t.appendChild(ot()); - return Ru( + l(Oi(Yo)), ms.add(l); + var u = void 0, f = Yu(() => { + var d = n ?? t.appendChild(rt()); + return Nu( /** @type {TemplateNode} */ - p, + d, { pending: () => { } }, (h) => { - zi({}); - var d = ( + qi({}); + var p = ( /** @type {ComponentContext} */ - lt + it ); - if (s && (d.c = s), i && (r.$$events = i), j && $n( + if (s && (p.c = s), i && (r.$$events = i), j && bn( /** @type {TemplateNode} */ h, null - ), u = e(h, r) || {}, j && (J.nodes.end = W, W === null || W.nodeType !== wr || /** @type {Comment} */ - W.data !== ks)) - throw qi(), fr; - Hi(); + ), u = e(h, r) || {}, j && (J.nodes.end = X, X === null || X.nodeType !== xr || /** @type {Comment} */ + X.data !== ks)) + throw Ii(), cr; + Vi(); } ), () => { - var b; + var x; for (var h of o) - for (const m of [t, document]) { - var d = ( + for (const y of [t, document]) { + var p = ( /** @type {Map} */ - ii.get(m) - ), y = ( + ni.get(y) + ), _ = ( /** @type {number} */ - d.get(h) + p.get(h) ); - --y == 0 ? (m.removeEventListener(h, va), d.delete(h), d.size === 0 && ii.delete(m)) : d.set(h, y); + --_ == 0 ? (y.removeEventListener(h, ga), p.delete(h), p.size === 0 && ni.delete(y)) : p.set(h, _); } - ms.delete(l), p !== n && ((b = p.parentNode) == null || b.removeChild(p)); + ms.delete(l), d !== n && ((x = d.parentNode) == null || x.removeChild(d)); }; }); return ys.set(u, f), u; } let ys = /* @__PURE__ */ new WeakMap(); -function ef(e, t) { +function nf(e, t) { const n = ys.get(e); return n ? (ys.delete(e), n(t)) : Promise.resolve(); } -var bt, Lt, st, zn, Xr, Wr, Oi; -class tf { +var xt, It, tt, zn, Ur, Gr, Pi; +class rf { /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(t, n = !0) { /** @type {TemplateNode} */ - ce(this, "anchor"); + pe(this, "anchor"); /** @type {Map} */ - H(this, bt, /* @__PURE__ */ new Map()); + z(this, xt, /* @__PURE__ */ new Map()); /** * Map of keys to effects that are currently rendered in the DOM. * These effects are visible and actively part of the document tree. @@ -2091,69 +2091,69 @@ class tf { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - H(this, Lt, /* @__PURE__ */ new Map()); + z(this, It, /* @__PURE__ */ new Map()); /** * Similar to #onscreen with respect to the keys, but contains branches that are not yet * in the DOM, because their insertion is deferred. * @type {Map} */ - H(this, st, /* @__PURE__ */ new Map()); + z(this, tt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - H(this, zn, /* @__PURE__ */ new Set()); + z(this, zn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - H(this, Xr, !0); - H(this, Wr, () => { + z(this, Ur, !0); + z(this, Gr, () => { var t = ( /** @type {Batch} */ K ); - if (v(this, bt).has(t)) { + if (v(this, xt).has(t)) { var n = ( /** @type {Key} */ - v(this, bt).get(t) - ), r = v(this, Lt).get(n); + v(this, xt).get(t) + ), r = v(this, It).get(n); if (r) zs(r), v(this, zn).delete(n); else { - var i = v(this, st).get(n); - i && (v(this, Lt).set(n, i.effect), v(this, st).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, tt).get(n); + i && (v(this, It).set(n, i.effect), v(this, tt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, bt)) { - if (v(this, bt).delete(s), s === t) + for (const [s, a] of v(this, xt)) { + if (v(this, xt).delete(s), s === t) break; - const o = v(this, st).get(a); - o && (ze(o.effect), v(this, st).delete(a)); + const o = v(this, tt).get(a); + o && (Le(o.effect), v(this, tt).delete(a)); } - for (const [s, a] of v(this, Lt)) { + for (const [s, a] of v(this, It)) { if (s === n || v(this, zn).has(s)) continue; const o = () => { - if (Array.from(v(this, bt).values()).includes(s)) { + if (Array.from(v(this, xt).values()).includes(s)) { var u = document.createDocumentFragment(); - Do(a, u), u.append(ot()), v(this, st).set(s, { effect: a, fragment: u }); + Oo(a, u), u.append(rt()), v(this, tt).set(s, { effect: a, fragment: u }); } else - ze(a); - v(this, zn).delete(s), v(this, Lt).delete(s); + Le(a); + v(this, zn).delete(s), v(this, It).delete(s); }; - v(this, Xr) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); + v(this, Ur) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - H(this, Oi, (t) => { - v(this, bt).delete(t); - const n = Array.from(v(this, bt).values()); - for (const [r, i] of v(this, st)) - n.includes(r) || (ze(i.effect), v(this, st).delete(r)); + z(this, Pi, (t) => { + v(this, xt).delete(t); + const n = Array.from(v(this, xt).values()); + for (const [r, i] of v(this, tt)) + n.includes(r) || (Le(i.effect), v(this, tt).delete(r)); }); - this.anchor = t, V(this, Xr, n); + this.anchor = t, q(this, Ur, n); } /** * @@ -2164,49 +2164,49 @@ class tf { var r = ( /** @type {Batch} */ K - ), i = To(); - if (n && !v(this, Lt).has(t) && !v(this, st).has(t)) + ), i = Ro(); + if (n && !v(this, It).has(t) && !v(this, tt).has(t)) if (i) { - var s = document.createDocumentFragment(), a = ot(); - s.append(a), v(this, st).set(t, { - effect: vt(() => n(a)), + var s = document.createDocumentFragment(), a = rt(); + s.append(a), v(this, tt).set(t, { + effect: ct(() => n(a)), fragment: s }); } else - v(this, Lt).set( + v(this, It).set( t, - vt(() => n(this.anchor)) + ct(() => n(this.anchor)) ); - if (v(this, bt).set(r, t), i) { - for (const [o, l] of v(this, Lt)) + if (v(this, xt).set(r, t), i) { + for (const [o, l] of v(this, It)) o === t ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, st)) + for (const [o, l] of v(this, tt)) o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Wr)), r.ondiscard(v(this, Oi)); + r.oncommit(v(this, Gr)), r.ondiscard(v(this, Pi)); } else - j && (this.anchor = W), v(this, Wr).call(this); + j && (this.anchor = X), v(this, Gr).call(this); } } -bt = new WeakMap(), Lt = new WeakMap(), st = new WeakMap(), zn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Oi = new WeakMap(); -function nf(e) { - lt === null && ou(), Is(() => { - const t = Wi(e); +xt = new WeakMap(), It = new WeakMap(), tt = new WeakMap(), zn = new WeakMap(), Ur = new WeakMap(), Gr = new WeakMap(), Pi = new WeakMap(); +function sf(e) { + it === null && uu(), Is(() => { + const t = Bi(e); if (typeof t == "function") return ( /** @type {() => void} */ t ); }); } -function er(e, t, n = !1) { - j && Vi(); - var r = new tf(e), i = n ? hr : 0; +function tr(e, t, n = !1) { + j && Li(); + var r = new rf(e), i = n ? dr : 0; function s(a, o) { if (j) { - const f = eo(e); + const f = to(e); var l; - if (f === Ns ? l = 0 : f === Fi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = Ei(); - Ve(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); + if (f === Ns ? l = 0 : f === Di ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = $i(); + Ie(u), r.anchor = u, an(!1), r.ensure(a, o), an(!0); return; } } @@ -2219,22 +2219,22 @@ function er(e, t, n = !1) { }), a || s(!1, null); }, i); } -function pi(e, t) { +function hi(e, t) { return t; } -function rf(e, t, n) { +function af(e, t, n) { for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { - let p = t[o]; + let d = t[o]; Yn( - p, + d, () => { if (s) { - if (s.pending.delete(p), s.done.add(p), s.pending.size === 0) { + if (s.pending.delete(d), s.done.add(d), s.pending.size === 0) { var h = ( /** @type {Set} */ e.outrogroups ); - ws(Ii(s.done)), h.delete(s), h.size === 0 && (e.outrogroups = null); + ws(Oi(s.done)), h.delete(s), h.size === 0 && (e.outrogroups = null); } } else a -= 1; @@ -2252,7 +2252,7 @@ function rf(e, t, n) { /** @type {Element} */ u.parentNode ); - Eo(f), f.append(u), e.items.clear(); + To(f), f.append(u), e.items.clear(); } ws(t, !l); } else @@ -2263,176 +2263,176 @@ function rf(e, t, n) { } function ws(e, t = !0) { for (var n = 0; n < e.length; n++) - ze(e[n], t); + Le(e[n], t); } -var _a; -function vi(e, t, n, r, i, s = null) { - var a = e, o = /* @__PURE__ */ new Map(), l = (t & Xa) !== 0; +var ma; +function di(e, t, n, r, i, s = null) { + var a = e, o = /* @__PURE__ */ new Map(), l = (t & Wa) !== 0; if (l) { var u = ( /** @type {Element} */ e ); - a = j ? Ve(/* @__PURE__ */ fn(u)) : u.appendChild(ot()); - } - j && Vi(); - var f = null, p = /* @__PURE__ */ go(() => { - var $ = n(); - return Ua($) ? $ : $ == null ? [] : Ii($); - }), h, d = !0; - function y() { - m.fallback = f, sf(m, h, a, t, r), f !== null && (h.length === 0 ? (f.f & an) === 0 ? zs(f) : (f.f ^= an, Sr(f, null, a)) : Yn(f, () => { + a = j ? Ie(/* @__PURE__ */ un(u)) : u.appendChild(rt()); + } + j && Li(); + var f = null, d = /* @__PURE__ */ _o(() => { + var b = n(); + return Ga(b) ? b : b == null ? [] : Oi(b); + }), h, p = !0; + function _() { + y.fallback = f, of(y, h, a, t, r), f !== null && (h.length === 0 ? (f.f & sn) === 0 ? zs(f) : (f.f ^= sn, kr(f, null, a)) : Yn(f, () => { f = null; })); } - var b = qs(() => { + var x = qs(() => { h = /** @type {V[]} */ - x(p); - var $ = h.length; - let D = !1; + $(d); + var b = h.length; + let O = !1; if (j) { - var M = eo(a) === Fi; - M !== ($ === 0) && (a = Ei(), Ve(a), on(!1), D = !0); + var N = to(a) === Di; + N !== (b === 0) && (a = $i(), Ie(a), an(!1), O = !0); } - for (var S = /* @__PURE__ */ new Set(), I = ( + for (var M = /* @__PURE__ */ new Set(), F = ( /** @type {Batch} */ K - ), L = To(), U = 0; U < $; U += 1) { - j && W.nodeType === wr && /** @type {Comment} */ - W.data === ks && (a = /** @type {Comment} */ - W, D = !0, on(!1)); - var ae = h[U], Q = r(ae, U), G = d ? null : o.get(Q); - G ? (G.v && vr(G.v, ae), G.i && vr(G.i, U), L && I.unskip_effect(G.e)) : (G = af( + ), W = Ro(), I = 0; I < b; I += 1) { + j && X.nodeType === xr && /** @type {Comment} */ + X.data === ks && (a = /** @type {Comment} */ + X, O = !0, an(!1)); + var ee = h[I], fe = r(ee, I), U = p ? null : o.get(fe); + U ? (U.v && gr(U.v, ee), U.i && gr(U.i, I), W && F.unskip_effect(U.e)) : (U = lf( o, - d ? a : _a ?? (_a = ot()), - ae, - Q, - U, + p ? a : ma ?? (ma = rt()), + ee, + fe, + I, i, t, n - ), d || (G.e.f |= an), o.set(Q, G)), S.add(Q); + ), p || (U.e.f |= sn), o.set(fe, U)), M.add(fe); } - if ($ === 0 && s && !f && (d ? f = vt(() => s(a)) : (f = vt(() => s(_a ?? (_a = ot()))), f.f |= an)), $ > S.size && uu(), j && $ > 0 && Ve(Ei()), !d) - if (L) { - for (const [oe, ue] of o) - S.has(oe) || I.skip_effect(ue.e); - I.oncommit(y), I.ondiscard(() => { + if (b === 0 && s && !f && (p ? f = ct(() => s(a)) : (f = ct(() => s(ma ?? (ma = rt()))), f.f |= sn)), b > M.size && cu(), j && b > 0 && Ie($i()), !p) + if (W) { + for (const [re, le] of o) + M.has(re) || F.skip_effect(le.e); + F.oncommit(_), F.ondiscard(() => { }); } else - y(); - D && on(!0), x(p); - }), m = { effect: b, items: o, outrogroups: null, fallback: f }; - d = !1, j && (a = W); + _(); + O && an(!0), $(d); + }), y = { effect: x, items: o, outrogroups: null, fallback: f }; + p = !1, j && (a = X); } function Cr(e) { - for (; e !== null && (e.f & Ct) === 0; ) + for (; e !== null && (e.f & Tt) === 0; ) e = e.next; return e; } -function sf(e, t, n, r, i) { - var G, oe, ue, O, F, Ne, ft, me, ye; - var s = (r & Yl) !== 0, a = t.length, o = e.items, l = Cr(e.effect.first), u, f = null, p, h = [], d = [], y, b, m, $; +function of(e, t, n, r, i) { + var U, re, le, D, H, te, je, qe, de; + var s = (r & Xl) !== 0, a = t.length, o = e.items, l = Cr(e.effect.first), u, f = null, d, h = [], p = [], _, x, y, b; if (s) - for ($ = 0; $ < a; $ += 1) - y = t[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, (m.f & an) === 0 && ((oe = (G = m.nodes) == null ? void 0 : G.a) == null || oe.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); - for ($ = 0; $ < a; $ += 1) { - if (y = t[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, e.outrogroups !== null) - for (const te of e.outrogroups) - te.pending.delete(m), te.done.delete(m); - if ((m.f & an) !== 0) - if (m.f ^= an, m === l) - Sr(m, null, n); + for (b = 0; b < a; b += 1) + _ = t[b], x = i(_, b), y = /** @type {EachItem} */ + o.get(x).e, (y.f & sn) === 0 && ((re = (U = y.nodes) == null ? void 0 : U.a) == null || re.measure(), (d ?? (d = /* @__PURE__ */ new Set())).add(y)); + for (b = 0; b < a; b += 1) { + if (_ = t[b], x = i(_, b), y = /** @type {EachItem} */ + o.get(x).e, e.outrogroups !== null) + for (const ce of e.outrogroups) + ce.pending.delete(y), ce.done.delete(y); + if ((y.f & sn) !== 0) + if (y.f ^= sn, y === l) + kr(y, null, n); else { - var D = f ? f.next : l; - m === e.effect.last && (e.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), gn(e, f, m), gn(e, m, D), Sr(m, D, n), f = m, h = [], d = [], l = Cr(f.next); + var O = f ? f.next : l; + y === e.effect.last && (e.effect.last = y.prev), y.prev && (y.prev.next = y.next), y.next && (y.next.prev = y.prev), vn(e, f, y), vn(e, y, O), kr(y, O, n), f = y, h = [], p = [], l = Cr(f.next); continue; } - if ((m.f & at) !== 0 && (zs(m), s && ((O = (ue = m.nodes) == null ? void 0 : ue.a) == null || O.unfix(), (p ?? (p = /* @__PURE__ */ new Set())).delete(m))), m !== l) { - if (u !== void 0 && u.has(m)) { - if (h.length < d.length) { - var M = d[0], S; - f = M.prev; - var I = h[0], L = h[h.length - 1]; - for (S = 0; S < h.length; S += 1) - Sr(h[S], M, n); - for (S = 0; S < d.length; S += 1) - u.delete(d[S]); - gn(e, I.prev, L.next), gn(e, f, I), gn(e, L, M), l = M, f = L, $ -= 1, h = [], d = []; + if ((y.f & nt) !== 0 && (zs(y), s && ((D = (le = y.nodes) == null ? void 0 : le.a) == null || D.unfix(), (d ?? (d = /* @__PURE__ */ new Set())).delete(y))), y !== l) { + if (u !== void 0 && u.has(y)) { + if (h.length < p.length) { + var N = p[0], M; + f = N.prev; + var F = h[0], W = h[h.length - 1]; + for (M = 0; M < h.length; M += 1) + kr(h[M], N, n); + for (M = 0; M < p.length; M += 1) + u.delete(p[M]); + vn(e, F.prev, W.next), vn(e, f, F), vn(e, W, N), l = N, f = W, b -= 1, h = [], p = []; } else - u.delete(m), Sr(m, l, n), gn(e, m.prev, m.next), gn(e, m, f === null ? e.effect.first : f.next), gn(e, f, m), f = m; + u.delete(y), kr(y, l, n), vn(e, y.prev, y.next), vn(e, y, f === null ? e.effect.first : f.next), vn(e, f, y), f = y; continue; } - for (h = [], d = []; l !== null && l !== m; ) - (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Cr(l.next); + for (h = [], p = []; l !== null && l !== y; ) + (u ?? (u = /* @__PURE__ */ new Set())).add(l), p.push(l), l = Cr(l.next); if (l === null) continue; } - (m.f & an) === 0 && h.push(m), f = m, l = Cr(m.next); + (y.f & sn) === 0 && h.push(y), f = y, l = Cr(y.next); } if (e.outrogroups !== null) { - for (const te of e.outrogroups) - te.pending.size === 0 && (ws(Ii(te.done)), (F = e.outrogroups) == null || F.delete(te)); + for (const ce of e.outrogroups) + ce.pending.size === 0 && (ws(Oi(ce.done)), (H = e.outrogroups) == null || H.delete(ce)); e.outrogroups.size === 0 && (e.outrogroups = null); } if (l !== null || u !== void 0) { - var U = []; + var I = []; if (u !== void 0) - for (m of u) - (m.f & at) === 0 && U.push(m); + for (y of u) + (y.f & nt) === 0 && I.push(y); for (; l !== null; ) - (l.f & at) === 0 && l !== e.fallback && U.push(l), l = Cr(l.next); - var ae = U.length; - if (ae > 0) { - var Q = (r & Xa) !== 0 && a === 0 ? n : null; + (l.f & nt) === 0 && l !== e.fallback && I.push(l), l = Cr(l.next); + var ee = I.length; + if (ee > 0) { + var fe = (r & Wa) !== 0 && a === 0 ? n : null; if (s) { - for ($ = 0; $ < ae; $ += 1) - (ft = (Ne = U[$].nodes) == null ? void 0 : Ne.a) == null || ft.measure(); - for ($ = 0; $ < ae; $ += 1) - (ye = (me = U[$].nodes) == null ? void 0 : me.a) == null || ye.fix(); + for (b = 0; b < ee; b += 1) + (je = (te = I[b].nodes) == null ? void 0 : te.a) == null || je.measure(); + for (b = 0; b < ee; b += 1) + (de = (qe = I[b].nodes) == null ? void 0 : qe.a) == null || de.fix(); } - rf(e, U, Q); + af(e, I, fe); } } - s && xn(() => { - var te, ke; - if (p !== void 0) - for (m of p) - (ke = (te = m.nodes) == null ? void 0 : te.a) == null || ke.apply(); + s && wn(() => { + var ce, _e; + if (d !== void 0) + for (y of d) + (_e = (ce = y.nodes) == null ? void 0 : ce.a) == null || _e.apply(); }); } -function af(e, t, n, r, i, s, a, o) { - var l = (a & zl) !== 0 ? (a & Bl) === 0 ? /* @__PURE__ */ wo(n, !1, !1) : Un(n) : null, u = (a & Hl) !== 0 ? Un(i) : null; +function lf(e, t, n, r, i, s, a, o) { + var l = (a & Yl) !== 0 ? (a & Wl) === 0 ? /* @__PURE__ */ xo(n, !1, !1) : Un(n) : null, u = (a & Bl) !== 0 ? Un(i) : null; return { v: l, i: u, - e: vt(() => (s(t, l ?? n, u ?? i, o), () => { + e: ct(() => (s(t, l ?? n, u ?? i, o), () => { e.delete(r); })) }; } -function Sr(e, t, n) { +function kr(e, t, n) { if (e.nodes) - for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & an) === 0 ? ( + for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & sn) === 0 ? ( /** @type {EffectNodes} */ t.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Yt(r) + /* @__PURE__ */ Ht(r) ); if (s.before(r), r === i) return; r = a; } } -function gn(e, t, n) { +function vn(e, t, n) { t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; } function Hs(e, t) { - So(() => { + No(() => { var n = e.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2450,9 +2450,9 @@ function Hs(e, t) { } }); } -const ma = [...` +const ya = [...` \r\f \v\uFEFF`]; -function of(e, t, n) { +function uf(e, t, n) { var r = e == null ? "" : "" + e; if (n) { for (var i in n) @@ -2461,12 +2461,12 @@ function of(e, t, n) { else if (r.length) for (var s = i.length, a = 0; (a = r.indexOf(i, a)) >= 0; ) { var o = a + s; - (a === 0 || ma.includes(r[a - 1])) && (o === r.length || ma.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; + (a === 0 || ya.includes(r[a - 1])) && (o === r.length || ya.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; } } return r === "" ? null : r; } -function ya(e, t = !1) { +function wa(e, t = !1) { var n = t ? " !important;" : ";", r = ""; for (var i in e) { var s = e[i]; @@ -2474,17 +2474,17 @@ function ya(e, t = !1) { } return r; } -function lf(e, t) { +function ff(e, t) { if (t) { var n = "", r, i; - return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += ya(r)), i && (n += ya(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += wa(r)), i && (n += wa(i, !0)), n = n.trim(), n === "" ? null : n; } return String(e); } -function si(e, t, n, r, i, s) { +function ri(e, t, n, r, i, s) { var a = e.__className; if (j || a !== n || a === void 0) { - var o = of(n, r, s); + var o = uf(n, r, s); (!j || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n; } else if (s && i !== s) for (var l in s) { @@ -2499,74 +2499,74 @@ function ns(e, t = {}, n, r) { t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); } } -function wa(e, t, n, r) { +function xa(e, t, n, r) { var i = e.__style; if (j || i !== t) { - var s = lf(t, r); + var s = ff(t, r); (!j || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; } else r && (Array.isArray(r) ? (ns(e, n == null ? void 0 : n[0], r[0]), ns(e, n == null ? void 0 : n[1], r[1], "important")) : ns(e, n, r)); return r; } -const uf = Symbol("is custom element"), ff = Symbol("is html"), cf = au ? "link" : "LINK"; -function xa(e, t, n, r) { - var i = hf(e); - j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === cf) || i[t] !== (i[t] = n) && (t === "loading" && (e[su] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && df(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); +const cf = Symbol("is custom element"), hf = Symbol("is html"), df = lu ? "link" : "LINK"; +function ba(e, t, n, r) { + var i = pf(e); + j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === df) || i[t] !== (i[t] = n) && (t === "loading" && (e[ou] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && vf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); } -function hf(e) { +function pf(e) { return ( /** @type {Record} **/ // @ts-expect-error e.__attributes ?? (e.__attributes = { - [uf]: e.nodeName.includes("-"), - [ff]: e.namespaceURI === Wa + [cf]: e.nodeName.includes("-"), + [hf]: e.namespaceURI === Ua }) ); } -var ba = /* @__PURE__ */ new Map(); -function df(e) { - var t = e.getAttribute("is") || e.nodeName, n = ba.get(t); +var $a = /* @__PURE__ */ new Map(); +function vf(e) { + var t = e.getAttribute("is") || e.nodeName, n = $a.get(t); if (n) return n; - ba.set(t, n = []); + $a.set(t, n = []); for (var r, i = e, s = Element.prototype; s !== i; ) { - r = Zl(i); + r = eu(i); for (var a in r) r[a].set && n.push(a); - i = Ga(i); + i = Ka(i); } return n; } -function $a(e, t) { - return e === t || (e == null ? void 0 : e[Pr]) === t; +function Aa(e, t) { + return e === t || (e == null ? void 0 : e[Or]) === t; } -function gi(e = {}, t, n, r) { - return So(() => { +function pi(e = {}, t, n, r) { + return No(() => { var i, s; return Ls(() => { - i = s, s = [], Wi(() => { - e !== n(...s) && (t(e, ...s), i && $a(n(...i), e) && t(null, ...i)); + i = s, s = [], Bi(() => { + e !== n(...s) && (t(e, ...s), i && Aa(n(...i), e) && t(null, ...i)); }); }), () => { - xn(() => { - s && $a(n(...s), e) && t(null, ...s); + wn(() => { + s && Aa(n(...s), e) && t(null, ...s); }); }; }), e; } -let ai = !1; -function pf(e) { - var t = ai; +let ii = !1; +function gf(e) { + var t = ii; try { - return ai = !1, [e(), ai]; + return ii = !1, [e(), ii]; } finally { - ai = t; + ii = t; } } -function se(e, t, n, r) { - var D; - var i = (n & Ul) !== 0, s = (n & Gl) !== 0, a = ( +function ie(e, t, n, r) { + var O; + var i = (n & Kl) !== 0, s = (n & jl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Wi( + ), o = !0, l = () => (o && (o = !1, a = s ? Bi( /** @type {() => V} */ r ) : ( @@ -2574,55 +2574,55 @@ function se(e, t, n, r) { r )), a), u; if (i) { - var f = Pr in e || Qa in e; - u = ((D = Hn(e, t)) == null ? void 0 : D.set) ?? (f && t in e ? (M) => e[t] = M : void 0); + var f = Or in e || eo in e; + u = ((O = Hn(e, t)) == null ? void 0 : O.set) ?? (f && t in e ? (N) => e[t] = N : void 0); } - var p, h = !1; - i ? [p, h] = pf(() => ( + var d, h = !1; + i ? [d, h] = gf(() => ( /** @type {V} */ e[t] - )) : p = /** @type {V} */ - e[t], p === void 0 && r !== void 0 && (p = l(), u && (vu(), u(p))); - var d; - if (d = () => { - var M = ( + )) : d = /** @type {V} */ + e[t], d === void 0 && r !== void 0 && (d = l(), u && (_u(), u(d))); + var p; + if (p = () => { + var N = ( /** @type {V} */ e[t] ); - return M === void 0 ? l() : (o = !0, M); - }, (n & Wl) === 0) - return d; + return N === void 0 ? l() : (o = !0, N); + }, (n & Gl) === 0) + return p; if (u) { - var y = e.$$legacy; + var _ = e.$$legacy; return ( /** @type {() => V} */ - (function(M, S) { - return arguments.length > 0 ? ((!S || y || h) && u(S ? d() : M), M) : d(); + (function(N, M) { + return arguments.length > 0 ? ((!M || _ || h) && u(M ? p() : N), N) : p(); }) ); } - var b = !1, m = ((n & Xl) !== 0 ? Bi : go)(() => (b = !1, d())); - i && x(m); - var $ = ( + var x = !1, y = ((n & Ul) !== 0 ? Hi : _o)(() => (x = !1, p())); + i && $(y); + var b = ( /** @type {Effect} */ J ); return ( /** @type {() => V} */ - (function(M, S) { + (function(N, M) { if (arguments.length > 0) { - const I = S ? x(m) : i ? Pn(M) : M; - return he(m, I), b = !0, a !== void 0 && (a = I), M; + const F = M ? $(y) : i ? Pn(N) : N; + return ve(y, F), x = !0, a !== void 0 && (a = F), N; } - return An && b || ($.f & ln) !== 0 ? m.v : x(m); + return $n && x || (b.f & on) !== 0 ? y.v : $(y); }) ); } -function vf(e) { - return new gf(e); +function _f(e) { + return new mf(e); } -var sn, pt; -class gf { +var rn, ft; +class mf { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2630,57 +2630,57 @@ class gf { */ constructor(t) { /** @type {any} */ - H(this, sn); + z(this, rn); /** @type {Record} */ - H(this, pt); + z(this, ft); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ wo(o, !1, !1); + var l = /* @__PURE__ */ xo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( { ...t.props || {}, $$events: {} }, { get(a, o) { - return x(n.get(o) ?? r(o, Reflect.get(a, o))); + return $(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Qa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === eo ? !0 : ($(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return he(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return ve(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - V(this, pt, (t.hydrate ? Qu : Bo)(t.component, { + q(this, ft, (t.hydrate ? tf : Xo)(t.component, { target: t.target, anchor: t.anchor, props: i, context: t.context, intro: t.intro ?? !1, recover: t.recover - })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && re(), V(this, sn, i.$$events); - for (const a of Object.keys(v(this, pt))) - a === "$set" || a === "$destroy" || a === "$on" || Ai(this, a, { + })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && ne(), q(this, rn, i.$$events); + for (const a of Object.keys(v(this, ft))) + a === "$set" || a === "$destroy" || a === "$on" || bi(this, a, { get() { - return v(this, pt)[a]; + return v(this, ft)[a]; }, /** @param {any} value */ set(o) { - v(this, pt)[a] = o; + v(this, ft)[a] = o; }, enumerable: !0 }); - v(this, pt).$set = /** @param {Record} next */ + v(this, ft).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, pt).$destroy = () => { - ef(v(this, pt)); + }, v(this, ft).$destroy = () => { + nf(v(this, ft)); }; } /** @param {Record} props */ $set(t) { - v(this, pt).$set(t); + v(this, ft).$set(t); } /** * @param {string} event @@ -2688,22 +2688,22 @@ class gf { * @returns {any} */ $on(t, n) { - v(this, sn)[t] = v(this, sn)[t] || []; + v(this, rn)[t] = v(this, rn)[t] || []; const r = (...i) => n.call(this, ...i); - return v(this, sn)[t].push(r), () => { - v(this, sn)[t] = v(this, sn)[t].filter( + return v(this, rn)[t].push(r), () => { + v(this, rn)[t] = v(this, rn)[t].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, pt).$destroy(); + v(this, ft).$destroy(); } } -sn = new WeakMap(), pt = new WeakMap(); -let Wo; -typeof HTMLElement == "function" && (Wo = class extends HTMLElement { +rn = new WeakMap(), ft = new WeakMap(); +let Uo; +typeof HTMLElement == "function" && (Uo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2712,27 +2712,27 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { constructor(t, n, r) { super(); /** The Svelte component constructor */ - ce(this, "$$ctor"); + pe(this, "$$ctor"); /** Slots */ - ce(this, "$$s"); + pe(this, "$$s"); /** @type {any} The Svelte component instance */ - ce(this, "$$c"); + pe(this, "$$c"); /** Whether or not the custom element is connected */ - ce(this, "$$cn", !1); + pe(this, "$$cn", !1); /** @type {Record} Component props data */ - ce(this, "$$d", {}); + pe(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - ce(this, "$$r", !1); + pe(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - ce(this, "$$p_d", {}); + pe(this, "$$p_d", {}); /** @type {Record} Event listeners */ - ce(this, "$$l", {}); + pe(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - ce(this, "$$l_u", /* @__PURE__ */ new Map()); + pe(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - ce(this, "$$me"); + pe(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - ce(this, "$$shadowRoot", null); + pe(this, "$$shadowRoot", null); this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2763,22 +2763,22 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { let n = function(s) { return (a) => { const o = Os("slot"); - s !== "default" && (o.name = s), Ue(a, o); + s !== "default" && (o.name = s), We(a, o); }; }; var t = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = _f(this); + const r = {}, i = yf(this); for (const s of this.$$s) s in i && (s === "default" && !this.$$d.children ? (this.$$d.children = n(s), r.default = !0) : r[s] = n(s)); for (const s of this.attributes) { const a = this.$$g_p(s.name); - a in this.$$d || (this.$$d[a] = _i(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = vi(a, s.value, this.$$p_d, "toProp")); } for (const s in this.$$p_d) !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]); - this.$$c = vf({ + this.$$c = _f({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2786,14 +2786,14 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = Vu(() => { + }), this.$$me = Hu(() => { Ls(() => { var s; this.$$r = !0; - for (const a of $i(this.$$c)) { + for (const a of xi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = _i( + const o = vi( a, this.$$d[a], this.$$p_d, @@ -2821,7 +2821,7 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { */ attributeChangedCallback(t, n, r) { var i; - this.$$r || (t = this.$$g_p(t), this.$$d[t] = _i(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); + this.$$r || (t = this.$$g_p(t), this.$$d[t] = vi(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2832,12 +2832,12 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(t) { - return $i(this.$$p_d).find( + return xi(this.$$p_d).find( (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t ) || t; } }); -function _i(e, t, n, r) { +function vi(e, t, n, r) { var s; const i = (s = n[e]) == null ? void 0 : s.type; if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) @@ -2868,7 +2868,7 @@ function _i(e, t, n, r) { return t; } } -function _f(e) { +function yf(e) { const t = {}; return e.childNodes.forEach((n) => { t[ @@ -2878,33 +2878,33 @@ function _f(e) { }), t; } function Ys(e, t, n, r, i, s) { - let a = class extends Wo { + let a = class extends Uo { constructor() { super(e, n, i), this.$$p_d = t; } static get observedAttributes() { - return $i(t).map( + return xi(t).map( (o) => (t[o].attribute || o).toLowerCase() ); } }; - return $i(t).forEach((o) => { - Ai(a.prototype, o, { + return xi(t).forEach((o) => { + bi(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { - var p; - l = _i(o, l, t), this.$$d[o] = l; + var d; + l = vi(o, l, t), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (p = Hn(u, o)) == null ? void 0 : p.get; + var f = (d = Hn(u, o)) == null ? void 0 : d.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - Ai(a.prototype, o, { + bi(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2913,43 +2913,43 @@ function Ys(e, t, n, r, i, s) { }), e.element = /** @type {any} */ a, a; } -var mf = { value: () => { +var wf = { value: () => { } }; -function Uo() { +function Go() { for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) { if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new mi(n); + return new gi(n); } -function mi(e) { +function gi(e) { this._ = e; } -function yf(e, t) { +function xf(e, t) { return e.trim().split(/^|\s+/).map(function(n) { var r = "", i = n.indexOf("."); if (i >= 0 && (r = n.slice(i + 1), n = n.slice(0, i)), n && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -mi.prototype = Uo.prototype = { - constructor: mi, +gi.prototype = Go.prototype = { + constructor: gi, on: function(e, t) { - var n = this._, r = yf(e + "", n), i, s = -1, a = r.length; + var n = this._, r = xf(e + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = wf(n[i], e.name))) return i; + for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = bf(n[i], e.name))) return i; return; } if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); for (; ++s < a; ) - if (i = (e = r[s]).type) n[i] = Aa(n[i], e.name, t); - else if (t == null) for (i in n) n[i] = Aa(n[i], e.name, null); + if (i = (e = r[s]).type) n[i] = Ea(n[i], e.name, t); + else if (t == null) for (i in n) n[i] = Ea(n[i], e.name, null); return this; }, copy: function() { var e = {}, t = this._; for (var n in t) e[n] = t[n].slice(); - return new mi(e); + return new gi(e); }, call: function(e, t) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2961,135 +2961,135 @@ mi.prototype = Uo.prototype = { for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); } }; -function wf(e, t) { +function bf(e, t) { for (var n = 0, r = e.length, i; n < r; ++n) if ((i = e[n]).name === t) return i.value; } -function Aa(e, t, n) { +function Ea(e, t, n) { for (var r = 0, i = e.length; r < i; ++r) if (e[r].name === t) { - e[r] = mf, e = e.slice(0, r).concat(e.slice(r + 1)); + e[r] = wf, e = e.slice(0, r).concat(e.slice(r + 1)); break; } return n != null && e.push({ name: t, value: n }), e; } var xs = "http://www.w3.org/1999/xhtml"; -const Ea = { +const Ta = { svg: "http://www.w3.org/2000/svg", xhtml: xs, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Ui(e) { +function Xi(e) { var t = e += "", n = t.indexOf(":"); - return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Ea.hasOwnProperty(t) ? { space: Ea[t], local: e } : e; + return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Ta.hasOwnProperty(t) ? { space: Ta[t], local: e } : e; } -function xf(e) { +function $f(e) { return function() { var t = this.ownerDocument, n = this.namespaceURI; return n === xs && t.documentElement.namespaceURI === xs ? t.createElement(e) : t.createElementNS(n, e); }; } -function bf(e) { +function Af(e) { return function() { return this.ownerDocument.createElementNS(e.space, e.local); }; } -function Go(e) { - var t = Ui(e); - return (t.local ? bf : xf)(t); +function Ko(e) { + var t = Xi(e); + return (t.local ? Af : $f)(t); } -function $f() { +function Ef() { } function Bs(e) { - return e == null ? $f : function() { + return e == null ? Ef : function() { return this.querySelector(e); }; } -function Af(e) { +function Tf(e) { typeof e != "function" && (e = Bs(e)); for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) for (var s = t[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = e.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new ut(r, this._parents); + return new st(r, this._parents); } -function Ef(e) { +function Rf(e) { return e == null ? [] : Array.isArray(e) ? e : Array.from(e); } -function Tf() { +function Sf() { return []; } -function Ko(e) { - return e == null ? Tf : function() { +function jo(e) { + return e == null ? Sf : function() { return this.querySelectorAll(e); }; } function Cf(e) { return function() { - return Ef(e.apply(this, arguments)); + return Rf(e.apply(this, arguments)); }; } -function Rf(e) { - typeof e == "function" ? e = Cf(e) : e = Ko(e); +function Nf(e) { + typeof e == "function" ? e = Cf(e) : e = jo(e); for (var t = this._groups, n = t.length, r = [], i = [], s = 0; s < n; ++s) for (var a = t[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(e.call(l, l.__data__, u, a)), i.push(l)); - return new ut(r, i); + return new st(r, i); } -function jo(e) { +function Jo(e) { return function() { return this.matches(e); }; } -function Jo(e) { +function Zo(e) { return function(t) { return t.matches(e); }; } -var Sf = Array.prototype.find; -function Nf(e) { +var kf = Array.prototype.find; +function Mf(e) { return function() { - return Sf.call(this.children, e); + return kf.call(this.children, e); }; } -function kf() { +function Pf() { return this.firstElementChild; } -function Mf(e) { - return this.select(e == null ? kf : Nf(typeof e == "function" ? e : Jo(e))); +function Df(e) { + return this.select(e == null ? Pf : Mf(typeof e == "function" ? e : Zo(e))); } -var Pf = Array.prototype.filter; -function Df() { +var Of = Array.prototype.filter; +function Ff() { return Array.from(this.children); } -function Of(e) { +function If(e) { return function() { - return Pf.call(this.children, e); + return Of.call(this.children, e); }; } -function Ff(e) { - return this.selectAll(e == null ? Df : Of(typeof e == "function" ? e : Jo(e))); +function Lf(e) { + return this.selectAll(e == null ? Ff : If(typeof e == "function" ? e : Zo(e))); } -function If(e) { - typeof e != "function" && (e = jo(e)); +function qf(e) { + typeof e != "function" && (e = Jo(e)); for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); - return new ut(r, this._parents); + return new st(r, this._parents); } -function Zo(e) { +function Qo(e) { return new Array(e.length); } -function Lf() { - return new ut(this._enter || this._groups.map(Zo), this._parents); +function Vf() { + return new st(this._enter || this._groups.map(Qo), this._parents); } -function Ti(e, t) { +function Ai(e, t) { this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; } -Ti.prototype = { - constructor: Ti, +Ai.prototype = { + constructor: Ai, appendChild: function(e) { return this._parent.insertBefore(e, this._next); }, @@ -3103,91 +3103,91 @@ Ti.prototype = { return this._parent.querySelectorAll(e); } }; -function qf(e) { +function zf(e) { return function() { return e; }; } -function Vf(e, t, n, r, i, s) { +function Hf(e, t, n, r, i, s) { for (var a = 0, o, l = t.length, u = s.length; a < u; ++a) - (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ti(e, s[a]); + (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ai(e, s[a]); for (; a < l; ++a) (o = t[a]) && (i[a] = o); } -function zf(e, t, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = t.length, p = s.length, h = new Array(f), d; +function Yf(e, t, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = t.length, d = s.length, h = new Array(f), p; for (o = 0; o < f; ++o) - (l = t[o]) && (h[o] = d = a.call(l, l.__data__, o, t) + "", u.has(d) ? i[o] = l : u.set(d, l)); - for (o = 0; o < p; ++o) - d = a.call(e, s[o], o, s) + "", (l = u.get(d)) ? (r[o] = l, l.__data__ = s[o], u.delete(d)) : n[o] = new Ti(e, s[o]); + (l = t[o]) && (h[o] = p = a.call(l, l.__data__, o, t) + "", u.has(p) ? i[o] = l : u.set(p, l)); + for (o = 0; o < d; ++o) + p = a.call(e, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new Ai(e, s[o]); for (o = 0; o < f; ++o) (l = t[o]) && u.get(h[o]) === l && (i[o] = l); } -function Hf(e) { +function Bf(e) { return e.__data__; } -function Yf(e, t) { - if (!arguments.length) return Array.from(this, Hf); - var n = t ? zf : Vf, r = this._parents, i = this._groups; - typeof e != "function" && (e = qf(e)); +function Xf(e, t) { + if (!arguments.length) return Array.from(this, Bf); + var n = t ? Yf : Hf, r = this._parents, i = this._groups; + typeof e != "function" && (e = zf(e)); for (var s = i.length, a = new Array(s), o = new Array(s), l = new Array(s), u = 0; u < s; ++u) { - var f = r[u], p = i[u], h = p.length, d = Bf(e.call(f, f && f.__data__, u, r)), y = d.length, b = o[u] = new Array(y), m = a[u] = new Array(y), $ = l[u] = new Array(h); - n(f, p, b, m, $, d, t); - for (var D = 0, M = 0, S, I; D < y; ++D) - if (S = b[D]) { - for (D >= M && (M = D + 1); !(I = m[M]) && ++M < y; ) ; - S._next = I || null; + var f = r[u], d = i[u], h = d.length, p = Wf(e.call(f, f && f.__data__, u, r)), _ = p.length, x = o[u] = new Array(_), y = a[u] = new Array(_), b = l[u] = new Array(h); + n(f, d, x, y, b, p, t); + for (var O = 0, N = 0, M, F; O < _; ++O) + if (M = x[O]) { + for (O >= N && (N = O + 1); !(F = y[N]) && ++N < _; ) ; + M._next = F || null; } } - return a = new ut(a, r), a._enter = o, a._exit = l, a; + return a = new st(a, r), a._enter = o, a._exit = l, a; } -function Bf(e) { +function Wf(e) { return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Xf() { - return new ut(this._exit || this._groups.map(Zo), this._parents); +function Uf() { + return new st(this._exit || this._groups.map(Qo), this._parents); } -function Wf(e, t, n) { +function Gf(e, t, n) { var r = this.enter(), i = this, s = this.exit(); return typeof e == "function" ? (r = e(r), r && (r = r.selection())) : r = r.append(e + ""), t != null && (i = t(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function Uf(e) { +function Kf(e) { for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) - for (var u = n[l], f = r[l], p = u.length, h = o[l] = new Array(p), d, y = 0; y < p; ++y) - (d = u[y] || f[y]) && (h[y] = d); + for (var u = n[l], f = r[l], d = u.length, h = o[l] = new Array(d), p, _ = 0; _ < d; ++_) + (p = u[_] || f[_]) && (h[_] = p); for (; l < i; ++l) o[l] = n[l]; - return new ut(o, this._parents); + return new st(o, this._parents); } -function Gf() { +function jf() { for (var e = this._groups, t = -1, n = e.length; ++t < n; ) for (var r = e[t], i = r.length - 1, s = r[i], a; --i >= 0; ) (a = r[i]) && (s && a.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(a, s), s = a); return this; } -function Kf(e) { - e || (e = jf); - function t(p, h) { - return p && h ? e(p.__data__, h.__data__) : !p - !h; +function Jf(e) { + e || (e = Zf); + function t(d, h) { + return d && h ? e(d.__data__, h.__data__) : !d - !h; } for (var n = this._groups, r = n.length, i = new Array(r), s = 0; s < r; ++s) { for (var a = n[s], o = a.length, l = i[s] = new Array(o), u, f = 0; f < o; ++f) (u = a[f]) && (l[f] = u); l.sort(t); } - return new ut(i, this._parents).order(); + return new st(i, this._parents).order(); } -function jf(e, t) { +function Zf(e, t) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Jf() { +function Qf() { var e = arguments[0]; return arguments[0] = this, e.apply(null, arguments), this; } -function Zf() { +function ec() { return Array.from(this); } -function Qf() { +function tc() { for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, s = r.length; i < s; ++i) { var a = r[i]; @@ -3195,114 +3195,114 @@ function Qf() { } return null; } -function ec() { +function nc() { let e = 0; for (const t of this) ++e; return e; } -function tc() { +function rc() { return !this.node(); } -function nc(e) { +function ic(e) { for (var t = this._groups, n = 0, r = t.length; n < r; ++n) for (var i = t[n], s = 0, a = i.length, o; s < a; ++s) (o = i[s]) && e.call(o, o.__data__, s, i); return this; } -function rc(e) { +function sc(e) { return function() { this.removeAttribute(e); }; } -function ic(e) { +function ac(e) { return function() { this.removeAttributeNS(e.space, e.local); }; } -function sc(e, t) { +function oc(e, t) { return function() { this.setAttribute(e, t); }; } -function ac(e, t) { +function lc(e, t) { return function() { this.setAttributeNS(e.space, e.local, t); }; } -function oc(e, t) { +function uc(e, t) { return function() { var n = t.apply(this, arguments); n == null ? this.removeAttribute(e) : this.setAttribute(e, n); }; } -function lc(e, t) { +function fc(e, t) { return function() { var n = t.apply(this, arguments); n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); }; } -function uc(e, t) { - var n = Ui(e); +function cc(e, t) { + var n = Xi(e); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((t == null ? n.local ? ic : rc : typeof t == "function" ? n.local ? lc : oc : n.local ? ac : sc)(n, t)); + return this.each((t == null ? n.local ? ac : sc : typeof t == "function" ? n.local ? fc : uc : n.local ? lc : oc)(n, t)); } -function Qo(e) { +function el(e) { return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; } -function fc(e) { +function hc(e) { return function() { this.style.removeProperty(e); }; } -function cc(e, t, n) { +function dc(e, t, n) { return function() { this.style.setProperty(e, t, n); }; } -function hc(e, t, n) { +function pc(e, t, n) { return function() { var r = t.apply(this, arguments); r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); }; } -function dc(e, t, n) { - return arguments.length > 1 ? this.each((t == null ? fc : typeof t == "function" ? hc : cc)(e, t, n ?? "")) : _r(this.node(), e); +function vc(e, t, n) { + return arguments.length > 1 ? this.each((t == null ? hc : typeof t == "function" ? pc : dc)(e, t, n ?? "")) : mr(this.node(), e); } -function _r(e, t) { - return e.style.getPropertyValue(t) || Qo(e).getComputedStyle(e, null).getPropertyValue(t); +function mr(e, t) { + return e.style.getPropertyValue(t) || el(e).getComputedStyle(e, null).getPropertyValue(t); } -function pc(e) { +function gc(e) { return function() { delete this[e]; }; } -function vc(e, t) { +function _c(e, t) { return function() { this[e] = t; }; } -function gc(e, t) { +function mc(e, t) { return function() { var n = t.apply(this, arguments); n == null ? delete this[e] : this[e] = n; }; } -function _c(e, t) { - return arguments.length > 1 ? this.each((t == null ? pc : typeof t == "function" ? gc : vc)(e, t)) : this.node()[e]; +function yc(e, t) { + return arguments.length > 1 ? this.each((t == null ? gc : typeof t == "function" ? mc : _c)(e, t)) : this.node()[e]; } -function el(e) { +function tl(e) { return e.trim().split(/^|\s+/); } function Xs(e) { - return e.classList || new tl(e); + return e.classList || new nl(e); } -function tl(e) { - this._node = e, this._names = el(e.getAttribute("class") || ""); +function nl(e) { + this._node = e, this._names = tl(e.getAttribute("class") || ""); } -tl.prototype = { +nl.prototype = { add: function(e) { var t = this._names.indexOf(e); t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); @@ -3315,53 +3315,53 @@ tl.prototype = { return this._names.indexOf(e) >= 0; } }; -function nl(e, t) { +function rl(e, t) { for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); } -function rl(e, t) { +function il(e, t) { for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); } -function mc(e) { +function wc(e) { return function() { - nl(this, e); + rl(this, e); }; } -function yc(e) { +function xc(e) { return function() { - rl(this, e); + il(this, e); }; } -function wc(e, t) { +function bc(e, t) { return function() { - (t.apply(this, arguments) ? nl : rl)(this, e); + (t.apply(this, arguments) ? rl : il)(this, e); }; } -function xc(e, t) { - var n = el(e + ""); +function $c(e, t) { + var n = tl(e + ""); if (arguments.length < 2) { for (var r = Xs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof t == "function" ? wc : t ? mc : yc)(n, t)); + return this.each((typeof t == "function" ? bc : t ? wc : xc)(n, t)); } -function bc() { +function Ac() { this.textContent = ""; } -function $c(e) { +function Ec(e) { return function() { this.textContent = e; }; } -function Ac(e) { +function Tc(e) { return function() { var t = e.apply(this, arguments); this.textContent = t ?? ""; }; } -function Ec(e) { - return arguments.length ? this.each(e == null ? bc : (typeof e == "function" ? Ac : $c)(e)) : this.node().textContent; +function Rc(e) { + return arguments.length ? this.each(e == null ? Ac : (typeof e == "function" ? Tc : Ec)(e)) : this.node().textContent; } -function Tc() { +function Sc() { this.innerHTML = ""; } function Cc(e) { @@ -3369,75 +3369,75 @@ function Cc(e) { this.innerHTML = e; }; } -function Rc(e) { +function Nc(e) { return function() { var t = e.apply(this, arguments); this.innerHTML = t ?? ""; }; } -function Sc(e) { - return arguments.length ? this.each(e == null ? Tc : (typeof e == "function" ? Rc : Cc)(e)) : this.node().innerHTML; +function kc(e) { + return arguments.length ? this.each(e == null ? Sc : (typeof e == "function" ? Nc : Cc)(e)) : this.node().innerHTML; } -function Nc() { +function Mc() { this.nextSibling && this.parentNode.appendChild(this); } -function kc() { - return this.each(Nc); +function Pc() { + return this.each(Mc); } -function Mc() { +function Dc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Pc() { - return this.each(Mc); +function Oc() { + return this.each(Dc); } -function Dc(e) { - var t = typeof e == "function" ? e : Go(e); +function Fc(e) { + var t = typeof e == "function" ? e : Ko(e); return this.select(function() { return this.appendChild(t.apply(this, arguments)); }); } -function Oc() { +function Ic() { return null; } -function Fc(e, t) { - var n = typeof e == "function" ? e : Go(e), r = t == null ? Oc : typeof t == "function" ? t : Bs(t); +function Lc(e, t) { + var n = typeof e == "function" ? e : Ko(e), r = t == null ? Ic : typeof t == "function" ? t : Bs(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Ic() { +function qc() { var e = this.parentNode; e && e.removeChild(this); } -function Lc() { - return this.each(Ic); +function Vc() { + return this.each(qc); } -function qc() { +function zc() { var e = this.cloneNode(!1), t = this.parentNode; return t ? t.insertBefore(e, this.nextSibling) : e; } -function Vc() { +function Hc() { var e = this.cloneNode(!0), t = this.parentNode; return t ? t.insertBefore(e, this.nextSibling) : e; } -function zc(e) { - return this.select(e ? Vc : qc); +function Yc(e) { + return this.select(e ? Hc : zc); } -function Hc(e) { +function Bc(e) { return arguments.length ? this.property("__data__", e) : this.node().__data__; } -function Yc(e) { +function Xc(e) { return function(t) { e.call(this, t, this.__data__); }; } -function Bc(e) { +function Wc(e) { return e.trim().split(/^|\s+/).map(function(t) { var n = "", r = t.indexOf("."); return r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), { type: t, name: n }; }); } -function Xc(e) { +function Uc(e) { return function() { var t = this.__on; if (t) { @@ -3447,9 +3447,9 @@ function Xc(e) { } }; } -function Wc(e, t, n) { +function Gc(e, t, n) { return function() { - var r = this.__on, i, s = Yc(t); + var r = this.__on, i, s = Xc(t); if (r) { for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === e.type && i.name === e.name) { @@ -3460,8 +3460,8 @@ function Wc(e, t, n) { this.addEventListener(e.type, s, n), i = { type: e.type, name: e.name, value: t, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function Uc(e, t, n) { - var r = Bc(e + ""), i, s = r.length, a; +function Kc(e, t, n) { + var r = Wc(e + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,93 +3472,93 @@ function Uc(e, t, n) { } return; } - for (o = t ? Wc : Xc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); + for (o = t ? Gc : Uc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); return this; } -function il(e, t, n) { - var r = Qo(e), i = r.CustomEvent; +function sl(e, t, n) { + var r = el(e), i = r.CustomEvent; typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i); } -function Gc(e, t) { +function jc(e, t) { return function() { - return il(this, e, t); + return sl(this, e, t); }; } -function Kc(e, t) { +function Jc(e, t) { return function() { - return il(this, e, t.apply(this, arguments)); + return sl(this, e, t.apply(this, arguments)); }; } -function jc(e, t) { - return this.each((typeof t == "function" ? Kc : Gc)(e, t)); +function Zc(e, t) { + return this.each((typeof t == "function" ? Jc : jc)(e, t)); } -function* Jc() { +function* Qc() { for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var sl = [null]; -function ut(e, t) { +var al = [null]; +function st(e, t) { this._groups = e, this._parents = t; } -function xr() { - return new ut([[document.documentElement]], sl); +function br() { + return new st([[document.documentElement]], al); } -function Zc() { +function eh() { return this; } -ut.prototype = xr.prototype = { - constructor: ut, - select: Af, - selectAll: Rf, - selectChild: Mf, - selectChildren: Ff, - filter: If, - data: Yf, - enter: Lf, - exit: Xf, - join: Wf, - merge: Uf, - selection: Zc, - order: Gf, - sort: Kf, - call: Jf, - nodes: Zf, - node: Qf, - size: ec, - empty: tc, - each: nc, - attr: uc, - style: dc, - property: _c, - classed: xc, - text: Ec, - html: Sc, - raise: kc, - lower: Pc, - append: Dc, - insert: Fc, - remove: Lc, - clone: zc, - datum: Hc, - on: Uc, - dispatch: jc, - [Symbol.iterator]: Jc +st.prototype = br.prototype = { + constructor: st, + select: Tf, + selectAll: Nf, + selectChild: Df, + selectChildren: Lf, + filter: qf, + data: Xf, + enter: Vf, + exit: Uf, + join: Gf, + merge: Kf, + selection: eh, + order: jf, + sort: Jf, + call: Qf, + nodes: ec, + node: tc, + size: nc, + empty: rc, + each: ic, + attr: cc, + style: vc, + property: yc, + classed: $c, + text: Rc, + html: kc, + raise: Pc, + lower: Oc, + append: Fc, + insert: Lc, + remove: Vc, + clone: Yc, + datum: Bc, + on: Kc, + dispatch: Zc, + [Symbol.iterator]: Qc }; -function fe(e) { - return typeof e == "string" ? new ut([[document.querySelector(e)]], [document.documentElement]) : new ut([[e]], sl); +function he(e) { + return typeof e == "string" ? new st([[document.querySelector(e)]], [document.documentElement]) : new st([[e]], al); } function Ws(e, t, n) { e.prototype = t.prototype = n, n.constructor = e; } -function al(e, t) { +function ol(e, t) { var n = Object.create(e.prototype); for (var r in t) n[r] = t[r]; return n; } -function Kr() { +function Jr() { } -var Lr = 0.7, Ci = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Vt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Qc = /^#([0-9a-f]{3,8})$/, eh = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), th = new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`), nh = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), rh = new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${qr}\\)$`), ih = new RegExp(`^hsl\\(${qr},${Vt},${Vt}\\)$`), sh = new RegExp(`^hsla\\(${qr},${Vt},${Vt},${qr}\\)$`), Ta = { +var Vr = 0.7, Ei = 1 / Vr, rr = "\\s*([+-]?\\d+)\\s*", zr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", qt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", th = /^#([0-9a-f]{3,8})$/, nh = new RegExp(`^rgb\\(${rr},${rr},${rr}\\)$`), rh = new RegExp(`^rgb\\(${qt},${qt},${qt}\\)$`), ih = new RegExp(`^rgba\\(${rr},${rr},${rr},${zr}\\)$`), sh = new RegExp(`^rgba\\(${qt},${qt},${qt},${zr}\\)$`), ah = new RegExp(`^hsl\\(${zr},${qt},${qt}\\)$`), oh = new RegExp(`^hsla\\(${zr},${qt},${qt},${zr}\\)$`), Ra = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3708,86 +3708,86 @@ var Lr = 0.7, Ci = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Ws(Kr, Gn, { +Ws(Jr, Gn, { copy(e) { return Object.assign(new this.constructor(), this, e); }, displayable() { return this.rgb().displayable(); }, - hex: Ca, + hex: Sa, // Deprecated! Use color.formatHex. - formatHex: Ca, - formatHex8: ah, - formatHsl: oh, - formatRgb: Ra, - toString: Ra + formatHex: Sa, + formatHex8: lh, + formatHsl: uh, + formatRgb: Ca, + toString: Ca }); -function Ca() { +function Sa() { return this.rgb().formatHex(); } -function ah() { +function lh() { return this.rgb().formatHex8(); } -function oh() { - return ol(this).formatHsl(); +function uh() { + return ll(this).formatHsl(); } -function Ra() { +function Ca() { return this.rgb().formatRgb(); } function Gn(e) { var t, n; - return e = (e + "").trim().toLowerCase(), (t = Qc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Sa(t) : n === 3 ? new je(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? oi(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? oi(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = eh.exec(e)) ? new je(t[1], t[2], t[3], 1) : (t = th.exec(e)) ? new je(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = nh.exec(e)) ? oi(t[1], t[2], t[3], t[4]) : (t = rh.exec(e)) ? oi(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = ih.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, 1) : (t = sh.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, t[4]) : Ta.hasOwnProperty(e) ? Sa(Ta[e]) : e === "transparent" ? new je(NaN, NaN, NaN, 0) : null; + return e = (e + "").trim().toLowerCase(), (t = th.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Na(t) : n === 3 ? new Ke(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? si(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? si(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = nh.exec(e)) ? new Ke(t[1], t[2], t[3], 1) : (t = rh.exec(e)) ? new Ke(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = ih.exec(e)) ? si(t[1], t[2], t[3], t[4]) : (t = sh.exec(e)) ? si(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = ah.exec(e)) ? Pa(t[1], t[2] / 100, t[3] / 100, 1) : (t = oh.exec(e)) ? Pa(t[1], t[2] / 100, t[3] / 100, t[4]) : Ra.hasOwnProperty(e) ? Na(Ra[e]) : e === "transparent" ? new Ke(NaN, NaN, NaN, 0) : null; } -function Sa(e) { - return new je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); +function Na(e) { + return new Ke(e >> 16 & 255, e >> 8 & 255, e & 255, 1); } -function oi(e, t, n, r) { - return r <= 0 && (e = t = n = NaN), new je(e, t, n, r); +function si(e, t, n, r) { + return r <= 0 && (e = t = n = NaN), new Ke(e, t, n, r); } -function lh(e) { - return e instanceof Kr || (e = Gn(e)), e ? (e = e.rgb(), new je(e.r, e.g, e.b, e.opacity)) : new je(); +function fh(e) { + return e instanceof Jr || (e = Gn(e)), e ? (e = e.rgb(), new Ke(e.r, e.g, e.b, e.opacity)) : new Ke(); } function bs(e, t, n, r) { - return arguments.length === 1 ? lh(e) : new je(e, t, n, r ?? 1); + return arguments.length === 1 ? fh(e) : new Ke(e, t, n, r ?? 1); } -function je(e, t, n, r) { +function Ke(e, t, n, r) { this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; } -Ws(je, bs, al(Kr, { +Ws(Ke, bs, ol(Jr, { brighter(e) { - return e = e == null ? Ci : Math.pow(Ci, e), new je(this.r * e, this.g * e, this.b * e, this.opacity); + return e = e == null ? Ei : Math.pow(Ei, e), new Ke(this.r * e, this.g * e, this.b * e, this.opacity); }, darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new je(this.r * e, this.g * e, this.b * e, this.opacity); + return e = e == null ? Vr : Math.pow(Vr, e), new Ke(this.r * e, this.g * e, this.b * e, this.opacity); }, rgb() { return this; }, clamp() { - return new je(Xn(this.r), Xn(this.g), Xn(this.b), Ri(this.opacity)); + return new Ke(Xn(this.r), Xn(this.g), Xn(this.b), Ti(this.opacity)); }, displayable() { return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1; }, - hex: Na, + hex: ka, // Deprecated! Use color.formatHex. - formatHex: Na, - formatHex8: uh, - formatRgb: ka, - toString: ka + formatHex: ka, + formatHex8: ch, + formatRgb: Ma, + toString: Ma })); -function Na() { +function ka() { return `#${On(this.r)}${On(this.g)}${On(this.b)}`; } -function uh() { +function ch() { return `#${On(this.r)}${On(this.g)}${On(this.b)}${On((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function ka() { - const e = Ri(this.opacity); +function Ma() { + const e = Ti(this.opacity); return `${e === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${e === 1 ? ")" : `, ${e})`}`; } -function Ri(e) { +function Ti(e) { return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); } function Xn(e) { @@ -3796,33 +3796,33 @@ function Xn(e) { function On(e) { return e = Xn(e), (e < 16 ? "0" : "") + e.toString(16); } -function Ma(e, t, n, r) { - return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new $t(e, t, n, r); +function Pa(e, t, n, r) { + return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new bt(e, t, n, r); } -function ol(e) { - if (e instanceof $t) return new $t(e.h, e.s, e.l, e.opacity); - if (e instanceof Kr || (e = Gn(e)), !e) return new $t(); - if (e instanceof $t) return e; +function ll(e) { + if (e instanceof bt) return new bt(e.h, e.s, e.l, e.opacity); + if (e instanceof Jr || (e = Gn(e)), !e) return new bt(); + if (e instanceof bt) return e; e = e.rgb(); var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), s = Math.max(t, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (t === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - t) / o + 2 : a = (t - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new $t(a, o, l, e.opacity); + return o ? (t === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - t) / o + 2 : a = (t - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new bt(a, o, l, e.opacity); } -function fh(e, t, n, r) { - return arguments.length === 1 ? ol(e) : new $t(e, t, n, r ?? 1); +function hh(e, t, n, r) { + return arguments.length === 1 ? ll(e) : new bt(e, t, n, r ?? 1); } -function $t(e, t, n, r) { +function bt(e, t, n, r) { this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; } -Ws($t, fh, al(Kr, { +Ws(bt, hh, ol(Jr, { brighter(e) { - return e = e == null ? Ci : Math.pow(Ci, e), new $t(this.h, this.s, this.l * e, this.opacity); + return e = e == null ? Ei : Math.pow(Ei, e), new bt(this.h, this.s, this.l * e, this.opacity); }, darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new $t(this.h, this.s, this.l * e, this.opacity); + return e = e == null ? Vr : Math.pow(Vr, e), new bt(this.h, this.s, this.l * e, this.opacity); }, rgb() { var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, i = 2 * n - r; - return new je( + return new Ke( rs(e >= 240 ? e - 240 : e + 120, i, r), rs(e, i, r), rs(e < 120 ? e + 240 : e - 120, i, r), @@ -3830,56 +3830,56 @@ Ws($t, fh, al(Kr, { ); }, clamp() { - return new $t(Pa(this.h), li(this.s), li(this.l), Ri(this.opacity)); + return new bt(Da(this.h), ai(this.s), ai(this.l), Ti(this.opacity)); }, displayable() { return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; }, formatHsl() { - const e = Ri(this.opacity); - return `${e === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${li(this.s) * 100}%, ${li(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; + const e = Ti(this.opacity); + return `${e === 1 ? "hsl(" : "hsla("}${Da(this.h)}, ${ai(this.s) * 100}%, ${ai(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; } })); -function Pa(e) { +function Da(e) { return e = (e || 0) % 360, e < 0 ? e + 360 : e; } -function li(e) { +function ai(e) { return Math.max(0, Math.min(1, e || 0)); } function rs(e, t, n) { return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255; } const Us = (e) => () => e; -function ch(e, t) { +function dh(e, t) { return function(n) { return e + n * t; }; } -function hh(e, t, n) { +function ph(e, t, n) { return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) { return Math.pow(e + r * t, n); }; } -function dh(e) { - return (e = +e) == 1 ? ll : function(t, n) { - return n - t ? hh(t, n, e) : Us(isNaN(t) ? n : t); +function vh(e) { + return (e = +e) == 1 ? ul : function(t, n) { + return n - t ? ph(t, n, e) : Us(isNaN(t) ? n : t); }; } -function ll(e, t) { +function ul(e, t) { var n = t - e; - return n ? ch(e, n) : Us(isNaN(e) ? t : e); + return n ? dh(e, n) : Us(isNaN(e) ? t : e); } -const Si = (function e(t) { - var n = dh(t); +const Ri = (function e(t) { + var n = vh(t); function r(i, s) { - var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ll(i.opacity, s.opacity); + var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ul(i.opacity, s.opacity); return function(f) { return i.r = a(f), i.g = o(f), i.b = l(f), i.opacity = u(f), i + ""; }; } return r.gamma = e, r; })(1); -function ph(e, t) { +function gh(e, t) { t || (t = []); var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; return function(s) { @@ -3887,64 +3887,64 @@ function ph(e, t) { return r; }; } -function vh(e) { +function _h(e) { return ArrayBuffer.isView(e) && !(e instanceof DataView); } -function gh(e, t) { +function mh(e, t) { var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Zt(e[a], t[a]); + for (a = 0; a < r; ++a) i[a] = Jt(e[a], t[a]); for (; a < n; ++a) s[a] = t[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function _h(e, t) { +function yh(e, t) { var n = /* @__PURE__ */ new Date(); return e = +e, t = +t, function(r) { return n.setTime(e * (1 - r) + t * r), n; }; } -function qt(e, t) { +function Lt(e, t) { return e = +e, t = +t, function(n) { return e * (1 - n) + t * n; }; } -function mh(e, t) { +function wh(e, t) { var n = {}, r = {}, i; (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); for (i in t) - i in e ? n[i] = Zt(e[i], t[i]) : r[i] = t[i]; + i in e ? n[i] = Jt(e[i], t[i]) : r[i] = t[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } var $s = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, is = new RegExp($s.source, "g"); -function yh(e) { +function xh(e) { return function() { return e; }; } -function wh(e) { +function bh(e) { return function(t) { return e(t) + ""; }; } -function ul(e, t) { +function fl(e, t) { var n = $s.lastIndex = is.lastIndex = 0, r, i, s, a = -1, o = [], l = []; for (e = e + "", t = t + ""; (r = $s.exec(e)) && (i = is.exec(t)); ) - (s = i.index) > n && (s = t.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: qt(r, i) })), n = is.lastIndex; - return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? wh(l[0].x) : yh(t) : (t = l.length, function(u) { - for (var f = 0, p; f < t; ++f) o[(p = l[f]).i] = p.x(u); + (s = i.index) > n && (s = t.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: Lt(r, i) })), n = is.lastIndex; + return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? bh(l[0].x) : xh(t) : (t = l.length, function(u) { + for (var f = 0, d; f < t; ++f) o[(d = l[f]).i] = d.x(u); return o.join(""); }); } -function Zt(e, t) { +function Jt(e, t) { var n = typeof t, r; - return t == null || n === "boolean" ? Us(t) : (n === "number" ? qt : n === "string" ? (r = Gn(t)) ? (t = r, Si) : ul : t instanceof Gn ? Si : t instanceof Date ? _h : vh(t) ? ph : Array.isArray(t) ? gh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? mh : qt)(e, t); + return t == null || n === "boolean" ? Us(t) : (n === "number" ? Lt : n === "string" ? (r = Gn(t)) ? (t = r, Ri) : fl : t instanceof Gn ? Ri : t instanceof Date ? yh : _h(t) ? gh : Array.isArray(t) ? mh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? wh : Lt)(e, t); } -var Da = 180 / Math.PI, As = { +var Oa = 180 / Math.PI, As = { translateX: 0, translateY: 0, rotate: 0, @@ -3952,146 +3952,146 @@ var Da = 180 / Math.PI, As = { scaleX: 1, scaleY: 1 }; -function fl(e, t, n, r, i, s) { +function cl(e, t, n, r, i, s) { var a, o, l; return (a = Math.sqrt(e * e + t * t)) && (e /= a, t /= a), (l = e * n + t * r) && (n -= e * l, r -= t * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), e * r < t * n && (e = -e, t = -t, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(t, e) * Da, - skewX: Math.atan(l) * Da, + rotate: Math.atan2(t, e) * Oa, + skewX: Math.atan(l) * Oa, scaleX: a, scaleY: o }; } -var ui; -function xh(e) { +var oi; +function $h(e) { const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); - return t.isIdentity ? As : fl(t.a, t.b, t.c, t.d, t.e, t.f); + return t.isIdentity ? As : cl(t.a, t.b, t.c, t.d, t.e, t.f); } -function bh(e) { - return e == null || (ui || (ui = document.createElementNS("http://www.w3.org/2000/svg", "g")), ui.setAttribute("transform", e), !(e = ui.transform.baseVal.consolidate())) ? As : (e = e.matrix, fl(e.a, e.b, e.c, e.d, e.e, e.f)); +function Ah(e) { + return e == null || (oi || (oi = document.createElementNS("http://www.w3.org/2000/svg", "g")), oi.setAttribute("transform", e), !(e = oi.transform.baseVal.consolidate())) ? As : (e = e.matrix, cl(e.a, e.b, e.c, e.d, e.e, e.f)); } -function cl(e, t, n, r) { +function hl(e, t, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, p, h, d, y) { - if (u !== p || f !== h) { - var b = d.push("translate(", null, t, null, n); - y.push({ i: b - 4, x: qt(u, p) }, { i: b - 2, x: qt(f, h) }); - } else (p || h) && d.push("translate(" + p + t + h + n); + function s(u, f, d, h, p, _) { + if (u !== d || f !== h) { + var x = p.push("translate(", null, t, null, n); + _.push({ i: x - 4, x: Lt(u, d) }, { i: x - 2, x: Lt(f, h) }); + } else (d || h) && p.push("translate(" + d + t + h + n); } - function a(u, f, p, h) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), h.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: qt(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); + function a(u, f, d, h) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), h.push({ i: d.push(i(d) + "rotate(", null, r) - 2, x: Lt(u, f) })) : f && d.push(i(d) + "rotate(" + f + r); } - function o(u, f, p, h) { - u !== f ? h.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: qt(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); + function o(u, f, d, h) { + u !== f ? h.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: Lt(u, f) }) : f && d.push(i(d) + "skewX(" + f + r); } - function l(u, f, p, h, d, y) { - if (u !== p || f !== h) { - var b = d.push(i(d) + "scale(", null, ",", null, ")"); - y.push({ i: b - 4, x: qt(u, p) }, { i: b - 2, x: qt(f, h) }); - } else (p !== 1 || h !== 1) && d.push(i(d) + "scale(" + p + "," + h + ")"); + function l(u, f, d, h, p, _) { + if (u !== d || f !== h) { + var x = p.push(i(p) + "scale(", null, ",", null, ")"); + _.push({ i: x - 4, x: Lt(u, d) }, { i: x - 2, x: Lt(f, h) }); + } else (d !== 1 || h !== 1) && p.push(i(p) + "scale(" + d + "," + h + ")"); } return function(u, f) { - var p = [], h = []; - return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, h), a(u.rotate, f.rotate, p, h), o(u.skewX, f.skewX, p, h), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, h), u = f = null, function(d) { - for (var y = -1, b = h.length, m; ++y < b; ) p[(m = h[y]).i] = m.x(d); - return p.join(""); + var d = [], h = []; + return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, d, h), a(u.rotate, f.rotate, d, h), o(u.skewX, f.skewX, d, h), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, d, h), u = f = null, function(p) { + for (var _ = -1, x = h.length, y; ++_ < x; ) d[(y = h[_]).i] = y.x(p); + return d.join(""); }; }; } -var $h = cl(xh, "px, ", "px)", "deg)"), Ah = cl(bh, ", ", ")", ")"), mr = 0, Nr = 0, Rr = 0, hl = 1e3, Ni, kr, ki = 0, Kn = 0, Gi = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, dl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { +var Eh = hl($h, "px, ", "px)", "deg)"), Th = hl(Ah, ", ", ")", ")"), yr = 0, Mr = 0, Nr = 0, dl = 1e3, Si, Pr, Ci = 0, Kn = 0, Wi = 0, Hr = typeof performance == "object" && performance.now ? performance : Date, pl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { setTimeout(e, 17); }; function Gs() { - return Kn || (dl(Eh), Kn = Vr.now() + Gi); + return Kn || (pl(Rh), Kn = Hr.now() + Wi); } -function Eh() { +function Rh() { Kn = 0; } -function Mi() { +function Ni() { this._call = this._time = this._next = null; } -Mi.prototype = pl.prototype = { - constructor: Mi, +Ni.prototype = vl.prototype = { + constructor: Ni, restart: function(e, t, n) { if (typeof e != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Gs() : +n) + (t == null ? 0 : +t), !this._next && kr !== this && (kr ? kr._next = this : Ni = this, kr = this), this._call = e, this._time = n, Es(); + n = (n == null ? Gs() : +n) + (t == null ? 0 : +t), !this._next && Pr !== this && (Pr ? Pr._next = this : Si = this, Pr = this), this._call = e, this._time = n, Es(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, Es()); } }; -function pl(e, t, n) { - var r = new Mi(); +function vl(e, t, n) { + var r = new Ni(); return r.restart(e, t, n), r; } -function Th() { - Gs(), ++mr; - for (var e = Ni, t; e; ) +function Sh() { + Gs(), ++yr; + for (var e = Si, t; e; ) (t = Kn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; - --mr; + --yr; } -function Oa() { - Kn = (ki = Vr.now()) + Gi, mr = Nr = 0; +function Fa() { + Kn = (Ci = Hr.now()) + Wi, yr = Mr = 0; try { - Th(); + Sh(); } finally { - mr = 0, Rh(), Kn = 0; + yr = 0, Nh(), Kn = 0; } } function Ch() { - var e = Vr.now(), t = e - ki; - t > hl && (Gi -= t, ki = e); + var e = Hr.now(), t = e - Ci; + t > dl && (Wi -= t, Ci = e); } -function Rh() { - for (var e, t = Ni, n, r = 1 / 0; t; ) - t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Ni = n); - kr = e, Es(r); +function Nh() { + for (var e, t = Si, n, r = 1 / 0; t; ) + t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Si = n); + Pr = e, Es(r); } function Es(e) { - if (!mr) { - Nr && (Nr = clearTimeout(Nr)); + if (!yr) { + Mr && (Mr = clearTimeout(Mr)); var t = e - Kn; - t > 24 ? (e < 1 / 0 && (Nr = setTimeout(Oa, e - Vr.now() - Gi)), Rr && (Rr = clearInterval(Rr))) : (Rr || (ki = Vr.now(), Rr = setInterval(Ch, hl)), mr = 1, dl(Oa)); + t > 24 ? (e < 1 / 0 && (Mr = setTimeout(Fa, e - Hr.now() - Wi)), Nr && (Nr = clearInterval(Nr))) : (Nr || (Ci = Hr.now(), Nr = setInterval(Ch, dl)), yr = 1, pl(Fa)); } } -function Fa(e, t, n) { - var r = new Mi(); +function Ia(e, t, n) { + var r = new Ni(); return t = t == null ? 0 : +t, r.restart((i) => { r.stop(), e(i + t); }, t, n), r; } -var Sh = Uo("start", "end", "cancel", "interrupt"), Nh = [], vl = 0, Ia = 1, Ts = 2, yi = 3, La = 4, Cs = 5, wi = 6; -function Ki(e, t, n, r, i, s) { +var kh = Go("start", "end", "cancel", "interrupt"), Mh = [], gl = 0, La = 1, Ts = 2, _i = 3, qa = 4, Rs = 5, mi = 6; +function Ui(e, t, n, r, i, s) { var a = e.__transition; if (!a) e.__transition = {}; else if (n in a) return; - kh(e, n, { + Ph(e, n, { name: t, index: r, // For context during callback. group: i, // For context during callback. - on: Sh, - tween: Nh, + on: kh, + tween: Mh, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: vl + state: gl }); } function Ks(e, t) { var n = Rt(e, t); - if (n.state > vl) throw new Error("too late; already scheduled"); + if (n.state > gl) throw new Error("too late; already scheduled"); return n; } -function Wt(e, t) { +function Xt(e, t) { var n = Rt(e, t); - if (n.state > yi) throw new Error("too late; already running"); + if (n.state > _i) throw new Error("too late; already running"); return n; } function Rt(e, t) { @@ -4099,40 +4099,40 @@ function Rt(e, t) { if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } -function kh(e, t, n) { +function Ph(e, t, n) { var r = e.__transition, i; - r[t] = n, n.timer = pl(s, 0, n.time); + r[t] = n, n.timer = vl(s, 0, n.time); function s(u) { - n.state = Ia, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = La, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, p, h, d; - if (n.state !== Ia) return l(); + var f, d, h, p; + if (n.state !== La) return l(); for (f in r) - if (d = r[f], d.name === n.name) { - if (d.state === yi) return Fa(a); - d.state === La ? (d.state = wi, d.timer.stop(), d.on.call("interrupt", e, e.__data__, d.index, d.group), delete r[f]) : +f < t && (d.state = wi, d.timer.stop(), d.on.call("cancel", e, e.__data__, d.index, d.group), delete r[f]); + if (p = r[f], p.name === n.name) { + if (p.state === _i) return Ia(a); + p.state === qa ? (p.state = mi, p.timer.stop(), p.on.call("interrupt", e, e.__data__, p.index, p.group), delete r[f]) : +f < t && (p.state = mi, p.timer.stop(), p.on.call("cancel", e, e.__data__, p.index, p.group), delete r[f]); } - if (Fa(function() { - n.state === yi && (n.state = La, n.timer.restart(o, n.delay, n.time), o(u)); + if (Ia(function() { + n.state === _i && (n.state = qa, n.timer.restart(o, n.delay, n.time), o(u)); }), n.state = Ts, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Ts) { - for (n.state = yi, i = new Array(h = n.tween.length), f = 0, p = -1; f < h; ++f) - (d = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++p] = d); - i.length = p + 1; + for (n.state = _i, i = new Array(h = n.tween.length), f = 0, d = -1; f < h; ++f) + (p = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++d] = p); + i.length = d + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Cs, 1), p = -1, h = i.length; ++p < h; ) - i[p].call(e, f); - n.state === Cs && (n.on.call("end", e, e.__data__, n.index, n.group), l()); + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Rs, 1), d = -1, h = i.length; ++d < h; ) + i[d].call(e, f); + n.state === Rs && (n.on.call("end", e, e.__data__, n.index, n.group), l()); } function l() { - n.state = wi, n.timer.stop(), delete r[t]; + n.state = mi, n.timer.stop(), delete r[t]; for (var u in r) return; delete e.__transition; } } -function Mh(e, t) { +function Dh(e, t) { var n = e.__transition, r, i, s = !0, a; if (n) { t = t == null ? null : t + ""; @@ -4141,20 +4141,20 @@ function Mh(e, t) { s = !1; continue; } - i = r.state > Ts && r.state < Cs, r.state = wi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; + i = r.state > Ts && r.state < Rs, r.state = mi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; } s && delete e.__transition; } } -function Ph(e) { +function Oh(e) { return this.each(function() { - Mh(this, e); + Dh(this, e); }); } -function Dh(e, t) { +function Fh(e, t) { var n, r; return function() { - var i = Wt(this, e), s = i.tween; + var i = Xt(this, e), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4166,11 +4166,11 @@ function Dh(e, t) { i.tween = r; }; } -function Oh(e, t, n) { +function Ih(e, t, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Wt(this, e), a = s.tween; + var s = Xt(this, e), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var o = { name: t, value: n }, l = 0, u = i.length; l < u; ++l) @@ -4183,7 +4183,7 @@ function Oh(e, t, n) { s.tween = i; }; } -function Fh(e, t) { +function Lh(e, t) { var n = this._id; if (e += "", arguments.length < 2) { for (var r = Rt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) @@ -4191,290 +4191,290 @@ function Fh(e, t) { return a.value; return null; } - return this.each((t == null ? Dh : Oh)(n, e, t)); + return this.each((t == null ? Fh : Ih)(n, e, t)); } function js(e, t, n) { var r = e._id; return e.each(function() { - var i = Wt(this, r); + var i = Xt(this, r); (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { return Rt(i, r).value[t]; }; } -function gl(e, t) { +function _l(e, t) { var n; - return (typeof t == "number" ? qt : t instanceof Gn ? Si : (n = Gn(t)) ? (t = n, Si) : ul)(e, t); + return (typeof t == "number" ? Lt : t instanceof Gn ? Ri : (n = Gn(t)) ? (t = n, Ri) : fl)(e, t); } -function Ih(e) { +function qh(e) { return function() { this.removeAttribute(e); }; } -function Lh(e) { +function Vh(e) { return function() { this.removeAttributeNS(e.space, e.local); }; } -function qh(e, t, n) { +function zh(e, t, n) { var r, i = n + "", s; return function() { var a = this.getAttribute(e); return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function Vh(e, t, n) { +function Hh(e, t, n) { var r, i = n + "", s; return function() { var a = this.getAttributeNS(e.space, e.local); return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function zh(e, t, n) { +function Yh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttribute(e) : (a = this.getAttribute(e), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); }; } -function Hh(e, t, n) { +function Bh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttributeNS(e.space, e.local) : (a = this.getAttributeNS(e.space, e.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); }; } -function Yh(e, t) { - var n = Ui(e), r = n === "transform" ? Ah : gl; - return this.attrTween(e, typeof t == "function" ? (n.local ? Hh : zh)(n, r, js(this, "attr." + e, t)) : t == null ? (n.local ? Lh : Ih)(n) : (n.local ? Vh : qh)(n, r, t)); +function Xh(e, t) { + var n = Xi(e), r = n === "transform" ? Th : _l; + return this.attrTween(e, typeof t == "function" ? (n.local ? Bh : Yh)(n, r, js(this, "attr." + e, t)) : t == null ? (n.local ? Vh : qh)(n) : (n.local ? Hh : zh)(n, r, t)); } -function Bh(e, t) { +function Wh(e, t) { return function(n) { this.setAttribute(e, t.call(this, n)); }; } -function Xh(e, t) { +function Uh(e, t) { return function(n) { this.setAttributeNS(e.space, e.local, t.call(this, n)); }; } -function Wh(e, t) { +function Gh(e, t) { var n, r; function i() { var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Xh(e, s)), n; + return s !== r && (n = (r = s) && Uh(e, s)), n; } return i._value = t, i; } -function Uh(e, t) { +function Kh(e, t) { var n, r; function i() { var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Bh(e, s)), n; + return s !== r && (n = (r = s) && Wh(e, s)), n; } return i._value = t, i; } -function Gh(e, t) { +function jh(e, t) { var n = "attr." + e; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (t == null) return this.tween(n, null); if (typeof t != "function") throw new Error(); - var r = Ui(e); - return this.tween(n, (r.local ? Wh : Uh)(r, t)); + var r = Xi(e); + return this.tween(n, (r.local ? Gh : Kh)(r, t)); } -function Kh(e, t) { +function Jh(e, t) { return function() { Ks(this, e).delay = +t.apply(this, arguments); }; } -function jh(e, t) { +function Zh(e, t) { return t = +t, function() { Ks(this, e).delay = t; }; } -function Jh(e) { +function Qh(e) { var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Kh : jh)(t, e)) : Rt(this.node(), t).delay; + return arguments.length ? this.each((typeof e == "function" ? Jh : Zh)(t, e)) : Rt(this.node(), t).delay; } -function Zh(e, t) { +function ed(e, t) { return function() { - Wt(this, e).duration = +t.apply(this, arguments); + Xt(this, e).duration = +t.apply(this, arguments); }; } -function Qh(e, t) { +function td(e, t) { return t = +t, function() { - Wt(this, e).duration = t; + Xt(this, e).duration = t; }; } -function ed(e) { +function nd(e) { var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Zh : Qh)(t, e)) : Rt(this.node(), t).duration; + return arguments.length ? this.each((typeof e == "function" ? ed : td)(t, e)) : Rt(this.node(), t).duration; } -function td(e, t) { +function rd(e, t) { if (typeof t != "function") throw new Error(); return function() { - Wt(this, e).ease = t; + Xt(this, e).ease = t; }; } -function nd(e) { +function id(e) { var t = this._id; - return arguments.length ? this.each(td(t, e)) : Rt(this.node(), t).ease; + return arguments.length ? this.each(rd(t, e)) : Rt(this.node(), t).ease; } -function rd(e, t) { +function sd(e, t) { return function() { var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); - Wt(this, e).ease = n; + Xt(this, e).ease = n; }; } -function id(e) { +function ad(e) { if (typeof e != "function") throw new Error(); - return this.each(rd(this._id, e)); + return this.each(sd(this._id, e)); } -function sd(e) { - typeof e != "function" && (e = jo(e)); +function od(e) { + typeof e != "function" && (e = Jo(e)); for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); - return new cn(r, this._parents, this._name, this._id); + return new fn(r, this._parents, this._name, this._id); } -function ad(e) { +function ld(e) { if (e._id !== this._id) throw new Error(); for (var t = this._groups, n = e._groups, r = t.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = t[o], u = n[o], f = l.length, p = a[o] = new Array(f), h, d = 0; d < f; ++d) - (h = l[d] || u[d]) && (p[d] = h); + for (var l = t[o], u = n[o], f = l.length, d = a[o] = new Array(f), h, p = 0; p < f; ++p) + (h = l[p] || u[p]) && (d[p] = h); for (; o < r; ++o) a[o] = t[o]; - return new cn(a, this._parents, this._name, this._id); + return new fn(a, this._parents, this._name, this._id); } -function od(e) { +function ud(e) { return (e + "").trim().split(/^|\s+/).every(function(t) { var n = t.indexOf("."); return n >= 0 && (t = t.slice(0, n)), !t || t === "start"; }); } -function ld(e, t, n) { - var r, i, s = od(t) ? Ks : Wt; +function fd(e, t, n) { + var r, i, s = ud(t) ? Ks : Xt; return function() { var a = s(this, e), o = a.on; o !== r && (i = (r = o).copy()).on(t, n), a.on = i; }; } -function ud(e, t) { +function cd(e, t) { var n = this._id; - return arguments.length < 2 ? Rt(this.node(), n).on.on(e) : this.each(ld(n, e, t)); + return arguments.length < 2 ? Rt(this.node(), n).on.on(e) : this.each(fd(n, e, t)); } -function fd(e) { +function hd(e) { return function() { var t = this.parentNode; for (var n in this.__transition) if (+n !== e) return; t && t.removeChild(this); }; } -function cd() { - return this.on("end.remove", fd(this._id)); +function dd() { + return this.on("end.remove", hd(this._id)); } -function hd(e) { +function pd(e) { var t = this._name, n = this._id; typeof e != "function" && (e = Bs(e)); for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) - for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, p, h = 0; h < l; ++h) - (f = o[h]) && (p = e.call(f, f.__data__, h, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[h] = p, Ki(u[h], t, n, h, u, Rt(f, n))); - return new cn(s, this._parents, t, n); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, d, h = 0; h < l; ++h) + (f = o[h]) && (d = e.call(f, f.__data__, h, o)) && ("__data__" in f && (d.__data__ = f.__data__), u[h] = d, Ui(u[h], t, n, h, u, Rt(f, n))); + return new fn(s, this._parents, t, n); } -function dd(e) { +function vd(e) { var t = this._name, n = this._id; - typeof e != "function" && (e = Ko(e)); + typeof e != "function" && (e = jo(e)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var l = r[o], u = l.length, f, p = 0; p < u; ++p) - if (f = l[p]) { - for (var h = e.call(f, f.__data__, p, l), d, y = Rt(f, n), b = 0, m = h.length; b < m; ++b) - (d = h[b]) && Ki(d, t, n, b, h, y); + for (var l = r[o], u = l.length, f, d = 0; d < u; ++d) + if (f = l[d]) { + for (var h = e.call(f, f.__data__, d, l), p, _ = Rt(f, n), x = 0, y = h.length; x < y; ++x) + (p = h[x]) && Ui(p, t, n, x, h, _); s.push(h), a.push(f); } - return new cn(s, a, t, n); + return new fn(s, a, t, n); } -var pd = xr.prototype.constructor; -function vd() { - return new pd(this._groups, this._parents); +var gd = br.prototype.constructor; +function _d() { + return new gd(this._groups, this._parents); } -function gd(e, t) { +function md(e, t) { var n, r, i; return function() { - var s = _r(this, e), a = (this.style.removeProperty(e), _r(this, e)); + var s = mr(this, e), a = (this.style.removeProperty(e), mr(this, e)); return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); }; } -function _l(e) { +function ml(e) { return function() { this.style.removeProperty(e); }; } -function _d(e, t, n) { +function yd(e, t, n) { var r, i = n + "", s; return function() { - var a = _r(this, e); + var a = mr(this, e); return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function md(e, t, n) { +function wd(e, t, n) { var r, i, s; return function() { - var a = _r(this, e), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(e), _r(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); + var a = mr(this, e), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(e), mr(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); }; } -function yd(e, t) { +function xd(e, t) { var n, r, i, s = "style." + t, a = "end." + s, o; return function() { - var l = Wt(this, e), u = l.on, f = l.value[s] == null ? o || (o = _l(t)) : void 0; + var l = Xt(this, e), u = l.on, f = l.value[s] == null ? o || (o = ml(t)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function wd(e, t, n) { - var r = (e += "") == "transform" ? $h : gl; - return t == null ? this.styleTween(e, gd(e, r)).on("end.style." + e, _l(e)) : typeof t == "function" ? this.styleTween(e, md(e, r, js(this, "style." + e, t))).each(yd(this._id, e)) : this.styleTween(e, _d(e, r, t), n).on("end.style." + e, null); +function bd(e, t, n) { + var r = (e += "") == "transform" ? Eh : _l; + return t == null ? this.styleTween(e, md(e, r)).on("end.style." + e, ml(e)) : typeof t == "function" ? this.styleTween(e, wd(e, r, js(this, "style." + e, t))).each(xd(this._id, e)) : this.styleTween(e, yd(e, r, t), n).on("end.style." + e, null); } -function xd(e, t, n) { +function $d(e, t, n) { return function(r) { this.style.setProperty(e, t.call(this, r), n); }; } -function bd(e, t, n) { +function Ad(e, t, n) { var r, i; function s() { var a = t.apply(this, arguments); - return a !== i && (r = (i = a) && xd(e, a, n)), r; + return a !== i && (r = (i = a) && $d(e, a, n)), r; } return s._value = t, s; } -function $d(e, t, n) { +function Ed(e, t, n) { var r = "style." + (e += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (t == null) return this.tween(r, null); if (typeof t != "function") throw new Error(); - return this.tween(r, bd(e, t, n ?? "")); + return this.tween(r, Ad(e, t, n ?? "")); } -function Ad(e) { +function Td(e) { return function() { this.textContent = e; }; } -function Ed(e) { +function Rd(e) { return function() { var t = e(this); this.textContent = t ?? ""; }; } -function Td(e) { - return this.tween("text", typeof e == "function" ? Ed(js(this, "text", e)) : Ad(e == null ? "" : e + "")); +function Sd(e) { + return this.tween("text", typeof e == "function" ? Rd(js(this, "text", e)) : Td(e == null ? "" : e + "")); } function Cd(e) { return function(t) { this.textContent = e.call(this, t); }; } -function Rd(e) { +function Nd(e) { var t, n; function r() { var i = e.apply(this, arguments); @@ -4482,118 +4482,118 @@ function Rd(e) { } return r._value = e, r; } -function Sd(e) { +function kd(e) { var t = "text"; if (arguments.length < 1) return (t = this.tween(t)) && t._value; if (e == null) return this.tween(t, null); if (typeof e != "function") throw new Error(); - return this.tween(t, Rd(e)); + return this.tween(t, Nd(e)); } -function Nd() { - for (var e = this._name, t = this._id, n = ml(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Md() { + for (var e = this._name, t = this._id, n = yl(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) if (l = a[u]) { var f = Rt(l, t); - Ki(l, e, n, u, a, { + Ui(l, e, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new cn(r, this._parents, e, n); + return new fn(r, this._parents, e, n); } -function kd() { +function Pd() { var e, t, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var o = { value: a }, l = { value: function() { --i === 0 && s(); } }; n.each(function() { - var u = Wt(this, r), f = u.on; + var u = Xt(this, r), f = u.on; f !== e && (t = (e = f).copy(), t._.cancel.push(o), t._.interrupt.push(o), t._.end.push(l)), u.on = t; }), i === 0 && s(); }); } -var Md = 0; -function cn(e, t, n, r) { +var Dd = 0; +function fn(e, t, n, r) { this._groups = e, this._parents = t, this._name = n, this._id = r; } -function xi(e) { - return xr().transition(e); -} -function ml() { - return ++Md; -} -var Jt = xr.prototype; -cn.prototype = xi.prototype = { - constructor: cn, - select: hd, - selectAll: dd, - selectChild: Jt.selectChild, - selectChildren: Jt.selectChildren, - filter: sd, - merge: ad, - selection: vd, - transition: Nd, - call: Jt.call, - nodes: Jt.nodes, - node: Jt.node, - size: Jt.size, - empty: Jt.empty, - each: Jt.each, - on: ud, - attr: Yh, - attrTween: Gh, - style: wd, - styleTween: $d, - text: Td, - textTween: Sd, - remove: cd, - tween: Fh, - delay: Jh, - duration: ed, - ease: nd, - easeVarying: id, - end: kd, - [Symbol.iterator]: Jt[Symbol.iterator] +function yi(e) { + return br().transition(e); +} +function yl() { + return ++Dd; +} +var jt = br.prototype; +fn.prototype = yi.prototype = { + constructor: fn, + select: pd, + selectAll: vd, + selectChild: jt.selectChild, + selectChildren: jt.selectChildren, + filter: od, + merge: ld, + selection: _d, + transition: Md, + call: jt.call, + nodes: jt.nodes, + node: jt.node, + size: jt.size, + empty: jt.empty, + each: jt.each, + on: cd, + attr: Xh, + attrTween: jh, + style: bd, + styleTween: Ed, + text: Sd, + textTween: kd, + remove: dd, + tween: Lh, + delay: Qh, + duration: nd, + ease: id, + easeVarying: ad, + end: Pd, + [Symbol.iterator]: jt[Symbol.iterator] }; -function Pd(e) { +function Od(e) { return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; } -var Dd = { +var Fd = { time: null, // Set on use. delay: 0, duration: 250, - ease: Pd + ease: Od }; -function Od(e, t) { +function Id(e, t) { for (var n; !(n = e.__transition) || !(n = n[t]); ) if (!(e = e.parentNode)) throw new Error(`transition ${t} not found`); return n; } -function Fd(e) { +function Ld(e) { var t, n; - e instanceof cn ? (t = e._id, e = e._name) : (t = ml(), (n = Dd).time = Gs(), e = e == null ? null : e + ""); + e instanceof fn ? (t = e._id, e = e._name) : (t = yl(), (n = Fd).time = Gs(), e = e == null ? null : e + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && Ki(l, e, t, u, a, n || Od(l, t)); - return new cn(r, this._parents, e, t); + (l = a[u]) && Ui(l, e, t, u, a, n || Id(l, t)); + return new fn(r, this._parents, e, t); } -xr.prototype.interrupt = Ph; -xr.prototype.transition = Fd; -const Rs = Math.PI, Ss = 2 * Rs, Nn = 1e-6, Id = Ss - Nn; -function yl(e) { +br.prototype.interrupt = Oh; +br.prototype.transition = Ld; +const Ss = Math.PI, Cs = 2 * Ss, Nn = 1e-6, qd = Cs - Nn; +function wl(e) { this._ += e[0]; for (let t = 1, n = e.length; t < n; ++t) this._ += arguments[t] + e[t]; } -function Ld(e) { +function Vd(e) { let t = Math.floor(e); if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); - if (t > 15) return yl; + if (t > 15) return wl; const n = 10 ** t; return function(r) { this._ += r[0]; @@ -4601,10 +4601,10 @@ function Ld(e) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class qd { +class zd { constructor(t) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = t == null ? yl : Ld(t); + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? wl : Vd(t); } moveTo(t, n) { this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; @@ -4623,20 +4623,20 @@ class qd { } arcTo(t, n, r, i, s) { if (t = +t, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); - let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, p = o - n, h = f * f + p * p; + let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, d = o - n, h = f * f + d * d; if (this._x1 === null) this._append`M${this._x1 = t},${this._y1 = n}`; - else if (h > Nn) if (!(Math.abs(p * l - u * f) > Nn) || !s) + else if (h > Nn) if (!(Math.abs(d * l - u * f) > Nn) || !s) this._append`L${this._x1 = t},${this._y1 = n}`; else { - let d = r - a, y = i - o, b = l * l + u * u, m = d * d + y * y, $ = Math.sqrt(b), D = Math.sqrt(h), M = s * Math.tan((Rs - Math.acos((b + h - m) / (2 * $ * D))) / 2), S = M / D, I = M / $; - Math.abs(S - 1) > Nn && this._append`L${t + S * f},${n + S * p}`, this._append`A${s},${s},0,0,${+(p * d > f * y)},${this._x1 = t + I * l},${this._y1 = n + I * u}`; + let p = r - a, _ = i - o, x = l * l + u * u, y = p * p + _ * _, b = Math.sqrt(x), O = Math.sqrt(h), N = s * Math.tan((Ss - Math.acos((x + h - y) / (2 * b * O))) / 2), M = N / O, F = N / b; + Math.abs(M - 1) > Nn && this._append`L${t + M * f},${n + M * d}`, this._append`A${s},${s},0,0,${+(d * p > f * _)},${this._x1 = t + F * l},${this._y1 = n + F * u}`; } } arc(t, n, r, i, s, a) { if (t = +t, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); - let o = r * Math.cos(i), l = r * Math.sin(i), u = t + o, f = n + l, p = 1 ^ a, h = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Nn || Math.abs(this._y1 - f) > Nn) && this._append`L${u},${f}`, r && (h < 0 && (h = h % Ss + Ss), h > Id ? this._append`A${r},${r},0,1,${p},${t - o},${n - l}A${r},${r},0,1,${p},${this._x1 = u},${this._y1 = f}` : h > Nn && this._append`A${r},${r},0,${+(h >= Rs)},${p},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = t + o, f = n + l, d = 1 ^ a, h = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Nn || Math.abs(this._y1 - f) > Nn) && this._append`L${u},${f}`, r && (h < 0 && (h = h % Cs + Cs), h > qd ? this._append`A${r},${r},0,1,${d},${t - o},${n - l}A${r},${r},0,1,${d},${this._x1 = u},${this._y1 = f}` : h > Nn && this._append`A${r},${r},0,${+(h >= Ss)},${d},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } rect(t, n, r, i) { this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; @@ -4645,24 +4645,24 @@ class qd { return this._; } } -function Vd(e) { +function Hd(e) { for (var t = e.length / 6 | 0, n = new Array(t), r = 0; r < t; ) n[r] = "#" + e.slice(r * 6, ++r * 6); return n; } -const zd = Vd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function qe(e) { +const Yd = Hd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Fe(e) { return function() { return e; }; } -const qa = Math.abs, De = Math.atan2, Sn = Math.cos, Hd = Math.max, ss = Math.min, Dt = Math.sin, tr = Math.sqrt, Be = 1e-12, zr = Math.PI, Pi = zr / 2, bi = 2 * zr; -function Yd(e) { - return e > 1 ? 0 : e < -1 ? zr : Math.acos(e); +const Va = Math.abs, Me = Math.atan2, Cn = Math.cos, Bd = Math.max, ss = Math.min, Pt = Math.sin, nr = Math.sqrt, Ye = 1e-12, Yr = Math.PI, ki = Yr / 2, wi = 2 * Yr; +function Xd(e) { + return e > 1 ? 0 : e < -1 ? Yr : Math.acos(e); } -function Va(e) { - return e >= 1 ? Pi : e <= -1 ? -Pi : Math.asin(e); +function za(e) { + return e >= 1 ? ki : e <= -1 ? -ki : Math.asin(e); } -function Bd(e) { +function Wd(e) { let t = 3; return e.digits = function(n) { if (!arguments.length) return t; @@ -4674,141 +4674,141 @@ function Bd(e) { t = r; } return e; - }, () => new qd(t); + }, () => new zd(t); } -function Xd(e) { +function Ud(e) { return e.innerRadius; } -function Wd(e) { +function Gd(e) { return e.outerRadius; } -function Ud(e) { +function Kd(e) { return e.startAngle; } -function Gd(e) { +function jd(e) { return e.endAngle; } -function Kd(e) { +function Jd(e) { return e && e.padAngle; } -function jd(e, t, n, r, i, s, a, o) { - var l = n - e, u = r - t, f = a - i, p = o - s, h = p * l - f * u; - if (!(h * h < Be)) - return h = (f * (t - s) - p * (e - i)) / h, [e + h * l, t + h * u]; +function Zd(e, t, n, r, i, s, a, o) { + var l = n - e, u = r - t, f = a - i, d = o - s, h = d * l - f * u; + if (!(h * h < Ye)) + return h = (f * (t - s) - d * (e - i)) / h, [e + h * l, t + h * u]; } -function fi(e, t, n, r, i, s, a) { - var o = e - n, l = t - r, u = (a ? s : -s) / tr(o * o + l * l), f = u * l, p = -u * o, h = e + f, d = t + p, y = n + f, b = r + p, m = (h + y) / 2, $ = (d + b) / 2, D = y - h, M = b - d, S = D * D + M * M, I = i - s, L = h * b - y * d, U = (M < 0 ? -1 : 1) * tr(Hd(0, I * I * S - L * L)), ae = (L * M - D * U) / S, Q = (-L * D - M * U) / S, G = (L * M + D * U) / S, oe = (-L * D + M * U) / S, ue = ae - m, O = Q - $, F = G - m, Ne = oe - $; - return ue * ue + O * O > F * F + Ne * Ne && (ae = G, Q = oe), { - cx: ae, - cy: Q, +function li(e, t, n, r, i, s, a) { + var o = e - n, l = t - r, u = (a ? s : -s) / nr(o * o + l * l), f = u * l, d = -u * o, h = e + f, p = t + d, _ = n + f, x = r + d, y = (h + _) / 2, b = (p + x) / 2, O = _ - h, N = x - p, M = O * O + N * N, F = i - s, W = h * x - _ * p, I = (N < 0 ? -1 : 1) * nr(Bd(0, F * F * M - W * W)), ee = (W * N - O * I) / M, fe = (-W * O - N * I) / M, U = (W * N + O * I) / M, re = (-W * O + N * I) / M, le = ee - y, D = fe - b, H = U - y, te = re - b; + return le * le + D * D > H * H + te * te && (ee = U, fe = re), { + cx: ee, + cy: fe, x01: -f, - y01: -p, - x11: ae * (i / I - 1), - y11: Q * (i / I - 1) + y01: -d, + x11: ee * (i / F - 1), + y11: fe * (i / F - 1) }; } -function wt() { - var e = Xd, t = Wd, n = qe(0), r = null, i = Ud, s = Gd, a = Kd, o = null, l = Bd(u); +function yt() { + var e = Ud, t = Gd, n = Fe(0), r = null, i = Kd, s = jd, a = Jd, o = null, l = Wd(u); function u() { - var f, p, h = +e.apply(this, arguments), d = +t.apply(this, arguments), y = i.apply(this, arguments) - Pi, b = s.apply(this, arguments) - Pi, m = qa(b - y), $ = b > y; - if (o || (o = f = l()), d < h && (p = d, d = h, h = p), !(d > Be)) o.moveTo(0, 0); - else if (m > bi - Be) - o.moveTo(d * Sn(y), d * Dt(y)), o.arc(0, 0, d, y, b, !$), h > Be && (o.moveTo(h * Sn(b), h * Dt(b)), o.arc(0, 0, h, b, y, $)); + var f, d, h = +e.apply(this, arguments), p = +t.apply(this, arguments), _ = i.apply(this, arguments) - ki, x = s.apply(this, arguments) - ki, y = Va(x - _), b = x > _; + if (o || (o = f = l()), p < h && (d = p, p = h, h = d), !(p > Ye)) o.moveTo(0, 0); + else if (y > wi - Ye) + o.moveTo(p * Cn(_), p * Pt(_)), o.arc(0, 0, p, _, x, !b), h > Ye && (o.moveTo(h * Cn(x), h * Pt(x)), o.arc(0, 0, h, x, _, b)); else { - var D = y, M = b, S = y, I = b, L = m, U = m, ae = a.apply(this, arguments) / 2, Q = ae > Be && (r ? +r.apply(this, arguments) : tr(h * h + d * d)), G = ss(qa(d - h) / 2, +n.apply(this, arguments)), oe = G, ue = G, O, F; - if (Q > Be) { - var Ne = Va(Q / h * Dt(ae)), ft = Va(Q / d * Dt(ae)); - (L -= Ne * 2) > Be ? (Ne *= $ ? 1 : -1, S += Ne, I -= Ne) : (L = 0, S = I = (y + b) / 2), (U -= ft * 2) > Be ? (ft *= $ ? 1 : -1, D += ft, M -= ft) : (U = 0, D = M = (y + b) / 2); + var O = _, N = x, M = _, F = x, W = y, I = y, ee = a.apply(this, arguments) / 2, fe = ee > Ye && (r ? +r.apply(this, arguments) : nr(h * h + p * p)), U = ss(Va(p - h) / 2, +n.apply(this, arguments)), re = U, le = U, D, H; + if (fe > Ye) { + var te = za(fe / h * Pt(ee)), je = za(fe / p * Pt(ee)); + (W -= te * 2) > Ye ? (te *= b ? 1 : -1, M += te, F -= te) : (W = 0, M = F = (_ + x) / 2), (I -= je * 2) > Ye ? (je *= b ? 1 : -1, O += je, N -= je) : (I = 0, O = N = (_ + x) / 2); } - var me = d * Sn(D), ye = d * Dt(D), te = h * Sn(I), ke = h * Dt(I); - if (G > Be) { - var Y = d * Sn(M), Oe = d * Dt(M), St = h * Sn(S), ie = h * Dt(S), Je; - if (m < zr) - if (Je = jd(me, ye, St, ie, Y, Oe, te, ke)) { - var yt = me - Je[0], Ze = ye - Je[1], Tn = Y - Je[0], ge = Oe - Je[1], Nt = 1 / Dt(Yd((yt * Tn + Ze * ge) / (tr(yt * yt + Ze * Ze) * tr(Tn * Tn + ge * ge))) / 2), Ut = tr(Je[0] * Je[0] + Je[1] * Je[1]); - oe = ss(G, (h - Ut) / (Nt - 1)), ue = ss(G, (d - Ut) / (Nt + 1)); + var qe = p * Cn(O), de = p * Pt(O), ce = h * Cn(F), _e = h * Pt(F); + if (U > Ye) { + var at = p * Cn(N), G = p * Pt(N), Pe = h * Cn(M), St = h * Pt(M), Z; + if (y < Yr) + if (Z = Zd(qe, de, Pe, St, at, G, ce, _e)) { + var hn = qe - Z[0], Ct = de - Z[1], dn = at - Z[0], Wt = G - Z[1], vt = 1 / Pt(Xd((hn * dn + Ct * Wt) / (nr(hn * hn + Ct * Ct) * nr(dn * dn + Wt * Wt))) / 2), En = nr(Z[0] * Z[0] + Z[1] * Z[1]); + re = ss(U, (h - En) / (vt - 1)), le = ss(U, (p - En) / (vt + 1)); } else - oe = ue = 0; + re = le = 0; } - U > Be ? ue > Be ? (O = fi(St, ie, me, ye, d, ue, $), F = fi(Y, Oe, te, ke, d, ue, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ue < G ? o.arc(O.cx, O.cy, ue, De(O.y01, O.x01), De(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, ue, De(O.y01, O.x01), De(O.y11, O.x11), !$), o.arc(0, 0, d, De(O.cy + O.y11, O.cx + O.x11), De(F.cy + F.y11, F.cx + F.x11), !$), o.arc(F.cx, F.cy, ue, De(F.y11, F.x11), De(F.y01, F.x01), !$))) : (o.moveTo(me, ye), o.arc(0, 0, d, D, M, !$)) : o.moveTo(me, ye), !(h > Be) || !(L > Be) ? o.lineTo(te, ke) : oe > Be ? (O = fi(te, ke, Y, Oe, h, -oe, $), F = fi(me, ye, St, ie, h, -oe, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), oe < G ? o.arc(O.cx, O.cy, oe, De(O.y01, O.x01), De(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, oe, De(O.y01, O.x01), De(O.y11, O.x11), !$), o.arc(0, 0, h, De(O.cy + O.y11, O.cx + O.x11), De(F.cy + F.y11, F.cx + F.x11), $), o.arc(F.cx, F.cy, oe, De(F.y11, F.x11), De(F.y01, F.x01), !$))) : o.arc(0, 0, h, I, S, $); + I > Ye ? le > Ye ? (D = li(Pe, St, qe, de, p, le, b), H = li(at, G, ce, _e, p, le, b), o.moveTo(D.cx + D.x01, D.cy + D.y01), le < U ? o.arc(D.cx, D.cy, le, Me(D.y01, D.x01), Me(H.y01, H.x01), !b) : (o.arc(D.cx, D.cy, le, Me(D.y01, D.x01), Me(D.y11, D.x11), !b), o.arc(0, 0, p, Me(D.cy + D.y11, D.cx + D.x11), Me(H.cy + H.y11, H.cx + H.x11), !b), o.arc(H.cx, H.cy, le, Me(H.y11, H.x11), Me(H.y01, H.x01), !b))) : (o.moveTo(qe, de), o.arc(0, 0, p, O, N, !b)) : o.moveTo(qe, de), !(h > Ye) || !(W > Ye) ? o.lineTo(ce, _e) : re > Ye ? (D = li(ce, _e, at, G, h, -re, b), H = li(qe, de, Pe, St, h, -re, b), o.lineTo(D.cx + D.x01, D.cy + D.y01), re < U ? o.arc(D.cx, D.cy, re, Me(D.y01, D.x01), Me(H.y01, H.x01), !b) : (o.arc(D.cx, D.cy, re, Me(D.y01, D.x01), Me(D.y11, D.x11), !b), o.arc(0, 0, h, Me(D.cy + D.y11, D.cx + D.x11), Me(H.cy + H.y11, H.cx + H.x11), b), o.arc(H.cx, H.cy, re, Me(H.y11, H.x11), Me(H.y01, H.x01), !b))) : o.arc(0, 0, h, F, M, b); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, p = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; - return [Sn(p) * f, Dt(p) * f]; + var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, d = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Yr / 2; + return [Cn(d) * f, Pt(d) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : qe(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : Fe(+f), u) : e; }, u.outerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : qe(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : Fe(+f), u) : t; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : qe(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Fe(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : qe(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Fe(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : qe(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Fe(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : qe(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Fe(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : qe(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Fe(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function Jd(e) { +function Qd(e) { return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Zd(e, t) { +function ep(e, t) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Qd(e) { +function tp(e) { return e; } function as() { - var e = Qd, t = Zd, n = null, r = qe(0), i = qe(bi), s = qe(0); + var e = tp, t = ep, n = null, r = Fe(0), i = Fe(wi), s = Fe(0); function a(o) { - var l, u = (o = Jd(o)).length, f, p, h = 0, d = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(bi, Math.max(-bi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; + var l, u = (o = Qd(o)).length, f, d, h = 0, p = new Array(u), _ = new Array(u), x = +r.apply(this, arguments), y = Math.min(wi, Math.max(-wi, i.apply(this, arguments) - x)), b, O = Math.min(Math.abs(y) / u, s.apply(this, arguments)), N = O * (y < 0 ? -1 : 1), M; for (l = 0; l < u; ++l) - (S = y[d[l] = l] = +e(o[l], l, o)) > 0 && (h += S); - for (t != null ? d.sort(function(I, L) { - return t(y[I], y[L]); - }) : n != null && d.sort(function(I, L) { - return n(o[I], o[L]); - }), l = 0, p = h ? (m - u * M) / h : 0; l < u; ++l, b = $) - f = d[l], S = y[f], $ = b + (S > 0 ? S * p : 0) + M, y[f] = { + (M = _[p[l] = l] = +e(o[l], l, o)) > 0 && (h += M); + for (t != null ? p.sort(function(F, W) { + return t(_[F], _[W]); + }) : n != null && p.sort(function(F, W) { + return n(o[F], o[W]); + }), l = 0, d = h ? (y - u * N) / h : 0; l < u; ++l, x = b) + f = p[l], M = _[f], b = x + (M > 0 ? M * d : 0) + N, _[f] = { data: o[f], index: l, - value: S, - startAngle: b, - endAngle: $, - padAngle: D + value: M, + startAngle: x, + endAngle: b, + padAngle: O }; - return y; + return _; } return a.value = function(o) { - return arguments.length ? (e = typeof o == "function" ? o : qe(+o), a) : e; + return arguments.length ? (e = typeof o == "function" ? o : Fe(+o), a) : e; }, a.sortValues = function(o) { return arguments.length ? (t = o, n = null, a) : t; }, a.sort = function(o) { return arguments.length ? (n = o, t = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : qe(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Fe(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : qe(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Fe(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : qe(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Fe(+o), a) : s; }, a; } -function Mr(e, t, n) { +function Dr(e, t, n) { this.k = e, this.x = t, this.y = n; } -Mr.prototype = { - constructor: Mr, +Dr.prototype = { + constructor: Dr, scale: function(e) { - return e === 1 ? this : new Mr(this.k * e, this.x, this.y); + return e === 1 ? this : new Dr(this.k * e, this.x, this.y); }, translate: function(e, t) { - return e === 0 & t === 0 ? this : new Mr(this.k, this.x + this.k * e, this.y + this.k * t); + return e === 0 & t === 0 ? this : new Dr(this.k, this.x + this.k * e, this.y + this.k * t); }, apply: function(e) { return [e[0] * this.k + this.x, e[1] * this.k + this.y]; @@ -4838,61 +4838,73 @@ Mr.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Mr.prototype; -var ep = /* @__PURE__ */ ju(''); -const tp = { +Dr.prototype; +var np = /* @__PURE__ */ Zu(''); +const rp = { hash: "svelte-80ulj4", code: `.pie-chart-svg.svelte-80ulj4 {width:100%;height:100%;max-width:700px;max-height:60vh;aspect-ratio:1 / 1; /* For a perfect circle, use 1:1 ratio */margin:0 auto;display:block;} @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function wl(e, t) { - zi(t, !0), Hs(e, tp); - let n = se(t, "jsonData", 7), r = se(t, "currentRound", 7, 1), i = se(t, "mouseEventType", 15), s = se(t, "mouseData", 15), a = se(t, "mouseX", 15), o = se(t, "mouseY", 15), l = se(t, "requestRoundChange", 7, (c) => { - }), u = se(t, "candidateColors", 23, () => []), f = se(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = se(t, "firstRoundDeterminesPercentages", 7, !1), h = se(t, "randomizeOrder", 7, !1), d = se(t, "displayPhase", 15, 0); - function y(c) { +function xl(e, t) { + qi(t, !0), Hs(e, rp); + let n = ie(t, "jsonData", 7), r = ie(t, "currentRound", 7, 1), i = ie(t, "mouseEventType", 15), s = ie(t, "mouseData", 15), a = ie(t, "mouseX", 15), o = ie(t, "mouseY", 15), l = ie(t, "requestRoundChange", 7, (c) => { + }), u = ie(t, "requestSkipToRound", 7, (c) => { + }), f = ie(t, "candidateColors", 23, () => []), d = ie(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = ie(t, "firstRoundDeterminesPercentages", 7, !1), p = ie(t, "randomizeOrder", 7, !1), _ = ie(t, "displayPhase", 15, 0); + function x(c) { return c.isTransfer ? `${c.label}__transfer` : c.transferIndex != null ? `${c.label}__${c.transferIndex}` : c.label; } - const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", I = "PieOutline", L = "Donut", U = "TextLayer", ae = "url(#cross-hatch)", Q = 1.15, G = 750, oe = 800, ue = "white", O = 1, F = "#ff00ff", Ne = 3; - function ft(c) { + const y = 800, b = 800, O = Math.min(y, b) * 0.3, N = y / 2, M = b / 2, F = "Pie", W = "PieOutline", I = "Donut", ee = "TextLayer", fe = "url(#cross-hatch)", U = 1.15, re = 750, le = 800, D = "white", H = 1, te = "#ff00ff", je = 3; + function qe(c) { return "hatch-" + c.replace(/[^a-zA-Z0-9]/g, "-"); } - let me = [], ye = [], te = [], ke = 0, Y = 0; - const Oe = {}, St = "No Further Rankings"; - let ie = /* @__PURE__ */ $e(null); - function Je() { - const c = fe(x(ie)); - c.select("#" + S).remove(), c.select("#" + I).remove(), c.select("#" + L).remove(), c.select("#" + U).remove(); + let de = [], ce = [], _e = [], at = 0, G = 0; + const Pe = {}, St = "No Further Rankings"; + let Z = /* @__PURE__ */ $e(null); + function hn() { + const c = he($(Z)); + c.select("#" + F).remove(), c.select("#" + W).remove(), c.select("#" + I).remove(), c.select("#" + ee).remove(); } - function yt(c) { - l() && (_e = c, l()(c)); + function Ct(c) { + l() && (oe = c, l()(c)); } - function Ze(c) { - Je(), te = Tn(c), me = ea(c, S, te, D, M, 0, ge()), ea(c, I, te, D, M, 0, ge(), !1, !1, !0), Er(); + function dn(c) { + var m; + if (!((m = n()) != null && m.results) || c < 1 || c > n().results.length) return !1; + const g = n().results[c - 1].tallyResults; + return g.length > 0 && g.some((A) => Object.keys(A.transfers).length > 0); + } + function Wt(c) { + for (let g = c; g < n().results.length; g++) + if (dn(g)) return g; + return n().results.length; } - nf(() => { - pn(), setTimeout( + function vt(c) { + hn(), _e = En(c), de = ta(c, F, _e, N, M, 0, Je()), ta(c, W, _e, N, M, 0, Je(), !1, !1, !0), Rr(); + } + sf(() => { + kt(), setTimeout( () => { - Ze(r()); + vt(r()); }, 0 ); }); - function Tn(c) { - const g = Gt(c); - return ke = Jn(c), g; + function En(c) { + const g = Rn(c); + return at = Gi(c), g; } - function ge() { - return $; + function Je() { + return O; } - function Nt() { - return ge() * 1.41; + function $r() { + return Je() * 1.41; } - function Ut(c) { + function Ar(c) { let g = 0; - for (let _ = 1; _ < c; _++) { - const A = n().results[_ - 1].tallyResults; + for (let m = 1; m < c; m++) { + const A = n().results[m - 1].tallyResults; for (let E = 0; E < A.length; E++) { const T = A[E].transfers; if (T) { @@ -4903,379 +4915,382 @@ function wl(e, t) { } return g; } - function jr(c, g) { - if (c === "exhausted") return Ut(g); + function Tn(c, g) { + if (c === "exhausted") return Ar(g); { - const _ = n().results[g - 1].tally; - return Number(_[c]); + const m = n().results[g - 1].tally; + return Number(m[c]); } } - function Jr(c, g) { - return jr(c, g).toLocaleString("en-US"); + function Jn(c, g) { + return Tn(c, g).toLocaleString("en-US"); } function Zr(c, g) { - const _ = p() ? ke : ji(g); - return (jr(c, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + const m = h() ? at : Ki(g); + return (Tn(c, g) / m).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function Jn(c) { + function Gi(c) { const g = n().results[c - 1].tally; - let _ = 0; + let m = 0; for (let [A, E] of Object.entries(g)) - _ += Number(E); - return _; + m += Number(E); + return m; } - function kt(c) { + function Nt(c) { return c === "exhausted" || c === "Inactive Ballots"; } - function ji(c) { + function Ki(c) { const g = n().results[c - 1].tally; - let _ = 0; + let m = 0; for (let [A, E] of Object.entries(g)) - kt(A) || (_ += Number(E)); - return _; + Nt(A) || (m += Number(E)); + return m; } - function Qr(c, g) { + function w(c, g) { if (!c || c < 1 || c > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; - if (f() && c === n().results.length) + if (d() && c === n().results.length) return []; - const _ = n().results[c - 1].tallyResults, A = []; - for (let E = 0; E < _.length; E++) { - const T = _[E][g]; + const m = n().results[c - 1].tallyResults, A = []; + for (let E = 0; E < m.length; E++) { + const T = m[E][g]; T != null && A.push(T); } return A; } - function dn(c) { - return Qr(c, "eliminated"); + function Y(c) { + return w(c, "eliminated"); } - function br(c) { + function se(c) { let g = []; - for (let _ = 1; _ <= c; _++) g = g.concat(Qr(_, "elected")); + for (let m = 1; m <= c; m++) g = g.concat(w(m, "elected")); return [...new Set(g)]; } - function w(c, g) { - const _ = n().results[g - 1].tallyResults; + function we(c, g) { + const m = n().results[g - 1].tallyResults; let A = 0; - const E = _.findIndex((T) => (T == null ? void 0 : T.elected) && c == T.elected); + const E = m.findIndex((T) => (T == null ? void 0 : T.elected) && c == T.elected); if (E >= 0) { - const T = _[E].transfers; + const T = m[E].transfers; if (T) - for (let [P, z] of Object.entries(T)) A += Number(z); + for (let [P, V] of Object.entries(T)) A += Number(V); } else return 0; return A; } - function B(c) { - if (c < 1 || c > n().results.length) return !1; - const g = n().results[c - 1].tallyResults; - return g.length > 0 && g.some((_) => Object.keys(_.transfers).length > 0); - } - function ee(c, g) { - c.some((_) => kt(_.label)) || c.push({ label: "exhausted", value: Ut(g) }); + function ye(c, g) { + c.some((m) => Nt(m.label)) || c.push({ label: "exhausted", value: Ar(g) }); } - function pe(c) { + function ue(c) { let g = c | 0; return () => { g = g + 1831565813 | 0; - let _ = Math.imul(g ^ g >>> 15, 1 | g); - return _ = _ + Math.imul(_ ^ _ >>> 7, 61 | _) ^ _, ((_ ^ _ >>> 14) >>> 0) / 4294967296; + let m = Math.imul(g ^ g >>> 15, 1 | g); + return m = m + Math.imul(m ^ m >>> 7, 61 | m) ^ m, ((m ^ m >>> 14) >>> 0) / 4294967296; }; } - function we(c) { + function Ve(c) { let g = 5381; - for (let _ = 0; _ < c.length; _++) - g = (g << 5) + g + c.charCodeAt(_) | 0; + for (let m = 0; m < c.length; m++) + g = (g << 5) + g + c.charCodeAt(m) | 0; return g; } - function le(c) { + function Ut(c) { var E; if (c.length <= 3) return c; - const g = we(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = pe(g), A = [...c]; + const g = Ve(((E = n().config) == null ? void 0 : E.contest) ?? ""), m = ue(g), A = [...c]; for (let T = A.length - 1; T > 0; T--) { - const P = Math.floor(_() * (T + 1)); + const P = Math.floor(m() * (T + 1)); [A[T], A[P]] = [A[P], A[T]]; } return A; } - function Fe() { - const c = Object.keys(n().results[0].tally), g = c.filter((E) => !kt(E)), _ = c.filter((E) => kt(E)); - return [...h() ? le(g) : g, ..._]; + function gt() { + const c = Object.keys(n().results[0].tally), g = c.filter((E) => !Nt(E)), m = c.filter((E) => Nt(E)); + return [...p() ? Ut(g) : g, ...m]; } - function Gt(c) { - const g = n().results[c - 1].tally, _ = []; - for (const A of Fe()) - A in g && _.push({ label: A, value: Number(g[A]) }); - return ee(_, c), _; + function Rn(c) { + const g = n().results[c - 1].tally, m = []; + for (const A of gt()) + A in g && m.push({ label: A, value: Number(g[A]) }); + return ye(m, c), m; } - function Mt(c) { - const g = n().results[c - 1].tally, _ = []; - for (const A of Fe()) - _.push({ label: A, value: Number(g[A] ?? 0) }); - return ee(_, c), _; + function pn(c) { + const g = n().results[c - 1].tally, m = []; + for (const A of gt()) + m.push({ label: A, value: Number(g[A] ?? 0) }); + return ye(m, c), m; } - function Cn(c, g) { - const _ = []; + function ze(c, g) { + const m = []; for (const A of c) { if (A.label === "exhausted" || A.isTransfer) { - _.push(A); + m.push(A); continue; } - const E = w(A.label, g); - E > 0 ? (_.push({ + const E = we(A.label, g); + E > 0 ? (m.push({ label: A.label, value: E, isTransfer: !0 - }), _.push({ ...A, value: A.value - E })) : _.push(A); + }), m.push({ ...A, value: A.value - E })) : m.push(A); } - return _; + return m; } - function pn() { - const c = fe(x(ie)).select("defs").select("#cross-hatch"); + function kt() { + const c = he($(Z)).select("defs").select("#cross-hatch"); let g = 0; - for (let [_, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Oe[_] = zd[g] : Oe[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Oe[_] = u()[g % u().length], g++; + for (let [m, A] of Object.entries(n().results[0].tally)) { + !f() || f().length === 0 ? g < 10 ? Pe[m] = Yd[g] : Pe[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Pe[m] = f()[g % f().length], g++; { const E = c.clone(!0); - E.attr("id", ft(_)).select("rect").attr("fill", Oe[_]), E.selectAll("circle").attr("fill", "#383838"); + E.attr("id", qe(m)).select("rect").attr("fill", Pe[m]), E.selectAll("circle").attr("fill", "#383838"); } } - Oe.exhausted = ae, Oe["Inactive Ballots"] = ae; + Pe.exhausted = fe, Pe["Inactive Ballots"] = fe; } - function He() { - fe(x(ie)).select("#" + L).remove(); + function ot() { + he($(Z)).select("#" + I).remove(); } - function Qe(c, g) { - const _ = xi("global").duration(oe); - g && _.on("end", g); - const A = Cn(te, c), T = as().sort(null).value((P) => P.value)(A); - ia(c, S, T, 0, ge()), ia(c, I, T, 0, ge(), !0), te = A, me = T, He(), Al(c), kl(), Pl(0, ge()), Er(); + function _t(c, g) { + const m = yi("global").duration(le); + g && m.on("end", g); + const A = ze(_e, c), T = as().sort(null).value((P) => P.value)(A); + sa(c, F, T, 0, Je()), sa(c, W, T, 0, Je(), !0), _e = A, de = T, ot(), Tl(c), Pl(), Ol(0, Je()), Rr(); } - function Me(c, g) { - const _ = xi("global").duration(oe); - g && _.on("end", g), El(c); + function Mt(c, g) { + const m = yi("global").duration(le); + g && m.on("end", g), Rl(c); } - function et(c, g) { - const _ = xi("global").duration(oe); - g && _.on("end", g), bl(c), $l(ge(), Nt()); + function mt(c, g) { + const m = yi("global").duration(le); + g && m.on("end", g), Al(c), El(Je(), $r()); } - let xe = !1, tt = []; - function Ie() { - Er(), xe = !1, tt.length === 0 && r() < n().results.length && !B(r()) && yt(r() + 1), ct(); + let xe = !1, De = []; + function Ee() { + Rr(), xe = !1, Gt(); } - function ct() { - if (tt.length === 0) { - _e !== r() && (r() === _e + 1 && _e > 0 && r() <= n().results.length ? (_e = r(), Pt(r())) : r() >= 1 && r() <= n().results.length && (_e = r(), d(0), Ze(r()))); + function Gt() { + if (De.length === 0) { + oe !== r() && (r() === oe + 1 && oe > 0 && r() <= n().results.length ? (oe = r(), Zn(r())) : r() >= 1 && r() <= n().results.length && (oe = r(), _(0), vt(r()))); return; } - const c = tt.shift(); + const c = De.shift(); switch (c.type) { case "round": { const g = c.round; - g === _e + 1 && _e > 0 && g <= n().results.length ? (_e = g, Pt(g)) : (g !== _e && g >= 1 && g <= n().results.length && (_e = g, d(0), Ze(g)), ct()); + g === oe + 1 && oe > 0 && g <= n().results.length ? (oe = g, Zn(g)) : (g !== oe && g >= 1 && g <= n().results.length && (oe = g, _(0), vt(g)), Gt()); break; } case "step": - ei(); + Zs(); break; } } - function Pt(c) { + function Zn(c) { if (c <= 1 || c > n().results.length) { - ct(); + Gt(); return; } - xe = !0, Y = c, d(0), Qe(Y - 1, () => { - d(1), Me(Y - 1, () => { - d(2), et(Y, () => { - d(0), Ie(); + xe = !0, G = c, _(0), _t(G - 1, () => { + _(1), Mt(G - 1, () => { + _(2), mt(G, () => { + _(0), Ee(); }); }); }); } - function Zn() { - xe || (xe = !0, Y = r(), Rn()); + function Er() { + xe || (xe = !0, G = r(), Qn()); } - function Rn() { - if (d( + function Qn() { + if (_( 0 // if in the middle of "one small step" animation, reset to 0. - ), tt.length > 0) { - Ie(); - return; - } - if (!B(Y)) { - Y++, yt(Y), Ze(Y), Y < n().results.length ? Rn() : (d(0), Ie()); + ), De.length > 0) { + Ee(); return; } - const c = Y < n().results.length - 1 ? Rn : () => { - d(0), Ie(); + const c = G < n().results.length - 1 ? Qn : () => { + _(0), Ee(); }; - Qe(Y, () => { - d(1), Me(Y, () => { - d(2), Y++, yt(Y), et(Y, c); + _t(G, () => { + _(1), Mt(G, () => { + _(2), G++, Ct(G), mt(G, c); }); }); } Is(() => { - $r(); + Kt(); }); - let _e = 0; - function $r() { - if (_e != r()) { + let oe = 0; + function Kt() { + if (oe != r()) { if (xe) { - tt.push({ type: "round", round: r() }); + De.push({ type: "round", round: r() }); return; } - _e == r() - 1 && _e > 0 ? jt() : Kt(r()), _e = r(); + if (oe == r() - 1 && oe > 0) + if (dn(oe)) + $l(); + else { + const c = Wt(r()); + if (u()) { + oe = c, c < n().results.length ? u()(c + 1) : u()(c); + return; + } + } + else + ji(r()); + oe = r(); } } - function Kt(c) { + function ji(c) { if (xe) { - tt.push({ type: "round", round: c }); + De.push({ type: "round", round: c }); return; } - d(0), Ze(c); + _(0), vt(c); } - function jt() { + function $l() { if (xe) { - tt.push({ type: "round", round: r() }); + De.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (Y = r(), Y > n().results.length) { - Er(), xe = !1; + if (G = r(), G > n().results.length) { + Rr(), xe = !1; return; } - xe = !0, d() === 0 ? Qe(Y - 1, () => { - d(1), Me(Y - 1, () => { - d(2), et(Y, () => { - d(0), Ie(); + xe = !0, _() === 0 ? _t(G - 1, () => { + _(1), Mt(G - 1, () => { + _(2), mt(G, () => { + _(0), Ee(); }); }); - }) : d() === 1 ? Me(Y - 1, () => { - d(2), et(Y, () => { - d(0), Ie(); + }) : _() === 1 ? Mt(G - 1, () => { + _(2), mt(G, () => { + _(0), Ee(); }); - }) : d() === 2 && et(Y, () => { - d(0), Ie(); + }) : _() === 2 && mt(G, () => { + _(0), Ee(); }); } - function ei() { + function Zs() { if (r() > n().results.length) { - Er(), xe = !1; + Rr(), xe = !1; return; } if (xe) { - tt.push({ type: "step" }); + De.push({ type: "step" }); return; } - xe = !0, Y = r(), d() === 0 ? Qe(Y, () => { - d(1), Ie(); - }) : d() === 1 ? Me(Y, () => { - d(2), Ie(); - }) : d() === 2 ? (Y++, yt(Y), et(Y, () => { - d(0), Ie(); - })) : (xe = !1, console.warn("displayPhase out of range at ", d())); - } - function bl(c) { - te = Mt(c), me = na(c, S, te, 0, ge(), !0), na(c, I, te, 0, ge(), !1, !0); - } - function $l(c, g) { - const _ = fe(x(ie)).select("#" + L), E = fe(x(ie)).select("#" + S), T = {}; - for (const N of me) { - const k = N.data.label; - if (N.data.isTransfer) continue; - const C = E.select("#" + CSS.escape(y(N.data))); - C.empty() || (T[k] = { - oldStart: Number(C.attr("prevStart")), - oldEnd: Number(C.attr("prevEnd")), - newStart: N.startAngle, - newEnd: N.endAngle + xe = !0, G = r(), _() === 0 ? _t(G, () => { + _(1), Ee(); + }) : _() === 1 ? Mt(G, () => { + _(2), Ee(); + }) : _() === 2 ? (G++, Ct(G), mt(G, () => { + _(0), Ee(); + })) : (xe = !1, console.warn("displayPhase out of range at ", _())); + } + function Al(c) { + _e = pn(c), de = ra(c, F, _e, 0, Je(), !0), ra(c, W, _e, 0, Je(), !1, !0); + } + function El(c, g) { + const m = he($(Z)).select("#" + I), E = he($(Z)).select("#" + F), T = {}; + for (const C of de) { + const k = C.data.label; + if (C.data.isTransfer) continue; + const R = E.select("#" + CSS.escape(x(C.data))); + R.empty() || (T[k] = { + oldStart: Number(R.attr("prevStart")), + oldEnd: Number(R.attr("prevEnd")), + newStart: C.startAngle, + newEnd: C.endAngle }); } - const P = _.selectAll(".slice"); - let z = P.size(); - function q() { - z--, z === 0 && Ml(); + const P = m.selectAll(".slice"); + let V = P.size(); + function L() { + V--, V === 0 && Dl(); } - P.select("path").transition("global").duration(G).attrTween("d", function(N) { - const k = N.startAngle, C = N.endAngle, R = C - k, Pe = T[N.data.label]; - let Z, Ye; - if (Pe) { - const Qn = (Pe.oldStart + Pe.oldEnd) / 2, Il = (Pe.newStart + Pe.newEnd) / 2, Ll = k - Qn; - Z = Il + Ll, Ye = Z + R; + P.select("path").transition("global").duration(re).attrTween("d", function(C) { + const k = C.startAngle, R = C.endAngle, S = R - k, ke = T[C.data.label]; + let Q, He; + if (ke) { + const er = (ke.oldStart + ke.oldEnd) / 2, ql = (ke.newStart + ke.newEnd) / 2, Vl = k - er; + Q = ql + Vl, He = Q + S; } else - Z = k, Ye = C; - const ne = Zt(k, Z), Ee = Zt(C, Ye), ni = Zt(g, c), Tr = wt(); - return function(Qn) { - return Tr.innerRadius(Math.min(ni(Qn), c) - 1).outerRadius(ni(Qn)).startAngle(ne(Qn)).endAngle(Ee(Qn)), Tr(N); + Q = k, He = R; + const ae = Jt(k, Q), Te = Jt(R, He), ei = Jt(g, c), Sr = yt(); + return function(er) { + return Sr.innerRadius(Math.min(ei(er), c) - 1).outerRadius(ei(er)).startAngle(ae(er)).endAngle(Te(er)), Sr(C); }; - }).on("end", (N) => q()); - } - function Al(c) { - const g = Cl(c, me); - ye = ta(c, L, g, D, M, ge(), Nt(), !1, !0); - const _ = fe(x(ie)); - _.select("#" + S).raise(), _.select("#" + I).raise(); - } - function El(c) { - const g = Sl(c, ye, me); - ye = sa(c, L, g, ge(), Nt(), !1); - } - function Ar(c) { - return Oe[c.data.label]; + }).on("end", (C) => L()); } function Tl(c) { - const g = {}, _ = n().results[c - 1].tallyResults; - for (let A = 0; A < _.length; A++) { - let E = _[A].eliminated; - if (E === void 0 && (E = _[A].elected), E === void 0) { + const g = Cl(c, de); + ce = na(c, I, g, N, M, Je(), $r(), !1, !0); + const m = he($(Z)); + m.select("#" + F).raise(), m.select("#" + W).raise(); + } + function Rl(c) { + const g = kl(c, ce, de); + ce = aa(c, I, g, Je(), $r(), !1); + } + function Tr(c) { + return Pe[c.data.label]; + } + function Sl(c) { + const g = {}, m = n().results[c - 1].tallyResults; + for (let A = 0; A < m.length; A++) { + let E = m[A].eliminated; + if (E === void 0 && (E = m[A].elected), E === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const T = _[A].transfers; + const T = m[A].transfers; if (T === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [P, z] of Object.entries(T)) - g[P] === void 0 ? g[P] = Number(z) : g[P] += Number(z); + for (let [P, V] of Object.entries(T)) + g[P] === void 0 ? g[P] = Number(V) : g[P] += Number(V); } return g; } function Cl(c, g) { - const _ = [], A = ke, E = n().results[c - 1].tallyResults; + const m = [], A = at, E = n().results[c - 1].tallyResults; for (let T = 0; T < E.length; T++) { let P = E[T].eliminated; if (P === void 0 && (P = E[T].elected), P === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const z = E[T].transfers; - if (z === void 0) { + const V = E[T].transfers; + if (V === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let q = g.find((k) => k.data.label == P && k.data.isTransfer); - q === void 0 && (q = g.find((k) => k.data.label == P && !k.data.isTransfer)); - let N = 0; - if (q) N = q.startAngle; + let L = g.find((k) => k.data.label == P && k.data.isTransfer); + L === void 0 && (L = g.find((k) => k.data.label == P && !k.data.isTransfer)); + let C = 0; + if (L) C = L.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [k, C] of Object.entries(z)) { - let R; - const Pe = g.find((ne) => ne.data.label == k); - if (Pe) - R = structuredClone(Pe); + for (let [k, R] of Object.entries(V)) { + let S; + const ke = g.find((ae) => ae.data.label == k); + if (ke) + S = structuredClone(ke); else if (k == "exhausted") - R = { - data: { label: k, value: Number(C) }, + S = { + data: { label: k, value: Number(R) }, value: 0, index: 0, startAngle: 0, @@ -5288,166 +5303,166 @@ function wl(e, t) { console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Ye = Number(C) / A * 2 * Math.PI; - R.startAngle = N, N = R.endAngle = N + Ye, R.index = T, R.data.transferIndex = T, _.push(R); + const He = Number(R) / A * 2 * Math.PI; + S.startAngle = C, C = S.endAngle = C + He, S.index = T, S.data.transferIndex = T, m.push(S); } } - return _; + return m; } - function Rl(c, g, _) { + function Nl(c, g, m) { const A = {}; for (let [E, T] of Object.entries(c)) { - const P = _.find((N) => E == N.data.label); + const P = m.find((C) => E == C.data.label); if (P === void 0) { E !== "residual surplus" && console.warn("getTransferStartAngles: mainPieObj not found for ", E); continue; } - const z = (P.startAngle + P.endAngle) / 2, q = c[P.data.label] / g * 2 * Math.PI; - A[P.data.label] = z - q / 2; + const V = (P.startAngle + P.endAngle) / 2, L = c[P.data.label] / g * 2 * Math.PI; + A[P.data.label] = V - L / 2; } return A; } - function Sl(c, g, _) { - const A = [], E = ke, T = Tl(c), P = Rl(T, E, _); - for (let [z, q] of g.entries()) { - const N = structuredClone(q), k = q.endAngle - q.startAngle, C = _.find((R) => q.data.label === R.data.label && !R.data.isTransfer); - if (C) { - const R = C.data.label; - N.startAngle = P[R], P[R] += k, N.endAngle = N.startAngle + k; - } else if (q.data.label === "exhausted") - N.startAngle = q.startAngle, N.endAngle = q.endAngle; + function kl(c, g, m) { + const A = [], E = at, T = Sl(c), P = Nl(T, E, m); + for (let [V, L] of g.entries()) { + const C = structuredClone(L), k = L.endAngle - L.startAngle, R = m.find((S) => L.data.label === S.data.label && !S.data.isTransfer); + if (R) { + const S = R.data.label; + C.startAngle = P[S], P[S] += k, C.endAngle = C.startAngle + k; + } else if (L.data.label === "exhausted") + C.startAngle = L.startAngle, C.endAngle = L.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", L.data.label); continue; } - N.index = z, A.push(N); + C.index = V, A.push(C); } return A; } - function Zs(c, g, _, A) { - const E = wt().innerRadius(_ * Q).outerRadius(_ * Q), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); + function Qs(c, g, m, A) { + const E = yt().innerRadius(m * U).outerRadius(m * U), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], V = A.append("g").attr("opacity", 0); for (const k of T) { - const C = k.data.label === "exhausted" ? St : k.data.label, R = E.centroid(k), Pe = ti(k.startAngle, k.endAngle), Z = Jr(k.data.label, c); - let Ye; - !p() && kt(k.data.label) ? Ye = Z : Ye = Z + " (" + Zr(k.data.label, c) + ")"; - const ne = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", Pe).text(C); - ne.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Ye); - const Ee = ne.node().getBBox(); + const R = k.data.label === "exhausted" ? St : k.data.label, S = E.centroid(k), ke = Qr(k.startAngle, k.endAngle), Q = Jn(k.data.label, c); + let He; + !h() && Nt(k.data.label) ? He = Q : He = Q + " (" + Zr(k.data.label, c) + ")"; + const ae = V.append("text").attr("transform", `translate(${S})`).attr("text-anchor", ke).text(R); + ae.append("tspan").attr("x", 0).attr("dy", "1.2em").text(He); + const Te = ae.node().getBBox(); P.push({ label: k.data.label, value: k.data.value, - bbox: new DOMRect(Ee.x + R[0], Ee.y + R[1], Ee.width, Ee.height) + bbox: new DOMRect(Te.x + S[0], Te.y + S[1], Te.width, Te.height) }); } - z.remove(), P.sort((k, C) => C.value - k.value); - const q = [], N = /* @__PURE__ */ new Set(); + V.remove(), P.sort((k, R) => R.value - k.value); + const L = [], C = /* @__PURE__ */ new Set(); for (const k of P) - q.some((R) => k.bbox.left < R.right && k.bbox.right > R.left && k.bbox.top < R.bottom && k.bbox.bottom > R.top) || (N.add(k.label), q.push(k.bbox)); - return N; - } - function Qs(c, g, _, A, E, T) { - const z = fe(x(ie)).append("g").attr("id", U).attr("transform", `translate(${_}, ${A})`), q = wt().innerRadius(E * Q).outerRadius(E * Q), N = Zs(c, g, E, z); - z.selectAll("text").data(g).enter().each(function(k) { - !k.data.isTransfer && N.has(k.data.label) && fe(this).append("g").attr("id", (C) => y(C.data)).classed("eliminated", (C) => T.includes(C.data.label) || C.data.isTransfer === !0).each(function(C, R) { - C.data.label === "exhausted" && fe(this).on("mouseenter", (Pe, Z) => Dl(Pe)).on("mouseleave", (Pe, Z) => Ol()); - }).append("text").attr("transform", (C) => `translate(${q.centroid(C)})`).attr("text-anchor", (C) => ti(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? St : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { - const R = Jr(C.data.label, c); - return !p() && kt(C.data.label) ? R : R + " (" + Zr(C.data.label, c) + ")"; + L.some((S) => k.bbox.left < S.right && k.bbox.right > S.left && k.bbox.top < S.bottom && k.bbox.bottom > S.top) || (C.add(k.label), L.push(k.bbox)); + return C; + } + function ea(c, g, m, A, E, T) { + const V = he($(Z)).append("g").attr("id", ee).attr("transform", `translate(${m}, ${A})`), L = yt().innerRadius(E * U).outerRadius(E * U), C = Qs(c, g, E, V); + V.selectAll("text").data(g).enter().each(function(k) { + !k.data.isTransfer && C.has(k.data.label) && he(this).append("g").attr("id", (R) => x(R.data)).classed("eliminated", (R) => T.includes(R.data.label) || R.data.isTransfer === !0).each(function(R, S) { + R.data.label === "exhausted" && he(this).on("mouseenter", (ke, Q) => Fl(ke)).on("mouseleave", (ke, Q) => Il()); + }).append("text").attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Qr(R.startAngle, R.endAngle)).text((R) => R.data.label === "exhausted" ? St : R.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((R) => { + const S = Jn(R.data.label, c); + return !h() && Nt(R.data.label) ? S : S + " (" + Zr(R.data.label, c) + ")"; }); }); } - function Nl(c, g, _, A) { - const T = fe(x(ie)).select("#" + U), P = Zs(c, g, _, T); - T.selectAll("g").each(function(R) { - R && R.data && !R.data.isTransfer && !P.has(R.data.label) && fe(this).remove(); + function Ml(c, g, m, A) { + const T = he($(Z)).select("#" + ee), P = Qs(c, g, m, T); + T.selectAll("g").each(function(S) { + S && S.data && !S.data.isTransfer && !P.has(S.data.label) && he(this).remove(); }); - const z = T.selectAll("tspan"), q = T.selectAll("g").data(g, (R) => y(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), N = wt().innerRadius(_ * Q).outerRadius(_ * Q + 1); - z.transition("global").duration(G).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ti(R.startAngle, R.endAngle)), q.select("text").transition("global").duration(G).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ti(R.startAngle, R.endAngle)).on("end", (R) => C()); - let k = q.size(); - function C(R) { - k--, k === 0 && (T.remove(), Qs(c, g, D, M, _, A)); + const V = T.selectAll("tspan"), L = T.selectAll("g").data(g, (S) => x(S.data)).classed("eliminated", (S) => A.includes(S.data.label) || S.data.isTransfer === !0), C = yt().innerRadius(m * U).outerRadius(m * U + 1); + V.transition("global").duration(re).attr("transform", (S) => `translate(${C.centroid(S)})`).attr("text-anchor", (S) => Qr(S.startAngle, S.endAngle)), L.select("text").transition("global").duration(re).attr("transform", (S) => `translate(${C.centroid(S)})`).attr("text-anchor", (S) => Qr(S.startAngle, S.endAngle)).on("end", (S) => R()); + let k = L.size(); + function R(S) { + k--, k === 0 && (T.remove(), ea(c, g, N, M, m, A)); } } - function ea(c, g, _, A, E, T, P, z = !0, q = !1, N = !1) { - const C = as().sort(null).value((R) => R.value)(_); - return ta(c, g, C, A, E, T, P, z, q, N), C; - } - function Er() { - fe(x(ie)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${Ne}px`); - } - function ta(c, g, _, A, E, T, P, z, q, N = !1) { - const k = dn(c), C = br(c), Z = fe(x(ie)).attr("viewBox", `0 0 ${b} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (ne) => k.includes(ne.data.label) || ne.data.isTransfer === !0).classed("elected", (ne) => C.includes(ne.data.label) && !ne.data.isTransfer).attr("id", (ne) => y(ne.data)); - N ? Z.style("pointer-events", "none") : Z.on("mouseenter", (ne, Ee) => Zi(ne, Ee)).on("mouseleave", (ne, Ee) => Qi(ne, Ee)); - const Ye = wt().outerRadius(P).innerRadius(T); - if (q) { - const ne = wt().outerRadius(T + 1).innerRadius(T); - Z.append("path").attr("d", ne).attr("stroke", N ? "none" : T === 0 ? ue : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Ee) => Ar(Ee)).transition("global").duration(G).attr("d", (Ee) => Ye(Ee)).on("end", (Ee) => { - N || Ji(); + function ta(c, g, m, A, E, T, P, V = !0, L = !1, C = !1) { + const R = as().sort(null).value((S) => S.value)(m); + return na(c, g, R, A, E, T, P, V, L, C), R; + } + function Rr() { + he($(Z)).select("#" + W).selectAll(".elected").select("path").style("stroke", te).style("stroke-width", `${je}px`); + } + function na(c, g, m, A, E, T, P, V, L, C = !1) { + const k = Y(c), R = se(c), Q = he($(Z)).attr("viewBox", `0 0 ${y} ${b}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (ae) => k.includes(ae.data.label) || ae.data.isTransfer === !0).classed("elected", (ae) => R.includes(ae.data.label) && !ae.data.isTransfer).attr("id", (ae) => x(ae.data)); + C ? Q.style("pointer-events", "none") : Q.on("mouseenter", (ae, Te) => Zi(ae, Te)).on("mouseleave", (ae, Te) => Qi(ae, Te)); + const He = yt().outerRadius(P).innerRadius(T); + if (L) { + const ae = yt().outerRadius(T + 1).innerRadius(T); + Q.append("path").attr("d", ae).attr("stroke", C ? "none" : T === 0 ? D : "none").attr("stroke-width", C ? 0 : T === 0 ? H : 0).attr("fill", C ? "none" : (Te) => Tr(Te)).transition("global").duration(re).attr("d", (Te) => He(Te)).on("end", (Te) => { + C || Ji(); }); } else - Z.append("path").attr("d", (ne) => Ye(ne)).attr("fill", N ? "none" : (ne) => Ar(ne)).attr("stroke", N ? "none" : ue).attr("stroke-width", N ? 0 : O), N || Ji(); - return z && !N && Qs(c, _, A, E, P, k), _; - } - function kl() { - const _ = fe(x(ie)).select("#" + U).selectAll(".eliminated"); - _.size() > 0 && _.classed("finished", !0); - } - function Ml() { - const _ = fe(x(ie)).select("#" + U).selectAll(".finished"); - _.size() > 0 && _.remove(); - } - function Pl(c, g) { - const E = fe(x(ie)).select("#" + S).selectAll(".eliminated"), T = wt().innerRadius(c), P = wt().outerRadius(g); - E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(G).attrTween("d", function(z) { - const q = Zt(g, c); - return function(N) { - return P.innerRadius(q(N)), P(z); + Q.append("path").attr("d", (ae) => He(ae)).attr("fill", C ? "none" : (ae) => Tr(ae)).attr("stroke", C ? "none" : D).attr("stroke-width", C ? 0 : H), C || Ji(); + return V && !C && ea(c, m, A, E, P, k), m; + } + function Pl() { + const m = he($(Z)).select("#" + ee).selectAll(".eliminated"); + m.size() > 0 && m.classed("finished", !0); + } + function Dl() { + const m = he($(Z)).select("#" + ee).selectAll(".finished"); + m.size() > 0 && m.remove(); + } + function Ol(c, g) { + const E = he($(Z)).select("#" + F).selectAll(".eliminated"), T = yt().innerRadius(c), P = yt().outerRadius(g); + E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(re).attrTween("d", function(V) { + const L = Jt(g, c); + return function(C) { + return P.innerRadius(L(C)), P(V); }; - }).attr("fill", (z) => `url(#${ft(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(G).attrTween("d", function(z) { - const q = Zt(g, c); - return function(N) { - return T.outerRadius(q(N)), T(z); + }).attr("fill", (V) => `url(#${qe(V.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(re).attrTween("d", function(V) { + const L = Jt(g, c); + return function(C) { + return T.outerRadius(L(C)), T(V); }; - }).attr("fill", (z) => Ar(z)); + }).attr("fill", (V) => Tr(V)); } - function ti(c, g) { - const _ = (c + g) / 2; - return _ > Math.PI * 11 / 6 || _ < Math.PI * 1 / 6 || _ > Math.PI * 5 / 6 && _ < Math.PI * 7 / 6 ? "middle" : _ < Math.PI ? "start" : "end"; + function Qr(c, g) { + const m = (c + g) / 2; + return m > Math.PI * 11 / 6 || m < Math.PI * 1 / 6 || m > Math.PI * 5 / 6 && m < Math.PI * 7 / 6 ? "middle" : m < Math.PI ? "start" : "end"; } function Ji() { - fe(x( - ie + he($( + Z // force redisplay of text labels - )).select("#" + U).raise().append("g").remove(); - } - function na(c, g, _, A, E, T, P = !1) { - const q = as().sort(null).value((N) => N.value)(_); - return sa(c, g, q, A, E, T, P), q; - } - function ra(c, g, _, A, E = !1) { - const T = dn(c), P = br(c), N = fe(x(ie)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); - N.exit().remove(); - const k = N.enter().append("g").attr("class", "slice").attr("id", (C) => y(C.data)).classed("eliminated", !0); - return E ? k.style("pointer-events", "none") : k.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), k.append("path").attr("d", (C) => A(C)).attr("fill", E ? "none" : (C) => Ar(C)).attr("stroke", E ? "none" : ue).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (C) => T.includes(C.data.label)).classed("elected", (C) => P.includes(C.data.label)), E || N.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), N; - } - function ia(c, g, _, A, E, T = !1) { - const P = wt().outerRadius(E).innerRadius(A); - ra(c, g, _, P, T).select("path").attr("d", (q) => P(q)).attr("fill", T ? "none" : (q) => Ar(q)); - } - function sa(c, g, _, A, E, T, P = !1) { - const z = wt().outerRadius(E).innerRadius(A).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), q = wt().outerRadius(E).innerRadius(A); - fe(x(ie)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); - const C = ra(c, g, _, q, P); - let R = C.size(); - function Pe() { - R--, R <= 0 && (P || Ji()); + )).select("#" + ee).raise().append("g").remove(); + } + function ra(c, g, m, A, E, T, P = !1) { + const L = as().sort(null).value((C) => C.value)(m); + return aa(c, g, L, A, E, T, P), L; + } + function ia(c, g, m, A, E = !1) { + const T = Y(c), P = se(c), C = he($(Z)).select("#" + g).selectAll(".slice").data(m, (R) => x(R.data)); + C.exit().remove(); + const k = C.enter().append("g").attr("class", "slice").attr("id", (R) => x(R.data)).classed("eliminated", !0); + return E ? k.style("pointer-events", "none") : k.on("mouseenter", (R, S) => Zi(R, S)).on("mouseleave", (R, S) => Qi(R, S)), k.append("path").attr("d", (R) => A(R)).attr("fill", E ? "none" : (R) => Tr(R)).attr("stroke", E ? "none" : D).attr("stroke-width", E ? 0 : H), C.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => P.includes(R.data.label)), E || C.on("mouseenter", (R, S) => Zi(R, S)).on("mouseleave", (R, S) => Qi(R, S)), C; + } + function sa(c, g, m, A, E, T = !1) { + const P = yt().outerRadius(E).innerRadius(A); + ia(c, g, m, P, T).select("path").attr("d", (L) => P(L)).attr("fill", T ? "none" : (L) => Tr(L)); + } + function aa(c, g, m, A, E, T, P = !1) { + const V = yt().outerRadius(E).innerRadius(A).startAngle((Q) => Q.startAngle).endAngle((Q) => Q.endAngle), L = yt().outerRadius(E).innerRadius(A); + he($(Z)).select("#" + g).selectAll(".slice").attr("prevStart", (Q) => Q.startAngle).attr("prevEnd", (Q) => Q.endAngle); + const R = ia(c, g, m, L, P); + let S = R.size(); + function ke() { + S--, S <= 0 && (P || Ji()); } - return C.select("path").transition("global").duration(G).attrTween("d", function(Z) { - const Ye = Number(fe(this.parentNode).attr("prevStart")), ne = Number(fe(this.parentNode).attr("prevEnd")), Ee = Zt(Ye, Z.startAngle), ni = Zt(ne, Z.endAngle); - return (Tr) => (z.startAngle(Ee(Tr)).endAngle(ni(Tr)), z(Z)); - }).on("end", function(Z) { - Z.startAngle === Z.endAngle && fe(this).attr("stroke", "none"), Pe(); - }), T && !P && Nl(c, _, E, dn(c)), _; + return R.select("path").transition("global").duration(re).attrTween("d", function(Q) { + const He = Number(he(this.parentNode).attr("prevStart")), ae = Number(he(this.parentNode).attr("prevEnd")), Te = Jt(He, Q.startAngle), ei = Jt(ae, Q.endAngle); + return (Sr) => (V.startAngle(Te(Sr)).endAngle(ei(Sr)), V(Q)); + }).on("end", function(Q) { + Q.startAngle === Q.endAngle && he(this).attr("stroke", "none"), ke(); + }), T && !P && Ml(c, m, E, Y(c)), m; } function Zi(c, g) { s(g.data.label), i("enter"), a(c.clientX), o(c.clientY); @@ -5455,98 +5470,105 @@ function wl(e, t) { function Qi(c, g) { s(g.data.label), i("leave"); } - function Dl(c, g) { + function Fl(c, g) { i("show-exhausted"), a(c.clientX), o(c.clientY); } - function Ol(c, g) { + function Il(c, g) { i("hide-exhausted"); } - var Fl = { - pieColors: Oe, + var Ll = { + pieColors: Pe, exhaustedLabel: St, - countExhaustedVotes: Ut, - getEliminatedCandidates: dn, - getElectedCandidates: br, - runFullAnimationFn: Zn, - animateOnePhaseFn: ei, + countExhaustedVotes: Ar, + getEliminatedCandidates: Y, + getElectedCandidates: se, + runFullAnimationFn: Er, + animateOnePhaseFn: Zs, get jsonData() { return n(); }, set jsonData(c) { - n(c), re(); + n(c), ne(); }, get currentRound() { return r(); }, set currentRound(c = 1) { - r(c), re(); + r(c), ne(); }, get mouseEventType() { return i(); }, set mouseEventType(c) { - i(c), re(); + i(c), ne(); }, get mouseData() { return s(); }, set mouseData(c) { - s(c), re(); + s(c), ne(); }, get mouseX() { return a(); }, set mouseX(c) { - a(c), re(); + a(c), ne(); }, get mouseY() { return o(); }, set mouseY(c) { - o(c), re(); + o(c), ne(); }, get requestRoundChange() { return l(); }, set requestRoundChange(c = (g) => { }) { - l(c), re(); + l(c), ne(); }, - get candidateColors() { + get requestSkipToRound() { return u(); }, + set requestSkipToRound(c = (g) => { + }) { + u(c), ne(); + }, + get candidateColors() { + return f(); + }, set candidateColors(c = []) { - u(c), re(); + f(c), ne(); }, get excludeFinalWinnerAndEliminatedCandidate() { - return f(); + return d(); }, set excludeFinalWinnerAndEliminatedCandidate(c = !1) { - f(c), re(); + d(c), ne(); }, get firstRoundDeterminesPercentages() { - return p(); + return h(); }, set firstRoundDeterminesPercentages(c = !1) { - p(c), re(); + h(c), ne(); }, get randomizeOrder() { - return h(); + return p(); }, set randomizeOrder(c = !1) { - h(c), re(); + p(c), ne(); }, get displayPhase() { - return d(); + return _(); }, set displayPhase(c = 0) { - d(c), re(); + _(c), ne(); } - }, aa = ep(); - return gi(aa, (c) => he(ie, c), () => x(ie)), Ue(e, aa), Hi(Fl); + }, oa = np(); + return pi(oa, (c) => ve(Z, c), () => $(Z)), We(e, oa), Vi(Ll); } Ys( - wl, + xl, { jsonData: {}, currentRound: {}, @@ -5555,6 +5577,7 @@ Ys( mouseX: {}, mouseY: {}, requestRoundChange: {}, + requestSkipToRound: {}, candidateColors: {}, excludeFinalWinnerAndEliminatedCandidate: {}, firstRoundDeterminesPercentages: {}, @@ -5573,83 +5596,83 @@ Ys( ], { mode: "open" } ); -var np = /* @__PURE__ */ Xt("
"), rp = /* @__PURE__ */ Xt('
', 1), ip = /* @__PURE__ */ Xt('
'); -const sp = { +var ip = /* @__PURE__ */ Bt("
"), sp = /* @__PURE__ */ Bt('
', 1), ap = /* @__PURE__ */ Bt('
'); +const op = { hash: "svelte-1l4eyw0", code: ".stepper.svelte-1l4eyw0 {display:inline-flex;align-items:center;cursor:pointer;user-select:none;padding:4px 8px;border-radius:4px;}.stepper.svelte-1l4eyw0:hover:not(.disabled) {background-color:#f0f0f0;}.stepper.disabled.svelte-1l4eyw0 {cursor:default;opacity:0.4;}.step.svelte-1l4eyw0 {display:flex;align-items:center;gap:4px;}.dot.svelte-1l4eyw0 {width:10px;height:10px;border-radius:50%;border:2px solid #ccc;background:white;transition:background-color 0.3s, border-color 0.3s;}.dot.active.svelte-1l4eyw0 {background:#4747ff;border-color:#4747ff;}.dot.completed.svelte-1l4eyw0 {background:#8888ff;border-color:#8888ff;}.label.svelte-1l4eyw0 {font-size:0.75rem;color:#888;transition:color 0.3s, font-weight 0.3s;}.label.active.svelte-1l4eyw0 {color:#4747ff;font-weight:bold;}.label.completed.svelte-1l4eyw0 {color:#8888ff;}.connector.svelte-1l4eyw0 {width:20px;height:2px;background:#ccc;margin:0 4px;transition:background-color 0.3s;}.connector.completed.svelte-1l4eyw0 {background:#8888ff;}" }; -function xl(e, t) { - zi(t, !0), Hs(e, sp); - let n = se(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = se(t, "currentStep", 7, 0), i = se(t, "disabled", 7, !1), s = se(t, "onAdvance", 7, () => { +function bl(e, t) { + qi(t, !0), Hs(e, op); + let n = ie(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ie(t, "currentStep", 7, 0), i = ie(t, "disabled", 7, !1), s = ie(t, "onAdvance", 7, () => { }); function a() { i() || s()(); } - function o(p) { - (p.key === "Enter" || p.key === " ") && (p.preventDefault(), a()); + function o(d) { + (d.key === "Enter" || d.key === " ") && (d.preventDefault(), a()); } var l = { get labels() { return n(); }, - set labels(p = ["Eliminate", "Transfer", "Consolidate"]) { - n(p), re(); + set labels(d = ["Eliminate", "Transfer", "Consolidate"]) { + n(d), ne(); }, get currentStep() { return r(); }, - set currentStep(p = 0) { - r(p), re(); + set currentStep(d = 0) { + r(d), ne(); }, get disabled() { return i(); }, - set disabled(p = !1) { - i(p), re(); + set disabled(d = !1) { + i(d), ne(); }, get onAdvance() { return s(); }, - set onAdvance(p = () => { + set onAdvance(d = () => { }) { - s(p), re(); + s(d), ne(); } - }, u = ip(); + }, u = ap(); let f; - return u.__click = a, u.__keydown = o, vi(u, 21, n, pi, (p, h, d) => { - var y = rp(), b = _n(y); + return u.__click = a, u.__keydown = o, di(u, 21, n, hi, (d, h, p) => { + var _ = sp(), x = gn(_); { - var m = (U) => { - var ae = np(); - let Q; - Qt(() => Q = si(ae, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ue(U, ae); + var y = (I) => { + var ee = ip(); + let fe; + Zt(() => fe = ri(ee, 1, "connector svelte-1l4eyw0", null, fe, { completed: !i() && p <= r() })), We(I, ee); }; - er(b, (U) => { - d > 0 && U(m); + tr(x, (I) => { + p > 0 && I(y); }); } - var $ = nt(b, 2), D = Xe($); - let M; - var S = nt(D, 2); - let I; - var L = Xe(S, !0); - Le(S), Le($), Qt(() => { - M = si(D, 1, "dot svelte-1l4eyw0", null, M, { - active: !i() && d === r(), - completed: !i() && d < r() - }), I = si(S, 1, "label svelte-1l4eyw0", null, I, { - active: !i() && d === r(), - completed: !i() && d < r() - }), mn(L, x(h)); - }), Ue(p, y); - }), Le(u), Qt(() => { - f = si(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), xa(u, "tabindex", i() ? -1 : 0), xa(u, "aria-disabled", i()); - }), Ue(e, u), Hi(l); -} -Uu(["click", "keydown"]); -Ys(xl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var ap = /* @__PURE__ */ Xt(" ", 1), op = /* @__PURE__ */ Xt("About to eliminate: ", 1), lp = /* @__PURE__ */ Xt(" ", 1), up = /* @__PURE__ */ Xt(" ", 1), fp = /* @__PURE__ */ Xt('

', 1), cp = /* @__PURE__ */ Xt("
", 1), hp = /* @__PURE__ */ Xt('


these ballots have already been eliminated.
', 1); -const dp = { + var b = Ze(x, 2), O = Be(b); + let N; + var M = Ze(O, 2); + let F; + var W = Be(M, !0); + Oe(M), Oe(b), Zt(() => { + N = ri(O, 1, "dot svelte-1l4eyw0", null, N, { + active: !i() && p === r(), + completed: !i() && p < r() + }), F = ri(M, 1, "label svelte-1l4eyw0", null, F, { + active: !i() && p === r(), + completed: !i() && p < r() + }), _n(W, $(h)); + }), We(d, _); + }), Oe(u), Zt(() => { + f = ri(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ba(u, "tabindex", i() ? -1 : 0), ba(u, "aria-disabled", i()); + }), We(e, u), Vi(l); +} +Ku(["click", "keydown"]); +Ys(bl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); +var lp = /* @__PURE__ */ Bt(" ", 1), up = /* @__PURE__ */ Bt("About to eliminate: ", 1), fp = /* @__PURE__ */ Bt(" ", 1), cp = /* @__PURE__ */ Bt(" ", 1), hp = /* @__PURE__ */ Bt('

', 1), dp = /* @__PURE__ */ Bt("
", 1), pp = /* @__PURE__ */ Bt('


these ballots have already been eliminated.
', 1); +const vp = { hash: "svelte-1r6y5gl", code: `.page-container.svelte-1r6y5gl {width:95%;max-width:1800px;margin:0 auto;padding:0 20px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;}.common-header.svelte-1r6y5gl {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1r6y5gl {position:fixed;width:max-content;max-width:calc(100vw - 24px);text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;font-weight:normal;opacity:0;z-index:100;}.tooltip.svelte-1r6y5gl h3:where(.svelte-1r6y5gl) {text-align:center;}.animation-button-container.svelte-1r6y5gl {display:flex;justify-content:center;gap:10px;margin:0.5rem;}.pie-chart-container.svelte-1r6y5gl {width:100%;min-width:auto;flex-grow:0;margin:0 auto;margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:20px;} @@ -5664,12 +5687,13 @@ const dp = { }` }; -function pp(e, t) { - zi(t, !0), Hs(e, dp); +function gp(e, t) { + qi(t, !0), Hs(e, vp); const n = 0.85; - let r = se(t, "electionSummary", 7), i = se(t, "currentRound", 7, 1), s = se(t, "requestRoundChange", 7, (w) => { - }), a = se(t, "candidateColors", 23, () => []), o = se(t, "textForWinner", 7, "elected"), l = se(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = se(t, "firstRoundDeterminesPercentages", 7, !1), f = se(t, "randomizeOrder", 7, !1), p = se(t, "showCaptions", 7, !1); - const h = { + let r = ie(t, "electionSummary", 7), i = ie(t, "currentRound", 7, 1), s = ie(t, "requestRoundChange", 7, (w) => { + }), a = ie(t, "requestSkipToRound", 7, (w) => { + }), o = ie(t, "candidateColors", 23, () => []), l = ie(t, "textForWinner", 7, "elected"), u = ie(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), f = ie(t, "firstRoundDeterminesPercentages", 7, !1), d = ie(t, "randomizeOrder", 7, !1), h = ie(t, "showCaptions", 7, !1); + const p = { elected: { caption: "Elected", event: "was elected", @@ -5687,345 +5711,348 @@ function pp(e, t) { infinitive: "to take the lead" } }; - let d = /* @__PURE__ */ vn(() => h[o()] ?? h.elected), y = /* @__PURE__ */ $e(null), b = /* @__PURE__ */ $e(null), m = /* @__PURE__ */ $e(""), $ = /* @__PURE__ */ $e(Pn([])), D = /* @__PURE__ */ $e(""), M = /* @__PURE__ */ $e(""), S = /* @__PURE__ */ $e(0), I = /* @__PURE__ */ $e(0), L = /* @__PURE__ */ vn(() => U(r())); - function U(w) { + let _ = /* @__PURE__ */ Sn(() => p[l()] ?? p.elected), x = /* @__PURE__ */ $e(null), y = /* @__PURE__ */ $e(null), b = /* @__PURE__ */ $e(""), O = /* @__PURE__ */ $e(Pn([])), N = /* @__PURE__ */ $e(""), M = /* @__PURE__ */ $e(""), F = /* @__PURE__ */ $e(0), W = /* @__PURE__ */ $e(0), I = /* @__PURE__ */ Sn(() => ee(r())); + function ee(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (B) { - return console.error("Failed to parse JSON string:", B), {}; + } catch (Y) { + return console.error("Failed to parse JSON string:", Y), {}; } return w || {}; } - function ae(w) { + function fe(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(w, B, ee) { - w.style.left = B + "px", w.style.top = ee + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const le = w.getBoundingClientRect(); - let Fe = B, Gt = ee + 20; - Fe + le.width > window.innerWidth - 12 && (Fe = window.innerWidth - le.width - 12), Fe < 12 && (Fe = 12), Gt + le.height > window.innerHeight - 12 && (Gt = ee - le.height - 12), w.style.left = Fe + "px", w.style.top = Gt + "px"; + function U(w, Y, se) { + w.style.left = Y + "px", w.style.top = se + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const ue = w.getBoundingClientRect(); + let Ve = Y, Ut = se + 20; + Ve + ue.width > window.innerWidth - 12 && (Ve = window.innerWidth - ue.width - 12), Ve < 12 && (Ve = 12), Ut + ue.height > window.innerHeight - 12 && (Ut = se - ue.height - 12), w.style.left = Ve + "px", w.style.top = Ut + "px"; }); } - function G() { - switch (x(D)) { + function re() { + switch ($(N)) { case "enter": ((w) => { - var B = ru(w, 2); - he($, B[0], !0), he(m, B[1], !0); - })(ue(x(M), i())), x(y) && (Q(x(y), x(S) || 0, x(I) || 0), x(y).style.opacity = String(n)); + var Y = su(w, 2); + ve(O, Y[0], !0), ve(b, Y[1], !0); + })(D($(M), i())), $(x) && (U($(x), $(F) || 0, $(W) || 0), $(x).style.opacity = String(n)); break; case "leave": - x(y) && (x(y).style.opacity = "0"), he($, [], !0), he(m, ""); + $(x) && ($(x).style.opacity = "0"), ve(O, [], !0), ve(b, ""); break; case "show-exhausted": - x(b) && (Q(x(b), x(S) || 0, x(I) || 0), x(b).style.opacity = String(n)); + $(y) && (U($(y), $(F) || 0, $(W) || 0), $(y).style.opacity = String(n)); break; case "hide-exhausted": - x(b) && (x(b).style.opacity = "0"); + $(y) && ($(y).style.opacity = "0"); break; case "": break; default: - console.log("Unknown mouse event: ", x(D)); + console.log("Unknown mouse event: ", $(N)); break; } } - Is(() => G()); - function oe(w, B) { - return w === 1 ? B ? "vote was" : "vote will be" : B ? "votes were" : "votes will be"; - } - function ue(w, B) { - const ee = [], pe = w === "exhausted" ? St() : w; - let we; - w === "exhausted" ? we = Y(1) : we = x(L).results[0].tally[w], ee.push(`${pe} started with ${we} votes.`); - for (let le = 1; le <= B; le++) { - le === B && (w === "exhausted" ? we = Y(B) : we = x(L).results[B - 1].tally[w], ee.push(`${pe} has ${we} votes at round ${B}.`)); - const Fe = x(L).results[le - 1].tallyResults, Gt = ye(le); - for (let Mt = 0; Mt < Fe.length; Mt++) { - const Cn = Fe[Mt].transfers, pn = Fe[Mt].eliminated, He = Fe[Mt].elected; - if (!Gt) { + Is(() => re()); + function le(w, Y) { + return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; + } + function D(w, Y) { + const se = [], we = w === "exhausted" ? Pe() : w; + let ye; + w === "exhausted" ? ye = at(1) : ye = $(I).results[0].tally[w], se.push(`${we} started with ${ye} votes.`); + for (let ue = 1; ue <= Y; ue++) { + ue === Y && (w === "exhausted" ? ye = at(Y) : ye = $(I).results[Y - 1].tally[w], se.push(`${we} has ${ye} votes at round ${Y}.`)); + const Ve = $(I).results[ue - 1].tallyResults, Ut = de(ue); + for (let gt = 0; gt < Ve.length; gt++) { + const Rn = Ve[gt].transfers, pn = Ve[gt].eliminated, ze = Ve[gt].elected; + if (!Ut) { if (pn) - pn === w && ee.push(`${pe} will be eliminated on round ${le}.`); - else if (w === He && (ee.push(`${pe} ${x(d).event} on round ${le}.`), Cn)) - for (let [Me, et] of Object.entries(Cn)) - ee.push(`${et} ${oe(Number(et), le < B)} transferred to ${Me} on round ${le}.`); + pn === w && se.push(`${we} will be eliminated on round ${ue}.`); + else if (w === ze && (se.push(`${we} ${$(_).event} on round ${ue}.`), Rn)) + for (let [ot, _t] of Object.entries(Rn)) + se.push(`${_t} ${le(Number(_t), ue < Y)} transferred to ${ot} on round ${ue}.`); } - const Qe = pn || He; - if (Qe) { - const Me = Number(Cn[w]); - Me && ee.push(`${Me} ${oe(Me, le < B)} transferred from ${Qe} on round ${le}.`); + const kt = pn || ze; + if (kt) { + const ot = Number(Rn[w]); + ot && se.push(`${ot} ${le(ot, ue < Y)} transferred from ${kt} on round ${ue}.`); } } } - return [ee, pe]; + return [se, we]; } - function O() { + function H() { let w = 0; - for (let B = 1; B <= x(L).results.length; B++) { - if (ye(B)) continue; - const ee = x(L).results[B - 1].tallyResults; - for (let pe = 0; pe < ee.length; pe++) - ee[pe].elected && w++; + for (let Y = 1; Y <= $(I).results.length; Y++) { + if (de(Y)) continue; + const se = $(I).results[Y - 1].tallyResults; + for (let we = 0; we < se.length; we++) + se[we].elected && w++; } return w; } - let F, Ne = /* @__PURE__ */ $e(0); - function ft(w) { - var we; - return !((we = x(L)) != null && we.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((le) => le.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + let te, je = /* @__PURE__ */ $e(0); + function qe(w) { + var ye; + return !((ye = $(I)) != null && ye.results) || w < 1 || w > $(I).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [$(I).results[w - 1].tallyResults.some((ue) => ue.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function me(w) { - var ee; - if (!((ee = x(L)) != null && ee.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; - const B = x(L).results[w - 1].tallyResults; - return B.length === 0 || B.every((pe) => Object.keys(pe.transfers).length === 0); + function de(w) { + return u() && $(I).results && w === $(I).results.length; } - function ye(w) { - return l() && x(L).results && w === x(L).results.length; + function ce(w) { + return de(w) ? [] : te ? te.getEliminatedCandidates(w) : []; } - function te(w) { - return ye(w) ? [] : F ? F.getEliminatedCandidates(w) : []; + function _e(w) { + return de(w) ? [] : te ? te.getElectedCandidates(w) : []; } - function ke(w) { - return ye(w) ? [] : F ? F.getElectedCandidates(w) : []; + function at(w) { + return te ? te.countExhaustedVotes(w) : 0; } - function Y(w) { - return F ? F.countExhaustedVotes(w) : 0; + function G() { + te && te.animateOnePhaseFn && te.animateOnePhaseFn(); } - function Oe() { - F && F.animateOnePhaseFn && F.animateOnePhaseFn(); + function Pe() { + return te ? te.exhaustedLabel : ""; } function St() { - return F ? F.exhaustedLabel : ""; - } - function ie() { - return F ? F.pieColors : {}; + return te ? te.pieColors : {}; } - var Je = { + var Z = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), re(); + r(w), ne(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), re(); + i(w), ne(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(w = (B) => { + set requestRoundChange(w = (Y) => { }) { - s(w), re(); + s(w), ne(); }, - get candidateColors() { + get requestSkipToRound() { return a(); }, + set requestSkipToRound(w = (Y) => { + }) { + a(w), ne(); + }, + get candidateColors() { + return o(); + }, set candidateColors(w = []) { - a(w), re(); + o(w), ne(); }, get textForWinner() { - return o(); + return l(); }, set textForWinner(w = "elected") { - o(w), re(); + l(w), ne(); }, get excludeFinalWinnerAndEliminatedCandidate() { - return l(); + return u(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), re(); + u(w), ne(); }, get firstRoundDeterminesPercentages() { - return u(); + return f(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), re(); + f(w), ne(); }, get randomizeOrder() { - return f(); + return d(); }, set randomizeOrder(w = !1) { - f(w), re(); + d(w), ne(); }, get showCaptions() { - return p(); + return h(); }, set showCaptions(w = !1) { - p(w), re(); + h(w), ne(); } - }, yt = hp(), Ze = _n(yt), Tn = Xe(Ze); + }, hn = pp(), Ct = gn(hn), dn = Be(Ct); { - let w = /* @__PURE__ */ vn(() => ft(i())), B = /* @__PURE__ */ vn(() => me(i())); - xl(Tn, { + let w = /* @__PURE__ */ Sn(() => qe(i())); + bl(dn, { get labels() { - return x(w); + return $(w); }, get currentStep() { - return x(Ne); + return $(je); }, - get disabled() { - return x(B); - }, - onAdvance: Oe + disabled: !1, + onAdvance: G }); } - Le(Ze); - var ge = nt(Ze, 4), Nt = Xe(ge), Ut = Xe(Nt), jr = Xe(Ut); - gi( - wl(jr, { + Oe(Ct); + var Wt = Ze(Ct, 4), vt = Be(Wt), En = Be(vt), Je = Be(En); + pi( + xl(Je, { get jsonData() { - return x(L); + return $(I); }, get currentRound() { return i(); }, - requestRoundChange: ae, - get candidateColors() { + requestRoundChange: fe, + get requestSkipToRound() { return a(); }, + get candidateColors() { + return o(); + }, get excludeFinalWinnerAndEliminatedCandidate() { - return l(); + return u(); }, get firstRoundDeterminesPercentages() { - return u(); + return f(); }, get randomizeOrder() { - return f(); + return d(); }, get mouseEventType() { - return x(D); + return $(N); }, set mouseEventType(w) { - he(D, w, !0); + ve(N, w, !0); }, get mouseData() { - return x(M); + return $(M); }, set mouseData(w) { - he(M, w, !0); + ve(M, w, !0); }, get mouseX() { - return x(S); + return $(F); }, set mouseX(w) { - he(S, w, !0); + ve(F, w, !0); }, get mouseY() { - return x(I); + return $(W); }, set mouseY(w) { - he(I, w, !0); + ve(W, w, !0); }, get displayPhase() { - return x(Ne); + return $(je); }, set displayPhase(w) { - he(Ne, w, !0); + ve(je, w, !0); } }), - (w) => F = w, - () => F - ), Le(Ut), Le(Nt); - var Jr = nt(Nt, 2); + (w) => te = w, + () => te + ), Oe(En), Oe(vt); + var $r = Ze(vt, 2); { - var Zr = (w) => { - var B = fp(), ee = _n(B), pe = Xe(ee); - Le(ee); - var we = nt(ee, 2), le = Xe(we); + var Ar = (w) => { + var Y = hp(), se = gn(Y), we = Be(se); + Oe(se); + var ye = Ze(se, 2), ue = Be(ye); { - var Fe = (He) => { - var Qe = op(), Me = nt(_n(Qe)); - vi(Me, 17, () => te(i()), pi, (et, xe, tt) => { - var Ie = ap(), ct = _n(Ie); - let Pt; - var Zn = Xe(ct, !0); - Le(ct); - var Rn = nt(ct, 2); + var Ve = (ze) => { + var kt = up(), ot = Ze(gn(kt)); + di(ot, 17, () => ce(i()), hi, (_t, Mt, mt) => { + var xe = lp(), De = gn(xe); + let Ee; + var Gt = Be(De, !0); + Oe(De); + var Zn = Ze(De, 2); { - var _e = (Kt) => { - var jt = ga(", "); - Ue(Kt, jt); - }, $r = /* @__PURE__ */ vn(() => tt < te(i()).length - 1); - er(Rn, (Kt) => { - x($r) && Kt(_e); + var Er = (oe) => { + var Kt = _a(", "); + We(oe, Kt); + }, Qn = /* @__PURE__ */ Sn(() => mt < ce(i()).length - 1); + tr(Zn, (oe) => { + $(Qn) && oe(Er); }); } - Qt( - (Kt) => { - Pt = wa(ct, "", Pt, Kt), mn(Zn, x(xe)); + Zt( + (oe) => { + Ee = xa(De, "", Ee, oe), _n(Gt, $(Mt)); }, - [() => ({ color: ie()[x(xe)] })] - ), Ue(et, Ie); - }), Ue(He, Qe); - }, Gt = /* @__PURE__ */ vn(() => te(i()).length > 0); - er(le, (He) => { - x(Gt) && He(Fe); + [() => ({ color: St()[$(Mt)] })] + ), We(_t, xe); + }), We(ze, kt); + }, Ut = /* @__PURE__ */ Sn(() => ce(i()).length > 0); + tr(ue, (ze) => { + $(Ut) && ze(Ve); }); } - var Mt = nt(le, 2); + var gt = Ze(ue, 2); { - var Cn = (He) => { - var Qe = up(), Me = _n(Qe), et = nt(Me); - vi(et, 17, () => ke(i()), pi, (xe, tt, Ie) => { - var ct = lp(), Pt = _n(ct); - let Zn; - var Rn = Xe(Pt, !0); - Le(Pt); - var _e = nt(Pt, 2); + var Rn = (ze) => { + var kt = cp(), ot = gn(kt), _t = Ze(ot); + di(_t, 17, () => _e(i()), hi, (Mt, mt, xe) => { + var De = fp(), Ee = gn(De); + let Gt; + var Zn = Be(Ee, !0); + Oe(Ee); + var Er = Ze(Ee, 2); { - var $r = (jt) => { - var ei = ga(", "); - Ue(jt, ei); - }, Kt = /* @__PURE__ */ vn(() => Ie < ke(i()).length - 1); - er(_e, (jt) => { - x(Kt) && jt($r); + var Qn = (Kt) => { + var ji = _a(", "); + We(Kt, ji); + }, oe = /* @__PURE__ */ Sn(() => xe < _e(i()).length - 1); + tr(Er, (Kt) => { + $(oe) && Kt(Qn); }); } - Qt( - (jt) => { - Zn = wa(Pt, "", Zn, jt), mn(Rn, x(tt)); + Zt( + (Kt) => { + Gt = xa(Ee, "", Gt, Kt), _n(Zn, $(mt)); }, - [() => ({ color: ie()[x(tt)] })] - ), Ue(xe, ct); - }), Qt(() => mn(Me, `${x(d).caption ?? ""}: `)), Ue(He, Qe); - }, pn = /* @__PURE__ */ vn(() => ke(i()).length > 0); - er(Mt, (He) => { - x(pn) && He(Cn); + [() => ({ color: St()[$(mt)] })] + ), We(Mt, De); + }), Zt(() => _n(ot, `${$(_).caption ?? ""}: `)), We(ze, kt); + }, pn = /* @__PURE__ */ Sn(() => _e(i()).length > 0); + tr(gt, (ze) => { + $(pn) && ze(Rn); }); } - Le(we), Qt((He) => mn(pe, `${x(L).config.contest ?? ""}, ${He ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ue(w, B); + Oe(ye), Zt((ze) => _n(we, `${$(I).config.contest ?? ""}, ${ze ?? ""} ${$(_).infinitive ?? ""}, Round ${i() ?? ""}.`), [H]), We(w, Y); }; - er(Jr, (w) => { - p() && w(Zr); + tr($r, (w) => { + h() && w(Ar); }); } - Le(ge); - var Jn = nt(ge, 2), kt = Xe(Jn), ji = Xe(kt, !0); - Le(kt); - var Qr = nt(kt, 2); - vi(Qr, 17, () => x($), pi, (w, B) => { - var ee = cp(), pe = _n(ee), we = Xe(pe, !0); - Le(pe), us(2), Qt(() => mn(we, x(B))), Ue(w, ee); - }), Le(Jn), gi(Jn, (w) => he(y, w), () => x(y)); - var dn = nt(Jn, 2), br = Xe(dn); - return us(2), Le(dn), gi(dn, (w) => he(b, w), () => x(b)), Qt( + Oe(Wt); + var Tn = Ze(Wt, 2), Jn = Be(Tn), Zr = Be(Jn, !0); + Oe(Jn); + var Gi = Ze(Jn, 2); + di(Gi, 17, () => $(O), hi, (w, Y) => { + var se = dp(), we = gn(se), ye = Be(we, !0); + Oe(we), us(2), Zt(() => _n(ye, $(Y))), We(w, se); + }), Oe(Tn), pi(Tn, (w) => ve(x, w), () => $(x)); + var Nt = Ze(Tn, 2), Ki = Be(Nt); + return us(2), Oe(Nt), pi(Nt, (w) => ve(y, w), () => $(y)), Zt( (w) => { - mn(ji, x(m)), mn(br, `"${w ?? ""}" means all the candidates ranked on `); + _n(Zr, $(b)), _n(Ki, `"${w ?? ""}" means all the candidates ranked on `); }, - [St] - ), Ue(e, yt), Hi(Je); + [Pe] + ), We(e, hn), Vi(Z); } customElements.define("pie-chart", Ys( - pp, + gp, { electionSummary: {}, currentRound: {}, requestRoundChange: {}, + requestSkipToRound: {}, candidateColors: {}, textForWinner: {}, excludeFinalWinnerAndEliminatedCandidate: {}, diff --git a/static/visualizer/round-player.js b/static/visualizer/round-player.js index 14914706..e705b7de 100644 --- a/static/visualizer/round-player.js +++ b/static/visualizer/round-player.js @@ -134,6 +134,14 @@ function RoundPlayer({ changeStep(step); } + // Jump to a step immediately without stopping playback. + // Used to skip no-transfer rounds during animation. + function skipToStep(step) { + window.clearTimeout(timer); + changeStep(step); + if (isPlaying) nextStep(stepTimeMs); + } + function nextStep(currStepTimeMs) { if (!isPlaying) return; @@ -148,7 +156,8 @@ function RoundPlayer({ isPlaying = true; container.querySelector(".round-player-play-btn").innerText = "Stop"; changeStep(0); - nextStep(firstStepTimeMs); + // First step fires immediately — the timer delay is for between steps + nextStep(0); } function stop() { @@ -168,5 +177,5 @@ function RoundPlayer({ init(); - return { play, stop, setStep, setTimeBetweenStepsMs, playing }; + return { play, stop, setStep, skipToStep, setTimeBetweenStepsMs, playing }; } diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index e18da237..bcc667c1 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -24,6 +24,7 @@ // So we don't have to re-stringify the JSON object, which will be immediately parsed again, // we can just bind it in object form here. pieChart.requestRoundChange = updateRound; + pieChart.requestSkipToRound = skipToRound; pieChart.electionSummary = electionSummary; pieChart.candidateColors = candidateColors; pieChart.textForWinner = "{{ textForWinner }}"; @@ -40,7 +41,6 @@ totalRounds: {{ config.numRounds }}, onChange: updatePieChartRound, timeBetweenStepsMs: 3000, - firstStepHoldTimeMs: 500, }); function updatePieChartRound(sliderIndex) { @@ -55,4 +55,11 @@ pieRoundPlayer.setStep(roundNum - 1); } + // Skip to a round immediately without stopping playback. + // Used to skip no-transfer rounds during animation. + function skipToRound(roundNum) { + pieChart.currentRound = roundNum; + pieRoundPlayer.skipToStep(roundNum - 1); + } +